diff options
Diffstat (limited to 'sys/dev/acpica/Osd/OsdTable.c')
-rw-r--r-- | sys/dev/acpica/Osd/OsdTable.c | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/sys/dev/acpica/Osd/OsdTable.c b/sys/dev/acpica/Osd/OsdTable.c index da220e5..f9f60df 100644 --- a/sys/dev/acpica/Osd/OsdTable.c +++ b/sys/dev/acpica/Osd/OsdTable.c @@ -50,51 +50,49 @@ 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_", ACPI_NAME_SIZE) == 0 && - strlen(acpi_osname) > 0) { - printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_osname); - *NewVal = acpi_osname; - } - - return (AE_OK); + if (InitVal == NULL || NewVal == NULL) + return (AE_BAD_PARAMETER); + + *NewVal = NULL; + if (strncmp(InitVal->Name, "_OS_", ACPI_NAME_SIZE) == 0 && + strlen(acpi_osname) > 0) { + printf("ACPI: Overriding _OS definition with \"%s\"\n", + acpi_osname); + *NewVal = acpi_osname; + } + return (AE_OK); } ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { - char modname[] = "acpi_dsdt"; - caddr_t acpi_table; - ACPI_TABLE_HEADER *hdr; - size_t sz; + char modname[] = "acpi_dsdt"; + caddr_t acpi_table; + ACPI_TABLE_HEADER *hdr; + size_t sz; - if (ExistingTable == NULL || NewTable == NULL) - return (AE_BAD_PARAMETER); + if (ExistingTable == NULL || NewTable == NULL) + return (AE_BAD_PARAMETER); - *NewTable = NULL; + *NewTable = NULL; #ifdef notyet - for (int i = 0; i < ACPI_NAME_SIZE; i++) - modname[i + 5] = tolower(ExistingTable->Signature[i]); + for (int i = 0; i < ACPI_NAME_SIZE; i++) + modname[i + 5] = tolower(ExistingTable->Signature[i]); #else - /* If we're not overriding the DSDT, just return. */ - if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, ACPI_NAME_SIZE) != 0) - return (AE_OK); + /* If we're not overriding the DSDT, just return. */ + if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, + ACPI_NAME_SIZE) != 0) + return (AE_OK); #endif - - acpi_table = preload_search_by_type(modname); - if (acpi_table == NULL) + acpi_table = preload_search_by_type(modname); + if (acpi_table == NULL) + return (AE_OK); + hdr = preload_fetch_addr(acpi_table); + sz = preload_fetch_size(acpi_table); + if (hdr != NULL && sz != 0) + *NewTable = hdr; return (AE_OK); - - hdr = preload_fetch_addr(acpi_table); - sz = preload_fetch_size(acpi_table); - if (hdr != NULL && sz != 0) - *NewTable = hdr; - - return (AE_OK); } ACPI_STATUS |