Deleted Added
full compact
evevent.c (85756) evevent.c (87031)
1/******************************************************************************
2 *
3 * Module Name: evevent - Fixed and General Purpose AcpiEvent
4 * handling and dispatch
1/******************************************************************************
2 *
3 * Module Name: evevent - Fixed and General Purpose AcpiEvent
4 * handling and dispatch
5 * $Revision: 51 $
5 * $Revision: 54 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

--- 137 unchanged lines hidden (view full) ---

151 /* Make sure we have ACPI tables */
152
153 if (!AcpiGbl_DSDT)
154 {
155 ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No ACPI tables present!\n"));
156 return_ACPI_STATUS (AE_NO_ACPI_TABLES);
157 }
158
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

--- 137 unchanged lines hidden (view full) ---

151 /* Make sure we have ACPI tables */
152
153 if (!AcpiGbl_DSDT)
154 {
155 ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No ACPI tables present!\n"));
156 return_ACPI_STATUS (AE_NO_ACPI_TABLES);
157 }
158
159
160 /* Make sure the BIOS supports ACPI mode */
161
162 if (SYS_MODE_LEGACY == AcpiHwGetModeCapabilities())
163 {
164 ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "ACPI Mode is not supported!\n"));
165 return_ACPI_STATUS (AE_ERROR);
166 }
167
168
169 AcpiGbl_OriginalMode = AcpiHwGetMode();
170
171 /*
172 * Initialize the Fixed and General Purpose AcpiEvents prior. This is
173 * done prior to enabling SCIs to prevent interrupts from occuring
174 * before handers are installed.
175 */
176 Status = AcpiEvFixedEventInitialize ();
177 if (ACPI_FAILURE (Status))
178 {

--- 12 unchanged lines hidden (view full) ---

191
192 Status = AcpiEvInstallSciHandler ();
193 if (ACPI_FAILURE (Status))
194 {
195 ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to install System Control Interrupt Handler\n"));
196 return_ACPI_STATUS (Status);
197 }
198
159 /*
160 * Initialize the Fixed and General Purpose AcpiEvents prior. This is
161 * done prior to enabling SCIs to prevent interrupts from occuring
162 * before handers are installed.
163 */
164 Status = AcpiEvFixedEventInitialize ();
165 if (ACPI_FAILURE (Status))
166 {

--- 12 unchanged lines hidden (view full) ---

179
180 Status = AcpiEvInstallSciHandler ();
181 if (ACPI_FAILURE (Status))
182 {
183 ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to install System Control Interrupt Handler\n"));
184 return_ACPI_STATUS (Status);
185 }
186
199
200 /* Install handlers for control method GPE handlers (_Lxx, _Exx) */
201
202 Status = AcpiEvInitGpeControlMethods ();
203 if (ACPI_FAILURE (Status))
204 {
205 ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Gpe control methods\n"));
206 return_ACPI_STATUS (Status);
207 }
208
209 /* Install the handler for the Global Lock */
210
211 Status = AcpiEvInitGlobalLockHandler ();
212 if (ACPI_FAILURE (Status))
213 {
214 ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Global Lock handler\n"));
215 return_ACPI_STATUS (Status);
216 }
217
187 /* Install handlers for control method GPE handlers (_Lxx, _Exx) */
188
189 Status = AcpiEvInitGpeControlMethods ();
190 if (ACPI_FAILURE (Status))
191 {
192 ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Gpe control methods\n"));
193 return_ACPI_STATUS (Status);
194 }
195
196 /* Install the handler for the Global Lock */
197
198 Status = AcpiEvInitGlobalLockHandler ();
199 if (ACPI_FAILURE (Status))
200 {
201 ACPI_DEBUG_PRINT ((ACPI_DB_FATAL, "Unable to initialize Global Lock handler\n"));
202 return_ACPI_STATUS (Status);
203 }
204
218
219 return_ACPI_STATUS (Status);
220}
221
222
223/*******************************************************************************
224 *
225 * FUNCTION: AcpiEvFixedEventInitialize
226 *
227 * PARAMETERS: None
228 *
229 * RETURN: Status
230 *
231 * DESCRIPTION: Initialize the Fixed AcpiEvent data structures
232 *
233 ******************************************************************************/
234
235ACPI_STATUS
236AcpiEvFixedEventInitialize(void)
237{
205 return_ACPI_STATUS (Status);
206}
207
208
209/*******************************************************************************
210 *
211 * FUNCTION: AcpiEvFixedEventInitialize
212 *
213 * PARAMETERS: None
214 *
215 * RETURN: Status
216 *
217 * DESCRIPTION: Initialize the Fixed AcpiEvent data structures
218 *
219 ******************************************************************************/
220
221ACPI_STATUS
222AcpiEvFixedEventInitialize(void)
223{
238 int i = 0;
224 NATIVE_UINT i;
239
225
226
240 /* Initialize the structure that keeps track of fixed event handlers */
241
242 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
243 {
244 AcpiGbl_FixedEventHandlers[i].Handler = NULL;
245 AcpiGbl_FixedEventHandlers[i].Context = NULL;
246 }
247

--- 36 unchanged lines hidden (view full) ---

284 */
285 StatusRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_STS);
286 EnableRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_EN);
287
288 ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
289 "Fixed AcpiEvent Block: Enable %08X Status %08X\n",
290 EnableRegister, StatusRegister));
291
227 /* Initialize the structure that keeps track of fixed event handlers */
228
229 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
230 {
231 AcpiGbl_FixedEventHandlers[i].Handler = NULL;
232 AcpiGbl_FixedEventHandlers[i].Context = NULL;
233 }
234

