acevents.h revision 193335
150476Speter/******************************************************************************
215903Swosch *
315903Swosch * Name: acevents.h - Event subcomponent prototypes and defines
415903Swosch *
515903Swosch *****************************************************************************/
615903Swosch
715903Swosch/******************************************************************************
815903Swosch *
915903Swosch * 1. Copyright Notice
1015903Swosch *
1115903Swosch * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
1215903Swosch * All rights reserved.
1315903Swosch *
1415903Swosch * 2. License
1515903Swosch *
1615903Swosch * 2.1. This is your license from Intel Corp. under its intellectual property
1715903Swosch * rights.  You may have additional license terms from the party that provided
1815903Swosch * you this software, covering your right to use that party's intellectual
1915903Swosch * property rights.
2015903Swosch *
2123546Swosch * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2234678Sbde * copy of the source code appearing in this file ("Covered Code") an
2323546Swosch * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2423546Swosch * base code distributed originally by Intel ("Original Intel Code") to copy,
2523546Swosch * make derivatives, distribute, use and display any portion of the Covered
2615903Swosch * Code in any form, with the right to sublicense such rights; and
2715903Swosch *
2815903Swosch * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
2915903Swosch * license (with the right to sublicense), under only those claims of Intel
3015903Swosch * patents that are infringed by the Original Intel Code, to make, use, sell,
3138413Sjb * offer to sell, and import the Covered Code and derivative works thereof
3253033Sphantom * solely to the minimum extent necessary to exercise the above copyright
3338042Sbde * license, and in no event shall the patent license extend to any additions
3439161Sobrien * to or modifications of the Original Intel Code.  No other license or right
3515903Swosch * is granted directly or by implication, estoppel or otherwise;
3639161Sobrien *
3715903Swosch * The above copyright and patent license is granted only if the following
3815903Swosch * conditions are met:
3915903Swosch *
4015903Swosch * 3. Conditions
4115903Swosch *
4255954Srgrimes * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4315903Swosch * Redistribution of source code of any substantial portion of the Covered
4455954Srgrimes * Code or modification with rights to further distribute source must include
4555954Srgrimes * the above Copyright Notice, the above License, this list of Conditions,
4655954Srgrimes * and the following Disclaimer and Export Compliance provision.  In addition,
4755954Srgrimes * Licensee must cause all Covered Code to which Licensee contributes to
4855954Srgrimes * contain a file documenting the changes Licensee made to create that Covered
4955954Srgrimes * Code and the date of any change.  Licensee must include in that file the
5015903Swosch * documentation of any changes made by any predecessor Licensee.  Licensee
5115903Swosch * must include a prominent statement that the modification is derived,
5232216Swosch * directly or indirectly, from Original Intel Code.
5332216Swosch *
5432216Swosch * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5532216Swosch * Redistribution of source code of any substantial portion of the Covered
5615903Swosch * Code or modification without rights to further distribute source must
5715903Swosch * include the following Disclaimer and Export Compliance provision in the
5815903Swosch * documentation and/or other materials provided with distribution.  In
5915903Swosch * addition, Licensee may not authorize further sublicense of source of any
6015903Swosch * portion of the Covered Code, and must include terms to the effect that the
6115903Swosch * license from Licensee to its licensee is limited to the intellectual
6215903Swosch * property embodied in the software Licensee provides to its licensee, and
6315903Swosch * not to intellectual property embodied in modifications its licensee may
6415903Swosch * make.
6515903Swosch *
6615903Swosch * 3.3. Redistribution of Executable. Redistribution in executable form of any
6715903Swosch * substantial portion of the Covered Code or modification must reproduce the
6865501Sobrien * above Copyright Notice, and the following Disclaimer and Export Compliance
6915903Swosch * provision in the documentation and/or other materials provided with the
7053033Sphantom * distribution.
7115903Swosch *
7253033Sphantom * 3.4. Intel retains all right, title, and interest in and to the Original
7315903Swosch * Intel Code.
7453033Sphantom *
7515903Swosch * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7615903Swosch * Intel shall be used in advertising or otherwise to promote the sale, use or
7715903Swosch * other dealings in products derived from or relating to the Covered Code
7815903Swosch * without prior written authorization from Intel.
7915903Swosch *
8039161Sobrien * 4. Disclaimer and Export Compliance
8115903Swosch *
8239161Sobrien * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8315903Swosch * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8415903Swosch * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8515903Swosch * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
8615903Swosch * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
8715903Swosch * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8815903Swosch * PARTICULAR PURPOSE.
8915903Swosch *
9015903Swosch * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9115903Swosch * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9215903Swosch * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9315903Swosch * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9415903Swosch * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9515903Swosch * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
9615903Swosch * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9715903Swosch * LIMITED REMEDY.
9815903Swosch *
9915903Swosch * 4.3. Licensee shall not export, either directly or indirectly, any of this
10015903Swosch * software or system incorporating such software without first obtaining any
10115903Swosch * required license or other approval from the U. S. Department of Commerce or
10215903Swosch * any other agency or department of the United States Government.  In the
10315903Swosch * event Licensee exports any such software from the United States or
10415903Swosch * re-exports any such software from a foreign destination, Licensee shall
10515903Swosch * ensure that the distribution and export/re-export of the software is in
10615903Swosch * compliance with all laws, regulations, orders, or other restrictions of the
10715903Swosch * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10815903Swosch * any of its subsidiaries will export/re-export any technical data, process,
10915903Swosch * software, or service, directly or indirectly, to any country for which the
11015903Swosch * United States government or any agency thereof requires an export license,
11115903Swosch * other governmental approval, or letter of assurance, without first obtaining
11215903Swosch * such license, approval or letter.
11315903Swosch *
11415903Swosch *****************************************************************************/
11515903Swosch
11615903Swosch#ifndef __ACEVENTS_H__
11790627Sphantom#define __ACEVENTS_H__
11815903Swosch
11990626Sphantom
12015903Swosch/*
12190626Sphantom * evevent
12215903Swosch */
12361462SghelmerACPI_STATUS
12415903SwoschAcpiEvInitializeEvents (
12532216Swosch    void);
12615903Swosch
12794982SruACPI_STATUS
12894982SruAcpiEvInstallXruptHandlers (
12994982Sru    void);
13014968Swosch
13139161SobrienACPI_STATUS
13239161SobrienAcpiEvInstallFadtGpes (
13314573Swosch    void);
13414968Swosch
13514573SwoschUINT32
13655954SrgrimesAcpiEvFixedEventDetect (
13755954Srgrimes    void);
13855954Srgrimes
13955954Srgrimes
14055954Srgrimes/*
14165501Sobrien * evmisc
14248204Sjmg */
14348204SjmgBOOLEAN
14448204SjmgAcpiEvIsNotifyObject (
14548204Sjmg    ACPI_NAMESPACE_NODE     *Node);
14638656Sjb
14736397SsosACPI_STATUS
14836397SsosAcpiEvAcquireGlobalLock(
14914573Swosch    UINT16                  Timeout);
15036397Ssos
15132226SsteveACPI_STATUS
15232226SsteveAcpiEvReleaseGlobalLock(
15314573Swosch    void);
15414573Swosch
15514968SwoschACPI_STATUS
15614968SwoschAcpiEvInitGlobalLockHandler (
15714968Swosch    void);
15814573Swosch
15914968SwoschUINT32
16014968SwoschAcpiEvGetGpeNumberIndex (
16114968Swosch    UINT32                  GpeNumber);
16239161Sobrien
16339161SobrienACPI_STATUS
16414968SwoschAcpiEvQueueNotifyRequest (
16514968Swosch    ACPI_NAMESPACE_NODE     *Node,
16614968Swosch    UINT32                  NotifyValue);
16714968Swosch
16814968Swosch
16914968Swosch/*
17014968Swosch * evgpe - GPE handling and dispatch
17114968Swosch */
17214968SwoschACPI_STATUS
17314968SwoschAcpiEvUpdateGpeEnableMasks (
17414968Swosch    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
17514968Swosch    UINT8                   Type);
17614968Swosch
17714968SwoschACPI_STATUS
17814968SwoschAcpiEvEnableGpe (
17914968Swosch    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
18014968Swosch    BOOLEAN                 WriteToHardware);
18114968Swosch
18290626SphantomACPI_STATUS
18390626SphantomAcpiEvDisableGpe (
18461462Sghelmer    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
18514968Swosch
18632216SwoschACPI_GPE_EVENT_INFO *
18732216SwoschAcpiEvGetGpeEventInfo (
18814968Swosch    ACPI_HANDLE             GpeDevice,
18914968Swosch    UINT32                  GpeNumber);
19014968Swosch
19114968Swosch
19214968Swosch/*
19314968Swosch * evgpeblk
19434678Sbde */
19523546SwoschBOOLEAN
19694982SruAcpiEvValidGpeEvent (
19794982Sru    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
198
199ACPI_STATUS
200AcpiEvWalkGpeList (
201    ACPI_GPE_CALLBACK       GpeWalkCallback,
202    void                    *Context);
203
204ACPI_STATUS
205AcpiEvDeleteGpeHandlers (
206    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
207    ACPI_GPE_BLOCK_INFO     *GpeBlock,
208    void                    *Context);
209
210ACPI_STATUS
211AcpiEvCreateGpeBlock (
212    ACPI_NAMESPACE_NODE     *GpeDevice,
213    ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
214    UINT32                  RegisterCount,
215    UINT8                   GpeBlockBaseNumber,
216    UINT32                  InterruptNumber,
217    ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock);
218
219ACPI_STATUS
220AcpiEvInitializeGpeBlock (
221    ACPI_NAMESPACE_NODE     *GpeDevice,
222    ACPI_GPE_BLOCK_INFO     *GpeBlock);
223
224ACPI_STATUS
225AcpiEvDeleteGpeBlock (
226    ACPI_GPE_BLOCK_INFO     *GpeBlock);
227
228UINT32
229AcpiEvGpeDispatch (
230    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
231    UINT32                  GpeNumber);
232
233UINT32
234AcpiEvGpeDetect (
235    ACPI_GPE_XRUPT_INFO     *GpeXruptList);
236
237ACPI_STATUS
238AcpiEvSetGpeType (
239    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
240    UINT8                   Type);
241
242ACPI_STATUS
243AcpiEvCheckForWakeOnlyGpe (
244    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
245
246ACPI_STATUS
247AcpiEvGpeInitialize (
248    void);
249
250
251/*
252 * evregion - Address Space handling
253 */
254ACPI_STATUS
255AcpiEvInstallRegionHandlers (
256    void);
257
258ACPI_STATUS
259AcpiEvInitializeOpRegions (
260    void);
261
262ACPI_STATUS
263AcpiEvAddressSpaceDispatch (
264    ACPI_OPERAND_OBJECT    *RegionObj,
265    UINT32                  Function,
266    UINT32                  RegionOffset,
267    UINT32                  BitWidth,
268    ACPI_INTEGER            *Value);
269
270ACPI_STATUS
271AcpiEvAttachRegion (
272    ACPI_OPERAND_OBJECT     *HandlerObj,
273    ACPI_OPERAND_OBJECT     *RegionObj,
274    BOOLEAN                 AcpiNsIsLocked);
275
276void
277AcpiEvDetachRegion (
278    ACPI_OPERAND_OBJECT    *RegionObj,
279    BOOLEAN                 AcpiNsIsLocked);
280
281ACPI_STATUS
282AcpiEvInstallSpaceHandler (
283    ACPI_NAMESPACE_NODE     *Node,
284    ACPI_ADR_SPACE_TYPE     SpaceId,
285    ACPI_ADR_SPACE_HANDLER  Handler,
286    ACPI_ADR_SPACE_SETUP    Setup,
287    void                    *Context);
288
289ACPI_STATUS
290AcpiEvExecuteRegMethods (
291    ACPI_NAMESPACE_NODE     *Node,
292    ACPI_ADR_SPACE_TYPE     SpaceId);
293
294ACPI_STATUS
295AcpiEvExecuteRegMethod (
296    ACPI_OPERAND_OBJECT    *RegionObj,
297    UINT32                  Function);
298
299
300/*
301 * evregini - Region initialization and setup
302 */
303ACPI_STATUS
304AcpiEvSystemMemoryRegionSetup (
305    ACPI_HANDLE             Handle,
306    UINT32                  Function,
307    void                    *HandlerContext,
308    void                    **RegionContext);
309
310ACPI_STATUS
311AcpiEvIoSpaceRegionSetup (
312    ACPI_HANDLE             Handle,
313    UINT32                  Function,
314    void                    *HandlerContext,
315    void                    **RegionContext);
316
317ACPI_STATUS
318AcpiEvPciConfigRegionSetup (
319    ACPI_HANDLE             Handle,
320    UINT32                  Function,
321    void                    *HandlerContext,
322    void                    **RegionContext);
323
324ACPI_STATUS
325AcpiEvCmosRegionSetup (
326    ACPI_HANDLE             Handle,
327    UINT32                  Function,
328    void                    *HandlerContext,
329    void                    **RegionContext);
330
331ACPI_STATUS
332AcpiEvPciBarRegionSetup (
333    ACPI_HANDLE             Handle,
334    UINT32                  Function,
335    void                    *HandlerContext,
336    void                    **RegionContext);
337
338ACPI_STATUS
339AcpiEvDefaultRegionSetup (
340    ACPI_HANDLE             Handle,
341    UINT32                  Function,
342    void                    *HandlerContext,
343    void                    **RegionContext);
344
345ACPI_STATUS
346AcpiEvInitializeRegion (
347    ACPI_OPERAND_OBJECT     *RegionObj,
348    BOOLEAN                 AcpiNsLocked);
349
350
351/*
352 * evsci - SCI (System Control Interrupt) handling/dispatch
353 */
354UINT32 ACPI_SYSTEM_XFACE
355AcpiEvGpeXruptHandler (
356    void                    *Context);
357
358UINT32
359AcpiEvInstallSciHandler (
360    void);
361
362ACPI_STATUS
363AcpiEvRemoveSciHandler (
364    void);
365
366UINT32
367AcpiEvInitializeSCI (
368    UINT32                  ProgramSCI);
369
370void
371AcpiEvTerminate (
372    void);
373
374
375#endif  /* __ACEVENTS_H__  */
376