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