summaryrefslogtreecommitdiff
path: root/kernel/mboot/rsdp.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-08 11:49:51 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-08 11:49:51 -0400
commit76ea83e70c5c852de9efdf857f6ee95be7d6e6c8 (patch)
tree0f00ac8591bc2978b0f4e82cf23033f4a677f306 /kernel/mboot/rsdp.c
parentfix old checkout (diff)
downloadcomus-76ea83e70c5c852de9efdf857f6ee95be7d6e6c8.tar.gz
comus-76ea83e70c5c852de9efdf857f6ee95be7d6e6c8.tar.bz2
comus-76ea83e70c5c852de9efdf857f6ee95be7d6e6c8.zip
acpi
Diffstat (limited to 'kernel/mboot/rsdp.c')
-rw-r--r--kernel/mboot/rsdp.c25
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;
+}