diff options
author | jkim <jkim@FreeBSD.org> | 2012-09-14 22:53:11 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-09-14 22:53:11 +0000 |
commit | da9b951a892d96e0521abeec09d4345ddf04ab8d (patch) | |
tree | 033c7834a7ab5fe0b48b11ac066372bfd32f2c22 /source/compiler/aslutils.c | |
parent | 08e6f22ac3350a67c38e9b42b5dce2a7d5fa08b4 (diff) | |
download | FreeBSD-src-da9b951a892d96e0521abeec09d4345ddf04ab8d.zip FreeBSD-src-da9b951a892d96e0521abeec09d4345ddf04ab8d.tar.gz |
Import ACPICA 20120913.
Diffstat (limited to 'source/compiler/aslutils.c')
-rw-r--r-- | source/compiler/aslutils.c | 100 |
1 files changed, 74 insertions, 26 deletions
diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c index 771ba09..43bf823 100644 --- a/source/compiler/aslutils.c +++ b/source/compiler/aslutils.c @@ -54,31 +54,6 @@ ACPI_MODULE_NAME ("aslutils") -char AslHexLookup[] = -{ - '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' -}; - -/* Table below must match ASL_FILE_TYPES in asltypes.h */ - -static const char *AslFileTypeNames [ASL_NUM_FILES] = -{ - "stdout: ", - "stderr: ", - "Table Input: ", - "Binary Output:", - "Source Output:", - "Preprocessor: ", - "Listing File: ", - "Hex Dump: ", - "Namespace: ", - "Debug File: ", - "ASM Source: ", - "C Source: ", - "ASM Include: ", - "C Include: " -}; - /* Local prototypes */ @@ -547,7 +522,7 @@ UtDisplaySummary ( } FlPrintFile (FileId, "%14s %s - %u bytes\n", - AslFileTypeNames [i], + Gbl_Files[i].ShortDescription, Gbl_Files[i].Filename, FlGetFileSize (i)); } @@ -646,6 +621,79 @@ UtGetStringBuffer ( } +/****************************************************************************** + * + * FUNCTION: UtExpandLineBuffers + * + * PARAMETERS: None. Updates global line buffer pointers. + * + * RETURN: None. Reallocates the global line buffers + * + * DESCRIPTION: Called if the current line buffer becomes filled. Reallocates + * all global line buffers and updates Gbl_LineBufferSize. NOTE: + * Also used for the initial allocation of the buffers, when + * all of the buffer pointers are NULL. Initial allocations are + * of size ASL_DEFAULT_LINE_BUFFER_SIZE + * + *****************************************************************************/ + +void +UtExpandLineBuffers ( + void) +{ + UINT32 NewSize; + + + /* Attempt to double the size of all line buffers */ + + NewSize = Gbl_LineBufferSize * 2; + if (Gbl_CurrentLineBuffer) + { + DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n", + Gbl_LineBufferSize, NewSize); + } + + Gbl_CurrentLineBuffer = realloc (Gbl_CurrentLineBuffer, NewSize); + Gbl_LineBufPtr = Gbl_CurrentLineBuffer; + if (!Gbl_CurrentLineBuffer) + { + goto ErrorExit; + } + + Gbl_MainTokenBuffer = realloc (Gbl_MainTokenBuffer, NewSize); + if (!Gbl_MainTokenBuffer) + { + goto ErrorExit; + } + + Gbl_MacroTokenBuffer = realloc (Gbl_MacroTokenBuffer, NewSize); + if (!Gbl_MacroTokenBuffer) + { + goto ErrorExit; + } + + Gbl_ExpressionTokenBuffer = realloc (Gbl_ExpressionTokenBuffer, NewSize); + if (!Gbl_ExpressionTokenBuffer) + { + goto ErrorExit; + } + + Gbl_LineBufferSize = NewSize; + return; + + + /* On error above, simply issue error messages and abort, cannot continue */ + +ErrorExit: + printf ("Could not increase line buffer size from %u to %u\n", + Gbl_LineBufferSize, Gbl_LineBufferSize * 2); + + AslError (ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, + NULL, NULL); + AslAbort (); +} + + /******************************************************************************* * * FUNCTION: UtInternalizeName |