[ACPICA]
[reactos.git] / reactos / drivers / bus / acpi / acpica / events / evregion.c
index 25a7900..24848db 100644 (file)
@@ -732,10 +732,17 @@ AcpiEvExecuteRegMethods (
     ACPI_ADR_SPACE_TYPE     SpaceId)
 {
     ACPI_STATUS             Status;
+    ACPI_REG_WALK_INFO      Info;
 
 
     ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
 
+    Info.SpaceId = SpaceId;
+    Info.RegRunCount = 0;
+
+    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
+        "    Running _REG methods for SpaceId %s\n",
+        AcpiUtGetRegionName (Info.SpaceId)));
 
     /*
      * Run all _REG methods for all Operation Regions for this space ID. This
@@ -744,8 +751,7 @@ AcpiEvExecuteRegMethods (
      * regions of this Space ID before we can run any _REG methods)
      */
     Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
-                ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL,
-                &SpaceId, NULL);
+        ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL);
 
     /* Special case for EC: handle "orphan" _REG methods with no region */
 
@@ -754,6 +760,10 @@ AcpiEvExecuteRegMethods (
         AcpiEvOrphanEcRegMethod (Node);
     }
 
+    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
+        "    Executed %u _REG methods for SpaceId %s\n",
+        Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId)));
+
     return_ACPI_STATUS (Status);
 }
 
@@ -777,11 +787,11 @@ AcpiEvRegRun (
 {
     ACPI_OPERAND_OBJECT     *ObjDesc;
     ACPI_NAMESPACE_NODE     *Node;
-    ACPI_ADR_SPACE_TYPE     SpaceId;
     ACPI_STATUS             Status;
+    ACPI_REG_WALK_INFO      *Info;
 
 
-    SpaceId = *ACPI_CAST_PTR (ACPI_ADR_SPACE_TYPE, Context);
+    Info = ACPI_CAST_PTR (ACPI_REG_WALK_INFO, Context);
 
     /* Convert and validate the device handle */
 
@@ -813,13 +823,14 @@ AcpiEvRegRun (
 
     /* Object is a Region */
 
-    if (ObjDesc->Region.SpaceId != SpaceId)
+    if (ObjDesc->Region.SpaceId != Info->SpaceId)
     {
         /* This region is for a different address space, just ignore it */
 
         return (AE_OK);
     }
 
+    Info->RegRunCount++;
     Status = AcpiEvExecuteRegMethod (ObjDesc, ACPI_REG_CONNECT);
     return (Status);
 }