aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events/evgpeblk.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-06-24 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-07-13 23:45:36 -0400
commit73459f73e5d1602c59ebec114fc45185521353c1 (patch)
tree56c2183e345784d2be09c2f5d2530cf36221c55e /drivers/acpi/events/evgpeblk.c
parent88ac00f5a841dcfc5c682000f4a6add0add8caac (diff)
ACPICA 20050617-0624 from Bob Moore <robert.moore@intel.com>
ACPICA 20050617: Moved the object cache operations into the OS interface layer (OSL) to allow the host OS to handle these operations if desired (for example, the Linux OSL will invoke the slab allocator). This support is optional; the compile time define ACPI_USE_LOCAL_CACHE may be used to utilize the original cache code in the ACPI CA core. The new OSL interfaces are shown below. See utalloc.c for an example implementation, and acpiosxf.h for the exact interface definitions. Thanks to Alexey Starikovskiy. acpi_os_create_cache acpi_os_delete_cache acpi_os_purge_cache acpi_os_acquire_object acpi_os_release_object Modified the interfaces to acpi_os_acquire_lock and acpi_os_release_lock to return and restore a flags parameter. This fits better with many OS lock models. Note: the current execution state (interrupt handler or not) is no longer passed to these interfaces. If necessary, the OSL must determine this state by itself, a simple and fast operation. Thanks to Alexey Starikovskiy. Fixed a problem in the ACPI table handling where a valid XSDT was assumed present if the revision of the RSDP was 2 or greater. According to the ACPI specification, the XSDT is optional in all cases, and the table manager therefore now checks for both an RSDP >=2 and a valid XSDT pointer. Otherwise, the RSDT pointer is used. Some ACPI 2.0 compliant BIOSs contain only the RSDT. Fixed an interpreter problem with the Mid() operator in the case of an input string where the resulting output string is of zero length. It now correctly returns a valid, null terminated string object instead of a string object with a null pointer. Fixed a problem with the control method argument handling to allow a store to an Arg object that already contains an object of type Device. The Device object is now correctly overwritten. Previously, an error was returned. ACPICA 20050624: Modified the new OSL cache interfaces to use ACPI_CACHE_T as the type for the host-defined cache object. This allows the OSL implementation to define and type this object in any manner desired, simplifying the OSL implementation. For example, ACPI_CACHE_T is defined as kmem_cache_t for Linux, and should be defined in the OS-specific header file for other operating systems as required. Changed the interface to AcpiOsAcquireObject to directly return the requested object as the function return (instead of ACPI_STATUS.) This change was made for performance reasons, since this is the purpose of the interface in the first place. acpi_os_acquire_object is now similar to the acpi_os_allocate interface. Thanks to Alexey Starikovskiy. Modified the initialization sequence in acpi_initialize_subsystem to call the OSL interface acpi_osl_initialize first, before any local initialization. This change was required because the global initialization now calls OSL interfaces. Restructured the code base to split some files because of size and/or because the code logically belonged in a separate file. New files are listed below. utilities/utcache.c /* Local cache interfaces */ utilities/utmutex.c /* Local mutex support */ utilities/utstate.c /* State object support */ parser/psloop.c /* Main AML parse loop */ Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/events/evgpeblk.c')
-rw-r--r--drivers/acpi/events/evgpeblk.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index ee5419b8f1b1..dfc54692b127 100644
--- a/drivers/acpi/events/evgpeblk.c
+++ b/drivers/acpi/events/evgpeblk.c
@@ -138,7 +138,6 @@ acpi_ev_valid_gpe_event (
138 * FUNCTION: acpi_ev_walk_gpe_list 138 * FUNCTION: acpi_ev_walk_gpe_list
139 * 139 *
140 * PARAMETERS: gpe_walk_callback - Routine called for each GPE block 140 * PARAMETERS: gpe_walk_callback - Routine called for each GPE block
141 * Flags - ACPI_NOT_ISR or ACPI_ISR
142 * 141 *
143 * RETURN: Status 142 * RETURN: Status
144 * 143 *
@@ -148,18 +147,18 @@ acpi_ev_valid_gpe_event (
148 147
149acpi_status 148acpi_status
150acpi_ev_walk_gpe_list ( 149acpi_ev_walk_gpe_list (
151 ACPI_GPE_CALLBACK gpe_walk_callback, 150 ACPI_GPE_CALLBACK gpe_walk_callback)
152 u32 flags)
153{ 151{
154 struct acpi_gpe_block_info *gpe_block; 152 struct acpi_gpe_block_info *gpe_block;
155 struct acpi_gpe_xrupt_info *gpe_xrupt_info; 153 struct acpi_gpe_xrupt_info *gpe_xrupt_info;
156 acpi_status status = AE_OK; 154 acpi_status status = AE_OK;
155 u32 flags;
157 156
158 157
159 ACPI_FUNCTION_TRACE ("ev_walk_gpe_list"); 158 ACPI_FUNCTION_TRACE ("ev_walk_gpe_list");
160 159
161 160
162 acpi_os_acquire_lock (acpi_gbl_gpe_lock, flags); 161 flags = acpi_os_acquire_lock (acpi_gbl_gpe_lock);
163 162
164 /* Walk the interrupt level descriptor list */ 163 /* Walk the interrupt level descriptor list */
165 164
@@ -500,6 +499,7 @@ acpi_ev_get_gpe_xrupt_block (
500 struct acpi_gpe_xrupt_info *next_gpe_xrupt; 499 struct acpi_gpe_xrupt_info *next_gpe_xrupt;
501 struct acpi_gpe_xrupt_info *gpe_xrupt; 500 struct acpi_gpe_xrupt_info *gpe_xrupt;
502 acpi_status status; 501 acpi_status status;
502 u32 flags;
503 503
504 504
505 ACPI_FUNCTION_TRACE ("ev_get_gpe_xrupt_block"); 505 ACPI_FUNCTION_TRACE ("ev_get_gpe_xrupt_block");
@@ -527,7 +527,7 @@ acpi_ev_get_gpe_xrupt_block (
527 527
528 /* Install new interrupt descriptor with spin lock */ 528 /* Install new interrupt descriptor with spin lock */
529 529
530 acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 530 flags = acpi_os_acquire_lock (acpi_gbl_gpe_lock);
531 if (acpi_gbl_gpe_xrupt_list_head) { 531 if (acpi_gbl_gpe_xrupt_list_head) {
532 next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head; 532 next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
533 while (next_gpe_xrupt->next) { 533 while (next_gpe_xrupt->next) {
@@ -540,7 +540,7 @@ acpi_ev_get_gpe_xrupt_block (
540 else { 540 else {
541 acpi_gbl_gpe_xrupt_list_head = gpe_xrupt; 541 acpi_gbl_gpe_xrupt_list_head = gpe_xrupt;
542 } 542 }
543 acpi_os_release_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 543 acpi_os_release_lock (acpi_gbl_gpe_lock, flags);
544 544
545 /* Install new interrupt handler if not SCI_INT */ 545 /* Install new interrupt handler if not SCI_INT */
546 546
@@ -577,6 +577,7 @@ acpi_ev_delete_gpe_xrupt (
577 struct acpi_gpe_xrupt_info *gpe_xrupt) 577 struct acpi_gpe_xrupt_info *gpe_xrupt)
578{ 578{
579 acpi_status status; 579 acpi_status status;
580 u32 flags;
580 581
581 582
582 ACPI_FUNCTION_TRACE ("ev_delete_gpe_xrupt"); 583 ACPI_FUNCTION_TRACE ("ev_delete_gpe_xrupt");
@@ -599,7 +600,7 @@ acpi_ev_delete_gpe_xrupt (
599 600
600 /* Unlink the interrupt block with lock */ 601 /* Unlink the interrupt block with lock */
601 602
602 acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 603 flags = acpi_os_acquire_lock (acpi_gbl_gpe_lock);
603 if (gpe_xrupt->previous) { 604 if (gpe_xrupt->previous) {
604 gpe_xrupt->previous->next = gpe_xrupt->next; 605 gpe_xrupt->previous->next = gpe_xrupt->next;
605 } 606 }
@@ -607,7 +608,7 @@ acpi_ev_delete_gpe_xrupt (
607 if (gpe_xrupt->next) { 608 if (gpe_xrupt->next) {
608 gpe_xrupt->next->previous = gpe_xrupt->previous; 609 gpe_xrupt->next->previous = gpe_xrupt->previous;
609 } 610 }
610 acpi_os_release_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 611 acpi_os_release_lock (acpi_gbl_gpe_lock, flags);
611 612
612 /* Free the block */ 613 /* Free the block */
613 614
@@ -637,6 +638,7 @@ acpi_ev_install_gpe_block (
637 struct acpi_gpe_block_info *next_gpe_block; 638 struct acpi_gpe_block_info *next_gpe_block;
638 struct acpi_gpe_xrupt_info *gpe_xrupt_block; 639 struct acpi_gpe_xrupt_info *gpe_xrupt_block;
639 acpi_status status; 640 acpi_status status;
641 u32 flags;
640 642
641 643
642 ACPI_FUNCTION_TRACE ("ev_install_gpe_block"); 644 ACPI_FUNCTION_TRACE ("ev_install_gpe_block");
@@ -655,7 +657,7 @@ acpi_ev_install_gpe_block (
655 657
656 /* Install the new block at the end of the list with lock */ 658 /* Install the new block at the end of the list with lock */
657 659
658 acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 660 flags = acpi_os_acquire_lock (acpi_gbl_gpe_lock);
659 if (gpe_xrupt_block->gpe_block_list_head) { 661 if (gpe_xrupt_block->gpe_block_list_head) {
660 next_gpe_block = gpe_xrupt_block->gpe_block_list_head; 662 next_gpe_block = gpe_xrupt_block->gpe_block_list_head;
661 while (next_gpe_block->next) { 663 while (next_gpe_block->next) {
@@ -670,7 +672,7 @@ acpi_ev_install_gpe_block (
670 } 672 }
671 673
672 gpe_block->xrupt_block = gpe_xrupt_block; 674 gpe_block->xrupt_block = gpe_xrupt_block;
673 acpi_os_release_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 675 acpi_os_release_lock (acpi_gbl_gpe_lock, flags);
674 676
675unlock_and_exit: 677unlock_and_exit:
676 status = acpi_ut_release_mutex (ACPI_MTX_EVENTS); 678 status = acpi_ut_release_mutex (ACPI_MTX_EVENTS);
@@ -695,6 +697,7 @@ acpi_ev_delete_gpe_block (
695 struct acpi_gpe_block_info *gpe_block) 697 struct acpi_gpe_block_info *gpe_block)
696{ 698{
697 acpi_status status; 699 acpi_status status;
700 u32 flags;
698 701
699 702
700 ACPI_FUNCTION_TRACE ("ev_install_gpe_block"); 703 ACPI_FUNCTION_TRACE ("ev_install_gpe_block");
@@ -720,7 +723,7 @@ acpi_ev_delete_gpe_block (
720 else { 723 else {
721 /* Remove the block on this interrupt with lock */ 724 /* Remove the block on this interrupt with lock */
722 725
723 acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 726 flags = acpi_os_acquire_lock (acpi_gbl_gpe_lock);
724 if (gpe_block->previous) { 727 if (gpe_block->previous) {
725 gpe_block->previous->next = gpe_block->next; 728 gpe_block->previous->next = gpe_block->next;
726 } 729 }
@@ -731,7 +734,7 @@ acpi_ev_delete_gpe_block (
731 if (gpe_block->next) { 734 if (gpe_block->next) {
732 gpe_block->next->previous = gpe_block->previous; 735 gpe_block->next->previous = gpe_block->previous;
733 } 736 }
734 acpi_os_release_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); 737 acpi_os_release_lock (acpi_gbl_gpe_lock, flags);
735 } 738 }
736 739
737 /* Free the gpe_block */ 740 /* Free the gpe_block */