xref: /freebsd/sys/contrib/dev/acpica/include/acevents.h (revision aa77200569e397d6ff1fdb4d255d0fa254d0a128)
1 /******************************************************************************
2  *
3  * Name: acevents.h - Event subcomponent prototypes and defines
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2012, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43 
44 #ifndef __ACEVENTS_H__
45 #define __ACEVENTS_H__
46 
47 
48 /*
49  * evevent
50  */
51 ACPI_STATUS
52 AcpiEvInitializeEvents (
53     void);
54 
55 ACPI_STATUS
56 AcpiEvInstallXruptHandlers (
57     void);
58 
59 UINT32
60 AcpiEvFixedEventDetect (
61     void);
62 
63 
64 /*
65  * evmisc
66  */
67 BOOLEAN
68 AcpiEvIsNotifyObject (
69     ACPI_NAMESPACE_NODE     *Node);
70 
71 UINT32
72 AcpiEvGetGpeNumberIndex (
73     UINT32                  GpeNumber);
74 
75 ACPI_STATUS
76 AcpiEvQueueNotifyRequest (
77     ACPI_NAMESPACE_NODE     *Node,
78     UINT32                  NotifyValue);
79 
80 
81 /*
82  * evglock - Global Lock support
83  */
84 ACPI_STATUS
85 AcpiEvInitGlobalLockHandler (
86     void);
87 
88 ACPI_HW_DEPENDENT_RETURN_OK (
89 ACPI_STATUS
90 AcpiEvAcquireGlobalLock(
91     UINT16                  Timeout))
92 
93 ACPI_HW_DEPENDENT_RETURN_OK (
94 ACPI_STATUS
95 AcpiEvReleaseGlobalLock(
96     void))
97 
98 ACPI_STATUS
99 AcpiEvRemoveGlobalLockHandler (
100     void);
101 
102 
103 /*
104  * evgpe - Low-level GPE support
105  */
106 UINT32
107 AcpiEvGpeDetect (
108     ACPI_GPE_XRUPT_INFO     *GpeXruptList);
109 
110 ACPI_STATUS
111 AcpiEvUpdateGpeEnableMask (
112     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
113 
114 ACPI_STATUS
115 AcpiEvEnableGpe (
116     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
117 
118 ACPI_STATUS
119 AcpiEvAddGpeReference (
120     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
121 
122 ACPI_STATUS
123 AcpiEvRemoveGpeReference (
124     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
125 
126 ACPI_GPE_EVENT_INFO *
127 AcpiEvGetGpeEventInfo (
128     ACPI_HANDLE             GpeDevice,
129     UINT32                  GpeNumber);
130 
131 ACPI_GPE_EVENT_INFO *
132 AcpiEvLowGetGpeInfo (
133     UINT32                  GpeNumber,
134     ACPI_GPE_BLOCK_INFO     *GpeBlock);
135 
136 ACPI_STATUS
137 AcpiEvFinishGpe (
138     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
139 
140 
141 /*
142  * evgpeblk - Upper-level GPE block support
143  */
144 ACPI_STATUS
145 AcpiEvCreateGpeBlock (
146     ACPI_NAMESPACE_NODE     *GpeDevice,
147     ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
148     UINT32                  RegisterCount,
149     UINT8                   GpeBlockBaseNumber,
150     UINT32                  InterruptNumber,
151     ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock);
152 
153 ACPI_STATUS
154 AcpiEvInitializeGpeBlock (
155     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
156     ACPI_GPE_BLOCK_INFO     *GpeBlock,
157     void                    *Context);
158 
159 ACPI_HW_DEPENDENT_RETURN_OK (
160 ACPI_STATUS
161 AcpiEvDeleteGpeBlock (
162     ACPI_GPE_BLOCK_INFO     *GpeBlock))
163 
164 UINT32
165 AcpiEvGpeDispatch (
166     ACPI_NAMESPACE_NODE     *GpeDevice,
167     ACPI_GPE_EVENT_INFO     *GpeEventInfo,
168     UINT32                  GpeNumber);
169 
170 /*
171  * evgpeinit - GPE initialization and update
172  */
173 ACPI_STATUS
174 AcpiEvGpeInitialize (
175     void);
176 
177 ACPI_HW_DEPENDENT_RETURN_VOID (
178 void
179 AcpiEvUpdateGpes (
180     ACPI_OWNER_ID           TableOwnerId))
181 
182 ACPI_STATUS
183 AcpiEvMatchGpeMethod (
184     ACPI_HANDLE             ObjHandle,
185     UINT32                  Level,
186     void                    *Context,
187     void                    **ReturnValue);
188 
189 /*
190  * evgpeutil - GPE utilities
191  */
192 ACPI_STATUS
193 AcpiEvWalkGpeList (
194     ACPI_GPE_CALLBACK       GpeWalkCallback,
195     void                    *Context);
196 
197 BOOLEAN
198 AcpiEvValidGpeEvent (
199     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
200 
201 ACPI_STATUS
202 AcpiEvGetGpeDevice (
203     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
204     ACPI_GPE_BLOCK_INFO     *GpeBlock,
205     void                    *Context);
206 
207 ACPI_GPE_XRUPT_INFO *
208 AcpiEvGetGpeXruptBlock (
209     UINT32                  InterruptNumber);
210 
211 ACPI_STATUS
212 AcpiEvDeleteGpeXrupt (
213     ACPI_GPE_XRUPT_INFO     *GpeXrupt);
214 
215 ACPI_STATUS
216 AcpiEvDeleteGpeHandlers (
217     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
218     ACPI_GPE_BLOCK_INFO     *GpeBlock,
219     void                    *Context);
220 
221 
222 /*
223  * evregion - Address Space handling
224  */
225 ACPI_STATUS
226 AcpiEvInstallRegionHandlers (
227     void);
228 
229 ACPI_STATUS
230 AcpiEvInitializeOpRegions (
231     void);
232 
233 ACPI_STATUS
234 AcpiEvAddressSpaceDispatch (
235     ACPI_OPERAND_OBJECT     *RegionObj,
236     ACPI_OPERAND_OBJECT     *FieldObj,
237     UINT32                  Function,
238     UINT32                  RegionOffset,
239     UINT32                  BitWidth,
240     UINT64                  *Value);
241 
242 ACPI_STATUS
243 AcpiEvAttachRegion (
244     ACPI_OPERAND_OBJECT     *HandlerObj,
245     ACPI_OPERAND_OBJECT     *RegionObj,
246     BOOLEAN                 AcpiNsIsLocked);
247 
248 void
249 AcpiEvDetachRegion (
250     ACPI_OPERAND_OBJECT    *RegionObj,
251     BOOLEAN                 AcpiNsIsLocked);
252 
253 ACPI_STATUS
254 AcpiEvInstallSpaceHandler (
255     ACPI_NAMESPACE_NODE     *Node,
256     ACPI_ADR_SPACE_TYPE     SpaceId,
257     ACPI_ADR_SPACE_HANDLER  Handler,
258     ACPI_ADR_SPACE_SETUP    Setup,
259     void                    *Context);
260 
261 ACPI_STATUS
262 AcpiEvExecuteRegMethods (
263     ACPI_NAMESPACE_NODE     *Node,
264     ACPI_ADR_SPACE_TYPE     SpaceId);
265 
266 ACPI_STATUS
267 AcpiEvExecuteRegMethod (
268     ACPI_OPERAND_OBJECT    *RegionObj,
269     UINT32                  Function);
270 
271 
272 /*
273  * evregini - Region initialization and setup
274  */
275 ACPI_STATUS
276 AcpiEvSystemMemoryRegionSetup (
277     ACPI_HANDLE             Handle,
278     UINT32                  Function,
279     void                    *HandlerContext,
280     void                    **RegionContext);
281 
282 ACPI_STATUS
283 AcpiEvIoSpaceRegionSetup (
284     ACPI_HANDLE             Handle,
285     UINT32                  Function,
286     void                    *HandlerContext,
287     void                    **RegionContext);
288 
289 ACPI_STATUS
290 AcpiEvPciConfigRegionSetup (
291     ACPI_HANDLE             Handle,
292     UINT32                  Function,
293     void                    *HandlerContext,
294     void                    **RegionContext);
295 
296 ACPI_STATUS
297 AcpiEvCmosRegionSetup (
298     ACPI_HANDLE             Handle,
299     UINT32                  Function,
300     void                    *HandlerContext,
301     void                    **RegionContext);
302 
303 ACPI_STATUS
304 AcpiEvPciBarRegionSetup (
305     ACPI_HANDLE             Handle,
306     UINT32                  Function,
307     void                    *HandlerContext,
308     void                    **RegionContext);
309 
310 ACPI_STATUS
311 AcpiEvDefaultRegionSetup (
312     ACPI_HANDLE             Handle,
313     UINT32                  Function,
314     void                    *HandlerContext,
315     void                    **RegionContext);
316 
317 ACPI_STATUS
318 AcpiEvInitializeRegion (
319     ACPI_OPERAND_OBJECT     *RegionObj,
320     BOOLEAN                 AcpiNsLocked);
321 
322 
323 /*
324  * evsci - SCI (System Control Interrupt) handling/dispatch
325  */
326 UINT32 ACPI_SYSTEM_XFACE
327 AcpiEvGpeXruptHandler (
328     void                    *Context);
329 
330 UINT32
331 AcpiEvInstallSciHandler (
332     void);
333 
334 ACPI_STATUS
335 AcpiEvRemoveSciHandler (
336     void);
337 
338 UINT32
339 AcpiEvInitializeSCI (
340     UINT32                  ProgramSCI);
341 
342 ACPI_HW_DEPENDENT_RETURN_VOID (
343 void
344 AcpiEvTerminate (
345     void))
346 
347 #endif  /* __ACEVENTS_H__  */
348