From 76ea83e70c5c852de9efdf857f6ee95be7d6e6c8 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 8 Apr 2025 11:49:51 -0400 Subject: acpi --- kernel/mboot/rsdp.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 kernel/mboot/rsdp.c (limited to 'kernel/mboot/rsdp.c') diff --git a/kernel/mboot/rsdp.c b/kernel/mboot/rsdp.c new file mode 100644 index 0000000..fb49187 --- /dev/null +++ b/kernel/mboot/rsdp.c @@ -0,0 +1,25 @@ +#include +#include + +#include "mboot.h" + +void *mboot_get_rsdp(void) +{ + void *tag; + + // acpi 2.0 + tag = locate_mboot_table(MBOOT_NEW_RSDP); + if (tag != NULL) { + struct mboot_tag_new_rsdp *rsdp = (struct mboot_tag_new_rsdp *) tag; + return rsdp->rsdp; + } + + // acpi 1.0 + tag = locate_mboot_table(MBOOT_OLD_RSDP); + if (tag != NULL) { + struct mboot_tag_old_rsdp *rsdp = (struct mboot_tag_old_rsdp *) tag; + return rsdp->rsdp; + } + + return NULL; +} -- cgit v1.2.3-freya