1 /*******************************************************************************
2 *
3 * Module Name: rsdump - AML debugger support for resource structures.
4 *
5 ******************************************************************************/
6
7 /******************************************************************************
8 *
9 * 1. Copyright Notice
10 *
11 * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
12 * All rights reserved.
13 *
14 * 2. License
15 *
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
19 * property rights.
20 *
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
27 *
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
36 *
37 * The above copyright and patent license is granted only if the following
38 * conditions are met:
39 *
40 * 3. Conditions
41 *
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
53 *
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
64 * make.
65 *
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
70 * distribution.
71 *
72 * 3.4. Intel retains all right, title, and interest in and to the Original
73 * Intel Code.
74 *
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
79 *
80 * 4. Disclaimer and Export Compliance
81 *
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88 * PARTICULAR PURPOSE.
89 *
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97 * LIMITED REMEDY.
98 *
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
113 *
114 *****************************************************************************
115 *
116 * Alternatively, you may choose to be licensed under the terms of the
117 * following license:
118 *
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
121 * are met:
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
133 *
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145 *
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
149 *
150 *****************************************************************************/
151
152 #include <contrib/dev/acpica/include/acpi.h>
153 #include <contrib/dev/acpica/include/accommon.h>
154 #include <contrib/dev/acpica/include/acresrc.h>
155
156 #define _COMPONENT ACPI_RESOURCES
157 ACPI_MODULE_NAME ("rsdump")
158
159 /*
160 * All functions in this module are used by the AML Debugger only
161 */
162
163 /* Local prototypes */
164
165 static void
166 AcpiRsOutString (
167 const char *Title,
168 const char *Value);
169
170 static void
171 AcpiRsOutInteger8 (
172 const char *Title,
173 UINT8 Value);
174
175 static void
176 AcpiRsOutInteger16 (
177 const char *Title,
178 UINT16 Value);
179
180 static void
181 AcpiRsOutInteger32 (
182 const char *Title,
183 UINT32 Value);
184
185 static void
186 AcpiRsOutInteger64 (
187 const char *Title,
188 UINT64 Value);
189
190 static void
191 AcpiRsOutTitle (
192 const char *Title);
193
194 static void
195 AcpiRsDumpByteList (
196 UINT16 Length,
197 UINT8 *Data);
198
199 static void
200 AcpiRsDumpWordList (
201 UINT16 Length,
202 UINT16 *Data);
203
204 static void
205 AcpiRsDumpDwordList (
206 UINT8 Length,
207 UINT32 *Data);
208
209 static void
210 AcpiRsDumpShortByteList (
211 UINT8 Length,
212 UINT8 *Data);
213
214 static void
215 AcpiRsDumpResourceSource (
216 ACPI_RESOURCE_SOURCE *ResourceSource);
217
218 static void
219 AcpiRsDumpResourceLabel (
220 char *Title,
221 ACPI_RESOURCE_LABEL *ResourceLabel);
222
223 static void
224 AcpiRsDumpAddressCommon (
225 ACPI_RESOURCE_DATA *Resource);
226
227 static void
228 AcpiRsDumpDescriptor (
229 void *Resource,
230 ACPI_RSDUMP_INFO *Table);
231
232
233 #ifdef ACPI_DEBUGGER
234 /*******************************************************************************
235 *
236 * FUNCTION: AcpiRsDumpResourceList
237 *
238 * PARAMETERS: ResourceList - Pointer to a resource descriptor list
239 *
240 * RETURN: None
241 *
242 * DESCRIPTION: Dispatches the structure to the correct dump routine.
243 *
244 ******************************************************************************/
245
246 void
AcpiRsDumpResourceList(ACPI_RESOURCE * ResourceList)247 AcpiRsDumpResourceList (
248 ACPI_RESOURCE *ResourceList)
249 {
250 UINT32 Count = 0;
251 UINT32 Type;
252
253
254 ACPI_FUNCTION_ENTRY ();
255
256
257 /* Check if debug output enabled */
258
259 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
260 {
261 return;
262 }
263
264 /* Walk list and dump all resource descriptors (END_TAG terminates) */
265
266 do
267 {
268 AcpiOsPrintf ("\n[%02X] ", Count);
269 Count++;
270
271 /* Validate Type before dispatch */
272
273 Type = ResourceList->Type;
274 if (Type > ACPI_RESOURCE_TYPE_MAX)
275 {
276 AcpiOsPrintf (
277 "Invalid descriptor type (%X) in resource list\n",
278 ResourceList->Type);
279 return;
280 }
281 else if (!ResourceList->Type)
282 {
283 ACPI_ERROR ((AE_INFO, "Invalid Zero Resource Type"));
284 return;
285 }
286
287 /* Sanity check the length. It must not be zero, or we loop forever */
288
289 if (!ResourceList->Length)
290 {
291 AcpiOsPrintf (
292 "Invalid zero length descriptor in resource list\n");
293 return;
294 }
295
296 /* Dump the resource descriptor */
297
298 if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
299 {
300 AcpiRsDumpDescriptor (&ResourceList->Data,
301 AcpiGbl_DumpSerialBusDispatch[
302 ResourceList->Data.CommonSerialBus.Type]);
303 }
304 else
305 {
306 AcpiRsDumpDescriptor (&ResourceList->Data,
307 AcpiGbl_DumpResourceDispatch[Type]);
308 }
309
310 /* Point to the next resource structure */
311
312 ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
313
314 /* Exit when END_TAG descriptor is reached */
315
316 } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
317 }
318
319
320 /*******************************************************************************
321 *
322 * FUNCTION: AcpiRsDumpIrqList
323 *
324 * PARAMETERS: RouteTable - Pointer to the routing table to dump.
325 *
326 * RETURN: None
327 *
328 * DESCRIPTION: Print IRQ routing table
329 *
330 ******************************************************************************/
331
332 void
AcpiRsDumpIrqList(UINT8 * RouteTable)333 AcpiRsDumpIrqList (
334 UINT8 *RouteTable)
335 {
336 ACPI_PCI_ROUTING_TABLE *PrtElement;
337 UINT8 Count;
338
339
340 ACPI_FUNCTION_ENTRY ();
341
342
343 /* Check if debug output enabled */
344
345 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
346 {
347 return;
348 }
349
350 PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
351
352 /* Dump all table elements, Exit on zero length element */
353
354 for (Count = 0; PrtElement->Length; Count++)
355 {
356 AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
357 AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
358
359 PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
360 PrtElement, PrtElement->Length);
361 }
362 }
363 #endif
364
365 /*******************************************************************************
366 *
367 * FUNCTION: AcpiRsDumpDescriptor
368 *
369 * PARAMETERS: Resource - Buffer containing the resource
370 * Table - Table entry to decode the resource
371 *
372 * RETURN: None
373 *
374 * DESCRIPTION: Dump a resource descriptor based on a dump table entry.
375 *
376 ******************************************************************************/
377
378 static void
AcpiRsDumpDescriptor(void * Resource,ACPI_RSDUMP_INFO * Table)379 AcpiRsDumpDescriptor (
380 void *Resource,
381 ACPI_RSDUMP_INFO *Table)
382 {
383 UINT8 *Target = NULL;
384 UINT8 *PreviousTarget;
385 const char *Name;
386 UINT8 Count;
387
388
389 /* First table entry must contain the table length (# of table entries) */
390
391 Count = Table->Offset;
392
393 while (Count)
394 {
395 PreviousTarget = Target;
396 Target = ACPI_ADD_PTR (UINT8, Resource, Table->Offset);
397 Name = Table->Name;
398
399 switch (Table->Opcode)
400 {
401 case ACPI_RSD_TITLE:
402 /*
403 * Optional resource title
404 */
405 if (Table->Name)
406 {
407 AcpiOsPrintf ("%s Resource\n", Name);
408 }
409 break;
410
411 /* Strings */
412
413 case ACPI_RSD_LITERAL:
414
415 AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer));
416 break;
417
418 case ACPI_RSD_STRING:
419
420 AcpiRsOutString (Name, ACPI_CAST_PTR (char, Target));
421 break;
422
423 /* Data items, 8/16/32/64 bit */
424
425 case ACPI_RSD_UINT8:
426
427 if (Table->Pointer)
428 {
429 AcpiRsOutString (Name, Table->Pointer [*Target]);
430 }
431 else
432 {
433 AcpiRsOutInteger8 (Name, ACPI_GET8 (Target));
434 }
435 break;
436
437 case ACPI_RSD_UINT16:
438
439 AcpiRsOutInteger16 (Name, ACPI_GET16 (Target));
440 break;
441
442 case ACPI_RSD_UINT32:
443
444 AcpiRsOutInteger32 (Name, ACPI_GET32 (Target));
445 break;
446
447 case ACPI_RSD_UINT64:
448
449 AcpiRsOutInteger64 (Name, ACPI_GET64 (Target));
450 break;
451
452 /* Flags: 1-bit and 2-bit flags supported */
453
454 case ACPI_RSD_1BITFLAG:
455
456 AcpiRsOutString (Name, Table->Pointer [*Target & 0x01]);
457 break;
458
459 case ACPI_RSD_2BITFLAG:
460
461 AcpiRsOutString (Name, Table->Pointer [*Target & 0x03]);
462 break;
463
464 case ACPI_RSD_3BITFLAG:
465
466 AcpiRsOutString (Name, Table->Pointer [*Target & 0x07]);
467 break;
468
469 case ACPI_RSD_6BITFLAG:
470
471 AcpiRsOutInteger8 (Name, (ACPI_GET8 (Target) & 0x3F));
472 break;
473
474 case ACPI_RSD_SHORTLIST:
475 /*
476 * Short byte list (single line output) for DMA and IRQ resources
477 * Note: The list length is obtained from the previous table entry
478 */
479 if (PreviousTarget)
480 {
481 AcpiRsOutTitle (Name);
482 AcpiRsDumpShortByteList (*PreviousTarget, Target);
483 }
484 break;
485
486 case ACPI_RSD_SHORTLISTX:
487 /*
488 * Short byte list (single line output) for GPIO vendor data
489 * Note: The list length is obtained from the previous table entry
490 */
491 if (PreviousTarget)
492 {
493 AcpiRsOutTitle (Name);
494 AcpiRsDumpShortByteList (*PreviousTarget,
495 *(ACPI_CAST_INDIRECT_PTR (UINT8, Target)));
496 }
497 break;
498
499 case ACPI_RSD_LONGLIST:
500 /*
501 * Long byte list for Vendor resource data
502 * Note: The list length is obtained from the previous table entry
503 */
504 if (PreviousTarget)
505 {
506 AcpiRsDumpByteList (ACPI_GET16 (PreviousTarget), Target);
507 }
508 break;
509
510 case ACPI_RSD_DWORDLIST:
511 /*
512 * Dword list for Extended Interrupt resources
513 * Note: The list length is obtained from the previous table entry
514 */
515 if (PreviousTarget)
516 {
517 AcpiRsDumpDwordList (*PreviousTarget,
518 ACPI_CAST_PTR (UINT32, Target));
519 }
520 break;
521
522 case ACPI_RSD_WORDLIST:
523 /*
524 * Word list for GPIO Pin Table
525 * Note: The list length is obtained from the previous table entry
526 */
527 if (PreviousTarget)
528 {
529 AcpiRsDumpWordList (*PreviousTarget,
530 *(ACPI_CAST_INDIRECT_PTR (UINT16, Target)));
531 }
532 break;
533
534 case ACPI_RSD_ADDRESS:
535 /*
536 * Common flags for all Address resources
537 */
538 AcpiRsDumpAddressCommon (ACPI_CAST_PTR (
539 ACPI_RESOURCE_DATA, Target));
540 break;
541
542 case ACPI_RSD_SOURCE:
543 /*
544 * Optional ResourceSource for Address resources
545 */
546 AcpiRsDumpResourceSource (ACPI_CAST_PTR (
547 ACPI_RESOURCE_SOURCE, Target));
548 break;
549
550 case ACPI_RSD_LABEL:
551 /*
552 * ResourceLabel
553 */
554 AcpiRsDumpResourceLabel ("Resource Label", ACPI_CAST_PTR (
555 ACPI_RESOURCE_LABEL, Target));
556 break;
557
558 case ACPI_RSD_SOURCE_LABEL:
559 /*
560 * ResourceSourceLabel
561 */
562 AcpiRsDumpResourceLabel ("Resource Source Label", ACPI_CAST_PTR (
563 ACPI_RESOURCE_LABEL, Target));
564 break;
565
566 default:
567
568 AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
569 Table->Opcode);
570 return;
571 }
572
573 Table++;
574 Count--;
575 }
576 }
577
578
579 /*******************************************************************************
580 *
581 * FUNCTION: AcpiRsDumpResourceSource
582 *
583 * PARAMETERS: ResourceSource - Pointer to a Resource Source struct
584 *
585 * RETURN: None
586 *
587 * DESCRIPTION: Common routine for dumping the optional ResourceSource and the
588 * corresponding ResourceSourceIndex.
589 *
590 ******************************************************************************/
591
592 static void
AcpiRsDumpResourceSource(ACPI_RESOURCE_SOURCE * ResourceSource)593 AcpiRsDumpResourceSource (
594 ACPI_RESOURCE_SOURCE *ResourceSource)
595 {
596 ACPI_FUNCTION_ENTRY ();
597
598
599 if (ResourceSource->Index == 0xFF)
600 {
601 return;
602 }
603
604 AcpiRsOutInteger8 ("Resource Source Index",
605 ResourceSource->Index);
606
607 AcpiRsOutString ("Resource Source",
608 ResourceSource->StringPtr ?
609 ResourceSource->StringPtr : "[Not Specified]");
610 }
611
612
613 /*******************************************************************************
614 *
615 * FUNCTION: AcpiRsDumpResourceLabel
616 *
617 * PARAMETERS: Title - Title of the dumped resource field
618 * ResourceLabel - Pointer to a Resource Label struct
619 *
620 * RETURN: None
621 *
622 * DESCRIPTION: Common routine for dumping the ResourceLabel
623 *
624 ******************************************************************************/
625
626 static void
AcpiRsDumpResourceLabel(char * Title,ACPI_RESOURCE_LABEL * ResourceLabel)627 AcpiRsDumpResourceLabel (
628 char *Title,
629 ACPI_RESOURCE_LABEL *ResourceLabel)
630 {
631 ACPI_FUNCTION_ENTRY ();
632
633 AcpiRsOutString (Title,
634 ResourceLabel->StringPtr ?
635 ResourceLabel->StringPtr : "[Not Specified]");
636 }
637
638
639 /*******************************************************************************
640 *
641 * FUNCTION: AcpiRsDumpAddressCommon
642 *
643 * PARAMETERS: Resource - Pointer to an internal resource descriptor
644 *
645 * RETURN: None
646 *
647 * DESCRIPTION: Dump the fields that are common to all Address resource
648 * descriptors
649 *
650 ******************************************************************************/
651
652 static void
AcpiRsDumpAddressCommon(ACPI_RESOURCE_DATA * Resource)653 AcpiRsDumpAddressCommon (
654 ACPI_RESOURCE_DATA *Resource)
655 {
656 ACPI_FUNCTION_ENTRY ();
657
658
659 /* Decode the type-specific flags */
660
661 switch (Resource->Address.ResourceType)
662 {
663 case ACPI_MEMORY_RANGE:
664
665 AcpiRsDumpDescriptor (Resource, AcpiRsDumpMemoryFlags);
666 break;
667
668 case ACPI_IO_RANGE:
669
670 AcpiRsDumpDescriptor (Resource, AcpiRsDumpIoFlags);
671 break;
672
673 case ACPI_BUS_NUMBER_RANGE:
674
675 AcpiRsOutString ("Resource Type", "Bus Number Range");
676 break;
677
678 default:
679
680 AcpiRsOutInteger8 ("Resource Type",
681 (UINT8) Resource->Address.ResourceType);
682 break;
683 }
684
685 /* Decode the general flags */
686
687 AcpiRsDumpDescriptor (Resource, AcpiRsDumpGeneralFlags);
688 }
689
690
691 /*******************************************************************************
692 *
693 * FUNCTION: AcpiRsOut*
694 *
695 * PARAMETERS: Title - Name of the resource field
696 * Value - Value of the resource field
697 *
698 * RETURN: None
699 *
700 * DESCRIPTION: Miscellaneous helper functions to consistently format the
701 * output of the resource dump routines
702 *
703 ******************************************************************************/
704
705 static void
AcpiRsOutString(const char * Title,const char * Value)706 AcpiRsOutString (
707 const char *Title,
708 const char *Value)
709 {
710
711 AcpiOsPrintf ("%27s : %s", Title, Value);
712 if (!*Value)
713 {
714 AcpiOsPrintf ("[NULL NAMESTRING]");
715 }
716 AcpiOsPrintf ("\n");
717 }
718
719 static void
AcpiRsOutInteger8(const char * Title,UINT8 Value)720 AcpiRsOutInteger8 (
721 const char *Title,
722 UINT8 Value)
723 {
724 AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
725 }
726
727 static void
AcpiRsOutInteger16(const char * Title,UINT16 Value)728 AcpiRsOutInteger16 (
729 const char *Title,
730 UINT16 Value)
731 {
732
733 AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
734 }
735
736 static void
AcpiRsOutInteger32(const char * Title,UINT32 Value)737 AcpiRsOutInteger32 (
738 const char *Title,
739 UINT32 Value)
740 {
741
742 AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
743 }
744
745 static void
AcpiRsOutInteger64(const char * Title,UINT64 Value)746 AcpiRsOutInteger64 (
747 const char *Title,
748 UINT64 Value)
749 {
750
751 AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
752 ACPI_FORMAT_UINT64 (Value));
753 }
754
755 static void
AcpiRsOutTitle(const char * Title)756 AcpiRsOutTitle (
757 const char *Title)
758 {
759
760 AcpiOsPrintf ("%27s : ", Title);
761 }
762
763
764 /*******************************************************************************
765 *
766 * FUNCTION: AcpiRsDump*List
767 *
768 * PARAMETERS: Length - Number of elements in the list
769 * Data - Start of the list
770 *
771 * RETURN: None
772 *
773 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
774 *
775 ******************************************************************************/
776
777 static void
AcpiRsDumpByteList(UINT16 Length,UINT8 * Data)778 AcpiRsDumpByteList (
779 UINT16 Length,
780 UINT8 *Data)
781 {
782 UINT16 i;
783
784
785 for (i = 0; i < Length; i++)
786 {
787 AcpiOsPrintf ("%25s%2.2X : %2.2X\n", "Byte", i, Data[i]);
788 }
789 }
790
791 static void
AcpiRsDumpShortByteList(UINT8 Length,UINT8 * Data)792 AcpiRsDumpShortByteList (
793 UINT8 Length,
794 UINT8 *Data)
795 {
796 UINT8 i;
797
798
799 for (i = 0; i < Length; i++)
800 {
801 AcpiOsPrintf ("%X ", Data[i]);
802 }
803
804 AcpiOsPrintf ("\n");
805 }
806
807 static void
AcpiRsDumpDwordList(UINT8 Length,UINT32 * Data)808 AcpiRsDumpDwordList (
809 UINT8 Length,
810 UINT32 *Data)
811 {
812 UINT8 i;
813
814
815 for (i = 0; i < Length; i++)
816 {
817 AcpiOsPrintf ("%25s%2.2X : %8.8X\n", "Dword", i, Data[i]);
818 }
819 }
820
821 static void
AcpiRsDumpWordList(UINT16 Length,UINT16 * Data)822 AcpiRsDumpWordList (
823 UINT16 Length,
824 UINT16 *Data)
825 {
826 UINT16 i;
827
828
829 for (i = 0; i < Length; i++)
830 {
831 AcpiOsPrintf ("%25s%2.2X : %4.4X\n", "Word", i, Data[i]);
832 }
833 }
834