xref: /titanic_50/usr/src/uts/intel/sys/acpi/acevents.h (revision e373b6e444a487df89a5dc6a4a4030b5b2aa87f9)
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 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 ACPI_OPERAND_OBJECT *
226 AcpiEvFindRegionHandler (
227     ACPI_ADR_SPACE_TYPE     SpaceId,
228     ACPI_OPERAND_OBJECT     *HandlerObj);
229 
230 BOOLEAN
231 AcpiEvHasDefaultHandler (
232     ACPI_NAMESPACE_NODE     *Node,
233     ACPI_ADR_SPACE_TYPE     SpaceId);
234 
235 ACPI_STATUS
236 AcpiEvInstallRegionHandlers (
237     void);
238 
239 ACPI_STATUS
240 AcpiEvInstallSpaceHandler (
241     ACPI_NAMESPACE_NODE     *Node,
242     ACPI_ADR_SPACE_TYPE     SpaceId,
243     ACPI_ADR_SPACE_HANDLER  Handler,
244     ACPI_ADR_SPACE_SETUP    Setup,
245     void                    *Context);
246 
247 
248 /*
249  * evregion - Operation region support
250  */
251 ACPI_STATUS
252 AcpiEvInitializeOpRegions (
253     void);
254 
255 ACPI_STATUS
256 AcpiEvAddressSpaceDispatch (
257     ACPI_OPERAND_OBJECT     *RegionObj,
258     ACPI_OPERAND_OBJECT     *FieldObj,
259     UINT32                  Function,
260     UINT32                  RegionOffset,
261     UINT32                  BitWidth,
262     UINT64                  *Value);
263 
264 ACPI_STATUS
265 AcpiEvAttachRegion (
266     ACPI_OPERAND_OBJECT     *HandlerObj,
267     ACPI_OPERAND_OBJECT     *RegionObj,
268     BOOLEAN                 AcpiNsIsLocked);
269 
270 void
271 AcpiEvDetachRegion (
272     ACPI_OPERAND_OBJECT     *RegionObj,
273     BOOLEAN                 AcpiNsIsLocked);
274 
275 void
276 AcpiEvExecuteRegMethods (
277     ACPI_NAMESPACE_NODE     *Node,
278     ACPI_ADR_SPACE_TYPE     SpaceId,
279     UINT32                  Function);
280 
281 ACPI_STATUS
282 AcpiEvExecuteRegMethod (
283     ACPI_OPERAND_OBJECT     *RegionObj,
284     UINT32                  Function);
285 
286 
287 /*
288  * evregini - Region initialization and setup
289  */
290 ACPI_STATUS
291 AcpiEvSystemMemoryRegionSetup (
292     ACPI_HANDLE             Handle,
293     UINT32                  Function,
294     void                    *HandlerContext,
295     void                    **RegionContext);
296 
297 ACPI_STATUS
298 AcpiEvIoSpaceRegionSetup (
299     ACPI_HANDLE             Handle,
300     UINT32                  Function,
301     void                    *HandlerContext,
302     void                    **RegionContext);
303 
304 ACPI_STATUS
305 AcpiEvPciConfigRegionSetup (
306     ACPI_HANDLE             Handle,
307     UINT32                  Function,
308     void                    *HandlerContext,
309     void                    **RegionContext);
310 
311 ACPI_STATUS
312 AcpiEvCmosRegionSetup (
313     ACPI_HANDLE             Handle,
314     UINT32                  Function,
315     void                    *HandlerContext,
316     void                    **RegionContext);
317 
318 ACPI_STATUS
319 AcpiEvPciBarRegionSetup (
320     ACPI_HANDLE             Handle,
321     UINT32                  Function,
322     void                    *HandlerContext,
323     void                    **RegionContext);
324 
325 ACPI_STATUS
326 AcpiEvDefaultRegionSetup (
327     ACPI_HANDLE             Handle,
328     UINT32                  Function,
329     void                    *HandlerContext,
330     void                    **RegionContext);
331 
332 ACPI_STATUS
333 AcpiEvInitializeRegion (
334     ACPI_OPERAND_OBJECT     *RegionObj,
335     BOOLEAN                 AcpiNsLocked);
336 
337 
338 /*
339  * evsci - SCI (System Control Interrupt) handling/dispatch
340  */
341 UINT32 ACPI_SYSTEM_XFACE
342 AcpiEvGpeXruptHandler (
343     void                    *Context);
344 
345 UINT32
346 AcpiEvSciDispatch (
347     void);
348 
349 UINT32
350 AcpiEvInstallSciHandler (
351     void);
352 
353 ACPI_STATUS
354 AcpiEvRemoveAllSciHandlers (
355     void);
356 
357 ACPI_HW_DEPENDENT_RETURN_VOID (
358 void
359 AcpiEvTerminate (
360     void))
361 
362 #endif  /* __ACEVENTS_H__  */
363