xref: /titanic_52/usr/src/uts/intel/io/acpica/utilities/utdebug.c (revision c1ecd8b9404ee0d96d93f02e82c441b9bb149a3d)
1 /******************************************************************************
2  *
3  * Module Name: utdebug - Debug print routines
4  *              $Revision: 1.132 $
5  *
6  *****************************************************************************/
7 
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2006, 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 #define __UTDEBUG_C__
118 
119 #include "acpi.h"
120 
121 #define _COMPONENT          ACPI_UTILITIES
122         ACPI_MODULE_NAME    ("utdebug")
123 
124 
125 #ifdef ACPI_DEBUG_OUTPUT
126 
127 static UINT32   AcpiGbl_PrevThreadId = 0xFFFFFFFF;
128 static char     *AcpiGbl_FnEntryStr = "----Entry";
129 static char     *AcpiGbl_FnExitStr  = "----Exit-";
130 
131 /* Local prototypes */
132 
133 static const char *
134 AcpiUtTrimFunctionName (
135     const char              *FunctionName);
136 
137 
138 /*******************************************************************************
139  *
140  * FUNCTION:    AcpiUtInitStackPtrTrace
141  *
142  * PARAMETERS:  None
143  *
144  * RETURN:      None
145  *
146  * DESCRIPTION: Save the current CPU stack pointer at subsystem startup
147  *
148  ******************************************************************************/
149 
150 void
151 AcpiUtInitStackPtrTrace (
152     void)
153 {
154     UINT32                  CurrentSp;
155 
156 
157     AcpiGbl_EntryStackPointer = ACPI_PTR_DIFF (&CurrentSp, NULL);
158 }
159 
160 
161 /*******************************************************************************
162  *
163  * FUNCTION:    AcpiUtTrackStackPtr
164  *
165  * PARAMETERS:  None
166  *
167  * RETURN:      None
168  *
169  * DESCRIPTION: Save the current CPU stack pointer
170  *
171  ******************************************************************************/
172 
173 void
174 AcpiUtTrackStackPtr (
175     void)
176 {
177     ACPI_SIZE               CurrentSp;
178 
179 
180     CurrentSp = ACPI_PTR_DIFF (&CurrentSp, NULL);
181 
182     if (CurrentSp < AcpiGbl_LowestStackPointer)
183     {
184         AcpiGbl_LowestStackPointer = CurrentSp;
185     }
186 
187     if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting)
188     {
189         AcpiGbl_DeepestNesting = AcpiGbl_NestingLevel;
190     }
191 }
192 
193 
194 /*******************************************************************************
195  *
196  * FUNCTION:    AcpiUtTrimFunctionName
197  *
198  * PARAMETERS:  FunctionName        - Ascii string containing a procedure name
199  *
200  * RETURN:      Updated pointer to the function name
201  *
202  * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
203  *              This allows compiler macros such as __FUNCTION__ to be used
204  *              with no change to the debug output.
205  *
206  ******************************************************************************/
207 
208 static const char *
209 AcpiUtTrimFunctionName (
210     const char              *FunctionName)
211 {
212 
213     /* All Function names are longer than 4 chars, check is safe */
214 
215     if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_MIXED)
216     {
217         /* This is the case where the original source has not been modified */
218 
219         return (FunctionName + 4);
220     }
221 
222     if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_LOWER)
223     {
224         /* This is the case where the source has been 'linuxized' */
225 
226         return (FunctionName + 5);
227     }
228 
229     return (FunctionName);
230 }
231 
232 
233 /*******************************************************************************
234  *
235  * FUNCTION:    AcpiUtDebugPrint
236  *
237  * PARAMETERS:  RequestedDebugLevel - Requested debug print level
238  *              LineNumber          - Caller's line number (for error output)
239  *              FunctionName        - Caller's procedure name
240  *              ModuleName          - Caller's module name
241  *              ComponentId         - Caller's component ID
242  *              Format              - Printf format field
243  *              ...                 - Optional printf arguments
244  *
245  * RETURN:      None
246  *
247  * DESCRIPTION: Print error message with prefix consisting of the module name,
248  *              line number, and component ID.
249  *
250  ******************************************************************************/
251 
252 void  ACPI_INTERNAL_VAR_XFACE
253 AcpiUtDebugPrint (
254     UINT32                  RequestedDebugLevel,
255     UINT32                  LineNumber,
256     const char              *FunctionName,
257     char                    *ModuleName,
258     UINT32                  ComponentId,
259     char                    *Format,
260     ...)
261 {
262     ACPI_THREAD_ID          ThreadId;
263     va_list                 args;
264 
265 
266     /*
267      * Stay silent if the debug level or component ID is disabled
268      */
269     if (!(RequestedDebugLevel & AcpiDbgLevel) ||
270         !(ComponentId & AcpiDbgLayer))
271     {
272         return;
273     }
274 
275     /*
276      * Thread tracking and context switch notification
277      */
278     ThreadId = AcpiOsGetThreadId ();
279     if (ThreadId != AcpiGbl_PrevThreadId)
280     {
281         if (ACPI_LV_THREADS & AcpiDbgLevel)
282         {
283             AcpiOsPrintf (
284                 "\n**** Context Switch from TID %X to TID %X ****\n\n",
285                 AcpiGbl_PrevThreadId, ThreadId);
286         }
287 
288         AcpiGbl_PrevThreadId = ThreadId;
289     }
290 
291     /*
292      * Display the module name, current line number, thread ID (if requested),
293      * current procedure nesting level, and the current procedure name
294      */
295     AcpiOsPrintf ("%8s-%04ld ", ModuleName, LineNumber);
296 
297     if (ACPI_LV_THREADS & AcpiDbgLevel)
298     {
299         AcpiOsPrintf ("[%04lX] ", ThreadId);
300     }
301 
302     AcpiOsPrintf ("[%02ld] %-22.22s: ",
303         AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName));
304 
305     va_start (args, Format);
306     AcpiOsVprintf (Format, args);
307 }
308 
309 ACPI_EXPORT_SYMBOL (AcpiUtDebugPrint)
310 
311 
312 /*******************************************************************************
313  *
314  * FUNCTION:    AcpiUtDebugPrintRaw
315  *
316  * PARAMETERS:  RequestedDebugLevel - Requested debug print level
317  *              LineNumber          - Caller's line number
318  *              FunctionName        - Caller's procedure name
319  *              ModuleName          - Caller's module name
320  *              ComponentId         - Caller's component ID
321  *              Format              - Printf format field
322  *              ...                 - Optional printf arguments
323  *
324  * RETURN:      None
325  *
326  * DESCRIPTION: Print message with no headers.  Has same interface as
327  *              DebugPrint so that the same macros can be used.
328  *
329  ******************************************************************************/
330 
331 void  ACPI_INTERNAL_VAR_XFACE
332 AcpiUtDebugPrintRaw (
333     UINT32                  RequestedDebugLevel,
334     UINT32                  LineNumber,
335     const char              *FunctionName,
336     char                    *ModuleName,
337     UINT32                  ComponentId,
338     char                    *Format,
339     ...)
340 {
341     va_list                 args;
342 
343 
344     if (!(RequestedDebugLevel & AcpiDbgLevel) ||
345         !(ComponentId & AcpiDbgLayer))
346     {
347         return;
348     }
349 
350     va_start (args, Format);
351     AcpiOsVprintf (Format, args);
352 }
353 
354 ACPI_EXPORT_SYMBOL (AcpiUtDebugPrintRaw)
355 
356 
357 /*******************************************************************************
358  *
359  * FUNCTION:    AcpiUtTrace
360  *
361  * PARAMETERS:  LineNumber          - Caller's line number
362  *              FunctionName        - Caller's procedure name
363  *              ModuleName          - Caller's module name
364  *              ComponentId         - Caller's component ID
365  *
366  * RETURN:      None
367  *
368  * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
369  *              set in DebugLevel
370  *
371  ******************************************************************************/
372 
373 void
374 AcpiUtTrace (
375     UINT32                  LineNumber,
376     const char              *FunctionName,
377     char                    *ModuleName,
378     UINT32                  ComponentId)
379 {
380 
381     AcpiGbl_NestingLevel++;
382     AcpiUtTrackStackPtr ();
383 
384     AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
385         LineNumber, FunctionName, ModuleName, ComponentId,
386         "%s\n", AcpiGbl_FnEntryStr);
387 }
388 
389 ACPI_EXPORT_SYMBOL (AcpiUtTrace)
390 
391 
392 /*******************************************************************************
393  *
394  * FUNCTION:    AcpiUtTracePtr
395  *
396  * PARAMETERS:  LineNumber          - Caller's line number
397  *              FunctionName        - Caller's procedure name
398  *              ModuleName          - Caller's module name
399  *              ComponentId         - Caller's component ID
400  *              Pointer             - Pointer to display
401  *
402  * RETURN:      None
403  *
404  * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
405  *              set in DebugLevel
406  *
407  ******************************************************************************/
408 
409 void
410 AcpiUtTracePtr (
411     UINT32                  LineNumber,
412     const char              *FunctionName,
413     char                    *ModuleName,
414     UINT32                  ComponentId,
415     void                    *Pointer)
416 {
417     AcpiGbl_NestingLevel++;
418     AcpiUtTrackStackPtr ();
419 
420     AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
421         LineNumber, FunctionName, ModuleName, ComponentId,
422         "%s %p\n", AcpiGbl_FnEntryStr, Pointer);
423 }
424 
425 
426 /*******************************************************************************
427  *
428  * FUNCTION:    AcpiUtTraceStr
429  *
430  * PARAMETERS:  LineNumber          - Caller's line number
431  *              FunctionName        - Caller's procedure name
432  *              ModuleName          - Caller's module name
433  *              ComponentId         - Caller's component ID
434  *              String              - Additional string to display
435  *
436  * RETURN:      None
437  *
438  * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
439  *              set in DebugLevel
440  *
441  ******************************************************************************/
442 
443 void
444 AcpiUtTraceStr (
445     UINT32                  LineNumber,
446     const char              *FunctionName,
447     char                    *ModuleName,
448     UINT32                  ComponentId,
449     char                    *String)
450 {
451 
452     AcpiGbl_NestingLevel++;
453     AcpiUtTrackStackPtr ();
454 
455     AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
456         LineNumber, FunctionName, ModuleName, ComponentId,
457         "%s %s\n", AcpiGbl_FnEntryStr, String);
458 }
459 
460 
461 /*******************************************************************************
462  *
463  * FUNCTION:    AcpiUtTraceU32
464  *
465  * PARAMETERS:  LineNumber          - Caller's line number
466  *              FunctionName        - Caller's procedure name
467  *              ModuleName          - Caller's module name
468  *              ComponentId         - Caller's component ID
469  *              Integer             - Integer to display
470  *
471  * RETURN:      None
472  *
473  * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
474  *              set in DebugLevel
475  *
476  ******************************************************************************/
477 
478 void
479 AcpiUtTraceU32 (
480     UINT32                  LineNumber,
481     const char              *FunctionName,
482     char                    *ModuleName,
483     UINT32                  ComponentId,
484     UINT32                  Integer)
485 {
486 
487     AcpiGbl_NestingLevel++;
488     AcpiUtTrackStackPtr ();
489 
490     AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
491         LineNumber, FunctionName, ModuleName, ComponentId,
492         "%s %08X\n", AcpiGbl_FnEntryStr, Integer);
493 }
494 
495 
496 /*******************************************************************************
497  *
498  * FUNCTION:    AcpiUtExit
499  *
500  * PARAMETERS:  LineNumber          - Caller's line number
501  *              FunctionName        - Caller's procedure name
502  *              ModuleName          - Caller's module name
503  *              ComponentId         - Caller's component ID
504  *
505  * RETURN:      None
506  *
507  * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
508  *              set in DebugLevel
509  *
510  ******************************************************************************/
511 
512 void
513 AcpiUtExit (
514     UINT32                  LineNumber,
515     const char              *FunctionName,
516     char                    *ModuleName,
517     UINT32                  ComponentId)
518 {
519 
520     AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
521         LineNumber, FunctionName, ModuleName, ComponentId,
522         "%s\n", AcpiGbl_FnExitStr);
523 
524     AcpiGbl_NestingLevel--;
525 }
526 
527 ACPI_EXPORT_SYMBOL (AcpiUtExit)
528 
529 
530 /*******************************************************************************
531  *
532  * FUNCTION:    AcpiUtStatusExit
533  *
534  * PARAMETERS:  LineNumber          - Caller's line number
535  *              FunctionName        - Caller's procedure name
536  *              ModuleName          - Caller's module name
537  *              ComponentId         - Caller's component ID
538  *              Status              - Exit status code
539  *
540  * RETURN:      None
541  *
542  * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
543  *              set in DebugLevel.  Prints exit status also.
544  *
545  ******************************************************************************/
546 
547 void
548 AcpiUtStatusExit (
549     UINT32                  LineNumber,
550     const char              *FunctionName,
551     char                    *ModuleName,
552     UINT32                  ComponentId,
553     ACPI_STATUS             Status)
554 {
555 
556     if (ACPI_SUCCESS (Status))
557     {
558         AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
559             LineNumber, FunctionName, ModuleName, ComponentId,
560             "%s %s\n", AcpiGbl_FnExitStr,
561             AcpiFormatException (Status));
562     }
563     else
564     {
565         AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
566             LineNumber, FunctionName, ModuleName, ComponentId,
567             "%s ****Exception****: %s\n", AcpiGbl_FnExitStr,
568             AcpiFormatException (Status));
569     }
570 
571     AcpiGbl_NestingLevel--;
572 }
573 
574 ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
575 
576 
577 /*******************************************************************************
578  *
579  * FUNCTION:    AcpiUtValueExit
580  *
581  * PARAMETERS:  LineNumber          - Caller's line number
582  *              FunctionName        - Caller's procedure name
583  *              ModuleName          - Caller's module name
584  *              ComponentId         - Caller's component ID
585  *              Value               - Value to be printed with exit msg
586  *
587  * RETURN:      None
588  *
589  * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
590  *              set in DebugLevel.  Prints exit value also.
591  *
592  ******************************************************************************/
593 
594 void
595 AcpiUtValueExit (
596     UINT32                  LineNumber,
597     const char              *FunctionName,
598     char                    *ModuleName,
599     UINT32                  ComponentId,
600     ACPI_INTEGER            Value)
601 {
602 
603     AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
604         LineNumber, FunctionName, ModuleName, ComponentId,
605         "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr,
606         ACPI_FORMAT_UINT64 (Value));
607 
608     AcpiGbl_NestingLevel--;
609 }
610 
611 ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
612 
613 
614 /*******************************************************************************
615  *
616  * FUNCTION:    AcpiUtPtrExit
617  *
618  * PARAMETERS:  LineNumber          - Caller's line number
619  *              FunctionName        - Caller's procedure name
620  *              ModuleName          - Caller's module name
621  *              ComponentId         - Caller's component ID
622  *              Ptr                 - Pointer to display
623  *
624  * RETURN:      None
625  *
626  * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
627  *              set in DebugLevel.  Prints exit value also.
628  *
629  ******************************************************************************/
630 
631 void
632 AcpiUtPtrExit (
633     UINT32                  LineNumber,
634     const char              *FunctionName,
635     char                    *ModuleName,
636     UINT32                  ComponentId,
637     UINT8                   *Ptr)
638 {
639 
640     AcpiUtDebugPrint (ACPI_LV_FUNCTIONS,
641         LineNumber, FunctionName, ModuleName, ComponentId,
642         "%s %p\n", AcpiGbl_FnExitStr, Ptr);
643 
644     AcpiGbl_NestingLevel--;
645 }
646 
647 #endif
648 
649 
650 /*******************************************************************************
651  *
652  * FUNCTION:    AcpiUtDumpBuffer
653  *
654  * PARAMETERS:  Buffer              - Buffer to dump
655  *              Count               - Amount to dump, in bytes
656  *              Display             - BYTE, WORD, DWORD, or QWORD display
657  *              ComponentID         - Caller's component ID
658  *
659  * RETURN:      None
660  *
661  * DESCRIPTION: Generic dump buffer in both hex and ascii.
662  *
663  ******************************************************************************/
664 
665 void
666 AcpiUtDumpBuffer2 (
667     UINT8                   *Buffer,
668     UINT32                  Count,
669     UINT32                  Display)
670 {
671     ACPI_NATIVE_UINT        i = 0;
672     ACPI_NATIVE_UINT        j;
673     UINT32                  Temp32;
674     UINT8                   BufChar;
675 
676 
677     if ((Count < 4) || (Count & 0x01))
678     {
679         Display = DB_BYTE_DISPLAY;
680     }
681 
682     /* Nasty little dump buffer routine! */
683 
684     while (i < Count)
685     {
686         /* Print current offset */
687 
688         AcpiOsPrintf ("%6.4X: ", (UINT32) i);
689 
690         /* Print 16 hex chars */
691 
692         for (j = 0; j < 16;)
693         {
694             if (i + j >= Count)
695             {
696                 /* Dump fill spaces */
697 
698                 AcpiOsPrintf ("%*s", ((Display * 2) + 1), " ");
699                 j += (ACPI_NATIVE_UINT) Display;
700                 continue;
701             }
702 
703             switch (Display)
704             {
705             case DB_BYTE_DISPLAY:
706             default:    /* Default is BYTE display */
707 
708                 AcpiOsPrintf ("%02X ", Buffer[i + j]);
709                 break;
710 
711 
712             case DB_WORD_DISPLAY:
713 
714                 ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[i + j]);
715                 AcpiOsPrintf ("%04X ", Temp32);
716                 break;
717 
718 
719             case DB_DWORD_DISPLAY:
720 
721                 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[i + j]);
722                 AcpiOsPrintf ("%08X ", Temp32);
723                 break;
724 
725 
726             case DB_QWORD_DISPLAY:
727 
728                 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[i + j]);
729                 AcpiOsPrintf ("%08X", Temp32);
730 
731                 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[i + j + 4]);
732                 AcpiOsPrintf ("%08X ", Temp32);
733                 break;
734             }
735 
736             j += (ACPI_NATIVE_UINT) Display;
737         }
738 
739         /*
740          * Print the ASCII equivalent characters but watch out for the bad
741          * unprintable ones (printable chars are 0x20 through 0x7E)
742          */
743         AcpiOsPrintf (" ");
744         for (j = 0; j < 16; j++)
745         {
746             if (i + j >= Count)
747             {
748                 AcpiOsPrintf ("\n");
749                 return;
750             }
751 
752             BufChar = Buffer[i + j];
753             if (ACPI_IS_PRINT (BufChar))
754             {
755                 AcpiOsPrintf ("%c", BufChar);
756             }
757             else
758             {
759                 AcpiOsPrintf (".");
760             }
761         }
762 
763         /* Done with that line. */
764 
765         AcpiOsPrintf ("\n");
766         i += 16;
767     }
768 
769     return;
770 }
771 
772 
773 /*******************************************************************************
774  *
775  * FUNCTION:    AcpiUtDumpBuffer
776  *
777  * PARAMETERS:  Buffer              - Buffer to dump
778  *              Count               - Amount to dump, in bytes
779  *              Display             - BYTE, WORD, DWORD, or QWORD display
780  *              ComponentID         - Caller's component ID
781  *
782  * RETURN:      None
783  *
784  * DESCRIPTION: Generic dump buffer in both hex and ascii.
785  *
786  ******************************************************************************/
787 
788 void
789 AcpiUtDumpBuffer (
790     UINT8                   *Buffer,
791     UINT32                  Count,
792     UINT32                  Display,
793     UINT32                  ComponentId)
794 {
795 
796     /* Only dump the buffer if tracing is enabled */
797 
798     if (!((ACPI_LV_TABLES & AcpiDbgLevel) &&
799         (ComponentId & AcpiDbgLayer)))
800     {
801         return;
802     }
803 
804     AcpiUtDumpBuffer2 (Buffer, Count, Display);
805 }
806 
807 
808