1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:27:43 +00:00

Kernel: Clean up some PATA log messages

This commit is contained in:
Conrad Pankoff 2019-08-11 14:58:21 +10:00 committed by Andreas Kling
parent f6dd76b915
commit 2267b3bd72

View file

@ -116,7 +116,7 @@ void PATAChannel::initialize()
PCI::enumerate_all([this](const PCI::Address& address, PCI::ID id) { PCI::enumerate_all([this](const PCI::Address& address, PCI::ID id) {
if (id == piix3_ide_id || id == piix4_ide_id) { if (id == piix3_ide_id || id == piix4_ide_id) {
m_pci_address = address; m_pci_address = address;
kprintf("PIIX%u PATA Controller found!\n", id == piix3_ide_id ? 3 : 4); kprintf("PATAChannel: PIIX%u PATA Controller found!\n", id == piix3_ide_id ? 3 : 4);
} }
}); });
@ -126,13 +126,13 @@ void PATAChannel::initialize()
PCI::enable_bus_mastering(m_pci_address); PCI::enable_bus_mastering(m_pci_address);
m_bus_master_base = PCI::get_BAR4(m_pci_address) & 0xfffc; m_bus_master_base = PCI::get_BAR4(m_pci_address) & 0xfffc;
m_dma_buffer_page = MM.allocate_supervisor_physical_page(); m_dma_buffer_page = MM.allocate_supervisor_physical_page();
dbgprintf("PIIX Bus master IDE: I/O @ %x\n", m_bus_master_base); kprintf("PATAChannel: PIIX Bus master IDE: I/O @ %x\n", m_bus_master_base);
} }
} }
static void print_ide_status(u8 status) static void print_ide_status(u8 status)
{ {
kprintf("DRQ=%u BSY=%u DRDY=%u DSC=%u DF=%u CORR=%u IDX=%u ERR=%u\n", kprintf("PATAChannel: print_ide_status: DRQ=%u BSY=%u DRDY=%u DSC=%u DF=%u CORR=%u IDX=%u ERR=%u\n",
(status & ATA_SR_DRQ) != 0, (status & ATA_SR_DRQ) != 0,
(status & ATA_SR_BSY) != 0, (status & ATA_SR_BSY) != 0,
(status & ATA_SR_DRDY) != 0, (status & ATA_SR_DRDY) != 0,
@ -146,14 +146,14 @@ static void print_ide_status(u8 status)
bool PATAChannel::wait_for_irq() bool PATAChannel::wait_for_irq()
{ {
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
kprintf("PATA: waiting for IRQ %d...\n", irq_number()); kprintf("PATAChannel: waiting for IRQ %d...\n", irq_number());
#endif #endif
while (!m_interrupted) { while (!m_interrupted) {
// FIXME: Put this process into a Blocked state instead, it's stupid to wake up just to check a flag. // FIXME: Put this process into a Blocked state instead, it's stupid to wake up just to check a flag.
Scheduler::yield(); Scheduler::yield();
} }
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
kprintf("PATA: received IRQ %d!\n", irq_number()); kprintf("PATAChannel: received IRQ %d!\n", irq_number());
#endif #endif
return true; return true;
@ -165,12 +165,12 @@ void PATAChannel::handle_irq()
if (status & ATA_SR_ERR) { if (status & ATA_SR_ERR) {
print_ide_status(status); print_ide_status(status);
m_device_error = IO::in8(m_io_base + ATA_REG_ERROR); m_device_error = IO::in8(m_io_base + ATA_REG_ERROR);
kprintf("PATADiskDevice: Error %b!\n", m_device_error); kprintf("PATAChannel: Error %b!\n", m_device_error);
} else { } else {
m_device_error = 0; m_device_error = 0;
} }
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
kprintf("disk:interrupt: DRQ=%u BSY=%u DRDY=%u\n", (status & ATA_SR_DRQ) != 0, (status & ATA_SR_BSY) != 0, (status & ATA_SR_DRDY) != 0); kprintf("PATAChannel: interrupt: DRQ=%u BSY=%u DRDY=%u\n", (status & ATA_SR_DRQ) != 0, (status & ATA_SR_BSY) != 0, (status & ATA_SR_DRDY) != 0);
#endif #endif
m_interrupted = true; m_interrupted = true;
} }
@ -203,7 +203,7 @@ void PATAChannel::detect_disks()
if (IO::in8(m_io_base + ATA_REG_STATUS) == 0x00) { if (IO::in8(m_io_base + ATA_REG_STATUS) == 0x00) {
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
kprintf("PATA: No %s disk detected!\n", (i == 0 ? "master" : "slave")); kprintf("PATAChannel: No %s disk detected!\n", (i == 0 ? "master" : "slave"));
#endif #endif
continue; continue;
} }
@ -230,7 +230,7 @@ void PATAChannel::detect_disks()
u8 spt = wbufbase[6]; u8 spt = wbufbase[6];
kprintf( kprintf(
"PATADiskDevice: Name=\"%s\", C/H/Spt=%u/%u/%u\n", "PATAChannel: Name=\"%s\", C/H/Spt=%u/%u/%u\n",
bbuf.pointer() + 54, bbuf.pointer() + 54,
cyls, cyls,
heads, heads,
@ -251,7 +251,7 @@ bool PATAChannel::ata_read_sectors_with_dma(u32 lba, u16 count, u8* outbuf, bool
{ {
LOCKER(s_lock()); LOCKER(s_lock());
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
dbgprintf("%s(%u): PATADiskDevice::read_sectors_with_dma (%u x%u) -> %p\n", kprintf("%s(%u): PATAChannel::ata_read_sectors_with_dma (%u x%u) -> %p\n",
current->process().name().characters(), current->process().name().characters(),
current->pid(), lba, count, outbuf); current->pid(), lba, count, outbuf);
#endif #endif
@ -330,7 +330,7 @@ bool PATAChannel::ata_write_sectors_with_dma(u32 lba, u16 count, const u8* inbuf
{ {
LOCKER(s_lock()); LOCKER(s_lock());
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
dbgprintf("%s(%u): PATADiskDevice::write_sectors_with_dma (%u x%u) <- %p\n", kprintf("%s(%u): PATAChannel::ata_write_sectors_with_dma (%u x%u) <- %p\n",
current->process().name().characters(), current->process().name().characters(),
current->pid(), lba, count, inbuf); current->pid(), lba, count, inbuf);
#endif #endif
@ -407,10 +407,12 @@ bool PATAChannel::ata_read_sectors(u32 start_sector, u16 count, u8* outbuf, bool
ASSERT(count <= 256); ASSERT(count <= 256);
LOCKER(s_lock()); LOCKER(s_lock());
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
dbgprintf("%s: Disk::read_sectors request (%u sector(s) @ %u)\n", kprintf("%s(%u): PATAChannel::ata_read_sectors request (%u sector(s) @ %u into %p)\n",
current->process().name().characters(), current->process().name().characters(),
current->pid(),
count, count,
start_sector); start_sector,
outbuf);
#endif #endif
disable_irq(); disable_irq();
@ -418,7 +420,7 @@ bool PATAChannel::ata_read_sectors(u32 start_sector, u16 count, u8* outbuf, bool
; ;
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
kprintf("PATADiskDevice: Reading %u sector(s) @ LBA %u\n", count, start_sector); kprintf("PATAChannel: Reading %u sector(s) @ LBA %u\n", count, start_sector);
#endif #endif
u8 devsel = 0xe0; u8 devsel = 0xe0;
@ -466,7 +468,7 @@ bool PATAChannel::ata_write_sectors(u32 start_sector, u16 count, const u8* inbuf
ASSERT(count <= 256); ASSERT(count <= 256);
LOCKER(s_lock()); LOCKER(s_lock());
#ifdef PATA_DEBUG #ifdef PATA_DEBUG
dbgprintf("%s(%u): PATADiskDevice::write_sectors request (%u sector(s) @ %u)\n", kprintf("%s(%u): PATAChannel::ata_write_sectors request (%u sector(s) @ %u)\n",
current->process().name().characters(), current->process().name().characters(),
current->pid(), current->pid(),
count, count,
@ -477,7 +479,9 @@ bool PATAChannel::ata_write_sectors(u32 start_sector, u16 count, const u8* inbuf
while (IO::in8(m_io_base + ATA_REG_STATUS) & ATA_SR_BSY) while (IO::in8(m_io_base + ATA_REG_STATUS) & ATA_SR_BSY)
; ;
//dbgprintf("PATADiskDevice: Writing %u sector(s) @ LBA %u\n", count, start_sector); #ifdef PATA_DEBUG
kprintf("PATAChannel: Writing %u sector(s) @ LBA %u\n", count, start_sector);
#endif
u8 devsel = 0xe0; u8 devsel = 0xe0;
if (slave_request) if (slave_request)