Update ACPI build wrappers to use new ACPICA(20050309) code.
[dragonfly.git] / sys / contrib / dev / acpica-unix-20050211 / disassembler / dmresrcl.c
1 /*******************************************************************************
2  *
3  * Module Name: dmresrcl.c - "Large" Resource Descriptor disassembly
4  *              $Revision: 15 $
5  *
6  ******************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116
117
118 #include "acpi.h"
119 #include "acdisasm.h"
120
121
122 #ifdef ACPI_DISASSEMBLER
123
124 #define _COMPONENT          ACPI_CA_DEBUGGER
125         ACPI_MODULE_NAME    ("dbresrcl")
126
127
128 /*******************************************************************************
129  *
130  * FUNCTION:    AcpiDmSpaceFlags
131  *
132  * PARAMETERS:  Flags               - Flag byte to be decoded
133  *
134  * RETURN:      None
135  *
136  * DESCRIPTION: Decode the flags specific to Space Address space descriptors
137  *
138  ******************************************************************************/
139
140 void
141 AcpiDmSpaceFlags (
142         UINT8               Flags)
143 {
144     AcpiOsPrintf ("%s, %s, %s, %s,",
145         AcpiGbl_ConsumeDecode [(Flags & 1)],
146         AcpiGbl_DECDecode [(Flags & 0x2) >> 1],
147         AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
148         AcpiGbl_MaxDecode [(Flags & 0x8) >> 3]);
149 }
150
151
152 /*******************************************************************************
153  *
154  * FUNCTION:    AcpiDmIoFlags
155  *
156  * PARAMETERS:  Flags               - Flag byte to be decoded
157  *
158  * RETURN:      None
159  *
160  * DESCRIPTION: Decode the flags specific to IO Address space descriptors
161  *
162  ******************************************************************************/
163
164 void
165 AcpiDmIoFlags (
166         UINT8               Flags)
167 {
168     AcpiOsPrintf ("%s, %s, %s, %s,",
169         AcpiGbl_ConsumeDecode [(Flags & 1)],
170         AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
171         AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
172         AcpiGbl_DECDecode [(Flags & 0x2) >> 1]);
173 }
174
175
176 /*******************************************************************************
177  *
178  * FUNCTION:    AcpiDmMemoryFlags
179  *
180  * PARAMETERS:  Flags               - Flag byte to be decoded
181  *              SpecificFlags       - "Specific" flag byte to be decoded
182  *
183  * RETURN:      None
184  *
185  * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
186  *
187  ******************************************************************************/
188
189 void
190 AcpiDmMemoryFlags (
191     UINT8                   Flags,
192     UINT8                   SpecificFlags)
193 {
194     AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
195         AcpiGbl_ConsumeDecode [(Flags & 1)],
196         AcpiGbl_DECDecode [(Flags & 0x2) >> 1],
197         AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
198         AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
199         AcpiGbl_MEMDecode [(SpecificFlags & 0x6) >> 1],
200         AcpiGbl_RWDecode [(SpecificFlags & 0x1)]);
201 }
202
203
204 /*******************************************************************************
205  *
206  * FUNCTION:    AcpiDmWordDescriptor
207  *
208  * PARAMETERS:  Resource            - Pointer to the resource descriptor
209  *              Length              - Length of the descriptor in bytes
210  *              Level               - Current source code indentation level
211  *
212  * RETURN:      None
213  *
214  * DESCRIPTION: Decode a Word Address Space descriptor
215  *
216  ******************************************************************************/
217
218 void
219 AcpiDmWordDescriptor (
220     ASL_WORD_ADDRESS_DESC   *Resource,
221     UINT32                  Length,
222     UINT32                  Level)
223 {
224
225     AcpiDmIndent (Level);
226     if (Resource->ResourceType >= 0xC0)
227     {
228         AcpiOsPrintf ("WordSpace (0x%2.2X, ", Resource->ResourceType);
229         AcpiDmSpaceFlags (Resource->Flags);
230         AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
231     }
232     else
233     {
234         AcpiOsPrintf ("%s (",
235             AcpiGbl_WordDecode [(Resource->ResourceType & 3)]);
236
237         AcpiDmIoFlags (Resource->Flags);
238
239         if ((Resource->ResourceType & 0x3) == 1)
240         {
241             AcpiOsPrintf (" %s,",
242                 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
243         }
244     }
245
246     /* The WORD values */
247
248     AcpiOsPrintf ("\n");
249     AcpiDmIndent (Level + 1);
250     AcpiOsPrintf ("0x%4.4X, /* Address Space Granularity */\n",
251         (UINT32) Resource->Granularity);
252     AcpiDmIndent (Level + 1);
253     AcpiOsPrintf ("0x%4.4X, /* Address Range Minimum */\n",
254         (UINT32) Resource->AddressMin);
255     AcpiDmIndent (Level + 1);
256     AcpiOsPrintf ("0x%4.4X, /* Address Range Maximum */\n",
257         (UINT32) Resource->AddressMax);
258     AcpiDmIndent (Level + 1);
259     AcpiOsPrintf ("0x%4.4X, /* Address Translation Offset */\n",
260         (UINT32) Resource->TranslationOffset);
261     AcpiDmIndent (Level + 1);
262     AcpiOsPrintf ("0x%4.4X",
263         (UINT32) Resource->AddressLength);
264
265     /* Optional fields */
266
267     if (Length > 13)
268     {
269         AcpiOsPrintf (", 0x%2.2X",
270             (UINT32) Resource->OptionalFields[0]);
271     }
272
273     if (Length > 14)
274     {
275         AcpiOsPrintf (", %s",
276             &Resource->OptionalFields[1]);
277     }
278     AcpiOsPrintf (")\n");
279 }
280
281
282 /*******************************************************************************
283  *
284  * FUNCTION:    AcpiDmDwordDescriptor
285  *
286  * PARAMETERS:  Resource            - Pointer to the resource descriptor
287  *              Length              - Length of the descriptor in bytes
288  *              Level               - Current source code indentation level
289  *
290  * RETURN:      None
291  *
292  * DESCRIPTION: Decode a DWord Address Space descriptor
293  *
294  ******************************************************************************/
295
296 void
297 AcpiDmDwordDescriptor (
298     ASL_DWORD_ADDRESS_DESC  *Resource,
299     UINT32                  Length,
300     UINT32                  Level)
301 {
302
303     AcpiDmIndent (Level);
304     if (Resource->ResourceType >= 0xC0)
305     {
306         AcpiOsPrintf ("DWordSpace (0x%2.2X, ", Resource->ResourceType);
307         AcpiDmSpaceFlags (Resource->Flags);
308         AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
309     }
310     else
311     {
312         AcpiOsPrintf ("D%s (",
313             AcpiGbl_WordDecode [(Resource->ResourceType & 3)]);
314
315         if ((Resource->ResourceType & 0x3) == 1)
316         {
317             AcpiDmIoFlags (Resource->Flags);
318             AcpiOsPrintf (" %s,",
319                 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
320         }
321         else
322         {
323             AcpiDmMemoryFlags (Resource->Flags, Resource->SpecificFlags);
324         }
325     }
326
327     /* The DWORD values */
328
329     AcpiOsPrintf ("\n");
330     AcpiDmIndent (Level + 1);
331     AcpiOsPrintf ("0x%8.8X, /* Address Space Granularity */\n",
332         Resource->Granularity);
333     AcpiDmIndent (Level + 1);
334     AcpiOsPrintf ("0x%8.8X, /* Address Range Minimum */\n",
335         Resource->AddressMin);
336     AcpiDmIndent (Level + 1);
337     AcpiOsPrintf ("0x%8.8X, /* Address Range Maximum */\n",
338         Resource->AddressMax);
339     AcpiDmIndent (Level + 1);
340     AcpiOsPrintf ("0x%8.8X, /* Address Translation Offset */\n",
341         Resource->TranslationOffset);
342     AcpiDmIndent (Level + 1);
343     AcpiOsPrintf ("0x%8.8X",
344         Resource->AddressLength);
345
346     /* Optional fields */
347
348     if (Length > 23)
349     {
350         AcpiOsPrintf (", 0x%2.2X",
351             Resource->OptionalFields[0]);
352     }
353     if (Length > 24)
354     {
355         AcpiOsPrintf (", %s",
356             &Resource->OptionalFields[1]);
357     }
358     AcpiOsPrintf (")\n");
359 }
360
361
362 /*******************************************************************************
363  *
364  * FUNCTION:    AcpiDmExtendedDescriptor
365  *
366  * PARAMETERS:  Resource            - Pointer to the resource descriptor
367  *              Length              - Length of the descriptor in bytes
368  *              Level               - Current source code indentation level
369  *
370  * RETURN:      None
371  *
372  * DESCRIPTION: Decode a Extended Address Space descriptor
373  *
374  ******************************************************************************/
375
376 void
377 AcpiDmExtendedDescriptor (
378     ASL_EXTENDED_ADDRESS_DESC  *Resource,
379     UINT32                  Length,
380     UINT32                  Level)
381 {
382
383     AcpiDmIndent (Level);
384     if (Resource->ResourceType >= 0xC0)
385     {
386         AcpiOsPrintf ("ExtendedSpace (0x%2.2X, ", Resource->ResourceType);
387         AcpiDmSpaceFlags (Resource->Flags);
388         AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
389     }
390     else
391     {
392         if ((Resource->ResourceType & 0x3) == 1)
393         {
394             AcpiOsPrintf ("ExtendedIO (");
395             AcpiDmIoFlags (Resource->Flags);
396             AcpiOsPrintf (" %s,",
397                 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
398         }
399         else
400         {
401             AcpiOsPrintf ("ExtendedMemory (");
402             AcpiDmMemoryFlags (Resource->Flags, Resource->SpecificFlags);
403         }
404     }
405
406     /* The QWORD values */
407
408     AcpiOsPrintf ("\n");
409     AcpiDmIndent (Level + 1);
410     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Space Granularity */\n",
411         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->Granularity)));
412
413     AcpiDmIndent (Level + 1);
414     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Minimum */\n",
415         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMin)));
416
417     AcpiDmIndent (Level + 1);
418     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Maximum */\n",
419         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMax)));
420
421     AcpiDmIndent (Level + 1);
422     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Translation Offset */\n",
423         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->TranslationOffset)));
424
425     AcpiDmIndent (Level + 1);
426     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Length */\n",
427         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressLength)));
428
429     AcpiDmIndent (Level + 1);
430     AcpiOsPrintf ("0x%8.8X%8.8X) /* Type Specific Attributes */\n",
431         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->TypeSpecificAttributes)));
432 }
433
434
435 /*******************************************************************************
436  *
437  * FUNCTION:    AcpiDmQwordDescriptor
438  *
439  * PARAMETERS:  Resource            - Pointer to the resource descriptor
440  *              Length              - Length of the descriptor in bytes
441  *              Level               - Current source code indentation level
442  *
443  * RETURN:      None
444  *
445  * DESCRIPTION: Decode a QWord Address Space descriptor
446  *
447  ******************************************************************************/
448
449 void
450 AcpiDmQwordDescriptor (
451     ASL_QWORD_ADDRESS_DESC  *Resource,
452     UINT32                  Length,
453     UINT32                  Level)
454 {
455
456     AcpiDmIndent (Level);
457     if (Resource->ResourceType >= 0xC0)
458     {
459         AcpiOsPrintf ("QWordSpace (0x%2.2X, ", Resource->ResourceType);
460         AcpiDmSpaceFlags (Resource->Flags);
461         AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
462     }
463     else
464     {
465         AcpiOsPrintf ("Q%s (",
466             AcpiGbl_WordDecode [(Resource->ResourceType & 3)]);
467
468         if ((Resource->ResourceType & 0x3) == 1)
469         {
470             AcpiDmIoFlags (Resource->Flags);
471             AcpiOsPrintf (" %s,",
472                 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
473         }
474         else
475         {
476             AcpiDmMemoryFlags (Resource->Flags, Resource->SpecificFlags);
477         }
478     }
479
480     /* The QWORD values */
481
482     AcpiOsPrintf ("\n");
483     AcpiDmIndent (Level + 1);
484     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Space Granularity */\n",
485         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->Granularity)));
486
487     AcpiDmIndent (Level + 1);
488     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Minimum */\n",
489         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMin)));
490
491     AcpiDmIndent (Level + 1);
492     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Maximum */\n",
493         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMax)));
494
495     AcpiDmIndent (Level + 1);
496     AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Translation Offset */\n",
497         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->TranslationOffset)));
498
499     AcpiDmIndent (Level + 1);
500     AcpiOsPrintf ("0x%8.8X%8.8X",
501         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressLength)));
502
503     /* Optional fields */
504
505     if (Length > 43)
506     {
507         AcpiOsPrintf (", 0x%2.2X",
508             Resource->OptionalFields[0]);
509     }
510     if (Length > 44)
511     {
512         AcpiOsPrintf (", %s",
513             &Resource->OptionalFields[1]);
514     }
515
516     AcpiOsPrintf (")\n");
517 }
518
519
520 /*******************************************************************************
521  *
522  * FUNCTION:    AcpiDmMemory24Descriptor
523  *
524  * PARAMETERS:  Resource            - Pointer to the resource descriptor
525  *              Length              - Length of the descriptor in bytes
526  *              Level               - Current source code indentation level
527  *
528  * RETURN:      None
529  *
530  * DESCRIPTION: Decode a Memory24 descriptor
531  *
532  ******************************************************************************/
533
534 void
535 AcpiDmMemory24Descriptor (
536     ASL_MEMORY_24_DESC      *Resource,
537     UINT32                  Length,
538     UINT32                  Level)
539 {
540
541     AcpiDmIndent (Level);
542     AcpiOsPrintf ("Memory24 (%s, 0x%4.4X, 0x%4.4X, 0x%4.4X, 0x%4.4X)\n",
543         AcpiGbl_RWDecode [Resource->Information & 1],
544         (UINT32) Resource->AddressMin,
545         (UINT32) Resource->AddressMax,
546         (UINT32) Resource->Alignment,
547         (UINT32) Resource->RangeLength);
548 }
549
550
551 /*******************************************************************************
552  *
553  * FUNCTION:    AcpiDmMemory32Descriptor
554  *
555  * PARAMETERS:  Resource            - Pointer to the resource descriptor
556  *              Length              - Length of the descriptor in bytes
557  *              Level               - Current source code indentation level
558  *
559  * RETURN:      None
560  *
561  * DESCRIPTION: Decode a Memory32 descriptor
562  *
563  ******************************************************************************/
564
565 void
566 AcpiDmMemory32Descriptor (
567     ASL_MEMORY_32_DESC      *Resource,
568     UINT32                  Length,
569     UINT32                  Level)
570 {
571
572     AcpiDmIndent (Level);
573     AcpiOsPrintf ("Memory32 (%s, 0x%8.8X, 0x%8.8X, 0x%8.8X, 0x%8.8X)\n",
574         AcpiGbl_RWDecode [Resource->Information & 1],
575         Resource->AddressMin,
576         Resource->AddressMax,
577         Resource->Alignment,
578         Resource->RangeLength);
579 }
580
581
582 /*******************************************************************************
583  *
584  * FUNCTION:    AcpiDmFixedMem32Descriptor
585  *
586  * PARAMETERS:  Resource            - Pointer to the resource descriptor
587  *              Length              - Length of the descriptor in bytes
588  *              Level               - Current source code indentation level
589  *
590  * RETURN:      None
591  *
592  * DESCRIPTION: Decode a Fixed Memory32 descriptor
593  *
594  ******************************************************************************/
595
596 void
597 AcpiDmFixedMem32Descriptor (
598     ASL_FIXED_MEMORY_32_DESC *Resource,
599     UINT32                  Length,
600     UINT32                  Level)
601 {
602
603     AcpiDmIndent (Level);
604     AcpiOsPrintf ("Memory32Fixed (%s, 0x%8.8X, 0x%8.8X)\n",
605         AcpiGbl_RWDecode [Resource->Information & 1],
606         Resource->BaseAddress,
607         Resource->RangeLength);
608 }
609
610
611 /*******************************************************************************
612  *
613  * FUNCTION:    AcpiDmGenericRegisterDescriptor
614  *
615  * PARAMETERS:  Resource            - Pointer to the resource descriptor
616  *              Length              - Length of the descriptor in bytes
617  *              Level               - Current source code indentation level
618  *
619  * RETURN:      None
620  *
621  * DESCRIPTION: Decode a Generic Register descriptor
622  *
623  ******************************************************************************/
624
625 void
626 AcpiDmGenericRegisterDescriptor (
627     ASL_GENERAL_REGISTER_DESC *Resource,
628     UINT32                  Length,
629     UINT32                  Level)
630 {
631
632     AcpiDmIndent (Level);
633     AcpiOsPrintf ("Register (");
634
635     AcpiDmAddressSpace (Resource->AddressSpaceId);
636
637     AcpiOsPrintf ("0x%2.2X, 0x%2.2X, 0x%8.8X%8.8X)\n",
638         (UINT32) Resource->BitWidth,
639         (UINT32) Resource->BitOffset,
640         ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->Address)));
641 }
642
643
644 /*******************************************************************************
645  *
646  * FUNCTION:    AcpiDmInterruptDescriptor
647  *
648  * PARAMETERS:  Resource            - Pointer to the resource descriptor
649  *              Length              - Length of the descriptor in bytes
650  *              Level               - Current source code indentation level
651  *
652  * RETURN:      None
653  *
654  * DESCRIPTION: Decode a extended Interrupt descriptor
655  *
656  ******************************************************************************/
657
658 void
659 AcpiDmInterruptDescriptor (
660     ASL_EXTENDED_XRUPT_DESC *Resource,
661     UINT32                  Length,
662     UINT32                  Level)
663 {
664     UINT32                  i;
665     UINT8                   *Rover;
666
667
668     AcpiDmIndent (Level);
669     AcpiOsPrintf ("Interrupt (%s, %s, %s, %s",
670         AcpiGbl_ConsumeDecode [(Resource->Flags & 1)],
671         AcpiGbl_HEDecode [(Resource->Flags >> 1) & 1],
672         AcpiGbl_LLDecode [(Resource->Flags >> 2) & 1],
673         AcpiGbl_SHRDecode [(Resource->Flags >> 3) & 1]);
674
675     /* Resource Index/Source, optional -- at end of descriptor */
676
677     if (Resource->Length > (UINT16) (4 * Resource->TableLength) + 2)
678     {
679         /* Get a pointer past the interrupt values */
680
681         Rover = ((UINT8 *) Resource) + ((4 * Resource->TableLength) + 5);
682
683         /* Resource Index */
684         /* Resource Source */
685
686         AcpiOsPrintf (", 0x%X, \"%s\"", (UINT32) Rover[0], (char *) &Rover[1]);
687     }
688
689     AcpiOsPrintf (")\n");
690     AcpiDmIndent (Level);
691     AcpiOsPrintf ("{\n");
692     for (i = 0; i < Resource->TableLength; i++)
693     {
694         AcpiDmIndent (Level + 1);
695         AcpiOsPrintf ("0x%8.8X,\n", (UINT32) Resource->InterruptNumber[i]);
696     }
697
698     AcpiDmIndent (Level);
699     AcpiOsPrintf ("}\n");
700 }
701
702
703 /*******************************************************************************
704  *
705  * FUNCTION:    AcpiDmVendorLargeDescriptor
706  *
707  * PARAMETERS:  Resource            - Pointer to the resource descriptor
708  *              Length              - Length of the descriptor in bytes
709  *              Level               - Current source code indentation level
710  *
711  * RETURN:      None
712  *
713  * DESCRIPTION: Decode a Vendor Large descriptor
714  *
715  ******************************************************************************/
716
717 void
718 AcpiDmVendorLargeDescriptor (
719     ASL_LARGE_VENDOR_DESC   *Resource,
720     UINT32                  Length,
721     UINT32                  Level)
722 {
723
724     AcpiDmIndent (Level);
725     AcpiOsPrintf ("VendorLong ()\n");
726     AcpiDmIndent (Level);
727
728     AcpiOsPrintf ("{\n");
729
730     AcpiDmDisasmByteList (Level + 1, (UINT8 *) Resource->VendorDefined, Length);
731     AcpiDmIndent (Level);
732     AcpiOsPrintf ("}\n");
733 }
734
735
736 #endif
737