xref: /titanic_50/usr/src/uts/intel/io/acpica/events/evxfevnt.c (revision 385cc6b4ad1792caef3f84eb61eed3f27085801f)
1ae115bc7Smrj /******************************************************************************
2ae115bc7Smrj  *
3ae115bc7Smrj  * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
4ae115bc7Smrj  *
5ae115bc7Smrj  *****************************************************************************/
6ae115bc7Smrj 
726f3cdf0SGordon Ross /*
8*385cc6b4SJerry Jelinek  * Copyright (C) 2000 - 2016, Intel Corp.
9ae115bc7Smrj  * All rights reserved.
10ae115bc7Smrj  *
1126f3cdf0SGordon Ross  * Redistribution and use in source and binary forms, with or without
1226f3cdf0SGordon Ross  * modification, are permitted provided that the following conditions
1326f3cdf0SGordon Ross  * are met:
1426f3cdf0SGordon Ross  * 1. Redistributions of source code must retain the above copyright
1526f3cdf0SGordon Ross  *    notice, this list of conditions, and the following disclaimer,
1626f3cdf0SGordon Ross  *    without modification.
1726f3cdf0SGordon Ross  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1826f3cdf0SGordon Ross  *    substantially similar to the "NO WARRANTY" disclaimer below
1926f3cdf0SGordon Ross  *    ("Disclaimer") and any redistribution must be conditioned upon
2026f3cdf0SGordon Ross  *    including a substantially similar Disclaimer requirement for further
2126f3cdf0SGordon Ross  *    binary redistribution.
2226f3cdf0SGordon Ross  * 3. Neither the names of the above-listed copyright holders nor the names
2326f3cdf0SGordon Ross  *    of any contributors may be used to endorse or promote products derived
2426f3cdf0SGordon Ross  *    from this software without specific prior written permission.
25ae115bc7Smrj  *
2626f3cdf0SGordon Ross  * Alternatively, this software may be distributed under the terms of the
2726f3cdf0SGordon Ross  * GNU General Public License ("GPL") version 2 as published by the Free
2826f3cdf0SGordon Ross  * Software Foundation.
29ae115bc7Smrj  *
3026f3cdf0SGordon Ross  * NO WARRANTY
3126f3cdf0SGordon Ross  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3226f3cdf0SGordon Ross  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3326f3cdf0SGordon Ross  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
3426f3cdf0SGordon Ross  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3526f3cdf0SGordon Ross  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3626f3cdf0SGordon Ross  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3726f3cdf0SGordon Ross  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3826f3cdf0SGordon Ross  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3926f3cdf0SGordon Ross  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
4026f3cdf0SGordon Ross  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4126f3cdf0SGordon Ross  * POSSIBILITY OF SUCH DAMAGES.
4226f3cdf0SGordon Ross  */
43ae115bc7Smrj 
44*385cc6b4SJerry Jelinek #define EXPORT_ACPI_INTERFACES
45ae115bc7Smrj 
46ae115bc7Smrj #include "acpi.h"
47aa2aa9a6SDana Myers #include "accommon.h"
48db2bae30SDana Myers #include "actables.h"
49ae115bc7Smrj 
50ae115bc7Smrj #define _COMPONENT          ACPI_EVENTS
51ae115bc7Smrj         ACPI_MODULE_NAME    ("evxfevnt")
52ae115bc7Smrj 
53ae115bc7Smrj 
54*385cc6b4SJerry Jelinek #if (!ACPI_REDUCED_HARDWARE) /* Entire module */
55ae115bc7Smrj /*******************************************************************************
56ae115bc7Smrj  *
57ae115bc7Smrj  * FUNCTION:    AcpiEnable
58ae115bc7Smrj  *
59ae115bc7Smrj  * PARAMETERS:  None
60ae115bc7Smrj  *
61ae115bc7Smrj  * RETURN:      Status
62ae115bc7Smrj  *
63ae115bc7Smrj  * DESCRIPTION: Transfers the system into ACPI mode.
64ae115bc7Smrj  *
65ae115bc7Smrj  ******************************************************************************/
66ae115bc7Smrj 
67ae115bc7Smrj ACPI_STATUS
AcpiEnable(void)68ae115bc7Smrj AcpiEnable (
69ae115bc7Smrj     void)
70ae115bc7Smrj {
71ae115bc7Smrj     ACPI_STATUS             Status = AE_OK;
72ae115bc7Smrj 
73ae115bc7Smrj 
74ae115bc7Smrj     ACPI_FUNCTION_TRACE (AcpiEnable);
75ae115bc7Smrj 
76ae115bc7Smrj 
77db2bae30SDana Myers     /* ACPI tables must be present */
78ae115bc7Smrj 
79*385cc6b4SJerry Jelinek     if (AcpiGbl_FadtIndex == ACPI_INVALID_TABLE_INDEX)
80ae115bc7Smrj     {
81ae115bc7Smrj         return_ACPI_STATUS (AE_NO_ACPI_TABLES);
82ae115bc7Smrj     }
83ae115bc7Smrj 
84*385cc6b4SJerry Jelinek     /* If the Hardware Reduced flag is set, machine is always in acpi mode */
85*385cc6b4SJerry Jelinek 
86*385cc6b4SJerry Jelinek     if (AcpiGbl_ReducedHardware)
87*385cc6b4SJerry Jelinek     {
88*385cc6b4SJerry Jelinek         return_ACPI_STATUS (AE_OK);
89*385cc6b4SJerry Jelinek     }
90*385cc6b4SJerry Jelinek 
91db2bae30SDana Myers     /* Check current mode */
92db2bae30SDana Myers 
93ae115bc7Smrj     if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI)
94ae115bc7Smrj     {
95*385cc6b4SJerry Jelinek         ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
96*385cc6b4SJerry Jelinek             "System is already in ACPI mode\n"));
97ae115bc7Smrj     }
98ae115bc7Smrj     else
99ae115bc7Smrj     {
100ae115bc7Smrj         /* Transition to ACPI mode */
101ae115bc7Smrj 
102ae115bc7Smrj         Status = AcpiHwSetMode (ACPI_SYS_MODE_ACPI);
103ae115bc7Smrj         if (ACPI_FAILURE (Status))
104ae115bc7Smrj         {
105ae115bc7Smrj             ACPI_ERROR ((AE_INFO, "Could not transition to ACPI mode"));
106ae115bc7Smrj             return_ACPI_STATUS (Status);
107ae115bc7Smrj         }
108ae115bc7Smrj 
109ae115bc7Smrj         ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
110ae115bc7Smrj             "Transition to ACPI mode successful\n"));
111ae115bc7Smrj     }
112ae115bc7Smrj 
113ae115bc7Smrj     return_ACPI_STATUS (Status);
114ae115bc7Smrj }
115ae115bc7Smrj 
ACPI_EXPORT_SYMBOL(AcpiEnable)116ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiEnable)
117ae115bc7Smrj 
118ae115bc7Smrj 
119ae115bc7Smrj /*******************************************************************************
120ae115bc7Smrj  *
121ae115bc7Smrj  * FUNCTION:    AcpiDisable
122ae115bc7Smrj  *
123ae115bc7Smrj  * PARAMETERS:  None
124ae115bc7Smrj  *
125ae115bc7Smrj  * RETURN:      Status
126ae115bc7Smrj  *
127ae115bc7Smrj  * DESCRIPTION: Transfers the system into LEGACY (non-ACPI) mode.
128ae115bc7Smrj  *
129ae115bc7Smrj  ******************************************************************************/
130ae115bc7Smrj 
131ae115bc7Smrj ACPI_STATUS
132ae115bc7Smrj AcpiDisable (
133ae115bc7Smrj     void)
134ae115bc7Smrj {
135ae115bc7Smrj     ACPI_STATUS             Status = AE_OK;
136ae115bc7Smrj 
137ae115bc7Smrj 
138ae115bc7Smrj     ACPI_FUNCTION_TRACE (AcpiDisable);
139ae115bc7Smrj 
140ae115bc7Smrj 
141*385cc6b4SJerry Jelinek     /* If the Hardware Reduced flag is set, machine is always in acpi mode */
142*385cc6b4SJerry Jelinek 
143*385cc6b4SJerry Jelinek     if (AcpiGbl_ReducedHardware)
144*385cc6b4SJerry Jelinek     {
145*385cc6b4SJerry Jelinek         return_ACPI_STATUS (AE_OK);
146*385cc6b4SJerry Jelinek     }
147*385cc6b4SJerry Jelinek 
148ae115bc7Smrj     if (AcpiHwGetMode() == ACPI_SYS_MODE_LEGACY)
149ae115bc7Smrj     {
150ae115bc7Smrj         ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
151ae115bc7Smrj             "System is already in legacy (non-ACPI) mode\n"));
152ae115bc7Smrj     }
153ae115bc7Smrj     else
154ae115bc7Smrj     {
155ae115bc7Smrj         /* Transition to LEGACY mode */
156ae115bc7Smrj 
157ae115bc7Smrj         Status = AcpiHwSetMode (ACPI_SYS_MODE_LEGACY);
158ae115bc7Smrj 
159ae115bc7Smrj         if (ACPI_FAILURE (Status))
160ae115bc7Smrj         {
161ae115bc7Smrj             ACPI_ERROR ((AE_INFO,
162ae115bc7Smrj                 "Could not exit ACPI mode to legacy mode"));
163ae115bc7Smrj             return_ACPI_STATUS (Status);
164ae115bc7Smrj         }
165ae115bc7Smrj 
166*385cc6b4SJerry Jelinek         ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
167*385cc6b4SJerry Jelinek             "ACPI mode disabled\n"));
168ae115bc7Smrj     }
169ae115bc7Smrj 
170ae115bc7Smrj     return_ACPI_STATUS (Status);
171ae115bc7Smrj }
172ae115bc7Smrj 
ACPI_EXPORT_SYMBOL(AcpiDisable)173ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiDisable)
174ae115bc7Smrj 
175ae115bc7Smrj 
176ae115bc7Smrj /*******************************************************************************
177ae115bc7Smrj  *
178ae115bc7Smrj  * FUNCTION:    AcpiEnableEvent
179ae115bc7Smrj  *
180ae115bc7Smrj  * PARAMETERS:  Event           - The fixed eventto be enabled
181ae115bc7Smrj  *              Flags           - Reserved
182ae115bc7Smrj  *
183ae115bc7Smrj  * RETURN:      Status
184ae115bc7Smrj  *
185ae115bc7Smrj  * DESCRIPTION: Enable an ACPI event (fixed)
186ae115bc7Smrj  *
187ae115bc7Smrj  ******************************************************************************/
188ae115bc7Smrj 
189ae115bc7Smrj ACPI_STATUS
190ae115bc7Smrj AcpiEnableEvent (
191ae115bc7Smrj     UINT32                  Event,
192ae115bc7Smrj     UINT32                  Flags)
193ae115bc7Smrj {
194ae115bc7Smrj     ACPI_STATUS             Status = AE_OK;
195ae115bc7Smrj     UINT32                  Value;
196ae115bc7Smrj 
197ae115bc7Smrj 
198ae115bc7Smrj     ACPI_FUNCTION_TRACE (AcpiEnableEvent);
199ae115bc7Smrj 
200ae115bc7Smrj 
201ae115bc7Smrj     /* Decode the Fixed Event */
202ae115bc7Smrj 
203ae115bc7Smrj     if (Event > ACPI_EVENT_MAX)
204ae115bc7Smrj     {
205ae115bc7Smrj         return_ACPI_STATUS (AE_BAD_PARAMETER);
206ae115bc7Smrj     }
207ae115bc7Smrj 
208ae115bc7Smrj     /*
209aa2aa9a6SDana Myers      * Enable the requested fixed event (by writing a one to the enable
210aa2aa9a6SDana Myers      * register bit)
211ae115bc7Smrj      */
212aa2aa9a6SDana Myers     Status = AcpiWriteBitRegister (
213aa2aa9a6SDana Myers         AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
214aa2aa9a6SDana Myers         ACPI_ENABLE_EVENT);
215ae115bc7Smrj     if (ACPI_FAILURE (Status))
216ae115bc7Smrj     {
217ae115bc7Smrj         return_ACPI_STATUS (Status);
218ae115bc7Smrj     }
219ae115bc7Smrj 
220ae115bc7Smrj     /* Make sure that the hardware responded */
221ae115bc7Smrj 
222aa2aa9a6SDana Myers     Status = AcpiReadBitRegister (
223aa2aa9a6SDana Myers         AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
224ae115bc7Smrj     if (ACPI_FAILURE (Status))
225ae115bc7Smrj     {
226ae115bc7Smrj         return_ACPI_STATUS (Status);
227ae115bc7Smrj     }
228ae115bc7Smrj 
229ae115bc7Smrj     if (Value != 1)
230ae115bc7Smrj     {
231ae115bc7Smrj         ACPI_ERROR ((AE_INFO,
232ae115bc7Smrj             "Could not enable %s event", AcpiUtGetEventName (Event)));
233ae115bc7Smrj         return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
234ae115bc7Smrj     }
235ae115bc7Smrj 
236ae115bc7Smrj     return_ACPI_STATUS (Status);
237ae115bc7Smrj }
238ae115bc7Smrj 
ACPI_EXPORT_SYMBOL(AcpiEnableEvent)239ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiEnableEvent)
240ae115bc7Smrj 
241ae115bc7Smrj 
242ae115bc7Smrj /*******************************************************************************
243ae115bc7Smrj  *
244ae115bc7Smrj  * FUNCTION:    AcpiDisableEvent
245ae115bc7Smrj  *
24626f3cdf0SGordon Ross  * PARAMETERS:  Event           - The fixed event to be disabled
247ae115bc7Smrj  *              Flags           - Reserved
248ae115bc7Smrj  *
249ae115bc7Smrj  * RETURN:      Status
250ae115bc7Smrj  *
251ae115bc7Smrj  * DESCRIPTION: Disable an ACPI event (fixed)
252ae115bc7Smrj  *
253ae115bc7Smrj  ******************************************************************************/
254ae115bc7Smrj 
255ae115bc7Smrj ACPI_STATUS
256ae115bc7Smrj AcpiDisableEvent (
257ae115bc7Smrj     UINT32                  Event,
258ae115bc7Smrj     UINT32                  Flags)
259ae115bc7Smrj {
260ae115bc7Smrj     ACPI_STATUS             Status = AE_OK;
261ae115bc7Smrj     UINT32                  Value;
262ae115bc7Smrj 
263ae115bc7Smrj 
264ae115bc7Smrj     ACPI_FUNCTION_TRACE (AcpiDisableEvent);
265ae115bc7Smrj 
266ae115bc7Smrj 
267ae115bc7Smrj     /* Decode the Fixed Event */
268ae115bc7Smrj 
269ae115bc7Smrj     if (Event > ACPI_EVENT_MAX)
270ae115bc7Smrj     {
271ae115bc7Smrj         return_ACPI_STATUS (AE_BAD_PARAMETER);
272ae115bc7Smrj     }
273ae115bc7Smrj 
274ae115bc7Smrj     /*
275aa2aa9a6SDana Myers      * Disable the requested fixed event (by writing a zero to the enable
276aa2aa9a6SDana Myers      * register bit)
277ae115bc7Smrj      */
278aa2aa9a6SDana Myers     Status = AcpiWriteBitRegister (
279aa2aa9a6SDana Myers         AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
280aa2aa9a6SDana Myers         ACPI_DISABLE_EVENT);
281ae115bc7Smrj     if (ACPI_FAILURE (Status))
282ae115bc7Smrj     {
283ae115bc7Smrj         return_ACPI_STATUS (Status);
284ae115bc7Smrj     }
285ae115bc7Smrj 
286aa2aa9a6SDana Myers     Status = AcpiReadBitRegister (
287aa2aa9a6SDana Myers         AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
288ae115bc7Smrj     if (ACPI_FAILURE (Status))
289ae115bc7Smrj     {
290ae115bc7Smrj         return_ACPI_STATUS (Status);
291ae115bc7Smrj     }
292ae115bc7Smrj 
293ae115bc7Smrj     if (Value != 0)
294ae115bc7Smrj     {
295ae115bc7Smrj         ACPI_ERROR ((AE_INFO,
296ae115bc7Smrj             "Could not disable %s events", AcpiUtGetEventName (Event)));
297ae115bc7Smrj         return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
298ae115bc7Smrj     }
299ae115bc7Smrj 
300ae115bc7Smrj     return_ACPI_STATUS (Status);
301ae115bc7Smrj }
302ae115bc7Smrj 
ACPI_EXPORT_SYMBOL(AcpiDisableEvent)303ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiDisableEvent)
304ae115bc7Smrj 
305ae115bc7Smrj 
306ae115bc7Smrj /*******************************************************************************
307ae115bc7Smrj  *
308ae115bc7Smrj  * FUNCTION:    AcpiClearEvent
309ae115bc7Smrj  *
310ae115bc7Smrj  * PARAMETERS:  Event           - The fixed event to be cleared
311ae115bc7Smrj  *
312ae115bc7Smrj  * RETURN:      Status
313ae115bc7Smrj  *
314ae115bc7Smrj  * DESCRIPTION: Clear an ACPI event (fixed)
315ae115bc7Smrj  *
316ae115bc7Smrj  ******************************************************************************/
317ae115bc7Smrj 
318ae115bc7Smrj ACPI_STATUS
319ae115bc7Smrj AcpiClearEvent (
320ae115bc7Smrj     UINT32                  Event)
321ae115bc7Smrj {
322ae115bc7Smrj     ACPI_STATUS             Status = AE_OK;
323ae115bc7Smrj 
324ae115bc7Smrj 
325ae115bc7Smrj     ACPI_FUNCTION_TRACE (AcpiClearEvent);
326ae115bc7Smrj 
327ae115bc7Smrj 
328ae115bc7Smrj     /* Decode the Fixed Event */
329ae115bc7Smrj 
330ae115bc7Smrj     if (Event > ACPI_EVENT_MAX)
331ae115bc7Smrj     {
332ae115bc7Smrj         return_ACPI_STATUS (AE_BAD_PARAMETER);
333ae115bc7Smrj     }
334ae115bc7Smrj 
335ae115bc7Smrj     /*
336aa2aa9a6SDana Myers      * Clear the requested fixed event (By writing a one to the status
337aa2aa9a6SDana Myers      * register bit)
338ae115bc7Smrj      */
339aa2aa9a6SDana Myers     Status = AcpiWriteBitRegister (
340aa2aa9a6SDana Myers         AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
341aa2aa9a6SDana Myers         ACPI_CLEAR_STATUS);
342ae115bc7Smrj 
343ae115bc7Smrj     return_ACPI_STATUS (Status);
344ae115bc7Smrj }
345ae115bc7Smrj 
ACPI_EXPORT_SYMBOL(AcpiClearEvent)346ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiClearEvent)
347ae115bc7Smrj 
348ae115bc7Smrj 
349ae115bc7Smrj /*******************************************************************************
350ae115bc7Smrj  *
351ae115bc7Smrj  * FUNCTION:    AcpiGetEventStatus
352ae115bc7Smrj  *
353ae115bc7Smrj  * PARAMETERS:  Event           - The fixed event
354ae115bc7Smrj  *              EventStatus     - Where the current status of the event will
355ae115bc7Smrj  *                                be returned
356ae115bc7Smrj  *
357ae115bc7Smrj  * RETURN:      Status
358ae115bc7Smrj  *
359ae115bc7Smrj  * DESCRIPTION: Obtains and returns the current status of the event
360ae115bc7Smrj  *
361ae115bc7Smrj  ******************************************************************************/
362ae115bc7Smrj 
363ae115bc7Smrj ACPI_STATUS
364ae115bc7Smrj AcpiGetEventStatus (
365ae115bc7Smrj     UINT32                  Event,
366ae115bc7Smrj     ACPI_EVENT_STATUS       *EventStatus)
367ae115bc7Smrj {
368*385cc6b4SJerry Jelinek     ACPI_STATUS             Status;
369*385cc6b4SJerry Jelinek     ACPI_EVENT_STATUS       LocalEventStatus = 0;
370*385cc6b4SJerry Jelinek     UINT32                  InByte;
371ae115bc7Smrj 
372ae115bc7Smrj 
373ae115bc7Smrj     ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
374ae115bc7Smrj 
375ae115bc7Smrj 
376ae115bc7Smrj     if (!EventStatus)
377ae115bc7Smrj     {
378ae115bc7Smrj         return_ACPI_STATUS (AE_BAD_PARAMETER);
379ae115bc7Smrj     }
380ae115bc7Smrj 
381ae115bc7Smrj     /* Decode the Fixed Event */
382ae115bc7Smrj 
383ae115bc7Smrj     if (Event > ACPI_EVENT_MAX)
384ae115bc7Smrj     {
385ae115bc7Smrj         return_ACPI_STATUS (AE_BAD_PARAMETER);
386ae115bc7Smrj     }
387ae115bc7Smrj 
388*385cc6b4SJerry Jelinek     /* Fixed event currently can be dispatched? */
389*385cc6b4SJerry Jelinek 
390*385cc6b4SJerry Jelinek     if (AcpiGbl_FixedEventHandlers[Event].Handler)
391*385cc6b4SJerry Jelinek     {
392*385cc6b4SJerry Jelinek         LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
393*385cc6b4SJerry Jelinek     }
394*385cc6b4SJerry Jelinek 
395*385cc6b4SJerry Jelinek     /* Fixed event currently enabled? */
396ae115bc7Smrj 
397aa2aa9a6SDana Myers     Status = AcpiReadBitRegister (
398*385cc6b4SJerry Jelinek         AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
399*385cc6b4SJerry Jelinek     if (ACPI_FAILURE (Status))
400*385cc6b4SJerry Jelinek     {
401ae115bc7Smrj         return_ACPI_STATUS (Status);
402ae115bc7Smrj     }
403ae115bc7Smrj 
404*385cc6b4SJerry Jelinek     if (InByte)
405*385cc6b4SJerry Jelinek     {
406*385cc6b4SJerry Jelinek         LocalEventStatus |=
407*385cc6b4SJerry Jelinek             (ACPI_EVENT_FLAG_ENABLED | ACPI_EVENT_FLAG_ENABLE_SET);
408*385cc6b4SJerry Jelinek     }
409*385cc6b4SJerry Jelinek 
410*385cc6b4SJerry Jelinek     /* Fixed event currently active? */
411*385cc6b4SJerry Jelinek 
412*385cc6b4SJerry Jelinek     Status = AcpiReadBitRegister (
413*385cc6b4SJerry Jelinek         AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
414*385cc6b4SJerry Jelinek     if (ACPI_FAILURE (Status))
415*385cc6b4SJerry Jelinek     {
416*385cc6b4SJerry Jelinek         return_ACPI_STATUS (Status);
417*385cc6b4SJerry Jelinek     }
418*385cc6b4SJerry Jelinek 
419*385cc6b4SJerry Jelinek     if (InByte)
420*385cc6b4SJerry Jelinek     {
421*385cc6b4SJerry Jelinek         LocalEventStatus |= ACPI_EVENT_FLAG_STATUS_SET;
422*385cc6b4SJerry Jelinek     }
423*385cc6b4SJerry Jelinek 
424*385cc6b4SJerry Jelinek     (*EventStatus) = LocalEventStatus;
425*385cc6b4SJerry Jelinek     return_ACPI_STATUS (AE_OK);
426*385cc6b4SJerry Jelinek }
427*385cc6b4SJerry Jelinek 
428ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
429ae115bc7Smrj 
430*385cc6b4SJerry Jelinek #endif /* !ACPI_REDUCED_HARDWARE */
431