diff options
author | Ian Moffett <ian@osmora.org> | 2025-04-17 00:47:03 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-04-17 00:47:03 -0400 |
commit | 39889716282dc6d3e5259cf61e8a36eaab7b497c (patch) | |
tree | 0ff1641cef3bdc67a086c8c0d1ad9d47017be51c /sys/dev | |
parent | be63b6e102a617a048160c42c84ef46fa38e6aad (diff) |
kernel: acpi: Add acpi_oemid()
acpi_oemid() can be useful for knowing the vendor of the current
machine.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/acpi_init.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/acpi/acpi_init.c b/sys/dev/acpi/acpi_init.c index bc8be77..ecfb129 100644 --- a/sys/dev/acpi/acpi_init.c +++ b/sys/dev/acpi/acpi_init.c @@ -36,12 +36,14 @@ #include <dev/acpi/acpivar.h> #include <dev/pci/pci.h> #include <vm/vm.h> +#include <string.h> #if defined(__x86_64__) #include <machine/hpet.h> #endif /* __x86_64__ */ #define pr_trace(fmt, ...) kprintf("acpi: " fmt, ##__VA_ARGS__) +static char oemid[OEMID_SIZE]; static struct acpi_root_sdt *root_sdt = NULL; static size_t root_sdt_entries = 0; static volatile struct limine_rsdp_request rsdp_req = { @@ -91,6 +93,12 @@ acpi_get_root_sdt_len(void) return root_sdt_entries; } +const char * +acpi_oemid(void) +{ + return oemid; +} + void acpi_init(void) { @@ -103,6 +111,7 @@ acpi_init(void) /* Fetch the RSDP */ rsdp = rsdp_req.response->address; acpi_print_oemid("RSDP", rsdp->oemid); + memcpy(oemid, rsdp->oemid, OEMID_SIZE); /* Fetch the root SDT */ if (rsdp->revision >= 2) { |