1/****************************************************************************** 2 * 3 * Module Name: evgpe - General Purpose Event handling and dispatch |
4 * $Revision: 42 $ |
5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. --- 188 unchanged lines hidden (view full) --- 201 return_ACPI_STATUS (AE_NOT_EXIST); 202 } 203 RegisterBit = GpeEventInfo->RegisterBit; 204 205 /* 1) Disable case. Simply clear all enable bits */ 206 207 if (Type == ACPI_GPE_DISABLE) 208 { |
209 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, RegisterBit); 210 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForRun, RegisterBit); |
211 return_ACPI_STATUS (AE_OK); 212 } 213 |
214 /* 2) Enable case. Set/Clear the appropriate enable bits */ |
215 216 switch (GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK) 217 { 218 case ACPI_GPE_TYPE_WAKE: |
219 ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, RegisterBit); 220 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForRun, RegisterBit); |
221 break; 222 223 case ACPI_GPE_TYPE_RUNTIME: |
224 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, RegisterBit); 225 ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, RegisterBit); |
226 break; 227 228 case ACPI_GPE_TYPE_WAKE_RUN: |
229 ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, RegisterBit); 230 ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, RegisterBit); |
231 break; 232 233 default: 234 return_ACPI_STATUS (AE_BAD_PARAMETER); 235 } 236 237 return_ACPI_STATUS (AE_OK); 238} --- 30 unchanged lines hidden (view full) --- 269 return_ACPI_STATUS (Status); 270 } 271 272 /* Mark wake-enabled or HW enable, or both */ 273 274 switch (GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK) 275 { 276 case ACPI_GPE_TYPE_WAKE: |
277 278 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED); |
279 break; 280 281 case ACPI_GPE_TYPE_WAKE_RUN: |
282 |
283 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED); 284 |
285 /*lint -fallthrough */ 286 287 case ACPI_GPE_TYPE_RUNTIME: 288 |
289 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_RUN_ENABLED); |
290 291 if (WriteToHardware) 292 { 293 /* Clear the GPE (of stale events), then enable it */ 294 295 Status = AcpiHwClearGpe (GpeEventInfo); 296 if (ACPI_FAILURE (Status)) 297 { --- 49 unchanged lines hidden (view full) --- 347 return_ACPI_STATUS (Status); 348 } 349 350 /* Mark wake-disabled or HW disable, or both */ 351 352 switch (GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK) 353 { 354 case ACPI_GPE_TYPE_WAKE: |
355 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED); |
356 break; 357 358 case ACPI_GPE_TYPE_WAKE_RUN: |
359 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED); |
360 361 /*lint -fallthrough */ 362 363 case ACPI_GPE_TYPE_RUNTIME: 364 365 /* Disable the requested runtime GPE */ 366 |
367 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_RUN_ENABLED); |
368 Status = AcpiHwWriteGpeEnableReg (GpeEventInfo); 369 break; 370 371 default: 372 return_ACPI_STATUS (AE_BAD_PARAMETER); 373 } 374 375 return_ACPI_STATUS (AE_OK); --- 342 unchanged lines hidden (view full) --- 718 return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); 719 } 720 } 721 722 /* Save current system state */ 723 724 if (AcpiGbl_SystemAwakeAndRunning) 725 { |
726 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_SYSTEM_RUNNING); |
727 } 728 else 729 { |
730 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_SYSTEM_RUNNING); |
731 } 732 733 /* 734 * Dispatch the GPE to either an installed handler, or the control 735 * method associated with this GPE (_Lxx or _Exx). 736 * If a handler exists, we invoke it and do not attempt to run the method. 737 * If there is neither a handler nor a method, we disable the level to 738 * prevent further events from coming in here. 739 */ 740 switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) 741 { 742 case ACPI_GPE_DISPATCH_HANDLER: 743 |
744 /* 745 * Invoke the installed handler (at interrupt level) 746 * Ignore return status for now. TBD: leave GPE disabled on error? 747 */ 748 (void) GpeEventInfo->Dispatch.Handler->Address ( |
749 GpeEventInfo->Dispatch.Handler->Context); 750 751 /* It is now safe to clear level-triggered events. */ 752 753 if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_LEVEL_TRIGGERED) 754 { 755 Status = AcpiHwClearGpe (GpeEventInfo); 756 if (ACPI_FAILURE (Status)) --- 117 unchanged lines hidden --- |