1 /******************************************************************************
3 * Name: acresrc.h - Resource Manager function prototypes
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
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.
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.
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.
47 /* Need the AML resource descriptor structs */
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:
57 * 1) Hardware does not support misaligned memory transfers
58 * 2) Compiler does not support pointers within packed structures
60 #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
65 * Individual entry for the resource conversion tables
67 typedef const struct acpi_rsconvert_info
74 } ACPI_RSCONVERT_INFO
;
76 /* Resource conversion opcodes */
91 ACPI_RSC_COUNT_GPIO_PIN
,
92 ACPI_RSC_COUNT_GPIO_RES
,
93 ACPI_RSC_COUNT_GPIO_VEN
,
94 ACPI_RSC_COUNT_SERIAL_RES
,
95 ACPI_RSC_COUNT_SERIAL_VEN
,
101 ACPI_RSC_MOVE_GPIO_PIN
,
102 ACPI_RSC_MOVE_GPIO_RES
,
103 ACPI_RSC_MOVE_SERIAL_RES
,
104 ACPI_RSC_MOVE_SERIAL_VEN
,
113 } ACPI_RSCONVERT_OPCODES
;
115 /* Resource Conversion sub-opcodes */
117 #define ACPI_RSC_COMPARE_AML_LENGTH 0
118 #define ACPI_RSC_COMPARE_VALUE 1
120 #define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (ACPI_RSCONVERT_INFO))
122 #define ACPI_RS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE,f)
123 #define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f)
127 * Individual entry for the resource dump tables
129 typedef const struct acpi_rsdump_info
134 const char **Pointer
;
138 /* Values for the Opcode field above */
160 } ACPI_RSDUMP_OPCODES
;
162 /* restore default alignment */
167 /* Resource tables indexed by internal resource type */
169 extern const UINT8 AcpiGbl_AmlResourceSizes
[];
170 extern const UINT8 AcpiGbl_AmlResourceSerialBusSizes
[];
171 extern ACPI_RSCONVERT_INFO
*AcpiGbl_SetResourceDispatch
[];
173 /* Resource tables indexed by raw AML resource descriptor type */
175 extern const UINT8 AcpiGbl_ResourceStructSizes
[];
176 extern const UINT8 AcpiGbl_ResourceStructSerialBusSizes
[];
177 extern ACPI_RSCONVERT_INFO
*AcpiGbl_GetResourceDispatch
[];
179 extern ACPI_RSCONVERT_INFO
*AcpiGbl_ConvertResourceSerialBusDispatch
[];
181 typedef struct acpi_vendor_walk_info
183 ACPI_VENDOR_UUID
*Uuid
;
187 } ACPI_VENDOR_WALK_INFO
;
194 AcpiRsCreateResourceList (
195 ACPI_OPERAND_OBJECT
*AmlBuffer
,
196 ACPI_BUFFER
*OutputBuffer
);
199 AcpiRsCreateAmlResources (
200 ACPI_BUFFER
*ResourceList
,
201 ACPI_BUFFER
*OutputBuffer
);
204 AcpiRsCreatePciRoutingTable (
205 ACPI_OPERAND_OBJECT
*PackageObject
,
206 ACPI_BUFFER
*OutputBuffer
);
213 AcpiRsGetPrtMethodData (
214 ACPI_NAMESPACE_NODE
*Node
,
215 ACPI_BUFFER
*RetBuffer
);
218 AcpiRsGetCrsMethodData (
219 ACPI_NAMESPACE_NODE
*Node
,
220 ACPI_BUFFER
*RetBuffer
);
223 AcpiRsGetPrsMethodData (
224 ACPI_NAMESPACE_NODE
*Node
,
225 ACPI_BUFFER
*RetBuffer
);
228 AcpiRsGetMethodData (
231 ACPI_BUFFER
*RetBuffer
);
234 AcpiRsSetSrsMethodData (
235 ACPI_NAMESPACE_NODE
*Node
,
236 ACPI_BUFFER
*RetBuffer
);
239 AcpiRsGetAeiMethodData (
240 ACPI_NAMESPACE_NODE
*Node
,
241 ACPI_BUFFER
*RetBuffer
);
247 AcpiRsGetListLength (
249 UINT32 AmlBufferLength
,
250 ACPI_SIZE
*SizeNeeded
);
254 ACPI_RESOURCE
*ResourceList
,
255 ACPI_SIZE ResourceListSize
,
256 ACPI_SIZE
*SizeNeeded
);
259 AcpiRsGetPciRoutingTableLength (
260 ACPI_OPERAND_OBJECT
*PackageObject
,
261 ACPI_SIZE
*BufferSizeNeeded
);
264 AcpiRsConvertAmlToResources (
272 AcpiRsConvertResourcesToAml (
273 ACPI_RESOURCE
*Resource
,
274 ACPI_SIZE AmlSizeNeeded
,
275 UINT8
*OutputBuffer
);
282 AcpiRsSetAddressCommon (
284 ACPI_RESOURCE
*Resource
);
287 AcpiRsGetAddressCommon (
288 ACPI_RESOURCE
*Resource
,
296 AcpiRsConvertAmlToResource (
297 ACPI_RESOURCE
*Resource
,
299 ACPI_RSCONVERT_INFO
*Info
);
302 AcpiRsConvertResourceToAml (
303 ACPI_RESOURCE
*Resource
,
305 ACPI_RSCONVERT_INFO
*Info
);
319 AcpiRsDecodeBitmask (
324 AcpiRsEncodeBitmask (
329 AcpiRsGetResourceSource (
330 ACPI_RS_LENGTH ResourceLength
,
331 ACPI_RS_LENGTH MinimumLength
,
332 ACPI_RESOURCE_SOURCE
*ResourceSource
,
337 AcpiRsSetResourceSource (
339 ACPI_RS_LENGTH MinimumLength
,
340 ACPI_RESOURCE_SOURCE
*ResourceSource
);
343 AcpiRsSetResourceHeader (
344 UINT8 DescriptorType
,
345 ACPI_RSDESC_SIZE TotalLength
,
349 AcpiRsSetResourceLength (
350 ACPI_RSDESC_SIZE TotalLength
,
355 * rsdump - Debugger support
359 AcpiRsDumpResourceList (
360 ACPI_RESOURCE
*Resource
);
369 * Resource conversion tables
371 extern ACPI_RSCONVERT_INFO AcpiRsConvertDma
[];
372 extern ACPI_RSCONVERT_INFO AcpiRsConvertEndDpf
[];
373 extern ACPI_RSCONVERT_INFO AcpiRsConvertIo
[];
374 extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedIo
[];
375 extern ACPI_RSCONVERT_INFO AcpiRsConvertEndTag
[];
376 extern ACPI_RSCONVERT_INFO AcpiRsConvertMemory24
[];
377 extern ACPI_RSCONVERT_INFO AcpiRsConvertGenericReg
[];
378 extern ACPI_RSCONVERT_INFO AcpiRsConvertMemory32
[];
379 extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedMemory32
[];
380 extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress32
[];
381 extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress16
[];
382 extern ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq
[];
383 extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress64
[];
384 extern ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64
[];
385 extern ACPI_RSCONVERT_INFO AcpiRsConvertGpio
[];
386 extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma
[];
387 extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus
[];
388 extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus
[];
389 extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus
[];
391 /* These resources require separate get/set tables */
393 extern ACPI_RSCONVERT_INFO AcpiRsGetIrq
[];
394 extern ACPI_RSCONVERT_INFO AcpiRsGetStartDpf
[];
395 extern ACPI_RSCONVERT_INFO AcpiRsGetVendorSmall
[];
396 extern ACPI_RSCONVERT_INFO AcpiRsGetVendorLarge
[];
398 extern ACPI_RSCONVERT_INFO AcpiRsSetIrq
[];
399 extern ACPI_RSCONVERT_INFO AcpiRsSetStartDpf
[];
400 extern ACPI_RSCONVERT_INFO AcpiRsSetVendor
[];
403 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
407 extern ACPI_RSDUMP_INFO
*AcpiGbl_DumpResourceDispatch
[];
408 extern ACPI_RSDUMP_INFO
*AcpiGbl_DumpSerialBusDispatch
[];
413 extern ACPI_RSDUMP_INFO AcpiRsDumpIrq
[];
414 extern ACPI_RSDUMP_INFO AcpiRsDumpPrt
[];
415 extern ACPI_RSDUMP_INFO AcpiRsDumpDma
[];
416 extern ACPI_RSDUMP_INFO AcpiRsDumpStartDpf
[];
417 extern ACPI_RSDUMP_INFO AcpiRsDumpEndDpf
[];
418 extern ACPI_RSDUMP_INFO AcpiRsDumpIo
[];
419 extern ACPI_RSDUMP_INFO AcpiRsDumpIoFlags
[];
420 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedIo
[];
421 extern ACPI_RSDUMP_INFO AcpiRsDumpVendor
[];
422 extern ACPI_RSDUMP_INFO AcpiRsDumpEndTag
[];
423 extern ACPI_RSDUMP_INFO AcpiRsDumpMemory24
[];
424 extern ACPI_RSDUMP_INFO AcpiRsDumpMemory32
[];
425 extern ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags
[];
426 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32
[];
427 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress16
[];
428 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress32
[];
429 extern ACPI_RSDUMP_INFO AcpiRsDumpAddress64
[];
430 extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64
[];
431 extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq
[];
432 extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg
[];
433 extern ACPI_RSDUMP_INFO AcpiRsDumpGpio
[];
434 extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma
[];
435 extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus
[];
436 extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus
[];
437 extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus
[];
438 extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus
[];
439 extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags
[];
442 #endif /* __ACRESRC_H__ */