ReactOS  0.4.14-dev-358-gbef841c
acevents.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Name: acevents.h - Event subcomponent prototypes and defines
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2019, 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  * Conditions to trigger post enabling GPE polling:
50  * It is not sufficient to trigger edge-triggered GPE with specific GPE
51  * chips, software need to poll once after enabling.
52  */
53 #ifdef ACPI_USE_GPE_POLLING
54 #define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) \
55  ((__gpe__)->RuntimeCount == 1 && \
56  (__gpe__)->Flags & ACPI_GPE_INITIALIZED && \
57  ((__gpe__)->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED)
58 #else
59 #define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) FALSE
60 #endif
61 
62 
63 /*
64  * evevent
65  */
68  void);
69 
72  void);
73 
74 UINT32
76  void);
77 
78 
79 /*
80  * evmisc
81  */
82 BOOLEAN
85 
86 UINT32
89 
93  UINT32 NotifyValue);
94 
95 
96 /*
97  * evglock - Global Lock support
98  */
101  void);
102 
106  UINT16 Timeout))
107 
111  void))
112 
115  void);
116 
117 
118 /*
119  * evgpe - Low-level GPE support
120  */
121 UINT32
123  ACPI_GPE_XRUPT_INFO *GpeXruptList);
124 
128 
132 
136  BOOLEAN IsMasked);
137 
141  BOOLEAN ClearOnEnable);
142 
146 
149  ACPI_HANDLE GpeDevice,
150  UINT32 GpeNumber);
151 
155  ACPI_GPE_BLOCK_INFO *GpeBlock);
156 
160 
161 UINT32
163  ACPI_NAMESPACE_NODE *GpeDevice,
165  UINT32 GpeNumber);
166 
167 
168 /*
169  * evgpeblk - Upper-level GPE block support
170  */
173  ACPI_NAMESPACE_NODE *GpeDevice,
174  UINT64 Address,
175  UINT8 SpaceId,
176  UINT32 RegisterCount,
177  UINT16 GpeBlockBaseNumber,
178  UINT32 InterruptNumber,
179  ACPI_GPE_BLOCK_INFO **ReturnGpeBlock);
180 
183  ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
184  ACPI_GPE_BLOCK_INFO *GpeBlock,
185  void *Context);
186 
190  ACPI_GPE_BLOCK_INFO *GpeBlock))
191 
192 UINT32
194  ACPI_NAMESPACE_NODE *GpeDevice,
196  UINT32 GpeNumber);
197 
198 
199 /*
200  * evgpeinit - GPE initialization and update
201  */
204  void);
205 
207 void
209  ACPI_OWNER_ID TableOwnerId))
210 
213  ACPI_HANDLE ObjHandle,
215  void *Context,
216  void **ReturnValue);
217 
218 
219 /*
220  * evgpeutil - GPE utilities
221  */
224  ACPI_GPE_CALLBACK GpeWalkCallback,
225  void *Context);
226 
229  ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
230  ACPI_GPE_BLOCK_INFO *GpeBlock,
231  void *Context);
232 
235  UINT32 InterruptNumber,
236  ACPI_GPE_XRUPT_INFO **GpeXruptBlock);
237 
240  ACPI_GPE_XRUPT_INFO *GpeXrupt);
241 
244  ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
245  ACPI_GPE_BLOCK_INFO *GpeBlock,
246  void *Context);
247 
248 
249 /*
250  * evhandler - Address space handling
251  */
255  ACPI_OPERAND_OBJECT *HandlerObj);
256 
257 BOOLEAN
261 
264  void);
265 
272  void *Context);
273 
274 
275 /*
276  * evregion - Operation region support
277  */
280  void);
281 
284  ACPI_OPERAND_OBJECT *RegionObj,
285  ACPI_OPERAND_OBJECT *FieldObj,
287  UINT32 RegionOffset,
288  UINT32 BitWidth,
289  UINT64 *Value);
290 
293  ACPI_OPERAND_OBJECT *HandlerObj,
294  ACPI_OPERAND_OBJECT *RegionObj,
295  BOOLEAN AcpiNsIsLocked);
296 
297 void
299  ACPI_OPERAND_OBJECT *RegionObj,
300  BOOLEAN AcpiNsIsLocked);
301 
302 void
306  UINT32 Function);
307 
310  ACPI_OPERAND_OBJECT *RegionObj,
311  UINT32 Function);
312 
313 
314 /*
315  * evregini - Region initialization and setup
316  */
321  void *HandlerContext,
322  void **RegionContext);
323 
328  void *HandlerContext,
329  void **RegionContext);
330 
335  void *HandlerContext,
336  void **RegionContext);
337 
342  void *HandlerContext,
343  void **RegionContext);
344 
349  void *HandlerContext,
350  void **RegionContext);
351 
356  void *HandlerContext,
357  void **RegionContext);
358 
361  ACPI_OPERAND_OBJECT *RegionObj);
362 
363 BOOLEAN
366 
367 
368 /*
369  * evsci - SCI (System Control Interrupt) handling/dispatch
370  */
373  void *Context);
374 
375 UINT32
377  void);
378 
379 UINT32
381  void);
382 
385  void);
386 
388 void
390  void))
391 
392 #endif /* __ACEVENTS_H__ */
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
ACPI_STATUS AcpiEvAddGpeReference(ACPI_GPE_EVENT_INFO *GpeEventInfo, BOOLEAN ClearOnEnable)
Definition: evgpe.c:221
ACPI_STATUS AcpiEvAcquireGlobalLock(UINT16 Timeout)
Definition: evglock.c:230
UINT32 Level
Definition: acevents.h:214
UINT8 ACPI_ADR_SPACE_TYPE
Definition: actypes.h:849
ACPI_STATUS(* ACPI_ADR_SPACE_SETUP)(ACPI_HANDLE RegionHandle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: actypes.h:1214
ACPI_STATUS(* ACPI_ADR_SPACE_HANDLER)(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext)
Definition: actypes.h:1192
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:828
ACPI_STATUS AcpiEvInstallRegionHandlers(void)
Definition: evhandler.c:88
ACPI_STATUS(* ACPI_GPE_CALLBACK)(ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
Definition: aclocal.h:628
ACPI_STATUS AcpiEvIoSpaceRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:136
ACPI_STATUS AcpiEvSystemMemoryRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:70
ACPI_STATUS AcpiEvRemoveGlobalLockHandler(void)
Definition: evglock.c:135
ACPI_STATUS AcpiEvInitializeOpRegions(void)
Definition: evregion.c:84
ACPI_GPE_EVENT_INFO * GpeEventInfo
Definition: acevents.h:195
ACPI_STATUS AcpiEvGpeInitialize(void)
Definition: evgpeinit.c:84
ACPI_STATUS AcpiEvAddressSpaceDispatch(ACPI_OPERAND_OBJECT *RegionObj, ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, UINT64 *Value)
Definition: evregion.c:148
ACPI_HW_DEPENDENT_RETURN_VOID(void AcpiEvUpdateGpes(ACPI_OWNER_ID TableOwnerId)) ACPI_STATUS AcpiEvMatchGpeMethod(ACPI_HANDLE ObjHandle
UINT32 ACPI_STATUS
Definition: actypes.h:460
ACPI_STATUS AcpiEvCreateGpeBlock(ACPI_NAMESPACE_NODE *GpeDevice, UINT64 Address, UINT8 SpaceId, UINT32 RegisterCount, UINT16 GpeBlockBaseNumber, UINT32 InterruptNumber, ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
Definition: evgpeblk.c:371
void AcpiEvUpdateGpes(ACPI_OWNER_ID TableOwnerId)
Definition: evgpeinit.c:233
ACPI_STATUS AcpiEvEnableGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:126
UINT32 ACPI_SYSTEM_XFACE AcpiEvGpeXruptHandler(void *Context)
Definition: evsci.c:176
ACPI_OPERAND_OBJECT * AcpiEvFindRegionHandler(ACPI_ADR_SPACE_TYPE SpaceId, ACPI_OPERAND_OBJECT *HandlerObj)
Definition: evhandler.c:346
ACPI_STATUS AcpiEvUpdateGpeEnableMask(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:79
void AcpiEvDetachRegion(ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked)
Definition: evregion.c:360
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:828
UINT32 AcpiEvDetectGpe(ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber)
Definition: evgpe.c:722
UINT32 void void ** ReturnValue
Definition: acevents.h:214
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
ACPI_STATUS AcpiEvInitializeRegion(ACPI_OPERAND_OBJECT *RegionObj)
Definition: evrgnini.c:568
unsigned int UINT32
ACPI_STATUS AcpiEvGetGpeXruptBlock(UINT32 InterruptNumber, ACPI_GPE_XRUPT_INFO **GpeXruptBlock)
Definition: evgpeutil.c:178
ACPI_STATUS AcpiEvDeleteGpeHandlers(ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
Definition: evgpeutil.c:339
UINT32 AcpiEvGpeDispatch(ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber)
Definition: evgpe.c:857
ACPI_STATUS AcpiEvGetGpeDevice(ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
Definition: evgpeutil.c:130
unsigned char BOOLEAN
BOOLEAN AcpiEvIsPciRootBridge(ACPI_NAMESPACE_NODE *Node)
Definition: evrgnini.c:379
static WCHAR Address[46]
Definition: ping.c:68
void AcpiEvExecuteRegMethods(ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId, UINT32 Function)
Definition: evregion.c:723
_In_ HANDLE Handle
Definition: extypes.h:390
ACPI_STATUS AcpiEvInstallSpaceHandler(ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId, ACPI_ADR_SPACE_HANDLER Handler, ACPI_ADR_SPACE_SETUP Setup, void *Context)
Definition: evhandler.c:389
ACPI_STATUS AcpiEvDeleteGpeBlock(ACPI_GPE_BLOCK_INFO *GpeBlock)
Definition: evgpeblk.c:148
ACPI_GPE_EVENT_INFO * AcpiEvGetGpeEventInfo(ACPI_HANDLE GpeDevice, UINT32 GpeNumber)
Definition: evgpe.c:372
#define ACPI_SYSTEM_XFACE
Definition: acenv.h:311
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
BOOLEAN AcpiEvHasDefaultHandler(ACPI_NAMESPACE_NODE *Node, ACPI_ADR_SPACE_TYPE SpaceId)
Definition: evhandler.c:166
ACPI_STATUS AcpiEvInitializeGpeBlock(ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context)
Definition: evgpeblk.c:481
UINT32 AcpiEvFixedEventDetect(void)
Definition: evevent.c:232
ACPI_GPE_EVENT_INFO UINT32 GpeNumber
Definition: acevents.h:195
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:668
ACPI_STATUS AcpiEvPciBarRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:447
ACPI_STATUS AcpiEvExecuteRegMethod(ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function)
Definition: evregion.c:577
static ULONG Timeout
Definition: ping.c:61
ACPI_STATUS AcpiEvFinishGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:670
ACPI_STATUS AcpiEvDeleteGpeXrupt(ACPI_GPE_XRUPT_INFO *GpeXrupt)
Definition: evgpeutil.c:270
ACPI_STATUS AcpiEvQueueNotifyRequest(ACPI_NAMESPACE_NODE *Node, UINT32 NotifyValue)
Definition: evmisc.c:111
ACPI_STATUS AcpiEvInstallXruptHandlers(void)
Definition: evevent.c:131
unsigned short UINT16
ACPI_STATUS AcpiEvPciConfigRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:176
ACPI_STATUS AcpiEvReleaseGlobalLock(void)
Definition: evglock.c:333
UINT32 AcpiEvGetGpeNumberIndex(UINT32 GpeNumber)
UINT32 AcpiEvGpeDetect(ACPI_GPE_XRUPT_INFO *GpeXruptList)
Definition: evgpe.c:433
ACPI_GPE_EVENT_INFO * AcpiEvLowGetGpeInfo(UINT32 GpeNumber, ACPI_GPE_BLOCK_INFO *GpeBlock)
Definition: evgpe.c:327
void AcpiEvTerminate(void)
Definition: evmisc.c:263
UINT32 AcpiEvSciDispatch(void)
Definition: evsci.c:75
ACPI_STATUS AcpiEvInitGlobalLockHandler(void)
Definition: evglock.c:74
ACPI_STATUS AcpiEvCmosRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:478
ACPI_HW_DEPENDENT_RETURN_OK(ACPI_STATUS AcpiEvAcquireGlobalLock(UINT16 Timeout)) ACPI_HW_DEPENDENT_RETURN_OK(ACPI_STATUS AcpiEvReleaseGlobalLock(void)) ACPI_STATUS AcpiEvRemoveGlobalLockHandler(void)
ACPI_STATUS AcpiEvAttachRegion(ACPI_OPERAND_OBJECT *HandlerObj, ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked)
Definition: evregion.c:530
UINT32 AcpiEvInstallSciHandler(void)
Definition: evsci.c:211
ACPI_STATUS AcpiEvWalkGpeList(ACPI_GPE_CALLBACK GpeWalkCallback, void *Context)
Definition: evgpeutil.c:67
ACPI_STATUS AcpiEvMaskGpe(ACPI_GPE_EVENT_INFO *GpeEventInfo, BOOLEAN IsMasked)
Definition: evgpe.c:156
ACPI_STATUS AcpiEvInitializeEvents(void)
Definition: evevent.c:77
ACPI_STATUS AcpiEvMatchGpeMethod(ACPI_HANDLE ObjHandle, UINT32 Level, void *Context, void **ReturnValue)
Definition: evgpeinit.c:327
ACPI_STATUS AcpiEvRemoveGpeReference(ACPI_GPE_EVENT_INFO *GpeEventInfo)
Definition: evgpe.c:276
unsigned long long UINT64
unsigned char UINT8
ACPI_STATUS AcpiEvDefaultRegionSetup(ACPI_HANDLE Handle, UINT32 Function, void *HandlerContext, void **RegionContext)
Definition: evrgnini.c:507
ACPI_STATUS AcpiEvRemoveAllSciHandlers(void)
Definition: evsci.c:246
BOOLEAN AcpiEvIsNotifyObject(ACPI_NAMESPACE_NODE *Node)
Definition: evmisc.c:75
Definition: dlist.c:348