diff options
Diffstat (limited to 'kernel/drivers')
-rw-r--r-- | kernel/drivers/acpi.c | 37 | ||||
-rw-r--r-- | kernel/drivers/pci.c | 4 |
2 files changed, 37 insertions, 4 deletions
diff --git a/kernel/drivers/acpi.c b/kernel/drivers/acpi.c index bd9fe54..41f7ba1 100644 --- a/kernel/drivers/acpi.c +++ b/kernel/drivers/acpi.c @@ -1,7 +1,9 @@ +#include "lib/kio.h" #include <lib.h> #include <comus/drivers/acpi.h> #include <comus/asm.h> #include <comus/memory.h> +#include <stdint.h> struct acpi_header { uint32_t signature; @@ -295,7 +297,6 @@ static void acpi_load_table(uint64_t addr) kunmapaddr(mapped); return; } - kprintf("%.*s: %#016lx\n", 4, (char *)&mapped->signature, (size_t)temp); acpi_handle_table(mapped); } @@ -311,20 +312,48 @@ void acpi_init(void *rootsdp) } if (rsdp->revision == 0) { state.version = 0; - kprintf("ACPI 1.0\n"); acpi_load_table(rsdp->rsdt_addr); } else if (rsdp->revision == 2) { state.version = 2; struct xsdp *xsdp = (struct xsdp *)rsdp; - kprintf("ACPI 2.0\n"); acpi_load_table(xsdp->xsdt_addr); } else { panic("invalid acpi rev: %d\n", rsdp->revision); } - kprintf("\n"); outb(state.fadt->smi_command_port, state.fadt->acpi_enable); } +void acpi_report(void) +{ + if (state.version == 0) { + kprintf("ACPI 1.0\n"); + kprintf("%.*s: %#016lx\n", 4, (char *) &state.sdt.rsdt->h.signature, + (uintptr_t) state.sdt.rsdt); + } else { + kprintf("ACPI 2.0\n"); + kprintf("%.*s: %#016lx\n", 4, (char *) &state.sdt.xsdt->h.signature, + (uintptr_t) state.sdt.xsdt); + } + + if (state.fadt) + kprintf("%.*s: %#016lx\n", 4, (char *) &state.fadt->h.signature, + (uintptr_t) state.fadt); + if (state.dsdt) + kprintf("%.*s: %#016lx\n", 4, (char *) &state.dsdt->h.signature, + (uintptr_t) state.dsdt); + if (state.apic) + kprintf("%.*s: %#016lx\n", 4, (char *) &state.apic->h.signature, + (uintptr_t) state.apic); + if (state.hept) + kprintf("%.*s: %#016lx\n", 4, (char *) &state.hept->h.signature, + (uintptr_t) state.hept); + if (state.waet) + kprintf("%.*s: %#016lx\n", 4, (char *) &state.waet->h.signature, + (uintptr_t) state.waet); + + kprintf("\n"); +} + void acpi_shutdown(void) { outw((unsigned int)state.fadt->pm1_a_control_block, diff --git a/kernel/drivers/pci.c b/kernel/drivers/pci.c index e84ca11..ce2583f 100644 --- a/kernel/drivers/pci.c +++ b/kernel/drivers/pci.c @@ -134,6 +134,10 @@ void pci_init(void) } } } +} + +void pci_report(void) +{ kprintf("PCI DEVICES\n"); for (size_t i = 0; i < pci_table_next; i++) { print_device(&pci_table[i]); |