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/evgpeblk.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/evgpeblk.c')
-rw-r--r-- | drivers/acpi/events/evgpeblk.c | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c index 00d981f53c6a..84186a7d17b2 100644 --- a/drivers/acpi/events/evgpeblk.c +++ b/drivers/acpi/events/evgpeblk.c | |||
@@ -48,6 +48,39 @@ | |||
48 | #define _COMPONENT ACPI_EVENTS | 48 | #define _COMPONENT ACPI_EVENTS |
49 | ACPI_MODULE_NAME ("evgpeblk") | 49 | ACPI_MODULE_NAME ("evgpeblk") |
50 | 50 | ||
51 | /* Local prototypes */ | ||
52 | |||
53 | static acpi_status | ||
54 | acpi_ev_save_method_info ( | ||
55 | acpi_handle obj_handle, | ||
56 | u32 level, | ||
57 | void *obj_desc, | ||
58 | void **return_value); | ||
59 | |||
60 | static acpi_status | ||
61 | acpi_ev_match_prw_and_gpe ( | ||
62 | acpi_handle obj_handle, | ||
63 | u32 level, | ||
64 | void *info, | ||
65 | void **return_value); | ||
66 | |||
67 | static struct acpi_gpe_xrupt_info * | ||
68 | acpi_ev_get_gpe_xrupt_block ( | ||
69 | u32 interrupt_level); | ||
70 | |||
71 | static acpi_status | ||
72 | acpi_ev_delete_gpe_xrupt ( | ||
73 | struct acpi_gpe_xrupt_info *gpe_xrupt); | ||
74 | |||
75 | static acpi_status | ||
76 | acpi_ev_install_gpe_block ( | ||
77 | struct acpi_gpe_block_info *gpe_block, | ||
78 | u32 interrupt_level); | ||
79 | |||
80 | static acpi_status | ||
81 | acpi_ev_create_gpe_info_blocks ( | ||
82 | struct acpi_gpe_block_info *gpe_block); | ||
83 | |||
51 | 84 | ||
52 | /******************************************************************************* | 85 | /******************************************************************************* |
53 | * | 86 | * |
@@ -155,7 +188,7 @@ unlock_and_exit: | |||
155 | } | 188 | } |
156 | 189 | ||
157 | 190 | ||
158 | /****************************************************************************** | 191 | /******************************************************************************* |
159 | * | 192 | * |
160 | * FUNCTION: acpi_ev_delete_gpe_handlers | 193 | * FUNCTION: acpi_ev_delete_gpe_handlers |
161 | * | 194 | * |
@@ -190,7 +223,8 @@ acpi_ev_delete_gpe_handlers ( | |||
190 | for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { | 223 | for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { |
191 | gpe_event_info = &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j]; | 224 | gpe_event_info = &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j]; |
192 | 225 | ||
193 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { | 226 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
227 | ACPI_GPE_DISPATCH_HANDLER) { | ||
194 | ACPI_MEM_FREE (gpe_event_info->dispatch.handler); | 228 | ACPI_MEM_FREE (gpe_event_info->dispatch.handler); |
195 | gpe_event_info->dispatch.handler = NULL; | 229 | gpe_event_info->dispatch.handler = NULL; |
196 | gpe_event_info->flags &= ~ACPI_GPE_DISPATCH_MASK; | 230 | gpe_event_info->flags &= ~ACPI_GPE_DISPATCH_MASK; |
@@ -471,7 +505,7 @@ acpi_ev_get_gpe_xrupt_block ( | |||
471 | ACPI_FUNCTION_TRACE ("ev_get_gpe_xrupt_block"); | 505 | ACPI_FUNCTION_TRACE ("ev_get_gpe_xrupt_block"); |
472 | 506 | ||
473 | 507 | ||
474 | /* No need for spin lock since we are not changing any list elements here */ | 508 | /* No need for lock since we are not changing any list elements here */ |
475 | 509 | ||
476 | next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head; | 510 | next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head; |
477 | while (next_gpe_xrupt) { | 511 | while (next_gpe_xrupt) { |
@@ -619,7 +653,7 @@ acpi_ev_install_gpe_block ( | |||
619 | goto unlock_and_exit; | 653 | goto unlock_and_exit; |
620 | } | 654 | } |
621 | 655 | ||
622 | /* Install the new block at the end of the list for this interrupt with lock */ | 656 | /* Install the new block at the end of the list with lock */ |
623 | 657 | ||
624 | acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); | 658 | acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR); |
625 | if (gpe_xrupt_block->gpe_block_list_head) { | 659 | if (gpe_xrupt_block->gpe_block_list_head) { |
@@ -756,10 +790,12 @@ acpi_ev_create_gpe_info_blocks ( | |||
756 | * per register. Initialization to zeros is sufficient. | 790 | * per register. Initialization to zeros is sufficient. |
757 | */ | 791 | */ |
758 | gpe_event_info = ACPI_MEM_CALLOCATE ( | 792 | gpe_event_info = ACPI_MEM_CALLOCATE ( |
759 | ((acpi_size) gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) * | 793 | ((acpi_size) gpe_block->register_count * |
794 | ACPI_GPE_REGISTER_WIDTH) * | ||
760 | sizeof (struct acpi_gpe_event_info)); | 795 | sizeof (struct acpi_gpe_event_info)); |
761 | if (!gpe_event_info) { | 796 | if (!gpe_event_info) { |
762 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not allocate the gpe_event_info table\n")); | 797 | ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, |
798 | "Could not allocate the gpe_event_info table\n")); | ||
763 | status = AE_NO_MEMORY; | 799 | status = AE_NO_MEMORY; |
764 | goto error_exit; | 800 | goto error_exit; |
765 | } | 801 | } |
@@ -899,7 +935,8 @@ acpi_ev_create_gpe_block ( | |||
899 | gpe_block->block_base_number = gpe_block_base_number; | 935 | gpe_block->block_base_number = gpe_block_base_number; |
900 | gpe_block->node = gpe_device; | 936 | gpe_block->node = gpe_device; |
901 | 937 | ||
902 | ACPI_MEMCPY (&gpe_block->block_address, gpe_block_address, sizeof (struct acpi_generic_address)); | 938 | ACPI_MEMCPY (&gpe_block->block_address, gpe_block_address, |
939 | sizeof (struct acpi_generic_address)); | ||
903 | 940 | ||
904 | /* Create the register_info and event_info sub-structures */ | 941 | /* Create the register_info and event_info sub-structures */ |
905 | 942 | ||
@@ -1061,8 +1098,9 @@ acpi_ev_gpe_initialize ( | |||
1061 | 1098 | ||
1062 | /* Install GPE Block 0 */ | 1099 | /* Install GPE Block 0 */ |
1063 | 1100 | ||
1064 | status = acpi_ev_create_gpe_block (acpi_gbl_fadt_gpe_device, &acpi_gbl_FADT->xgpe0_blk, | 1101 | status = acpi_ev_create_gpe_block (acpi_gbl_fadt_gpe_device, |
1065 | register_count0, 0, acpi_gbl_FADT->sci_int, &acpi_gbl_gpe_fadt_blocks[0]); | 1102 | &acpi_gbl_FADT->xgpe0_blk, register_count0, 0, |
1103 | acpi_gbl_FADT->sci_int, &acpi_gbl_gpe_fadt_blocks[0]); | ||
1066 | 1104 | ||
1067 | if (ACPI_FAILURE (status)) { | 1105 | if (ACPI_FAILURE (status)) { |
1068 | ACPI_REPORT_ERROR (( | 1106 | ACPI_REPORT_ERROR (( |
@@ -1094,8 +1132,9 @@ acpi_ev_gpe_initialize ( | |||
1094 | else { | 1132 | else { |
1095 | /* Install GPE Block 1 */ | 1133 | /* Install GPE Block 1 */ |
1096 | 1134 | ||
1097 | status = acpi_ev_create_gpe_block (acpi_gbl_fadt_gpe_device, &acpi_gbl_FADT->xgpe1_blk, | 1135 | status = acpi_ev_create_gpe_block (acpi_gbl_fadt_gpe_device, |
1098 | register_count1, acpi_gbl_FADT->gpe1_base, | 1136 | &acpi_gbl_FADT->xgpe1_blk, register_count1, |
1137 | acpi_gbl_FADT->gpe1_base, | ||
1099 | acpi_gbl_FADT->sci_int, &acpi_gbl_gpe_fadt_blocks[1]); | 1138 | acpi_gbl_FADT->sci_int, &acpi_gbl_gpe_fadt_blocks[1]); |
1100 | 1139 | ||
1101 | if (ACPI_FAILURE (status)) { | 1140 | if (ACPI_FAILURE (status)) { |
@@ -1109,7 +1148,7 @@ acpi_ev_gpe_initialize ( | |||
1109 | * space. However, GPE0 always starts at GPE number zero. | 1148 | * space. However, GPE0 always starts at GPE number zero. |
1110 | */ | 1149 | */ |
1111 | gpe_number_max = acpi_gbl_FADT->gpe1_base + | 1150 | gpe_number_max = acpi_gbl_FADT->gpe1_base + |
1112 | ((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1); | 1151 | ((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1); |
1113 | } | 1152 | } |
1114 | } | 1153 | } |
1115 | 1154 | ||