Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bob Moore and committed by
Len Brown
958dd242 b229cf92

+161 -110
+17 -6
drivers/acpi/dispatcher/dsmethod.c
··· 385 385 union acpi_operand_object *return_desc) 386 386 { 387 387 acpi_status status; 388 + int same_as_implicit_return; 388 389 389 390 ACPI_FUNCTION_TRACE_PTR(ds_restart_control_method, walk_state); 390 391 ··· 402 401 /* Did the called method return a value? */ 403 402 404 403 if (return_desc) { 404 + 405 + /* Is the implicit return object the same as the return desc? */ 406 + 407 + same_as_implicit_return = 408 + (walk_state->implicit_return_obj == return_desc); 405 409 406 410 /* Are we actually going to use the return value? */ 407 411 ··· 428 422 } 429 423 430 424 /* 431 - * The following code is the 432 - * optional support for a so-called "implicit return". Some AML code 433 - * assumes that the last value of the method is "implicitly" returned 434 - * to the caller. Just save the last result as the return value. 425 + * The following code is the optional support for the so-called 426 + * "implicit return". Some AML code assumes that the last value of the 427 + * method is "implicitly" returned to the caller, in the absence of an 428 + * explicit return value. 429 + * 430 + * Just save the last result of the method as the return value. 431 + * 435 432 * NOTE: this is optional because the ASL language does not actually 436 433 * support this behavior. 437 434 */ 438 435 else if (!acpi_ds_do_implicit_return 439 - (return_desc, walk_state, FALSE)) { 436 + (return_desc, walk_state, FALSE) 437 + || same_as_implicit_return) { 440 438 /* 441 439 * Delete the return value if it will not be used by the 442 - * calling method 440 + * calling method or remove one reference if the explicit return 441 + * is the same as the implicit return value. 443 442 */ 444 443 acpi_ut_remove_reference(return_desc); 445 444 }
+3 -3
drivers/acpi/dispatcher/dsmthdat.c
··· 336 336 * Increment ref count so object can't be deleted while installed. 337 337 * NOTE: We do not copy the object in order to preserve the call by 338 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 341 acpi_ut_add_reference(object); 342 342 ··· 351 351 * FUNCTION: acpi_ds_method_data_get_value 352 352 * 353 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 355 * walk_state - Current walk state object 356 356 * dest_desc - Where Arg or Local value is returned 357 357 * ··· 459 459 * FUNCTION: acpi_ds_method_data_delete_value 460 460 * 461 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 463 * walk_state - Current walk state object 464 464 * 465 465 * RETURN: None
+36 -5
drivers/acpi/dispatcher/dswload.c
··· 178 178 * Target of Scope() not found. Generate an External for it, and 179 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 182 status = 183 183 acpi_ns_lookup(walk_state->scope_info, path, 184 184 object_type, ACPI_IMODE_LOAD_PASS1, 185 185 ACPI_NS_SEARCH_PARENT, walk_state, 186 - &(node)); 186 + &node); 187 187 } 188 188 #endif 189 189 if (ACPI_FAILURE(status)) { ··· 301 301 status = 302 302 acpi_ns_lookup(walk_state->scope_info, path, object_type, 303 303 ACPI_IMODE_LOAD_PASS1, flags, walk_state, 304 - &(node)); 304 + &node); 305 305 if (ACPI_FAILURE(status)) { 306 - ACPI_ERROR_NAMESPACE(path, status); 307 - return_ACPI_STATUS(status); 306 + if (status == AE_ALREADY_EXISTS) { 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 340 break; 310 341 }
+4 -4
drivers/acpi/events/evgpe.c
··· 489 489 * RETURN: None 490 490 * 491 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 493 * (and therefore does NOT execute at interrupt level) so that 494 494 * the control method itself is not executed in the context of 495 495 * an interrupt handler. ··· 674 674 * Execute the method associated with the GPE 675 675 * NOTE: Level-triggered GPEs are cleared after the method completes. 676 676 */ 677 - status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, 678 - acpi_ev_asynch_execute_gpe_method, 679 - gpe_event_info); 677 + status = acpi_os_execute(OSL_GPE_HANDLER, 678 + acpi_ev_asynch_execute_gpe_method, 679 + gpe_event_info); 680 680 if (ACPI_FAILURE(status)) { 681 681 ACPI_EXCEPTION((AE_INFO, status, 682 682 "Unable to queue handler for GPE[%2X] - event disabled",
+4 -6
drivers/acpi/events/evmisc.c
··· 191 191 notify_info->notify.value = (u16) notify_value; 192 192 notify_info->notify.handler_obj = handler_obj; 193 193 194 - status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH, 195 - acpi_ev_notify_dispatch, 196 - notify_info); 194 + status = acpi_os_execute(OSL_NOTIFY_HANDLER, 195 + acpi_ev_notify_dispatch, notify_info); 197 196 if (ACPI_FAILURE(status)) { 198 197 acpi_ut_delete_generic_state(notify_info); 199 198 } ··· 345 346 346 347 /* Run the Global Lock thread which will signal all waiting threads */ 347 348 348 - status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH, 349 - acpi_ev_global_lock_thread, 350 - context); 349 + status = acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER, 350 + acpi_ev_global_lock_thread, context); 351 351 if (ACPI_FAILURE(status)) { 352 352 ACPI_EXCEPTION((AE_INFO, status, 353 353 "Could not queue Global Lock thread"));
+4 -3
drivers/acpi/events/evregion.c
··· 261 261 * Function - Read or Write operation 262 262 * Address - Where in the space to read or write 263 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 267 * RETURN: Status 267 268 * ··· 275 274 acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, 276 275 u32 function, 277 276 acpi_physical_address address, 278 - u32 bit_width, void *value) 277 + u32 bit_width, acpi_integer * value) 279 278 { 280 279 acpi_status status; 281 280 acpi_status status2; ··· 1008 1007 * 1009 1008 * PARAMETERS: walk_namespace callback 1010 1009 * 1011 - * DESCRIPTION: Run _REg method for region objects of the requested space_iD 1010 + * DESCRIPTION: Run _REG method for region objects of the requested space_iD 1012 1011 * 1013 1012 ******************************************************************************/ 1014 1013
+12 -5
drivers/acpi/executer/exconfig.c
··· 298 298 struct acpi_table_header *table_ptr = NULL; 299 299 acpi_physical_address address; 300 300 struct acpi_table_header table_header; 301 + acpi_integer temp; 301 302 u32 i; 302 303 303 304 ACPI_FUNCTION_TRACE(ex_load_op); ··· 327 326 328 327 address = obj_desc->region.address; 329 328 330 - /* Get the table length from the table header */ 329 + /* Get part of the table header to get the table length */ 331 330 332 331 table_header.length = 0; 333 332 for (i = 0; i < 8; i++) { ··· 335 334 acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, 336 335 (acpi_physical_address) 337 336 (i + address), 8, 338 - ((u8 *) & 339 - table_header) + i); 337 + &temp); 340 338 if (ACPI_FAILURE(status)) { 341 339 return_ACPI_STATUS(status); 342 340 } 341 + 342 + /* Get the one valid byte of the returned 64-bit value */ 343 + 344 + ACPI_CAST_PTR(u8, &table_header)[i] = (u8) temp; 343 345 } 344 346 345 347 /* Sanity check the table length */ ··· 365 361 acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, 366 362 (acpi_physical_address) 367 363 (i + address), 8, 368 - ((u8 *) table_ptr + 369 - i)); 364 + &temp); 370 365 if (ACPI_FAILURE(status)) { 371 366 goto cleanup; 372 367 } 368 + 369 + /* Get the one valid byte of the returned 64-bit value */ 370 + 371 + ACPI_CAST_PTR(u8, table_ptr)[i] = (u8) temp; 373 372 } 374 373 break; 375 374
+1 -1
drivers/acpi/executer/exstorob.c
··· 103 103 * NOTE: ACPI versions up to 3.0 specified that the buffer must be 104 104 * truncated if the string is smaller than the buffer. However, "other" 105 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 107 * is no longer truncated. 108 108 */ 109 109
+4 -4
drivers/acpi/namespace/nsaccess.c
··· 157 157 158 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 162 new_node->value = obj_desc->method.param_count; 163 163 #else ··· 311 311 acpi_object_type type_to_check_for; 312 312 acpi_object_type this_search_type; 313 313 u32 search_parent_flag = ACPI_NS_SEARCH_PARENT; 314 - u32 local_flags = flags & ~(ACPI_NS_ERROR_IF_FOUND | 315 - ACPI_NS_SEARCH_PARENT); 314 + u32 local_flags; 316 315 317 316 ACPI_FUNCTION_TRACE(ns_lookup); 318 317 ··· 319 320 return_ACPI_STATUS(AE_BAD_PARAMETER); 320 321 } 321 322 322 - acpi_gbl_ns_lookup_count++; 323 + local_flags = flags & ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_SEARCH_PARENT); 323 324 *return_node = ACPI_ENTRY_NOT_FOUND; 325 + acpi_gbl_ns_lookup_count++; 324 326 325 327 if (!acpi_gbl_root_node) { 326 328 return_ACPI_STATUS(AE_NO_NAMESPACE);
+6 -1
drivers/acpi/namespace/nssearch.c
··· 299 299 300 300 if (!node || !target_name || !return_node) { 301 301 ACPI_ERROR((AE_INFO, 302 - "Null param: Node %p Name %X ReturnNode %p", 302 + "Null parameter: Node %p Name %X ReturnNode %p", 303 303 node, target_name, return_node)); 304 304 return_ACPI_STATUS(AE_BAD_PARAMETER); 305 305 } ··· 385 385 if (!new_node) { 386 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 394 /* Install the new object into the parent's list of children */ 390 395
+2 -2
drivers/acpi/resources/rscalc.c
··· 451 451 */ 452 452 buffer_size = acpi_gbl_resource_struct_sizes[resource_index] + 453 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 456 *size_needed += buffer_size; 457 457 ··· 579 579 580 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 584 /* Point to the next union acpi_operand_object */ 585 585
+1 -1
drivers/acpi/resources/rscreate.c
··· 335 335 /* Now align the current length */ 336 336 337 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 340 /* 4) Fourth subobject: Dereference the PRT.source_index */ 341 341
+3 -2
drivers/acpi/resources/rsutils.c
··· 354 354 * Zero the entire area of the buffer. 355 355 */ 356 356 total_length = 357 + (u32) 357 358 ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) + 358 359 1; 359 360 total_length = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); ··· 529 528 */ 530 529 status = acpi_rs_create_resource_list(obj_desc, ret_buffer); 531 530 532 - /* on exit, we must delete the object returned by evaluate_object */ 531 + /* On exit, we must delete the object returned by evaluate_object */ 533 532 534 533 acpi_ut_remove_reference(obj_desc); 535 534 return_ACPI_STATUS(status); ··· 579 578 */ 580 579 status = acpi_rs_create_resource_list(obj_desc, ret_buffer); 581 580 582 - /* on exit, we must delete the object returned by evaluate_object */ 581 + /* On exit, we must delete the object returned by evaluate_object */ 583 582 584 583 acpi_ut_remove_reference(obj_desc); 585 584 return_ACPI_STATUS(status);
+2 -4
drivers/acpi/tables/tbrsdt.c
··· 196 196 ACPI_DUMP_BUFFER(acpi_gbl_RSDP, 20); 197 197 198 198 ACPI_ERROR((AE_INFO, 199 - "RSDT/XSDT signature at %X (%p) is invalid", 200 - acpi_gbl_RSDP->rsdt_physical_address, 201 - (void *)(acpi_native_uint) acpi_gbl_RSDP-> 202 - rsdt_physical_address)); 199 + "RSDT/XSDT signature at %X is invalid", 200 + acpi_gbl_RSDP->rsdt_physical_address)); 203 201 204 202 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { 205 203 ACPI_ERROR((AE_INFO, "Looking for RSDT"));
+8 -8
drivers/acpi/tables/tbxfroot.c
··· 472 472 * 473 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 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 479 * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) 480 480 * Only a 32-bit physical address is necessary. 481 481 * ··· 525 525 526 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 529 * minimum of 1_k length) 530 530 */ 531 531 status = acpi_os_map_memory((acpi_physical_address) ··· 550 550 /* Return the physical address */ 551 551 552 552 physical_address += 553 - ACPI_PTR_DIFF(mem_rover, table_ptr); 553 + (u32) ACPI_PTR_DIFF(mem_rover, table_ptr); 554 554 555 555 table_info->physical_address = 556 556 (acpi_physical_address) physical_address; ··· 584 584 585 585 /* Return the physical address */ 586 586 587 - physical_address = 588 - ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF(mem_rover, 589 - table_ptr); 587 + physical_address = (u32) 588 + (ACPI_HI_RSDP_WINDOW_BASE + 589 + ACPI_PTR_DIFF(mem_rover, table_ptr)); 590 590 591 591 table_info->physical_address = 592 592 (acpi_physical_address) physical_address; ··· 607 607 608 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 611 * 1_k length) 612 612 */ 613 613 mem_rover =
-8
drivers/acpi/utilities/utglobal.c
··· 443 443 /* Region type decoding */ 444 444 445 445 const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { 446 - /*! [Begin] no source code translation (keep these ASL Keywords as-is) */ 447 446 "SystemMemory", 448 447 "SystemIO", 449 448 "PCI_Config", ··· 451 452 "CMOS", 452 453 "PCIBARTarget", 453 454 "DataTable" 454 - /*! [End] no source code translation !*/ 455 455 }; 456 456 457 457 char *acpi_ut_get_region_name(u8 space_id) ··· 480 482 /* Event type decoding */ 481 483 482 484 static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { 483 - /*! [Begin] no source code translation (keep these strings as-is) */ 484 485 "PM_Timer", 485 486 "GlobalLock", 486 487 "PowerButton", 487 488 "SleepButton", 488 489 "RealTimeClock", 489 - /*! [End] no source code translation !*/ 490 490 }; 491 491 492 492 char *acpi_ut_get_event_name(u32 event_id) ··· 522 526 /* Printable names of the ACPI object types */ 523 527 524 528 static const char *acpi_gbl_ns_type_names[] = { 525 - /*! [Begin] no source code translation (keep these strings as-is) */ 526 529 /* 00 */ "Untyped", 527 530 /* 01 */ "Integer", 528 531 /* 02 */ "String", ··· 553 558 /* 28 */ "Extra", 554 559 /* 29 */ "Data", 555 560 /* 30 */ "Invalid" 556 - /*! [End] no source code translation !*/ 557 561 }; 558 562 559 563 char *acpi_ut_get_type_name(acpi_object_type type) ··· 635 641 /* Printable names of object descriptor types */ 636 642 637 643 static const char *acpi_gbl_desc_type_names[] = { 638 - /*! [Begin] no source code translation (keep these ASL Keywords as-is) */ 639 644 /* 00 */ "Invalid", 640 645 /* 01 */ "Cached", 641 646 /* 02 */ "State-Generic", ··· 651 658 /* 13 */ "Parser", 652 659 /* 14 */ "Operand", 653 660 /* 15 */ "Node" 654 - /*! [End] no source code translation !*/ 655 661 }; 656 662 657 663 char *acpi_ut_get_descriptor_name(void *object)
+1 -1
include/acpi/acconfig.h
··· 63 63 64 64 /* Current ACPICA subsystem version in YYYYMMDD format */ 65 65 66 - #define ACPI_CA_VERSION 0x20060421 66 + #define ACPI_CA_VERSION 0x20060512 67 67 68 68 /* 69 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
+7 -1
include/acpi/acdisasm.h
··· 54 54 55 55 struct acpi_external_list { 56 56 char *path; 57 + char *internal_path; 57 58 struct acpi_external_list *next; 59 + u32 value; 60 + u16 length; 61 + u8 type; 58 62 }; 59 63 60 64 extern struct acpi_external_list *acpi_gbl_external_list; ··· 112 108 113 109 struct acpi_op_walk_info { 114 110 u32 level; 111 + u32 last_level; 112 + u32 count; 115 113 u32 bit_offset; 116 114 u32 flags; 117 115 struct acpi_walk_state *walk_state; ··· 396 390 /* 397 391 * dmutils 398 392 */ 399 - void acpi_dm_add_to_external_list(char *path); 393 + void acpi_dm_add_to_external_list(char *path, u8 type, u32 value); 400 394 401 395 /* 402 396 * dmrestag
+1 -1
include/acpi/acevents.h
··· 138 138 acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, 139 139 u32 function, 140 140 acpi_physical_address address, 141 - u32 bit_width, void *value); 141 + u32 bit_width, acpi_integer * value); 142 142 143 143 acpi_status 144 144 acpi_ev_attach_region(union acpi_operand_object *handler_obj,
-8
include/acpi/acglobal.h
··· 292 292 293 293 /***************************************************************************** 294 294 * 295 - * Parser globals 296 - * 297 - ****************************************************************************/ 298 - 299 - ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; 300 - 301 - /***************************************************************************** 302 - * 303 295 * Hardware globals 304 296 * 305 297 ****************************************************************************/
+9 -5
include/acpi/aclocal.h
··· 207 207 #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 208 208 #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 209 209 210 - #define ANOBJ_METHOD_NO_RETVal 0x10 /* i_aSL only: Method has no return value */ 211 - #define ANOBJ_METHOD_SOME_NO_RETVal 0x20 /* i_aSL only: Method has at least one return value */ 212 - #define ANOBJ_IS_BIT_OFFSet 0x40 /* i_aSL only: Reference is a bit offset */ 213 - #define ANOBJ_IS_REFERENCed 0x80 /* i_aSL only: Object was referenced */ 210 + #define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */ 211 + #define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */ 212 + #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* i_aSL only: Method has at least one return value */ 213 + #define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */ 214 + #define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */ 214 215 215 216 /* 216 217 * ACPI Table Descriptor. One per ACPI table ··· 596 595 #define ACPI_DASM_UNICODE 0x03 597 596 #define ACPI_DASM_EISAID 0x04 598 597 #define ACPI_DASM_MATCHOP 0x05 598 + #define ACPI_DASM_LNOT_PREFIX 0x06 599 + #define ACPI_DASM_LNOT_SUFFIX 0x07 600 + #define ACPI_DASM_IGNORE 0x08 599 601 600 602 /* 601 603 * Generic operation (for example: If, While, Store) ··· 617 613 u32 name; /* 4-byte name or zero if no name */ 618 614 }; 619 615 620 - /* this version is used by the i_aSL compiler only */ 616 + /* This version is used by the i_aSL compiler only */ 621 617 622 618 #define ACPI_MAX_PARSEOP_NAME 20 623 619
+5 -5
include/acpi/acmacros.h
··· 103 103 * printf() format helpers 104 104 */ 105 105 106 - /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ 106 + /* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */ 107 107 108 108 #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) 109 109 ··· 359 359 360 360 /* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */ 361 361 362 - #define ACPI_ROUND_DOWN_to_32_bIT(a) ACPI_ROUND_DOWN(a,4) 363 - #define ACPI_ROUND_DOWN_to_64_bIT(a) ACPI_ROUND_DOWN(a,8) 362 + #define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) 363 + #define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) 364 364 #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint)) 365 365 366 - #define ACPI_ROUND_UP_to_32_bIT(a) ACPI_ROUND_UP(a,4) 367 - #define ACPI_ROUND_UP_to_64_bIT(a) ACPI_ROUND_UP(a,8) 366 + #define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) 367 + #define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) 368 368 #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint)) 369 369 370 370 #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7)
+1
include/acpi/acnamesp.h
··· 64 64 #define ACPI_NS_NO_PEER_SEARCH 0x04 65 65 #define ACPI_NS_ERROR_IF_FOUND 0x08 66 66 #define ACPI_NS_PREFIX_IS_SCOPE 0x10 67 + #define ACPI_NS_EXTERNAL 0x20 67 68 68 69 #define ACPI_NS_WALK_UNLOCK TRUE 69 70 #define ACPI_NS_WALK_NO_UNLOCK FALSE
+12 -7
include/acpi/acpiosxf.h
··· 50 50 #include "platform/acenv.h" 51 51 #include "actypes.h" 52 52 53 - /* Priorities for acpi_os_queue_for_execution */ 53 + /* Types for acpi_os_execute */ 54 54 55 - #define OSD_PRIORITY_GPE 1 56 - #define OSD_PRIORITY_HIGH 2 57 - #define OSD_PRIORITY_MED 3 58 - #define OSD_PRIORITY_LO 4 55 + typedef enum { 56 + OSL_GLOBAL_LOCK_HANDLER, 57 + OSL_NOTIFY_HANDLER, 58 + OSL_GPE_HANDLER, 59 + OSL_DEBUGGER_THREAD, 60 + OSL_EC_POLL_HANDLER, 61 + OSL_EC_BURST_HANDLER, 62 + 63 + } acpi_execute_type; 59 64 60 65 #define ACPI_NO_UNIT_LIMIT ((u32) -1) 61 66 #define ACPI_MUTEX_SEM 1 ··· 169 164 acpi_thread_id acpi_os_get_thread_id(void); 170 165 171 166 acpi_status 172 - acpi_os_queue_for_execution(u32 priority, 173 - acpi_osd_exec_callback function, void *context); 167 + acpi_os_execute(acpi_execute_type type, 168 + acpi_osd_exec_callback function, void *context); 174 169 175 170 void acpi_os_wait_events_complete(void *context); 176 171
+3 -3
include/acpi/actbl.h
··· 206 206 u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \ 207 207 u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \ 208 208 u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \ 209 - u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ \ 210 - u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ \ 209 + u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ \ 210 + u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ \ 211 211 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \ 212 212 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \ 213 213 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \ ··· 252 252 u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ 253 253 u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */ 254 254 u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ 255 - u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ 255 + u8 force_apic_physical_destination_mode:1; /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */ 256 256 u8:4; /* 20-23: Reserved, must be zero */ 257 257 u8 reserved3; /* 24-31: Reserved, must be zero */ 258 258
+3 -3
include/acpi/actypes.h
··· 971 971 * Definitions for Resource Attributes 972 972 */ 973 973 typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ 974 - typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */ 974 + typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */ 975 975 976 976 /* 977 977 * Memory Attributes ··· 986 986 987 987 /* 988 988 * IO Attributes 989 - * The ISA Io ranges are: n000-n0_ffh, n400-n4_ffh, n800-n8_ffh, n_c00-n_cFFh. 990 - * The non-ISA Io ranges are: n100-n3_ffh, n500-n7_ffh, n900-n_bFfh, n_cd0-n_fFFh. 989 + * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. 990 + * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. 991 991 */ 992 992 #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 993 993 #define ACPI_ISA_ONLY_RANGES (u8) 0x02
+4 -2
include/acpi/amlcode.h
··· 180 180 #define AML_BANK_FIELD_OP (u16) 0x5b87 181 181 #define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ 182 182 183 - /* Bogus opcodes (they are actually two separate opcodes) */ 184 - 183 + /* 184 + * Combination opcodes (actually two one-byte opcodes) 185 + * Used by the disassembler and i_aSL compiler 186 + */ 185 187 #define AML_LGREATEREQUAL_OP (u16) 0x9295 186 188 #define AML_LLESSEQUAL_OP (u16) 0x9294 187 189 #define AML_LNOTEQUAL_OP (u16) 0x9293
+8 -11
include/acpi/amlresrc.h
··· 47 47 #ifndef __AMLRESRC_H 48 48 #define __AMLRESRC_H 49 49 50 - /*! [Begin] no source code translation */ 51 - 52 50 /* 53 51 * Resource descriptor tags, as defined in the ACPI specification. 54 52 * Used to symbolically reference fields within a descriptor. ··· 63 65 #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 64 66 #define ACPI_RESTAG_GRANULARITY "_GRA" 65 67 #define ACPI_RESTAG_INTERRUPT "_INT" 66 - #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */ 67 - #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */ 68 + #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 69 + #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ 68 70 #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 69 71 #define ACPI_RESTAG_LENGTH "_LEN" 70 72 #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 71 - #define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 73 + #define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 72 74 #define ACPI_RESTAG_MAXADDR "_MAX" 73 75 #define ACPI_RESTAG_MINADDR "_MIN" 74 76 #define ACPI_RESTAG_MAXTYPE "_MAF" ··· 76 78 #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" 77 79 #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" 78 80 #define ACPI_RESTAG_RANGETYPE "_RNG" 79 - #define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */ 81 + #define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ 80 82 #define ACPI_RESTAG_TRANSLATION "_TRA" 81 83 #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 82 84 #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ 83 - #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ 84 - /*! [End] no source code translation !*/ 85 + #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ 85 86 86 87 /* Default sizes for "small" resource descriptors */ 87 88 ··· 303 306 /* Utility overlays */ 304 307 305 308 struct aml_resource_address address; 306 - u32 u32_item; 307 - u16 u16_item; 308 - u8 U8item; 309 + u32 dword_item; 310 + u16 word_item; 311 + u8 byte_item; 309 312 }; 310 313 311 314 #endif