xref: /freebsd/sys/contrib/dev/acpica/include/acevents.h (revision 7d8f797b725e3efc0a4256554654780df83c456c)
1 /******************************************************************************
2  *
3  * Name: acevents.h - Event subcomponent prototypes and defines
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2015, 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     UINT64                  Address,
148     UINT8                   SpaceId,
149     UINT32                  RegisterCount,
150     UINT16                  GpeBlockBaseNumber,
151     UINT32                  InterruptNumber,
152     ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock);
153 
154 ACPI_STATUS
155 AcpiEvInitializeGpeBlock (
156     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
157     ACPI_GPE_BLOCK_INFO     *GpeBlock,
158     void                    *Context);
159 
160 ACPI_HW_DEPENDENT_RETURN_OK (
161 ACPI_STATUS
162 AcpiEvDeleteGpeBlock (
163     ACPI_GPE_BLOCK_INFO     *GpeBlock))
164 
165 UINT32
166 AcpiEvGpeDispatch (
167     ACPI_NAMESPACE_NODE     *GpeDevice,
168     ACPI_GPE_EVENT_INFO     *GpeEventInfo,
169     UINT32                  GpeNumber);
170 
171 
172 /*
173  * evgpeinit - GPE initialization and update
174  */
175 ACPI_STATUS
176 AcpiEvGpeInitialize (
177     void);
178 
179 ACPI_HW_DEPENDENT_RETURN_VOID (
180 void
181 AcpiEvUpdateGpes (
182     ACPI_OWNER_ID           TableOwnerId))
183 
184 ACPI_STATUS
185 AcpiEvMatchGpeMethod (
186     ACPI_HANDLE             ObjHandle,
187     UINT32                  Level,
188     void                    *Context,
189     void                    **ReturnValue);
190 
191 
192 /*
193  * evgpeutil - GPE utilities
194  */
195 ACPI_STATUS
196 AcpiEvWalkGpeList (
197     ACPI_GPE_CALLBACK       GpeWalkCallback,
198     void                    *Context);
199 
200 ACPI_STATUS
201 AcpiEvGetGpeDevice (
202     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
203     ACPI_GPE_BLOCK_INFO     *GpeBlock,
204     void                    *Context);
205 
206 ACPI_STATUS
207 AcpiEvGetGpeXruptBlock (
208     UINT32                  InterruptNumber,
209     ACPI_GPE_XRUPT_INFO     **GpeXruptBlock);
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  * evhandler - Address space handling
224  */
225 BOOLEAN
226 AcpiEvHasDefaultHandler (
227     ACPI_NAMESPACE_NODE     *Node,
228     ACPI_ADR_SPACE_TYPE     SpaceId);
229 
230 ACPI_STATUS
231 AcpiEvInstallRegionHandlers (
232     void);
233 
234 ACPI_STATUS
235 AcpiEvInstallSpaceHandler (
236     ACPI_NAMESPACE_NODE     *Node,
237     ACPI_ADR_SPACE_TYPE     SpaceId,
238     ACPI_ADR_SPACE_HANDLER  Handler,
239     ACPI_ADR_SPACE_SETUP    Setup,
240     void                    *Context);
241 
242 
243 /*
244  * evregion - Operation region support
245  */
246 ACPI_STATUS
247 AcpiEvInitializeOpRegions (
248     void);
249 
250 ACPI_STATUS
251 AcpiEvAddressSpaceDispatch (
252     ACPI_OPERAND_OBJECT     *RegionObj,
253     ACPI_OPERAND_OBJECT     *FieldObj,
254     UINT32                  Function,
255     UINT32                  RegionOffset,
256     UINT32                  BitWidth,
257     UINT64                  *Value);
258 
259 ACPI_STATUS
260 AcpiEvAttachRegion (
261     ACPI_OPERAND_OBJECT     *HandlerObj,
262     ACPI_OPERAND_OBJECT     *RegionObj,
263     BOOLEAN                 AcpiNsIsLocked);
264 
265 void
266 AcpiEvDetachRegion (
267     ACPI_OPERAND_OBJECT    *RegionObj,
268     BOOLEAN                 AcpiNsIsLocked);
269 
270 ACPI_STATUS
271 AcpiEvExecuteRegMethods (
272     ACPI_NAMESPACE_NODE     *Node,
273     ACPI_ADR_SPACE_TYPE     SpaceId);
274 
275 ACPI_STATUS
276 AcpiEvExecuteRegMethod (
277     ACPI_OPERAND_OBJECT    *RegionObj,
278     UINT32                  Function);
279 
280 
281 /*
282  * evregini - Region initialization and setup
283  */
284 ACPI_STATUS
285 AcpiEvSystemMemoryRegionSetup (
286     ACPI_HANDLE             Handle,
287     UINT32                  Function,
288     void                    *HandlerContext,
289     void                    **RegionContext);
290 
291 ACPI_STATUS
292 AcpiEvIoSpaceRegionSetup (
293     ACPI_HANDLE             Handle,
294     UINT32                  Function,
295     void                    *HandlerContext,
296     void                    **RegionContext);
297 
298 ACPI_STATUS
299 AcpiEvPciConfigRegionSetup (
300     ACPI_HANDLE             Handle,
301     UINT32                  Function,
302     void                    *HandlerContext,
303     void                    **RegionContext);
304 
305 ACPI_STATUS
306 AcpiEvCmosRegionSetup (
307     ACPI_HANDLE             Handle,
308     UINT32                  Function,
309     void                    *HandlerContext,
310     void                    **RegionContext);
311 
312 ACPI_STATUS
313 AcpiEvPciBarRegionSetup (
314     ACPI_HANDLE             Handle,
315     UINT32                  Function,
316     void                    *HandlerContext,
317     void                    **RegionContext);
318 
319 ACPI_STATUS
320 AcpiEvDefaultRegionSetup (
321     ACPI_HANDLE             Handle,
322     UINT32                  Function,
323     void                    *HandlerContext,
324     void                    **RegionContext);
325 
326 ACPI_STATUS
327 AcpiEvInitializeRegion (
328     ACPI_OPERAND_OBJECT     *RegionObj,
329     BOOLEAN                 AcpiNsLocked);
330 
331 
332 /*
333  * evsci - SCI (System Control Interrupt) handling/dispatch
334  */
335 UINT32 ACPI_SYSTEM_XFACE
336 AcpiEvGpeXruptHandler (
337     void                    *Context);
338 
339 UINT32
340 AcpiEvSciDispatch (
341     void);
342 
343 UINT32
344 AcpiEvInstallSciHandler (
345     void);
346 
347 ACPI_STATUS
348 AcpiEvRemoveAllSciHandlers (
349     void);
350 
351 ACPI_HW_DEPENDENT_RETURN_VOID (
352 void
353 AcpiEvTerminate (
354     void))
355 
356 #endif  /* __ACEVENTS_H__  */
357