1 /*******************************************************************************
3 * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2013, 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.
50 #ifdef ACPI_DISASSEMBLER
52 #define _COMPONENT ACPI_CA_DEBUGGER
53 ACPI_MODULE_NAME ("dbresrcs")
56 /*******************************************************************************
58 * FUNCTION: AcpiDmIrqDescriptor
60 * PARAMETERS: 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 AML_RESOURCE
*Resource
,
79 AcpiGbl_IrqDecode
[ACPI_GET_1BIT_FLAG (Length
)]);
81 /* Decode flags byte if present */
85 AcpiOsPrintf ("%s, %s, %s, ",
86 AcpiGbl_HeDecode
[ACPI_GET_1BIT_FLAG (Resource
->Irq
.Flags
)],
87 AcpiGbl_LlDecode
[ACPI_EXTRACT_1BIT_FLAG (Resource
->Irq
.Flags
, 3)],
88 AcpiGbl_ShrDecode
[ACPI_EXTRACT_2BIT_FLAG (Resource
->Irq
.Flags
, 4)]);
91 /* Insert a descriptor name */
93 AcpiDmDescriptorName ();
96 AcpiDmIndent (Level
+ 1);
97 AcpiDmBitList (Resource
->Irq
.IrqMask
);
101 /*******************************************************************************
103 * FUNCTION: AcpiDmDmaDescriptor
105 * PARAMETERS: Resource - Pointer to the resource descriptor
106 * Length - Length of the descriptor in bytes
107 * Level - Current source code indentation level
111 * DESCRIPTION: Decode a DMA descriptor
113 ******************************************************************************/
116 AcpiDmDmaDescriptor (
117 AML_RESOURCE
*Resource
,
122 AcpiDmIndent (Level
);
123 AcpiOsPrintf ("DMA (%s, %s, %s, ",
124 AcpiGbl_TypDecode
[ACPI_EXTRACT_2BIT_FLAG (Resource
->Dma
.Flags
, 5)],
125 AcpiGbl_BmDecode
[ACPI_EXTRACT_1BIT_FLAG (Resource
->Dma
.Flags
, 2)],
126 AcpiGbl_SizDecode
[ACPI_GET_2BIT_FLAG (Resource
->Dma
.Flags
)]);
128 /* Insert a descriptor name */
130 AcpiDmDescriptorName ();
131 AcpiOsPrintf (")\n");
133 AcpiDmIndent (Level
+ 1);
134 AcpiDmBitList (Resource
->Dma
.DmaChannelMask
);
138 /*******************************************************************************
140 * FUNCTION: AcpiDmFixedDmaDescriptor
142 * PARAMETERS: Resource - Pointer to the resource descriptor
143 * Length - Length of the descriptor in bytes
144 * Level - Current source code indentation level
148 * DESCRIPTION: Decode a FixedDMA descriptor
150 ******************************************************************************/
153 AcpiDmFixedDmaDescriptor (
154 AML_RESOURCE
*Resource
,
159 AcpiDmIndent (Level
);
160 AcpiOsPrintf ("FixedDMA (0x%4.4X, 0x%4.4X, ",
161 Resource
->FixedDma
.RequestLines
,
162 Resource
->FixedDma
.Channels
);
164 if (Resource
->FixedDma
.Width
<= 5)
166 AcpiOsPrintf ("%s, ",
167 AcpiGbl_DtsDecode
[Resource
->FixedDma
.Width
]);
171 AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ", Resource
->FixedDma
.Width
);
174 /* Insert a descriptor name */
176 AcpiDmDescriptorName ();
177 AcpiOsPrintf (")\n");
181 /*******************************************************************************
183 * FUNCTION: AcpiDmIoDescriptor
185 * PARAMETERS: Resource - Pointer to the resource descriptor
186 * Length - Length of the descriptor in bytes
187 * Level - Current source code indentation level
191 * DESCRIPTION: Decode an IO descriptor
193 ******************************************************************************/
197 AML_RESOURCE
*Resource
,
202 AcpiDmIndent (Level
);
203 AcpiOsPrintf ("IO (%s,\n",
204 AcpiGbl_IoDecode
[ACPI_GET_1BIT_FLAG (Resource
->Io
.Flags
)]);
206 AcpiDmIndent (Level
+ 1);
207 AcpiDmDumpInteger16 (Resource
->Io
.Minimum
, "Range Minimum");
209 AcpiDmIndent (Level
+ 1);
210 AcpiDmDumpInteger16 (Resource
->Io
.Maximum
, "Range Maximum");
212 AcpiDmIndent (Level
+ 1);
213 AcpiDmDumpInteger8 (Resource
->Io
.Alignment
, "Alignment");
215 AcpiDmIndent (Level
+ 1);
216 AcpiDmDumpInteger8 (Resource
->Io
.AddressLength
, "Length");
218 /* Insert a descriptor name */
220 AcpiDmIndent (Level
+ 1);
221 AcpiDmDescriptorName ();
222 AcpiOsPrintf (")\n");
226 /*******************************************************************************
228 * FUNCTION: AcpiDmFixedIoDescriptor
230 * PARAMETERS: Resource - Pointer to the resource descriptor
231 * Length - Length of the descriptor in bytes
232 * Level - Current source code indentation level
236 * DESCRIPTION: Decode a Fixed IO descriptor
238 ******************************************************************************/
241 AcpiDmFixedIoDescriptor (
242 AML_RESOURCE
*Resource
,
247 AcpiDmIndent (Level
);
248 AcpiOsPrintf ("FixedIO (\n");
250 AcpiDmIndent (Level
+ 1);
251 AcpiDmDumpInteger16 (Resource
->FixedIo
.Address
, "Address");
253 AcpiDmIndent (Level
+ 1);
254 AcpiDmDumpInteger8 (Resource
->FixedIo
.AddressLength
, "Length");
256 /* Insert a descriptor name */
258 AcpiDmIndent (Level
+ 1);
259 AcpiDmDescriptorName ();
260 AcpiOsPrintf (")\n");
264 /*******************************************************************************
266 * FUNCTION: AcpiDmStartDependentDescriptor
268 * PARAMETERS: Resource - Pointer to the resource descriptor
269 * Length - Length of the descriptor in bytes
270 * Level - Current source code indentation level
274 * DESCRIPTION: Decode a Start Dependendent functions descriptor
276 ******************************************************************************/
279 AcpiDmStartDependentDescriptor (
280 AML_RESOURCE
*Resource
,
285 AcpiDmIndent (Level
);
289 AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
290 (UINT32
) ACPI_GET_2BIT_FLAG (Resource
->StartDpf
.Flags
),
291 (UINT32
) ACPI_EXTRACT_2BIT_FLAG (Resource
->StartDpf
.Flags
, 2));
295 AcpiOsPrintf ("StartDependentFnNoPri ()\n");
298 AcpiDmIndent (Level
);
299 AcpiOsPrintf ("{\n");
303 /*******************************************************************************
305 * FUNCTION: AcpiDmEndDependentDescriptor
307 * PARAMETERS: Resource - Pointer to the resource descriptor
308 * Length - Length of the descriptor in bytes
309 * Level - Current source code indentation level
313 * DESCRIPTION: Decode an End Dependent functions descriptor
315 ******************************************************************************/
318 AcpiDmEndDependentDescriptor (
319 AML_RESOURCE
*Resource
,
324 AcpiDmIndent (Level
);
325 AcpiOsPrintf ("}\n");
326 AcpiDmIndent (Level
);
327 AcpiOsPrintf ("EndDependentFn ()\n");
331 /*******************************************************************************
333 * FUNCTION: AcpiDmVendorSmallDescriptor
335 * PARAMETERS: Resource - Pointer to the resource descriptor
336 * Length - Length of the descriptor in bytes
337 * Level - Current source code indentation level
341 * DESCRIPTION: Decode a Vendor Small Descriptor
343 ******************************************************************************/
346 AcpiDmVendorSmallDescriptor (
347 AML_RESOURCE
*Resource
,
352 AcpiDmVendorCommon ("Short",
353 ACPI_ADD_PTR (UINT8
, Resource
, sizeof (AML_RESOURCE_SMALL_HEADER
)),