xref: /titanic_51/usr/src/uts/intel/sys/acpi/acevents.h (revision 0d928757379972073af9fb22bdc827b74e8ba6ac)
1 /******************************************************************************
2  *
3  * Name: acevents.h - Event subcomponent prototypes and defines
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2011, 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_STATUS
89 AcpiEvAcquireGlobalLock(
90     UINT16                  Timeout);
91 
92 ACPI_STATUS
93 AcpiEvReleaseGlobalLock(
94     void);
95 
96 ACPI_STATUS
97 AcpiEvRemoveGlobalLockHandler (
98     void);
99 
100 
101 /*
102  * evgpe - Low-level GPE support
103  */
104 UINT32
105 AcpiEvGpeDetect (
106     ACPI_GPE_XRUPT_INFO     *GpeXruptList);
107 
108 ACPI_STATUS
109 AcpiEvUpdateGpeEnableMask (
110     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
111 
112 ACPI_STATUS
113 AcpiEvEnableGpe (
114     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
115 
116 ACPI_STATUS
117 AcpiEvAddGpeReference (
118     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
119 
120 ACPI_STATUS
121 AcpiEvRemoveGpeReference (
122     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
123 
124 ACPI_GPE_EVENT_INFO *
125 AcpiEvGetGpeEventInfo (
126     ACPI_HANDLE             GpeDevice,
127     UINT32                  GpeNumber);
128 
129 ACPI_GPE_EVENT_INFO *
130 AcpiEvLowGetGpeInfo (
131     UINT32                  GpeNumber,
132     ACPI_GPE_BLOCK_INFO     *GpeBlock);
133 
134 ACPI_STATUS
135 AcpiEvFinishGpe (
136     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
137 
138 
139 /*
140  * evgpeblk - Upper-level GPE block support
141  */
142 ACPI_STATUS
143 AcpiEvCreateGpeBlock (
144     ACPI_NAMESPACE_NODE     *GpeDevice,
145     ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
146     UINT32                  RegisterCount,
147     UINT8                   GpeBlockBaseNumber,
148     UINT32                  InterruptNumber,
149     ACPI_GPE_BLOCK_INFO     **ReturnGpeBlock);
150 
151 ACPI_STATUS
152 AcpiEvInitializeGpeBlock (
153     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
154     ACPI_GPE_BLOCK_INFO     *GpeBlock,
155     void                    *Context);
156 
157 ACPI_STATUS
158 AcpiEvDeleteGpeBlock (
159     ACPI_GPE_BLOCK_INFO     *GpeBlock);
160 
161 UINT32
162 AcpiEvGpeDispatch (
163     ACPI_NAMESPACE_NODE     *GpeDevice,
164     ACPI_GPE_EVENT_INFO     *GpeEventInfo,
165     UINT32                  GpeNumber);
166 
167 /*
168  * evgpeinit - GPE initialization and update
169  */
170 ACPI_STATUS
171 AcpiEvGpeInitialize (
172     void);
173 
174 void
175 AcpiEvUpdateGpes (
176     ACPI_OWNER_ID           TableOwnerId);
177 
178 ACPI_STATUS
179 AcpiEvMatchGpeMethod (
180     ACPI_HANDLE             ObjHandle,
181     UINT32                  Level,
182     void                    *Context,
183     void                    **ReturnValue);
184 
185 /*
186  * evgpeutil - GPE utilities
187  */
188 ACPI_STATUS
189 AcpiEvWalkGpeList (
190     ACPI_GPE_CALLBACK       GpeWalkCallback,
191     void                    *Context);
192 
193 BOOLEAN
194 AcpiEvValidGpeEvent (
195     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
196 
197 ACPI_STATUS
198 AcpiEvGetGpeDevice (
199     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
200     ACPI_GPE_BLOCK_INFO     *GpeBlock,
201     void                    *Context);
202 
203 ACPI_GPE_XRUPT_INFO *
204 AcpiEvGetGpeXruptBlock (
205     UINT32                  InterruptNumber);
206 
207 ACPI_STATUS
208 AcpiEvDeleteGpeXrupt (
209     ACPI_GPE_XRUPT_INFO     *GpeXrupt);
210 
211 ACPI_STATUS
212 AcpiEvDeleteGpeHandlers (
213     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
214     ACPI_GPE_BLOCK_INFO     *GpeBlock,
215     void                    *Context);
216 
217 
218 /*
219  * evregion - Address Space handling
220  */
221 ACPI_STATUS
222 AcpiEvInstallRegionHandlers (
223     void);
224 
225 ACPI_STATUS
226 AcpiEvInitializeOpRegions (
227     void);
228 
229 ACPI_STATUS
230 AcpiEvAddressSpaceDispatch (
231     ACPI_OPERAND_OBJECT    *RegionObj,
232     UINT32                  Function,
233     UINT32                  RegionOffset,
234     UINT32                  BitWidth,
235     UINT64                  *Value);
236 
237 ACPI_STATUS
238 AcpiEvAttachRegion (
239     ACPI_OPERAND_OBJECT     *HandlerObj,
240     ACPI_OPERAND_OBJECT     *RegionObj,
241     BOOLEAN                 AcpiNsIsLocked);
242 
243 void
244 AcpiEvDetachRegion (
245     ACPI_OPERAND_OBJECT    *RegionObj,
246     BOOLEAN                 AcpiNsIsLocked);
247 
248 ACPI_STATUS
249 AcpiEvInstallSpaceHandler (
250     ACPI_NAMESPACE_NODE     *Node,
251     ACPI_ADR_SPACE_TYPE     SpaceId,
252     ACPI_ADR_SPACE_HANDLER  Handler,
253     ACPI_ADR_SPACE_SETUP    Setup,
254     void                    *Context);
255 
256 ACPI_STATUS
257 AcpiEvExecuteRegMethods (
258     ACPI_NAMESPACE_NODE     *Node,
259     ACPI_ADR_SPACE_TYPE     SpaceId);
260 
261 ACPI_STATUS
262 AcpiEvExecuteRegMethod (
263     ACPI_OPERAND_OBJECT    *RegionObj,
264     UINT32                  Function);
265 
266 
267 /*
268  * evregini - Region initialization and setup
269  */
270 ACPI_STATUS
271 AcpiEvSystemMemoryRegionSetup (
272     ACPI_HANDLE             Handle,
273     UINT32                  Function,
274     void                    *HandlerContext,
275     void                    **RegionContext);
276 
277 ACPI_STATUS
278 AcpiEvIoSpaceRegionSetup (
279     ACPI_HANDLE             Handle,
280     UINT32                  Function,
281     void                    *HandlerContext,
282     void                    **RegionContext);
283 
284 ACPI_STATUS
285 AcpiEvPciConfigRegionSetup (
286     ACPI_HANDLE             Handle,
287     UINT32                  Function,
288     void                    *HandlerContext,
289     void                    **RegionContext);
290 
291 ACPI_STATUS
292 AcpiEvCmosRegionSetup (
293     ACPI_HANDLE             Handle,
294     UINT32                  Function,
295     void                    *HandlerContext,
296     void                    **RegionContext);
297 
298 ACPI_STATUS
299 AcpiEvPciBarRegionSetup (
300     ACPI_HANDLE             Handle,
301     UINT32                  Function,
302     void                    *HandlerContext,
303     void                    **RegionContext);
304 
305 ACPI_STATUS
306 AcpiEvDefaultRegionSetup (
307     ACPI_HANDLE             Handle,
308     UINT32                  Function,
309     void                    *HandlerContext,
310     void                    **RegionContext);
311 
312 ACPI_STATUS
313 AcpiEvInitializeRegion (
314     ACPI_OPERAND_OBJECT     *RegionObj,
315     BOOLEAN                 AcpiNsLocked);
316 
317 
318 /*
319  * evsci - SCI (System Control Interrupt) handling/dispatch
320  */
321 UINT32 ACPI_SYSTEM_XFACE
322 AcpiEvGpeXruptHandler (
323     void                    *Context);
324 
325 UINT32
326 AcpiEvInstallSciHandler (
327     void);
328 
329 ACPI_STATUS
330 AcpiEvRemoveSciHandler (
331     void);
332 
333 UINT32
334 AcpiEvInitializeSCI (
335     UINT32                  ProgramSCI);
336 
337 void
338 AcpiEvTerminate (
339     void);
340 
341 
342 #endif  /* __ACEVENTS_H__  */
343