--- 36 unchanged lines hidden (view full) ---

271 */
272 StatusRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_STS);
273 EnableRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_EN);
274
275 ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
276 "Fixed AcpiEvent Block: Enable %08X Status %08X\n",
277 EnableRegister, StatusRegister));
278
279 /* Power management timer roll over */
292
280
293 /* power management timer roll over */
294
295 if ((StatusRegister & ACPI_STATUS_PMTIMER) &&
296 (EnableRegister & ACPI_ENABLE_PMTIMER))
297 {
298 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_PMTIMER);
299 }
300
281 if ((StatusRegister & ACPI_STATUS_PMTIMER) &&
282 (EnableRegister & ACPI_ENABLE_PMTIMER))
283 {
284 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_PMTIMER);
285 }
286
301 /* global event (BIOS wants the global lock) */
287 /* Global event (BIOS wants the global lock) */
302
303 if ((StatusRegister & ACPI_STATUS_GLOBAL) &&
304 (EnableRegister & ACPI_ENABLE_GLOBAL))
305 {
306 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_GLOBAL);
307 }
308
288
289 if ((StatusRegister & ACPI_STATUS_GLOBAL) &&
290 (EnableRegister & ACPI_ENABLE_GLOBAL))
291 {
292 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_GLOBAL);
293 }
294
309 /* power button event */
295 /* Power button event */
310
311 if ((StatusRegister & ACPI_STATUS_POWER_BUTTON) &&
312 (EnableRegister & ACPI_ENABLE_POWER_BUTTON))
313 {
314 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_POWER_BUTTON);
315 }
316
296
297 if ((StatusRegister & ACPI_STATUS_POWER_BUTTON) &&
298 (EnableRegister & ACPI_ENABLE_POWER_BUTTON))
299 {
300 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_POWER_BUTTON);
301 }
302
317 /* sleep button event */
303 /* Sleep button event */
318
319 if ((StatusRegister & ACPI_STATUS_SLEEP_BUTTON) &&
320 (EnableRegister & ACPI_ENABLE_SLEEP_BUTTON))
321 {
322 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_SLEEP_BUTTON);
323 }
324
325 return (IntStatus);

--- 323 unchanged lines hidden (view full) ---

649
650 /*
651 * Now we can add this information to the GpeInfo block
652 * for use during dispatch of this GPE.
653 */
654 AcpiGbl_GpeInfo [GpeNumber].Type = Type;
655 AcpiGbl_GpeInfo [GpeNumber].MethodHandle = ObjHandle;
656
304
305 if ((StatusRegister & ACPI_STATUS_SLEEP_BUTTON) &&
306 (EnableRegister & ACPI_ENABLE_SLEEP_BUTTON))
307 {
308 IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_SLEEP_BUTTON);
309 }
310
311 return (IntStatus);

--- 323 unchanged lines hidden (view full) ---

635
636 /*
637 * Now we can add this information to the GpeInfo block
638 * for use during dispatch of this GPE.
639 */
640 AcpiGbl_GpeInfo [GpeNumber].Type = Type;
641 AcpiGbl_GpeInfo [GpeNumber].MethodHandle = ObjHandle;
642
657
658 /*
659 * Enable the GPE (SCIs should be disabled at this point)
660 */
661 AcpiHwEnableGpe (GpeNumber);
662
663 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %X\n",
664 Name, GpeNumber));
665 return (AE_OK);

--- 140 unchanged lines hidden (view full) ---

806 void *Context)
807{
808 UINT32 GpeNumber = (UINT32) Context;
809 ACPI_GPE_LEVEL_INFO GpeInfo;
810
811
812 FUNCTION_TRACE ("EvAsynchExecuteGpeMethod");
813
643 /*
644 * Enable the GPE (SCIs should be disabled at this point)
645 */
646 AcpiHwEnableGpe (GpeNumber);
647
648 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %X\n",
649 Name, GpeNumber));
650 return (AE_OK);

--- 140 unchanged lines hidden (view full) ---

791 void *Context)
792{
793 UINT32 GpeNumber = (UINT32) Context;
794 ACPI_GPE_LEVEL_INFO GpeInfo;
795
796
797 FUNCTION_TRACE ("EvAsynchExecuteGpeMethod");
798
799
814 /*
815 * Take a snapshot of the GPE info for this level
816 */
817 AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
818 GpeInfo = AcpiGbl_GpeInfo [GpeNumber];
819 AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
820
821 /*

--- 138 unchanged lines hidden ---
800 /*
801 * Take a snapshot of the GPE info for this level
802 */
803 AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
804 GpeInfo = AcpiGbl_GpeInfo [GpeNumber];
805 AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
806
807 /*

--- 138 unchanged lines hidden ---