diff options
Diffstat (limited to 'drivers/acpi/acpica/dsinit.c')
-rw-r--r-- | drivers/acpi/acpica/dsinit.c | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c index 96644d5ac0e1..aee5e45f6d35 100644 --- a/drivers/acpi/acpica/dsinit.c +++ b/drivers/acpi/acpica/dsinit.c | |||
@@ -83,8 +83,8 @@ acpi_ds_init_one_object(acpi_handle obj_handle, | |||
83 | (struct acpi_init_walk_info *)context; | 83 | (struct acpi_init_walk_info *)context; |
84 | struct acpi_namespace_node *node = | 84 | struct acpi_namespace_node *node = |
85 | (struct acpi_namespace_node *)obj_handle; | 85 | (struct acpi_namespace_node *)obj_handle; |
86 | acpi_object_type type; | ||
87 | acpi_status status; | 86 | acpi_status status; |
87 | union acpi_operand_object *obj_desc; | ||
88 | 88 | ||
89 | ACPI_FUNCTION_ENTRY(); | 89 | ACPI_FUNCTION_ENTRY(); |
90 | 90 | ||
@@ -100,9 +100,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle, | |||
100 | 100 | ||
101 | /* And even then, we are only interested in a few object types */ | 101 | /* And even then, we are only interested in a few object types */ |
102 | 102 | ||
103 | type = acpi_ns_get_type(obj_handle); | 103 | switch (acpi_ns_get_type(obj_handle)) { |
104 | |||
105 | switch (type) { | ||
106 | case ACPI_TYPE_REGION: | 104 | case ACPI_TYPE_REGION: |
107 | 105 | ||
108 | status = acpi_ds_initialize_region(obj_handle); | 106 | status = acpi_ds_initialize_region(obj_handle); |
@@ -117,8 +115,44 @@ acpi_ds_init_one_object(acpi_handle obj_handle, | |||
117 | break; | 115 | break; |
118 | 116 | ||
119 | case ACPI_TYPE_METHOD: | 117 | case ACPI_TYPE_METHOD: |
120 | 118 | /* | |
119 | * Auto-serialization support. We will examine each method that is | ||
120 | * not_serialized to determine if it creates any Named objects. If | ||
121 | * it does, it will be marked serialized to prevent problems if | ||
122 | * the method is entered by two or more threads and an attempt is | ||
123 | * made to create the same named object twice -- which results in | ||
124 | * an AE_ALREADY_EXISTS exception and method abort. | ||
125 | */ | ||
121 | info->method_count++; | 126 | info->method_count++; |
127 | obj_desc = acpi_ns_get_attached_object(node); | ||
128 | if (!obj_desc) { | ||
129 | break; | ||
130 | } | ||
131 | |||
132 | /* Ignore if already serialized */ | ||
133 | |||
134 | if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) { | ||
135 | info->serial_method_count++; | ||
136 | break; | ||
137 | } | ||
138 | |||
139 | if (acpi_gbl_auto_serialize_methods) { | ||
140 | |||
141 | /* Parse/scan method and serialize it if necessary */ | ||
142 | |||
143 | acpi_ds_auto_serialize_method(node, obj_desc); | ||
144 | if (obj_desc->method. | ||
145 | info_flags & ACPI_METHOD_SERIALIZED) { | ||
146 | |||
147 | /* Method was just converted to Serialized */ | ||
148 | |||
149 | info->serial_method_count++; | ||
150 | info->serialized_method_count++; | ||
151 | break; | ||
152 | } | ||
153 | } | ||
154 | |||
155 | info->non_serial_method_count++; | ||
122 | break; | 156 | break; |
123 | 157 | ||
124 | case ACPI_TYPE_DEVICE: | 158 | case ACPI_TYPE_DEVICE: |
@@ -170,7 +204,6 @@ acpi_ds_initialize_objects(u32 table_index, | |||
170 | 204 | ||
171 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, | 205 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, |
172 | "**** Starting initialization of namespace objects ****\n")); | 206 | "**** Starting initialization of namespace objects ****\n")); |
173 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "Parsing all Control Methods:")); | ||
174 | 207 | ||
175 | /* Set all init info to zero */ | 208 | /* Set all init info to zero */ |
176 | 209 | ||
@@ -205,14 +238,16 @@ acpi_ds_initialize_objects(u32 table_index, | |||
205 | } | 238 | } |
206 | 239 | ||
207 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, | 240 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, |
208 | "\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n", | 241 | "Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, " |
242 | "%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n", | ||
209 | table->signature, owner_id, info.object_count, | 243 | table->signature, owner_id, info.object_count, |
210 | info.device_count, info.method_count, | 244 | info.device_count, info.op_region_count, |
211 | info.op_region_count)); | 245 | info.method_count, info.serial_method_count, |
246 | info.non_serial_method_count, | ||
247 | info.serialized_method_count)); | ||
212 | 248 | ||
213 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, | 249 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n", |
214 | "%u Methods, %u Regions\n", info.method_count, | 250 | info.method_count, info.op_region_count)); |
215 | info.op_region_count)); | ||
216 | 251 | ||
217 | return_ACPI_STATUS(AE_OK); | 252 | return_ACPI_STATUS(AE_OK); |
218 | } | 253 | } |