Add fixes for FreeBSD build that were submitted upstream.
This commit is contained in:
parent
1a39cfb03c
commit
6976fc7f02
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor-sys/acpica/dist/; revision=167805
@ -176,7 +176,7 @@
|
||||
/* Always use FreeBSD code over our local versions */
|
||||
#define ACPI_USE_SYSTEM_CLIBRARY
|
||||
|
||||
#ifdef _KERNEL
|
||||
#if defined(_KERNEL) && (__FreeBSD_version < 700020)
|
||||
/* Or strstr (used in debugging mode, also move to libkern) */
|
||||
static __inline char *
|
||||
strstr (char *s, char *find)
|
||||
|
@ -141,9 +141,11 @@ AcpiDbClassifyOneObject (
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
#if defined ACPI_DBG_TRACK_ALLOCATIONS || defined ACPI_USE_LOCAL_CACHE
|
||||
static void
|
||||
AcpiDbListInfo (
|
||||
ACPI_MEMORY_LIST *List);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@ -522,17 +524,18 @@ AcpiDbDisplayStatistics (
|
||||
case CMD_STAT_MEMORY:
|
||||
|
||||
#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_NsNodeList);
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_USE_LOCAL_CACHE
|
||||
AcpiOsPrintf ("\n----Cache Statistics (all in hex)----------\n");
|
||||
AcpiDbListInfo (AcpiGbl_OperandCache);
|
||||
AcpiDbListInfo (AcpiGbl_PsNodeCache);
|
||||
AcpiDbListInfo (AcpiGbl_PsNodeExtCache);
|
||||
AcpiDbListInfo (AcpiGbl_StateCache);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
@ -211,7 +211,8 @@ AcpiNsOneCompleteParse (
|
||||
|
||||
/* 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);
|
||||
|
||||
AcpiPsDeleteParseTree (ParseRoot);
|
||||
|
@ -320,7 +320,7 @@ AcpiTbCreateLocalFadt (
|
||||
if (Length > sizeof (ACPI_TABLE_FADT))
|
||||
{
|
||||
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)));
|
||||
}
|
||||
|
||||
|
@ -535,6 +535,7 @@ AcpiTbLoadNamespace (
|
||||
ACPI_STATUS Status;
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
ACPI_NATIVE_UINT i;
|
||||
BOOLEAN DsdtOverriden;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (TbLoadNamespace);
|
||||
@ -558,6 +559,7 @@ AcpiTbLoadNamespace (
|
||||
/*
|
||||
* Find DSDT table
|
||||
*/
|
||||
DsdtOverriden = FALSE;
|
||||
Status = AcpiOsTableOverride (
|
||||
AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer, &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].Length = Table->Length;
|
||||
AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Flags = ACPI_TABLE_ORIGIN_UNKNOWN;
|
||||
DsdtOverriden = TRUE;
|
||||
|
||||
ACPI_INFO ((AE_INFO, "Table DSDT replaced by host OS"));
|
||||
AcpiTbPrintTableHeader (0, Table);
|
||||
@ -598,7 +601,7 @@ AcpiTbLoadNamespace (
|
||||
* Load any SSDT or PSDT tables. Note: Loop leaves tables locked
|
||||
*/
|
||||
(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),
|
||||
ACPI_SIG_SSDT) &&
|
||||
@ -609,6 +612,15 @@ AcpiTbLoadNamespace (
|
||||
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 */
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
|
Loading…
Reference in New Issue
Block a user