utdebug.c revision 231844
1290001Sglebius/******************************************************************************
2290001Sglebius *
3290001Sglebius * Module Name: utdebug - Debug print routines
4290001Sglebius *
5290001Sglebius *****************************************************************************/
6290001Sglebius
7290001Sglebius/*
8290001Sglebius * Copyright (C) 2000 - 2012, Intel Corp.
9290001Sglebius * All rights reserved.
10290001Sglebius *
11290001Sglebius * Redistribution and use in source and binary forms, with or without
12290001Sglebius * modification, are permitted provided that the following conditions
13290001Sglebius * are met:
14290001Sglebius * 1. Redistributions of source code must retain the above copyright
15290001Sglebius *    notice, this list of conditions, and the following disclaimer,
16290001Sglebius *    without modification.
17290001Sglebius * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18290001Sglebius *    substantially similar to the "NO WARRANTY" disclaimer below
19290001Sglebius *    ("Disclaimer") and any redistribution must be conditioned upon
20290001Sglebius *    including a substantially similar Disclaimer requirement for further
21290001Sglebius *    binary redistribution.
22290001Sglebius * 3. Neither the names of the above-listed copyright holders nor the names
23290001Sglebius *    of any contributors may be used to endorse or promote products derived
24290001Sglebius *    from this software without specific prior written permission.
25290001Sglebius *
26290001Sglebius * Alternatively, this software may be distributed under the terms of the
27290001Sglebius * GNU General Public License ("GPL") version 2 as published by the Free
28290001Sglebius * Software Foundation.
29290001Sglebius *
30290001Sglebius * NO WARRANTY
31290001Sglebius * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32290001Sglebius * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33290001Sglebius * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34290001Sglebius * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35290001Sglebius * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36290001Sglebius * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37290001Sglebius * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38290001Sglebius * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39290001Sglebius * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40290001Sglebius * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41290001Sglebius * POSSIBILITY OF SUCH DAMAGES.
42290001Sglebius */
43290001Sglebius
44290001Sglebius#define __UTDEBUG_C__
45290001Sglebius
46290001Sglebius#include <contrib/dev/acpica/include/acpi.h>
47290001Sglebius#include <contrib/dev/acpica/include/accommon.h>
48290001Sglebius
49290001Sglebius#define _COMPONENT          ACPI_UTILITIES
50290001Sglebius        ACPI_MODULE_NAME    ("utdebug")
51290001Sglebius
52290001Sglebius
53290001Sglebius#ifdef ACPI_DEBUG_OUTPUT
54290001Sglebius
55290001Sglebiusstatic ACPI_THREAD_ID       AcpiGbl_PrevThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF;
56290001Sglebiusstatic char                 *AcpiGbl_FnEntryStr = "----Entry";
57290001Sglebiusstatic char                 *AcpiGbl_FnExitStr  = "----Exit-";
58290001Sglebius
59290001Sglebius/* Local prototypes */
60290001Sglebius
61290001Sglebiusstatic const char *
62290001SglebiusAcpiUtTrimFunctionName (
63290001Sglebius    const char              *FunctionName);
64290001Sglebius
65290001Sglebius
66290001Sglebius/*******************************************************************************
67290001Sglebius *
68290001Sglebius * FUNCTION:    AcpiUtInitStackPtrTrace
69290001Sglebius *
70290001Sglebius * PARAMETERS:  None
71290001Sglebius *
72290001Sglebius * RETURN:      None
73290001Sglebius *
74290001Sglebius * DESCRIPTION: Save the current CPU stack pointer at subsystem startup
75290001Sglebius *
76290001Sglebius ******************************************************************************/
77290001Sglebius
78290001Sglebiusvoid
79290001SglebiusAcpiUtInitStackPtrTrace (
80290001Sglebius    void)
81290001Sglebius{
82290001Sglebius    ACPI_SIZE               CurrentSp;
83290001Sglebius
84290001Sglebius
85290001Sglebius    AcpiGbl_EntryStackPointer = &CurrentSp;
86290001Sglebius}
87290001Sglebius
88290001Sglebius
89290001Sglebius/*******************************************************************************
90290001Sglebius *
91290001Sglebius * FUNCTION:    AcpiUtTrackStackPtr
92290001Sglebius *
93290001Sglebius * PARAMETERS:  None
94290001Sglebius *
95290001Sglebius * RETURN:      None
96290001Sglebius *
97290001Sglebius * DESCRIPTION: Save the current CPU stack pointer
98290001Sglebius *
99290001Sglebius ******************************************************************************/
100290001Sglebius
101290001Sglebiusvoid
102290001SglebiusAcpiUtTrackStackPtr (
103290001Sglebius    void)
104290001Sglebius{
105290001Sglebius    ACPI_SIZE               CurrentSp;
106290001Sglebius
107290001Sglebius
108290001Sglebius    if (&CurrentSp < AcpiGbl_LowestStackPointer)
109290001Sglebius    {
110290001Sglebius        AcpiGbl_LowestStackPointer = &CurrentSp;
111290001Sglebius    }
112290001Sglebius
113290001Sglebius    if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting)
114290001Sglebius    {
115290001Sglebius        AcpiGbl_DeepestNesting = AcpiGbl_NestingLevel;
116290001Sglebius    }
117290001Sglebius}
118290001Sglebius
119290001Sglebius
120290001Sglebius/*******************************************************************************
121290001Sglebius *
122290001Sglebius * FUNCTION:    AcpiUtTrimFunctionName
123290001Sglebius *
124290001Sglebius * PARAMETERS:  FunctionName        - Ascii string containing a procedure name
125290001Sglebius *
126290001Sglebius * RETURN:      Updated pointer to the function name
127290001Sglebius *
128290001Sglebius * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
129290001Sglebius *              This allows compiler macros such as __FUNCTION__ to be used
130290001Sglebius *              with no change to the debug output.
131290001Sglebius *
132290001Sglebius ******************************************************************************/
133290001Sglebius
134290001Sglebiusstatic const char *
135290001SglebiusAcpiUtTrimFunctionName (
136290001Sglebius    const char              *FunctionName)
137290001Sglebius{
138290001Sglebius
139290001Sglebius    /* All Function names are longer than 4 chars, check is safe */
140290001Sglebius
141290001Sglebius    if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_MIXED)
142290001Sglebius    {
143290001Sglebius        /* This is the case where the original source has not been modified */
144290001Sglebius
145290001Sglebius        return (FunctionName + 4);
146290001Sglebius    }
147290001Sglebius
148290001Sglebius    if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_LOWER)
149290001Sglebius    {
150290001Sglebius        /* This is the case where the source has been 'linuxized' */
151290001Sglebius
152290001Sglebius        return (FunctionName + 5);
153290001Sglebius    }
154290001Sglebius
155290001Sglebius    return (FunctionName);
156290001Sglebius}
157290001Sglebius
158
159/*******************************************************************************
160 *
161 * FUNCTION:    AcpiDebugPrint
162 *
163 * PARAMETERS:  RequestedDebugLevel - Requested debug print level
164 *              LineNumber          - Caller's line number (for error output)
165 *              FunctionName        - Caller's procedure name
166 *              ModuleName          - Caller's module name
167 *              ComponentId         - Caller's component ID
168 *              Format              - Printf format field
169 *              ...                 - Optional printf arguments
170 *
171 * RETURN:      None
172 *
173 * DESCRIPTION: Print error message with prefix consisting of the module name,
174 *              line number, and component ID.
175 *
176 ******************************************************************************/
177
178void  ACPI_INTERNAL_VAR_XFACE
179AcpiDebugPrint (
180    UINT32                  RequestedDebugLevel,
181    UINT32                  LineNumber,
182    const char              *FunctionName,
183    const char              *ModuleName,
184    UINT32                  ComponentId,
185    const char              *Format,
186    ...)
187{
188    ACPI_THREAD_ID          ThreadId;
189    va_list                 args;
190
191
192    /*
193     * Stay silent if the debug level or component ID is disabled
194     */
195    if (!(RequestedDebugLevel & AcpiDbgLevel) ||
196        !(ComponentId & AcpiDbgLayer))
197    {
198        return;
199    }
200
201    /*
202     * Thread tracking and context switch notification
203     */
204    ThreadId = AcpiOsGetThreadId ();
205    if (ThreadId != AcpiGbl_PrevThreadId)
206    {
207        if (ACPI_LV_THREADS & AcpiDbgLevel)
208        {
209            AcpiOsPrintf (
210                "\n**** Context Switch from TID %u to TID %u ****\n\n",
211                (UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId);
212        }
213
214        AcpiGbl_PrevThreadId = ThreadId;
215    }
216
217    /*
218     * Display the module name, current line number, thread ID (if requested),
219     * current procedure nesting level, and the current procedure name
220     */
221    AcpiOsPrintf ("%8s-%04ld ", ModuleName, LineNumber);
222
223    if (ACPI_LV_THREADS & AcpiDbgLevel)
224    {
225        AcpiOsPrintf ("[%u] ", (UINT32) ThreadId);
226    }
227
228    AcpiOsPrintf ("[%02ld] %-22.22s: ",
229        AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName));
230
231    va_start (args, Format);
232    AcpiOsVprintf (Format, args);
233    va_end (args);
234}
235
236ACPI_EXPORT_SYMBOL (AcpiDebugPrint)
237
238
239/*******************************************************************************
240 *
241 * FUNCTION:    AcpiDebugPrintRaw
242 *
243 * PARAMETERS:  RequestedDebugLevel - Requested debug print level
244 *              LineNumber          - Caller's line number
245 *              FunctionName        - Caller's procedure name
246 *              ModuleName          - Caller's module name
247 *              ComponentId         - Caller's component ID
248 *              Format              - Printf format field
249 *              ...                 - Optional printf arguments
250 *
251 * RETURN:      None
252 *
253 * DESCRIPTION: Print message with no headers.  Has same interface as
254 *              DebugPrint so that the same macros can be used.
255 *
256 ******************************************************************************/
257
258void  ACPI_INTERNAL_VAR_XFACE
259AcpiDebugPrintRaw (
260    UINT32                  RequestedDebugLevel,
261    UINT32                  LineNumber,
262    const char              *FunctionName,
263    const char              *ModuleName,
264    UINT32                  ComponentId,
265    const char              *Format,
266    ...)
267{
268    va_list                 args;
269
270
271    if (!(RequestedDebugLevel & AcpiDbgLevel) ||
272        !(ComponentId & AcpiDbgLayer))
273    {
274        return;
275    }
276
277    va_start (args, Format);
278    AcpiOsVprintf (Format, args);
279    va_end (args);
280}
281
282ACPI_EXPORT_SYMBOL (AcpiDebugPrintRaw)
283
284
285/*******************************************************************************
286 *
287 * FUNCTION:    AcpiUtTrace
288 *
289 * PARAMETERS:  LineNumber          - Caller's line number
290 *              FunctionName        - Caller's procedure name
291 *              ModuleName          - Caller's module name
292 *              ComponentId         - Caller's component ID
293 *
294 * RETURN:      None
295 *
296 * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
297 *              set in DebugLevel
298 *
299 ******************************************************************************/
300
301void
302AcpiUtTrace (
303    UINT32                  LineNumber,
304    const char              *FunctionName,
305    const char              *ModuleName,
306    UINT32                  ComponentId)
307{
308
309    AcpiGbl_NestingLevel++;
310    AcpiUtTrackStackPtr ();
311
312    AcpiDebugPrint (ACPI_LV_FUNCTIONS,
313        LineNumber, FunctionName, ModuleName, ComponentId,
314        "%s\n", AcpiGbl_FnEntryStr);
315}
316
317ACPI_EXPORT_SYMBOL (AcpiUtTrace)
318
319
320/*******************************************************************************
321 *
322 * FUNCTION:    AcpiUtTracePtr
323 *
324 * PARAMETERS:  LineNumber          - Caller's line number
325 *              FunctionName        - Caller's procedure name
326 *              ModuleName          - Caller's module name
327 *              ComponentId         - Caller's component ID
328 *              Pointer             - Pointer to display
329 *
330 * RETURN:      None
331 *
332 * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
333 *              set in DebugLevel
334 *
335 ******************************************************************************/
336
337void
338AcpiUtTracePtr (
339    UINT32                  LineNumber,
340    const char              *FunctionName,
341    const char              *ModuleName,
342    UINT32                  ComponentId,
343    void                    *Pointer)
344{
345    AcpiGbl_NestingLevel++;
346    AcpiUtTrackStackPtr ();
347
348    AcpiDebugPrint (ACPI_LV_FUNCTIONS,
349        LineNumber, FunctionName, ModuleName, ComponentId,
350        "%s %p\n", AcpiGbl_FnEntryStr, Pointer);
351}
352
353
354/*******************************************************************************
355 *
356 * FUNCTION:    AcpiUtTraceStr
357 *
358 * PARAMETERS:  LineNumber          - Caller's line number
359 *              FunctionName        - Caller's procedure name
360 *              ModuleName          - Caller's module name
361 *              ComponentId         - Caller's component ID
362 *              String              - Additional string to display
363 *
364 * RETURN:      None
365 *
366 * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
367 *              set in DebugLevel
368 *
369 ******************************************************************************/
370
371void
372AcpiUtTraceStr (
373    UINT32                  LineNumber,
374    const char              *FunctionName,
375    const char              *ModuleName,
376    UINT32                  ComponentId,
377    char                    *String)
378{
379
380    AcpiGbl_NestingLevel++;
381    AcpiUtTrackStackPtr ();
382
383    AcpiDebugPrint (ACPI_LV_FUNCTIONS,
384        LineNumber, FunctionName, ModuleName, ComponentId,
385        "%s %s\n", AcpiGbl_FnEntryStr, String);
386}
387
388
389/*******************************************************************************
390 *
391 * FUNCTION:    AcpiUtTraceU32
392 *
393 * PARAMETERS:  LineNumber          - Caller's line number
394 *              FunctionName        - Caller's procedure name
395 *              ModuleName          - Caller's module name
396 *              ComponentId         - Caller's component ID
397 *              Integer             - Integer to display
398 *
399 * RETURN:      None
400 *
401 * DESCRIPTION: Function entry trace.  Prints only if TRACE_FUNCTIONS bit is
402 *              set in DebugLevel
403 *
404 ******************************************************************************/
405
406void
407AcpiUtTraceU32 (
408    UINT32                  LineNumber,
409    const char              *FunctionName,
410    const char              *ModuleName,
411    UINT32                  ComponentId,
412    UINT32                  Integer)
413{
414
415    AcpiGbl_NestingLevel++;
416    AcpiUtTrackStackPtr ();
417
418    AcpiDebugPrint (ACPI_LV_FUNCTIONS,
419        LineNumber, FunctionName, ModuleName, ComponentId,
420        "%s %08X\n", AcpiGbl_FnEntryStr, Integer);
421}
422
423
424/*******************************************************************************
425 *
426 * FUNCTION:    AcpiUtExit
427 *
428 * PARAMETERS:  LineNumber          - Caller's line number
429 *              FunctionName        - Caller's procedure name
430 *              ModuleName          - Caller's module name
431 *              ComponentId         - Caller's component ID
432 *
433 * RETURN:      None
434 *
435 * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
436 *              set in DebugLevel
437 *
438 ******************************************************************************/
439
440void
441AcpiUtExit (
442    UINT32                  LineNumber,
443    const char              *FunctionName,
444    const char              *ModuleName,
445    UINT32                  ComponentId)
446{
447
448    AcpiDebugPrint (ACPI_LV_FUNCTIONS,
449        LineNumber, FunctionName, ModuleName, ComponentId,
450        "%s\n", AcpiGbl_FnExitStr);
451
452    AcpiGbl_NestingLevel--;
453}
454
455ACPI_EXPORT_SYMBOL (AcpiUtExit)
456
457
458/*******************************************************************************
459 *
460 * FUNCTION:    AcpiUtStatusExit
461 *
462 * PARAMETERS:  LineNumber          - Caller's line number
463 *              FunctionName        - Caller's procedure name
464 *              ModuleName          - Caller's module name
465 *              ComponentId         - Caller's component ID
466 *              Status              - Exit status code
467 *
468 * RETURN:      None
469 *
470 * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
471 *              set in DebugLevel.  Prints exit status also.
472 *
473 ******************************************************************************/
474
475void
476AcpiUtStatusExit (
477    UINT32                  LineNumber,
478    const char              *FunctionName,
479    const char              *ModuleName,
480    UINT32                  ComponentId,
481    ACPI_STATUS             Status)
482{
483
484    if (ACPI_SUCCESS (Status))
485    {
486        AcpiDebugPrint (ACPI_LV_FUNCTIONS,
487            LineNumber, FunctionName, ModuleName, ComponentId,
488            "%s %s\n", AcpiGbl_FnExitStr,
489            AcpiFormatException (Status));
490    }
491    else
492    {
493        AcpiDebugPrint (ACPI_LV_FUNCTIONS,
494            LineNumber, FunctionName, ModuleName, ComponentId,
495            "%s ****Exception****: %s\n", AcpiGbl_FnExitStr,
496            AcpiFormatException (Status));
497    }
498
499    AcpiGbl_NestingLevel--;
500}
501
502ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
503
504
505/*******************************************************************************
506 *
507 * FUNCTION:    AcpiUtValueExit
508 *
509 * PARAMETERS:  LineNumber          - Caller's line number
510 *              FunctionName        - Caller's procedure name
511 *              ModuleName          - Caller's module name
512 *              ComponentId         - Caller's component ID
513 *              Value               - Value to be printed with exit msg
514 *
515 * RETURN:      None
516 *
517 * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
518 *              set in DebugLevel.  Prints exit value also.
519 *
520 ******************************************************************************/
521
522void
523AcpiUtValueExit (
524    UINT32                  LineNumber,
525    const char              *FunctionName,
526    const char              *ModuleName,
527    UINT32                  ComponentId,
528    UINT64                  Value)
529{
530
531    AcpiDebugPrint (ACPI_LV_FUNCTIONS,
532        LineNumber, FunctionName, ModuleName, ComponentId,
533        "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr,
534        ACPI_FORMAT_UINT64 (Value));
535
536    AcpiGbl_NestingLevel--;
537}
538
539ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
540
541
542/*******************************************************************************
543 *
544 * FUNCTION:    AcpiUtPtrExit
545 *
546 * PARAMETERS:  LineNumber          - Caller's line number
547 *              FunctionName        - Caller's procedure name
548 *              ModuleName          - Caller's module name
549 *              ComponentId         - Caller's component ID
550 *              Ptr                 - Pointer to display
551 *
552 * RETURN:      None
553 *
554 * DESCRIPTION: Function exit trace.  Prints only if TRACE_FUNCTIONS bit is
555 *              set in DebugLevel.  Prints exit value also.
556 *
557 ******************************************************************************/
558
559void
560AcpiUtPtrExit (
561    UINT32                  LineNumber,
562    const char              *FunctionName,
563    const char              *ModuleName,
564    UINT32                  ComponentId,
565    UINT8                   *Ptr)
566{
567
568    AcpiDebugPrint (ACPI_LV_FUNCTIONS,
569        LineNumber, FunctionName, ModuleName, ComponentId,
570        "%s %p\n", AcpiGbl_FnExitStr, Ptr);
571
572    AcpiGbl_NestingLevel--;
573}
574
575#endif
576
577
578/*******************************************************************************
579 *
580 * FUNCTION:    AcpiUtDumpBuffer
581 *
582 * PARAMETERS:  Buffer              - Buffer to dump
583 *              Count               - Amount to dump, in bytes
584 *              Display             - BYTE, WORD, DWORD, or QWORD display
585 *              ComponentID         - Caller's component ID
586 *
587 * RETURN:      None
588 *
589 * DESCRIPTION: Generic dump buffer in both hex and ascii.
590 *
591 ******************************************************************************/
592
593void
594AcpiUtDumpBuffer2 (
595    UINT8                   *Buffer,
596    UINT32                  Count,
597    UINT32                  Display)
598{
599    UINT32                  i = 0;
600    UINT32                  j;
601    UINT32                  Temp32;
602    UINT8                   BufChar;
603
604
605    if (!Buffer)
606    {
607        AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n");
608        return;
609    }
610
611    if ((Count < 4) || (Count & 0x01))
612    {
613        Display = DB_BYTE_DISPLAY;
614    }
615
616    /* Nasty little dump buffer routine! */
617
618    while (i < Count)
619    {
620        /* Print current offset */
621
622        AcpiOsPrintf ("%6.4X: ", i);
623
624        /* Print 16 hex chars */
625
626        for (j = 0; j < 16;)
627        {
628            if (i + j >= Count)
629            {
630                /* Dump fill spaces */
631
632                AcpiOsPrintf ("%*s", ((Display * 2) + 1), " ");
633                j += Display;
634                continue;
635            }
636
637            switch (Display)
638            {
639            case DB_BYTE_DISPLAY:
640            default:    /* Default is BYTE display */
641
642                AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]);
643                break;
644
645
646            case DB_WORD_DISPLAY:
647
648                ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
649                AcpiOsPrintf ("%04X ", Temp32);
650                break;
651
652
653            case DB_DWORD_DISPLAY:
654
655                ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
656                AcpiOsPrintf ("%08X ", Temp32);
657                break;
658
659
660            case DB_QWORD_DISPLAY:
661
662                ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
663                AcpiOsPrintf ("%08X", Temp32);
664
665                ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
666                AcpiOsPrintf ("%08X ", Temp32);
667                break;
668            }
669
670            j += Display;
671        }
672
673        /*
674         * Print the ASCII equivalent characters but watch out for the bad
675         * unprintable ones (printable chars are 0x20 through 0x7E)
676         */
677        AcpiOsPrintf (" ");
678        for (j = 0; j < 16; j++)
679        {
680            if (i + j >= Count)
681            {
682                AcpiOsPrintf ("\n");
683                return;
684            }
685
686            BufChar = Buffer[(ACPI_SIZE) i + j];
687            if (ACPI_IS_PRINT (BufChar))
688            {
689                AcpiOsPrintf ("%c", BufChar);
690            }
691            else
692            {
693                AcpiOsPrintf (".");
694            }
695        }
696
697        /* Done with that line. */
698
699        AcpiOsPrintf ("\n");
700        i += 16;
701    }
702
703    return;
704}
705
706
707/*******************************************************************************
708 *
709 * FUNCTION:    AcpiUtDumpBuffer
710 *
711 * PARAMETERS:  Buffer              - Buffer to dump
712 *              Count               - Amount to dump, in bytes
713 *              Display             - BYTE, WORD, DWORD, or QWORD display
714 *              ComponentID         - Caller's component ID
715 *
716 * RETURN:      None
717 *
718 * DESCRIPTION: Generic dump buffer in both hex and ascii.
719 *
720 ******************************************************************************/
721
722void
723AcpiUtDumpBuffer (
724    UINT8                   *Buffer,
725    UINT32                  Count,
726    UINT32                  Display,
727    UINT32                  ComponentId)
728{
729
730    /* Only dump the buffer if tracing is enabled */
731
732    if (!((ACPI_LV_TABLES & AcpiDbgLevel) &&
733        (ComponentId & AcpiDbgLayer)))
734    {
735        return;
736    }
737
738    AcpiUtDumpBuffer2 (Buffer, Count, Display);
739}
740
741
742