diff options
author | Robert Moore <robert.moore@intel.com> | 2005-04-18 22:49:35 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-12 00:08:52 -0400 |
commit | 44f6c01242da4e162f28d8e1216a8c7a91174605 (patch) | |
tree | 53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/events/evgpe.c | |
parent | ebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff) |
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index"
argument to an ASL function was still (internally) 32
bits instead of the required 64 bits. This was the Index
argument to the Index, Mid, and Match operators.
The "strupr" function is now permanently local
(acpi_ut_strupr), since this is not a POSIX-defined
function and not present in most kernel-level C
libraries. References to the C library strupr function
have been removed from the headers.
Completed the deployment of static
functions/prototypes. All prototypes with the static
attribute have been moved from the headers to the owning
C file.
ACPICA 20050329 from Bob Moore
An error is now generated if an attempt is made to create
a Buffer Field of length zero (A CreateField with a length
operand of zero.)
The interpreter now issues a warning whenever executable
code at the module level is detected during ACPI table
load. This will give some idea of the prevalence of this
type of code.
Implemented support for references to named objects (other
than control methods) within package objects.
Enhanced package object output for the debug
object. Package objects are now completely dumped, showing
all elements.
Enhanced miscellaneous object output for the debug
object. Any object can now be written to the debug object
(for example, a device object can be written, and the type
of the object will be displayed.)
The "static" qualifier has been added to all local
functions across the core subsystem.
The number of "long" lines (> 80 chars) within the source
has been significantly reduced, by about 1/3.
Cleaned up all header files to ensure that all CA/iASL
functions are prototyped (even static functions) and the
formatting is consistent.
Two new header files have been added, acopcode.h and
acnames.h.
Removed several obsolete functions that were no longer
used.
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/events/evgpe.c')
-rw-r--r-- | drivers/acpi/events/evgpe.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c index 118d72ac7c76..081120b109ba 100644 --- a/drivers/acpi/events/evgpe.c +++ b/drivers/acpi/events/evgpe.c | |||
@@ -48,6 +48,12 @@ | |||
48 | #define _COMPONENT ACPI_EVENTS | 48 | #define _COMPONENT ACPI_EVENTS |
49 | ACPI_MODULE_NAME ("evgpe") | 49 | ACPI_MODULE_NAME ("evgpe") |
50 | 50 | ||
51 | /* Local prototypes */ | ||
52 | |||
53 | static void ACPI_SYSTEM_XFACE | ||
54 | acpi_ev_asynch_execute_gpe_method ( | ||
55 | void *context); | ||
56 | |||
51 | 57 | ||
52 | /******************************************************************************* | 58 | /******************************************************************************* |
53 | * | 59 | * |
@@ -335,8 +341,10 @@ acpi_ev_get_gpe_event_info ( | |||
335 | gpe_block = acpi_gbl_gpe_fadt_blocks[i]; | 341 | gpe_block = acpi_gbl_gpe_fadt_blocks[i]; |
336 | if (gpe_block) { | 342 | if (gpe_block) { |
337 | if ((gpe_number >= gpe_block->block_base_number) && | 343 | if ((gpe_number >= gpe_block->block_base_number) && |
338 | (gpe_number < gpe_block->block_base_number + (gpe_block->register_count * 8))) { | 344 | (gpe_number < gpe_block->block_base_number + |
339 | return (&gpe_block->event_info[gpe_number - gpe_block->block_base_number]); | 345 | (gpe_block->register_count * 8))) { |
346 | return (&gpe_block->event_info[gpe_number - | ||
347 | gpe_block->block_base_number]); | ||
340 | } | 348 | } |
341 | } | 349 | } |
342 | } | 350 | } |
@@ -437,7 +445,7 @@ acpi_ev_gpe_detect ( | |||
437 | "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n", | 445 | "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n", |
438 | gpe_register_info->base_gpe_number, status_reg, enable_reg)); | 446 | gpe_register_info->base_gpe_number, status_reg, enable_reg)); |
439 | 447 | ||
440 | /* First check if there is anything active at all in this register */ | 448 | /* Check if there is anything active at all in this register */ |
441 | 449 | ||
442 | enabled_status_byte = (u8) (status_reg & enable_reg); | 450 | enabled_status_byte = (u8) (status_reg & enable_reg); |
443 | if (!enabled_status_byte) { | 451 | if (!enabled_status_byte) { |
@@ -457,8 +465,8 @@ acpi_ev_gpe_detect ( | |||
457 | * or method. | 465 | * or method. |
458 | */ | 466 | */ |
459 | int_status |= acpi_ev_gpe_dispatch ( | 467 | int_status |= acpi_ev_gpe_dispatch ( |
460 | &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j], | 468 | &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j], |
461 | (u32) j + gpe_register_info->base_gpe_number); | 469 | (u32) j + gpe_register_info->base_gpe_number); |
462 | } | 470 | } |
463 | } | 471 | } |
464 | } | 472 | } |
@@ -523,7 +531,8 @@ acpi_ev_asynch_execute_gpe_method ( | |||
523 | * Take a snapshot of the GPE info for this level - we copy the | 531 | * Take a snapshot of the GPE info for this level - we copy the |
524 | * info to prevent a race condition with remove_handler/remove_block. | 532 | * info to prevent a race condition with remove_handler/remove_block. |
525 | */ | 533 | */ |
526 | ACPI_MEMCPY (&local_gpe_event_info, gpe_event_info, sizeof (struct acpi_gpe_event_info)); | 534 | ACPI_MEMCPY (&local_gpe_event_info, gpe_event_info, |
535 | sizeof (struct acpi_gpe_event_info)); | ||
527 | 536 | ||
528 | status = acpi_ut_release_mutex (ACPI_MTX_EVENTS); | 537 | status = acpi_ut_release_mutex (ACPI_MTX_EVENTS); |
529 | if (ACPI_FAILURE (status)) { | 538 | if (ACPI_FAILURE (status)) { |
@@ -534,7 +543,8 @@ acpi_ev_asynch_execute_gpe_method ( | |||
534 | * Must check for control method type dispatch one more | 543 | * Must check for control method type dispatch one more |
535 | * time to avoid race with ev_gpe_install_handler | 544 | * time to avoid race with ev_gpe_install_handler |
536 | */ | 545 | */ |
537 | if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_METHOD) { | 546 | if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) == |
547 | ACPI_GPE_DISPATCH_METHOD) { | ||
538 | /* | 548 | /* |
539 | * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx | 549 | * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx |
540 | * control method that corresponds to this GPE | 550 | * control method that corresponds to this GPE |
@@ -553,7 +563,8 @@ acpi_ev_asynch_execute_gpe_method ( | |||
553 | } | 563 | } |
554 | } | 564 | } |
555 | 565 | ||
556 | if ((local_gpe_event_info.flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_LEVEL_TRIGGERED) { | 566 | if ((local_gpe_event_info.flags & ACPI_GPE_XRUPT_TYPE_MASK) == |
567 | ACPI_GPE_LEVEL_TRIGGERED) { | ||
557 | /* | 568 | /* |
558 | * GPE is level-triggered, we clear the GPE status bit after | 569 | * GPE is level-triggered, we clear the GPE status bit after |
559 | * handling the event. | 570 | * handling the event. |
@@ -575,7 +586,7 @@ acpi_ev_asynch_execute_gpe_method ( | |||
575 | * | 586 | * |
576 | * FUNCTION: acpi_ev_gpe_dispatch | 587 | * FUNCTION: acpi_ev_gpe_dispatch |
577 | * | 588 | * |
578 | * PARAMETERS: gpe_event_info - info for this GPE | 589 | * PARAMETERS: gpe_event_info - Info for this GPE |
579 | * gpe_number - Number relative to the parent GPE block | 590 | * gpe_number - Number relative to the parent GPE block |
580 | * | 591 | * |
581 | * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED | 592 | * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED |
@@ -602,10 +613,12 @@ acpi_ev_gpe_dispatch ( | |||
602 | * If edge-triggered, clear the GPE status bit now. Note that | 613 | * If edge-triggered, clear the GPE status bit now. Note that |
603 | * level-triggered events are cleared after the GPE is serviced. | 614 | * level-triggered events are cleared after the GPE is serviced. |
604 | */ | 615 | */ |
605 | if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED) { | 616 | if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == |
617 | ACPI_GPE_EDGE_TRIGGERED) { | ||
606 | status = acpi_hw_clear_gpe (gpe_event_info); | 618 | status = acpi_hw_clear_gpe (gpe_event_info); |
607 | if (ACPI_FAILURE (status)) { | 619 | if (ACPI_FAILURE (status)) { |
608 | ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", | 620 | ACPI_REPORT_ERROR (( |
621 | "acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", | ||
609 | acpi_format_exception (status), gpe_number)); | 622 | acpi_format_exception (status), gpe_number)); |
610 | return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); | 623 | return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); |
611 | } | 624 | } |
@@ -639,7 +652,8 @@ acpi_ev_gpe_dispatch ( | |||
639 | 652 | ||
640 | /* It is now safe to clear level-triggered events. */ | 653 | /* It is now safe to clear level-triggered events. */ |
641 | 654 | ||
642 | if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_LEVEL_TRIGGERED) { | 655 | if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == |
656 | ACPI_GPE_LEVEL_TRIGGERED) { | ||
643 | status = acpi_hw_clear_gpe (gpe_event_info); | 657 | status = acpi_hw_clear_gpe (gpe_event_info); |
644 | if (ACPI_FAILURE (status)) { | 658 | if (ACPI_FAILURE (status)) { |
645 | ACPI_REPORT_ERROR (( | 659 | ACPI_REPORT_ERROR (( |
@@ -704,7 +718,6 @@ acpi_ev_gpe_dispatch ( | |||
704 | 718 | ||
705 | 719 | ||
706 | #ifdef ACPI_GPE_NOTIFY_CHECK | 720 | #ifdef ACPI_GPE_NOTIFY_CHECK |
707 | |||
708 | /******************************************************************************* | 721 | /******************************************************************************* |
709 | * TBD: NOT USED, PROTOTYPE ONLY AND WILL PROBABLY BE REMOVED | 722 | * TBD: NOT USED, PROTOTYPE ONLY AND WILL PROBABLY BE REMOVED |
710 | * | 723 | * |