summaryrefslogtreecommitdiff
path: root/source/components/utilities
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2016-06-15 10:51:12 -0700
committerGitHub <noreply@github.com>2016-06-15 10:51:12 -0700
commitd776c9ee6e67f3b7a186d809763558ca7a358710 (patch)
tree22aee76d7f384a2553421abf763747a229bf0680 /source/components/utilities
parent8aac0be3c840747a032b63e7365c99190e2a0ba9 (diff)
downloadacpica-revert-143-efi-edk2.tar.gz
Revert "Efi edk2"revert-143-efi-edk2
Diffstat (limited to 'source/components/utilities')
-rw-r--r--source/components/utilities/utbuffer.c26
-rw-r--r--source/components/utilities/utclib.c146
-rw-r--r--source/components/utilities/utdebug.c30
-rw-r--r--source/components/utilities/utpredef.c2
-rw-r--r--source/components/utilities/utprint.c124
-rw-r--r--source/components/utilities/utxfinit.c4
6 files changed, 61 insertions, 271 deletions
diff --git a/source/components/utilities/utbuffer.c b/source/components/utilities/utbuffer.c
index fe5c7d505..4a50e9e06 100644
--- a/source/components/utilities/utbuffer.c
+++ b/source/components/utilities/utbuffer.c
@@ -336,7 +336,7 @@ AcpiUtDumpBufferToFile (
if (!Buffer)
{
- fprintf (File, "Null Buffer Pointer in DumpBuffer!\n");
+ AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
return;
}
@@ -351,7 +351,7 @@ AcpiUtDumpBufferToFile (
{
/* Print current offset */
- fprintf (File, "%6.4X: ", (BaseOffset + i));
+ AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
/* Print 16 hex chars */
@@ -361,7 +361,7 @@ AcpiUtDumpBufferToFile (
{
/* Dump fill spaces */
- fprintf (File, "%*s", ((Display * 2) + 1), " ");
+ AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
j += Display;
continue;
}
@@ -371,28 +371,28 @@ AcpiUtDumpBufferToFile (
case DB_BYTE_DISPLAY:
default: /* Default is BYTE display */
- fprintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
break;
case DB_WORD_DISPLAY:
ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
- fprintf (File, "%04X ", Temp32);
+ AcpiUtFilePrintf (File, "%04X ", Temp32);
break;
case DB_DWORD_DISPLAY:
ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
- fprintf (File, "%08X ", Temp32);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
break;
case DB_QWORD_DISPLAY:
ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
- fprintf (File, "%08X", Temp32);
+ AcpiUtFilePrintf (File, "%08X", Temp32);
ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
- fprintf (File, "%08X ", Temp32);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
break;
}
@@ -403,29 +403,29 @@ AcpiUtDumpBufferToFile (
* Print the ASCII equivalent characters but watch out for the bad
* unprintable ones (printable chars are 0x20 through 0x7E)
*/
- fprintf (File, " ");
+ AcpiUtFilePrintf (File, " ");
for (j = 0; j < 16; j++)
{
if (i + j >= Count)
{
- fprintf (File, "\n");
+ AcpiUtFilePrintf (File, "\n");
return;
}
BufChar = Buffer[(ACPI_SIZE) i + j];
if (isprint (BufChar))
{
- fprintf (File, "%c", BufChar);
+ AcpiUtFilePrintf (File, "%c", BufChar);
}
else
{
- fprintf (File, ".");
+ AcpiUtFilePrintf (File, ".");
}
}
/* Done with that line. */
- fprintf (File, "\n");
+ AcpiUtFilePrintf (File, "\n");
i += 16;
}
diff --git a/source/components/utilities/utclib.c b/source/components/utilities/utclib.c
index 2f4f4ffdb..26fbaf958 100644
--- a/source/components/utilities/utclib.c
+++ b/source/components/utilities/utclib.c
@@ -163,7 +163,7 @@
ACPI_MODULE_NAME ("utclib")
-#if defined(ACPI_USE_SYSTEM_CLIBRARY) && !defined(ACPI_USE_STANDARD_HEADERS)
+#ifndef ACPI_USE_SYSTEM_CLIBRARY /* Entire module */
/*******************************************************************************
@@ -201,61 +201,6 @@ memcmp (
/*******************************************************************************
*
- * FUNCTION: memmove
- *
- * PARAMETERS: Dest - Target of the copy
- * Src - Source buffer to copy
- * Count - Number of bytes to copy
- *
- * RETURN: Dest
- *
- * DESCRIPTION: Copy arbitrary bytes of memory with respect to the overlapping
- *
- ******************************************************************************/
-
-void *
-memmove (
- void *Dest,
- const void *Src,
- ACPI_SIZE Count)
-{
- char *New = (char *) Dest;
- char *Old = (char *) Src;
-
-
- if (Old > New)
- {
- /* Copy from the beginning */
-
- while (Count)
- {
- *New = *Old;
- New++;
- Old++;
- Count--;
- }
- }
- else if (Old < New)
- {
- /* Copy from the end */
-
- New = New + Count - 1;
- Old = Old + Count - 1;
- while (Count)
- {
- *New = *Old;
- New--;
- Old--;
- Count--;
- }
- }
-
- return (Dest);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: memcpy
*
* PARAMETERS: Dest - Target of the copy
@@ -358,93 +303,6 @@ strlen (
/*******************************************************************************
*
- * FUNCTION: strpbrk
- *
- * PARAMETERS: String - Null terminated string
- * Delimiters - Delimiters to match
- *
- * RETURN: The first occurance in the string of any of the bytes in the
- * delimiters
- *
- * DESCRIPTION: Search a string for any of a set of the delimiters
- *
- ******************************************************************************/
-
-char *
-strpbrk (
- const char *String,
- const char *Delimiters)
-{
- const char *Delimiter;
-
-
- for ( ; *String != '\0'; ++String)
- {
- for (Delimiter = Delimiters; *Delimiter != '\0'; Delimiter++)
- {
- if (*String == *Delimiter)
- {
- return (ACPI_CAST_PTR (char, String));
- }
- }
- }
-
- return (NULL);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: strtok
- *
- * PARAMETERS: String - Null terminated string
- * Delimiters - Delimiters to match
- *
- * RETURN: Pointer to the next token
- *
- * DESCRIPTION: Split string into tokens
- *
- ******************************************************************************/
-
-char*
-strtok (
- char *String,
- const char *Delimiters)
-{
- char *Begin = String;
- static char *SavedPtr;
-
-
- if (Begin == NULL)
- {
- if (SavedPtr == NULL)
- {
- return (NULL);
- }
- Begin = SavedPtr;
- }
-
- SavedPtr = strpbrk (Begin, Delimiters);
- while (SavedPtr == Begin)
- {
- *Begin++ = '\0';
- SavedPtr = strpbrk (Begin, Delimiters);
- }
-
- if (SavedPtr)
- {
- *SavedPtr++ = '\0';
- return (Begin);
- }
- else
- {
- return (NULL);
- }
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: strcpy
*
* PARAMETERS: DstString - Target of the copy
@@ -1129,4 +987,4 @@ const UINT8 AcpiGbl_Ctypes[257] = {
};
-#endif /* ACPI_USE_SYSTEM_CLIBRARY && !ACPI_USE_STANDARD_HEADERS */
+#endif /* ACPI_USE_SYSTEM_CLIBRARY */
diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c
index 995d45cc3..4d2b306a0 100644
--- a/source/components/utilities/utdebug.c
+++ b/source/components/utilities/utdebug.c
@@ -780,3 +780,33 @@ 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/utpredef.c b/source/components/utilities/utpredef.c
index a97064c7a..01196bb03 100644
--- a/source/components/utilities/utpredef.c
+++ b/source/components/utilities/utpredef.c
@@ -268,6 +268,8 @@ 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 ee52453fd..5ca859ec4 100644
--- a/source/components/utilities/utprint.c
+++ b/source/components/utilities/utprint.c
@@ -120,8 +120,6 @@
ACPI_MODULE_NAME ("utprint")
-#if defined(ACPI_USE_SYSTEM_CLIBRARY) && !defined(ACPI_USE_STANDARD_HEADERS)
-
#define ACPI_FORMAT_SIGN 0x01
#define ACPI_FORMAT_SIGN_PLUS 0x02
#define ACPI_FORMAT_SIGN_PLUS_SPACE 0x04
@@ -490,7 +488,7 @@ AcpiUtFormatNumber (
/*******************************************************************************
*
- * FUNCTION: vsnprintf
+ * FUNCTION: AcpiUtVsnprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
@@ -504,7 +502,7 @@ AcpiUtFormatNumber (
******************************************************************************/
int
-vsnprintf (
+AcpiUtVsnprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
@@ -787,7 +785,7 @@ vsnprintf (
/*******************************************************************************
*
- * FUNCTION: snprintf
+ * FUNCTION: AcpiUtSnprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
@@ -800,7 +798,7 @@ vsnprintf (
******************************************************************************/
int
-snprintf (
+AcpiUtSnprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
@@ -811,38 +809,7 @@ snprintf (
va_start (Args, Format);
- 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);
+ Length = AcpiUtVsnprintf (String, Size, Format, Args);
va_end (Args);
return (Length);
@@ -852,69 +819,7 @@ sprintf (
#ifdef ACPI_APPLICATION
/*******************************************************************************
*
- * 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
+ * FUNCTION: AcpiUtFileVprintf
*
* PARAMETERS: File - File descriptor
* Format - Standard printf format
@@ -927,8 +832,8 @@ printf (
******************************************************************************/
int
-vfprintf (
- FILE *File,
+AcpiUtFileVprintf (
+ ACPI_FILE File,
const char *Format,
va_list Args)
{
@@ -937,10 +842,10 @@ vfprintf (
Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
- Length = vsnprintf (AcpiGbl_PrintBuffer,
+ Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
sizeof (AcpiGbl_PrintBuffer), Format, Args);
- (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, File);
+ (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
return (Length);
@@ -949,7 +854,7 @@ vfprintf (
/*******************************************************************************
*
- * FUNCTION: fprintf
+ * FUNCTION: AcpiUtFilePrintf
*
* PARAMETERS: File - File descriptor
* Format, ... - Standard printf format
@@ -961,8 +866,8 @@ vfprintf (
******************************************************************************/
int
-fprintf (
- FILE *File,
+AcpiUtFilePrintf (
+ ACPI_FILE File,
const char *Format,
...)
{
@@ -971,10 +876,9 @@ fprintf (
va_start (Args, Format);
- Length = vfprintf (File, Format, Args);
+ Length = AcpiUtFileVprintf (File, Format, Args);
va_end (Args);
return (Length);
}
#endif
-#endif /* ACPI_USE_SYSTEM_CLIBRARY && !ACPI_USE_STANDARD_HEADERS */
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
index 66834ac77..c6a26d992 100644
--- a/source/components/utilities/utxfinit.c
+++ b/source/components/utilities/utxfinit.c
@@ -126,11 +126,9 @@
ACPI_MODULE_NAME ("utxfinit")
/* For AcpiExec only */
-#ifndef ACPI_DISABLE_OBJECT_OVERRIDE
void
AeDoObjectOverrides (
void);
-#endif
/*******************************************************************************
@@ -348,14 +346,12 @@ AcpiInitializeObjects (
#ifdef ACPI_EXEC_APP
-#ifndef ACPI_DISABLE_OBJECT_OVERRIDE
/*
* This call implements the "initialization file" option for AcpiExec.
* This is the precise point that we want to perform the overrides.
*/
AeDoObjectOverrides ();
#endif
-#endif
/*
* Execute any module-level code that was detected during the table load