Add fixes for FreeBSD build that were submitted upstream.

This commit is contained in:
Jung-uk Kim 2007-03-22 17:36:29 +00:00
parent 1a39cfb03c
commit 6976fc7f02
5 changed files with 22 additions and 6 deletions

View File

@ -176,7 +176,7 @@
/* Always use FreeBSD code over our local versions */ /* Always use FreeBSD code over our local versions */
#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_SYSTEM_CLIBRARY
#ifdef _KERNEL #if defined(_KERNEL) && (__FreeBSD_version < 700020)
/* Or strstr (used in debugging mode, also move to libkern) */ /* Or strstr (used in debugging mode, also move to libkern) */
static __inline char * static __inline char *
strstr (char *s, char *find) strstr (char *s, char *find)

View File

@ -141,9 +141,11 @@ AcpiDbClassifyOneObject (
void *Context, void *Context,
void **ReturnValue); void **ReturnValue);
#if defined ACPI_DBG_TRACK_ALLOCATIONS || defined ACPI_USE_LOCAL_CACHE
static void static void
AcpiDbListInfo ( AcpiDbListInfo (
ACPI_MEMORY_LIST *List); ACPI_MEMORY_LIST *List);
#endif
/* /*
@ -522,17 +524,18 @@ AcpiDbDisplayStatistics (
case CMD_STAT_MEMORY: case CMD_STAT_MEMORY:
#ifdef ACPI_DBG_TRACK_ALLOCATIONS #ifdef ACPI_DBG_TRACK_ALLOCATIONS
AcpiOsPrintf ("\n----Object and Cache Statistics (all in hex)---------\n"); AcpiOsPrintf ("\n----Object Statistics (all in hex)---------\n");
AcpiDbListInfo (AcpiGbl_GlobalList); AcpiDbListInfo (AcpiGbl_GlobalList);
AcpiDbListInfo (AcpiGbl_NsNodeList); AcpiDbListInfo (AcpiGbl_NsNodeList);
#endif
#ifdef ACPI_USE_LOCAL_CACHE #ifdef ACPI_USE_LOCAL_CACHE
AcpiOsPrintf ("\n----Cache Statistics (all in hex)----------\n");
AcpiDbListInfo (AcpiGbl_OperandCache); AcpiDbListInfo (AcpiGbl_OperandCache);
AcpiDbListInfo (AcpiGbl_PsNodeCache); AcpiDbListInfo (AcpiGbl_PsNodeCache);
AcpiDbListInfo (AcpiGbl_PsNodeExtCache); AcpiDbListInfo (AcpiGbl_PsNodeExtCache);
AcpiDbListInfo (AcpiGbl_StateCache); AcpiDbListInfo (AcpiGbl_StateCache);
#endif
#endif #endif
break; break;

View File

@ -211,7 +211,8 @@ AcpiNsOneCompleteParse (
/* Parse the AML */ /* Parse the AML */
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", PassNumber)); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %lu parse\n",
(unsigned long) PassNumber));
Status = AcpiPsParseAml (WalkState); Status = AcpiPsParseAml (WalkState);
AcpiPsDeleteParseTree (ParseRoot); AcpiPsDeleteParseTree (ParseRoot);

View File

@ -320,7 +320,7 @@ AcpiTbCreateLocalFadt (
if (Length > sizeof (ACPI_TABLE_FADT)) if (Length > sizeof (ACPI_TABLE_FADT))
{ {
ACPI_WARNING ((AE_INFO, ACPI_WARNING ((AE_INFO,
"FADT (revision %u) is longer than ACPI 2.0 version, truncating length 0x%X to 0x%X", "FADT (revision %u) is longer than ACPI 2.0 version, truncating length 0x%X to 0x%zX",
Table->Revision, Length, sizeof (ACPI_TABLE_FADT))); Table->Revision, Length, sizeof (ACPI_TABLE_FADT)));
} }

View File

@ -535,6 +535,7 @@ AcpiTbLoadNamespace (
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_TABLE_HEADER *Table; ACPI_TABLE_HEADER *Table;
ACPI_NATIVE_UINT i; ACPI_NATIVE_UINT i;
BOOLEAN DsdtOverriden;
ACPI_FUNCTION_TRACE (TbLoadNamespace); ACPI_FUNCTION_TRACE (TbLoadNamespace);
@ -558,6 +559,7 @@ AcpiTbLoadNamespace (
/* /*
* Find DSDT table * Find DSDT table
*/ */
DsdtOverriden = FALSE;
Status = AcpiOsTableOverride ( Status = AcpiOsTableOverride (
AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer, &Table); AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer, &Table);
if (ACPI_SUCCESS (Status) && Table) if (ACPI_SUCCESS (Status) && Table)
@ -569,6 +571,7 @@ AcpiTbLoadNamespace (
AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer = Table; AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer = Table;
AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Length = Table->Length; AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Length = Table->Length;
AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Flags = ACPI_TABLE_ORIGIN_UNKNOWN; AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Flags = ACPI_TABLE_ORIGIN_UNKNOWN;
DsdtOverriden = TRUE;
ACPI_INFO ((AE_INFO, "Table DSDT replaced by host OS")); ACPI_INFO ((AE_INFO, "Table DSDT replaced by host OS"));
AcpiTbPrintTableHeader (0, Table); AcpiTbPrintTableHeader (0, Table);
@ -598,7 +601,7 @@ AcpiTbLoadNamespace (
* Load any SSDT or PSDT tables. Note: Loop leaves tables locked * Load any SSDT or PSDT tables. Note: Loop leaves tables locked
*/ */
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
for (i = 0; i < AcpiGbl_RootTableList.Count; ++i) for (i = 2; i < AcpiGbl_RootTableList.Count; ++i)
{ {
if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
ACPI_SIG_SSDT) && ACPI_SIG_SSDT) &&
@ -609,6 +612,15 @@ AcpiTbLoadNamespace (
continue; continue;
} }
/* Delete SSDT when DSDT is overriden */
if (ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
ACPI_SIG_SSDT) && DsdtOverriden)
{
AcpiTbDeleteTable (&AcpiGbl_RootTableList.Tables[i]);
continue;
}
/* Ignore errors while loading tables, get as many as possible */ /* Ignore errors while loading tables, get as many as possible */
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);