Some Lint changes; 16-bit changes

date	2002.04.15.22.46.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 19:03:47 +00:00
parent 566306af42
commit 85c94c9571
2 changed files with 405 additions and 378 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: cmclib - Local implementation of C library functions
* $Revision: 1.41 $
* $Revision: 1.46 $
*
*****************************************************************************/
@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* All rights reserved.
*
* 2. License
@ -118,11 +118,6 @@
#define __CMCLIB_C__
#include "acpi.h"
#include "acevents.h"
#include "achware.h"
#include "acnamesp.h"
#include "acinterp.h"
#include "amlcode.h"
/*
* These implementations of standard C Library routines can optionally be
@ -130,8 +125,8 @@
* than an inline or assembly implementation
*/
#define _COMPONENT MISCELLANEOUS
MODULE_NAME ("cmclib")
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("cmclib")
#ifndef ACPI_USE_SYSTEM_CLIBRARY
@ -295,7 +290,7 @@ AcpiUtStrcmp (
*
******************************************************************************/
UINT32
int
AcpiUtStrncmp (
const NATIVE_CHAR *String1,
const NATIVE_CHAR *String2,
@ -472,19 +467,7 @@ AcpiUtMemset (
#define NEGATIVE 1
#define POSITIVE 0
#define _ACPI_XA 0x00 /* extra alphabetic - not supported */
#define _ACPI_XS 0x40 /* extra space */
#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */
#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */
#define _ACPI_DI 0x04 /* '0'-'9' */
#define _ACPI_LO 0x02 /* 'a'-'z' */
#define _ACPI_PU 0x10 /* punctuation */
#define _ACPI_SP 0x08 /* space */
#define _ACPI_UP 0x01 /* 'A'-'Z' */
#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */
static const UINT8 _acpi_ctype[257] = {
const UINT8 _acpi_ctype[257] = {
_ACPI_CN, /* 0x0 0. */
_ACPI_CN, /* 0x1 1. */
_ACPI_CN, /* 0x2 2. */
@ -643,9 +626,9 @@ static const UINT8 _acpi_ctype[257] = {
*
******************************************************************************/
UINT32
int
AcpiUtToUpper (
UINT32 c)
int c)
{
return (IS_LOWER(c) ? ((c)-0x20) : (c));
@ -664,9 +647,9 @@ AcpiUtToUpper (
*
******************************************************************************/
UINT32
int
AcpiUtToLower (
UINT32 c)
int c)
{
return (IS_UPPER(c) ? ((c)+0x20) : (c));
@ -832,11 +815,11 @@ AcpiUtStrtoul (
{
if (IS_DIGIT (*String))
{
index = *String - '0';
index = (UINT32) ((UINT8) *String - '0');
}
else
{
index = AcpiUtToUpper (*String);
index = (UINT32) AcpiUtToUpper (*String);
if (IS_UPPER (index))
{
index = index - 'A' + 10;

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: cmdebug - Debug print routines
* Module Name: utdebug - Debug print routines
* $Revision: 1.101 $
*
*****************************************************************************/
@ -9,8 +9,8 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999, Intel Corp. All rights
* reserved.
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* All rights reserved.
*
* 2. License
*
@ -114,331 +114,87 @@
*
*****************************************************************************/
#define __CMDEBUG_C__
#define __UTDEBUG_C__
#include "acpi.h"
#define _COMPONENT MISCELLANEOUS
MODULE_NAME ("cmdebug");
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utdebug")
static UINT32 AcpiGbl_PrevThreadId = 0xFFFFFFFF;
static char *AcpiGbl_FnEntryStr = "----Entry";
static char *AcpiGbl_FnExitStr = "----Exit-";
#ifdef ACPI_DEBUG
/*****************************************************************************
*
* FUNCTION: Get/Set debug level
* FUNCTION: AcpiUtInitStackPtrTrace
*
* DESCRIPTION: Get or set value of the debug flag
*
* These are used to allow user's to get/set the debug level
*
****************************************************************************/
INT32
GetDebugLevel (void)
{
return AcpiDbgLevel;
}
void
SetDebugLevel (
INT32 NewDebugLevel)
{
AcpiDbgLevel = NewDebugLevel;
}
/*****************************************************************************
*
* FUNCTION: FunctionTrace
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
* DESCRIPTION: Save the current stack pointer
*
****************************************************************************/
void
FunctionTrace (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName)
AcpiUtInitStackPtrTrace (
void)
{
UINT32 CurrentSp;
AcpiGbl_NestingLevel++;
DebugPrint (ModuleName, LineNumber, ComponentId,
TRACE_FUNCTIONS,
" %2.2ld Entered Function: %s\n",
AcpiGbl_NestingLevel, FunctionName);
AcpiGbl_EntryStackPointer = ACPI_PTR_DIFF (&CurrentSp, NULL);
}
/*****************************************************************************
*
* FUNCTION: FunctionTracePtr
* FUNCTION: AcpiUtTrackStackPtr
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
* Pointer - Pointer to display
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
* DESCRIPTION: Save the current stack pointer
*
****************************************************************************/
void
FunctionTracePtr (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName,
void *Pointer)
AcpiUtTrackStackPtr (
void)
{
ACPI_SIZE CurrentSp;
AcpiGbl_NestingLevel++;
DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
" %2.2ld Entered Function: %s, 0x%p\n",
AcpiGbl_NestingLevel, FunctionName, Pointer);
CurrentSp = ACPI_PTR_DIFF (&CurrentSp, NULL);
if (CurrentSp < AcpiGbl_LowestStackPointer)
{
AcpiGbl_LowestStackPointer = CurrentSp;
}
if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting)
{
AcpiGbl_DeepestNesting = AcpiGbl_NestingLevel;
}
}
/*****************************************************************************
*
* FUNCTION: FunctionTraceStr
* FUNCTION: AcpiUtDebugPrint
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* PARAMETERS: DebugLevel - Requested debug print level
* ProcName - Caller's procedure name
* ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
* String - Additional string to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
FunctionTraceStr (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName,
INT8 *String)
{
AcpiGbl_NestingLevel++;
DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
" %2.2ld Entered Function: %s, %s\n",
AcpiGbl_NestingLevel, FunctionName, String);
}
/*****************************************************************************
*
* FUNCTION: FunctionTraceU32
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
* Integer - Integer to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
FunctionTraceU32 (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName,
UINT32 Integer)
{
AcpiGbl_NestingLevel++;
DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
" %2.2ld Entered Function: %s, 0x%lX\n",
AcpiGbl_NestingLevel, FunctionName, Integer);
}
/*****************************************************************************
*
* FUNCTION: FunctionExit
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
FunctionExit (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName)
{
DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
" %2.2ld Exiting Function: %s\n",
AcpiGbl_NestingLevel, FunctionName);
AcpiGbl_NestingLevel--;
}
/*****************************************************************************
*
* FUNCTION: FunctionStatusExit
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
* Status - Exit status code
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel. Prints exit status also.
*
****************************************************************************/
void
FunctionStatusExit (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName,
ACPI_STATUS Status)
{
if (Status > ACPI_MAX_STATUS)
{
DebugPrint (ModuleName, LineNumber, ComponentId,
TRACE_FUNCTIONS,
" %2.2ld Exiting Function: %s, [Unknown Status] 0x%X\n",
AcpiGbl_NestingLevel,
FunctionName,
Status);
}
else
{
DebugPrint (ModuleName, LineNumber, ComponentId,
TRACE_FUNCTIONS,
" %2.2ld Exiting Function: %s, %s\n",
AcpiGbl_NestingLevel,
FunctionName,
AcpiCmFormatException (Status));
}
AcpiGbl_NestingLevel--;
}
/*****************************************************************************
*
* FUNCTION: FunctionValueExit
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
* Value - Value to be printed with exit msg
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel. Prints exit value also.
*
****************************************************************************/
void
FunctionValueExit (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName,
NATIVE_UINT Value)
{
DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
" %2.2ld Exiting Function: %s, 0x%X\n",
AcpiGbl_NestingLevel, FunctionName, Value);
AcpiGbl_NestingLevel--;
}
/*****************************************************************************
*
* FUNCTION: FunctionPtrExit
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* FunctionName - Name of Caller's function
* Value - Value to be printed with exit msg
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel. Prints exit value also.
*
****************************************************************************/
void
FunctionPtrExit (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT8 *FunctionName,
INT8 *Ptr)
{
DebugPrint (ModuleName, LineNumber, ComponentId, TRACE_FUNCTIONS,
" %2.2ld Exiting Function: %s, 0x%p\n",
AcpiGbl_NestingLevel, FunctionName, Ptr);
AcpiGbl_NestingLevel--;
}
/*****************************************************************************
*
* FUNCTION: DebugPrint
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
* PrintLevel - Requested debug print level
* Format - Printf format field
* ... - Optional printf arguments
*
@ -449,92 +205,378 @@ FunctionPtrExit (
*
****************************************************************************/
void
DebugPrint (
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
INT32 PrintLevel,
INT8 *Format,
void ACPI_INTERNAL_VAR_XFACE
AcpiUtDebugPrint (
UINT32 RequestedDebugLevel,
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
char *Format,
...)
{
UINT32 ThreadId;
va_list args;
/* Both the level and the component must be enabled */
if ((PrintLevel & AcpiDbgLevel) &&
(ComponentId & AcpiDbgLayer))
/*
* Stay silent if the debug level or component ID is disabled
*/
if (!(RequestedDebugLevel & AcpiDbgLevel) ||
!(DbgInfo->ComponentId & AcpiDbgLayer))
{
va_start (args, Format);
return;
}
AcpiOsPrintf ("%8s-%04d: ", ModuleName, LineNumber);
/*
* Thread tracking and context switch notification
*/
ThreadId = AcpiOsGetThreadId ();
if (ThreadId != AcpiGbl_PrevThreadId)
{
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf ("\n**** Context Switch from TID %X to TID %X ****\n\n",
AcpiGbl_PrevThreadId, ThreadId);
}
AcpiGbl_PrevThreadId = ThreadId;
}
/*
* Display the module name, current line number, thread ID (if requested),
* current procedure nesting level, and the current procedure name
*/
AcpiOsPrintf ("%8s-%04ld ", DbgInfo->ModuleName, LineNumber);
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf ("[%04lX] ", ThreadId, AcpiGbl_NestingLevel, DbgInfo->ProcName);
}
AcpiOsPrintf ("[%02ld] %-22.22s: ", AcpiGbl_NestingLevel, DbgInfo->ProcName);
va_start (args, Format);
AcpiOsVprintf (Format, args);
}
}
/*****************************************************************************
*
* FUNCTION: DebugPrintPrefix
* FUNCTION: AcpiUtDebugPrintRaw
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* ComponentId - Caller's component ID (for error output)
*
* RETURN: None
*
* DESCRIPTION: Print the prefix part of an error message, consisting of the
* module name, and line number
*
****************************************************************************/
void
DebugPrintPrefix (
INT8 *ModuleName,
INT32 LineNumber)
{
AcpiOsPrintf ("%8s-%04d: ", ModuleName, LineNumber);
}
/*****************************************************************************
*
* FUNCTION: DebugPrintRaw
*
* PARAMETERS: Format - Printf format field
* PARAMETERS: RequestedDebugLevel - Requested debug print level
* LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
* Format - Printf format field
* ... - Optional printf arguments
*
* RETURN: None
*
* DESCRIPTION: Print error message -- without module/line indentifiers
* DESCRIPTION: Print message with no headers. Has same interface as
* DebugPrint so that the same macros can be used.
*
****************************************************************************/
void
DebugPrintRaw (
INT8 *Format,
void ACPI_INTERNAL_VAR_XFACE
AcpiUtDebugPrintRaw (
UINT32 RequestedDebugLevel,
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
char *Format,
...)
{
va_list args;
if (!(RequestedDebugLevel & AcpiDbgLevel) ||
!(DbgInfo->ComponentId & AcpiDbgLayer))
{
return;
}
va_start (args, Format);
AcpiOsVprintf (Format, args);
va_end (args);
}
/*****************************************************************************
*
* FUNCTION: AcpiCmDumpBuffer
* FUNCTION: AcpiUtTrace
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
AcpiUtTrace (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo)
{
AcpiGbl_NestingLevel++;
AcpiUtTrackStackPtr ();
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s\n", AcpiGbl_FnEntryStr);
}
/*****************************************************************************
*
* FUNCTION: AcpiUtTracePtr
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
* Pointer - Pointer to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
AcpiUtTracePtr (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
void *Pointer)
{
AcpiGbl_NestingLevel++;
AcpiUtTrackStackPtr ();
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s %p\n", AcpiGbl_FnEntryStr, Pointer);
}
/*****************************************************************************
*
* FUNCTION: AcpiUtTraceStr
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
* String - Additional string to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
AcpiUtTraceStr (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
NATIVE_CHAR *String)
{
AcpiGbl_NestingLevel++;
AcpiUtTrackStackPtr ();
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s %s\n", AcpiGbl_FnEntryStr, String);
}
/*****************************************************************************
*
* FUNCTION: AcpiUtTraceU32
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
* Integer - Integer to display
*
* RETURN: None
*
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
AcpiUtTraceU32 (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
UINT32 Integer)
{
AcpiGbl_NestingLevel++;
AcpiUtTrackStackPtr ();
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s %08X\n", AcpiGbl_FnEntryStr, Integer);
}
/*****************************************************************************
*
* FUNCTION: AcpiUtExit
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel
*
****************************************************************************/
void
AcpiUtExit (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo)
{
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s\n", AcpiGbl_FnExitStr);
AcpiGbl_NestingLevel--;
}
/*****************************************************************************
*
* FUNCTION: AcpiUtStatusExit
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
* Status - Exit status code
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel. Prints exit status also.
*
****************************************************************************/
void
AcpiUtStatusExit (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
ACPI_STATUS Status)
{
if (ACPI_SUCCESS (Status))
{
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s %s\n", AcpiGbl_FnExitStr,
AcpiFormatException (Status));
}
else
{
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s ****Exception****: %s\n", AcpiGbl_FnExitStr,
AcpiFormatException (Status));
}
AcpiGbl_NestingLevel--;
}
/*****************************************************************************
*
* FUNCTION: AcpiUtValueExit
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
* Value - Value to be printed with exit msg
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel. Prints exit value also.
*
****************************************************************************/
void
AcpiUtValueExit (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
ACPI_INTEGER Value)
{
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s %8.8lX%8.8lX\n", AcpiGbl_FnExitStr,
ACPI_HIDWORD (Value), ACPI_LODWORD (Value));
AcpiGbl_NestingLevel--;
}
/*****************************************************************************
*
* FUNCTION: AcpiUtPtrExit
*
* PARAMETERS: LineNumber - Caller's line number
* DbgInfo - Contains:
* ProcName - Caller's procedure name
* ModuleName - Caller's module name
* ComponentId - Caller's component ID
* Value - Value to be printed with exit msg
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in DebugLevel. Prints exit value also.
*
****************************************************************************/
void
AcpiUtPtrExit (
UINT32 LineNumber,
ACPI_DEBUG_PRINT_INFO *DbgInfo,
UINT8 *Ptr)
{
AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo,
"%s %p\n", AcpiGbl_FnExitStr, Ptr);
AcpiGbl_NestingLevel--;
}
#endif
/*****************************************************************************
*
* FUNCTION: AcpiUtDumpBuffer
*
* PARAMETERS: Buffer - Buffer to dump
* Count - Amount to dump, in bytes
* Display - BYTE, WORD, DWORD, or QWORD display
* ComponentID - Caller's component ID
*
* RETURN: None
@ -544,26 +586,32 @@ DebugPrintRaw (
****************************************************************************/
void
AcpiCmDumpBuffer (
INT8 *Buffer,
AcpiUtDumpBuffer (
UINT8 *Buffer,
UINT32 Count,
UINT32 Display,
INT32 ComponentId)
UINT32 ComponentId)
{
UINT32 i = 0;
UINT32 j;
NATIVE_UINT i = 0;
NATIVE_UINT j;
UINT32 Temp32;
UINT8 BufChar;
/* Only dump the buffer if tracing is enabled */
if (!((TRACE_TABLES & AcpiDbgLevel) &&
if (!((ACPI_LV_TABLES & AcpiDbgLevel) &&
(ComponentId & AcpiDbgLayer)))
{
return;
}
if ((Count < 4) || (Count & 0x01))
{
Display = DB_BYTE_DISPLAY;
}
AcpiOsPrintf ("\nOffset Value\n");
/*
* Nasty little dump buffer routine!
@ -574,7 +622,6 @@ AcpiCmDumpBuffer (
AcpiOsPrintf ("%05X ", i);
/* Print 16 hex chars */
for (j = 0; j < 16;)
@ -601,7 +648,7 @@ AcpiCmDumpBuffer (
case DB_WORD_DISPLAY:
MOVE_UNALIGNED16_TO_32 (&Temp32,
ACPI_MOVE_UNALIGNED16_TO_32 (&Temp32,
&Buffer[i + j]);
AcpiOsPrintf ("%04X ", Temp32);
j += 2;
@ -610,7 +657,7 @@ AcpiCmDumpBuffer (
case DB_DWORD_DISPLAY:
MOVE_UNALIGNED32_TO_32 (&Temp32,
ACPI_MOVE_UNALIGNED32_TO_32 (&Temp32,
&Buffer[i + j]);
AcpiOsPrintf ("%08X ", Temp32);
j += 4;
@ -619,11 +666,11 @@ AcpiCmDumpBuffer (
case DB_QWORD_DISPLAY:
MOVE_UNALIGNED32_TO_32 (&Temp32,
ACPI_MOVE_UNALIGNED32_TO_32 (&Temp32,
&Buffer[i + j]);
AcpiOsPrintf ("%08X", Temp32);
MOVE_UNALIGNED32_TO_32 (&Temp32,
ACPI_MOVE_UNALIGNED32_TO_32 (&Temp32,
&Buffer[i + j + 4]);
AcpiOsPrintf ("%08X ", Temp32);
j += 8;
@ -631,12 +678,10 @@ AcpiCmDumpBuffer (
}
}
/*
* Print the ASCII equivalent characters
* But watch out for the bad unprintable ones...
*/
for (j = 0; j < 16; j++)
{
if (i + j >= Count)
@ -667,4 +712,3 @@ AcpiCmDumpBuffer (
return;
}