acpi: switch to debug logging
This commit is contained in:
parent
1799cb5abf
commit
805650c7b1
1 changed files with 12 additions and 5 deletions
17
init/acpi.c
17
init/acpi.c
|
|
@ -13,10 +13,13 @@ struct limine_rsdp_request rsdp_req = { .id = LIMINE_RSDP_REQUEST, .revision = 0
|
|||
static struct rsdp *rsdp = NULL;
|
||||
struct madt *__madt = NULL;
|
||||
|
||||
void rsdt_print(struct rsdt *rsdt)
|
||||
static void rsdt_parse(struct rsdt *rsdt)
|
||||
{
|
||||
int num_sdt = (rsdt->h.length - sizeof(rsdt->h)) >> 2;
|
||||
printf(LOG_INFO "Number of RSDT entries: %d\n", num_sdt);
|
||||
|
||||
#ifdef KDEBUG
|
||||
printf(LOG_DEBUG "Number of RSDT entries: %d\n", num_sdt);
|
||||
#endif /* KDEBUG */
|
||||
|
||||
for (int i = 0; i < num_sdt; i++) {
|
||||
/* 2 steps silences warning */
|
||||
|
|
@ -27,9 +30,11 @@ void rsdt_print(struct rsdt *rsdt)
|
|||
__madt = (struct madt *)h;
|
||||
}
|
||||
|
||||
#ifdef KDEBUG
|
||||
char buf[8] = { 0 };
|
||||
memcpy(buf, h->signature, 4);
|
||||
printf(LOG_INFO "RSDT entry: %s %d %x \n", buf, h->revision, h->checksum);
|
||||
printf(LOG_DEBUG "RSDT entry: %s %d %x \n", buf, h->revision, h->checksum);
|
||||
#endif /* KDEBUG */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -40,8 +45,10 @@ void acpi_init()
|
|||
/* 2 steps silences warning */
|
||||
uintptr_t rsdt_addr = (uintptr_t)(rsdp->rsdt_addr | hhdm_start);
|
||||
struct rsdt *rsdt = (struct rsdt *)rsdt_addr;
|
||||
rsdt_print(rsdt);
|
||||
rsdt_parse(rsdt);
|
||||
|
||||
printf(LOG_INFO "ACPI version: %d\n", rsdp->revision);
|
||||
#ifdef KDEBUG
|
||||
printf(LOG_DEBUG "ACPI version: %d\n", rsdp->revision);
|
||||
#endif /* KDEBUG */
|
||||
printf(LOG_SUCCESS "ACPI initialized\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue