summaryrefslogtreecommitdiff
path: root/source/components/dispatcher/dsinit.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2014-02-17 17:10:41 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2014-02-17 17:10:41 +0000
commit526d99544ba42a5a2155021975b3b97da425819e (patch)
treef33eb960cbd87cb5fa516e45153eb6351dc8ea2e /source/components/dispatcher/dsinit.c
parent7bf0bd8c239ae7e6cb5c98382db85377146519d6 (diff)
Notes
Diffstat (limited to 'source/components/dispatcher/dsinit.c')
-rw-r--r--source/components/dispatcher/dsinit.c61
1 files changed, 49 insertions, 12 deletions
diff --git a/source/components/dispatcher/dsinit.c b/source/components/dispatcher/dsinit.c
index 47a42bc98f6b9..3e7977d72c278 100644
--- a/source/components/dispatcher/dsinit.c
+++ b/source/components/dispatcher/dsinit.c
@@ -52,6 +52,7 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsinit")
+
/* Local prototypes */
static ACPI_STATUS
@@ -91,8 +92,8 @@ AcpiDsInitOneObject (
{
ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
- ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_FUNCTION_ENTRY ();
@@ -111,9 +112,7 @@ AcpiDsInitOneObject (
/* And even then, we are only interested in a few object types */
- Type = AcpiNsGetType (ObjHandle);
-
- switch (Type)
+ switch (AcpiNsGetType (ObjHandle))
{
case ACPI_TYPE_REGION:
@@ -129,8 +128,45 @@ AcpiDsInitOneObject (
break;
case ACPI_TYPE_METHOD:
-
+ /*
+ * Auto-serialization support. We will examine each method that is
+ * NotSerialized to determine if it creates any Named objects. If
+ * it does, it will be marked serialized to prevent problems if
+ * the method is entered by two or more threads and an attempt is
+ * made to create the same named object twice -- which results in
+ * an AE_ALREADY_EXISTS exception and method abort.
+ */
Info->MethodCount++;
+ ObjDesc = AcpiNsGetAttachedObject (Node);
+ if (!ObjDesc)
+ {
+ break;
+ }
+
+ /* Ignore if already serialized */
+
+ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
+ {
+ Info->SerialMethodCount++;
+ break;
+ }
+
+ if (AcpiGbl_AutoSerializeMethods)
+ {
+ /* Parse/scan method and serialize it if necessary */
+
+ AcpiDsAutoSerializeMethod (Node, ObjDesc);
+ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
+ {
+ /* Method was just converted to Serialized */
+
+ Info->SerialMethodCount++;
+ Info->SerializedMethodCount++;
+ break;
+ }
+ }
+
+ Info->NonSerialMethodCount++;
break;
case ACPI_TYPE_DEVICE:
@@ -187,7 +223,6 @@ AcpiDsInitializeObjects (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
/* Set all init info to zero */
@@ -223,12 +258,14 @@ AcpiDsInitializeObjects (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- "\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
- Table->Signature, OwnerId, Info.ObjectCount,
- Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount));
+ "Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, "
+ "%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n",
+ Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount,
+ Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
+ Info.NonSerialMethodCount, Info.SerializedMethodCount));
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
+ Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}