aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events/evgpeblk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/events/evgpeblk.c')
-rw-r--r--drivers/acpi/events/evgpeblk.c63
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
53static acpi_status
54acpi_ev_save_method_info (
55 acpi_handle obj_handle,
56 u32 level,
57 void *obj_desc,
58 void **return_value);
59
60static acpi_status
61acpi_ev_match_prw_and_gpe (
62 acpi_handle obj_handle,
63 u32 level,
64 void *info,
65 void **return_value);
66
67static struct acpi_gpe_xrupt_info *
68acpi_ev_get_gpe_xrupt_block (
69 u32 interrupt_level);
70
71static acpi_status
72acpi_ev_delete_gpe_xrupt (
73 struct acpi_gpe_xrupt_info *gpe_xrupt);
74
75static acpi_status
76acpi_ev_install_gpe_block (
77 struct acpi_gpe_block_info *gpe_block,
78 u32 interrupt_level);
79
80static acpi_status
81acpi_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