1 2/****************************************************************************** 3 * 4 * Module Name: hwgpe - Low level GPE enable/disable/clear functions 5 * 6 *****************************************************************************/ 7 8/* --- 51 unchanged lines hidden (view full) --- 60 void *Context); 61 62 63/****************************************************************************** 64 * 65 * FUNCTION: AcpiHwGetGpeRegisterBit 66 * 67 * PARAMETERS: GpeEventInfo - Info block for the GPE |
68 * 69 * RETURN: Register mask with a one in the GPE bit position 70 * 71 * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the 72 * correct position for the input GPE. 73 * 74 ******************************************************************************/ 75 76UINT32 77AcpiHwGetGpeRegisterBit ( |
78 ACPI_GPE_EVENT_INFO *GpeEventInfo) |
79{ 80 81 return ((UINT32) 1 << |
82 (GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber)); |
83} 84 85 86/****************************************************************************** 87 * 88 * FUNCTION: AcpiHwLowSetGpe 89 * 90 * PARAMETERS: GpeEventInfo - Info block for the GPE to be disabled --- 32 unchanged lines hidden (view full) --- 123 Status = AcpiHwRead (&EnableMask, &GpeRegisterInfo->EnableAddress); 124 if (ACPI_FAILURE (Status)) 125 { 126 return (Status); 127 } 128 129 /* Set or clear just the bit that corresponds to this GPE */ 130 |
131 RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); |
132 switch (Action) 133 { 134 case ACPI_GPE_CONDITIONAL_ENABLE: 135 136 /* Only enable if the EnableForRun bit is set */ 137 138 if (!(RegisterBit & GpeRegisterInfo->EnableForRun)) 139 { --- 52 unchanged lines hidden (view full) --- 192 { 193 return (AE_NOT_EXIST); 194 } 195 196 /* 197 * Write a one to the appropriate bit in the status register to 198 * clear this GPE. 199 */ |
200 RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); |
201 202 Status = AcpiHwWrite (RegisterBit, 203 &GpeRegisterInfo->StatusAddress); 204 205 return (Status); 206} 207 208 --- 31 unchanged lines hidden (view full) --- 240 } 241 242 /* Get the info block for the entire GPE register */ 243 244 GpeRegisterInfo = GpeEventInfo->RegisterInfo; 245 246 /* Get the register bitmask for this GPE */ 247 |
248 RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); |
249 250 /* GPE currently enabled? (enabled for runtime?) */ 251 252 if (RegisterBit & GpeRegisterInfo->EnableForRun) 253 { 254 LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED; 255 } 256 --- 285 unchanged lines hidden --- |