diff options
author | Bob Moore <robert.moore@intel.com> | 2006-05-12 17:12:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-14 02:34:48 -0400 |
commit | 958dd242b691f64ab4632b4903dbb1e16fee8269 (patch) | |
tree | ddf4932fb4e3023dd0d1914571f17f2e3b03978d /drivers | |
parent | b229cf92eee616c7cb5ad8cdb35a19b119f00bc8 (diff) |
ACPI: ACPICA 20060512
Replaced the acpi_os_queue_for_execution() with a new
interface named acpi_os_execute(). The major difference is
that the new interface does not have a Priority parameter,
this appeared to be useless and has been replaced by
a Type parameter. The Type tells the OS what type of
execution is being requested, such as global lock handler,
notify handler, GPE handler, etc. This allows the host
to queue and execute the request as appropriate for the
request type, possibly using different work queues and
different priorities for the various request types. This
enables fixes for multithreading deadlock problems such as
http://bugzilla.kernel.org/show_bug.cgi?id=5534
(Alexey Starikovskiy and Bob Moore)
Fixed a possible memory leak associated with the
support for the so-called "implicit return" ACPI
extension. Reported by FreeBSD (Fiodor Suietov)
http://bugzilla.kernel.org/show_bug.cgi?id=6514
Fixed a problem with the Load() operator where a table
load from an operation region could overwrite an internal
table buffer by up to 7 bytes and cause alignment faults
on IPF systems. (With assistance from Luming Yu)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/dispatcher/dsmethod.c | 23 | ||||
-rw-r--r-- | drivers/acpi/dispatcher/dsmthdat.c | 6 | ||||
-rw-r--r-- | drivers/acpi/dispatcher/dswload.c | 41 | ||||
-rw-r--r-- | drivers/acpi/events/evgpe.c | 8 | ||||
-rw-r--r-- | drivers/acpi/events/evmisc.c | 10 | ||||
-rw-r--r-- | drivers/acpi/events/evregion.c | 7 | ||||
-rw-r--r-- | drivers/acpi/executer/exconfig.c | 17 | ||||
-rw-r--r-- | drivers/acpi/executer/exstorob.c | 2 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsaccess.c | 8 | ||||
-rw-r--r-- | drivers/acpi/namespace/nssearch.c | 7 | ||||
-rw-r--r-- | drivers/acpi/resources/rscalc.c | 4 | ||||
-rw-r--r-- | drivers/acpi/resources/rscreate.c | 2 | ||||
-rw-r--r-- | drivers/acpi/resources/rsutils.c | 5 | ||||
-rw-r--r-- | drivers/acpi/tables/tbrsdt.c | 6 | ||||
-rw-r--r-- | drivers/acpi/tables/tbxfroot.c | 16 | ||||
-rw-r--r-- | drivers/acpi/utilities/utglobal.c | 8 |
16 files changed, 107 insertions, 63 deletions
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c index 651f2b68531b..e348db0e541e 100644 --- a/drivers/acpi/dispatcher/dsmethod.c +++ b/drivers/acpi/dispatcher/dsmethod.c | |||
@@ -385,6 +385,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, | |||
385 | union acpi_operand_object *return_desc) | 385 | union acpi_operand_object *return_desc) |
386 | { | 386 | { |
387 | acpi_status status; | 387 | acpi_status status; |
388 | int same_as_implicit_return; | ||
388 | 389 | ||
389 | ACPI_FUNCTION_TRACE_PTR(ds_restart_control_method, walk_state); | 390 | ACPI_FUNCTION_TRACE_PTR(ds_restart_control_method, walk_state); |
390 | 391 | ||
@@ -402,6 +403,11 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, | |||
402 | 403 | ||
403 | if (return_desc) { | 404 | if (return_desc) { |
404 | 405 | ||
406 | /* Is the implicit return object the same as the return desc? */ | ||
407 | |||
408 | same_as_implicit_return = | ||
409 | (walk_state->implicit_return_obj == return_desc); | ||
410 | |||
405 | /* Are we actually going to use the return value? */ | 411 | /* Are we actually going to use the return value? */ |
406 | 412 | ||
407 | if (walk_state->return_used) { | 413 | if (walk_state->return_used) { |
@@ -422,18 +428,23 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, | |||
422 | } | 428 | } |
423 | 429 | ||
424 | /* | 430 | /* |
425 | * The following code is the | 431 | * The following code is the optional support for the so-called |
426 | * optional support for a so-called "implicit return". Some AML code | 432 | * "implicit return". Some AML code assumes that the last value of the |
427 | * assumes that the last value of the method is "implicitly" returned | 433 | * method is "implicitly" returned to the caller, in the absence of an |
428 | * to the caller. Just save the last result as the return value. | 434 | * explicit return value. |
435 | * | ||
436 | * Just save the last result of the method as the return value. | ||
437 | * | ||
429 | * NOTE: this is optional because the ASL language does not actually | 438 | * NOTE: this is optional because the ASL language does not actually |
430 | * support this behavior. | 439 | * support this behavior. |
431 | */ | 440 | */ |
432 | else if (!acpi_ds_do_implicit_return | 441 | else if (!acpi_ds_do_implicit_return |
433 | (return_desc, walk_state, FALSE)) { | 442 | (return_desc, walk_state, FALSE) |
443 | || same_as_implicit_return) { | ||
434 | /* | 444 | /* |
435 | * Delete the return value if it will not be used by the | 445 | * Delete the return value if it will not be used by the |
436 | * calling method | 446 | * calling method or remove one reference if the explicit return |
447 | * is the same as the implicit return value. | ||
437 | */ | 448 | */ |
438 | acpi_ut_remove_reference(return_desc); | 449 | acpi_ut_remove_reference(return_desc); |
439 | } | 450 | } |
diff --git a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c index b47c54fad86d..459160ff9058 100644 --- a/drivers/acpi/dispatcher/dsmthdat.c +++ b/drivers/acpi/dispatcher/dsmthdat.c | |||
@@ -336,7 +336,7 @@ acpi_ds_method_data_set_value(u16 opcode, | |||
336 | * Increment ref count so object can't be deleted while installed. | 336 | * Increment ref count so object can't be deleted while installed. |
337 | * NOTE: We do not copy the object in order to preserve the call by | 337 | * NOTE: We do not copy the object in order to preserve the call by |
338 | * reference semantics of ACPI Control Method invocation. | 338 | * reference semantics of ACPI Control Method invocation. |
339 | * (See ACPI specification 2.0_c) | 339 | * (See ACPI Specification 2.0_c) |
340 | */ | 340 | */ |
341 | acpi_ut_add_reference(object); | 341 | acpi_ut_add_reference(object); |
342 | 342 | ||
@@ -351,7 +351,7 @@ acpi_ds_method_data_set_value(u16 opcode, | |||
351 | * FUNCTION: acpi_ds_method_data_get_value | 351 | * FUNCTION: acpi_ds_method_data_get_value |
352 | * | 352 | * |
353 | * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP | 353 | * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP |
354 | * Index - which local_var or argument to get | 354 | * Index - Which local_var or argument to get |
355 | * walk_state - Current walk state object | 355 | * walk_state - Current walk state object |
356 | * dest_desc - Where Arg or Local value is returned | 356 | * dest_desc - Where Arg or Local value is returned |
357 | * | 357 | * |
@@ -459,7 +459,7 @@ acpi_ds_method_data_get_value(u16 opcode, | |||
459 | * FUNCTION: acpi_ds_method_data_delete_value | 459 | * FUNCTION: acpi_ds_method_data_delete_value |
460 | * | 460 | * |
461 | * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP | 461 | * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP |
462 | * Index - which local_var or argument to delete | 462 | * Index - Which local_var or argument to delete |
463 | * walk_state - Current walk state object | 463 | * walk_state - Current walk state object |
464 | * | 464 | * |
465 | * RETURN: None | 465 | * RETURN: None |
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c index a8deb700cf33..35074399c617 100644 --- a/drivers/acpi/dispatcher/dswload.c +++ b/drivers/acpi/dispatcher/dswload.c | |||
@@ -178,12 +178,12 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, | |||
178 | * Target of Scope() not found. Generate an External for it, and | 178 | * Target of Scope() not found. Generate an External for it, and |
179 | * insert the name into the namespace. | 179 | * insert the name into the namespace. |
180 | */ | 180 | */ |
181 | acpi_dm_add_to_external_list(path); | 181 | acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0); |
182 | status = | 182 | status = |
183 | acpi_ns_lookup(walk_state->scope_info, path, | 183 | acpi_ns_lookup(walk_state->scope_info, path, |
184 | object_type, ACPI_IMODE_LOAD_PASS1, | 184 | object_type, ACPI_IMODE_LOAD_PASS1, |
185 | ACPI_NS_SEARCH_PARENT, walk_state, | 185 | ACPI_NS_SEARCH_PARENT, walk_state, |
186 | &(node)); | 186 | &node); |
187 | } | 187 | } |
188 | #endif | 188 | #endif |
189 | if (ACPI_FAILURE(status)) { | 189 | if (ACPI_FAILURE(status)) { |
@@ -301,10 +301,41 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, | |||
301 | status = | 301 | status = |
302 | acpi_ns_lookup(walk_state->scope_info, path, object_type, | 302 | acpi_ns_lookup(walk_state->scope_info, path, object_type, |
303 | ACPI_IMODE_LOAD_PASS1, flags, walk_state, | 303 | ACPI_IMODE_LOAD_PASS1, flags, walk_state, |
304 | &(node)); | 304 | &node); |
305 | if (ACPI_FAILURE(status)) { | 305 | if (ACPI_FAILURE(status)) { |
306 | ACPI_ERROR_NAMESPACE(path, status); | 306 | if (status == AE_ALREADY_EXISTS) { |
307 | return_ACPI_STATUS(status); | 307 | |
308 | /* The name already exists in this scope */ | ||
309 | |||
310 | if (node->flags & ANOBJ_IS_EXTERNAL) { | ||
311 | /* | ||
312 | * Allow one create on an object or segment that was | ||
313 | * previously declared External | ||
314 | */ | ||
315 | node->flags &= ~ANOBJ_IS_EXTERNAL; | ||
316 | node->type = (u8) object_type; | ||
317 | |||
318 | /* Just retyped a node, probably will need to open a scope */ | ||
319 | |||
320 | if (acpi_ns_opens_scope(object_type)) { | ||
321 | status = | ||
322 | acpi_ds_scope_stack_push | ||
323 | (node, object_type, | ||
324 | walk_state); | ||
325 | if (ACPI_FAILURE(status)) { | ||
326 | return_ACPI_STATUS | ||
327 | (status); | ||
328 | } | ||
329 | } | ||
330 | status = AE_OK; | ||
331 | } | ||
332 | } | ||
333 | |||
334 | if (ACPI_FAILURE(status)) { | ||
335 | |||
336 | ACPI_ERROR_NAMESPACE(path, status); | ||
337 | return_ACPI_STATUS(status); | ||
338 | } | ||
308 | } | 339 | } |
309 | break; | 340 | break; |
310 | } | 341 | } |
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c index 25fd12a29a29..aa179dc78011 100644 --- a/drivers/acpi/events/evgpe.c +++ b/drivers/acpi/events/evgpe.c | |||
@@ -489,7 +489,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) | |||
489 | * RETURN: None | 489 | * RETURN: None |
490 | * | 490 | * |
491 | * DESCRIPTION: Perform the actual execution of a GPE control method. This | 491 | * DESCRIPTION: Perform the actual execution of a GPE control method. This |
492 | * function is called from an invocation of acpi_os_queue_for_execution | 492 | * function is called from an invocation of acpi_os_exece |
493 | * (and therefore does NOT execute at interrupt level) so that | 493 | * (and therefore does NOT execute at interrupt level) so that |
494 | * the control method itself is not executed in the context of | 494 | * the control method itself is not executed in the context of |
495 | * an interrupt handler. | 495 | * an interrupt handler. |
@@ -674,9 +674,9 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) | |||
674 | * Execute the method associated with the GPE | 674 | * Execute the method associated with the GPE |
675 | * NOTE: Level-triggered GPEs are cleared after the method completes. | 675 | * NOTE: Level-triggered GPEs are cleared after the method completes. |
676 | */ | 676 | */ |
677 | status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, | 677 | status = acpi_os_execute(OSL_GPE_HANDLER, |
678 | acpi_ev_asynch_execute_gpe_method, | 678 | acpi_ev_asynch_execute_gpe_method, |
679 | gpe_event_info); | 679 | gpe_event_info); |
680 | if (ACPI_FAILURE(status)) { | 680 | if (ACPI_FAILURE(status)) { |
681 | ACPI_EXCEPTION((AE_INFO, status, | 681 | ACPI_EXCEPTION((AE_INFO, status, |
682 | "Unable to queue handler for GPE[%2X] - event disabled", | 682 | "Unable to queue handler for GPE[%2X] - event disabled", |
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index 97e05481aa7c..24e0b8d36f31 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c | |||
@@ -191,9 +191,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
191 | notify_info->notify.value = (u16) notify_value; | 191 | notify_info->notify.value = (u16) notify_value; |
192 | notify_info->notify.handler_obj = handler_obj; | 192 | notify_info->notify.handler_obj = handler_obj; |
193 | 193 | ||
194 | status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH, | 194 | status = acpi_os_execute(OSL_NOTIFY_HANDLER, |
195 | acpi_ev_notify_dispatch, | 195 | acpi_ev_notify_dispatch, notify_info); |
196 | notify_info); | ||
197 | if (ACPI_FAILURE(status)) { | 196 | if (ACPI_FAILURE(status)) { |
198 | acpi_ut_delete_generic_state(notify_info); | 197 | acpi_ut_delete_generic_state(notify_info); |
199 | } | 198 | } |
@@ -346,9 +345,8 @@ static u32 acpi_ev_global_lock_handler(void *context) | |||
346 | 345 | ||
347 | /* Run the Global Lock thread which will signal all waiting threads */ | 346 | /* Run the Global Lock thread which will signal all waiting threads */ |
348 | 347 | ||
349 | status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH, | 348 | status = acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER, |
350 | acpi_ev_global_lock_thread, | 349 | acpi_ev_global_lock_thread, context); |
351 | context); | ||
352 | if (ACPI_FAILURE(status)) { | 350 | if (ACPI_FAILURE(status)) { |
353 | ACPI_EXCEPTION((AE_INFO, status, | 351 | ACPI_EXCEPTION((AE_INFO, status, |
354 | "Could not queue Global Lock thread")); | 352 | "Could not queue Global Lock thread")); |
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c index eb29e96f053c..edf9d2e1dff9 100644 --- a/drivers/acpi/events/evregion.c +++ b/drivers/acpi/events/evregion.c | |||
@@ -261,7 +261,8 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | |||
261 | * Function - Read or Write operation | 261 | * Function - Read or Write operation |
262 | * Address - Where in the space to read or write | 262 | * Address - Where in the space to read or write |
263 | * bit_width - Field width in bits (8, 16, 32, or 64) | 263 | * bit_width - Field width in bits (8, 16, 32, or 64) |
264 | * Value - Pointer to in or out value | 264 | * Value - Pointer to in or out value, must be |
265 | * full 64-bit acpi_integer | ||
265 | * | 266 | * |
266 | * RETURN: Status | 267 | * RETURN: Status |
267 | * | 268 | * |
@@ -274,7 +275,7 @@ acpi_status | |||
274 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | 275 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, |
275 | u32 function, | 276 | u32 function, |
276 | acpi_physical_address address, | 277 | acpi_physical_address address, |
277 | u32 bit_width, void *value) | 278 | u32 bit_width, acpi_integer * value) |
278 | { | 279 | { |
279 | acpi_status status; | 280 | acpi_status status; |
280 | acpi_status status2; | 281 | acpi_status status2; |
@@ -1007,7 +1008,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, | |||
1007 | * | 1008 | * |
1008 | * PARAMETERS: walk_namespace callback | 1009 | * PARAMETERS: walk_namespace callback |
1009 | * | 1010 | * |
1010 | * DESCRIPTION: Run _REg method for region objects of the requested space_iD | 1011 | * DESCRIPTION: Run _REG method for region objects of the requested space_iD |
1011 | * | 1012 | * |
1012 | ******************************************************************************/ | 1013 | ******************************************************************************/ |
1013 | 1014 | ||
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index 9c46f3338640..9ae3cb55979b 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c | |||
@@ -298,6 +298,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
298 | struct acpi_table_header *table_ptr = NULL; | 298 | struct acpi_table_header *table_ptr = NULL; |
299 | acpi_physical_address address; | 299 | acpi_physical_address address; |
300 | struct acpi_table_header table_header; | 300 | struct acpi_table_header table_header; |
301 | acpi_integer temp; | ||
301 | u32 i; | 302 | u32 i; |
302 | 303 | ||
303 | ACPI_FUNCTION_TRACE(ex_load_op); | 304 | ACPI_FUNCTION_TRACE(ex_load_op); |
@@ -326,7 +327,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
326 | 327 | ||
327 | address = obj_desc->region.address; | 328 | address = obj_desc->region.address; |
328 | 329 | ||
329 | /* Get the table length from the table header */ | 330 | /* Get part of the table header to get the table length */ |
330 | 331 | ||
331 | table_header.length = 0; | 332 | table_header.length = 0; |
332 | for (i = 0; i < 8; i++) { | 333 | for (i = 0; i < 8; i++) { |
@@ -334,11 +335,14 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
334 | acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, | 335 | acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, |
335 | (acpi_physical_address) | 336 | (acpi_physical_address) |
336 | (i + address), 8, | 337 | (i + address), 8, |
337 | ((u8 *) & | 338 | &temp); |
338 | table_header) + i); | ||
339 | if (ACPI_FAILURE(status)) { | 339 | if (ACPI_FAILURE(status)) { |
340 | return_ACPI_STATUS(status); | 340 | return_ACPI_STATUS(status); |
341 | } | 341 | } |
342 | |||
343 | /* Get the one valid byte of the returned 64-bit value */ | ||
344 | |||
345 | ACPI_CAST_PTR(u8, &table_header)[i] = (u8) temp; | ||
342 | } | 346 | } |
343 | 347 | ||
344 | /* Sanity check the table length */ | 348 | /* Sanity check the table length */ |
@@ -361,11 +365,14 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
361 | acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, | 365 | acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, |
362 | (acpi_physical_address) | 366 | (acpi_physical_address) |
363 | (i + address), 8, | 367 | (i + address), 8, |
364 | ((u8 *) table_ptr + | 368 | &temp); |
365 | i)); | ||
366 | if (ACPI_FAILURE(status)) { | 369 | if (ACPI_FAILURE(status)) { |
367 | goto cleanup; | 370 | goto cleanup; |
368 | } | 371 | } |
372 | |||
373 | /* Get the one valid byte of the returned 64-bit value */ | ||
374 | |||
375 | ACPI_CAST_PTR(u8, table_ptr)[i] = (u8) temp; | ||
369 | } | 376 | } |
370 | break; | 377 | break; |
371 | 378 | ||
diff --git a/drivers/acpi/executer/exstorob.c b/drivers/acpi/executer/exstorob.c index 18925f5b313c..99ebe5adfcda 100644 --- a/drivers/acpi/executer/exstorob.c +++ b/drivers/acpi/executer/exstorob.c | |||
@@ -103,7 +103,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc, | |||
103 | * NOTE: ACPI versions up to 3.0 specified that the buffer must be | 103 | * NOTE: ACPI versions up to 3.0 specified that the buffer must be |
104 | * truncated if the string is smaller than the buffer. However, "other" | 104 | * truncated if the string is smaller than the buffer. However, "other" |
105 | * implementations of ACPI never did this and thus became the defacto | 105 | * implementations of ACPI never did this and thus became the defacto |
106 | * standard. ACPi 3.0_a changes this behavior such that the buffer | 106 | * standard. ACPI 3.0_a changes this behavior such that the buffer |
107 | * is no longer truncated. | 107 | * is no longer truncated. |
108 | */ | 108 | */ |
109 | 109 | ||
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c index 5e3f63a90fb4..ba8ad569188f 100644 --- a/drivers/acpi/namespace/nsaccess.c +++ b/drivers/acpi/namespace/nsaccess.c | |||
@@ -157,7 +157,7 @@ acpi_status acpi_ns_root_initialize(void) | |||
157 | 157 | ||
158 | #if defined (ACPI_ASL_COMPILER) | 158 | #if defined (ACPI_ASL_COMPILER) |
159 | 159 | ||
160 | /* save the parameter count for the i_aSL compiler */ | 160 | /* Save the parameter count for the i_aSL compiler */ |
161 | 161 | ||
162 | new_node->value = obj_desc->method.param_count; | 162 | new_node->value = obj_desc->method.param_count; |
163 | #else | 163 | #else |
@@ -311,8 +311,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
311 | acpi_object_type type_to_check_for; | 311 | acpi_object_type type_to_check_for; |
312 | acpi_object_type this_search_type; | 312 | acpi_object_type this_search_type; |
313 | u32 search_parent_flag = ACPI_NS_SEARCH_PARENT; | 313 | u32 search_parent_flag = ACPI_NS_SEARCH_PARENT; |
314 | u32 local_flags = flags & ~(ACPI_NS_ERROR_IF_FOUND | | 314 | u32 local_flags; |
315 | ACPI_NS_SEARCH_PARENT); | ||
316 | 315 | ||
317 | ACPI_FUNCTION_TRACE(ns_lookup); | 316 | ACPI_FUNCTION_TRACE(ns_lookup); |
318 | 317 | ||
@@ -320,8 +319,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
320 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 319 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
321 | } | 320 | } |
322 | 321 | ||
323 | acpi_gbl_ns_lookup_count++; | 322 | local_flags = flags & ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_SEARCH_PARENT); |
324 | *return_node = ACPI_ENTRY_NOT_FOUND; | 323 | *return_node = ACPI_ENTRY_NOT_FOUND; |
324 | acpi_gbl_ns_lookup_count++; | ||
325 | 325 | ||
326 | if (!acpi_gbl_root_node) { | 326 | if (!acpi_gbl_root_node) { |
327 | return_ACPI_STATUS(AE_NO_NAMESPACE); | 327 | return_ACPI_STATUS(AE_NO_NAMESPACE); |
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c index 34ac512a2d5e..d2473476afa5 100644 --- a/drivers/acpi/namespace/nssearch.c +++ b/drivers/acpi/namespace/nssearch.c | |||
@@ -299,7 +299,7 @@ acpi_ns_search_and_enter(u32 target_name, | |||
299 | 299 | ||
300 | if (!node || !target_name || !return_node) { | 300 | if (!node || !target_name || !return_node) { |
301 | ACPI_ERROR((AE_INFO, | 301 | ACPI_ERROR((AE_INFO, |
302 | "Null param: Node %p Name %X ReturnNode %p", | 302 | "Null parameter: Node %p Name %X ReturnNode %p", |
303 | node, target_name, return_node)); | 303 | node, target_name, return_node)); |
304 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 304 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
305 | } | 305 | } |
@@ -385,6 +385,11 @@ acpi_ns_search_and_enter(u32 target_name, | |||
385 | if (!new_node) { | 385 | if (!new_node) { |
386 | return_ACPI_STATUS(AE_NO_MEMORY); | 386 | return_ACPI_STATUS(AE_NO_MEMORY); |
387 | } | 387 | } |
388 | #ifdef ACPI_ASL_COMPILER | ||
389 | if (flags & ACPI_NS_EXTERNAL) { | ||
390 | new_node->flags |= ANOBJ_IS_EXTERNAL; | ||
391 | } | ||
392 | #endif | ||
388 | 393 | ||
389 | /* Install the new object into the parent's list of children */ | 394 | /* Install the new object into the parent's list of children */ |
390 | 395 | ||
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c index a573ad5d41db..cf87b0230026 100644 --- a/drivers/acpi/resources/rscalc.c +++ b/drivers/acpi/resources/rscalc.c | |||
@@ -451,7 +451,7 @@ acpi_rs_get_list_length(u8 * aml_buffer, | |||
451 | */ | 451 | */ |
452 | buffer_size = acpi_gbl_resource_struct_sizes[resource_index] + | 452 | buffer_size = acpi_gbl_resource_struct_sizes[resource_index] + |
453 | extra_struct_bytes; | 453 | extra_struct_bytes; |
454 | buffer_size = ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size); | 454 | buffer_size = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size); |
455 | 455 | ||
456 | *size_needed += buffer_size; | 456 | *size_needed += buffer_size; |
457 | 457 | ||
@@ -579,7 +579,7 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, | |||
579 | 579 | ||
580 | /* Round up the size since each element must be aligned */ | 580 | /* Round up the size since each element must be aligned */ |
581 | 581 | ||
582 | temp_size_needed = ACPI_ROUND_UP_to_64_bIT(temp_size_needed); | 582 | temp_size_needed = ACPI_ROUND_UP_TO_64BIT(temp_size_needed); |
583 | 583 | ||
584 | /* Point to the next union acpi_operand_object */ | 584 | /* Point to the next union acpi_operand_object */ |
585 | 585 | ||
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c index 4c322daaf885..008058acdd39 100644 --- a/drivers/acpi/resources/rscreate.c +++ b/drivers/acpi/resources/rscreate.c | |||
@@ -335,7 +335,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
335 | /* Now align the current length */ | 335 | /* Now align the current length */ |
336 | 336 | ||
337 | user_prt->length = | 337 | user_prt->length = |
338 | (u32) ACPI_ROUND_UP_to_64_bIT(user_prt->length); | 338 | (u32) ACPI_ROUND_UP_TO_64BIT(user_prt->length); |
339 | 339 | ||
340 | /* 4) Fourth subobject: Dereference the PRT.source_index */ | 340 | /* 4) Fourth subobject: Dereference the PRT.source_index */ |
341 | 341 | ||
diff --git a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c index aa98eebc9b78..0e493f2fec4d 100644 --- a/drivers/acpi/resources/rsutils.c +++ b/drivers/acpi/resources/rsutils.c | |||
@@ -354,6 +354,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, | |||
354 | * Zero the entire area of the buffer. | 354 | * Zero the entire area of the buffer. |
355 | */ | 355 | */ |
356 | total_length = | 356 | total_length = |
357 | (u32) | ||
357 | ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) + | 358 | ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) + |
358 | 1; | 359 | 1; |
359 | total_length = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); | 360 | total_length = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); |
@@ -528,7 +529,7 @@ acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer) | |||
528 | */ | 529 | */ |
529 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 530 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
530 | 531 | ||
531 | /* on exit, we must delete the object returned by evaluate_object */ | 532 | /* On exit, we must delete the object returned by evaluate_object */ |
532 | 533 | ||
533 | acpi_ut_remove_reference(obj_desc); | 534 | acpi_ut_remove_reference(obj_desc); |
534 | return_ACPI_STATUS(status); | 535 | return_ACPI_STATUS(status); |
@@ -578,7 +579,7 @@ acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer) | |||
578 | */ | 579 | */ |
579 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 580 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
580 | 581 | ||
581 | /* on exit, we must delete the object returned by evaluate_object */ | 582 | /* On exit, we must delete the object returned by evaluate_object */ |
582 | 583 | ||
583 | acpi_ut_remove_reference(obj_desc); | 584 | acpi_ut_remove_reference(obj_desc); |
584 | return_ACPI_STATUS(status); | 585 | return_ACPI_STATUS(status); |
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c index 9e226438a3f6..494965229fa2 100644 --- a/drivers/acpi/tables/tbrsdt.c +++ b/drivers/acpi/tables/tbrsdt.c | |||
@@ -196,10 +196,8 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr) | |||
196 | ACPI_DUMP_BUFFER(acpi_gbl_RSDP, 20); | 196 | ACPI_DUMP_BUFFER(acpi_gbl_RSDP, 20); |
197 | 197 | ||
198 | ACPI_ERROR((AE_INFO, | 198 | ACPI_ERROR((AE_INFO, |
199 | "RSDT/XSDT signature at %X (%p) is invalid", | 199 | "RSDT/XSDT signature at %X is invalid", |
200 | acpi_gbl_RSDP->rsdt_physical_address, | 200 | acpi_gbl_RSDP->rsdt_physical_address)); |
201 | (void *)(acpi_native_uint) acpi_gbl_RSDP-> | ||
202 | rsdt_physical_address)); | ||
203 | 201 | ||
204 | if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { | 202 | if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { |
205 | ACPI_ERROR((AE_INFO, "Looking for RSDT")); | 203 | ACPI_ERROR((AE_INFO, "Looking for RSDT")); |
diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c index 3107e741d510..da2648bbdbc0 100644 --- a/drivers/acpi/tables/tbxfroot.c +++ b/drivers/acpi/tables/tbxfroot.c | |||
@@ -472,10 +472,10 @@ static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length) | |||
472 | * | 472 | * |
473 | * RETURN: Status, RSDP physical address | 473 | * RETURN: Status, RSDP physical address |
474 | * | 474 | * |
475 | * DESCRIPTION: search lower 1_mbyte of memory for the root system descriptor | 475 | * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor |
476 | * pointer structure. If it is found, set *RSDP to point to it. | 476 | * pointer structure. If it is found, set *RSDP to point to it. |
477 | * | 477 | * |
478 | * NOTE1: The RSDp must be either in the first 1_k of the Extended | 478 | * NOTE1: The RSDP must be either in the first 1_k of the Extended |
479 | * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) | 479 | * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) |
480 | * Only a 32-bit physical address is necessary. | 480 | * Only a 32-bit physical address is necessary. |
481 | * | 481 | * |
@@ -525,7 +525,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags) | |||
525 | 525 | ||
526 | if (physical_address > 0x400) { | 526 | if (physical_address > 0x400) { |
527 | /* | 527 | /* |
528 | * 1b) Search EBDA paragraphs (EBDa is required to be a | 528 | * 1b) Search EBDA paragraphs (EBDA is required to be a |
529 | * minimum of 1_k length) | 529 | * minimum of 1_k length) |
530 | */ | 530 | */ |
531 | status = acpi_os_map_memory((acpi_physical_address) | 531 | status = acpi_os_map_memory((acpi_physical_address) |
@@ -550,7 +550,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags) | |||
550 | /* Return the physical address */ | 550 | /* Return the physical address */ |
551 | 551 | ||
552 | physical_address += | 552 | physical_address += |
553 | ACPI_PTR_DIFF(mem_rover, table_ptr); | 553 | (u32) ACPI_PTR_DIFF(mem_rover, table_ptr); |
554 | 554 | ||
555 | table_info->physical_address = | 555 | table_info->physical_address = |
556 | (acpi_physical_address) physical_address; | 556 | (acpi_physical_address) physical_address; |
@@ -584,9 +584,9 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags) | |||
584 | 584 | ||
585 | /* Return the physical address */ | 585 | /* Return the physical address */ |
586 | 586 | ||
587 | physical_address = | 587 | physical_address = (u32) |
588 | ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF(mem_rover, | 588 | (ACPI_HI_RSDP_WINDOW_BASE + |
589 | table_ptr); | 589 | ACPI_PTR_DIFF(mem_rover, table_ptr)); |
590 | 590 | ||
591 | table_info->physical_address = | 591 | table_info->physical_address = |
592 | (acpi_physical_address) physical_address; | 592 | (acpi_physical_address) physical_address; |
@@ -607,7 +607,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags) | |||
607 | 607 | ||
608 | if (physical_address > 0x400) { | 608 | if (physical_address > 0x400) { |
609 | /* | 609 | /* |
610 | * 1b) Search EBDA paragraphs (EBDa is required to be a minimum of | 610 | * 1b) Search EBDA paragraphs (EBDA is required to be a minimum of |
611 | * 1_k length) | 611 | * 1_k length) |
612 | */ | 612 | */ |
613 | mem_rover = | 613 | mem_rover = |
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c index e666c71be0bf..9450f9b5bfb2 100644 --- a/drivers/acpi/utilities/utglobal.c +++ b/drivers/acpi/utilities/utglobal.c | |||
@@ -443,7 +443,6 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = | |||
443 | /* Region type decoding */ | 443 | /* Region type decoding */ |
444 | 444 | ||
445 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { | 445 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { |
446 | /*! [Begin] no source code translation (keep these ASL Keywords as-is) */ | ||
447 | "SystemMemory", | 446 | "SystemMemory", |
448 | "SystemIO", | 447 | "SystemIO", |
449 | "PCI_Config", | 448 | "PCI_Config", |
@@ -452,7 +451,6 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { | |||
452 | "CMOS", | 451 | "CMOS", |
453 | "PCIBARTarget", | 452 | "PCIBARTarget", |
454 | "DataTable" | 453 | "DataTable" |
455 | /*! [End] no source code translation !*/ | ||
456 | }; | 454 | }; |
457 | 455 | ||
458 | char *acpi_ut_get_region_name(u8 space_id) | 456 | char *acpi_ut_get_region_name(u8 space_id) |
@@ -482,13 +480,11 @@ char *acpi_ut_get_region_name(u8 space_id) | |||
482 | /* Event type decoding */ | 480 | /* Event type decoding */ |
483 | 481 | ||
484 | static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { | 482 | static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { |
485 | /*! [Begin] no source code translation (keep these strings as-is) */ | ||
486 | "PM_Timer", | 483 | "PM_Timer", |
487 | "GlobalLock", | 484 | "GlobalLock", |
488 | "PowerButton", | 485 | "PowerButton", |
489 | "SleepButton", | 486 | "SleepButton", |
490 | "RealTimeClock", | 487 | "RealTimeClock", |
491 | /*! [End] no source code translation !*/ | ||
492 | }; | 488 | }; |
493 | 489 | ||
494 | char *acpi_ut_get_event_name(u32 event_id) | 490 | char *acpi_ut_get_event_name(u32 event_id) |
@@ -526,7 +522,6 @@ static const char acpi_gbl_bad_type[] = "UNDEFINED"; | |||
526 | /* Printable names of the ACPI object types */ | 522 | /* Printable names of the ACPI object types */ |
527 | 523 | ||
528 | static const char *acpi_gbl_ns_type_names[] = { | 524 | static const char *acpi_gbl_ns_type_names[] = { |
529 | /*! [Begin] no source code translation (keep these strings as-is) */ | ||
530 | /* 00 */ "Untyped", | 525 | /* 00 */ "Untyped", |
531 | /* 01 */ "Integer", | 526 | /* 01 */ "Integer", |
532 | /* 02 */ "String", | 527 | /* 02 */ "String", |
@@ -558,7 +553,6 @@ static const char *acpi_gbl_ns_type_names[] = { | |||
558 | /* 28 */ "Extra", | 553 | /* 28 */ "Extra", |
559 | /* 29 */ "Data", | 554 | /* 29 */ "Data", |
560 | /* 30 */ "Invalid" | 555 | /* 30 */ "Invalid" |
561 | /*! [End] no source code translation !*/ | ||
562 | }; | 556 | }; |
563 | 557 | ||
564 | char *acpi_ut_get_type_name(acpi_object_type type) | 558 | char *acpi_ut_get_type_name(acpi_object_type type) |
@@ -641,7 +635,6 @@ char *acpi_ut_get_node_name(void *object) | |||
641 | /* Printable names of object descriptor types */ | 635 | /* Printable names of object descriptor types */ |
642 | 636 | ||
643 | static const char *acpi_gbl_desc_type_names[] = { | 637 | static const char *acpi_gbl_desc_type_names[] = { |
644 | /*! [Begin] no source code translation (keep these ASL Keywords as-is) */ | ||
645 | /* 00 */ "Invalid", | 638 | /* 00 */ "Invalid", |
646 | /* 01 */ "Cached", | 639 | /* 01 */ "Cached", |
647 | /* 02 */ "State-Generic", | 640 | /* 02 */ "State-Generic", |
@@ -658,7 +651,6 @@ static const char *acpi_gbl_desc_type_names[] = { | |||
658 | /* 13 */ "Parser", | 651 | /* 13 */ "Parser", |
659 | /* 14 */ "Operand", | 652 | /* 14 */ "Operand", |
660 | /* 15 */ "Node" | 653 | /* 15 */ "Node" |
661 | /*! [End] no source code translation !*/ | ||
662 | }; | 654 | }; |
663 | 655 | ||
664 | char *acpi_ut_get_descriptor_name(void *object) | 656 | char *acpi_ut_get_descriptor_name(void *object) |