diff options
Diffstat (limited to 'source/components/utilities')
| -rw-r--r-- | source/components/utilities/utbuffer.c | 26 | ||||
| -rw-r--r-- | source/components/utilities/utdebug.c | 30 | ||||
| -rw-r--r-- | source/components/utilities/utinit.c | 2 | ||||
| -rw-r--r-- | source/components/utilities/utpredef.c | 2 | ||||
| -rw-r--r-- | source/components/utilities/utprint.c | 121 | ||||
| -rw-r--r-- | source/components/utilities/uttrack.c | 4 | ||||
| -rw-r--r-- | source/components/utilities/utxface.c | 2 | ||||
| -rw-r--r-- | source/components/utilities/utxfinit.c | 6 |
8 files changed, 126 insertions, 67 deletions
diff --git a/source/components/utilities/utbuffer.c b/source/components/utilities/utbuffer.c index 863055f7375d..19c670796929 100644 --- a/source/components/utilities/utbuffer.c +++ b/source/components/utilities/utbuffer.c @@ -264,7 +264,7 @@ AcpiUtDumpBufferToFile ( if (!Buffer) { - AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n"); + fprintf (File, "Null Buffer Pointer in DumpBuffer!\n"); return; } @@ -279,7 +279,7 @@ AcpiUtDumpBufferToFile ( { /* Print current offset */ - AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i)); + fprintf (File, "%6.4X: ", (BaseOffset + i)); /* Print 16 hex chars */ @@ -289,7 +289,7 @@ AcpiUtDumpBufferToFile ( { /* Dump fill spaces */ - AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " "); + fprintf (File, "%*s", ((Display * 2) + 1), " "); j += Display; continue; } @@ -299,28 +299,28 @@ AcpiUtDumpBufferToFile ( case DB_BYTE_DISPLAY: default: /* Default is BYTE display */ - AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]); + fprintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]); break; case DB_WORD_DISPLAY: ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiUtFilePrintf (File, "%04X ", Temp32); + fprintf (File, "%04X ", Temp32); break; case DB_DWORD_DISPLAY: ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiUtFilePrintf (File, "%08X ", Temp32); + fprintf (File, "%08X ", Temp32); break; case DB_QWORD_DISPLAY: ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiUtFilePrintf (File, "%08X", Temp32); + fprintf (File, "%08X", Temp32); ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]); - AcpiUtFilePrintf (File, "%08X ", Temp32); + fprintf (File, "%08X ", Temp32); break; } @@ -331,29 +331,29 @@ AcpiUtDumpBufferToFile ( * Print the ASCII equivalent characters but watch out for the bad * unprintable ones (printable chars are 0x20 through 0x7E) */ - AcpiUtFilePrintf (File, " "); + fprintf (File, " "); for (j = 0; j < 16; j++) { if (i + j >= Count) { - AcpiUtFilePrintf (File, "\n"); + fprintf (File, "\n"); return; } BufChar = Buffer[(ACPI_SIZE) i + j]; if (isprint (BufChar)) { - AcpiUtFilePrintf (File, "%c", BufChar); + fprintf (File, "%c", BufChar); } else { - AcpiUtFilePrintf (File, "."); + fprintf (File, "."); } } /* Done with that line. */ - AcpiUtFilePrintf (File, "\n"); + fprintf (File, "\n"); i += 16; } diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c index 6a298d175b34..10785399d7d5 100644 --- a/source/components/utilities/utdebug.c +++ b/source/components/utilities/utdebug.c @@ -708,33 +708,3 @@ AcpiTracePoint ( ACPI_EXPORT_SYMBOL (AcpiTracePoint) #endif - - -#ifdef ACPI_APPLICATION -/******************************************************************************* - * - * FUNCTION: AcpiLogError - * - * PARAMETERS: Format - Printf format field - * ... - Optional printf arguments - * - * RETURN: None - * - * DESCRIPTION: Print error message to the console, used by applications. - * - ******************************************************************************/ - -void ACPI_INTERNAL_VAR_XFACE -AcpiLogError ( - const char *Format, - ...) -{ - va_list Args; - - va_start (Args, Format); - (void) AcpiUtFileVprintf (ACPI_FILE_ERR, Format, Args); - va_end (Args); -} - -ACPI_EXPORT_SYMBOL (AcpiLogError) -#endif diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c index 03c3e510b82d..c3da33d06cbb 100644 --- a/source/components/utilities/utinit.c +++ b/source/components/utilities/utinit.c @@ -226,7 +226,7 @@ AcpiUtInitGlobals ( AcpiGbl_NextOwnerIdOffset = 0; AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; AcpiGbl_OsiMutex = NULL; - AcpiGbl_MaxLoopIterations = 0xFFFF; + AcpiGbl_MaxLoopIterations = ACPI_MAX_LOOP_COUNT; /* Hardware oriented */ diff --git a/source/components/utilities/utpredef.c b/source/components/utilities/utpredef.c index 0f6658ecf7f8..ced72a7331a3 100644 --- a/source/components/utilities/utpredef.c +++ b/source/components/utilities/utpredef.c @@ -196,8 +196,6 @@ AcpiUtGetExpectedReturnTypes ( ******************************************************************************/ #if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP) -#include <stdio.h> -#include <string.h> /* Local prototypes */ diff --git a/source/components/utilities/utprint.c b/source/components/utilities/utprint.c index e01f1734a94f..7d4c48939aeb 100644 --- a/source/components/utilities/utprint.c +++ b/source/components/utilities/utprint.c @@ -416,7 +416,7 @@ AcpiUtFormatNumber ( /******************************************************************************* * - * FUNCTION: AcpiUtVsnprintf + * FUNCTION: vsnprintf * * PARAMETERS: String - String with boundary * Size - Boundary of the string @@ -430,7 +430,7 @@ AcpiUtFormatNumber ( ******************************************************************************/ int -AcpiUtVsnprintf ( +vsnprintf ( char *String, ACPI_SIZE Size, const char *Format, @@ -713,7 +713,7 @@ AcpiUtVsnprintf ( /******************************************************************************* * - * FUNCTION: AcpiUtSnprintf + * FUNCTION: snprintf * * PARAMETERS: String - String with boundary * Size - Boundary of the string @@ -726,7 +726,7 @@ AcpiUtVsnprintf ( ******************************************************************************/ int -AcpiUtSnprintf ( +snprintf ( char *String, ACPI_SIZE Size, const char *Format, @@ -737,7 +737,38 @@ AcpiUtSnprintf ( va_start (Args, Format); - Length = AcpiUtVsnprintf (String, Size, Format, Args); + Length = vsnprintf (String, Size, Format, Args); + va_end (Args); + + return (Length); +} + + +/******************************************************************************* + * + * FUNCTION: sprintf + * + * PARAMETERS: String - String with boundary + * Format, ... - Standard printf format + * + * RETURN: Number of bytes actually written. + * + * DESCRIPTION: Formatted output to a string. + * + ******************************************************************************/ + +int +sprintf ( + char *String, + const char *Format, + ...) +{ + va_list Args; + int Length; + + + va_start (Args, Format); + Length = vsnprintf (String, ACPI_UINT32_MAX, Format, Args); va_end (Args); return (Length); @@ -747,7 +778,69 @@ AcpiUtSnprintf ( #ifdef ACPI_APPLICATION /******************************************************************************* * - * FUNCTION: AcpiUtFileVprintf + * FUNCTION: vprintf + * + * PARAMETERS: Format - Standard printf format + * Args - Argument list + * + * RETURN: Number of bytes actually written. + * + * DESCRIPTION: Formatted output to stdout using argument list pointer. + * + ******************************************************************************/ + +int +vprintf ( + const char *Format, + va_list Args) +{ + ACPI_CPU_FLAGS Flags; + int Length; + + + Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock); + Length = vsnprintf (AcpiGbl_PrintBuffer, + sizeof (AcpiGbl_PrintBuffer), Format, Args); + + (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, ACPI_FILE_OUT); + AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags); + + return (Length); +} + + +/******************************************************************************* + * + * FUNCTION: printf + * + * PARAMETERS: Format, ... - Standard printf format + * + * RETURN: Number of bytes actually written. + * + * DESCRIPTION: Formatted output to stdout. + * + ******************************************************************************/ + +int +printf ( + const char *Format, + ...) +{ + va_list Args; + int Length; + + + va_start (Args, Format); + Length = vprintf (Format, Args); + va_end (Args); + + return (Length); +} + + +/******************************************************************************* + * + * FUNCTION: vfprintf * * PARAMETERS: File - File descriptor * Format - Standard printf format @@ -760,8 +853,8 @@ AcpiUtSnprintf ( ******************************************************************************/ int -AcpiUtFileVprintf ( - ACPI_FILE File, +vfprintf ( + FILE *File, const char *Format, va_list Args) { @@ -770,10 +863,10 @@ AcpiUtFileVprintf ( Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock); - Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer, + Length = vsnprintf (AcpiGbl_PrintBuffer, sizeof (AcpiGbl_PrintBuffer), Format, Args); - (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1); + (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, File); AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags); return (Length); @@ -782,7 +875,7 @@ AcpiUtFileVprintf ( /******************************************************************************* * - * FUNCTION: AcpiUtFilePrintf + * FUNCTION: fprintf * * PARAMETERS: File - File descriptor * Format, ... - Standard printf format @@ -794,8 +887,8 @@ AcpiUtFileVprintf ( ******************************************************************************/ int -AcpiUtFilePrintf ( - ACPI_FILE File, +fprintf ( + FILE *File, const char *Format, ...) { @@ -804,7 +897,7 @@ AcpiUtFilePrintf ( va_start (Args, Format); - Length = AcpiUtFileVprintf (File, Format, Args); + Length = vfprintf (File, Format, Args); va_end (Args); return (Length); diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c index 9efa9d6ec75d..2902e2c8b6fa 100644 --- a/source/components/utilities/uttrack.c +++ b/source/components/utilities/uttrack.c @@ -107,14 +107,12 @@ AcpiUtCreateList ( ACPI_MEMORY_LIST *Cache; - Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST)); + Cache = AcpiOsAllocateZeroed (sizeof (ACPI_MEMORY_LIST)); if (!Cache) { return (AE_NO_MEMORY); } - memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); - Cache->ListName = ListName; Cache->ObjectSize = ObjectSize; diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c index a8452c32955b..ff91886466a3 100644 --- a/source/components/utilities/utxface.c +++ b/source/components/utilities/utxface.c @@ -63,7 +63,7 @@ * ******************************************************************************/ -ACPI_STATUS +ACPI_STATUS ACPI_INIT_FUNCTION AcpiTerminate ( void) { diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c index 2a518bc82d99..7d7758815869 100644 --- a/source/components/utilities/utxfinit.c +++ b/source/components/utilities/utxfinit.c @@ -72,7 +72,7 @@ AeDoObjectOverrides ( * ******************************************************************************/ -ACPI_STATUS +ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeSubsystem ( void) { @@ -151,7 +151,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeSubsystem) * ******************************************************************************/ -ACPI_STATUS +ACPI_STATUS ACPI_INIT_FUNCTION AcpiEnableSubsystem ( UINT32 Flags) { @@ -263,7 +263,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiEnableSubsystem) * ******************************************************************************/ -ACPI_STATUS +ACPI_STATUS ACPI_INIT_FUNCTION AcpiInitializeObjects ( UINT32 Flags) { |
