1 /*******************************************************************************
3 * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2011, 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.
45 #include <contrib/dev/acpica/include/acpi.h>
46 #include <contrib/dev/acpica/include/accommon.h>
47 #include <contrib/dev/acpica/include/acdisasm.h>
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 [Length & 1]);
81 /* Decode flags byte if present */
85 AcpiOsPrintf ("%s, %s, %s, ",
86 AcpiGbl_HeDecode [Resource->Irq.Flags & 1],
87 AcpiGbl_LlDecode [(Resource->Irq.Flags >> 3) & 1],
88 AcpiGbl_ShrDecode [(Resource->Irq.Flags >> 4) & 1]);
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 [(Resource->Dma.Flags >> 5) & 3],
125 AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1],
126 AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]);
128 /* Insert a descriptor name */
130 AcpiDmDescriptorName ();
131 AcpiOsPrintf (")\n");
133 AcpiDmIndent (Level + 1);
134 AcpiDmBitList (Resource->Dma.DmaChannelMask);
138 /*******************************************************************************
140 * FUNCTION: AcpiDmIoDescriptor
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 an IO descriptor
150 ******************************************************************************/
154 AML_RESOURCE *Resource,
159 AcpiDmIndent (Level);
160 AcpiOsPrintf ("IO (%s,\n",
161 AcpiGbl_IoDecode [(Resource->Io.Flags & 1)]);
163 AcpiDmIndent (Level + 1);
164 AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
166 AcpiDmIndent (Level + 1);
167 AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
169 AcpiDmIndent (Level + 1);
170 AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
172 AcpiDmIndent (Level + 1);
173 AcpiDmDumpInteger8 (Resource->Io.AddressLength, "Length");
175 /* Insert a descriptor name */
177 AcpiDmIndent (Level + 1);
178 AcpiDmDescriptorName ();
179 AcpiOsPrintf (")\n");
183 /*******************************************************************************
185 * FUNCTION: AcpiDmFixedIoDescriptor
187 * PARAMETERS: Resource - Pointer to the resource descriptor
188 * Length - Length of the descriptor in bytes
189 * Level - Current source code indentation level
193 * DESCRIPTION: Decode a Fixed IO descriptor
195 ******************************************************************************/
198 AcpiDmFixedIoDescriptor (
199 AML_RESOURCE *Resource,
204 AcpiDmIndent (Level);
205 AcpiOsPrintf ("FixedIO (\n");
207 AcpiDmIndent (Level + 1);
208 AcpiDmDumpInteger16 (Resource->FixedIo.Address, "Address");
210 AcpiDmIndent (Level + 1);
211 AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length");
213 /* Insert a descriptor name */
215 AcpiDmIndent (Level + 1);
216 AcpiDmDescriptorName ();
217 AcpiOsPrintf (")\n");
221 /*******************************************************************************
223 * FUNCTION: AcpiDmStartDependentDescriptor
225 * PARAMETERS: Resource - Pointer to the resource descriptor
226 * Length - Length of the descriptor in bytes
227 * Level - Current source code indentation level
231 * DESCRIPTION: Decode a Start Dependendent functions descriptor
233 ******************************************************************************/
236 AcpiDmStartDependentDescriptor (
237 AML_RESOURCE *Resource,
242 AcpiDmIndent (Level);
246 AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
247 (UINT32) Resource->StartDpf.Flags & 3,
248 (UINT32) (Resource->StartDpf.Flags >> 2) & 3);
252 AcpiOsPrintf ("StartDependentFnNoPri ()\n");
255 AcpiDmIndent (Level);
256 AcpiOsPrintf ("{\n");
260 /*******************************************************************************
262 * FUNCTION: AcpiDmEndDependentDescriptor
264 * PARAMETERS: Resource - Pointer to the resource descriptor
265 * Length - Length of the descriptor in bytes
266 * Level - Current source code indentation level
270 * DESCRIPTION: Decode an End Dependent functions descriptor
272 ******************************************************************************/
275 AcpiDmEndDependentDescriptor (
276 AML_RESOURCE *Resource,
281 AcpiDmIndent (Level);
282 AcpiOsPrintf ("}\n");
283 AcpiDmIndent (Level);
284 AcpiOsPrintf ("EndDependentFn ()\n");
288 /*******************************************************************************
290 * FUNCTION: AcpiDmVendorSmallDescriptor
292 * PARAMETERS: Resource - Pointer to the resource descriptor
293 * Length - Length of the descriptor in bytes
294 * Level - Current source code indentation level
298 * DESCRIPTION: Decode a Vendor Small Descriptor
300 ******************************************************************************/
303 AcpiDmVendorSmallDescriptor (
304 AML_RESOURCE *Resource,
309 AcpiDmVendorCommon ("Short",
310 ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)),