aboutsummaryrefslogtreecommitdiff
path: root/source/components/executer
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2016-08-31 21:40:51 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2016-08-31 21:40:51 +0000
commitbe99e84498e91a5930864ef7b92b1a7ceb815e44 (patch)
tree7f5a2883a75b1713bdfe7d36ffa6217bac9187e2 /source/components/executer
parent8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d (diff)
Notes
Diffstat (limited to 'source/components/executer')
-rw-r--r--source/components/executer/exconcat.c3
-rw-r--r--source/components/executer/exconfig.c112
-rw-r--r--source/components/executer/exconvrt.c7
-rw-r--r--source/components/executer/exmisc.c3
-rw-r--r--source/components/executer/exoparg1.c7
-rw-r--r--source/components/executer/exresop.c10
-rw-r--r--source/components/executer/extrace.c28
-rw-r--r--source/components/executer/exutils.c10
8 files changed, 52 insertions, 128 deletions
diff --git a/source/components/executer/exconcat.c b/source/components/executer/exconcat.c
index 49b279ad05d1..22091b5bde3d 100644
--- a/source/components/executer/exconcat.c
+++ b/source/components/executer/exconcat.c
@@ -164,7 +164,8 @@ AcpiExDoConcatenate (
{
case ACPI_TYPE_INTEGER:
- Status = AcpiExConvertToInteger (LocalOperand1, &TempOperand1, 16);
+ Status = AcpiExConvertToInteger (LocalOperand1, &TempOperand1,
+ ACPI_STRTOUL_BASE16);
break;
case ACPI_TYPE_BUFFER:
diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c
index bb0d2bb411d1..7e2f6996cf3e 100644
--- a/source/components/executer/exconfig.c
+++ b/source/components/executer/exconfig.c
@@ -59,7 +59,6 @@
static ACPI_STATUS
AcpiExAddTable (
UINT32 TableIndex,
- ACPI_NAMESPACE_NODE *ParentNode,
ACPI_OPERAND_OBJECT **DdbHandle);
static ACPI_STATUS
@@ -87,12 +86,9 @@ AcpiExRegionRead (
static ACPI_STATUS
AcpiExAddTable (
UINT32 TableIndex,
- ACPI_NAMESPACE_NODE *ParentNode,
ACPI_OPERAND_OBJECT **DdbHandle)
{
ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_STATUS Status;
- ACPI_OWNER_ID OwnerId;
ACPI_FUNCTION_TRACE (ExAddTable);
@@ -110,42 +106,8 @@ AcpiExAddTable (
ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID;
ObjDesc->Reference.Class = ACPI_REFCLASS_TABLE;
- *DdbHandle = ObjDesc;
-
- /* Install the new table into the local data structures */
-
ObjDesc->Reference.Value = TableIndex;
-
- /* Add the table to the namespace */
-
- Status = AcpiNsLoadTable (TableIndex, ParentNode);
- if (ACPI_FAILURE (Status))
- {
- AcpiUtRemoveReference (ObjDesc);
- *DdbHandle = NULL;
- return_ACPI_STATUS (Status);
- }
-
- /* Execute any module-level code that was found in the table */
-
- AcpiExExitInterpreter ();
- if (AcpiGbl_GroupModuleLevelCode)
- {
- AcpiNsExecModuleCodeList ();
- }
- AcpiExEnterInterpreter ();
-
- /*
- * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
- * responsible for discovering any new wake GPEs by running _PRW methods
- * that may have been loaded by this table.
- */
- Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
- if (ACPI_SUCCESS (Status))
- {
- AcpiEvUpdateGpes (OwnerId);
- }
-
+ *DdbHandle = ObjDesc;
return_ACPI_STATUS (AE_OK);
}
@@ -174,7 +136,6 @@ AcpiExLoadTableOp (
ACPI_NAMESPACE_NODE *StartNode;
ACPI_NAMESPACE_NODE *ParameterNode = NULL;
ACPI_OPERAND_OBJECT *DdbHandle;
- ACPI_TABLE_HEADER *Table;
UINT32 TableIndex;
@@ -183,10 +144,12 @@ AcpiExLoadTableOp (
/* Find the ACPI table in the RSDT/XSDT */
+ AcpiExExitInterpreter ();
Status = AcpiTbFindTable (
Operand[0]->String.Pointer,
Operand[1]->String.Pointer,
Operand[2]->String.Pointer, &TableIndex);
+ AcpiExEnterInterpreter ();
if (ACPI_FAILURE (Status))
{
if (Status != AE_NOT_FOUND)
@@ -219,8 +182,9 @@ AcpiExLoadTableOp (
* Find the node referenced by the RootPathString. This is the
* location within the namespace where the table will be loaded.
*/
- Status = AcpiNsGetNode (StartNode, Operand[3]->String.Pointer,
- ACPI_NS_SEARCH_PARENT, &ParentNode);
+ Status = AcpiNsGetNodeUnlocked (StartNode,
+ Operand[3]->String.Pointer, ACPI_NS_SEARCH_PARENT,
+ &ParentNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -243,8 +207,9 @@ AcpiExLoadTableOp (
/* Find the node referenced by the ParameterPathString */
- Status = AcpiNsGetNode (StartNode, Operand[4]->String.Pointer,
- ACPI_NS_SEARCH_PARENT, &ParameterNode);
+ Status = AcpiNsGetNodeUnlocked (StartNode,
+ Operand[4]->String.Pointer, ACPI_NS_SEARCH_PARENT,
+ &ParameterNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -253,7 +218,16 @@ AcpiExLoadTableOp (
/* Load the table into the namespace */
- Status = AcpiExAddTable (TableIndex, ParentNode, &DdbHandle);
+ ACPI_INFO (("Dynamic OEM Table Load:"));
+ AcpiExExitInterpreter ();
+ Status = AcpiTbLoadTable (TableIndex, ParentNode);
+ AcpiExEnterInterpreter ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ Status = AcpiExAddTable (TableIndex, &DdbHandle);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -276,21 +250,6 @@ AcpiExLoadTableOp (
}
}
- Status = AcpiGetTableByIndex (TableIndex, &Table);
- if (ACPI_SUCCESS (Status))
- {
- ACPI_INFO (("Dynamic OEM Table Load:"));
- AcpiTbPrintTableHeader (0, Table);
- }
-
- /* Invoke table handler if present */
-
- if (AcpiGbl_TableHandler)
- {
- (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
- AcpiGbl_TableHandlerContext);
- }
-
*ReturnDesc = DdbHandle;
return_ACPI_STATUS (Status);
}
@@ -520,13 +479,10 @@ AcpiExLoadOp (
/* Install the new table into the local data structures */
ACPI_INFO (("Dynamic OEM Table Load:"));
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
-
- Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
- ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
- &TableIndex);
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ AcpiExExitInterpreter ();
+ Status = AcpiTbInstallAndLoadTable (Table, ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, &TableIndex);
+ AcpiExEnterInterpreter ();
if (ACPI_FAILURE (Status))
{
/* Delete allocated table buffer */
@@ -536,24 +492,13 @@ AcpiExLoadOp (
}
/*
- * Note: Now table is "INSTALLED", it must be validated before
- * loading.
- */
- Status = AcpiTbValidateTable (
- &AcpiGbl_RootTableList.Tables[TableIndex]);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /*
* Add the table to the namespace.
*
* Note: Load the table objects relative to the root of the namespace.
* This appears to go against the ACPI specification, but we do it for
* compatibility with other ACPI implementations.
*/
- Status = AcpiExAddTable (TableIndex, AcpiGbl_RootNode, &DdbHandle);
+ Status = AcpiExAddTable (TableIndex, &DdbHandle);
if (ACPI_FAILURE (Status))
{
/* On error, TablePtr was deallocated above */
@@ -577,15 +522,6 @@ AcpiExLoadOp (
/* Remove the reference by added by AcpiExStore above */
AcpiUtRemoveReference (DdbHandle);
-
- /* Invoke table handler if present */
-
- if (AcpiGbl_TableHandler)
- {
- (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
- AcpiGbl_TableHandlerContext);
- }
-
return_ACPI_STATUS (Status);
}
diff --git a/source/components/executer/exconvrt.c b/source/components/executer/exconvrt.c
index ea6f82620dd1..5e0f5499aa4a 100644
--- a/source/components/executer/exconvrt.c
+++ b/source/components/executer/exconvrt.c
@@ -137,8 +137,8 @@ AcpiExConvertToInteger (
* of ACPI 3.0) is that the ToInteger() operator allows both decimal
* and hexadecimal strings (hex prefixed with "0x").
*/
- Status = AcpiUtStrtoul64 ((char *) Pointer, Flags,
- AcpiGbl_IntegerByteWidth, &Result);
+ Status = AcpiUtStrtoul64 (ACPI_CAST_PTR (char, Pointer),
+ (AcpiGbl_IntegerByteWidth | Flags), &Result);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -684,7 +684,8 @@ AcpiExConvertToTargetType (
* These types require an Integer operand. We can convert
* a Buffer or a String to an Integer if necessary.
*/
- Status = AcpiExConvertToInteger (SourceDesc, ResultDesc, 16);
+ Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,
+ ACPI_STRTOUL_BASE16);
break;
case ACPI_TYPE_STRING:
diff --git a/source/components/executer/exmisc.c b/source/components/executer/exmisc.c
index a8e5497a9de7..21e30f0f570c 100644
--- a/source/components/executer/exmisc.c
+++ b/source/components/executer/exmisc.c
@@ -360,7 +360,8 @@ AcpiExDoLogicalOp (
{
case ACPI_TYPE_INTEGER:
- Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16);
+ Status = AcpiExConvertToInteger (Operand1, &LocalOperand1,
+ ACPI_STRTOUL_BASE16);
break;
case ACPI_TYPE_STRING:
diff --git a/source/components/executer/exoparg1.c b/source/components/executer/exoparg1.c
index 5a45bead06f9..d91d8c55bce3 100644
--- a/source/components/executer/exoparg1.c
+++ b/source/components/executer/exoparg1.c
@@ -550,8 +550,9 @@ AcpiExOpcode_1A_1T_1R (
case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */
- Status = AcpiExConvertToInteger (
- Operand[0], &ReturnDesc, ACPI_ANY_BASE);
+ /* Perform "explicit" conversion */
+
+ Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc, 0);
if (ReturnDesc == Operand[0])
{
/* No conversion performed, add ref to handle return value */
@@ -936,7 +937,7 @@ AcpiExOpcode_1A_0T_1R (
* 2) Dereference the node to an actual object. Could be a
* Field, so we need to resolve the node to a value.
*/
- Status = AcpiNsGetNode (WalkState->ScopeInfo->Scope.Node,
+ Status = AcpiNsGetNodeUnlocked (WalkState->ScopeInfo->Scope.Node,
Operand[0]->String.Pointer,
ACPI_NS_SEARCH_PARENT,
ACPI_CAST_INDIRECT_PTR (
diff --git a/source/components/executer/exresop.c b/source/components/executer/exresop.c
index 32ceb6f0217b..d4352e297c16 100644
--- a/source/components/executer/exresop.c
+++ b/source/components/executer/exresop.c
@@ -428,11 +428,13 @@ AcpiExResolveOperands (
case ARGI_INTEGER:
/*
- * Need an operand of type ACPI_TYPE_INTEGER,
- * But we can implicitly convert from a STRING or BUFFER
- * Aka - "Implicit Source Operand Conversion"
+ * Need an operand of type ACPI_TYPE_INTEGER, but we can
+ * implicitly convert from a STRING or BUFFER.
+ *
+ * Known as "Implicit Source Operand Conversion"
*/
- Status = AcpiExConvertToInteger (ObjDesc, StackPtr, 16);
+ Status = AcpiExConvertToInteger (ObjDesc, StackPtr,
+ ACPI_STRTOUL_BASE16);
if (ACPI_FAILURE (Status))
{
if (Status == AE_TYPE)
diff --git a/source/components/executer/extrace.c b/source/components/executer/extrace.c
index 6f8a707ae417..6eaf6e70d630 100644
--- a/source/components/executer/extrace.c
+++ b/source/components/executer/extrace.c
@@ -226,7 +226,6 @@ AcpiExStartTraceMethod (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
- ACPI_STATUS Status;
char *Pathname = NULL;
BOOLEAN Enabled = FALSE;
@@ -239,12 +238,6 @@ AcpiExStartTraceMethod (
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
}
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- goto Exit;
- }
-
Enabled = AcpiExInterpreterTraceEnabled (Pathname);
if (Enabled && !AcpiGbl_TraceMethodObject)
{
@@ -265,9 +258,6 @@ AcpiExStartTraceMethod (
}
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
-Exit:
if (Enabled)
{
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
@@ -302,7 +292,6 @@ AcpiExStopTraceMethod (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
- ACPI_STATUS Status;
char *Pathname = NULL;
BOOLEAN Enabled;
@@ -315,28 +304,14 @@ AcpiExStopTraceMethod (
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
}
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- goto ExitPath;
- }
-
Enabled = AcpiExInterpreterTraceEnabled (NULL);
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
if (Enabled)
{
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
}
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- goto ExitPath;
- }
-
/* Check whether the tracer should be stopped */
if (AcpiGbl_TraceMethodObject == ObjDesc)
@@ -353,9 +328,6 @@ AcpiExStopTraceMethod (
AcpiGbl_TraceMethodObject = NULL;
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
-
-ExitPath:
if (Pathname)
{
ACPI_FREE (Pathname);
diff --git a/source/components/executer/exutils.c b/source/components/executer/exutils.c
index 4843a2089143..edaee5526bec 100644
--- a/source/components/executer/exutils.c
+++ b/source/components/executer/exutils.c
@@ -103,6 +103,11 @@ AcpiExEnterInterpreter (
{
ACPI_ERROR ((AE_INFO, "Could not acquire AML Interpreter mutex"));
}
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_ERROR ((AE_INFO, "Could not acquire AML Namespace mutex"));
+ }
return_VOID;
}
@@ -141,6 +146,11 @@ AcpiExExitInterpreter (
ACPI_FUNCTION_TRACE (ExExitInterpreter);
+ Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_ERROR ((AE_INFO, "Could not release AML Namespace mutex"));
+ }
Status = AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
if (ACPI_FAILURE (Status))
{