diff options
Diffstat (limited to 'kernel/mboot/rsdp.c')
-rw-r--r-- | kernel/mboot/rsdp.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 <lib.h> +#include <comus/mboot.h> + +#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; +} |