summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/nsinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/nsinit.c')
-rw-r--r--sys/contrib/dev/acpica/nsinit.c71
1 files changed, 42 insertions, 29 deletions
diff --git a/sys/contrib/dev/acpica/nsinit.c b/sys/contrib/dev/acpica/nsinit.c
index 87cae8d..16f05b0 100644
--- a/sys/contrib/dev/acpica/nsinit.c
+++ b/sys/contrib/dev/acpica/nsinit.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: nsinit - namespace initialization
- * $Revision: 55 $
+ * $Revision: 57 $
*
*****************************************************************************/
@@ -220,10 +220,18 @@ AcpiNsInitializeDevices (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Executing all Device _STA and_INI methods:"));
- /* Walk namespace for all objects of type Device */
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Walk namespace for all objects of type Device or Processor */
- Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, &Info, NULL);
+ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, TRUE, AcpiNsInitOneDevice, &Info, NULL);
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
@@ -373,7 +381,8 @@ AcpiNsInitOneObject (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Could not execute arguments for [%4.4s] (%s), %s\n",
- Node->Name.Ascii, AcpiUtGetTypeName (Type), AcpiFormatException (Status)));
+ AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Type),
+ AcpiFormatException (Status)));
}
/* Print a dot for each object unless we are going to print the entire pathname */
@@ -422,51 +431,55 @@ AcpiNsInitOneDevice (
ACPI_FUNCTION_TRACE ("NsInitOneDevice");
- if ((AcpiDbgLevel <= ACPI_LV_ALL_EXCEPTIONS) && (!(AcpiDbgLevel & ACPI_LV_INFO)))
+ Node = AcpiNsMapHandleToNode (ObjHandle);
+ if (!Node)
{
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- Info->DeviceCount++;
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
+ /*
+ * We will run _STA/_INI on Devices and Processors only
+ */
+ if ((Node->Type != ACPI_TYPE_DEVICE) &&
+ (Node->Type != ACPI_TYPE_PROCESSOR))
{
- return_ACPI_STATUS (Status);
+ return_ACPI_STATUS (AE_OK);
}
- Node = AcpiNsMapHandleToNode (ObjHandle);
- if (!Node)
+ if ((AcpiDbgLevel <= ACPI_LV_ALL_EXCEPTIONS) && (!(AcpiDbgLevel & ACPI_LV_INFO)))
{
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
- return_ACPI_STATUS (AE_BAD_PARAMETER);
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
}
- Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
+ Info->DeviceCount++;
/*
* Run _STA to determine if we can run _INI on the device.
*/
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_METHOD, Node, "_STA"));
Status = AcpiUtExecute_STA (Node, &Flags);
+
if (ACPI_FAILURE (Status))
{
- /* Ignore error and move on to next device */
-
- return_ACPI_STATUS (AE_OK);
- }
+ if (Node->Type == ACPI_TYPE_DEVICE)
+ {
+ /* Ignore error and move on to next device */
- Info->Num_STA++;
+ return_ACPI_STATUS (AE_OK);
+ }
- if (!(Flags & 0x01))
+ /* _STA is not required for Processor objects */
+ }
+ else
{
- /* don't look at children of a not present device */
+ Info->Num_STA++;
- return_ACPI_STATUS(AE_CTRL_DEPTH);
+ if (!(Flags & 0x01))
+ {
+ /* Don't look at children of a not present device */
+
+ return_ACPI_STATUS(AE_CTRL_DEPTH);
+ }
}
/*
OpenPOWER on IntegriCloud