Home | History | Annotate | Line # | Download | only in utilities
utdebug.c revision 1.4.8.1
      1      1.1  jruoho /******************************************************************************
      2      1.1  jruoho  *
      3  1.4.8.1    yamt  * Module Name: utdebug - Debug print/trace routines
      4      1.1  jruoho  *
      5      1.1  jruoho  *****************************************************************************/
      6      1.1  jruoho 
      7      1.3  jruoho /*
      8  1.4.8.1    yamt  * Copyright (C) 2000 - 2013, Intel Corp.
      9      1.1  jruoho  * All rights reserved.
     10      1.1  jruoho  *
     11      1.3  jruoho  * Redistribution and use in source and binary forms, with or without
     12      1.3  jruoho  * modification, are permitted provided that the following conditions
     13      1.3  jruoho  * are met:
     14      1.3  jruoho  * 1. Redistributions of source code must retain the above copyright
     15      1.3  jruoho  *    notice, this list of conditions, and the following disclaimer,
     16      1.3  jruoho  *    without modification.
     17      1.3  jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18      1.3  jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19      1.3  jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20      1.3  jruoho  *    including a substantially similar Disclaimer requirement for further
     21      1.3  jruoho  *    binary redistribution.
     22      1.3  jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23      1.3  jruoho  *    of any contributors may be used to endorse or promote products derived
     24      1.3  jruoho  *    from this software without specific prior written permission.
     25      1.3  jruoho  *
     26      1.3  jruoho  * Alternatively, this software may be distributed under the terms of the
     27      1.3  jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28      1.3  jruoho  * Software Foundation.
     29      1.3  jruoho  *
     30      1.3  jruoho  * NO WARRANTY
     31      1.3  jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32      1.3  jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33      1.3  jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34      1.3  jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35      1.3  jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36      1.3  jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37      1.3  jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38      1.3  jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39      1.3  jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40      1.3  jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41      1.3  jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42      1.3  jruoho  */
     43      1.1  jruoho 
     44      1.1  jruoho #define __UTDEBUG_C__
     45  1.4.8.1    yamt #define EXPORT_ACPI_INTERFACES
     46      1.1  jruoho 
     47      1.1  jruoho #include "acpi.h"
     48      1.1  jruoho #include "accommon.h"
     49      1.1  jruoho 
     50      1.1  jruoho #define _COMPONENT          ACPI_UTILITIES
     51      1.1  jruoho         ACPI_MODULE_NAME    ("utdebug")
     52      1.1  jruoho 
     53      1.1  jruoho 
     54      1.1  jruoho #ifdef ACPI_DEBUG_OUTPUT
     55      1.1  jruoho 
     56      1.1  jruoho static ACPI_THREAD_ID       AcpiGbl_PrevThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF;
     57      1.2  jruoho static const char           *AcpiGbl_FnEntryStr = "----Entry";
     58      1.2  jruoho static const char           *AcpiGbl_FnExitStr  = "----Exit-";
     59      1.1  jruoho 
     60      1.1  jruoho /* Local prototypes */
     61      1.1  jruoho 
     62      1.1  jruoho static const char *
     63      1.1  jruoho AcpiUtTrimFunctionName (
     64      1.1  jruoho     const char              *FunctionName);
     65      1.1  jruoho 
     66      1.1  jruoho 
     67      1.1  jruoho /*******************************************************************************
     68      1.1  jruoho  *
     69      1.1  jruoho  * FUNCTION:    AcpiUtInitStackPtrTrace
     70      1.1  jruoho  *
     71      1.1  jruoho  * PARAMETERS:  None
     72      1.1  jruoho  *
     73      1.1  jruoho  * RETURN:      None
     74      1.1  jruoho  *
     75      1.1  jruoho  * DESCRIPTION: Save the current CPU stack pointer at subsystem startup
     76      1.1  jruoho  *
     77      1.1  jruoho  ******************************************************************************/
     78      1.1  jruoho 
     79      1.1  jruoho void
     80      1.1  jruoho AcpiUtInitStackPtrTrace (
     81      1.1  jruoho     void)
     82      1.1  jruoho {
     83      1.1  jruoho     ACPI_SIZE               CurrentSp;
     84      1.1  jruoho 
     85      1.1  jruoho 
     86      1.1  jruoho     AcpiGbl_EntryStackPointer = &CurrentSp;
     87      1.1  jruoho }
     88      1.1  jruoho 
     89      1.1  jruoho 
     90      1.1  jruoho /*******************************************************************************
     91      1.1  jruoho  *
     92      1.1  jruoho  * FUNCTION:    AcpiUtTrackStackPtr
     93      1.1  jruoho  *
     94      1.1  jruoho  * PARAMETERS:  None
     95      1.1  jruoho  *
     96      1.1  jruoho  * RETURN:      None
     97      1.1  jruoho  *
     98      1.1  jruoho  * DESCRIPTION: Save the current CPU stack pointer
     99      1.1  jruoho  *
    100      1.1  jruoho  ******************************************************************************/
    101      1.1  jruoho 
    102      1.1  jruoho void
    103      1.1  jruoho AcpiUtTrackStackPtr (
    104      1.1  jruoho     void)
    105      1.1  jruoho {
    106      1.1  jruoho     ACPI_SIZE               CurrentSp;
    107      1.1  jruoho 
    108      1.1  jruoho 
    109      1.1  jruoho     if (&CurrentSp < AcpiGbl_LowestStackPointer)
    110      1.1  jruoho     {
    111      1.1  jruoho         AcpiGbl_LowestStackPointer = &CurrentSp;
    112      1.1  jruoho     }
    113      1.1  jruoho 
    114      1.1  jruoho     if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting)
    115      1.1  jruoho     {
    116      1.1  jruoho         AcpiGbl_DeepestNesting = AcpiGbl_NestingLevel;
    117      1.1  jruoho     }
    118      1.1  jruoho }
    119      1.1  jruoho 
    120      1.1  jruoho 
    121      1.1  jruoho /*******************************************************************************
    122      1.1  jruoho  *
    123      1.1  jruoho  * FUNCTION:    AcpiUtTrimFunctionName
    124      1.1  jruoho  *
    125      1.1  jruoho  * PARAMETERS:  FunctionName        - Ascii string containing a procedure name
    126      1.1  jruoho  *
    127      1.1  jruoho  * RETURN:      Updated pointer to the function name
    128      1.1  jruoho  *
    129      1.1  jruoho  * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
    130      1.1  jruoho  *              This allows compiler macros such as __FUNCTION__ to be used
    131      1.1  jruoho  *              with no change to the debug output.
    132      1.1  jruoho  *
    133      1.1  jruoho  ******************************************************************************/
    134      1.1  jruoho 
    135      1.1  jruoho static const char *
    136      1.1  jruoho AcpiUtTrimFunctionName (
    137      1.1  jruoho     const char              *FunctionName)
    138      1.1  jruoho {
    139      1.1  jruoho 
    140      1.1  jruoho     /* All Function names are longer than 4 chars, check is safe */
    141      1.1  jruoho 
    142      1.1  jruoho     if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_MIXED)
    143      1.1  jruoho     {
    144      1.1  jruoho         /* This is the case where the original source has not been modified */
    145      1.1  jruoho 
    146      1.1  jruoho         return (FunctionName + 4);
    147      1.1  jruoho     }
    148      1.1  jruoho 
    149      1.1  jruoho     if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_LOWER)
    150      1.1  jruoho     {
    151      1.1  jruoho         /* This is the case where the source has been 'linuxized' */
    152      1.1  jruoho 
    153      1.1  jruoho         return (FunctionName + 5);
    154      1.1  jruoho     }
    155      1.1  jruoho 
    156      1.1  jruoho     return (FunctionName);
    157      1.1  jruoho }
    158      1.1  jruoho 
    159      1.1  jruoho 
    160      1.1  jruoho /*******************************************************************************
    161      1.1  jruoho  *
    162      1.1  jruoho  * FUNCTION:    AcpiDebugPrint
    163      1.1  jruoho  *
    164      1.1  jruoho  * PARAMETERS:  RequestedDebugLevel - Requested debug print level
    165      1.1  jruoho  *              LineNumber          - Caller's line number (for error output)
    166      1.1  jruoho  *              FunctionName        - Caller's procedure name
    167      1.1  jruoho  *              ModuleName          - Caller's module name
    168      1.1  jruoho  *              ComponentId         - Caller's component ID
    169      1.1  jruoho  *              Format              - Printf format field
    170      1.1  jruoho  *              ...                 - Optional printf arguments
    171      1.1  jruoho  *
    172      1.1  jruoho  * RETURN:      None
    173      1.1  jruoho  *
    174      1.1  jruoho  * DESCRIPTION: Print error message with prefix consisting of the module name,
    175      1.1  jruoho  *              line number, and component ID.
    176      1.1  jruoho  *
    177      1.1  jruoho  ******************************************************************************/
    178      1.1  jruoho 
    179      1.1  jruoho void  ACPI_INTERNAL_VAR_XFACE
    180      1.1  jruoho AcpiDebugPrint (
    181      1.1  jruoho     UINT32                  RequestedDebugLevel,
    182      1.1  jruoho     UINT32                  LineNumber,
    183      1.1  jruoho     const char              *FunctionName,
    184      1.1  jruoho     const char              *ModuleName,
    185      1.1  jruoho     UINT32                  ComponentId,
    186      1.1  jruoho     const char              *Format,
    187      1.1  jruoho     ...)
    188      1.1  jruoho {
    189      1.1  jruoho     ACPI_THREAD_ID          ThreadId;
    190      1.1  jruoho     va_list                 args;
    191      1.1  jruoho 
    192      1.1  jruoho 
    193  1.4.8.1    yamt     /* Check if debug output enabled */
    194  1.4.8.1    yamt 
    195  1.4.8.1    yamt     if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId))
    196      1.1  jruoho     {
    197      1.1  jruoho         return;
    198      1.1  jruoho     }
    199      1.1  jruoho 
    200      1.1  jruoho     /*
    201      1.1  jruoho      * Thread tracking and context switch notification
    202      1.1  jruoho      */
    203      1.1  jruoho     ThreadId = AcpiOsGetThreadId ();
    204      1.1  jruoho     if (ThreadId != AcpiGbl_PrevThreadId)
    205      1.1  jruoho     {
    206      1.1  jruoho         if (ACPI_LV_THREADS & AcpiDbgLevel)
    207      1.1  jruoho         {
    208      1.1  jruoho             AcpiOsPrintf (
    209      1.3  jruoho                 "\n**** Context Switch from TID %u to TID %u ****\n\n",
    210      1.3  jruoho                 (UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId);
    211      1.1  jruoho         }
    212      1.1  jruoho 
    213      1.1  jruoho         AcpiGbl_PrevThreadId = ThreadId;
    214  1.4.8.1    yamt         AcpiGbl_NestingLevel = 0;
    215      1.1  jruoho     }
    216      1.1  jruoho 
    217      1.1  jruoho     /*
    218      1.1  jruoho      * Display the module name, current line number, thread ID (if requested),
    219      1.1  jruoho      * current procedure nesting level, and the current procedure name
    220      1.1  jruoho      */
    221  1.4.8.1    yamt     AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
    222      1.1  jruoho 
    223  1.4.8.1    yamt #ifdef ACPI_APPLICATION
    224  1.4.8.1    yamt     /*
    225  1.4.8.1    yamt      * For AcpiExec/iASL only, emit the thread ID and nesting level.
    226  1.4.8.1    yamt      * Note: nesting level is really only useful during a single-thread
    227  1.4.8.1    yamt      * execution. Otherwise, multiple threads will keep resetting the
    228  1.4.8.1    yamt      * level.
    229  1.4.8.1    yamt      */
    230      1.1  jruoho     if (ACPI_LV_THREADS & AcpiDbgLevel)
    231      1.1  jruoho     {
    232      1.3  jruoho         AcpiOsPrintf ("[%u] ", (UINT32) ThreadId);
    233      1.1  jruoho     }
    234      1.1  jruoho 
    235  1.4.8.1    yamt     AcpiOsPrintf ("[%02ld] ", AcpiGbl_NestingLevel);
    236  1.4.8.1    yamt #endif
    237  1.4.8.1    yamt 
    238  1.4.8.1    yamt     AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName));
    239      1.1  jruoho 
    240      1.1  jruoho     va_start (args, Format);
    241      1.1  jruoho     AcpiOsVprintf (Format, args);
    242      1.1  jruoho     va_end (args);
    243      1.1  jruoho }
    244      1.1  jruoho 
    245      1.1  jruoho ACPI_EXPORT_SYMBOL (AcpiDebugPrint)
    246      1.1  jruoho 
    247      1.1  jruoho 
    248      1.1  jruoho /*******************************************************************************
    249      1.1  jruoho  *
    250      1.1  jruoho  * FUNCTION:    AcpiDebugPrintRaw
    251      1.1  jruoho  *
    252      1.1  jruoho  * PARAMETERS:  RequestedDebugLevel - Requested debug print level
    253      1.1  jruoho  *              LineNumber          - Caller's line number
    254      1.1  jruoho  *              FunctionName        - Caller's procedure name
    255      1.1  jruoho  *              ModuleName          - Caller's module name
    256      1.1  jruoho  *              ComponentId         - Caller's component ID
    257      1.1  jruoho  *              Format              - Printf format field
    258      1.1  jruoho  *              ...                 - Optional printf arguments
    259      1.1  jruoho  *
    260      1.1  jruoho  * RETURN:      None
    261      1.1  jruoho  *
    262  1.4.8.1    yamt  * DESCRIPTION: Print message with no headers. Has same interface as
    263      1.1  jruoho  *              DebugPrint so that the same macros can be used.
    264      1.1  jruoho  *
    265      1.1  jruoho  ******************************************************************************/
    266      1.1  jruoho 
    267      1.1  jruoho void  ACPI_INTERNAL_VAR_XFACE
    268      1.1  jruoho AcpiDebugPrintRaw (
    269      1.1  jruoho     UINT32                  RequestedDebugLevel,
    270      1.1  jruoho     UINT32                  LineNumber,
    271      1.1  jruoho     const char              *FunctionName,
    272      1.1  jruoho     const char              *ModuleName,
    273      1.1  jruoho     UINT32                  ComponentId,
    274      1.1  jruoho     const char              *Format,
    275      1.1  jruoho     ...)
    276      1.1  jruoho {
    277      1.1  jruoho     va_list                 args;
    278      1.1  jruoho 
    279      1.1  jruoho 
    280  1.4.8.1    yamt     /* Check if debug output enabled */
    281  1.4.8.1    yamt 
    282  1.4.8.1    yamt     if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId))
    283      1.1  jruoho     {
    284      1.1  jruoho         return;
    285      1.1  jruoho     }
    286      1.1  jruoho 
    287      1.1  jruoho     va_start (args, Format);
    288      1.1  jruoho     AcpiOsVprintf (Format, args);
    289      1.1  jruoho     va_end (args);
    290      1.1  jruoho }
    291      1.1  jruoho 
    292      1.1  jruoho ACPI_EXPORT_SYMBOL (AcpiDebugPrintRaw)
    293      1.1  jruoho 
    294      1.1  jruoho 
    295      1.1  jruoho /*******************************************************************************
    296      1.1  jruoho  *
    297      1.1  jruoho  * FUNCTION:    AcpiUtTrace
    298      1.1  jruoho  *
    299      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    300      1.1  jruoho  *              FunctionName        - Caller's procedure name
    301      1.1  jruoho  *              ModuleName          - Caller's module name
    302      1.1  jruoho  *              ComponentId         - Caller's component ID
    303      1.1  jruoho  *
    304      1.1  jruoho  * RETURN:      None
    305      1.1  jruoho  *
    306  1.4.8.1    yamt  * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
    307      1.1  jruoho  *              set in DebugLevel
    308      1.1  jruoho  *
    309      1.1  jruoho  ******************************************************************************/
    310      1.1  jruoho 
    311      1.1  jruoho void
    312      1.1  jruoho AcpiUtTrace (
    313      1.1  jruoho     UINT32                  LineNumber,
    314      1.1  jruoho     const char              *FunctionName,
    315      1.1  jruoho     const char              *ModuleName,
    316      1.1  jruoho     UINT32                  ComponentId)
    317      1.1  jruoho {
    318      1.1  jruoho 
    319      1.1  jruoho     AcpiGbl_NestingLevel++;
    320      1.1  jruoho     AcpiUtTrackStackPtr ();
    321      1.1  jruoho 
    322  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    323  1.4.8.1    yamt 
    324  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    325  1.4.8.1    yamt     {
    326  1.4.8.1    yamt         AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    327  1.4.8.1    yamt             LineNumber, FunctionName, ModuleName, ComponentId,
    328  1.4.8.1    yamt             "%s\n", AcpiGbl_FnEntryStr);
    329  1.4.8.1    yamt     }
    330      1.1  jruoho }
    331      1.1  jruoho 
    332      1.1  jruoho ACPI_EXPORT_SYMBOL (AcpiUtTrace)
    333      1.1  jruoho 
    334      1.1  jruoho 
    335      1.1  jruoho /*******************************************************************************
    336      1.1  jruoho  *
    337      1.1  jruoho  * FUNCTION:    AcpiUtTracePtr
    338      1.1  jruoho  *
    339      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    340      1.1  jruoho  *              FunctionName        - Caller's procedure name
    341      1.1  jruoho  *              ModuleName          - Caller's module name
    342      1.1  jruoho  *              ComponentId         - Caller's component ID
    343      1.1  jruoho  *              Pointer             - Pointer to display
    344      1.1  jruoho  *
    345      1.1  jruoho  * RETURN:      None
    346      1.1  jruoho  *
    347  1.4.8.1    yamt  * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
    348      1.1  jruoho  *              set in DebugLevel
    349      1.1  jruoho  *
    350      1.1  jruoho  ******************************************************************************/
    351      1.1  jruoho 
    352      1.1  jruoho void
    353      1.1  jruoho AcpiUtTracePtr (
    354      1.1  jruoho     UINT32                  LineNumber,
    355      1.1  jruoho     const char              *FunctionName,
    356      1.1  jruoho     const char              *ModuleName,
    357      1.1  jruoho     UINT32                  ComponentId,
    358      1.1  jruoho     void                    *Pointer)
    359      1.1  jruoho {
    360  1.4.8.1    yamt 
    361      1.1  jruoho     AcpiGbl_NestingLevel++;
    362      1.1  jruoho     AcpiUtTrackStackPtr ();
    363      1.1  jruoho 
    364  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    365  1.4.8.1    yamt 
    366  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    367  1.4.8.1    yamt     {
    368  1.4.8.1    yamt         AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    369  1.4.8.1    yamt             LineNumber, FunctionName, ModuleName, ComponentId,
    370  1.4.8.1    yamt             "%s %p\n", AcpiGbl_FnEntryStr, Pointer);
    371  1.4.8.1    yamt     }
    372      1.1  jruoho }
    373      1.1  jruoho 
    374      1.1  jruoho 
    375      1.1  jruoho /*******************************************************************************
    376      1.1  jruoho  *
    377      1.1  jruoho  * FUNCTION:    AcpiUtTraceStr
    378      1.1  jruoho  *
    379      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    380      1.1  jruoho  *              FunctionName        - Caller's procedure name
    381      1.1  jruoho  *              ModuleName          - Caller's module name
    382      1.1  jruoho  *              ComponentId         - Caller's component ID
    383      1.1  jruoho  *              String              - Additional string to display
    384      1.1  jruoho  *
    385      1.1  jruoho  * RETURN:      None
    386      1.1  jruoho  *
    387  1.4.8.1    yamt  * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
    388      1.1  jruoho  *              set in DebugLevel
    389      1.1  jruoho  *
    390      1.1  jruoho  ******************************************************************************/
    391      1.1  jruoho 
    392      1.1  jruoho void
    393      1.1  jruoho AcpiUtTraceStr (
    394      1.1  jruoho     UINT32                  LineNumber,
    395      1.1  jruoho     const char              *FunctionName,
    396      1.1  jruoho     const char              *ModuleName,
    397      1.1  jruoho     UINT32                  ComponentId,
    398      1.4  jruoho     const char              *String)
    399      1.1  jruoho {
    400      1.1  jruoho 
    401      1.1  jruoho     AcpiGbl_NestingLevel++;
    402      1.1  jruoho     AcpiUtTrackStackPtr ();
    403      1.1  jruoho 
    404  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    405  1.4.8.1    yamt 
    406  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    407  1.4.8.1    yamt     {
    408  1.4.8.1    yamt         AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    409  1.4.8.1    yamt             LineNumber, FunctionName, ModuleName, ComponentId,
    410  1.4.8.1    yamt             "%s %s\n", AcpiGbl_FnEntryStr, String);
    411  1.4.8.1    yamt     }
    412      1.1  jruoho }
    413      1.1  jruoho 
    414      1.1  jruoho 
    415      1.1  jruoho /*******************************************************************************
    416      1.1  jruoho  *
    417      1.1  jruoho  * FUNCTION:    AcpiUtTraceU32
    418      1.1  jruoho  *
    419      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    420      1.1  jruoho  *              FunctionName        - Caller's procedure name
    421      1.1  jruoho  *              ModuleName          - Caller's module name
    422      1.1  jruoho  *              ComponentId         - Caller's component ID
    423      1.1  jruoho  *              Integer             - Integer to display
    424      1.1  jruoho  *
    425      1.1  jruoho  * RETURN:      None
    426      1.1  jruoho  *
    427  1.4.8.1    yamt  * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
    428      1.1  jruoho  *              set in DebugLevel
    429      1.1  jruoho  *
    430      1.1  jruoho  ******************************************************************************/
    431      1.1  jruoho 
    432      1.1  jruoho void
    433      1.1  jruoho AcpiUtTraceU32 (
    434      1.1  jruoho     UINT32                  LineNumber,
    435      1.1  jruoho     const char              *FunctionName,
    436      1.1  jruoho     const char              *ModuleName,
    437      1.1  jruoho     UINT32                  ComponentId,
    438      1.1  jruoho     UINT32                  Integer)
    439      1.1  jruoho {
    440      1.1  jruoho 
    441      1.1  jruoho     AcpiGbl_NestingLevel++;
    442      1.1  jruoho     AcpiUtTrackStackPtr ();
    443      1.1  jruoho 
    444  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    445  1.4.8.1    yamt 
    446  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    447  1.4.8.1    yamt     {
    448  1.4.8.1    yamt         AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    449  1.4.8.1    yamt             LineNumber, FunctionName, ModuleName, ComponentId,
    450  1.4.8.1    yamt             "%s %08X\n", AcpiGbl_FnEntryStr, Integer);
    451  1.4.8.1    yamt     }
    452      1.1  jruoho }
    453      1.1  jruoho 
    454      1.1  jruoho 
    455      1.1  jruoho /*******************************************************************************
    456      1.1  jruoho  *
    457      1.1  jruoho  * FUNCTION:    AcpiUtExit
    458      1.1  jruoho  *
    459      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    460      1.1  jruoho  *              FunctionName        - Caller's procedure name
    461      1.1  jruoho  *              ModuleName          - Caller's module name
    462      1.1  jruoho  *              ComponentId         - Caller's component ID
    463      1.1  jruoho  *
    464      1.1  jruoho  * RETURN:      None
    465      1.1  jruoho  *
    466  1.4.8.1    yamt  * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
    467      1.1  jruoho  *              set in DebugLevel
    468      1.1  jruoho  *
    469      1.1  jruoho  ******************************************************************************/
    470      1.1  jruoho 
    471      1.1  jruoho void
    472      1.1  jruoho AcpiUtExit (
    473      1.1  jruoho     UINT32                  LineNumber,
    474      1.1  jruoho     const char              *FunctionName,
    475      1.1  jruoho     const char              *ModuleName,
    476      1.1  jruoho     UINT32                  ComponentId)
    477      1.1  jruoho {
    478      1.1  jruoho 
    479  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    480  1.4.8.1    yamt 
    481  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    482  1.4.8.1    yamt     {
    483  1.4.8.1    yamt         AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    484  1.4.8.1    yamt             LineNumber, FunctionName, ModuleName, ComponentId,
    485  1.4.8.1    yamt             "%s\n", AcpiGbl_FnExitStr);
    486  1.4.8.1    yamt     }
    487      1.1  jruoho 
    488  1.4.8.1    yamt     if (AcpiGbl_NestingLevel)
    489  1.4.8.1    yamt     {
    490  1.4.8.1    yamt         AcpiGbl_NestingLevel--;
    491  1.4.8.1    yamt     }
    492      1.1  jruoho }
    493      1.1  jruoho 
    494      1.1  jruoho ACPI_EXPORT_SYMBOL (AcpiUtExit)
    495      1.1  jruoho 
    496      1.1  jruoho 
    497      1.1  jruoho /*******************************************************************************
    498      1.1  jruoho  *
    499      1.1  jruoho  * FUNCTION:    AcpiUtStatusExit
    500      1.1  jruoho  *
    501      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    502      1.1  jruoho  *              FunctionName        - Caller's procedure name
    503      1.1  jruoho  *              ModuleName          - Caller's module name
    504      1.1  jruoho  *              ComponentId         - Caller's component ID
    505      1.1  jruoho  *              Status              - Exit status code
    506      1.1  jruoho  *
    507      1.1  jruoho  * RETURN:      None
    508      1.1  jruoho  *
    509  1.4.8.1    yamt  * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
    510  1.4.8.1    yamt  *              set in DebugLevel. Prints exit status also.
    511      1.1  jruoho  *
    512      1.1  jruoho  ******************************************************************************/
    513      1.1  jruoho 
    514      1.1  jruoho void
    515      1.1  jruoho AcpiUtStatusExit (
    516      1.1  jruoho     UINT32                  LineNumber,
    517      1.1  jruoho     const char              *FunctionName,
    518      1.1  jruoho     const char              *ModuleName,
    519      1.1  jruoho     UINT32                  ComponentId,
    520      1.1  jruoho     ACPI_STATUS             Status)
    521      1.1  jruoho {
    522      1.1  jruoho 
    523  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    524  1.4.8.1    yamt 
    525  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    526      1.1  jruoho     {
    527  1.4.8.1    yamt         if (ACPI_SUCCESS (Status))
    528  1.4.8.1    yamt         {
    529  1.4.8.1    yamt             AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    530  1.4.8.1    yamt                 LineNumber, FunctionName, ModuleName, ComponentId,
    531  1.4.8.1    yamt                 "%s %s\n", AcpiGbl_FnExitStr,
    532  1.4.8.1    yamt                 AcpiFormatException (Status));
    533  1.4.8.1    yamt         }
    534  1.4.8.1    yamt         else
    535  1.4.8.1    yamt         {
    536  1.4.8.1    yamt             AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    537  1.4.8.1    yamt                 LineNumber, FunctionName, ModuleName, ComponentId,
    538  1.4.8.1    yamt                 "%s ****Exception****: %s\n", AcpiGbl_FnExitStr,
    539  1.4.8.1    yamt                 AcpiFormatException (Status));
    540  1.4.8.1    yamt         }
    541      1.1  jruoho     }
    542  1.4.8.1    yamt 
    543  1.4.8.1    yamt     if (AcpiGbl_NestingLevel)
    544      1.1  jruoho     {
    545  1.4.8.1    yamt         AcpiGbl_NestingLevel--;
    546      1.1  jruoho     }
    547      1.1  jruoho }
    548      1.1  jruoho 
    549      1.1  jruoho ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
    550      1.1  jruoho 
    551      1.1  jruoho 
    552      1.1  jruoho /*******************************************************************************
    553      1.1  jruoho  *
    554      1.1  jruoho  * FUNCTION:    AcpiUtValueExit
    555      1.1  jruoho  *
    556      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    557      1.1  jruoho  *              FunctionName        - Caller's procedure name
    558      1.1  jruoho  *              ModuleName          - Caller's module name
    559      1.1  jruoho  *              ComponentId         - Caller's component ID
    560      1.1  jruoho  *              Value               - Value to be printed with exit msg
    561      1.1  jruoho  *
    562      1.1  jruoho  * RETURN:      None
    563      1.1  jruoho  *
    564  1.4.8.1    yamt  * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
    565  1.4.8.1    yamt  *              set in DebugLevel. Prints exit value also.
    566      1.1  jruoho  *
    567      1.1  jruoho  ******************************************************************************/
    568      1.1  jruoho 
    569      1.1  jruoho void
    570      1.1  jruoho AcpiUtValueExit (
    571      1.1  jruoho     UINT32                  LineNumber,
    572      1.1  jruoho     const char              *FunctionName,
    573      1.1  jruoho     const char              *ModuleName,
    574      1.1  jruoho     UINT32                  ComponentId,
    575      1.1  jruoho     UINT64                  Value)
    576      1.1  jruoho {
    577      1.1  jruoho 
    578  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    579  1.4.8.1    yamt 
    580  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    581  1.4.8.1    yamt     {
    582  1.4.8.1    yamt         AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    583  1.4.8.1    yamt             LineNumber, FunctionName, ModuleName, ComponentId,
    584  1.4.8.1    yamt             "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr,
    585  1.4.8.1    yamt             ACPI_FORMAT_UINT64 (Value));
    586  1.4.8.1    yamt     }
    587      1.1  jruoho 
    588  1.4.8.1    yamt     if (AcpiGbl_NestingLevel)
    589  1.4.8.1    yamt     {
    590  1.4.8.1    yamt         AcpiGbl_NestingLevel--;
    591  1.4.8.1    yamt     }
    592      1.1  jruoho }
    593      1.1  jruoho 
    594      1.1  jruoho ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
    595      1.1  jruoho 
    596      1.1  jruoho 
    597      1.1  jruoho /*******************************************************************************
    598      1.1  jruoho  *
    599      1.1  jruoho  * FUNCTION:    AcpiUtPtrExit
    600      1.1  jruoho  *
    601      1.1  jruoho  * PARAMETERS:  LineNumber          - Caller's line number
    602      1.1  jruoho  *              FunctionName        - Caller's procedure name
    603      1.1  jruoho  *              ModuleName          - Caller's module name
    604      1.1  jruoho  *              ComponentId         - Caller's component ID
    605      1.1  jruoho  *              Ptr                 - Pointer to display
    606      1.1  jruoho  *
    607      1.1  jruoho  * RETURN:      None
    608      1.1  jruoho  *
    609  1.4.8.1    yamt  * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
    610  1.4.8.1    yamt  *              set in DebugLevel. Prints exit value also.
    611      1.1  jruoho  *
    612      1.1  jruoho  ******************************************************************************/
    613      1.1  jruoho 
    614      1.1  jruoho void
    615      1.1  jruoho AcpiUtPtrExit (
    616      1.1  jruoho     UINT32                  LineNumber,
    617      1.1  jruoho     const char              *FunctionName,
    618      1.1  jruoho     const char              *ModuleName,
    619      1.1  jruoho     UINT32                  ComponentId,
    620      1.1  jruoho     UINT8                   *Ptr)
    621      1.1  jruoho {
    622      1.1  jruoho 
    623  1.4.8.1    yamt     /* Check if enabled up-front for performance */
    624      1.1  jruoho 
    625  1.4.8.1    yamt     if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
    626      1.1  jruoho     {
    627  1.4.8.1    yamt         AcpiDebugPrint (ACPI_LV_FUNCTIONS,
    628  1.4.8.1    yamt             LineNumber, FunctionName, ModuleName, ComponentId,
    629  1.4.8.1    yamt             "%s %p\n", AcpiGbl_FnExitStr, Ptr);
    630      1.1  jruoho     }
    631      1.1  jruoho 
    632  1.4.8.1    yamt     if (AcpiGbl_NestingLevel)
    633      1.1  jruoho     {
    634  1.4.8.1    yamt         AcpiGbl_NestingLevel--;
    635      1.1  jruoho     }
    636      1.1  jruoho }
    637      1.1  jruoho 
    638  1.4.8.1    yamt #endif
    639