aboutsummaryrefslogtreecommitdiff
path: root/source/components
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-08-16 17:26:22 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-08-16 17:26:22 +0000
commitfc8e34d9a95f87b780f9ee3d400dd995aba2ce27 (patch)
treea28a9676fa0b9e969cfd83d7a508660c754c8b3e /source/components
parent8724452f676e45bfd39cfb47234f7def5551f067 (diff)
downloadsrc-fc8e34d9a95f87b780f9ee3d400dd995aba2ce27.tar.gz
src-fc8e34d9a95f87b780f9ee3d400dd995aba2ce27.zip
Import ACPICA 20120816.vendor/acpica/20120816
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=239332 svn path=/vendor-sys/acpica/20120816/; revision=239333; tag=vendor/acpica/20120816
Diffstat (limited to 'source/components')
-rw-r--r--source/components/debugger/dbcmds.c4
-rw-r--r--source/components/debugger/dbexec.c247
-rw-r--r--source/components/disassembler/dmbuffer.c167
-rw-r--r--source/components/disassembler/dmopcode.c5
-rw-r--r--source/components/dispatcher/dswload.c14
-rw-r--r--source/components/dispatcher/dswload2.c14
-rw-r--r--source/components/events/evgpe.c18
-rw-r--r--source/components/events/evxfgpe.c2
-rw-r--r--source/components/hardware/hwesleep.c25
-rw-r--r--source/components/hardware/hwgpe.c12
-rw-r--r--source/components/hardware/hwsleep.c25
-rw-r--r--source/components/hardware/hwxfsleep.c22
-rw-r--r--source/components/namespace/nsdump.c2
-rw-r--r--source/components/utilities/utosi.c1
-rw-r--r--source/components/utilities/utxface.c406
-rw-r--r--source/components/utilities/utxferror.c4
-rw-r--r--source/components/utilities/utxfinit.c358
17 files changed, 932 insertions, 394 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c
index 93d4f294dd09..0e9d78d965e4 100644
--- a/source/components/debugger/dbcmds.c
+++ b/source/components/debugger/dbcmds.c
@@ -174,14 +174,14 @@ AcpiDbSleep (
}
AcpiOsPrintf ("**** Going to sleep ****\n");
- Status = AcpiEnterSleepState (SleepState, ACPI_NO_OPTIONAL_METHODS);
+ Status = AcpiEnterSleepState (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
AcpiOsPrintf ("**** Prepare to return from sleep ****\n");
- Status = AcpiLeaveSleepStatePrep (SleepState, ACPI_NO_OPTIONAL_METHODS);
+ Status = AcpiLeaveSleepStatePrep (SleepState);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c
index 4b59f22053a7..86c6579e322a 100644
--- a/source/components/debugger/dbexec.c
+++ b/source/components/debugger/dbexec.c
@@ -104,6 +104,15 @@ AcpiDbDeleteObjects (
ACPI_OBJECT *Objects);
+static UINT8 *
+AcpiDbEncodePldBuffer (
+ ACPI_PLD_INFO *PldInfo);
+
+static void
+AcpiDbDumpPldBuffer (
+ ACPI_OBJECT *ObjDesc);
+
+
/*******************************************************************************
*
* FUNCTION: AcpiDbHexCharToValue
@@ -446,7 +455,6 @@ AcpiDbExecuteMethod (
ACPI_STATUS Status;
ACPI_OBJECT_LIST ParamObjects;
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
- ACPI_HANDLE Handle;
ACPI_DEVICE_INFO *ObjInfo;
UINT32 i;
@@ -459,17 +467,9 @@ AcpiDbExecuteMethod (
AcpiOsPrintf ("Warning: debug output is not enabled!\n");
}
- /* Get the NS node, determines existence also */
-
- Status = AcpiGetHandle (NULL, Info->Pathname, &Handle);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
/* Get the object info for number of method parameters */
- Status = AcpiGetObjectInfo (Handle, &ObjInfo);
+ Status = AcpiGetObjectInfo (Info->Method, &ObjInfo);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -720,6 +720,202 @@ AcpiDbExecutionWalk (
/*******************************************************************************
*
+ * FUNCTION: AcpiDbEncodePldBuffer
+ *
+ * PARAMETERS: PldInfo - _PLD buffer struct (Using local struct)
+ *
+ * RETURN: Encode _PLD buffer suitable for return value from _PLD
+ *
+ * DESCRIPTION: Bit-packs a _PLD buffer struct. Used to test the _PLD macros
+ *
+ ******************************************************************************/
+
+static UINT8 *
+AcpiDbEncodePldBuffer (
+ ACPI_PLD_INFO *PldInfo)
+{
+ UINT32 *Buffer;
+ UINT32 Dword;
+
+
+ Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE);
+ if (!Buffer)
+ {
+ return (NULL);
+ }
+
+ /* First 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
+ ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
+ ACPI_PLD_SET_COLOR (&Dword, PldInfo->Color);
+ ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
+
+ /* Second 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_WIDTH (&Dword, PldInfo->Width);
+ ACPI_PLD_SET_HEIGHT (&Dword, PldInfo->Height);
+ ACPI_MOVE_32_TO_32 (&Buffer[1], &Dword);
+
+ /* Third 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_USER_VISIBLE (&Dword, PldInfo->UserVisible);
+ ACPI_PLD_SET_DOCK (&Dword, PldInfo->Dock);
+ ACPI_PLD_SET_LID (&Dword, PldInfo->Lid);
+ ACPI_PLD_SET_PANEL (&Dword, PldInfo->Panel);
+ ACPI_PLD_SET_VERTICAL (&Dword, PldInfo->VerticalPosition);
+ ACPI_PLD_SET_HORIZONTAL (&Dword, PldInfo->HorizontalPosition);
+ ACPI_PLD_SET_SHAPE (&Dword, PldInfo->Shape);
+ ACPI_PLD_SET_ORIENTATION (&Dword, PldInfo->GroupOrientation);
+ ACPI_PLD_SET_TOKEN (&Dword, PldInfo->GroupToken);
+ ACPI_PLD_SET_POSITION (&Dword, PldInfo->GroupPosition);
+ ACPI_PLD_SET_BAY (&Dword, PldInfo->Bay);
+ ACPI_MOVE_32_TO_32 (&Buffer[2], &Dword);
+
+ /* Fourth 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_EJECTABLE (&Dword, PldInfo->Ejectable);
+ ACPI_PLD_SET_OSPM_EJECT (&Dword, PldInfo->OspmEjectRequired);
+ ACPI_PLD_SET_CABINET (&Dword, PldInfo->CabinetNumber);
+ ACPI_PLD_SET_CARD_CAGE (&Dword, PldInfo->CardCageNumber);
+ ACPI_PLD_SET_REFERENCE (&Dword, PldInfo->Reference);
+ ACPI_PLD_SET_ROTATION (&Dword, PldInfo->Rotation);
+ ACPI_PLD_SET_ORDER (&Dword, PldInfo->Order);
+ ACPI_MOVE_32_TO_32 (&Buffer[3], &Dword);
+
+ if (PldInfo->Revision >= 2)
+ {
+ /* Fifth 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_VERT_OFFSET (&Dword, PldInfo->VerticalOffset);
+ ACPI_PLD_SET_HORIZ_OFFSET (&Dword, PldInfo->HorizontalOffset);
+ ACPI_MOVE_32_TO_32 (&Buffer[4], &Dword);
+ }
+
+ return (ACPI_CAST_PTR (UINT8, Buffer));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbDumpPldBuffer
+ *
+ * PARAMETERS: ObjDesc - Object returned from _PLD method
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Dumps formatted contents of a _PLD return buffer.
+ *
+ ******************************************************************************/
+
+#define ACPI_PLD_OUTPUT "%20s : %-6X\n"
+
+static void
+AcpiDbDumpPldBuffer (
+ ACPI_OBJECT *ObjDesc)
+{
+ ACPI_OBJECT *BufferDesc;
+ ACPI_PLD_INFO *PldInfo;
+ UINT8 *NewBuffer;
+ ACPI_STATUS Status;
+
+
+ /* Object must be of type Package with at least one Buffer element */
+
+ if (ObjDesc->Type != ACPI_TYPE_PACKAGE)
+ {
+ return;
+ }
+
+ BufferDesc = &ObjDesc->Package.Elements[0];
+ if (BufferDesc->Type != ACPI_TYPE_BUFFER)
+ {
+ return;
+ }
+
+ /* Convert _PLD buffer to local _PLD struct */
+
+ Status = AcpiDecodePldBuffer (BufferDesc->Buffer.Pointer,
+ BufferDesc->Buffer.Length, &PldInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Encode local _PLD struct back to a _PLD buffer */
+
+ NewBuffer = AcpiDbEncodePldBuffer (PldInfo);
+ if (!NewBuffer)
+ {
+ return;
+ }
+
+ /* The two bit-packed buffers should match */
+
+ if (ACPI_MEMCMP (NewBuffer, BufferDesc->Buffer.Pointer,
+ BufferDesc->Buffer.Length))
+ {
+ AcpiOsPrintf ("Converted _PLD buffer does not compare. New:\n");
+
+ AcpiUtDumpBuffer2 (NewBuffer,
+ BufferDesc->Buffer.Length, DB_BYTE_DISPLAY);
+ }
+
+ /* First 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Color", PldInfo->Color);
+
+ /* Second 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Width", PldInfo->Width);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Height", PldInfo->Height);
+
+ /* Third 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay);
+
+ /* Fourth 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order);
+
+ /* Fifth 32-bit dword */
+
+ if (BufferDesc->Buffer.Length > 16)
+ {
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalOffset", PldInfo->VerticalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalOffset", PldInfo->HorizontalOffset);
+ }
+
+ ACPI_FREE (PldInfo);
+ ACPI_FREE (NewBuffer);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDbExecute
*
* PARAMETERS: Name - Name of method to execute
@@ -782,6 +978,16 @@ AcpiDbExecute (
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+
+ /* Get the NS node, determines existence also */
+
+ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname,
+ &AcpiGbl_DbMethodInfo.Method);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj);
ACPI_FREE (NameString);
}
@@ -823,6 +1029,14 @@ AcpiDbExecute (
AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer,
(UINT32) ReturnObj.Length);
AcpiDbDumpExternalObject (ReturnObj.Pointer, 1);
+
+ /* Dump a _PLD buffer if present */
+
+ if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
+ AcpiGbl_DbMethodInfo.Method)->Name.Ascii), METHOD_NAME__PLD))
+ {
+ AcpiDbDumpPldBuffer (ReturnObj.Pointer);
+ }
}
else
{
@@ -1067,6 +1281,17 @@ AcpiDbCreateExecutionThreads (
AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ /* Get the NS node, determines existence also */
+
+ Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname,
+ &AcpiGbl_DbMethodInfo.Method);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s Could not get handle for %s\n",
+ AcpiFormatException (Status), AcpiGbl_DbMethodInfo.Pathname);
+ goto CleanupAndExit;
+ }
+
/* Create the threads */
AcpiOsPrintf ("Creating %X threads to execute %X times each\n",
@@ -1090,6 +1315,8 @@ AcpiDbCreateExecutionThreads (
AcpiOsPrintf ("All threads (%X) have completed\n", NumThreads);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
+CleanupAndExit:
+
/* Cleanup and exit */
(void) AcpiOsDeleteSemaphore (MainThreadGate);
diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c
index 9f49f92e4743..d0a66ef2fdae 100644
--- a/source/components/disassembler/dmbuffer.c
+++ b/source/components/disassembler/dmbuffer.c
@@ -64,6 +64,12 @@ static void
AcpiDmIsEisaIdElement (
ACPI_PARSE_OBJECT *Op);
+static void
+AcpiDmPldBuffer (
+ UINT32 Level,
+ UINT8 *ByteData,
+ UINT32 ByteCount);
+
/*******************************************************************************
*
@@ -180,6 +186,12 @@ AcpiDmByteList (
AcpiDmUnicode (Op);
break;
+ case ACPI_DASM_PLD_METHOD:
+
+ AcpiDmDisasmByteList (Info->Level, ByteData, ByteCount);
+ AcpiDmPldBuffer (Info->Level, ByteData, ByteCount);
+ break;
+
case ACPI_DASM_BUFFER:
default:
@@ -332,6 +344,161 @@ AcpiDmIsStringBuffer (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmIsPldBuffer
+ *
+ * PARAMETERS: Op - Buffer Object to be examined
+ *
+ * RETURN: TRUE if buffer contains a ASCII string, FALSE otherwise
+ *
+ * DESCRIPTION: Determine if a buffer Op contains a _PLD structure
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiDmIsPldBuffer (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_NAMESPACE_NODE *Node;
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ ParentOp = Op->Common.Parent;
+ if (!ParentOp)
+ {
+ return (FALSE);
+ }
+
+ /* Check for form: Name(_PLD, Buffer() {}). Not legal, however */
+
+ if (ParentOp->Common.AmlOpcode == AML_NAME_OP)
+ {
+ Node = ParentOp->Common.Node;
+
+ if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
+ {
+ return (TRUE);
+ }
+
+ return (FALSE);
+ }
+
+ /* Check for proper form: Name(_PLD, Package() {Buffer() {}}) */
+
+ if (ParentOp->Common.AmlOpcode == AML_PACKAGE_OP)
+ {
+ ParentOp = ParentOp->Common.Parent;
+ if (!ParentOp)
+ {
+ return (FALSE);
+ }
+
+ if (ParentOp->Common.AmlOpcode == AML_NAME_OP)
+ {
+ Node = ParentOp->Common.Node;
+
+ if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
+ {
+ return (TRUE);
+ }
+ }
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPldBuffer
+ *
+ * PARAMETERS: Level - Current source code indentation level
+ * ByteData - Pointer to the byte list
+ * ByteCount - Length of the byte list
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump and format the contents of a _PLD buffer object
+ *
+ ******************************************************************************/
+
+#define ACPI_PLD_OUTPUT "%*.s/* %18s : %-6.2X */\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT16 "%*.s/* %18s : %-6.4X */\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT24 "%*.s/* %18s : %-6.6X */\n", ACPI_MUL_4 (Level), " "
+
+static void
+AcpiDmPldBuffer (
+ UINT32 Level,
+ UINT8 *ByteData,
+ UINT32 ByteCount)
+{
+ ACPI_PLD_INFO *PldInfo;
+ ACPI_STATUS Status;
+
+
+ /* Check for valid byte count */
+
+ if (ByteCount < ACPI_PLD_REV1_BUFFER_SIZE)
+ {
+ return;
+ }
+
+ /* Convert _PLD buffer to local _PLD struct */
+
+ Status = AcpiDecodePldBuffer (ByteData, ByteCount, &PldInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* First 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT24,"Color", PldInfo->Color);
+
+ /* Second 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Width", PldInfo->Width);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Height", PldInfo->Height);
+
+ /* Third 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay);
+
+ /* Fourth 32-bit dword */
+
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order);
+
+ /* Fifth 32-bit dword */
+
+ if (ByteCount >= ACPI_PLD_REV1_BUFFER_SIZE)
+ {
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"VerticalOffset", PldInfo->VerticalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16,"HorizontalOffset", PldInfo->HorizontalOffset);
+ }
+
+ ACPI_FREE (PldInfo);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmUnicode
*
* PARAMETERS: Op - Byte List op containing Unicode string
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index b52bdb28151f..2ce08a33f16f 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -665,6 +665,11 @@ AcpiDmDisassembleOneOp (
Op->Common.DisasmOpcode = ACPI_DASM_STRING;
AcpiOsPrintf ("Buffer");
}
+ else if (AcpiDmIsPldBuffer (Op))
+ {
+ Op->Common.DisasmOpcode = ACPI_DASM_PLD_METHOD;
+ AcpiOsPrintf ("Buffer");
+ }
else
{
Op->Common.DisasmOpcode = ACPI_DASM_BUFFER;
diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c
index d40f911f417c..c2431155a1f4 100644
--- a/source/components/dispatcher/dswload.c
+++ b/source/components/dispatcher/dswload.c
@@ -241,6 +241,20 @@ AcpiDsLoad1BeginOp (
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
break;
+ case ACPI_TYPE_METHOD:
+
+ /*
+ * Allow scope change to root during execution of module-level
+ * code. Root is typed METHOD during this time.
+ */
+ if ((Node == AcpiGbl_RootNode) &&
+ (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
+ {
+ break;
+ }
+
+ /*lint -fallthrough */
+
default:
/* All other types are an error */
diff --git a/source/components/dispatcher/dswload2.c b/source/components/dispatcher/dswload2.c
index 27e317620911..90d85d6501da 100644
--- a/source/components/dispatcher/dswload2.c
+++ b/source/components/dispatcher/dswload2.c
@@ -243,6 +243,20 @@ AcpiDsLoad2BeginOp (
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
break;
+ case ACPI_TYPE_METHOD:
+
+ /*
+ * Allow scope change to root during execution of module-level
+ * code. Root is typed METHOD during this time.
+ */
+ if ((Node == AcpiGbl_RootNode) &&
+ (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
+ {
+ break;
+ }
+
+ /*lint -fallthrough */
+
default:
/* All other types are an error */
diff --git a/source/components/events/evgpe.c b/source/components/events/evgpe.c
index 623795a83619..7c572b74f15d 100644
--- a/source/components/events/evgpe.c
+++ b/source/components/events/evgpe.c
@@ -92,7 +92,7 @@ AcpiEvUpdateGpeEnableMask (
return_ACPI_STATUS (AE_NOT_EXIST);
}
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* Clear the run bit up front */
@@ -431,6 +431,13 @@ AcpiEvGpeDetect (
if (!(GpeRegisterInfo->EnableForRun |
GpeRegisterInfo->EnableForWake))
{
+ ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
+ "Ignore disabled registers for GPE%02X-GPE%02X: "
+ "RunEnable=%02X, WakeEnable=%02X\n",
+ GpeRegisterInfo->BaseGpeNumber,
+ GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
+ GpeRegisterInfo->EnableForRun,
+ GpeRegisterInfo->EnableForWake));
continue;
}
@@ -451,8 +458,13 @@ AcpiEvGpeDetect (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n",
- GpeRegisterInfo->BaseGpeNumber, StatusReg, EnableReg));
+ "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
+ "RunEnable=%02X, WakeEnable=%02X\n",
+ GpeRegisterInfo->BaseGpeNumber,
+ GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
+ StatusReg, EnableReg,
+ GpeRegisterInfo->EnableForRun,
+ GpeRegisterInfo->EnableForWake));
/* Check if there is anything active at all in this register */
diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c
index 4194651def8e..1e83d1dacd6d 100644
--- a/source/components/events/evxfgpe.c
+++ b/source/components/events/evxfgpe.c
@@ -480,7 +480,7 @@ AcpiSetGpeWakeMask (
goto UnlockAndExit;
}
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* Perform the action */
diff --git a/source/components/hardware/hwesleep.c b/source/components/hardware/hwesleep.c
index 1587af019cb9..353d5a92974e 100644
--- a/source/components/hardware/hwesleep.c
+++ b/source/components/hardware/hwesleep.c
@@ -99,7 +99,6 @@ AcpiHwExecuteSleepMethod (
* FUNCTION: AcpiHwExtendedSleep
*
* PARAMETERS: SleepState - Which sleep state to enter
- * Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
@@ -111,8 +110,7 @@ AcpiHwExecuteSleepMethod (
ACPI_STATUS
AcpiHwExtendedSleep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
UINT8 SleepTypeValue;
@@ -140,13 +138,6 @@ AcpiHwExtendedSleep (
AcpiGbl_SystemAwakeAndRunning = FALSE;
- /* Optionally execute _GTS (Going To Sleep) */
-
- if (Flags & ACPI_EXECUTE_GTS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
- }
-
/* Flush caches, as per ACPI specification */
ACPI_FLUSH_CPU_CACHE ();
@@ -191,7 +182,6 @@ AcpiHwExtendedSleep (
* FUNCTION: AcpiHwExtendedWakePrep
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
@@ -202,8 +192,7 @@ AcpiHwExtendedSleep (
ACPI_STATUS
AcpiHwExtendedWakePrep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
UINT8 SleepTypeValue;
@@ -223,12 +212,6 @@ AcpiHwExtendedWakePrep (
&AcpiGbl_FADT.SleepControl);
}
- /* Optionally execute _BFS (Back From Sleep) */
-
- if (Flags & ACPI_EXECUTE_BFS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
- }
return_ACPI_STATUS (AE_OK);
}
@@ -238,7 +221,6 @@ AcpiHwExtendedWakePrep (
* FUNCTION: AcpiHwExtendedWake
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - Reserved, set to zero
*
* RETURN: Status
*
@@ -249,8 +231,7 @@ AcpiHwExtendedWakePrep (
ACPI_STATUS
AcpiHwExtendedWake (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_FUNCTION_TRACE (HwExtendedWake);
diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c
index c94f17be260e..11cb36e86b97 100644
--- a/source/components/hardware/hwgpe.c
+++ b/source/components/hardware/hwgpe.c
@@ -65,7 +65,6 @@ AcpiHwEnableWakeupGpeBlock (
* FUNCTION: AcpiHwGetGpeRegisterBit
*
* PARAMETERS: GpeEventInfo - Info block for the GPE
- * GpeRegisterInfo - Info block for the GPE register
*
* RETURN: Register mask with a one in the GPE bit position
*
@@ -76,12 +75,11 @@ AcpiHwEnableWakeupGpeBlock (
UINT32
AcpiHwGetGpeRegisterBit (
- ACPI_GPE_EVENT_INFO *GpeEventInfo,
- ACPI_GPE_REGISTER_INFO *GpeRegisterInfo)
+ ACPI_GPE_EVENT_INFO *GpeEventInfo)
{
return ((UINT32) 1 <<
- (GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
+ (GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
}
@@ -130,7 +128,7 @@ AcpiHwLowSetGpe (
/* Set or clear just the bit that corresponds to this GPE */
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
switch (Action)
{
case ACPI_GPE_CONDITIONAL_ENABLE:
@@ -199,7 +197,7 @@ AcpiHwClearGpe (
* Write a one to the appropriate bit in the status register to
* clear this GPE.
*/
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
Status = AcpiHwWrite (RegisterBit,
&GpeRegisterInfo->StatusAddress);
@@ -247,7 +245,7 @@ AcpiHwGetGpeStatus (
/* Get the register bitmask for this GPE */
- RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* GPE currently enabled? (enabled for runtime?) */
diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c
index 1957fbdf2764..d3817554225a 100644
--- a/source/components/hardware/hwsleep.c
+++ b/source/components/hardware/hwsleep.c
@@ -55,7 +55,6 @@
* FUNCTION: AcpiHwLegacySleep
*
* PARAMETERS: SleepState - Which sleep state to enter
- * Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
@@ -66,8 +65,7 @@
ACPI_STATUS
AcpiHwLegacySleep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
@@ -116,13 +114,6 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- /* Optionally execute _GTS (Going To Sleep) */
-
- if (Flags & ACPI_EXECUTE_GTS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
- }
-
/* Get current value of PM1A control */
Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL,
@@ -219,7 +210,6 @@ AcpiHwLegacySleep (
* FUNCTION: AcpiHwLegacyWakePrep
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
@@ -231,8 +221,7 @@ AcpiHwLegacySleep (
ACPI_STATUS
AcpiHwLegacyWakePrep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
@@ -282,12 +271,6 @@ AcpiHwLegacyWakePrep (
}
}
- /* Optionally execute _BFS (Back From Sleep) */
-
- if (Flags & ACPI_EXECUTE_BFS)
- {
- AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
- }
return_ACPI_STATUS (Status);
}
@@ -297,7 +280,6 @@ AcpiHwLegacyWakePrep (
* FUNCTION: AcpiHwLegacyWake
*
* PARAMETERS: SleepState - Which sleep state we just exited
- * Flags - Reserved, set to zero
*
* RETURN: Status
*
@@ -308,8 +290,7 @@ AcpiHwLegacyWakePrep (
ACPI_STATUS
AcpiHwLegacyWake (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c
index caa51a8a4a62..c75308443a2e 100644
--- a/source/components/hardware/hwxfsleep.c
+++ b/source/components/hardware/hwxfsleep.c
@@ -52,7 +52,6 @@
static ACPI_STATUS
AcpiHwSleepDispatch (
UINT8 SleepState,
- UINT8 Flags,
UINT32 FunctionId);
/*
@@ -261,7 +260,6 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
static ACPI_STATUS
AcpiHwSleepDispatch (
UINT8 SleepState,
- UINT8 Flags,
UINT32 FunctionId)
{
ACPI_STATUS Status;
@@ -277,13 +275,13 @@ AcpiHwSleepDispatch (
if (AcpiGbl_ReducedHardware ||
AcpiGbl_FADT.SleepControl.Address)
{
- Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
+ Status = SleepFunctions->ExtendedFunction (SleepState);
}
else
{
/* Legacy sleep */
- Status = SleepFunctions->LegacyFunction (SleepState, Flags);
+ Status = SleepFunctions->LegacyFunction (SleepState);
}
return (Status);
@@ -293,7 +291,7 @@ AcpiHwSleepDispatch (
* For the case where reduced-hardware-only code is being generated,
* we know that only the extended sleep registers are available
*/
- Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
+ Status = SleepFunctions->ExtendedFunction (SleepState);
return (Status);
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -387,7 +385,6 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
* FUNCTION: AcpiEnterSleepState
*
* PARAMETERS: SleepState - Which sleep state to enter
- * Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
@@ -398,8 +395,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
@@ -415,7 +411,7 @@ AcpiEnterSleepState (
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
- Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_SLEEP_FUNCTION_ID);
+ Status = AcpiHwSleepDispatch (SleepState, ACPI_SLEEP_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
@@ -427,7 +423,6 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
* FUNCTION: AcpiLeaveSleepStatePrep
*
* PARAMETERS: SleepState - Which sleep state we are exiting
- * Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
@@ -440,8 +435,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
ACPI_STATUS
AcpiLeaveSleepStatePrep (
- UINT8 SleepState,
- UINT8 Flags)
+ UINT8 SleepState)
{
ACPI_STATUS Status;
@@ -449,7 +443,7 @@ AcpiLeaveSleepStatePrep (
ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep);
- Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_WAKE_PREP_FUNCTION_ID);
+ Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_PREP_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
@@ -479,7 +473,7 @@ AcpiLeaveSleepState (
ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
- Status = AcpiHwSleepDispatch (SleepState, 0, ACPI_WAKE_FUNCTION_ID);
+ Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c
index 6b7c50577918..e0635dc7ba22 100644
--- a/source/components/namespace/nsdump.c
+++ b/source/components/namespace/nsdump.c
@@ -294,7 +294,7 @@ AcpiNsDumpOneObject (
{
case ACPI_TYPE_PROCESSOR:
- AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
+ AcpiOsPrintf ("ID %02X Len %02X Addr %p\n",
ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
break;
diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c
index dcce8a99e18a..a1ff84521e95 100644
--- a/source/components/utilities/utosi.c
+++ b/source/components/utilities/utosi.c
@@ -77,6 +77,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
+ {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
/* Feature Group Strings */
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index 3e858c9b0ffe..38f7195769ab 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Module Name: utxface - External interfaces for "global" ACPI functions
+ * Module Name: utxface - External interfaces, miscellaneous utility functions
*
*****************************************************************************/
@@ -46,321 +46,12 @@
#include "acpi.h"
#include "accommon.h"
-#include "acevents.h"
-#include "acnamesp.h"
#include "acdebug.h"
-#include "actables.h"
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utxface")
-#ifndef ACPI_ASL_COMPILER
-/*******************************************************************************
- *
- * FUNCTION: AcpiInitializeSubsystem
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Initializes all global variables. This is the first function
- * called, so any early initialization belongs here.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiInitializeSubsystem (
- void)
-{
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (AcpiInitializeSubsystem);
-
-
- AcpiGbl_StartupFlags = ACPI_SUBSYSTEM_INITIALIZE;
- ACPI_DEBUG_EXEC (AcpiUtInitStackPtrTrace ());
-
- /* Initialize the OS-Dependent layer */
-
- Status = AcpiOsInitialize ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During OSL initialization"));
- return_ACPI_STATUS (Status);
- }
-
- /* Initialize all globals used by the subsystem */
-
- Status = AcpiUtInitGlobals ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During initialization of globals"));
- return_ACPI_STATUS (Status);
- }
-
- /* Create the default mutex objects */
-
- Status = AcpiUtMutexInitialize ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Global Mutex creation"));
- return_ACPI_STATUS (Status);
- }
-
- /*
- * Initialize the namespace manager and
- * the root of the namespace tree
- */
- Status = AcpiNsRootInitialize ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization"));
- return_ACPI_STATUS (Status);
- }
-
- /* Initialize the global OSI interfaces list with the static names */
-
- Status = AcpiUtInitializeInterfaces ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization"));
- return_ACPI_STATUS (Status);
- }
-
- /* If configured, initialize the AML debugger */
-
- ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiInitializeSubsystem)
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiEnableSubsystem
- *
- * PARAMETERS: Flags - Init/enable Options
- *
- * RETURN: Status
- *
- * DESCRIPTION: Completes the subsystem initialization including hardware.
- * Puts system into ACPI mode if it isn't already.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiEnableSubsystem (
- UINT32 Flags)
-{
- ACPI_STATUS Status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE (AcpiEnableSubsystem);
-
-
-#if (!ACPI_REDUCED_HARDWARE)
-
- /* Enable ACPI mode */
-
- if (!(Flags & ACPI_NO_ACPI_ENABLE))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
-
- AcpiGbl_OriginalMode = AcpiHwGetMode();
-
- Status = AcpiEnable ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_WARNING ((AE_INFO, "AcpiEnable failed"));
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Obtain a permanent mapping for the FACS. This is required for the
- * Global Lock and the Firmware Waking Vector
- */
- Status = AcpiTbInitializeFacs ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_WARNING ((AE_INFO, "Could not map the FACS table"));
- return_ACPI_STATUS (Status);
- }
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- /*
- * Install the default OpRegion handlers. These are installed unless
- * other handlers have already been installed via the
- * InstallAddressSpaceHandler interface.
- */
- if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Installing default address space handlers\n"));
-
- Status = AcpiEvInstallRegionHandlers ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
-#if (!ACPI_REDUCED_HARDWARE)
- /*
- * Initialize ACPI Event handling (Fixed and General Purpose)
- *
- * Note1: We must have the hardware and events initialized before we can
- * execute any control methods safely. Any control method can require
- * ACPI hardware support, so the hardware must be fully initialized before
- * any method execution!
- *
- * Note2: Fixed events are initialized and enabled here. GPEs are
- * initialized, but cannot be enabled until after the hardware is
- * completely initialized (SCI and GlobalLock activated) and the various
- * initialization control methods are run (_REG, _STA, _INI) on the
- * entire namespace.
- */
- if (!(Flags & ACPI_NO_EVENT_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Initializing ACPI events\n"));
-
- Status = AcpiEvInitializeEvents ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Install the SCI handler and Global Lock handler. This completes the
- * hardware initialization.
- */
- if (!(Flags & ACPI_NO_HANDLER_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Installing SCI/GL handlers\n"));
-
- Status = AcpiEvInstallXruptHandlers ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiEnableSubsystem)
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiInitializeObjects
- *
- * PARAMETERS: Flags - Init/enable Options
- *
- * RETURN: Status
- *
- * DESCRIPTION: Completes namespace initialization by initializing device
- * objects and executing AML code for Regions, buffers, etc.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiInitializeObjects (
- UINT32 Flags)
-{
- ACPI_STATUS Status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
-
-
- /*
- * Run all _REG methods
- *
- * Note: Any objects accessed by the _REG methods will be automatically
- * initialized, even if they contain executable AML (see the call to
- * AcpiNsInitializeObjects below).
- */
- if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Executing _REG OpRegion methods\n"));
-
- Status = AcpiEvInitializeOpRegions ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Execute any module-level code that was detected during the table load
- * phase. Although illegal since ACPI 2.0, there are many machines that
- * contain this type of code. Each block of detected executable AML code
- * outside of any control method is wrapped with a temporary control
- * method object and placed on a global list. The methods on this list
- * are executed below.
- */
- AcpiNsExecModuleCodeList ();
-
- /*
- * Initialize the objects that remain uninitialized. This runs the
- * executable AML that may be part of the declaration of these objects:
- * OperationRegions, BufferFields, Buffers, and Packages.
- */
- if (!(Flags & ACPI_NO_OBJECT_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Completing Initialization of ACPI Objects\n"));
-
- Status = AcpiNsInitializeObjects ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Initialize all device objects in the namespace. This runs the device
- * _STA and _INI methods.
- */
- if (!(Flags & ACPI_NO_DEVICE_INIT))
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "[Init] Initializing ACPI Devices\n"));
-
- Status = AcpiNsInitializeDevices ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
-
- /*
- * Empty the caches (delete the cached objects) on the assumption that
- * the table load filled them up more than they will be at runtime --
- * thus wasting non-paged memory.
- */
- Status = AcpiPurgeCachedObjects ();
-
- AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK;
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)
-
-
-#endif
-
/*******************************************************************************
*
* FUNCTION: AcpiTerminate
@@ -835,3 +526,98 @@ AcpiCheckAddressRange (
ACPI_EXPORT_SYMBOL (AcpiCheckAddressRange)
#endif /* !ACPI_ASL_COMPILER */
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDecodePldBuffer
+ *
+ * PARAMETERS: InBuffer - Buffer returned by _PLD method
+ * Length - Length of the InBuffer
+ * ReturnBuffer - Where the decode buffer is returned
+ *
+ * RETURN: Status and the decoded _PLD buffer. User must deallocate
+ * the buffer via ACPI_FREE.
+ *
+ * DESCRIPTION: Decode the bit-packed buffer returned by the _PLD method into
+ * a local struct that is much more useful to an ACPI driver.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDecodePldBuffer (
+ UINT8 *InBuffer,
+ ACPI_SIZE Length,
+ ACPI_PLD_INFO **ReturnBuffer)
+{
+ ACPI_PLD_INFO *PldInfo;
+ UINT32 *Buffer = ACPI_CAST_PTR (UINT32, InBuffer);
+ UINT32 Dword;
+
+
+ /* Parameter validation */
+
+ if (!InBuffer || !ReturnBuffer || (Length < 16))
+ {
+ return (AE_BAD_PARAMETER);
+ }
+
+ PldInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PLD_INFO));
+ if (!PldInfo)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* First 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]);
+ PldInfo->Revision = ACPI_PLD_GET_REVISION (&Dword);
+ PldInfo->IgnoreColor = ACPI_PLD_GET_IGNORE_COLOR (&Dword);
+ PldInfo->Color = ACPI_PLD_GET_COLOR (&Dword);
+
+ /* Second 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[1]);
+ PldInfo->Width = ACPI_PLD_GET_WIDTH (&Dword);
+ PldInfo->Height = ACPI_PLD_GET_HEIGHT(&Dword);
+
+ /* Third 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[2]);
+ PldInfo->UserVisible = ACPI_PLD_GET_USER_VISIBLE (&Dword);
+ PldInfo->Dock = ACPI_PLD_GET_DOCK (&Dword);
+ PldInfo->Lid = ACPI_PLD_GET_LID (&Dword);
+ PldInfo->Panel = ACPI_PLD_GET_PANEL (&Dword);
+ PldInfo->VerticalPosition = ACPI_PLD_GET_VERTICAL (&Dword);
+ PldInfo->HorizontalPosition = ACPI_PLD_GET_HORIZONTAL (&Dword);
+ PldInfo->Shape = ACPI_PLD_GET_SHAPE (&Dword);
+ PldInfo->GroupOrientation = ACPI_PLD_GET_ORIENTATION (&Dword);
+ PldInfo->GroupToken = ACPI_PLD_GET_TOKEN (&Dword);
+ PldInfo->GroupPosition = ACPI_PLD_GET_POSITION (&Dword);
+ PldInfo->Bay = ACPI_PLD_GET_BAY (&Dword);
+
+ /* Fourth 32-bit DWord */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[3]);
+ PldInfo->Ejectable = ACPI_PLD_GET_EJECTABLE (&Dword);
+ PldInfo->OspmEjectRequired = ACPI_PLD_GET_OSPM_EJECT (&Dword);
+ PldInfo->CabinetNumber = ACPI_PLD_GET_CABINET (&Dword);
+ PldInfo->CardCageNumber = ACPI_PLD_GET_CARD_CAGE (&Dword);
+ PldInfo->Reference = ACPI_PLD_GET_REFERENCE (&Dword);
+ PldInfo->Rotation = ACPI_PLD_GET_ROTATION (&Dword);
+ PldInfo->Order = ACPI_PLD_GET_ORDER (&Dword);
+
+ if (Length >= ACPI_PLD_BUFFER_SIZE)
+ {
+ /* Fifth 32-bit DWord (Revision 2 of _PLD) */
+
+ ACPI_MOVE_32_TO_32 (&Dword, &Buffer[4]);
+ PldInfo->VerticalOffset = ACPI_PLD_GET_VERT_OFFSET (&Dword);
+ PldInfo->HorizontalOffset = ACPI_PLD_GET_HORIZ_OFFSET (&Dword);
+ }
+
+ *ReturnBuffer = PldInfo;
+ return (AE_OK);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiDecodePldBuffer)
diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c
index 715c0f47f0f4..beeb7c7ce961 100644
--- a/source/components/utilities/utxferror.c
+++ b/source/components/utilities/utxferror.c
@@ -87,8 +87,8 @@ extern FILE *AcpiGbl_OutputFile;
#define ACPI_MSG_WARNING "ACPI Warning: "
#define ACPI_MSG_INFO "ACPI: "
-#define ACPI_MSG_BIOS_ERROR "ACPI Firmware Error: "
-#define ACPI_MSG_BIOS_WARNING "ACPI Firmware Warning: "
+#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Bug: Error: "
+#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Bug: Warning: "
/*
* Common message suffix
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
new file mode 100644
index 000000000000..733aa3b9bbfc
--- /dev/null
+++ b/source/components/utilities/utxfinit.c
@@ -0,0 +1,358 @@
+/******************************************************************************
+ *
+ * Module Name: utxfinit - External interfaces for ACPICA initialization
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+
+#define __UTXFINIT_C__
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acevents.h"
+#include "acnamesp.h"
+#include "acdebug.h"
+#include "actables.h"
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utxfinit")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiInitializeSubsystem
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Initializes all global variables. This is the first function
+ * called, so any early initialization belongs here.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInitializeSubsystem (
+ void)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInitializeSubsystem);
+
+
+ AcpiGbl_StartupFlags = ACPI_SUBSYSTEM_INITIALIZE;
+ ACPI_DEBUG_EXEC (AcpiUtInitStackPtrTrace ());
+
+ /* Initialize the OS-Dependent layer */
+
+ Status = AcpiOsInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During OSL initialization"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Initialize all globals used by the subsystem */
+
+ Status = AcpiUtInitGlobals ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During initialization of globals"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Create the default mutex objects */
+
+ Status = AcpiUtMutexInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Global Mutex creation"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /*
+ * Initialize the namespace manager and
+ * the root of the namespace tree
+ */
+ Status = AcpiNsRootInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Initialize the global OSI interfaces list with the static names */
+
+ Status = AcpiUtInitializeInterfaces ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization"));
+ return_ACPI_STATUS (Status);
+ }
+
+ /* If configured, initialize the AML debugger */
+
+ ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiInitializeSubsystem)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiEnableSubsystem
+ *
+ * PARAMETERS: Flags - Init/enable Options
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Completes the subsystem initialization including hardware.
+ * Puts system into ACPI mode if it isn't already.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiEnableSubsystem (
+ UINT32 Flags)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (AcpiEnableSubsystem);
+
+
+#if (!ACPI_REDUCED_HARDWARE)
+
+ /* Enable ACPI mode */
+
+ if (!(Flags & ACPI_NO_ACPI_ENABLE))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n"));
+
+ AcpiGbl_OriginalMode = AcpiHwGetMode();
+
+ Status = AcpiEnable ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_WARNING ((AE_INFO, "AcpiEnable failed"));
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Obtain a permanent mapping for the FACS. This is required for the
+ * Global Lock and the Firmware Waking Vector
+ */
+ Status = AcpiTbInitializeFacs ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_WARNING ((AE_INFO, "Could not map the FACS table"));
+ return_ACPI_STATUS (Status);
+ }
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+ /*
+ * Install the default OpRegion handlers. These are installed unless
+ * other handlers have already been installed via the
+ * InstallAddressSpaceHandler interface.
+ */
+ if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Installing default address space handlers\n"));
+
+ Status = AcpiEvInstallRegionHandlers ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+#if (!ACPI_REDUCED_HARDWARE)
+ /*
+ * Initialize ACPI Event handling (Fixed and General Purpose)
+ *
+ * Note1: We must have the hardware and events initialized before we can
+ * execute any control methods safely. Any control method can require
+ * ACPI hardware support, so the hardware must be fully initialized before
+ * any method execution!
+ *
+ * Note2: Fixed events are initialized and enabled here. GPEs are
+ * initialized, but cannot be enabled until after the hardware is
+ * completely initialized (SCI and GlobalLock activated) and the various
+ * initialization control methods are run (_REG, _STA, _INI) on the
+ * entire namespace.
+ */
+ if (!(Flags & ACPI_NO_EVENT_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Initializing ACPI events\n"));
+
+ Status = AcpiEvInitializeEvents ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Install the SCI handler and Global Lock handler. This completes the
+ * hardware initialization.
+ */
+ if (!(Flags & ACPI_NO_HANDLER_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Installing SCI/GL handlers\n"));
+
+ Status = AcpiEvInstallXruptHandlers ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiEnableSubsystem)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiInitializeObjects
+ *
+ * PARAMETERS: Flags - Init/enable Options
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Completes namespace initialization by initializing device
+ * objects and executing AML code for Regions, buffers, etc.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInitializeObjects (
+ UINT32 Flags)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
+
+
+ /*
+ * Run all _REG methods
+ *
+ * Note: Any objects accessed by the _REG methods will be automatically
+ * initialized, even if they contain executable AML (see the call to
+ * AcpiNsInitializeObjects below).
+ */
+ if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Executing _REG OpRegion methods\n"));
+
+ Status = AcpiEvInitializeOpRegions ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Execute any module-level code that was detected during the table load
+ * phase. Although illegal since ACPI 2.0, there are many machines that
+ * contain this type of code. Each block of detected executable AML code
+ * outside of any control method is wrapped with a temporary control
+ * method object and placed on a global list. The methods on this list
+ * are executed below.
+ */
+ AcpiNsExecModuleCodeList ();
+
+ /*
+ * Initialize the objects that remain uninitialized. This runs the
+ * executable AML that may be part of the declaration of these objects:
+ * OperationRegions, BufferFields, Buffers, and Packages.
+ */
+ if (!(Flags & ACPI_NO_OBJECT_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Completing Initialization of ACPI Objects\n"));
+
+ Status = AcpiNsInitializeObjects ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Initialize all device objects in the namespace. This runs the device
+ * _STA and _INI methods.
+ */
+ if (!(Flags & ACPI_NO_DEVICE_INIT))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Initializing ACPI Devices\n"));
+
+ Status = AcpiNsInitializeDevices ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ /*
+ * Empty the caches (delete the cached objects) on the assumption that
+ * the table load filled them up more than they will be at runtime --
+ * thus wasting non-paged memory.
+ */
+ Status = AcpiPurgeCachedObjects ();
+
+ AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK;
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)