ReactOS  0.4.14-dev-323-g6fe6a88
acresrc.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Name: acresrc.h - Resource Manager function prototypes
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 __ACRESRC_H__
45 #define __ACRESRC_H__
46 
47 /* Need the AML resource descriptor structs */
48 
49 #include "amlresrc.h"
50 
51 
52 /*
53  * If possible, pack the following structures to byte alignment, since we
54  * don't care about performance for debug output. Two cases where we cannot
55  * pack the structures:
56  *
57  * 1) Hardware does not support misaligned memory transfers
58  * 2) Compiler does not support pointers within packed structures
59  */
60 #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
61 #pragma pack(1)
62 #endif
63 
64 /*
65  * Individual entry for the resource conversion tables
66  */
67 typedef const struct acpi_rsconvert_info
68 {
73 
75 
76 /* Resource conversion opcodes */
77 
78 typedef enum
79 {
112 
114 
115 /* Resource Conversion sub-opcodes */
116 
117 #define ACPI_RSC_COMPARE_AML_LENGTH 0
118 #define ACPI_RSC_COMPARE_VALUE 1
119 
120 #define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (ACPI_RSCONVERT_INFO))
121 
122 #define ACPI_RS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE,f)
123 #define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f)
124 
125 
126 /*
127  * Individual entry for the resource dump tables
128  */
129 typedef const struct acpi_rsdump_info
130 {
133  const char *Name;
134  const char **Pointer;
135 
137 
138 /* Values for the Opcode field above */
139 
140 typedef enum
141 {
161 
163 
164 /* restore default alignment */
165 
166 #pragma pack()
167 
168 
169 /* Resource tables indexed by internal resource type */
170 
171 extern const UINT8 AcpiGbl_AmlResourceSizes[];
174 
175 /* Resource tables indexed by raw AML resource descriptor type */
176 
177 extern const UINT8 AcpiGbl_ResourceStructSizes[];
180 
182 
183 typedef struct acpi_vendor_walk_info
184 {
188 
190 
191 
192 /*
193  * rscreate
194  */
197  ACPI_OPERAND_OBJECT *AmlBuffer,
199 
204 
207  ACPI_OPERAND_OBJECT *PackageObject,
209 
210 
211 /*
212  * rsutils
213  */
217  ACPI_BUFFER *RetBuffer);
218 
222  ACPI_BUFFER *RetBuffer);
223 
227  ACPI_BUFFER *RetBuffer);
228 
232  const char *Path,
233  ACPI_BUFFER *RetBuffer);
234 
238  ACPI_BUFFER *RetBuffer);
239 
243  ACPI_BUFFER *RetBuffer);
244 
245 /*
246  * rscalc
247  */
250  UINT8 *AmlBuffer,
252  ACPI_SIZE *SizeNeeded);
253 
257  ACPI_SIZE ResourceListSize,
258  ACPI_SIZE *SizeNeeded);
259 
262  ACPI_OPERAND_OBJECT *PackageObject,
263  ACPI_SIZE *BufferSizeNeeded);
264 
267  UINT8 *Aml,
268  UINT32 Length,
269  UINT32 Offset,
270  UINT8 ResourceIndex,
271  void **Context);
272 
276  ACPI_SIZE AmlSizeNeeded,
278 
279 
280 /*
281  * rsaddr
282  */
283 void
285  AML_RESOURCE *Aml,
287 
288 BOOLEAN
291  AML_RESOURCE *Aml);
292 
293 
294 /*
295  * rsmisc
296  */
300  AML_RESOURCE *Aml,
302 
306  AML_RESOURCE *Aml,
308 
309 
310 /*
311  * rsutils
312  */
313 void
315  void *Destination,
316  void *Source,
317  UINT16 ItemCount,
318  UINT8 MoveType);
319 
320 UINT8
322  UINT16 Mask,
323  UINT8 *List);
324 
325 UINT16
327  UINT8 *List,
328  UINT8 Count);
329 
332  ACPI_RS_LENGTH ResourceLength,
333  ACPI_RS_LENGTH MinimumLength,
334  ACPI_RESOURCE_SOURCE *ResourceSource,
335  AML_RESOURCE *Aml,
336  char *StringPtr);
337 
340  AML_RESOURCE *Aml,
341  ACPI_RS_LENGTH MinimumLength,
342  ACPI_RESOURCE_SOURCE *ResourceSource);
343 
344 void
348  AML_RESOURCE *Aml);
349 
350 void
353  AML_RESOURCE *Aml);
354 
355 
356 /*
357  * rsdump - Debugger support
358  */
359 #ifdef ACPI_DEBUGGER
360 void
363 
364 void
366  UINT8 *RouteTable);
367 #endif
368 
369 
370 /*
371  * Resource conversion tables
372  */
397 
398 /* These resources require separate get/set tables */
399 
404 
408 
409 
410 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
411 /*
412  * rsinfo
413  */
414 extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[];
415 extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[];
416 
417 /*
418  * rsdumpinfo
419  */
420 extern ACPI_RSDUMP_INFO AcpiRsDumpIrq[];
421 extern ACPI_RSDUMP_INFO AcpiRsDumpPrt[];
422 extern ACPI_RSDUMP_INFO AcpiRsDumpDma[];
423 extern ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[];
424 extern ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[];
425 extern ACPI_RSDUMP_INFO AcpiRsDumpIo[];
426 extern ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[];
427 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[];
428 extern ACPI_RSDUMP_INFO AcpiRsDumpVendor[];
429 extern ACPI_RSDUMP_INFO AcpiRsDumpEndTag[];
430 extern ACPI_RSDUMP_INFO AcpiRsDumpMemory24[];
431 extern ACPI_RSDUMP_INFO AcpiRsDumpMemory32[];
432 extern ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[];
433 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[];
434 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress16[];
435 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress32[];
436 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress64[];
437 extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[];
438 extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[];
439 extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[];
440 extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[];
441 extern ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[];
442 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[];
443 extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[];
444 extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[];
445 extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[];
446 extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[];
447 extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[];
448 extern ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[];
449 extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[];
450 extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[];
451 extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[];
452 #endif
453 
454 #endif /* __ACRESRC_H__ */
ACPI_RSCONVERT_INFO AcpiRsConvertFixedMemory32[]
Definition: rsmemory.c:126
ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[]
Definition: rsserial.c:412
ACPI_STATUS AcpiRsConvertAmlToResources(UINT8 *Aml, UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, void **Context)
Definition: rslist.c:68
ACPI_RS_LENGTH AcpiRsGetResourceSource(ACPI_RS_LENGTH ResourceLength, ACPI_RS_LENGTH MinimumLength, ACPI_RESOURCE_SOURCE *ResourceSource, AML_RESOURCE *Aml, char *StringPtr)
Definition: rsutils.c:366
ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[]
Definition: rsserial.c:596
ACPI_STATUS AcpiRsCreateAmlResources(ACPI_BUFFER *ResourceList, ACPI_BUFFER *OutputBuffer)
Definition: rscreate.c:458
ACPI_RSCONVERT_INFO AcpiRsGetIrq[]
Definition: rsirq.c:58
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING _Out_opt_ PULONG BufferSizeNeeded
Definition: fltkernel.h:1117
ACPI_RSCONVERT_INFO * AcpiGbl_GetResourceDispatch[]
Definition: rsinfo.c:96
const UINT8 AcpiGbl_AmlResourceSerialBusSizes[]
Definition: rsinfo.c:273
void AcpiRsMoveData(void *Destination, void *Source, UINT16 ItemCount, UINT8 MoveType)
Definition: rsutils.c:150
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[]
Definition: rsaddr.c:178
UINT16 AcpiRsEncodeBitmask(UINT8 *List, UINT8 Count)
Definition: rsutils.c:110
ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[]
Definition: rsserial.c:228
void AcpiRsSetAddressCommon(AML_RESOURCE *Aml, ACPI_RESOURCE *Resource)
Definition: rsaddr.c:381
UINT32 ACPI_STATUS
Definition: actypes.h:460
_In_ ULONG TotalLength
Definition: usbdlib.h:145
ACPI_RSCONVERT_INFO AcpiRsConvertDma[]
Definition: rsirq.c:258
ACPI_BUFFER * Buffer
Definition: acresrc.h:186
ACPI_STATUS Status
Definition: acresrc.h:187
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
ACPI_STATUS AcpiRsGetPrtMethodData(ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:521
struct TraceInfo Info
ACPI_RSCONVERT_INFO * AcpiGbl_ConvertResourceSerialBusDispatch[]
Definition: rsinfo.c:142
ACPI_RSCONVERT_INFO AcpiRsConvertGpio[]
Definition: rsserial.c:58
ACPI_RSCONVERT_INFO AcpiRsConvertFixedIo[]
Definition: rsio.c:96
BOOLEAN AcpiRsGetAddressCommon(ACPI_RESOURCE *Resource, AML_RESOURCE *Aml)
Definition: rsaddr.c:322
const UINT8 AcpiGbl_ResourceStructSizes[]
Definition: rsinfo.c:229
ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[]
Definition: rsio.c:241
void AcpiRsSetResourceHeader(UINT8 DescriptorType, ACPI_RSDESC_SIZE TotalLength, AML_RESOURCE *Aml)
Definition: rsutils.c:289
const char ** Pointer
Definition: acresrc.h:134
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:848
ACPI_RSCONVERT_INFO AcpiRsGetStartDpf[]
Definition: rsio.c:201
unsigned int UINT32
ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[]
Definition: rsirq.c:198
ACPI_STATUS AcpiRsConvertResourcesToAml(ACPI_RESOURCE *Resource, ACPI_SIZE AmlSizeNeeded, UINT8 *OutputBuffer)
Definition: rslist.c:173
ACPI_RSDESC_SIZE AcpiRsSetResourceSource(AML_RESOURCE *Aml, ACPI_RS_LENGTH MinimumLength, ACPI_RESOURCE_SOURCE *ResourceSource)
Definition: rsutils.c:457
ACPI_STATUS AcpiRsSetSrsMethodData(ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:800
const struct acpi_rsdump_info ACPI_RSDUMP_INFO
ACPI_RSCONVERT_INFO AcpiRsSetVendor[]
Definition: rsmemory.c:210
ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[]
Definition: rsaddr.c:58
unsigned char BOOLEAN
ACPI_RSCONVERT_INFO AcpiRsConvertEndTag[]
Definition: rsio.c:178
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[]
Definition: rsserial.c:312
ACPI_RSCONVERT_INFO AcpiRsGetVendorSmall[]
Definition: rsmemory.c:158
const UINT8 AcpiGbl_ResourceStructSerialBusSizes[]
Definition: rsinfo.c:281
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 AmlBufferLength
Definition: acpixf.h:1089
ACPI_STATUS AcpiRsGetCrsMethodData(ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:575
ACPI_RSCONVERT_INFO AcpiRsSetIrq[]
Definition: rsirq.c:112
_In_ HANDLE Handle
Definition: extypes.h:390
ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[]
Definition: rsserial.c:656
ACPI_STATUS AcpiRsCreateResourceList(ACPI_OPERAND_OBJECT *AmlBuffer, ACPI_BUFFER *OutputBuffer)
Definition: rscreate.c:151
ACPI_STATUS AcpiRsGetListLength(UINT8 *AmlBuffer, UINT32 AmlBufferLength, ACPI_SIZE *SizeNeeded)
Definition: rscalc.c:460
const char * Name
Definition: acresrc.h:133
LIST_ENTRY List
Definition: psmgr.c:57
void AcpiRsDumpResourceList(ACPI_RESOURCE *ResourceList)
Definition: rsdump.c:138
UINT8 AcpiRsDecodeBitmask(UINT16 Mask, UINT8 *List)
Definition: rsutils.c:68
ACPI_RSCONVERT_INFO * AcpiGbl_SetResourceDispatch[]
Definition: rsinfo.c:65
ACPI_STATUS AcpiRsGetAmlLength(ACPI_RESOURCE *ResourceList, ACPI_SIZE ResourceListSize, ACPI_SIZE *SizeNeeded)
Definition: rscalc.c:211
ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[]
Definition: rsserial.c:723
ACPI_STATUS AcpiRsCreatePciRoutingTable(ACPI_OPERAND_OBJECT *PackageObject, ACPI_BUFFER *OutputBuffer)
Definition: rscreate.c:234
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ACPI_STATUS AcpiRsGetAeiMethodData(ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:685
ACPI_RSCONVERT_INFO AcpiRsGetVendorLarge[]
Definition: rsmemory.c:184
const UINT8 AcpiGbl_AmlResourceSizes[]
Definition: rsinfo.c:199
ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[]
Definition: rsaddr.c:138
ACPI_STATUS AcpiRsGetPrsMethodData(ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:630
ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[]
Definition: rsaddr.c:98
UINT8 ResourceOffset
Definition: acresrc.h:70
ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[]
Definition: rsserial.c:155
ACPI_STATUS AcpiRsGetMethodData(ACPI_HANDLE Handle, const char *Path, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:741
PRTL_UNICODE_STRING_BUFFER Path
ACPI_VENDOR_UUID * Uuid
Definition: acresrc.h:185
ACPI_STATUS AcpiRsConvertAmlToResource(ACPI_RESOURCE *Resource, AML_RESOURCE *Aml, ACPI_RSCONVERT_INFO *Info)
Definition: rsmisc.c:77
ACPI_RSCONVERT_INFO AcpiRsConvertEndDpf[]
Definition: rsio.c:160
const struct acpi_rsconvert_info ACPI_RSCONVERT_INFO
unsigned short UINT16
UINT32 ACPI_RSDESC_SIZE
Definition: acrestyp.h:52
UINT16 ACPI_RS_LENGTH
Definition: acrestyp.h:51
ACPI_RSCONVERT_INFO AcpiRsConvertIo[]
Definition: rsio.c:58
ACPI_RSDUMP_OPCODES
Definition: acresrc.h:140
ACPI_STATUS AcpiRsConvertResourceToAml(ACPI_RESOURCE *Resource, AML_RESOURCE *Aml, ACPI_RSCONVERT_INFO *Info)
Definition: rsmisc.c:468
ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[]
Definition: rsserial.c:520
void AcpiRsSetResourceLength(ACPI_RSDESC_SIZE TotalLength, AML_RESOURCE *Aml)
Definition: rsutils.c:233
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[]
Definition: rsirq.c:296
ACPI_RSCONVERT_INFO AcpiRsConvertGenericReg[]
Definition: rsio.c:126
ACPI_RSCONVERT_INFO AcpiRsConvertMemory32[]
Definition: rsmemory.c:92
void AcpiRsDumpIrqList(UINT8 *RouteTable)
Definition: rsdump.c:219
unsigned char UINT8
_In_ ULONG _In_ PVOID _In_ LONG DescriptorType
Definition: usbdlib.h:145
ACPI_RSCONVERT_OPCODES
Definition: acresrc.h:78
ACPI_RSCONVERT_INFO AcpiRsConvertMemory24[]
Definition: rsmemory.c:58
ACPI_STATUS AcpiRsGetPciRoutingTableLength(ACPI_OPERAND_OBJECT *PackageObject, ACPI_SIZE *BufferSizeNeeded)
Definition: rscalc.c:746
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1287
Definition: dlist.c:348
struct acpi_vendor_walk_info ACPI_VENDOR_WALK_INFO