summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2003-07-13 22:45:34 +0000
committernjl <njl@FreeBSD.org>2003-07-13 22:45:34 +0000
commit935eed9d24bac0bfc2bee095035ca1cb7c6aee3b (patch)
treeb38df159cd63b23f83795eb3b6fdb2b7f1d69e5f /sys
parentf668772b045b09705e4efd220d77bef71683290a (diff)
downloadFreeBSD-src-935eed9d24bac0bfc2bee095035ca1cb7c6aee3b.zip
FreeBSD-src-935eed9d24bac0bfc2bee095035ca1cb7c6aee3b.tar.gz
Unmodified files from the vendor 0619 dist that should no longer be off the
vendor branch.
Diffstat (limited to 'sys')
-rw-r--r--sys/contrib/dev/acpica/acconfig.h55
-rw-r--r--sys/contrib/dev/acpica/acpi.h2
-rw-r--r--sys/contrib/dev/acpica/acpiosxf.h43
-rw-r--r--sys/contrib/dev/acpica/acpixf.h55
-rw-r--r--sys/contrib/dev/acpica/acutils.h4
-rw-r--r--sys/contrib/dev/acpica/dbfileio.c105
-rw-r--r--sys/contrib/dev/acpica/exfldio.c57
-rw-r--r--sys/contrib/dev/acpica/exsystem.c6
-rw-r--r--sys/contrib/dev/acpica/tbget.c17
-rw-r--r--sys/contrib/dev/acpica/utglobal.c42
10 files changed, 258 insertions, 128 deletions
diff --git a/sys/contrib/dev/acpica/acconfig.h b/sys/contrib/dev/acpica/acconfig.h
index 25d30f7..bba73c6 100644
--- a/sys/contrib/dev/acpica/acconfig.h
+++ b/sys/contrib/dev/acpica/acconfig.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
- * $Revision: 129 $
+ * $Revision: 139 $
*
*****************************************************************************/
@@ -120,7 +120,7 @@
/******************************************************************************
*
- * Compile-time options
+ * Configuration options
*
*****************************************************************************/
@@ -135,21 +135,9 @@
*
*/
-
-/******************************************************************************
- *
- * Subsystem Constants
- *
- *****************************************************************************/
-
-
/* Version string */
-#define ACPI_CA_VERSION 0x20030228
-
-/* Version of ACPI supported */
-
-#define ACPI_CA_SUPPORT_LEVEL 2
+#define ACPI_CA_VERSION 0x20030619
/* Maximum objects in the various object caches */
@@ -159,6 +147,23 @@
#define ACPI_MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */
#define ACPI_MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */
+/*
+ * Should the subystem abort the loading of an ACPI table if the
+ * table checksum is incorrect?
+ */
+#define ACPI_CHECKSUM_ABORT FALSE
+
+
+/******************************************************************************
+ *
+ * Subsystem Constants
+ *
+ *****************************************************************************/
+
+/* Version of ACPI supported */
+
+#define ACPI_CA_SUPPORT_LEVEL 2
+
/* String size constants */
#define ACPI_MAX_STRING_LENGTH 512
@@ -179,20 +184,6 @@
/******************************************************************************
*
- * Configuration of subsystem behavior
- *
- *****************************************************************************/
-
-
-/*
- * Should the subystem abort the loading of an ACPI table if the
- * table checksum is incorrect?
- */
-#define ACPI_CHECKSUM_ABORT FALSE
-
-
-/******************************************************************************
- *
* ACPI Specification constants (Do not change unless the specification changes)
*
*****************************************************************************/
@@ -215,6 +206,11 @@
#define ACPI_MAX_STRING_CONVERSION 200
+/* Length of _HID, _UID, and _CID values */
+
+#define ACPI_DEVICE_ID_LENGTH 0x09
+#define ACPI_MAX_CID_LENGTH 48
+
/*
* Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
*/
@@ -269,7 +265,6 @@
*
*****************************************************************************/
-
#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
diff --git a/sys/contrib/dev/acpica/acpi.h b/sys/contrib/dev/acpica/acpi.h
index 0ae41b2..11fdb69 100644
--- a/sys/contrib/dev/acpica/acpi.h
+++ b/sys/contrib/dev/acpica/acpi.h
@@ -123,7 +123,7 @@
* in the rest of the source code again and again.
*/
#include "acconfig.h" /* Configuration constants */
-#include "acenv.h" /* Target environment specific items */
+#include "acenv.h" /* Target environment specific items */
#include "actypes.h" /* Fundamental common data types */
#include "acexcep.h" /* ACPI exception codes */
#include "acmacros.h" /* C macros */
diff --git a/sys/contrib/dev/acpica/acpiosxf.h b/sys/contrib/dev/acpica/acpiosxf.h
index acbd985..d0e82b2 100644
--- a/sys/contrib/dev/acpica/acpiosxf.h
+++ b/sys/contrib/dev/acpica/acpiosxf.h
@@ -151,19 +151,6 @@ typedef struct acpi_signal_fatal_info
/*
- * Types specific to the OS service interfaces
- */
-
-typedef UINT32
-(ACPI_SYSTEM_XFACE *OSD_HANDLER) (
- void *Context);
-
-typedef void
-(ACPI_SYSTEM_XFACE *OSD_EXECUTION_CALLBACK) (
- void *Context);
-
-
-/*
* OSL Initialization and shutdown primitives
*/
@@ -221,6 +208,24 @@ AcpiOsSignalSemaphore (
ACPI_HANDLE Handle,
UINT32 Units);
+ACPI_STATUS
+AcpiOsCreateLock (
+ ACPI_HANDLE *OutHandle);
+
+void
+AcpiOsDeleteLock (
+ ACPI_HANDLE Handle);
+
+void
+AcpiOsAcquireLock (
+ ACPI_HANDLE Handle,
+ UINT32 Flags);
+
+void
+AcpiOsReleaseLock (
+ ACPI_HANDLE Handle,
+ UINT32 Flags);
+
/*
* Memory allocation and mapping
@@ -298,13 +303,13 @@ AcpiOsStall (
ACPI_STATUS
AcpiOsReadPort (
ACPI_IO_ADDRESS Address,
- void *Value,
+ UINT32 *Value,
UINT32 Width);
ACPI_STATUS
AcpiOsWritePort (
ACPI_IO_ADDRESS Address,
- ACPI_INTEGER Value,
+ UINT32 Value,
UINT32 Width);
@@ -315,13 +320,13 @@ AcpiOsWritePort (
ACPI_STATUS
AcpiOsReadMemory (
ACPI_PHYSICAL_ADDRESS Address,
- void *Value,
+ UINT32 *Value,
UINT32 Width);
ACPI_STATUS
AcpiOsWriteMemory (
ACPI_PHYSICAL_ADDRESS Address,
- ACPI_INTEGER Value,
+ UINT32 Value,
UINT32 Width);
@@ -359,12 +364,12 @@ AcpiOsDerivePciId(
BOOLEAN
AcpiOsReadable (
void *Pointer,
- UINT32 Length);
+ ACPI_SIZE Length);
BOOLEAN
AcpiOsWritable (
void *Pointer,
- UINT32 Length);
+ ACPI_SIZE Length);
UINT32
AcpiOsGetTimer (
diff --git a/sys/contrib/dev/acpica/acpixf.h b/sys/contrib/dev/acpica/acpixf.h
index ea13888..c30c94e 100644
--- a/sys/contrib/dev/acpica/acpixf.h
+++ b/sys/contrib/dev/acpica/acpixf.h
@@ -300,8 +300,8 @@ AcpiEvaluateObjectTyped (
ACPI_STATUS
AcpiGetObjectInfo (
- ACPI_HANDLE Device,
- ACPI_DEVICE_INFO *Info);
+ ACPI_HANDLE Handle,
+ ACPI_BUFFER *ReturnBuffer);
ACPI_STATUS
AcpiGetNextObject (
@@ -365,6 +365,7 @@ AcpiRemoveAddressSpaceHandler (
ACPI_STATUS
AcpiInstallGpeHandler (
+ ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT32 Type,
ACPI_GPE_HANDLER Handler,
@@ -381,32 +382,66 @@ AcpiReleaseGlobalLock (
ACPI_STATUS
AcpiRemoveGpeHandler (
+ ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
ACPI_GPE_HANDLER Handler);
ACPI_STATUS
AcpiEnableEvent (
- UINT32 AcpiEvent,
- UINT32 Type,
+ UINT32 Event,
UINT32 Flags);
ACPI_STATUS
AcpiDisableEvent (
- UINT32 AcpiEvent,
- UINT32 Type,
+ UINT32 Event,
UINT32 Flags);
ACPI_STATUS
AcpiClearEvent (
- UINT32 AcpiEvent,
- UINT32 Type);
+ UINT32 Event);
ACPI_STATUS
AcpiGetEventStatus (
- UINT32 AcpiEvent,
- UINT32 Type,
+ UINT32 Event,
ACPI_EVENT_STATUS *EventStatus);
+ACPI_STATUS
+AcpiEnableGpe (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Flags);
+
+ACPI_STATUS
+AcpiDisableGpe (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Flags);
+
+ACPI_STATUS
+AcpiClearGpe (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Flags);
+
+ACPI_STATUS
+AcpiGetGpeStatus (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Flags,
+ ACPI_EVENT_STATUS *EventStatus);
+
+ACPI_STATUS
+AcpiInstallGpeBlock (
+ ACPI_HANDLE GpeDevice,
+ ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT32 RegisterCount,
+ UINT32 InterruptLevel);
+
+ACPI_STATUS
+AcpiRemoveGpeBlock (
+ ACPI_HANDLE GpeDevice);
+
+
/*
* Resource interfaces
*/
diff --git a/sys/contrib/dev/acpica/acutils.h b/sys/contrib/dev/acpica/acutils.h
index 31826e2..ca52024 100644
--- a/sys/contrib/dev/acpica/acutils.h
+++ b/sys/contrib/dev/acpica/acutils.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
- * $Revision: 154 $
+ * $Revision: 155 $
*
*****************************************************************************/
@@ -562,7 +562,7 @@ AcpiUtExecute_HID (
ACPI_STATUS
AcpiUtExecute_CID (
ACPI_NAMESPACE_NODE *DeviceNode,
- ACPI_DEVICE_ID *Cid);
+ ACPI_COMPATIBLE_ID_LIST **ReturnCidList);
ACPI_STATUS
AcpiUtExecute_STA (
diff --git a/sys/contrib/dev/acpica/dbfileio.c b/sys/contrib/dev/acpica/dbfileio.c
index 11c0206..a0dd713 100644
--- a/sys/contrib/dev/acpica/dbfileio.c
+++ b/sys/contrib/dev/acpica/dbfileio.c
@@ -2,7 +2,7 @@
*
* Module Name: dbfileio - Debugger file I/O commands. These can't usually
* be used when running the debugger in Ring 0 (Kernel mode)
- * $Revision: 72 $
+ * $Revision: 74 $
*
******************************************************************************/
@@ -206,6 +206,76 @@ AcpiDbOpenDebugFile (
#ifdef ACPI_APPLICATION
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbCheckTextModeCorruption
+ *
+ * PARAMETERS: Table - Table buffer
+ * TableLength - Length of table from the table header
+ * FileLength - Length of the file that contains the table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Check table for text mode file corruption where all linefeed
+ * characters (LF) have been replaced by carriage return linefeed
+ * pairs (CR/LF).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbCheckTextModeCorruption (
+ UINT8 *Table,
+ UINT32 TableLength,
+ UINT32 FileLength)
+{
+ UINT32 i;
+ UINT32 Pairs = 0;
+
+
+ if (TableLength != FileLength)
+ {
+ ACPI_REPORT_WARNING (("File length (0x%X) is not the same as the table length (0x%X)\n",
+ FileLength, TableLength));
+ }
+
+ /* Scan entire table to determine if each LF has been prefixed with a CR */
+
+ for (i = 1; i < FileLength; i++)
+ {
+ if (Table[i] == 0x0A)
+ {
+ if (Table[i - 1] != 0x0D)
+ {
+ /* the LF does not have a preceeding CR, table is not corrupted */
+
+ return (AE_OK);
+ }
+ else
+ {
+ /* Found a CR/LF pair */
+
+ Pairs++;
+ }
+ i++;
+ }
+ }
+
+ /*
+ * Entire table scanned, each CR is part of a CR/LF pair --
+ * meaning that the table was treated as a text file somewhere.
+ *
+ * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
+ * original table are left untouched by the text conversion process --
+ * meaning that we cannot simply replace CR/LF pairs with LFs.
+ */
+ AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
+ AcpiOsPrintf ("All LFs (%d) were changed to CR/LF pairs\n", Pairs);
+ AcpiOsPrintf ("Table cannot be repaired!\n");
+ return (AE_BAD_VALUE);
+}
+
+
/*******************************************************************************
*
* FUNCTION: AcpiDbReadTable
@@ -227,11 +297,14 @@ AcpiDbReadTable (
UINT32 *TableLength)
{
ACPI_TABLE_HEADER TableHeader;
- UINT8 *AmlStart;
- UINT32 AmlLength;
UINT32 Actual;
ACPI_STATUS Status;
+ UINT32 FileSize;
+
+ fseek (fp, 0, SEEK_END);
+ FileSize = ftell (fp);
+ fseek (fp, 0, SEEK_SET);
/* Read the table header */
@@ -265,7 +338,7 @@ AcpiDbReadTable (
/* Allocate a buffer for the table */
*TableLength = TableHeader.Length;
- *Table = AcpiOsAllocate ((size_t) *TableLength);
+ *Table = AcpiOsAllocate ((size_t) (FileSize));
if (!*Table)
{
AcpiOsPrintf ("Could not allocate memory for ACPI table %4.4s (size=%X)\n",
@@ -273,27 +346,29 @@ AcpiDbReadTable (
return (AE_NO_MEMORY);
}
- AmlStart = (UINT8 *) *Table + sizeof (TableHeader);
- AmlLength = *TableLength - sizeof (TableHeader);
-
- /* Copy the header to the buffer */
-
- ACPI_MEMCPY (*Table, &TableHeader, sizeof (TableHeader));
-
/* Get the rest of the table */
- Actual = fread (AmlStart, 1, (size_t) AmlLength, fp);
- if (Actual == AmlLength)
+ fseek (fp, 0, SEEK_SET);
+ Actual = fread (*Table, 1, (size_t) FileSize, fp);
+ if (Actual == FileSize)
{
/* Now validate the checksum */
Status = AcpiTbVerifyTableChecksum (*Table);
+
+ if (Status == AE_BAD_CHECKSUM)
+ {
+ Status = AcpiDbCheckTextModeCorruption ((UINT8 *) *Table,
+ FileSize, (*Table)->Length);
+ return (Status);
+ }
return (AE_OK);
}
if (Actual > 0)
{
- AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n", AmlLength, Actual);
+ AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
+ FileSize, Actual);
return (AE_OK);
}
@@ -364,7 +439,7 @@ AeLocalLoadTable (
{
/* Uninstall table and free the buffer */
- AcpiTbDeleteAcpiTable (ACPI_TABLE_DSDT);
+ AcpiTbDeleteTablesByType (ACPI_TABLE_DSDT);
return_ACPI_STATUS (Status);
}
#endif
diff --git a/sys/contrib/dev/acpica/exfldio.c b/sys/contrib/dev/acpica/exfldio.c
index 9bfc5d9..1cc535d 100644
--- a/sys/contrib/dev/acpica/exfldio.c
+++ b/sys/contrib/dev/acpica/exfldio.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exfldio - Aml Field I/O
- * $Revision: 92 $
+ * $Revision: 96 $
*
*****************************************************************************/
@@ -676,9 +676,10 @@ AcpiExWriteWithUpdateRule (
*
* PARAMETERS: Datum - Where the Datum is returned
* Buffer - Raw field buffer
+ * BufferLength - Entire length (used for big-endian only)
* ByteGranularity - 1/2/4/8 Granularity of the field
* (aka Datum Size)
- * Offset - Datum offset into the buffer
+ * BufferOffset - Datum offset into the buffer
*
* RETURN: none
*
@@ -688,36 +689,45 @@ AcpiExWriteWithUpdateRule (
******************************************************************************/
void
-AcpiExGetBufferDatum(
+AcpiExGetBufferDatum (
ACPI_INTEGER *Datum,
void *Buffer,
+ UINT32 BufferLength,
UINT32 ByteGranularity,
- UINT32 Offset)
+ UINT32 BufferOffset)
{
+ UINT32 Index;
+
ACPI_FUNCTION_ENTRY ();
+ /* Get proper index into buffer (handles big/little endian) */
+
+ Index = ACPI_BUFFER_INDEX (BufferLength, BufferOffset, ByteGranularity);
+
+ /* Move the requested number of bytes */
+
switch (ByteGranularity)
{
case ACPI_FIELD_BYTE_GRANULARITY:
- *Datum = ((UINT8 *) Buffer) [Offset];
+ *Datum = ((UINT8 *) Buffer) [Index];
break;
case ACPI_FIELD_WORD_GRANULARITY:
- ACPI_MOVE_UNALIGNED16_TO_32 (Datum, &(((UINT16 *) Buffer) [Offset]));
+ ACPI_MOVE_16_TO_64 (Datum, &(((UINT16 *) Buffer) [Index]));
break;
case ACPI_FIELD_DWORD_GRANULARITY:
- ACPI_MOVE_UNALIGNED32_TO_32 (Datum, &(((UINT32 *) Buffer) [Offset]));
+ ACPI_MOVE_32_TO_64 (Datum, &(((UINT32 *) Buffer) [Index]));
break;
case ACPI_FIELD_QWORD_GRANULARITY:
- ACPI_MOVE_UNALIGNED64_TO_64 (Datum, &(((UINT64 *) Buffer) [Offset]));
+ ACPI_MOVE_64_TO_64 (Datum, &(((UINT64 *) Buffer) [Index]));
break;
default:
@@ -733,9 +743,10 @@ AcpiExGetBufferDatum(
*
* PARAMETERS: MergedDatum - Value to store
* Buffer - Receiving buffer
+ * BufferLength - Entire length (used for big-endian only)
* ByteGranularity - 1/2/4/8 Granularity of the field
* (aka Datum Size)
- * Offset - Datum offset into the buffer
+ * BufferOffset - Datum offset into the buffer
*
* RETURN: none
*
@@ -748,33 +759,41 @@ void
AcpiExSetBufferDatum (
ACPI_INTEGER MergedDatum,
void *Buffer,
+ UINT32 BufferLength,
UINT32 ByteGranularity,
- UINT32 Offset)
+ UINT32 BufferOffset)
{
+ UINT32 Index;
ACPI_FUNCTION_ENTRY ();
+ /* Get proper index into buffer (handles big/little endian) */
+
+ Index = ACPI_BUFFER_INDEX (BufferLength, BufferOffset, ByteGranularity);
+
+ /* Move the requested number of bytes */
+
switch (ByteGranularity)
{
case ACPI_FIELD_BYTE_GRANULARITY:
- ((UINT8 *) Buffer) [Offset] = (UINT8) MergedDatum;
+ ((UINT8 *) Buffer) [Index] = (UINT8) MergedDatum;
break;
case ACPI_FIELD_WORD_GRANULARITY:
- ACPI_MOVE_UNALIGNED16_TO_16 (&(((UINT16 *) Buffer)[Offset]), &MergedDatum);
+ ACPI_MOVE_64_TO_16 (&(((UINT16 *) Buffer)[Index]), &MergedDatum);
break;
case ACPI_FIELD_DWORD_GRANULARITY:
- ACPI_MOVE_UNALIGNED32_TO_32 (&(((UINT32 *) Buffer)[Offset]), &MergedDatum);
+ ACPI_MOVE_64_TO_32 (&(((UINT32 *) Buffer)[Index]), &MergedDatum);
break;
case ACPI_FIELD_QWORD_GRANULARITY:
- ACPI_MOVE_UNALIGNED64_TO_64 (&(((UINT64 *) Buffer)[Offset]), &MergedDatum);
+ ACPI_MOVE_64_TO_64 (&(((UINT64 *) Buffer)[Index]), &MergedDatum);
break;
default:
@@ -876,8 +895,8 @@ AcpiExExtractFromField (
/* Store the datum to the caller buffer */
- AcpiExSetBufferDatum (MergedDatum, Buffer, ObjDesc->CommonField.AccessByteWidth,
- DatumOffset);
+ AcpiExSetBufferDatum (MergedDatum, Buffer, BufferLength,
+ ObjDesc->CommonField.AccessByteWidth, DatumOffset);
return_ACPI_STATUS (AE_OK);
}
@@ -956,7 +975,7 @@ AcpiExExtractFromField (
* Store the merged field datum in the caller's buffer, according to
* the granularity of the field (size of each datum).
*/
- AcpiExSetBufferDatum (MergedDatum, Buffer,
+ AcpiExSetBufferDatum (MergedDatum, Buffer, BufferLength,
ObjDesc->CommonField.AccessByteWidth, DatumOffset);
/*
@@ -1038,7 +1057,7 @@ AcpiExInsertIntoField (
/* Get a single datum from the caller's buffer */
- AcpiExGetBufferDatum (&PreviousRawDatum, Buffer,
+ AcpiExGetBufferDatum (&PreviousRawDatum, Buffer, BufferLength,
ObjDesc->CommonField.AccessByteWidth, DatumOffset);
/*
@@ -1105,7 +1124,7 @@ AcpiExInsertIntoField (
* Get the next raw buffer datum. It may contain bits of the previous
* field datum
*/
- AcpiExGetBufferDatum (&ThisRawDatum, Buffer,
+ AcpiExGetBufferDatum (&ThisRawDatum, Buffer, BufferLength,
ObjDesc->CommonField.AccessByteWidth, DatumOffset);
/* Create the field datum based on the field alignment */
diff --git a/sys/contrib/dev/acpica/exsystem.c b/sys/contrib/dev/acpica/exsystem.c
index 36380f9..ae38ec8 100644
--- a/sys/contrib/dev/acpica/exsystem.c
+++ b/sys/contrib/dev/acpica/exsystem.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exsystem - Interface to OS services
- * $Revision: 75 $
+ * $Revision: 76 $
*
*****************************************************************************/
@@ -212,7 +212,7 @@ AcpiExSystemDoStall (
AcpiExExitInterpreter ();
- AcpiOsStall (HowLong);
+ AcpiOsSleep (0, (HowLong / 1000) + 1);
/* And now we must get the interpreter again */
@@ -221,7 +221,7 @@ AcpiExSystemDoStall (
else
{
- AcpiOsSleep (0, (HowLong / 1000) + 1);
+ AcpiOsStall (HowLong);
}
return (Status);
diff --git a/sys/contrib/dev/acpica/tbget.c b/sys/contrib/dev/acpica/tbget.c
index 9dc70b6..01fac0e 100644
--- a/sys/contrib/dev/acpica/tbget.c
+++ b/sys/contrib/dev/acpica/tbget.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbget - ACPI Table get* routines
- * $Revision: 83 $
+ * $Revision: 84 $
*
*****************************************************************************/
@@ -547,18 +547,19 @@ AcpiTbGetTablePtr (
*/
if (Instance == 1)
{
- /*
- * Just pluck the pointer out of the global table!
- * Will be null if no table is present
- */
- *TablePtrLoc = AcpiGbl_AcpiTables[TableType].Pointer;
+ /* Get the first */
+
+ if (AcpiGbl_TableLists[TableType].Next)
+ {
+ *TablePtrLoc = AcpiGbl_TableLists[TableType].Next->Pointer;
+ }
return_ACPI_STATUS (AE_OK);
}
/*
* Check for instance out of range
*/
- if (Instance > AcpiGbl_AcpiTables[TableType].Count)
+ if (Instance > AcpiGbl_TableLists[TableType].Count)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
@@ -570,7 +571,7 @@ AcpiTbGetTablePtr (
* need to walk from the 2nd table until we reach the Instance
* that the user is looking for and return its table pointer.
*/
- TableDesc = AcpiGbl_AcpiTables[TableType].Next;
+ TableDesc = AcpiGbl_TableLists[TableType].Next;
for (i = 2; i < Instance; i++)
{
TableDesc = TableDesc->Next;
diff --git a/sys/contrib/dev/acpica/utglobal.c b/sys/contrib/dev/acpica/utglobal.c
index 2611ea2..9a16eea 100644
--- a/sys/contrib/dev/acpica/utglobal.c
+++ b/sys/contrib/dev/acpica/utglobal.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
- * $Revision: 180 $
+ * $Revision: 185 $
*
*****************************************************************************/
@@ -380,10 +380,10 @@ AcpiUtHexToAsciiChar (
******************************************************************************/
-ACPI_TABLE_DESC AcpiGbl_AcpiTables[NUM_ACPI_TABLES];
+ACPI_TABLE_LIST AcpiGbl_TableLists[NUM_ACPI_TABLE_TYPES];
-ACPI_TABLE_SUPPORT AcpiGbl_AcpiTableData[NUM_ACPI_TABLES] =
+ACPI_TABLE_SUPPORT AcpiGbl_TableData[NUM_ACPI_TABLE_TYPES] =
{
/*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */
@@ -616,12 +616,10 @@ AcpiUtGetObjectTypeName (
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
-
/*
* Strings and procedures used for debug only
*/
-
/*****************************************************************************
*
* FUNCTION: AcpiUtGetMutexName
@@ -639,7 +637,7 @@ AcpiUtGetMutexName (
UINT32 MutexId)
{
- if (MutexId > MAX_MTX)
+ if (MutexId > MAX_MUTEX)
{
return ("Invalid Mutex ID");
}
@@ -647,7 +645,6 @@ AcpiUtGetMutexName (
return (AcpiGbl_MutexNames[MutexId]);
}
-
#endif
@@ -711,9 +708,12 @@ AcpiUtAllocateOwnerId (
OwnerId = AcpiGbl_NextTableOwnerId;
AcpiGbl_NextTableOwnerId++;
+ /* Check for wraparound */
+
if (AcpiGbl_NextTableOwnerId == ACPI_FIRST_METHOD_ID)
{
AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID;
+ ACPI_REPORT_WARNING (("Table owner ID wraparound\n"));
}
break;
@@ -725,6 +725,8 @@ AcpiUtAllocateOwnerId (
if (AcpiGbl_NextMethodOwnerId == ACPI_FIRST_TABLE_ID)
{
+ /* Check for wraparound */
+
AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID;
}
break;
@@ -791,33 +793,31 @@ AcpiUtInitGlobals (
/* ACPI table structure */
- for (i = 0; i < NUM_ACPI_TABLES; i++)
+ for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++)
{
- AcpiGbl_AcpiTables[i].Prev = &AcpiGbl_AcpiTables[i];
- AcpiGbl_AcpiTables[i].Next = &AcpiGbl_AcpiTables[i];
- AcpiGbl_AcpiTables[i].Pointer = NULL;
- AcpiGbl_AcpiTables[i].Length = 0;
- AcpiGbl_AcpiTables[i].Allocation = ACPI_MEM_NOT_ALLOCATED;
- AcpiGbl_AcpiTables[i].Count = 0;
+ AcpiGbl_TableLists[i].Next = NULL;
+ AcpiGbl_TableLists[i].Count = 0;
}
/* Mutex locked flags */
- for (i = 0; i < NUM_MTX; i++)
+ for (i = 0; i < NUM_MUTEX; i++)
{
- AcpiGbl_AcpiMutexInfo[i].Mutex = NULL;
- AcpiGbl_AcpiMutexInfo[i].OwnerId = ACPI_MUTEX_NOT_ACQUIRED;
- AcpiGbl_AcpiMutexInfo[i].UseCount = 0;
+ AcpiGbl_MutexInfo[i].Mutex = NULL;
+ AcpiGbl_MutexInfo[i].OwnerId = ACPI_MUTEX_NOT_ACQUIRED;
+ AcpiGbl_MutexInfo[i].UseCount = 0;
}
/* GPE support */
- AcpiGbl_GpeBlockListHead = NULL;
+ AcpiGbl_GpeXruptListHead = NULL;
+ AcpiGbl_GpeFadtBlocks[0] = NULL;
+ AcpiGbl_GpeFadtBlocks[1] = NULL;
/* Global notify handlers */
- AcpiGbl_SysNotify.Handler = NULL;
- AcpiGbl_DrvNotify.Handler = NULL;
+ AcpiGbl_SystemNotify.Handler = NULL;
+ AcpiGbl_DeviceNotify.Handler = NULL;
AcpiGbl_InitHandler = NULL;
/* Global "typed" ACPI table pointers */
OpenPOWER on IntegriCloud