acevents.h revision 241973
1227825Stheraven/******************************************************************************
2227825Stheraven *
3227825Stheraven * Name: acevents.h - Event subcomponent prototypes and defines
4353358Sdim *
5353358Sdim *****************************************************************************/
6353358Sdim
7227825Stheraven/*
8227825Stheraven * Copyright (C) 2000 - 2012, Intel Corp.
9227825Stheraven * All rights reserved.
10227825Stheraven *
11227825Stheraven * Redistribution and use in source and binary forms, with or without
12227825Stheraven * modification, are permitted provided that the following conditions
13227825Stheraven * are met:
14227825Stheraven * 1. Redistributions of source code must retain the above copyright
15227825Stheraven *    notice, this list of conditions, and the following disclaimer,
16227825Stheraven *    without modification.
17227825Stheraven * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18227825Stheraven *    substantially similar to the "NO WARRANTY" disclaimer below
19227825Stheraven *    ("Disclaimer") and any redistribution must be conditioned upon
20227825Stheraven *    including a substantially similar Disclaimer requirement for further
21227825Stheraven *    binary redistribution.
22227825Stheraven * 3. Neither the names of the above-listed copyright holders nor the names
23288943Sdim *    of any contributors may be used to endorse or promote products derived
24288943Sdim *    from this software without specific prior written permission.
25227825Stheraven *
26227825Stheraven * Alternatively, this software may be distributed under the terms of the
27227825Stheraven * GNU General Public License ("GPL") version 2 as published by the Free
28227825Stheraven * Software Foundation.
29227825Stheraven *
30227825Stheraven * NO WARRANTY
31227825Stheraven * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32227825Stheraven * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33227825Stheraven * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34227825Stheraven * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35227825Stheraven * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36227825Stheraven * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37227825Stheraven * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38227825Stheraven * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39227825Stheraven * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40227825Stheraven * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41227825Stheraven * POSSIBILITY OF SUCH DAMAGES.
42227825Stheraven */
43227825Stheraven
44227825Stheraven#ifndef __ACEVENTS_H__
45227825Stheraven#define __ACEVENTS_H__
46227825Stheraven
47227825Stheraven
48227825Stheraven/*
49227825Stheraven * evevent
50227825Stheraven */
51227825StheravenACPI_STATUS
52227825StheravenAcpiEvInitializeEvents (
53227825Stheraven    void);
54227825Stheraven
55227825StheravenACPI_STATUS
56227825StheravenAcpiEvInstallXruptHandlers (
57227825Stheraven    void);
58227825Stheraven
59227825StheravenUINT32
60227825StheravenAcpiEvFixedEventDetect (
61227825Stheraven    void);
62227825Stheraven
63227825Stheraven
64300770Sdim/*
65327952Sdim * evmisc
66300770Sdim */
67327952SdimBOOLEAN
68300770SdimAcpiEvIsNotifyObject (
69327952Sdim    ACPI_NAMESPACE_NODE     *Node);
70300770Sdim
71327952SdimUINT32
72300770SdimAcpiEvGetGpeNumberIndex (
73327952Sdim    UINT32                  GpeNumber);
74300770Sdim
75327952SdimACPI_STATUS
76300770SdimAcpiEvQueueNotifyRequest (
77227825Stheraven    ACPI_NAMESPACE_NODE     *Node,
78227825Stheraven    UINT32                  NotifyValue);
79227825Stheraven
80227825Stheraven
81227825Stheraven/*
82227825Stheraven * evglock - Global Lock support
83227825Stheraven */
84227825StheravenACPI_STATUS
85227825StheravenAcpiEvInitGlobalLockHandler (
86227825Stheraven    void);
87227825Stheraven
88227825StheravenACPI_HW_DEPENDENT_RETURN_OK (
89321369SdimACPI_STATUS
90321369SdimAcpiEvAcquireGlobalLock(
91321369Sdim    UINT16                  Timeout))
92321369Sdim
93227825StheravenACPI_HW_DEPENDENT_RETURN_OK (
94227825StheravenACPI_STATUS
95227825StheravenAcpiEvReleaseGlobalLock(
96227825Stheraven    void))
97227825Stheraven
98227825StheravenACPI_STATUS
99227825StheravenAcpiEvRemoveGlobalLockHandler (
100227825Stheraven    void);
101227825Stheraven
102227825Stheraven
103227825Stheraven/*
104227825Stheraven * evgpe - Low-level GPE support
105227825Stheraven */
106227825StheravenUINT32
107227825StheravenAcpiEvGpeDetect (
108227825Stheraven    ACPI_GPE_XRUPT_INFO     *GpeXruptList);
109227825Stheraven
110227825StheravenACPI_STATUS
111227825StheravenAcpiEvUpdateGpeEnableMask (
112227825Stheraven    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
113227825Stheraven
114227825StheravenACPI_STATUS
115227825StheravenAcpiEvEnableGpe (
116227825Stheraven    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
117227825Stheraven
118227825StheravenACPI_STATUS
119227825StheravenAcpiEvAddGpeReference (
120227825Stheraven    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
121227825Stheraven
122227825StheravenACPI_STATUS
123227825StheravenAcpiEvRemoveGpeReference (
124227825Stheraven    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
125227825Stheraven
126227825StheravenACPI_GPE_EVENT_INFO *
127227825StheravenAcpiEvGetGpeEventInfo (
128227825Stheraven    ACPI_HANDLE             GpeDevice,
129227825Stheraven    UINT32                  GpeNumber);
130227825Stheraven
131227825StheravenACPI_GPE_EVENT_INFO *
132227825StheravenAcpiEvLowGetGpeInfo (
133227825Stheraven    UINT32                  GpeNumber,
134227825Stheraven    ACPI_GPE_BLOCK_INFO     *GpeBlock);
135227825Stheraven
136227825StheravenACPI_STATUS
137227825StheravenAcpiEvFinishGpe (
138227825Stheraven    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
139227825Stheraven
140227825Stheraven
141227825Stheraven/*
142227825Stheraven * evgpeblk - Upper-level GPE block support
143227825Stheraven */
144227825StheravenACPI_STATUS
145227825StheravenAcpiEvCreateGpeBlock (
146227825Stheraven    ACPI_NAMESPACE_NODE     *GpeDevice,
147227825Stheraven    ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
148227825Stheraven    UINT32                  RegisterCount,
149227825Stheraven    UINT8                   GpeBlockBaseNumber,
150227825Stheraven    UINT32                  InterruptNumber,
151227825Stheraven    ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock);
152227825Stheraven
153227825StheravenACPI_STATUS
154227825StheravenAcpiEvInitializeGpeBlock (
155227825Stheraven    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
156227825Stheraven    ACPI_GPE_BLOCK_INFO     *GpeBlock,
157227825Stheraven    void                    *Context);
158227825Stheraven
159227825StheravenACPI_HW_DEPENDENT_RETURN_OK (
160227825StheravenACPI_STATUS
161227825StheravenAcpiEvDeleteGpeBlock (
162227825Stheraven    ACPI_GPE_BLOCK_INFO     *GpeBlock))
163227825Stheraven
164227825StheravenUINT32
165227825StheravenAcpiEvGpeDispatch (
166227825Stheraven    ACPI_NAMESPACE_NODE     *GpeDevice,
167227825Stheraven    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
168227825Stheraven    UINT32                  GpeNumber);
169227825Stheraven
170227825Stheraven/*
171227825Stheraven * evgpeinit - GPE initialization and update
172227825Stheraven */
173227825StheravenACPI_STATUS
174227825StheravenAcpiEvGpeInitialize (
175227825Stheraven    void);
176227825Stheraven
177227825StheravenACPI_HW_DEPENDENT_RETURN_VOID (
178227825Stheravenvoid
179227825StheravenAcpiEvUpdateGpes (
180227825Stheraven    ACPI_OWNER_ID           TableOwnerId))
181227825Stheraven
182227825StheravenACPI_STATUS
183227825StheravenAcpiEvMatchGpeMethod (
184227825Stheraven    ACPI_HANDLE             ObjHandle,
185227825Stheraven    UINT32                  Level,
186227825Stheraven    void                    *Context,
187227825Stheraven    void                    **ReturnValue);
188227825Stheraven
189227825Stheraven/*
190227825Stheraven * evgpeutil - GPE utilities
191227825Stheraven */
192227825StheravenACPI_STATUS
193227825StheravenAcpiEvWalkGpeList (
194227825Stheraven    ACPI_GPE_CALLBACK       GpeWalkCallback,
195227825Stheraven    void                    *Context);
196227825Stheraven
197227825StheravenBOOLEAN
198227825StheravenAcpiEvValidGpeEvent (
199227825Stheraven    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
200227825Stheraven
201227825StheravenACPI_STATUS
202227825StheravenAcpiEvGetGpeDevice (
203227825Stheraven    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
204227825Stheraven    ACPI_GPE_BLOCK_INFO     *GpeBlock,
205227825Stheraven    void                    *Context);
206227825Stheraven
207227825StheravenACPI_GPE_XRUPT_INFO *
208227825StheravenAcpiEvGetGpeXruptBlock (
209227825Stheraven    UINT32                  InterruptNumber);
210227825Stheraven
211227825StheravenACPI_STATUS
212227825StheravenAcpiEvDeleteGpeXrupt (
213227825Stheraven    ACPI_GPE_XRUPT_INFO     *GpeXrupt);
214227825Stheraven
215227825StheravenACPI_STATUS
216227825StheravenAcpiEvDeleteGpeHandlers (
217227825Stheraven    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
218227825Stheraven    ACPI_GPE_BLOCK_INFO     *GpeBlock,
219227825Stheraven    void                    *Context);
220227825Stheraven
221227825Stheraven
222227825Stheraven/*
223227825Stheraven * evregion - Address Space handling
224227825Stheraven */
225227825StheravenACPI_STATUS
226227825StheravenAcpiEvInstallRegionHandlers (
227227825Stheraven    void);
228227825Stheraven
229227825StheravenACPI_STATUS
230227825StheravenAcpiEvInitializeOpRegions (
231227825Stheraven    void);
232227825Stheraven
233227825StheravenACPI_STATUS
234227825StheravenAcpiEvAddressSpaceDispatch (
235227825Stheraven    ACPI_OPERAND_OBJECT     *RegionObj,
236227825Stheraven    ACPI_OPERAND_OBJECT     *FieldObj,
237227825Stheraven    UINT32                  Function,
238227825Stheraven    UINT32                  RegionOffset,
239227825Stheraven    UINT32                  BitWidth,
240227825Stheraven    UINT64                  *Value);
241227825Stheraven
242227825StheravenACPI_STATUS
243227825StheravenAcpiEvAttachRegion (
244227825Stheraven    ACPI_OPERAND_OBJECT     *HandlerObj,
245227825Stheraven    ACPI_OPERAND_OBJECT     *RegionObj,
246227825Stheraven    BOOLEAN                 AcpiNsIsLocked);
247227825Stheraven
248314564Sdimvoid
249227825StheravenAcpiEvDetachRegion (
250227825Stheraven    ACPI_OPERAND_OBJECT    *RegionObj,
251227825Stheraven    BOOLEAN                 AcpiNsIsLocked);
252227825Stheraven
253288943SdimACPI_STATUS
254288943SdimAcpiEvInstallSpaceHandler (
255288943Sdim    ACPI_NAMESPACE_NODE     *Node,
256288943Sdim    ACPI_ADR_SPACE_TYPE     SpaceId,
257227825Stheraven    ACPI_ADR_SPACE_HANDLER  Handler,
258288943Sdim    ACPI_ADR_SPACE_SETUP    Setup,
259288943Sdim    void                    *Context);
260227825Stheraven
261227825StheravenACPI_STATUS
262227825StheravenAcpiEvExecuteRegMethods (
263227825Stheraven    ACPI_NAMESPACE_NODE     *Node,
264288943Sdim    ACPI_ADR_SPACE_TYPE     SpaceId);
265288943Sdim
266227825StheravenACPI_STATUS
267288943SdimAcpiEvExecuteRegMethod (
268288943Sdim    ACPI_OPERAND_OBJECT    *RegionObj,
269288943Sdim    UINT32                  Function);
270227825Stheraven
271227825Stheraven
272227825Stheraven/*
273227825Stheraven * evregini - Region initialization and setup
274227825Stheraven */
275227825StheravenACPI_STATUS
276227825StheravenAcpiEvSystemMemoryRegionSetup (
277227825Stheraven    ACPI_HANDLE             Handle,
278227825Stheraven    UINT32                  Function,
279227825Stheraven    void                    *HandlerContext,
280227825Stheraven    void                    **RegionContext);
281227825Stheraven
282227825StheravenACPI_STATUS
283227825StheravenAcpiEvIoSpaceRegionSetup (
284227825Stheraven    ACPI_HANDLE             Handle,
285227825Stheraven    UINT32                  Function,
286227825Stheraven    void                    *HandlerContext,
287227825Stheraven    void                    **RegionContext);
288227825Stheraven
289227825StheravenACPI_STATUS
290227825StheravenAcpiEvPciConfigRegionSetup (
291227825Stheraven    ACPI_HANDLE             Handle,
292227825Stheraven    UINT32                  Function,
293227825Stheraven    void                    *HandlerContext,
294227825Stheraven    void                    **RegionContext);
295227825Stheraven
296227825StheravenACPI_STATUS
297227825StheravenAcpiEvCmosRegionSetup (
298227825Stheraven    ACPI_HANDLE             Handle,
299227825Stheraven    UINT32                  Function,
300227825Stheraven    void                    *HandlerContext,
301227825Stheraven    void                    **RegionContext);
302227825Stheraven
303227825StheravenACPI_STATUS
304314564SdimAcpiEvPciBarRegionSetup (
305227825Stheraven    ACPI_HANDLE             Handle,
306227825Stheraven    UINT32                  Function,
307227825Stheraven    void                    *HandlerContext,
308227825Stheraven    void                    **RegionContext);
309314564Sdim
310227825StheravenACPI_STATUS
311227825StheravenAcpiEvDefaultRegionSetup (
312314564Sdim    ACPI_HANDLE             Handle,
313227825Stheraven    UINT32                  Function,
314227825Stheraven    void                    *HandlerContext,
315314564Sdim    void                    **RegionContext);
316227825Stheraven
317227825StheravenACPI_STATUS
318227825StheravenAcpiEvInitializeRegion (
319227825Stheraven    ACPI_OPERAND_OBJECT     *RegionObj,
320227825Stheraven    BOOLEAN                 AcpiNsLocked);
321227825Stheraven
322227825Stheraven
323227825Stheraven/*
324227825Stheraven * evsci - SCI (System Control Interrupt) handling/dispatch
325227825Stheraven */
326227825StheravenUINT32 ACPI_SYSTEM_XFACE
327227825StheravenAcpiEvGpeXruptHandler (
328227825Stheraven    void                    *Context);
329227825Stheraven
330227825StheravenUINT32
331314564SdimAcpiEvInstallSciHandler (
332227825Stheraven    void);
333227825Stheraven
334227825StheravenACPI_STATUS
335227825StheravenAcpiEvRemoveSciHandler (
336314564Sdim    void);
337227825Stheraven
338227825StheravenUINT32
339314564SdimAcpiEvInitializeSCI (
340227825Stheraven    UINT32                  ProgramSCI);
341227825Stheraven
342314564SdimACPI_HW_DEPENDENT_RETURN_VOID (
343227825Stheravenvoid
344227825StheravenAcpiEvTerminate (
345227825Stheraven    void))
346227825Stheraven
347227825Stheraven#endif  /* __ACEVENTS_H__  */
348227825Stheraven