1 /*******************************************************************************
3 * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2015, 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.
49 #ifdef ACPI_DISASSEMBLER
51 #define _COMPONENT ACPI_CA_DEBUGGER
52 ACPI_MODULE_NAME ("dbresrcs")
55 /*******************************************************************************
57 * FUNCTION: AcpiDmIrqDescriptor
59 * PARAMETERS: Info - Extra resource info
60 * Resource - Pointer to the resource descriptor
61 * Length - Length of the descriptor in bytes
62 * Level - Current source code indentation level
66 * DESCRIPTION: Decode a IRQ descriptor, either Irq() or IrqNoFlags()
68 ******************************************************************************/
72 ACPI_OP_WALK_INFO *Info,
73 AML_RESOURCE *Resource,
80 AcpiGbl_IrqDecode [ACPI_GET_1BIT_FLAG (Length)]);
82 /* Decode flags byte if present */
86 AcpiOsPrintf ("%s, %s, %s, ",
87 AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Irq.Flags)],
88 AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Irq.Flags, 3)],
89 AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Irq.Flags, 4)]);
92 /* Insert a descriptor name */
94 AcpiDmDescriptorName ();
97 AcpiDmIndent (Level + 1);
98 AcpiDmBitList (Resource->Irq.IrqMask);
102 /*******************************************************************************
104 * FUNCTION: AcpiDmDmaDescriptor
106 * PARAMETERS: Info - Extra resource info
107 * Resource - Pointer to the resource descriptor
108 * Length - Length of the descriptor in bytes
109 * Level - Current source code indentation level
113 * DESCRIPTION: Decode a DMA descriptor
115 ******************************************************************************/
118 AcpiDmDmaDescriptor (
119 ACPI_OP_WALK_INFO *Info,
120 AML_RESOURCE *Resource,
125 AcpiDmIndent (Level);
126 AcpiOsPrintf ("DMA (%s, %s, %s, ",
127 AcpiGbl_TypDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Dma.Flags, 5)],
128 AcpiGbl_BmDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Dma.Flags, 2)],
129 AcpiGbl_SizDecode [ACPI_GET_2BIT_FLAG (Resource->Dma.Flags)]);
131 /* Insert a descriptor name */
133 AcpiDmDescriptorName ();
134 AcpiOsPrintf (")\n");
136 AcpiDmIndent (Level + 1);
137 AcpiDmBitList (Resource->Dma.DmaChannelMask);
141 /*******************************************************************************
143 * FUNCTION: AcpiDmFixedDmaDescriptor
145 * PARAMETERS: Info - Extra resource info
146 * Resource - Pointer to the resource descriptor
147 * Length - Length of the descriptor in bytes
148 * Level - Current source code indentation level
152 * DESCRIPTION: Decode a FixedDMA descriptor
154 ******************************************************************************/
157 AcpiDmFixedDmaDescriptor (
158 ACPI_OP_WALK_INFO *Info,
159 AML_RESOURCE *Resource,
164 AcpiDmIndent (Level);
165 AcpiOsPrintf ("FixedDMA (0x%4.4X, 0x%4.4X, ",
166 Resource->FixedDma.RequestLines,
167 Resource->FixedDma.Channels);
169 if (Resource->FixedDma.Width <= 5)
171 AcpiOsPrintf ("%s, ",
172 AcpiGbl_DtsDecode [Resource->FixedDma.Width]);
176 AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ",
177 Resource->FixedDma.Width);
180 /* Insert a descriptor name */
182 AcpiDmDescriptorName ();
183 AcpiOsPrintf (")\n");
187 /*******************************************************************************
189 * FUNCTION: AcpiDmIoDescriptor
191 * PARAMETERS: Info - Extra resource info
192 * Resource - Pointer to the resource descriptor
193 * Length - Length of the descriptor in bytes
194 * Level - Current source code indentation level
198 * DESCRIPTION: Decode an IO descriptor
200 ******************************************************************************/
204 ACPI_OP_WALK_INFO *Info,
205 AML_RESOURCE *Resource,
210 AcpiDmIndent (Level);
211 AcpiOsPrintf ("IO (%s,\n",
212 AcpiGbl_IoDecode [ACPI_GET_1BIT_FLAG (Resource->Io.Flags)]);
214 AcpiDmIndent (Level + 1);
215 AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
217 AcpiDmIndent (Level + 1);
218 AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
220 AcpiDmIndent (Level + 1);
221 AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
223 AcpiDmIndent (Level + 1);
224 AcpiDmDumpInteger8 (Resource->Io.AddressLength, "Length");
226 /* Insert a descriptor name */
228 AcpiDmIndent (Level + 1);
229 AcpiDmDescriptorName ();
230 AcpiOsPrintf (")\n");
234 /*******************************************************************************
236 * FUNCTION: AcpiDmFixedIoDescriptor
238 * PARAMETERS: Info - Extra resource info
239 * Resource - Pointer to the resource descriptor
240 * Length - Length of the descriptor in bytes
241 * Level - Current source code indentation level
245 * DESCRIPTION: Decode a Fixed IO descriptor
247 ******************************************************************************/
250 AcpiDmFixedIoDescriptor (
251 ACPI_OP_WALK_INFO *Info,
252 AML_RESOURCE *Resource,
257 AcpiDmIndent (Level);
258 AcpiOsPrintf ("FixedIO (\n");
260 AcpiDmIndent (Level + 1);
261 AcpiDmDumpInteger16 (Resource->FixedIo.Address, "Address");
263 AcpiDmIndent (Level + 1);
264 AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length");
266 /* Insert a descriptor name */
268 AcpiDmIndent (Level + 1);
269 AcpiDmDescriptorName ();
270 AcpiOsPrintf (")\n");
274 /*******************************************************************************
276 * FUNCTION: AcpiDmStartDependentDescriptor
278 * PARAMETERS: Info - Extra resource info
279 * Resource - Pointer to the resource descriptor
280 * Length - Length of the descriptor in bytes
281 * Level - Current source code indentation level
285 * DESCRIPTION: Decode a Start Dependendent functions descriptor
287 ******************************************************************************/
290 AcpiDmStartDependentDescriptor (
291 ACPI_OP_WALK_INFO *Info,
292 AML_RESOURCE *Resource,
297 AcpiDmIndent (Level);
301 AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
302 (UINT32) ACPI_GET_2BIT_FLAG (Resource->StartDpf.Flags),
303 (UINT32) ACPI_EXTRACT_2BIT_FLAG (Resource->StartDpf.Flags, 2));
307 AcpiOsPrintf ("StartDependentFnNoPri ()\n");
310 AcpiDmIndent (Level);
311 AcpiOsPrintf ("{\n");
315 /*******************************************************************************
317 * FUNCTION: AcpiDmEndDependentDescriptor
319 * PARAMETERS: Info - Extra resource info
320 * Resource - Pointer to the resource descriptor
321 * Length - Length of the descriptor in bytes
322 * Level - Current source code indentation level
326 * DESCRIPTION: Decode an End Dependent functions descriptor
328 ******************************************************************************/
331 AcpiDmEndDependentDescriptor (
332 ACPI_OP_WALK_INFO *Info,
333 AML_RESOURCE *Resource,
338 AcpiDmIndent (Level);
339 AcpiOsPrintf ("}\n");
340 AcpiDmIndent (Level);
341 AcpiOsPrintf ("EndDependentFn ()\n");
345 /*******************************************************************************
347 * FUNCTION: AcpiDmVendorSmallDescriptor
349 * PARAMETERS: Info - Extra resource info
350 * Resource - Pointer to the resource descriptor
351 * Length - Length of the descriptor in bytes
352 * Level - Current source code indentation level
356 * DESCRIPTION: Decode a Vendor Small Descriptor
358 ******************************************************************************/
361 AcpiDmVendorSmallDescriptor (
362 ACPI_OP_WALK_INFO *Info,
363 AML_RESOURCE *Resource,
368 AcpiDmVendorCommon ("Short",
369 ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)),