ReactOS  0.4.15-dev-5499-g1341c38
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 - 2022, 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 MERCHANTABILITY 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 {
113 
115 
116 /* Resource Conversion sub-opcodes */
117 
118 #define ACPI_RSC_COMPARE_AML_LENGTH 0
119 #define ACPI_RSC_COMPARE_VALUE 1
120 
121 #define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (ACPI_RSCONVERT_INFO))
122 
123 #define ACPI_RS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE,f)
124 #define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f)
125 
126 
127 /*
128  * Individual entry for the resource dump tables
129  */
130 typedef const struct acpi_rsdump_info
131 {
134  const char *Name;
135  const char **Pointer;
136 
138 
139 /* Values for the Opcode field above */
140 
141 typedef enum
142 {
163 
165 
166 /* restore default alignment */
167 
168 #pragma pack()
169 
170 
171 /* Resource tables indexed by internal resource type */
172 
173 extern const UINT8 AcpiGbl_AmlResourceSizes[];
176 
177 /* Resource tables indexed by raw AML resource descriptor type */
178 
179 extern const UINT8 AcpiGbl_ResourceStructSizes[];
182 
184 
185 typedef struct acpi_vendor_walk_info
186 {
190 
192 
193 
194 /*
195  * rscreate
196  */
199  ACPI_OPERAND_OBJECT *AmlBuffer,
201 
206 
209  ACPI_OPERAND_OBJECT *PackageObject,
211 
212 
213 /*
214  * rsutils
215  */
219  ACPI_BUFFER *RetBuffer);
220 
224  ACPI_BUFFER *RetBuffer);
225 
229  ACPI_BUFFER *RetBuffer);
230 
234  const char *Path,
235  ACPI_BUFFER *RetBuffer);
236 
240  ACPI_BUFFER *RetBuffer);
241 
245  ACPI_BUFFER *RetBuffer);
246 
247 /*
248  * rscalc
249  */
252  UINT8 *AmlBuffer,
254  ACPI_SIZE *SizeNeeded);
255 
259  ACPI_SIZE ResourceListSize,
260  ACPI_SIZE *SizeNeeded);
261 
264  ACPI_OPERAND_OBJECT *PackageObject,
265  ACPI_SIZE *BufferSizeNeeded);
266 
269  UINT8 *Aml,
270  UINT32 Length,
271  UINT32 Offset,
272  UINT8 ResourceIndex,
273  void **Context);
274 
278  ACPI_SIZE AmlSizeNeeded,
280 
281 
282 /*
283  * rsaddr
284  */
285 void
287  AML_RESOURCE *Aml,
289 
290 BOOLEAN
293  AML_RESOURCE *Aml);
294 
295 
296 /*
297  * rsmisc
298  */
302  AML_RESOURCE *Aml,
304 
308  AML_RESOURCE *Aml,
310 
311 
312 /*
313  * rsutils
314  */
315 void
317  void *Destination,
318  void *Source,
319  UINT16 ItemCount,
320  UINT8 MoveType);
321 
322 UINT8
324  UINT16 Mask,
325  UINT8 *List);
326 
327 UINT16
329  UINT8 *List,
330  UINT8 Count);
331 
334  ACPI_RS_LENGTH ResourceLength,
335  ACPI_RS_LENGTH MinimumLength,
336  ACPI_RESOURCE_SOURCE *ResourceSource,
337  AML_RESOURCE *Aml,
338  char *StringPtr);
339 
342  AML_RESOURCE *Aml,
343  ACPI_RS_LENGTH MinimumLength,
344  ACPI_RESOURCE_SOURCE *ResourceSource);
345 
346 void
350  AML_RESOURCE *Aml);
351 
352 void
355  AML_RESOURCE *Aml);
356 
357 
358 /*
359  * rsdump - Debugger support
360  */
361 #ifdef ACPI_DEBUGGER
362 void
365 
366 void
368  UINT8 *RouteTable);
369 #endif
370 
371 
372 /*
373  * Resource conversion tables
374  */
400 
401 /* These resources require separate get/set tables */
402 
407 
411 
412 
413 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
414 /*
415  * rsinfo
416  */
417 extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[];
418 extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[];
419 
420 /*
421  * rsdumpinfo
422  */
423 extern ACPI_RSDUMP_INFO AcpiRsDumpIrq[];
424 extern ACPI_RSDUMP_INFO AcpiRsDumpPrt[];
425 extern ACPI_RSDUMP_INFO AcpiRsDumpDma[];
426 extern ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[];
427 extern ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[];
428 extern ACPI_RSDUMP_INFO AcpiRsDumpIo[];
429 extern ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[];
430 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[];
431 extern ACPI_RSDUMP_INFO AcpiRsDumpVendor[];
432 extern ACPI_RSDUMP_INFO AcpiRsDumpEndTag[];
433 extern ACPI_RSDUMP_INFO AcpiRsDumpMemory24[];
434 extern ACPI_RSDUMP_INFO AcpiRsDumpMemory32[];
435 extern ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[];
436 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[];
437 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress16[];
438 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress32[];
439 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress64[];
440 extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[];
441 extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[];
442 extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[];
443 extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[];
444 extern ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[];
445 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[];
446 extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[];
447 extern ACPI_RSDUMP_INFO AcpiRsDumpCsi2SerialBus[];
448 extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[];
449 extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[];
450 extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[];
451 extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[];
452 extern ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[];
453 extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[];
454 extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[];
455 extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[];
456 #endif
457 
458 #endif /* __ACRESRC_H__ */
ACPI_RSCONVERT_INFO AcpiRsConvertFixedMemory32[]
Definition: rsmemory.c:126
ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[]
Definition: rsserial.c:482
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:666
ACPI_STATUS AcpiRsCreateAmlResources(ACPI_BUFFER *ResourceList, ACPI_BUFFER *OutputBuffer)
Definition: rscreate.c:462
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
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
ACPI_RSCONVERT_INFO AcpiRsConvertCsi2SerialBus[]
Definition: rsserial.c:228
const UINT8 AcpiGbl_AmlResourceSerialBusSizes[]
Definition: rsinfo.c:275
void AcpiRsMoveData(void *Destination, void *Source, UINT16 ItemCount, UINT8 MoveType)
Definition: rsutils.c:150
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:298
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:158
ACPI_RSCONVERT_INFO AcpiRsConvertDma[]
Definition: rsirq.c:258
ACPI_BUFFER * Buffer
Definition: acresrc.h:188
ACPI_STATUS Status
Definition: acresrc.h:189
ACPI_STATUS AcpiRsGetPrtMethodData(ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:521
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
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:231
ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[]
Definition: rsio.c:241
void AcpiRsSetResourceHeader(UINT8 DescriptorType, ACPI_RSDESC_SIZE TotalLength, AML_RESOURCE *Aml)
Definition: rsutils.c:289
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
const char ** Pointer
Definition: acresrc.h:135
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
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:179
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
ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[]
Definition: rsserial.c:382
ACPI_RSCONVERT_INFO AcpiRsGetVendorSmall[]
Definition: rsmemory.c:158
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:859
const UINT8 AcpiGbl_ResourceStructSerialBusSizes[]
Definition: rsinfo.c:284
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 AmlBufferLength
Definition: acpixf.h:1103
ACPI_STATUS AcpiRsGetCrsMethodData(ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer)
Definition: rsutils.c:575
ACPI_RSCONVERT_INFO AcpiRsSetIrq[]
Definition: rsirq.c:112
ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[]
Definition: rsserial.c:726
int Count
Definition: noreturn.cpp:7
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:134
void AcpiRsDumpResourceList(ACPI_RESOURCE *ResourceList)
Definition: rsdump.c:138
unsigned int Mask
Definition: fpcontrol.c:82
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:793
ACPI_STATUS AcpiRsCreatePciRoutingTable(ACPI_OPERAND_OBJECT *PackageObject, ACPI_BUFFER *OutputBuffer)
Definition: rscreate.c:234
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2991
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:201
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
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
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
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:187
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:141
_In_ HANDLE Handle
Definition: extypes.h:390
ACPI_STATUS AcpiRsConvertResourceToAml(ACPI_RESOURCE *Resource, AML_RESOURCE *Aml, ACPI_RSCONVERT_INFO *Info)
Definition: rsmisc.c:478
ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[]
Definition: rsserial.c:590
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:224
unsigned char UINT8
_In_ ULONG _In_ PVOID _In_ LONG DescriptorType
Definition: usbdlib.h:158
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:1301
Definition: dlist.c:348
struct acpi_vendor_walk_info ACPI_VENDOR_WALK_INFO