summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/Osd/OsdTable.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/acpica/Osd/OsdTable.c')
-rw-r--r--sys/dev/acpica/Osd/OsdTable.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/acpica/Osd/OsdTable.c b/sys/dev/acpica/Osd/OsdTable.c
index 58c01cd..f24c5ea 100644
--- a/sys/dev/acpica/Osd/OsdTable.c
+++ b/sys/dev/acpica/Osd/OsdTable.c
@@ -38,6 +38,26 @@
#undef _COMPONENT
#define _COMPONENT ACPI_TABLES
+static char acpi_os_name[128];
+
+ACPI_STATUS
+AcpiOsPredefinedOverride (
+ const ACPI_PREDEFINED_NAMES *InitVal,
+ ACPI_STRING *NewVal)
+{
+ if (InitVal == NULL || NewVal == NULL)
+ return(AE_BAD_PARAMETER);
+
+ *NewVal = NULL;
+ if (strncmp(InitVal->Name, "_OS_", 4) == 0 &&
+ getenv_string("hw.acpi.os_name", acpi_os_name, sizeof(acpi_os_name))) {
+ printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_os_name);
+ *NewVal = acpi_os_name;
+ }
+
+ return(AE_OK);
+}
+
ACPI_STATUS
AcpiOsTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
OpenPOWER on IntegriCloud