ACPI_STATUS AcpiOsActualTableOverride ( ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { #ifndef ACPI_EXEC_APP char TableName[ACPI_NAME_SIZE + 1]; #endif if (!ExistingTable || !NewTable) { return (AE_BAD_PARAMETER); } *NewTable = NULL; #ifdef ACPI_EXEC_APP /* This code exercises the table override mechanism in the core */ #ifdef OBSOLETE_CODE if (ACPI_COMPARE_NAME (ExistingTable->Signature, ACPI_SIG_DSDT)) { /* override DSDT with itself */ *NewTable = AcpiGbl_DbTablePtr; } #endif #else /* Construct a null-terminated string from table signature */ TableName[ACPI_NAME_SIZE] = 0; ACPI_STRNCPY (TableName, ExistingTable->Signature, ACPI_NAME_SIZE); *NewTable = OsGetTable (TableName); if (*NewTable) { AcpiOsPrintf ("%s obtained from registry, %d bytes\n", TableName, (*NewTable)->Length); } else { AcpiOsPrintf ("Could not read %s from registry\n", TableName); } #endif return (AE_OK); }
ACPI_STATUS AcpiOsTableOverride ( ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { if (!ExistingTable || !NewTable) { return (AE_BAD_PARAMETER); } *NewTable = NULL; #ifdef ACPI_EXEC_APP /* Call back up to AcpiExec */ AeTableOverride (ExistingTable, NewTable); #endif #ifdef ACPI_ASL_COMPILER /* Attempt to get the table from the registry */ /* Construct a null-terminated string from table signature */ TableName[ACPI_NAME_SIZE] = 0; ACPI_STRNCPY (TableName, ExistingTable->Signature, ACPI_NAME_SIZE); *NewTable = OsGetTable (TableName); if (*NewTable) { AcpiOsPrintf ("Table [%s] obtained from registry, %u bytes\n", TableName, (*NewTable)->Length); } else { AcpiOsPrintf ("Could not read table %s from registry\n", TableName); } #endif return (AE_OK); }