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