summaryrefslogtreecommitdiff
path: root/kernel/drivers
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-06-17 22:07:38 +0200
committerAnton Kling <anton@kling.gg>2024-06-17 22:07:38 +0200
commitf209faffab90186cd88cd0a2fe2cc6236bb53e15 (patch)
tree68194363c25900f5d349c8ae34d42be9ae638df8 /kernel/drivers
parent08d0b7eee74b9f345241faad460d145bb0454736 (diff)
Reorganize logging code
Diffstat (limited to 'kernel/drivers')
-rw-r--r--kernel/drivers/ahci.c8
-rw-r--r--kernel/drivers/ata.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/kernel/drivers/ahci.c b/kernel/drivers/ahci.c
index 34de443..22468ff 100644
--- a/kernel/drivers/ahci.c
+++ b/kernel/drivers/ahci.c
@@ -313,7 +313,7 @@ u8 ahci_perform_command(volatile struct HBA_PORT *port, u32 startl, u32 starth,
u8 err;
u32 command_slot = get_free_command_slot(port, &err);
if (err) {
- klog("AHCI No command slot found", LOG_WARN);
+ klog(LOG_WARN, "AHCI No command slot found");
return 0;
}
struct HBA_CMD_HEADER *cmdheader =
@@ -373,7 +373,7 @@ u8 ahci_perform_command(volatile struct HBA_PORT *port, u32 startl, u32 starth,
spin++;
}
if (spin == 10000) {
- klog("AHCI port is hung", LOG_ERROR);
+ klog(LOG_ERROR, "AHCI port is hung");
return 0;
}
@@ -387,14 +387,14 @@ u8 ahci_perform_command(volatile struct HBA_PORT *port, u32 startl, u32 starth,
break;
}
if (port->is & HBA_PxIS_TFES) {
- klog("AHCI command failed", LOG_ERROR);
+ klog(LOG_ERROR, "AHCI command failed");
return 0;
}
}
// Check again
if (port->is & HBA_PxIS_TFES) {
- klog("AHCI command failed", LOG_ERROR);
+ klog(LOG_ERROR, "AHCI command failed");
return 0;
}
diff --git a/kernel/drivers/ata.c b/kernel/drivers/ata.c
index 0537f6e..9116da9 100644
--- a/kernel/drivers/ata.c
+++ b/kernel/drivers/ata.c
@@ -56,7 +56,7 @@ int identify(int master_slave) {
// non-zero. If so, the drive is not ATA, and we
// should stop polling.
if (0 != inb(io_base + LBAmid) || 0 != inb(io_base + LBAhi)) {
- klog("Drive is not ATA.", LOG_ERROR);
+ klog(LOG_ERROR, "Drive is not ATA.");
return -1;
}
@@ -64,7 +64,7 @@ int identify(int master_slave) {
status = inb(io_base + STATUS_PORT);
if (1 == (status & STATUS_ERR)) {
- klog("Drive ERR set.", LOG_ERROR);
+ klog(LOG_ERROR, "Drive ERR set.");
return -2;
}
@@ -95,7 +95,7 @@ int poll_status(void) {
// ERR or
// DF sets
if ((status & STATUS_ERR) || (status & STATUS_DF)) {
- klog("Drive error set.", LOG_ERROR);
+ klog(LOG_ERROR, "Drive error set.");
return 0;
}
@@ -205,7 +205,7 @@ void ata_init(void) {
// 0xFF is an illegal status value, and
// indicates that the bus has no drives
if (0xFF == inb(io_base + STATUS_PORT)) {
- klog("Bus has no drives", LOG_ERROR);
+ klog(LOG_ERROR, "Bus has no drives");
}
// Issue IDENTIFY command