dmresrcs.c revision 1.1.1.2.2.2 1 1.1.1.2.2.2 bouyer /*******************************************************************************
2 1.1.1.2.2.2 bouyer *
3 1.1.1.2.2.2 bouyer * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
4 1.1.1.2.2.2 bouyer *
5 1.1.1.2.2.2 bouyer ******************************************************************************/
6 1.1.1.2.2.2 bouyer
7 1.1.1.2.2.2 bouyer /*
8 1.1.1.2.2.2 bouyer * Copyright (C) 2000 - 2011, Intel Corp.
9 1.1.1.2.2.2 bouyer * All rights reserved.
10 1.1.1.2.2.2 bouyer *
11 1.1.1.2.2.2 bouyer * Redistribution and use in source and binary forms, with or without
12 1.1.1.2.2.2 bouyer * modification, are permitted provided that the following conditions
13 1.1.1.2.2.2 bouyer * are met:
14 1.1.1.2.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
15 1.1.1.2.2.2 bouyer * notice, this list of conditions, and the following disclaimer,
16 1.1.1.2.2.2 bouyer * without modification.
17 1.1.1.2.2.2 bouyer * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1.1.2.2.2 bouyer * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1.1.2.2.2 bouyer * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1.1.2.2.2 bouyer * including a substantially similar Disclaimer requirement for further
21 1.1.1.2.2.2 bouyer * binary redistribution.
22 1.1.1.2.2.2 bouyer * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1.1.2.2.2 bouyer * of any contributors may be used to endorse or promote products derived
24 1.1.1.2.2.2 bouyer * from this software without specific prior written permission.
25 1.1.1.2.2.2 bouyer *
26 1.1.1.2.2.2 bouyer * Alternatively, this software may be distributed under the terms of the
27 1.1.1.2.2.2 bouyer * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1.1.2.2.2 bouyer * Software Foundation.
29 1.1.1.2.2.2 bouyer *
30 1.1.1.2.2.2 bouyer * NO WARRANTY
31 1.1.1.2.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1.1.2.2.2 bouyer * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1.1.2.2.2 bouyer * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1.1.2.2.2 bouyer * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1.1.2.2.2 bouyer * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1.1.2.2.2 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1.1.2.2.2 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1.1.2.2.2 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1.1.2.2.2 bouyer * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1.1.2.2.2 bouyer * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1.1.2.2.2 bouyer * POSSIBILITY OF SUCH DAMAGES.
42 1.1.1.2.2.2 bouyer */
43 1.1.1.2.2.2 bouyer
44 1.1.1.2.2.2 bouyer
45 1.1.1.2.2.2 bouyer #include "acpi.h"
46 1.1.1.2.2.2 bouyer #include "accommon.h"
47 1.1.1.2.2.2 bouyer #include "acdisasm.h"
48 1.1.1.2.2.2 bouyer
49 1.1.1.2.2.2 bouyer
50 1.1.1.2.2.2 bouyer #ifdef ACPI_DISASSEMBLER
51 1.1.1.2.2.2 bouyer
52 1.1.1.2.2.2 bouyer #define _COMPONENT ACPI_CA_DEBUGGER
53 1.1.1.2.2.2 bouyer ACPI_MODULE_NAME ("dbresrcs")
54 1.1.1.2.2.2 bouyer
55 1.1.1.2.2.2 bouyer
56 1.1.1.2.2.2 bouyer /*******************************************************************************
57 1.1.1.2.2.2 bouyer *
58 1.1.1.2.2.2 bouyer * FUNCTION: AcpiDmIrqDescriptor
59 1.1.1.2.2.2 bouyer *
60 1.1.1.2.2.2 bouyer * PARAMETERS: Resource - Pointer to the resource descriptor
61 1.1.1.2.2.2 bouyer * Length - Length of the descriptor in bytes
62 1.1.1.2.2.2 bouyer * Level - Current source code indentation level
63 1.1.1.2.2.2 bouyer *
64 1.1.1.2.2.2 bouyer * RETURN: None
65 1.1.1.2.2.2 bouyer *
66 1.1.1.2.2.2 bouyer * DESCRIPTION: Decode a IRQ descriptor, either Irq() or IrqNoFlags()
67 1.1.1.2.2.2 bouyer *
68 1.1.1.2.2.2 bouyer ******************************************************************************/
69 1.1.1.2.2.2 bouyer
70 1.1.1.2.2.2 bouyer void
71 1.1.1.2.2.2 bouyer AcpiDmIrqDescriptor (
72 1.1.1.2.2.2 bouyer AML_RESOURCE *Resource,
73 1.1.1.2.2.2 bouyer UINT32 Length,
74 1.1.1.2.2.2 bouyer UINT32 Level)
75 1.1.1.2.2.2 bouyer {
76 1.1.1.2.2.2 bouyer
77 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
78 1.1.1.2.2.2 bouyer AcpiOsPrintf ("%s (",
79 1.1.1.2.2.2 bouyer AcpiGbl_IrqDecode [Length & 1]);
80 1.1.1.2.2.2 bouyer
81 1.1.1.2.2.2 bouyer /* Decode flags byte if present */
82 1.1.1.2.2.2 bouyer
83 1.1.1.2.2.2 bouyer if (Length & 1)
84 1.1.1.2.2.2 bouyer {
85 1.1.1.2.2.2 bouyer AcpiOsPrintf ("%s, %s, %s, ",
86 1.1.1.2.2.2 bouyer AcpiGbl_HeDecode [Resource->Irq.Flags & 1],
87 1.1.1.2.2.2 bouyer AcpiGbl_LlDecode [(Resource->Irq.Flags >> 3) & 1],
88 1.1.1.2.2.2 bouyer AcpiGbl_ShrDecode [(Resource->Irq.Flags >> 4) & 1]);
89 1.1.1.2.2.2 bouyer }
90 1.1.1.2.2.2 bouyer
91 1.1.1.2.2.2 bouyer /* Insert a descriptor name */
92 1.1.1.2.2.2 bouyer
93 1.1.1.2.2.2 bouyer AcpiDmDescriptorName ();
94 1.1.1.2.2.2 bouyer AcpiOsPrintf (")\n");
95 1.1.1.2.2.2 bouyer
96 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
97 1.1.1.2.2.2 bouyer AcpiDmBitList (Resource->Irq.IrqMask);
98 1.1.1.2.2.2 bouyer }
99 1.1.1.2.2.2 bouyer
100 1.1.1.2.2.2 bouyer
101 1.1.1.2.2.2 bouyer /*******************************************************************************
102 1.1.1.2.2.2 bouyer *
103 1.1.1.2.2.2 bouyer * FUNCTION: AcpiDmDmaDescriptor
104 1.1.1.2.2.2 bouyer *
105 1.1.1.2.2.2 bouyer * PARAMETERS: Resource - Pointer to the resource descriptor
106 1.1.1.2.2.2 bouyer * Length - Length of the descriptor in bytes
107 1.1.1.2.2.2 bouyer * Level - Current source code indentation level
108 1.1.1.2.2.2 bouyer *
109 1.1.1.2.2.2 bouyer * RETURN: None
110 1.1.1.2.2.2 bouyer *
111 1.1.1.2.2.2 bouyer * DESCRIPTION: Decode a DMA descriptor
112 1.1.1.2.2.2 bouyer *
113 1.1.1.2.2.2 bouyer ******************************************************************************/
114 1.1.1.2.2.2 bouyer
115 1.1.1.2.2.2 bouyer void
116 1.1.1.2.2.2 bouyer AcpiDmDmaDescriptor (
117 1.1.1.2.2.2 bouyer AML_RESOURCE *Resource,
118 1.1.1.2.2.2 bouyer UINT32 Length,
119 1.1.1.2.2.2 bouyer UINT32 Level)
120 1.1.1.2.2.2 bouyer {
121 1.1.1.2.2.2 bouyer
122 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
123 1.1.1.2.2.2 bouyer AcpiOsPrintf ("DMA (%s, %s, %s, ",
124 1.1.1.2.2.2 bouyer AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3],
125 1.1.1.2.2.2 bouyer AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1],
126 1.1.1.2.2.2 bouyer AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]);
127 1.1.1.2.2.2 bouyer
128 1.1.1.2.2.2 bouyer /* Insert a descriptor name */
129 1.1.1.2.2.2 bouyer
130 1.1.1.2.2.2 bouyer AcpiDmDescriptorName ();
131 1.1.1.2.2.2 bouyer AcpiOsPrintf (")\n");
132 1.1.1.2.2.2 bouyer
133 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
134 1.1.1.2.2.2 bouyer AcpiDmBitList (Resource->Dma.DmaChannelMask);
135 1.1.1.2.2.2 bouyer }
136 1.1.1.2.2.2 bouyer
137 1.1.1.2.2.2 bouyer
138 1.1.1.2.2.2 bouyer /*******************************************************************************
139 1.1.1.2.2.2 bouyer *
140 1.1.1.2.2.2 bouyer * FUNCTION: AcpiDmIoDescriptor
141 1.1.1.2.2.2 bouyer *
142 1.1.1.2.2.2 bouyer * PARAMETERS: Resource - Pointer to the resource descriptor
143 1.1.1.2.2.2 bouyer * Length - Length of the descriptor in bytes
144 1.1.1.2.2.2 bouyer * Level - Current source code indentation level
145 1.1.1.2.2.2 bouyer *
146 1.1.1.2.2.2 bouyer * RETURN: None
147 1.1.1.2.2.2 bouyer *
148 1.1.1.2.2.2 bouyer * DESCRIPTION: Decode an IO descriptor
149 1.1.1.2.2.2 bouyer *
150 1.1.1.2.2.2 bouyer ******************************************************************************/
151 1.1.1.2.2.2 bouyer
152 1.1.1.2.2.2 bouyer void
153 1.1.1.2.2.2 bouyer AcpiDmIoDescriptor (
154 1.1.1.2.2.2 bouyer AML_RESOURCE *Resource,
155 1.1.1.2.2.2 bouyer UINT32 Length,
156 1.1.1.2.2.2 bouyer UINT32 Level)
157 1.1.1.2.2.2 bouyer {
158 1.1.1.2.2.2 bouyer
159 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
160 1.1.1.2.2.2 bouyer AcpiOsPrintf ("IO (%s,\n",
161 1.1.1.2.2.2 bouyer AcpiGbl_IoDecode [(Resource->Io.Flags & 1)]);
162 1.1.1.2.2.2 bouyer
163 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
164 1.1.1.2.2.2 bouyer AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
165 1.1.1.2.2.2 bouyer
166 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
167 1.1.1.2.2.2 bouyer AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
168 1.1.1.2.2.2 bouyer
169 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
170 1.1.1.2.2.2 bouyer AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
171 1.1.1.2.2.2 bouyer
172 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
173 1.1.1.2.2.2 bouyer AcpiDmDumpInteger8 (Resource->Io.AddressLength, "Length");
174 1.1.1.2.2.2 bouyer
175 1.1.1.2.2.2 bouyer /* Insert a descriptor name */
176 1.1.1.2.2.2 bouyer
177 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
178 1.1.1.2.2.2 bouyer AcpiDmDescriptorName ();
179 1.1.1.2.2.2 bouyer AcpiOsPrintf (")\n");
180 1.1.1.2.2.2 bouyer }
181 1.1.1.2.2.2 bouyer
182 1.1.1.2.2.2 bouyer
183 1.1.1.2.2.2 bouyer /*******************************************************************************
184 1.1.1.2.2.2 bouyer *
185 1.1.1.2.2.2 bouyer * FUNCTION: AcpiDmFixedIoDescriptor
186 1.1.1.2.2.2 bouyer *
187 1.1.1.2.2.2 bouyer * PARAMETERS: Resource - Pointer to the resource descriptor
188 1.1.1.2.2.2 bouyer * Length - Length of the descriptor in bytes
189 1.1.1.2.2.2 bouyer * Level - Current source code indentation level
190 1.1.1.2.2.2 bouyer *
191 1.1.1.2.2.2 bouyer * RETURN: None
192 1.1.1.2.2.2 bouyer *
193 1.1.1.2.2.2 bouyer * DESCRIPTION: Decode a Fixed IO descriptor
194 1.1.1.2.2.2 bouyer *
195 1.1.1.2.2.2 bouyer ******************************************************************************/
196 1.1.1.2.2.2 bouyer
197 1.1.1.2.2.2 bouyer void
198 1.1.1.2.2.2 bouyer AcpiDmFixedIoDescriptor (
199 1.1.1.2.2.2 bouyer AML_RESOURCE *Resource,
200 1.1.1.2.2.2 bouyer UINT32 Length,
201 1.1.1.2.2.2 bouyer UINT32 Level)
202 1.1.1.2.2.2 bouyer {
203 1.1.1.2.2.2 bouyer
204 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
205 1.1.1.2.2.2 bouyer AcpiOsPrintf ("FixedIO (\n");
206 1.1.1.2.2.2 bouyer
207 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
208 1.1.1.2.2.2 bouyer AcpiDmDumpInteger16 (Resource->FixedIo.Address, "Address");
209 1.1.1.2.2.2 bouyer
210 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
211 1.1.1.2.2.2 bouyer AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length");
212 1.1.1.2.2.2 bouyer
213 1.1.1.2.2.2 bouyer /* Insert a descriptor name */
214 1.1.1.2.2.2 bouyer
215 1.1.1.2.2.2 bouyer AcpiDmIndent (Level + 1);
216 1.1.1.2.2.2 bouyer AcpiDmDescriptorName ();
217 1.1.1.2.2.2 bouyer AcpiOsPrintf (")\n");
218 1.1.1.2.2.2 bouyer }
219 1.1.1.2.2.2 bouyer
220 1.1.1.2.2.2 bouyer
221 1.1.1.2.2.2 bouyer /*******************************************************************************
222 1.1.1.2.2.2 bouyer *
223 1.1.1.2.2.2 bouyer * FUNCTION: AcpiDmStartDependentDescriptor
224 1.1.1.2.2.2 bouyer *
225 1.1.1.2.2.2 bouyer * PARAMETERS: Resource - Pointer to the resource descriptor
226 1.1.1.2.2.2 bouyer * Length - Length of the descriptor in bytes
227 1.1.1.2.2.2 bouyer * Level - Current source code indentation level
228 1.1.1.2.2.2 bouyer *
229 1.1.1.2.2.2 bouyer * RETURN: None
230 1.1.1.2.2.2 bouyer *
231 1.1.1.2.2.2 bouyer * DESCRIPTION: Decode a Start Dependendent functions descriptor
232 1.1.1.2.2.2 bouyer *
233 1.1.1.2.2.2 bouyer ******************************************************************************/
234 1.1.1.2.2.2 bouyer
235 1.1.1.2.2.2 bouyer void
236 1.1.1.2.2.2 bouyer AcpiDmStartDependentDescriptor (
237 1.1.1.2.2.2 bouyer AML_RESOURCE *Resource,
238 1.1.1.2.2.2 bouyer UINT32 Length,
239 1.1.1.2.2.2 bouyer UINT32 Level)
240 1.1.1.2.2.2 bouyer {
241 1.1.1.2.2.2 bouyer
242 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
243 1.1.1.2.2.2 bouyer
244 1.1.1.2.2.2 bouyer if (Length & 1)
245 1.1.1.2.2.2 bouyer {
246 1.1.1.2.2.2 bouyer AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
247 1.1.1.2.2.2 bouyer (UINT32) Resource->StartDpf.Flags & 3,
248 1.1.1.2.2.2 bouyer (UINT32) (Resource->StartDpf.Flags >> 2) & 3);
249 1.1.1.2.2.2 bouyer }
250 1.1.1.2.2.2 bouyer else
251 1.1.1.2.2.2 bouyer {
252 1.1.1.2.2.2 bouyer AcpiOsPrintf ("StartDependentFnNoPri ()\n");
253 1.1.1.2.2.2 bouyer }
254 1.1.1.2.2.2 bouyer
255 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
256 1.1.1.2.2.2 bouyer AcpiOsPrintf ("{\n");
257 1.1.1.2.2.2 bouyer }
258 1.1.1.2.2.2 bouyer
259 1.1.1.2.2.2 bouyer
260 1.1.1.2.2.2 bouyer /*******************************************************************************
261 1.1.1.2.2.2 bouyer *
262 1.1.1.2.2.2 bouyer * FUNCTION: AcpiDmEndDependentDescriptor
263 1.1.1.2.2.2 bouyer *
264 1.1.1.2.2.2 bouyer * PARAMETERS: Resource - Pointer to the resource descriptor
265 1.1.1.2.2.2 bouyer * Length - Length of the descriptor in bytes
266 1.1.1.2.2.2 bouyer * Level - Current source code indentation level
267 1.1.1.2.2.2 bouyer *
268 1.1.1.2.2.2 bouyer * RETURN: None
269 1.1.1.2.2.2 bouyer *
270 1.1.1.2.2.2 bouyer * DESCRIPTION: Decode an End Dependent functions descriptor
271 1.1.1.2.2.2 bouyer *
272 1.1.1.2.2.2 bouyer ******************************************************************************/
273 1.1.1.2.2.2 bouyer
274 1.1.1.2.2.2 bouyer void
275 1.1.1.2.2.2 bouyer AcpiDmEndDependentDescriptor (
276 1.1.1.2.2.2 bouyer AML_RESOURCE *Resource,
277 1.1.1.2.2.2 bouyer UINT32 Length,
278 1.1.1.2.2.2 bouyer UINT32 Level)
279 1.1.1.2.2.2 bouyer {
280 1.1.1.2.2.2 bouyer
281 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
282 1.1.1.2.2.2 bouyer AcpiOsPrintf ("}\n");
283 1.1.1.2.2.2 bouyer AcpiDmIndent (Level);
284 1.1.1.2.2.2 bouyer AcpiOsPrintf ("EndDependentFn ()\n");
285 1.1.1.2.2.2 bouyer }
286 1.1.1.2.2.2 bouyer
287 1.1.1.2.2.2 bouyer
288 1.1.1.2.2.2 bouyer /*******************************************************************************
289 1.1.1.2.2.2 bouyer *
290 1.1.1.2.2.2 bouyer * FUNCTION: AcpiDmVendorSmallDescriptor
291 1.1.1.2.2.2 bouyer *
292 1.1.1.2.2.2 bouyer * PARAMETERS: Resource - Pointer to the resource descriptor
293 1.1.1.2.2.2 bouyer * Length - Length of the descriptor in bytes
294 1.1.1.2.2.2 bouyer * Level - Current source code indentation level
295 1.1.1.2.2.2 bouyer *
296 1.1.1.2.2.2 bouyer * RETURN: None
297 1.1.1.2.2.2 bouyer *
298 1.1.1.2.2.2 bouyer * DESCRIPTION: Decode a Vendor Small Descriptor
299 1.1.1.2.2.2 bouyer *
300 1.1.1.2.2.2 bouyer ******************************************************************************/
301 1.1.1.2.2.2 bouyer
302 1.1.1.2.2.2 bouyer void
303 1.1.1.2.2.2 bouyer AcpiDmVendorSmallDescriptor (
304 1.1.1.2.2.2 bouyer AML_RESOURCE *Resource,
305 1.1.1.2.2.2 bouyer UINT32 Length,
306 1.1.1.2.2.2 bouyer UINT32 Level)
307 1.1.1.2.2.2 bouyer {
308 1.1.1.2.2.2 bouyer
309 1.1.1.2.2.2 bouyer AcpiDmVendorCommon ("Short",
310 1.1.1.2.2.2 bouyer ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)),
311 1.1.1.2.2.2 bouyer Length, Level);
312 1.1.1.2.2.2 bouyer }
313 1.1.1.2.2.2 bouyer
314 1.1.1.2.2.2 bouyer #endif
315 1.1.1.2.2.2 bouyer
316