From 805650c7b164d007d821d214c30164c960ba4595 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Thu, 4 May 2023 15:38:40 -0400 Subject: [PATCH] acpi: switch to debug logging --- init/acpi.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/init/acpi.c b/init/acpi.c index 20bf34a..096db7d 100644 --- a/init/acpi.c +++ b/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"); }