ReactOS 0.4.15-dev-7670-g69b08be
rsinfo.c
Go to the documentation of this file.
1/*******************************************************************************
2 *
3 * Module Name: rsinfo - Dispatch and Info tables
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#include "acpi.h"
45#include "accommon.h"
46#include "acresrc.h"
47
48#define _COMPONENT ACPI_RESOURCES
49 ACPI_MODULE_NAME ("rsinfo")
50
51/*
52 * Resource dispatch and information tables. Any new resource types (either
53 * Large or Small) must be reflected in each of these tables, so they are here
54 * in one place.
55 *
56 * The tables for Large descriptors are indexed by bits 6:0 of the AML
57 * descriptor type byte. The tables for Small descriptors are indexed by
58 * bits 6:3 of the descriptor byte. The tables for internal resource
59 * descriptors are indexed by the ACPI_RESOURCE_TYPE field.
60 */
61
62
63/* Dispatch table for resource-to-AML (Set Resource) conversion functions */
64
66{
67 AcpiRsSetIrq, /* 0x00, ACPI_RESOURCE_TYPE_IRQ */
68 AcpiRsConvertDma, /* 0x01, ACPI_RESOURCE_TYPE_DMA */
69 AcpiRsSetStartDpf, /* 0x02, ACPI_RESOURCE_TYPE_START_DEPENDENT */
70 AcpiRsConvertEndDpf, /* 0x03, ACPI_RESOURCE_TYPE_END_DEPENDENT */
71 AcpiRsConvertIo, /* 0x04, ACPI_RESOURCE_TYPE_IO */
72 AcpiRsConvertFixedIo, /* 0x05, ACPI_RESOURCE_TYPE_FIXED_IO */
73 AcpiRsSetVendor, /* 0x06, ACPI_RESOURCE_TYPE_VENDOR */
74 AcpiRsConvertEndTag, /* 0x07, ACPI_RESOURCE_TYPE_END_TAG */
75 AcpiRsConvertMemory24, /* 0x08, ACPI_RESOURCE_TYPE_MEMORY24 */
76 AcpiRsConvertMemory32, /* 0x09, ACPI_RESOURCE_TYPE_MEMORY32 */
77 AcpiRsConvertFixedMemory32, /* 0x0A, ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
78 AcpiRsConvertAddress16, /* 0x0B, ACPI_RESOURCE_TYPE_ADDRESS16 */
79 AcpiRsConvertAddress32, /* 0x0C, ACPI_RESOURCE_TYPE_ADDRESS32 */
80 AcpiRsConvertAddress64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */
81 AcpiRsConvertExtAddress64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
82 AcpiRsConvertExtIrq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
83 AcpiRsConvertGenericReg, /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
84 AcpiRsConvertGpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */
85 AcpiRsConvertFixedDma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */
86 NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */
87 AcpiRsConvertPinFunction, /* 0x14, ACPI_RESOURCE_TYPE_PIN_FUNCTION */
88 AcpiRsConvertPinConfig, /* 0x15, ACPI_RESOURCE_TYPE_PIN_CONFIG */
89 AcpiRsConvertPinGroup, /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */
90 AcpiRsConvertPinGroupFunction, /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
91 AcpiRsConvertPinGroupConfig, /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
92};
93
94/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
95
97{
98 /* Small descriptors */
99
100 NULL, /* 0x00, Reserved */
101 NULL, /* 0x01, Reserved */
102 NULL, /* 0x02, Reserved */
103 NULL, /* 0x03, Reserved */
104 AcpiRsGetIrq, /* 0x04, ACPI_RESOURCE_NAME_IRQ */
105 AcpiRsConvertDma, /* 0x05, ACPI_RESOURCE_NAME_DMA */
106 AcpiRsGetStartDpf, /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */
107 AcpiRsConvertEndDpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
108 AcpiRsConvertIo, /* 0x08, ACPI_RESOURCE_NAME_IO */
109 AcpiRsConvertFixedIo, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */
110 AcpiRsConvertFixedDma, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
111 NULL, /* 0x0B, Reserved */
112 NULL, /* 0x0C, Reserved */
113 NULL, /* 0x0D, Reserved */
114 AcpiRsGetVendorSmall, /* 0x0E, ACPI_RESOURCE_NAME_VENDOR_SMALL */
115 AcpiRsConvertEndTag, /* 0x0F, ACPI_RESOURCE_NAME_END_TAG */
116
117 /* Large descriptors */
118
119 NULL, /* 0x00, Reserved */
120 AcpiRsConvertMemory24, /* 0x01, ACPI_RESOURCE_NAME_MEMORY24 */
121 AcpiRsConvertGenericReg, /* 0x02, ACPI_RESOURCE_NAME_GENERIC_REGISTER */
122 NULL, /* 0x03, Reserved */
123 AcpiRsGetVendorLarge, /* 0x04, ACPI_RESOURCE_NAME_VENDOR_LARGE */
124 AcpiRsConvertMemory32, /* 0x05, ACPI_RESOURCE_NAME_MEMORY32 */
125 AcpiRsConvertFixedMemory32, /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY32 */
126 AcpiRsConvertAddress32, /* 0x07, ACPI_RESOURCE_NAME_ADDRESS32 */
127 AcpiRsConvertAddress16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */
128 AcpiRsConvertExtIrq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */
129 AcpiRsConvertAddress64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
130 AcpiRsConvertExtAddress64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
131 AcpiRsConvertGpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
132 AcpiRsConvertPinFunction, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */
133 NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */
134 AcpiRsConvertPinConfig, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */
135 AcpiRsConvertPinGroup, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
136 AcpiRsConvertPinGroupFunction, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
137 AcpiRsConvertPinGroupConfig, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
138};
139
140/* Subtype table for SerialBus -- I2C, SPI, UART, and CSI2 */
141
143{
144 NULL,
149};
150
151
152#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
153
154/* Dispatch table for resource dump functions */
155
156ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[] =
157{
158 AcpiRsDumpIrq, /* ACPI_RESOURCE_TYPE_IRQ */
159 AcpiRsDumpDma, /* ACPI_RESOURCE_TYPE_DMA */
160 AcpiRsDumpStartDpf, /* ACPI_RESOURCE_TYPE_START_DEPENDENT */
161 AcpiRsDumpEndDpf, /* ACPI_RESOURCE_TYPE_END_DEPENDENT */
162 AcpiRsDumpIo, /* ACPI_RESOURCE_TYPE_IO */
163 AcpiRsDumpFixedIo, /* ACPI_RESOURCE_TYPE_FIXED_IO */
164 AcpiRsDumpVendor, /* ACPI_RESOURCE_TYPE_VENDOR */
165 AcpiRsDumpEndTag, /* ACPI_RESOURCE_TYPE_END_TAG */
166 AcpiRsDumpMemory24, /* ACPI_RESOURCE_TYPE_MEMORY24 */
167 AcpiRsDumpMemory32, /* ACPI_RESOURCE_TYPE_MEMORY32 */
168 AcpiRsDumpFixedMemory32, /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
169 AcpiRsDumpAddress16, /* ACPI_RESOURCE_TYPE_ADDRESS16 */
170 AcpiRsDumpAddress32, /* ACPI_RESOURCE_TYPE_ADDRESS32 */
171 AcpiRsDumpAddress64, /* ACPI_RESOURCE_TYPE_ADDRESS64 */
172 AcpiRsDumpExtAddress64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
173 AcpiRsDumpExtIrq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
174 AcpiRsDumpGenericReg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
175 AcpiRsDumpGpio, /* ACPI_RESOURCE_TYPE_GPIO */
176 AcpiRsDumpFixedDma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */
177 NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
178 AcpiRsDumpPinFunction, /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
179 AcpiRsDumpPinConfig, /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
180 AcpiRsDumpPinGroup, /* ACPI_RESOURCE_TYPE_PIN_GROUP */
181 AcpiRsDumpPinGroupFunction, /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
182 AcpiRsDumpPinGroupConfig, /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
183};
184
185ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[] =
186{
187 NULL,
188 AcpiRsDumpI2cSerialBus, /* AML_RESOURCE_I2C_BUS_TYPE */
189 AcpiRsDumpSpiSerialBus, /* AML_RESOURCE_SPI_BUS_TYPE */
190 AcpiRsDumpUartSerialBus, /* AML_RESOURCE_UART_BUS_TYPE */
191 AcpiRsDumpCsi2SerialBus, /* AML_RESOURCE_CSI2_BUS_TYPE */
192};
193#endif
194
195
196/*
197 * Base sizes for external AML resource descriptors, indexed by internal type.
198 * Includes size of the descriptor header (1 byte for small descriptors,
199 * 3 bytes for large descriptors)
200 */
202{
203 sizeof (AML_RESOURCE_IRQ), /* ACPI_RESOURCE_TYPE_IRQ (optional Byte 3 always created) */
204 sizeof (AML_RESOURCE_DMA), /* ACPI_RESOURCE_TYPE_DMA */
205 sizeof (AML_RESOURCE_START_DEPENDENT), /* ACPI_RESOURCE_TYPE_START_DEPENDENT (optional Byte 1 always created) */
206 sizeof (AML_RESOURCE_END_DEPENDENT), /* ACPI_RESOURCE_TYPE_END_DEPENDENT */
207 sizeof (AML_RESOURCE_IO), /* ACPI_RESOURCE_TYPE_IO */
208 sizeof (AML_RESOURCE_FIXED_IO), /* ACPI_RESOURCE_TYPE_FIXED_IO */
209 sizeof (AML_RESOURCE_VENDOR_SMALL), /* ACPI_RESOURCE_TYPE_VENDOR */
210 sizeof (AML_RESOURCE_END_TAG), /* ACPI_RESOURCE_TYPE_END_TAG */
211 sizeof (AML_RESOURCE_MEMORY24), /* ACPI_RESOURCE_TYPE_MEMORY24 */
212 sizeof (AML_RESOURCE_MEMORY32), /* ACPI_RESOURCE_TYPE_MEMORY32 */
213 sizeof (AML_RESOURCE_FIXED_MEMORY32), /* ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
214 sizeof (AML_RESOURCE_ADDRESS16), /* ACPI_RESOURCE_TYPE_ADDRESS16 */
215 sizeof (AML_RESOURCE_ADDRESS32), /* ACPI_RESOURCE_TYPE_ADDRESS32 */
216 sizeof (AML_RESOURCE_ADDRESS64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */
217 sizeof (AML_RESOURCE_EXTENDED_ADDRESS64),/*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
218 sizeof (AML_RESOURCE_EXTENDED_IRQ), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
219 sizeof (AML_RESOURCE_GENERIC_REGISTER), /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
220 sizeof (AML_RESOURCE_GPIO), /* ACPI_RESOURCE_TYPE_GPIO */
221 sizeof (AML_RESOURCE_FIXED_DMA), /* ACPI_RESOURCE_TYPE_FIXED_DMA */
222 sizeof (AML_RESOURCE_COMMON_SERIALBUS), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
223 sizeof (AML_RESOURCE_PIN_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
224 sizeof (AML_RESOURCE_PIN_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
225 sizeof (AML_RESOURCE_PIN_GROUP), /* ACPI_RESOURCE_TYPE_PIN_GROUP */
226 sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
227 sizeof (AML_RESOURCE_PIN_GROUP_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
228};
229
230
232{
233 /* Small descriptors */
234
235 0,
236 0,
237 0,
238 0,
246 0,
247 0,
248 0,
251
252 /* Large descriptors */
253
254 0,
257 0,
273};
274
276{
277 0,
282};
283
285{
286 0,
291};
unsigned char UINT8
#define ACPI_MODULE_NAME(Name)
Definition: acoutput.h:216
ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[]
Definition: rsserial.c:590
ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[]
Definition: rsaddr.c:98
ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[]
Definition: rsirq.c:296
ACPI_RSCONVERT_INFO AcpiRsConvertEndDpf[]
Definition: rsio.c:160
ACPI_RSCONVERT_INFO AcpiRsGetIrq[]
Definition: rsirq.c:58
ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[]
Definition: rsserial.c:482
ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[]
Definition: rsserial.c:298
ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[]
Definition: rsaddr.c:138
ACPI_RSCONVERT_INFO AcpiRsConvertIo[]
Definition: rsio.c:58
ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[]
Definition: rsserial.c:382
ACPI_RSCONVERT_INFO AcpiRsGetVendorSmall[]
Definition: rsmemory.c:158
ACPI_RSCONVERT_INFO AcpiRsConvertGpio[]
Definition: rsserial.c:58
ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[]
Definition: rsaddr.c:178
ACPI_RSCONVERT_INFO AcpiRsConvertFixedIo[]
Definition: rsio.c:96
ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[]
Definition: rsserial.c:155
ACPI_RSCONVERT_INFO AcpiRsConvertMemory24[]
Definition: rsmemory.c:58
ACPI_RSCONVERT_INFO AcpiRsConvertCsi2SerialBus[]
Definition: rsserial.c:228
ACPI_RSCONVERT_INFO AcpiRsGetStartDpf[]
Definition: rsio.c:201
ACPI_RSCONVERT_INFO AcpiRsConvertGenericReg[]
Definition: rsio.c:126
ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[]
Definition: rsserial.c:793
ACPI_RSCONVERT_INFO AcpiRsGetVendorLarge[]
Definition: rsmemory.c:184
ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[]
Definition: rsserial.c:726
ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[]
Definition: rsirq.c:198
ACPI_RSCONVERT_INFO AcpiRsSetIrq[]
Definition: rsirq.c:112
ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[]
Definition: rsserial.c:666
ACPI_RSCONVERT_INFO AcpiRsConvertMemory32[]
Definition: rsmemory.c:92
ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[]
Definition: rsio.c:241
ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[]
Definition: rsaddr.c:58
ACPI_RSCONVERT_INFO AcpiRsSetVendor[]
Definition: rsmemory.c:210
ACPI_RSCONVERT_INFO AcpiRsConvertFixedMemory32[]
Definition: rsmemory.c:126
ACPI_RSCONVERT_INFO AcpiRsConvertDma[]
Definition: rsirq.c:258
ACPI_RSCONVERT_INFO AcpiRsConvertEndTag[]
Definition: rsio.c:178
#define ACPI_RS_SIZE_MIN
Definition: acrestyp.h:807
#define ACPI_RS_SIZE(Type)
Definition: acrestyp.h:808
struct aml_resource_pin_group AML_RESOURCE_PIN_GROUP
struct aml_resource_i2c_serialbus AML_RESOURCE_I2C_SERIALBUS
struct aml_resource_fixed_dma AML_RESOURCE_FIXED_DMA
struct aml_resource_generic_register AML_RESOURCE_GENERIC_REGISTER
struct aml_resource_extended_address64 AML_RESOURCE_EXTENDED_ADDRESS64
struct aml_resource_irq AML_RESOURCE_IRQ
struct aml_resource_io AML_RESOURCE_IO
struct aml_resource_uart_serialbus AML_RESOURCE_UART_SERIALBUS
struct aml_resource_vendor_small AML_RESOURCE_VENDOR_SMALL
struct aml_resource_address32 AML_RESOURCE_ADDRESS32
struct aml_resource_pin_function AML_RESOURCE_PIN_FUNCTION
struct aml_resource_fixed_memory32 AML_RESOURCE_FIXED_MEMORY32
struct aml_resource_memory24 AML_RESOURCE_MEMORY24
struct aml_resource_start_dependent AML_RESOURCE_START_DEPENDENT
struct aml_resource_pin_group_config AML_RESOURCE_PIN_GROUP_CONFIG
#define NULL
Definition: types.h:112
ACPI_RSCONVERT_INFO * AcpiGbl_ConvertResourceSerialBusDispatch[]
Definition: rsinfo.c:142
const UINT8 AcpiGbl_AmlResourceSizes[]
Definition: rsinfo.c:201
ACPI_RSCONVERT_INFO * AcpiGbl_SetResourceDispatch[]
Definition: rsinfo.c:65
const UINT8 AcpiGbl_ResourceStructSerialBusSizes[]
Definition: rsinfo.c:284
ACPI_RSCONVERT_INFO * AcpiGbl_GetResourceDispatch[]
Definition: rsinfo.c:96
const UINT8 AcpiGbl_AmlResourceSerialBusSizes[]
Definition: rsinfo.c:275
const UINT8 AcpiGbl_ResourceStructSizes[]
Definition: rsinfo.c:231