Cleanup and update of function headers

date	2002.02.04.21.11.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 15:55:09 +00:00
parent e9a976d930
commit 1d825f7962
13 changed files with 677 additions and 210 deletions

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslerror - Error handling and statistics
* $Revision: 1.59 $
* $Revision: 1.60 $
*
*****************************************************************************/
@ -321,7 +321,6 @@ AePrintException (
}
}
/* NULL message ID, just print the raw message */
if (Enode->MessageId == 0)
@ -336,7 +335,6 @@ AePrintException (
AslErrorLevel[Enode->Level],
Enode->MessageId + ((Enode->Level+1) * 1000));
MainMessage = AslMessages[Enode->MessageId];
ExtraMessage = Enode->Message;
@ -398,7 +396,7 @@ AePrintException (
*
* FUNCTION: AePrintErrorLog
*
* PARAMETERS: Where - Where to print the error log
* PARAMETERS: FileId - Where to output the error log
*
* RETURN: None
*
@ -429,6 +427,8 @@ AePrintErrorLog (
* MessageId - Index into global message buffer
* CurrentLineNumber - Actual file line number
* LogicalLineNumber - Cumulative line number
* LogicalByteOffset - Byte offset in source file
* Column - Column in current line
* Filename - source filename
* ExtraMessage - additional error message
*
@ -458,15 +458,13 @@ AslCommonError (
if (ExtraMessage)
{
/*
* Allocate a buffer for the message and a new error node
*/
/* Allocate a buffer for the message and a new error node */
MessageSize = strlen (ExtraMessage) + 1;
MessageBuffer = UtLocalCalloc (MessageSize);
/*
* Keep a copy of the extra message
*/
/* Keep a copy of the extra message */
STRCPY (MessageBuffer, ExtraMessage);
}
@ -491,12 +489,10 @@ AslCommonError (
Enode->Column = Column;
Enode->Message = MessageBuffer;
/* Add the new node to the error node list */
AeAddToErrorLog (Enode);
if (Gbl_DebugFlag)
{
/* stderr is a file, send error to it immediately */
@ -504,9 +500,7 @@ AslCommonError (
AePrintException (ASL_FILE_STDERR, Enode);
}
Gbl_ExceptionCount[Level]++;
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
{

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslfiles - file I/O suppoert
* $Revision: 1.27 $
* $Revision: 1.30 $
*
*****************************************************************************/
@ -211,7 +211,7 @@ FlFileError (
* Filename - file pathname to open
* Mode - Open mode for fopen
*
* RETURN: None
* RETURN: File descriptor
*
* DESCRIPTION: Open a file.
* NOTE: Aborts compiler on any error.
@ -250,7 +250,7 @@ FlOpenFile (
* Buffer - Where to place the data
* Length - Amount to read
*
* RETURN: Status. AE_ERROR indicated EOF.
* RETURN: Status. AE_ERROR indicates EOF.
*
* DESCRIPTION: Read data from an open file.
* NOTE: Aborts compiler on any error.
@ -457,10 +457,10 @@ FlOpenIncludeFile (
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_InputByteCount, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, " - Null parse node");
return;
}
/*
* Flush out the "include ()" statement on this line, start
* the actual include file on the next line
@ -480,7 +480,6 @@ FlOpenIncludeFile (
return;
}
/* Push the include file on the open input file stack */
AslPushInputFileStack (IncFile, Node->Value.String);
@ -702,6 +701,26 @@ FlOpenMiscOutputFiles (
AslCompilerFileHeader (ASL_FILE_ASM_SOURCE_OUTPUT);
}
/* Create/Open a C code source output file if asked */
if (Gbl_C_OutputFlag)
{
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_SOURCE);
if (!Filename)
{
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, 0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
}
/* Open the assembly code source file, text mode */
FlOpenFile (ASL_FILE_C_SOURCE_OUTPUT, Filename, "w+");
FlPrintFile (ASL_FILE_C_SOURCE_OUTPUT, "/*\n");
AslCompilerSignon (ASL_FILE_C_SOURCE_OUTPUT);
AslCompilerFileHeader (ASL_FILE_C_SOURCE_OUTPUT);
}
/* Create/Open a hex output file if asked */
if (Gbl_HexOutputFlag)
@ -717,7 +736,6 @@ FlOpenMiscOutputFiles (
FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+");
FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n");
AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT);
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: asllength - Tree walk to determine package and opcode lengths
* $Revision: 1.23 $
* $Revision: 1.24 $
*
*****************************************************************************/
@ -132,7 +132,7 @@
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: None.
* RETURN: Status
*
* DESCRIPTION: Walk callback to initialize (and re-initialize) the node
* subtree length(s) to zero. The Subtree lengths are bubbled
@ -158,7 +158,7 @@ LnInitLengthsWalk (
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: None
* RETURN: Status
*
* DESCRIPTION: Walk callback to calculate the total AML length.
* 1) Calculate the AML lengths (opcode, package length, etc.) for
@ -190,9 +190,9 @@ LnPackageLengthWalk (
(Node->ParseOpcode != DEFAULT_ARG))
{
Node->Parent->AmlSubtreeLength += (Node->AmlLength +
Node->AmlOpcodeLength +
Node->AmlPkgLenBytes +
Node->AmlSubtreeLength);
Node->AmlOpcodeLength +
Node->AmlPkgLenBytes +
Node->AmlSubtreeLength);
}
return (AE_OK);
}
@ -261,7 +261,6 @@ CgGetPackageLenByteCount (
* Note: the package length includes the number of bytes used to encode
* the package length, so we must account for this also.
*/
if (PackageLength <= (0x0000003F - 1))
{
return (1);
@ -332,18 +331,22 @@ CgGenerateAmlOpcodeLength (
switch (Node->AmlOpcode)
{
case AML_BYTE_OP:
Node->AmlLength = 1;
break;
case AML_WORD_OP:
Node->AmlLength = 2;
break;
case AML_DWORD_OP:
Node->AmlLength = 4;
break;
case AML_QWORD_OP:
Node->AmlLength = 8;
break;
}
@ -374,32 +377,40 @@ CgGenerateAmlLengths (
switch (Node->AmlOpcode)
{
case AML_RAW_DATA_BYTE:
Node->AmlOpcodeLength = 0;
Node->AmlLength = 1;
return;
case AML_RAW_DATA_WORD:
Node->AmlOpcodeLength = 0;
Node->AmlLength = 2;
return;
case AML_RAW_DATA_DWORD:
Node->AmlOpcodeLength = 0;
Node->AmlLength = 4;
return;
case AML_RAW_DATA_QWORD:
Node->AmlOpcodeLength = 0;
Node->AmlLength = 8;
return;
case AML_RAW_DATA_BUFFER:
/* Aml length is/was set by creator */
Node->AmlOpcodeLength = 0;
return;
case AML_RAW_DATA_CHAIN:
/* Aml length is/was set by creator */
Node->AmlOpcodeLength = 0;
return;
}
@ -407,10 +418,12 @@ CgGenerateAmlLengths (
switch (Node->ParseOpcode)
{
case DEFINITIONBLOCK:
Gbl_TableLength = sizeof (ACPI_TABLE_HEADER) + Node->AmlSubtreeLength;
break;
case NAMESEG:
Node->AmlOpcodeLength = 0;
Node->AmlLength = 4;
Node->ExternalName = Node->Value.String;
@ -418,6 +431,7 @@ CgGenerateAmlLengths (
case NAMESTRING:
case METHODCALL:
if (Node->Flags & NODE_NAME_INTERNALIZED)
{
break;
@ -449,28 +463,33 @@ CgGenerateAmlLengths (
break;
case STRING_LITERAL:
Node->AmlOpcodeLength = 1;
Node->AmlLength = strlen (Node->Value.String) + 1; /* Get null terminator */
break;
case PACKAGE_LENGTH:
Node->AmlOpcodeLength = 0;
Node->AmlPkgLenBytes = CgGetPackageLenByteCount (Node, Node->Value.Integer32);
break;
case RAW_DATA:
Node->AmlOpcodeLength = 0;
break;
/* Ignore the "default arg" nodes, they are extraneous at this point */
case DEFAULT_ARG:
case EXTERNAL:
case INCLUDE:
case INCLUDE_END:
/* Ignore the "default arg" nodes, they are extraneous at this point */
break;
default:
CgGenerateAmlOpcodeLength (Node);
break;
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: asllisting - Listing file generation
* $Revision: 1.29 $
* $Revision: 1.32 $
*
*****************************************************************************/
@ -121,11 +121,119 @@
#include "aslresource.h"
#include "amlcode.h"
#include "acparser.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_COMPILER
MODULE_NAME ("aslisting")
/*******************************************************************************
*
* FUNCTION: LsAmlListingWalk
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Process one node during a listing file generation.
*
******************************************************************************/
ACPI_STATUS
LsAmlListingWalk (
ASL_PARSE_NODE *Node,
UINT32 Level,
void *Context)
{
char FileByte;
UINT32 i;
UINT32 FileId = (UINT32) Context;
LsWriteNodeToListing (Node, FileId);
/* Write the hex bytes to the listing file(s) (if requested) */
for (i = 0; i < Node->FinalAmlLength; i++)
{
FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1);
LsWriteListingHexBytes (&FileByte, 1, FileId);
}
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: LsGenerateListing
*
* PARAMETERS: FileId - ID of listing file
*
* RETURN: None
*
* DESCRIPTION: Generate a listing file. This can be one of the several types
* of "listings" supported.
*
******************************************************************************/
void
LsGenerateListing (
UINT32 FileId)
{
/* Start at the beginning of both the source and AML files */
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
Gbl_SourceLine = 0;
Gbl_CurrentHexColumn = 0;
LsPushNode (Gbl_Files[ASL_FILE_INPUT].Filename);
/* Process all parse nodes */
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
NULL, (void *) FileId);
/* Final processing */
LsFinishSourceListing (FileId);
}
/*******************************************************************************
*
* FUNCTION: LsDoListings
*
* PARAMETERS: None.
*
* RETURN: None
*
* DESCRIPTION: Generate all requested listing files.
*
******************************************************************************/
void
LsDoListings (void)
{
if (Gbl_C_OutputFlag)
{
LsGenerateListing (ASL_FILE_C_SOURCE_OUTPUT);
}
if (Gbl_ListingFlag)
{
LsGenerateListing (ASL_FILE_LISTING_OUTPUT);
}
if (Gbl_AsmOutputFlag)
{
LsGenerateListing (ASL_FILE_ASM_SOURCE_OUTPUT);
}
}
/*******************************************************************************
*
* FUNCTION: LsPushNode
@ -148,11 +256,6 @@ LsPushNode (
ASL_LISTING_NODE *Lnode;
if (!Gbl_ListingFlag)
{
return;
}
/* Create a new node */
Lnode = UtLocalCalloc (sizeof (ASL_LISTING_NODE));
@ -188,11 +291,6 @@ LsPopNode (void)
ASL_LISTING_NODE *Lnode;
if (!Gbl_ListingFlag)
{
return Gbl_ListingNode;
}
/* Just grab the node at the head of the list */
Lnode = Gbl_ListingNode;
@ -217,6 +315,7 @@ LsPopNode (void)
* FUNCTION: LsCheckException
*
* PARAMETERS: LineNumber - Current logical (cumulative) line #
* FileId - ID of output listing file
*
* RETURN: None
*
@ -229,10 +328,10 @@ LsPopNode (void)
void
LsCheckException (
UINT32 LineNumber)
UINT32 LineNumber,
UINT32 FileId)
{
if ((!Gbl_NextError) ||
(LineNumber < Gbl_NextError->LogicalLineNumber ))
{
@ -241,17 +340,20 @@ LsCheckException (
/* Handle multiple errors per line */
while (Gbl_NextError &&
(LineNumber >= Gbl_NextError->LogicalLineNumber))
if (FileId == ASL_FILE_LISTING_OUTPUT)
{
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n[****AslException****]\n");
while (Gbl_NextError &&
(LineNumber >= Gbl_NextError->LogicalLineNumber))
{
FlPrintFile (FileId, "\n[****AslException****]\n");
AePrintException (ASL_FILE_LISTING_OUTPUT, Gbl_NextError);
AePrintException (FileId, Gbl_NextError);
Gbl_NextError = Gbl_NextError->Next;
Gbl_NextError = Gbl_NextError->Next;
}
FlPrintFile (FileId, "\n");
}
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");
}
@ -259,7 +361,7 @@ LsCheckException (
*
* FUNCTION: LsFlushListingBuffer
*
* PARAMETERS: None
* PARAMETERS: FileId - ID of the listing file
*
* RETURN: None
*
@ -270,7 +372,8 @@ LsCheckException (
******************************************************************************/
void
LsFlushListingBuffer (void)
LsFlushListingBuffer (
UINT32 FileId)
{
UINT32 i;
UINT8 BufChar;
@ -283,38 +386,82 @@ LsFlushListingBuffer (void)
/* Write the hex bytes */
for (i = 0; i < Gbl_CurrentHexColumn; i++)
switch (FileId)
{
FlWriteFile (ASL_FILE_LISTING_OUTPUT, &hex[Gbl_AmlBuffer[i] >> 4], 1);
FlWriteFile (ASL_FILE_LISTING_OUTPUT, &hex[Gbl_AmlBuffer[i] & 0xF], 1);
FlWriteFile (ASL_FILE_LISTING_OUTPUT, " ", 1);
}
case ASL_FILE_LISTING_OUTPUT:
for (i = 0; i < ((16 - Gbl_CurrentHexColumn) * 3); i++)
{
FlWriteFile (ASL_FILE_LISTING_OUTPUT, ".", 1);
}
for (i = 0; i < Gbl_CurrentHexColumn; i++)
{
FlPrintFile (FileId, "%2.2X ", Gbl_AmlBuffer[i]);
}
FlWriteFile (ASL_FILE_LISTING_OUTPUT, " ", 4);
for (i = 0; i < ((16 - Gbl_CurrentHexColumn) * 3); i++)
{
FlWriteFile (FileId, ".", 1);
}
FlPrintFile (FileId, " \"");
break;
case ASL_FILE_ASM_SOURCE_OUTPUT:
for (i = 0; i < Gbl_CurrentHexColumn; i++)
{
if (i > 0)
{
FlPrintFile (FileId, ",");
}
FlPrintFile (FileId, "0%2.2Xh", Gbl_AmlBuffer[i]);
}
for (i = 0; i < ((16 - Gbl_CurrentHexColumn) * 5); i++)
{
FlWriteFile (FileId, " ", 1);
}
FlPrintFile (FileId, " ;%8.8X \"", Gbl_CurrentAmlOffset);
break;
case ASL_FILE_C_SOURCE_OUTPUT:
for (i = 0; i < Gbl_CurrentHexColumn; i++)
{
FlPrintFile (FileId, "0x%2.2X,", Gbl_AmlBuffer[i]);
}
for (i = 0; i < ((16 - Gbl_CurrentHexColumn) * 5); i++)
{
FlWriteFile (FileId, " ", 1);
}
FlPrintFile (FileId, " /* %8.8X \"", Gbl_CurrentAmlOffset);
break;
}
/* Write the ASCII character associated with each of the bytes */
for (i = 0; i < Gbl_CurrentHexColumn; i++)
{
BufChar = Gbl_AmlBuffer[i];
if ((BufChar > 0x1F && BufChar < 0x2E) ||
(BufChar > 0x2F && BufChar < 0x61) ||
(BufChar > 0x60 && BufChar < 0x7F))
if (isprint (BufChar) && !isspace (BufChar))
{
FlPrintFile (ASL_FILE_LISTING_OUTPUT,"%c", BufChar);
FlPrintFile (FileId, "%c", BufChar);
}
else
{
FlWriteFile (ASL_FILE_LISTING_OUTPUT, ".", 1);
FlWriteFile (FileId, ".", 1);
}
}
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");
FlPrintFile (FileId, "\"");
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, " */");
}
FlPrintFile (FileId, "\n");
Gbl_CurrentHexColumn = 0;
Gbl_HexBytesWereWritten = TRUE;
}
@ -326,6 +473,7 @@ LsFlushListingBuffer (void)
*
* PARAMETERS: Buffer - AML code buffer
* Length - Number of AML bytes to write
* FileId - ID of current listing file.
*
* RETURN: None
*
@ -338,18 +486,12 @@ LsFlushListingBuffer (void)
void
LsWriteListingHexBytes (
char *Buffer,
UINT32 Length)
UINT32 Length,
UINT32 FileId)
{
UINT32 i;
/* Are we in listing mode? */
if (!Gbl_ListingFlag)
{
return;
}
/* Transfer all requested bytes */
for (i = 0; i < Length; i++)
@ -360,10 +502,26 @@ LsWriteListingHexBytes (
{
if (Gbl_HasIncludeFiles)
{
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "%*s", 10, " ");
FlPrintFile (FileId, "%*s", 10, " ");
}
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "%8.8X....", Gbl_CurrentAmlOffset);
switch (FileId)
{
case ASL_FILE_LISTING_OUTPUT:
FlPrintFile (FileId, "%8.8X....", Gbl_CurrentAmlOffset);
break;
case ASL_FILE_ASM_SOURCE_OUTPUT:
FlPrintFile (FileId, " db ");
break;
case ASL_FILE_C_SOURCE_OUTPUT:
FlPrintFile (FileId, " ");
break;
}
}
/* Transfer AML byte and update counts */
@ -377,7 +535,7 @@ LsWriteListingHexBytes (
if (Gbl_CurrentHexColumn >= 16)
{
LsFlushListingBuffer ();
LsFlushListingBuffer (FileId);
}
}
}
@ -387,7 +545,7 @@ LsWriteListingHexBytes (
*
* FUNCTION: LsWriteOneSourceLine
*
* PARAMETERS: None
* PARAMETERS: FileID - ID of current listing file
*
* RETURN: FALSE on EOF (input source file), TRUE otherwise
*
@ -398,35 +556,53 @@ LsWriteListingHexBytes (
******************************************************************************/
UINT32
LsWriteOneSourceLine (void)
LsWriteOneSourceLine (
UINT32 FileId)
{
UINT8 FileByte;
UINT8 FileByte;
Gbl_SourceLine++;
Gbl_ListingNode->LineNumber++;
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, " *");
}
if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
{
FlPrintFile (FileId, "; ");
}
if (Gbl_HasIncludeFiles)
{
/*
* This file contains "include" statements, print the current
* filename and line number within the current file
*/
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "%12s %5d....",
FlPrintFile (FileId, "%12s %5d....",
Gbl_ListingNode->Filename, Gbl_ListingNode->LineNumber);
}
else
{
/* No include files, just print the line number */
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "%8d....", Gbl_SourceLine);
FlPrintFile (FileId, "%8d....", Gbl_SourceLine);
}
/* Read one line (up to a newline or EOF) */
while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK)
{
FlWriteFile (ASL_FILE_LISTING_OUTPUT, &FileByte, 1);
if (FileId == FileId)
{
if (FileByte == '/')
{
FileByte = '*';
}
}
FlWriteFile (FileId, &FileByte, 1);
DbgPrint (ASL_PARSE_OUTPUT, "%c", FileByte);
if (FileByte == '\n')
@ -435,7 +611,7 @@ LsWriteOneSourceLine (void)
* Check if an error occurred on this source line during the compile.
* If so, we print the error message after the source line.
*/
LsCheckException (Gbl_SourceLine);
LsCheckException (FileId, Gbl_SourceLine);
return (1);
}
}
@ -450,7 +626,7 @@ LsWriteOneSourceLine (void)
*
* FUNCTION: LsFinishSourceListing
*
* PARAMETERS: None
* PARAMETERS: FileId - ID of current listing file.
*
* RETURN: None
*
@ -461,23 +637,41 @@ LsWriteOneSourceLine (void)
******************************************************************************/
void
LsFinishSourceListing (void)
LsFinishSourceListing (
UINT32 FileId)
{
if (!Gbl_ListingFlag)
{
return;
}
LsFlushListingBuffer ();
LsFlushListingBuffer (FileId);
Gbl_CurrentAmlOffset = 0;
/* Flush any remaining text in the source file */
while (LsWriteOneSourceLine ())
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, " /*\n");
}
while (LsWriteOneSourceLine (FileId))
{ ; }
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, "\n */\n };\n");
}
FlPrintFile (FileId, "\n");
if (FileId == ASL_FILE_LISTING_OUTPUT)
{
/* Print a summary of the compile exceptions */
FlPrintFile (FileId, "\n\nSummary of errors and warnings\n\n");
AePrintErrorLog (FileId);
FlPrintFile (FileId, "\n\n");
UtDisplaySummary (FileId);
FlPrintFile (FileId, "\n\n");
}
}
@ -485,8 +679,9 @@ LsFinishSourceListing (void)
*
* FUNCTION: LsWriteSourceLines
*
* PARAMETERS: ToLineNumber
* ToLogicalLineNumber
* PARAMETERS: ToLineNumber -
* ToLogicalLineNumber - Write up to this source line number
* FileId - ID of current listing file
*
* RETURN: None
*
@ -500,15 +695,16 @@ LsFinishSourceListing (void)
void
LsWriteSourceLines (
UINT32 ToLineNumber,
UINT32 ToLogicalLineNumber)
UINT32 ToLineNumber,
UINT32 ToLogicalLineNumber,
UINT32 FileId)
{
Gbl_CurrentLine = ToLogicalLineNumber;
/* Flush any hex bytes remaining from the last opcode */
LsFlushListingBuffer ();
LsFlushListingBuffer (FileId);
/*
* Read lines and write them as long as we are not caught up
@ -521,18 +717,27 @@ LsWriteSourceLines (
*/
if (Gbl_HexBytesWereWritten)
{
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");
FlPrintFile (FileId, "\n");
Gbl_HexBytesWereWritten = FALSE;
}
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, " /*\n");
}
/*
* Write one line at a time until we have reached the target line #
*/
while ((Gbl_SourceLine < Gbl_CurrentLine) &&
LsWriteOneSourceLine ())
LsWriteOneSourceLine (FileId))
{ ; }
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, " */");
}
FlPrintFile (FileId, "\n");
}
}
@ -542,6 +747,7 @@ LsWriteSourceLines (
* FUNCTION: LsWriteNodeToListing
*
* PARAMETERS: Node - Parse node to write to the listing file.
* FileId - ID of current listing file
*
* RETURN: None.
*
@ -554,15 +760,55 @@ LsWriteSourceLines (
void
LsWriteNodeToListing (
ASL_PARSE_NODE *Node)
ASL_PARSE_NODE *Node,
UINT32 FileId)
{
const ACPI_OPCODE_INFO *OpInfo;
UINT32 OpClass;
char *Pathname;
UINT32 Length;
UINT32 i;
if (!Gbl_ListingFlag)
OpInfo = AcpiPsGetOpcodeInfo (Node->AmlOpcode);
OpClass = OpInfo->Class;
/* TBD: clean this up with a single flag that says: I start a named output block */
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
return;
switch (Node->ParseOpcode)
{
case DEFINITIONBLOCK:
case METHODCALL:
case INCLUDE:
case INCLUDE_END:
case DEFAULT_ARG:
break;
default:
switch (OpClass)
{
case AML_CLASS_NAMED_OBJECT:
switch (Node->AmlOpcode)
{
case AML_SCOPE_OP:
case AML_ALIAS_OP:
break;
default:
if (Node->ExternalName)
{
LsFlushListingBuffer (FileId);
FlPrintFile (FileId, " };\n");
}
break;
}
break;
}
break;
}
}
@ -571,18 +817,31 @@ LsWriteNodeToListing (
switch (Node->ParseOpcode)
{
case DEFINITIONBLOCK:
LsWriteSourceLines (Node->EndLine, Node->EndLogicalLine);
LsWriteSourceLines (Node->EndLine, Node->EndLogicalLine, FileId);
if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
{
FlPrintFile (FileId, "AmlHeader \\\n");
}
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, " unsigned char AmlHeader [] = \n {\n");
}
return;
case METHODCALL:
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber);
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber, FileId);
return;
case INCLUDE:
/*
* Flush everything up to and including the include source line
*/
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber);
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber, FileId);
/*
* Create a new listing node and push it
@ -590,11 +849,13 @@ LsWriteNodeToListing (
LsPushNode (Node->Child->Value.String);
return;
case INCLUDE_END:
/*
* Flush out the rest of the include file
*/
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber);
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber, FileId);
/*
* Pop off this listing node and go back to the parent file
@ -602,6 +863,7 @@ LsWriteNodeToListing (
LsPopNode ();
return;
case DEFAULT_ARG:
return;
}
@ -611,9 +873,6 @@ LsWriteNodeToListing (
* switch on the opcode type, getting an entire class
* at once
*/
OpInfo = AcpiPsGetOpcodeInfo (Node->AmlOpcode);
OpClass = OpInfo->Class;
switch (OpClass)
{
case AML_CLASS_ARGUMENT: /* argument type only */
@ -621,32 +880,73 @@ LsWriteNodeToListing (
break;
case AML_CLASS_NAMED_OBJECT:
switch (Node->AmlOpcode)
{
/* For fields, we want to dump all the AML after the entire definition */
case AML_FIELD_OP:
case AML_INDEX_FIELD_OP:
case AML_BANK_FIELD_OP:
case AML_NAME_OP:
LsWriteSourceLines (Node->EndLine, Node->EndLogicalLine);
/* For fields, we want to dump all the AML after the entire definition */
LsWriteSourceLines (Node->EndLine, Node->EndLogicalLine, FileId);
break;
default:
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber);
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber, FileId);
break;
}
switch (Node->AmlOpcode)
{
case AML_SCOPE_OP:
case AML_ALIAS_OP:
break;
default:
switch (FileId)
{
case ASL_FILE_ASM_SOURCE_OUTPUT:
case ASL_FILE_C_SOURCE_OUTPUT:
if (Node->ExternalName)
{
Pathname = AcpiNsGetExternalPathname (Node->NsNode);
Length = strlen (Pathname);
if (Length >= 4)
{
for (i = 0; i < Length; i++)
{
if (Pathname[i] == '.')
{
Pathname[i] = '_';
}
}
if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
{
FlPrintFile (FileId, "Aml_%s \\\n", &Pathname[1]);
}
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
{
FlPrintFile (FileId, " unsigned char Aml_%s [] = \n {\n", &Pathname[1]);
}
}
ACPI_MEM_FREE (Pathname);
}
break;
}
}
break;
case AML_CLASS_EXECUTE:
case AML_CLASS_CREATE:
default:
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber);
LsWriteSourceLines (Node->LineNumber, Node->LogicalLineNumber, FileId);
break;
case AML_CLASS_UNKNOWN:
@ -659,7 +959,9 @@ LsWriteNodeToListing (
*
* FUNCTION: LsDumpAscii
*
* PARAMETERS: Count - Number of bytes to convert
* PARAMETERS: FileId - ID of current listing file
* Count - Number of bytes to convert
* Buffer - Buffer of bytes to convert
*
* RETURN: None.
*
@ -680,14 +982,14 @@ LsDumpAscii (
for (i = 0; i < Count; i++)
{
BufChar = Buffer[i];
if ((BufChar > 0x1F && BufChar < 0x2E) ||
(BufChar > 0x2F && BufChar < 0x61) ||
(BufChar > 0x60 && BufChar < 0x7F))
if (isprint (BufChar))
{
FlPrintFile (FileId, "%c", BufChar);
}
else
{
/* Not a printable character, just put out a dot */
FlPrintFile (FileId, ".");
}
}
@ -702,6 +1004,37 @@ LsDumpAscii (
*
* RETURN: None.
*
* DESCRIPTION: Create the hex output file.
*
******************************************************************************/
void
LsDoHexOutput (void)
{
switch (Gbl_HexOutputFlag)
{
case HEX_OUTPUT_C:
LsDoHexOutputC ();
break;
case HEX_OUTPUT_ASM:
LsDoHexOutputAsm ();
break;
}
}
/*******************************************************************************
*
* FUNCTION: LsDoHexOutputC
*
* PARAMETERS: None
*
* RETURN: None.
*
* DESCRIPTION: Create the hex output file. This is the same data as the AML
* output file, but formatted into hex/ascii bytes suitable for
* inclusion into a C source file.
@ -711,7 +1044,7 @@ LsDumpAscii (
#define HEX_CHARS_PER_LINE 8
void
LsDoHexOutput (void)
LsDoHexOutputC (void)
{
UINT32 j;
UINT8 FileByte[HEX_CHARS_PER_LINE];
@ -719,11 +1052,6 @@ LsDoHexOutput (void)
UINT32 Offset = 0;
if (!Gbl_HexOutputFlag)
{
return;
}
FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n *\n */\n");
FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] = \n{\n");
@ -771,7 +1099,7 @@ LsDoHexOutput (void)
/*******************************************************************************
*
* FUNCTION: LsDoAsmOutput
* FUNCTION: LsDoHexOutputAsm
*
* PARAMETERS: None
*
@ -779,7 +1107,7 @@ LsDoHexOutput (void)
*
* DESCRIPTION: Create the hex output file. This is the same data as the AML
* output file, but formatted into hex/ascii bytes suitable for
* inclusion into a C source file.
* inclusion into a ASM source file.
*
******************************************************************************/
@ -787,7 +1115,7 @@ LsDoHexOutput (void)
void
LsDoAsmOutput (void)
LsDoHexOutputAsm (void)
{
UINT32 j;
UINT8 FileByte[HEX_CHARS_PER_LINE];
@ -796,12 +1124,7 @@ LsDoAsmOutput (void)
BOOLEAN DoComma = FALSE;
if (!Gbl_AsmOutputFlag)
{
return;
}
FlPrintFile (ASL_FILE_ASM_SOURCE_OUTPUT, "; Assembly code source output\n;\n");
FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n;\n");
/* Start at the beginning of the AML file */
@ -814,11 +1137,11 @@ LsDoAsmOutput (void)
{
if (j == 0)
{
FlPrintFile (ASL_FILE_ASM_SOURCE_OUTPUT, " db ");
FlPrintFile (ASL_FILE_HEX_OUTPUT, " db ");
}
else if (DoComma)
{
FlPrintFile (ASL_FILE_ASM_SOURCE_OUTPUT, ",");
FlPrintFile (ASL_FILE_HEX_OUTPUT, ",");
DoComma = FALSE;
}
@ -826,7 +1149,7 @@ LsDoAsmOutput (void)
* Convert each AML byte to hex
*/
UtConvertByteToAsmHex (FileByte[j], Buffer);
FlWriteFile (ASL_FILE_ASM_SOURCE_OUTPUT, Buffer, 4);
FlWriteFile (ASL_FILE_HEX_OUTPUT, Buffer, 4);
/* An occasional linefeed improves readability */
@ -834,12 +1157,12 @@ LsDoAsmOutput (void)
j++;
if (j >= ASM_HEX_CHARS_PER_LINE)
{
FlPrintFile (ASL_FILE_ASM_SOURCE_OUTPUT, " ;%8.8X \"", Offset - ASM_HEX_CHARS_PER_LINE);
FlPrintFile (ASL_FILE_HEX_OUTPUT, " ;%8.8X \"", Offset - ASM_HEX_CHARS_PER_LINE);
/* Write the ASCII character associated with each of the bytes */
LsDumpAscii (ASL_FILE_ASM_SOURCE_OUTPUT, ASM_HEX_CHARS_PER_LINE, FileByte);
FlPrintFile (ASL_FILE_ASM_SOURCE_OUTPUT, "\"\n");
LsDumpAscii (ASL_FILE_HEX_OUTPUT, ASM_HEX_CHARS_PER_LINE, FileByte);
FlPrintFile (ASL_FILE_HEX_OUTPUT, "\"\n");
j = 0;
}
else
@ -848,8 +1171,8 @@ LsDoAsmOutput (void)
}
}
FlPrintFile (ASL_FILE_ASM_SOURCE_OUTPUT, "\n");
FlCloseFile (ASL_FILE_ASM_SOURCE_OUTPUT);
FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n");
FlCloseFile (ASL_FILE_HEX_OUTPUT);
}

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 1.41 $
* $Revision: 1.42 $
*
*****************************************************************************/
@ -181,7 +181,7 @@ LdLoadNamespace (void)
* PARAMETERS: PsNode - Parent node (Field)
* WalkState - Current walk state
*
* RETURN: None
* RETURN: Status
*
* DESCRIPTION: Enter the named elements of the field (children of the parent)
* into the namespace.
@ -203,14 +203,17 @@ LdLoadFieldElements (
switch (PsNode->AmlOpcode)
{
case AML_BANK_FIELD_OP:
Child = UtGetArg (PsNode, 6);
break;
case AML_INDEX_FIELD_OP:
Child = UtGetArg (PsNode, 5);
break;
case AML_FIELD_OP:
Child = UtGetArg (PsNode, 4);
break;
}
@ -223,6 +226,7 @@ LdLoadFieldElements (
{
case AML_INT_RESERVEDFIELD_OP:
case AML_INT_ACCESSFIELD_OP:
break;
default:
@ -264,7 +268,7 @@ LdLoadFieldElements (
* PARAMETERS: PsNode - Parent node (Resource Descriptor)
* WalkState - Current walk state
*
* RETURN: None
* RETURN: Status
*
* DESCRIPTION: Enter the named elements of the resource descriptor (children
* of the parent) into the namespace.
@ -334,6 +338,7 @@ LdLoadResourceElements (
}
InitializerNode = ASL_GET_PEER_NODE (InitializerNode);
}
return (AE_OK);
}
@ -437,7 +442,6 @@ LdNamespace1Begin (
else
{
ObjectType = AslMapNamedOpcodeToDataType (PsNode->AmlOpcode);
}
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "LdNamespace1Begin: Type=%x\n", ObjectType));
@ -474,6 +478,7 @@ LdNamespace1Begin (
*/
PsNode->NsNode = NsNode;
NsNode->Object = (ACPI_OPERAND_OBJECT *) PsNode;
/* Set the actual data type if appropriate (EXTERNAL term only) */
if (ActualObjectType != ACPI_TYPE_ANY)
@ -552,7 +557,6 @@ LdNamespace1End (
AcpiUtGetTypeName (ObjectType), PsNode));
AcpiDsScopeStackPop (WalkState);
}
return (AE_OK);

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslmain - compiler main and utilities
* $Revision: 1.39 $
* $Revision: 1.42 $
*
*****************************************************************************/
@ -129,6 +129,37 @@ char hex[] = {'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'};
/*******************************************************************************
*
* FUNCTION: Options
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Display option help message
*
******************************************************************************/
void
Options (
void)
{
printf ("Options:\n");
printf (" -a Create AML in a assembler source code file (*.asm)\n");
printf (" -c Create AML in a C source code file (*.c)\n");
printf (" -h Additional help and compiler debug options\n");
printf (" -i Ignore errors, always create AML output file(s)\n");
printf (" -l Create listing file (mixed ASL source and AML) (*.lst)\n");
printf (" -n Create namespace file (*.nsp)\n");
printf (" -o <name> Specify filename prefix for all output files\n");
printf (" (including the .aml file)\n");
printf (" -s Create combined (w/includes) ASL file (*.src)\n");
printf (" -t <a|c> Create AML hex table in assembler or C (*.hex)\n");
}
/*******************************************************************************
*
* FUNCTION: Usage
@ -141,25 +172,50 @@ char hex[] = {'0','1','2','3','4','5','6','7',
*
******************************************************************************/
void
HelpMessage (
void)
{
printf ("Output Filename generation:\n");
printf (" Output filenames are generated by appending an extension to a common\n");
printf (" filename prefix. The filename prefix is obtained via one of the\n");
printf (" following methods (in priority order):\n");
printf (" 1) The -o option specifies the prefix\n");
printf (" 2) The prefix of the AMLFileName in the ASL Definition Block\n");
printf (" 3) The prefix of the input filename\n");
printf ("\n");
Options ();
printf ("\nCompiler Debug Options:\n");
printf (" -d <p|t|b> Create compiler debug/trace file (*.txt)\n");
printf (" Types: Parse/Tree/Both\n");
printf (" -p Parse only, no output generation\n");
printf (" -x Display compile times\n");
printf (" -v <trace level> Set debug level for trace output\n");
}
/*******************************************************************************
*
* FUNCTION: Usage
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Display usage and option message
*
******************************************************************************/
void
Usage (
void)
{
printf ("Usage: %s <Options> <InputFile>\n\n", CompilerName);
printf ("Options: -a Create hex assembly source file (*.asm)\n");
printf (" -c Create hex C source file (*.c)\n");
printf (" -i Ignore errors, always create AML file\n");
printf (" -l Create listing (mixed source/AML) file (*.lst)\n");
printf (" -n Create namespace file (*.nsp)\n");
printf (" -o <name> Specify filename prefix for all output files\n");
printf (" (including the .aml file)\n");
printf (" -s Create combined (w/includes) ASL file (*.src)\n");
printf ("\nCompiler Debug Options:\n");
printf (" -d <p|t|b> Create compiler debug/trace file (*.txt)\n");
printf (" Types: Parse/Tree/Both\n");
printf (" -p Parse only, no output generation\n");
printf (" -t Display compile times\n");
printf (" -v <trace level> Set debug level for trace output\n");
Options ();
}
@ -233,21 +289,24 @@ main (
/* Get the command line options */
while ((j = getopt (argc, argv, "acd:ilno:pstv:")) != EOF) switch (j)
while ((j = getopt (argc, argv, "acd:hilno:pst:vx")) != EOF) switch (j)
{
case 'a':
/* Produce assembly code output file */
Gbl_AsmOutputFlag = TRUE;
break;
case 'c':
/* Produce C hex output file */
Gbl_HexOutputFlag = TRUE;
Gbl_C_OutputFlag = TRUE;
break;
case 'd':
switch (optarg[0])
{
case 'b':
@ -260,6 +319,10 @@ main (
case 't':
break;
default:
printf ("Unknown option: -d%s\n", optarg);
BadCommandLine = TRUE;
}
/* Produce debug output file */
@ -267,25 +330,34 @@ main (
Gbl_DebugFlag = TRUE;
break;
case 'h':
HelpMessage ();
return 0;
case 'i':
/* Ignore errors and always attempt to create aml file */
Gbl_IgnoreErrors = TRUE;
break;
case 'l':
/* Produce listing file (Mixed source/aml) */
Gbl_ListingFlag = TRUE;
break;
case 'n':
/* Produce namespace file */
Gbl_NsOutputFlag = TRUE;
break;
case 'o':
/* Override default AML output filename */
Gbl_OutputFilenamePrefix = optarg;
@ -293,28 +365,54 @@ main (
break;
case 'p':
/* Parse only */
Gbl_ParseOnlyFlag = TRUE;
break;
case 's':
/* Produce combined source file */
Gbl_SourceOutputFlag = TRUE;
break;
case 't':
/* Produce hex table output file */
switch (optarg[0])
{
case 'a':
Gbl_HexOutputFlag = HEX_OUTPUT_ASM;
break;
case 'c':
Gbl_HexOutputFlag = HEX_OUTPUT_C;
break;
default:
printf ("Unknown option: -t%s\n", optarg);
BadCommandLine = TRUE;
}
break;
case 'v':
AcpiDbgLevel = strtoul (optarg, NULL, 16);
break;
case 'x':
/* Display compile time(s) */
Gbl_CompileTimesFlag = TRUE;
break;
case 'v':
AcpiDbgLevel = strtoul (optarg, NULL, 16);
break;
default:
BadCommandLine = TRUE;
break;
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslopcode - AML opcode generation
* $Revision: 1.33 $
* $Revision: 1.34 $
*
*****************************************************************************/
@ -132,7 +132,7 @@
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: None
* RETURN: Status
*
* DESCRIPTION: Parse tree walk to generate both the AML opcodes and the AML
* operands.
@ -397,27 +397,33 @@ OpcGenerateAmlOpcode (
break;
case OFFSET:
Node->AmlOpcodeLength = 1;
break;
case ACCESSAS:
OpcDoAccessAs (Node);
break;
case EISAID:
OpcDoEisaId (Node);
break;
case UNICODE:
OpcDoUnicode (Node);
break;
case INCLUDE:
Node->Child->ParseOpcode = DEFAULT_ARG;
Gbl_HasIncludeFiles = TRUE;
break;
case EXTERNAL:
Node->Child->ParseOpcode = DEFAULT_ARG;
Node->Child->Peer->ParseOpcode = DEFAULT_ARG;
break;

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: asloperands - AML operand processing
* $Revision: 1.30 $
* $Revision: 1.31 $
*
*****************************************************************************/
@ -205,7 +205,8 @@ OpnDoMethod (
*
* FUNCTION: OpnDoFieldCommon
*
* PARAMETERS: Node - The parent parse node
* PARAMETERS: FieldNode - Node for an ASL field
* Node - The parent parse node
*
* RETURN: None
*
@ -335,7 +336,6 @@ OpnDoFieldCommon (
NewBitOffset = PkgLengthNode->Value.Integer32;
CurrentBitOffset += NewBitOffset;
break;
}
/* Move on to next entry in the field list */
@ -715,7 +715,7 @@ OpnDoPackage (
*
* RETURN: None
*
* DESCRIPTION:
* DESCRIPTION: Construct the AML operands for the LOADTABLE ASL keyword.
*
******************************************************************************/
@ -771,7 +771,6 @@ OpnDoLoadTable (
OpcGenerateAmlOpcode (Next);
}
*/
}
@ -876,7 +875,7 @@ UtGetArg (
*
* FUNCTION: OpnAttachNameToNode
*
* PARAMETERS: Node - The parent parse node
* PARAMETERS: PsNode - The parent parse node
*
* RETURN: None
*

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslrestype1 - Short (type1) resource templates and descriptors
* $Revision: 1.16 $
* $Revision: 1.17 $
*
*****************************************************************************/
@ -311,6 +311,7 @@ RsDoFixedIoDescriptor (
InitializerNode = RsCompleteNodeAndGetNext (InitializerNode);
}
return (Rnode);
}
@ -397,6 +398,7 @@ RsDoIoDescriptor (
InitializerNode = RsCompleteNodeAndGetNext (InitializerNode);
}
return (Rnode);
}
@ -650,6 +652,7 @@ RsDoMemory24Descriptor (
InitializerNode = RsCompleteNodeAndGetNext (InitializerNode);
}
return (Rnode);
}
@ -736,6 +739,7 @@ RsDoMemory32Descriptor (
InitializerNode = RsCompleteNodeAndGetNext (InitializerNode);
}
return (Rnode);
}
@ -808,6 +812,7 @@ RsDoMemory32FixedDescriptor (
InitializerNode = RsCompleteNodeAndGetNext (InitializerNode);
}
return (Rnode);
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslrestype2 - Long (type2) resource templates and descriptors
* $Revision: 1.13 $
* $Revision: 1.14 $
*
*****************************************************************************/
@ -1245,8 +1245,8 @@ RsDoInterruptDescriptor (
OptionIndex += 4;
}
InitializerNode = Node->Child;
InitializerNode = Node->Child;
Rnode = RsAllocateResourceNode (sizeof (ASL_EXTENDED_XRUPT_DESC) +
OptionIndex + StringLength);
Descriptor = Rnode->Buffer;
@ -1449,12 +1449,10 @@ RsDoGeneralRegisterDescriptor (
InitializerNode = Node->Child;
Rnode = RsAllocateResourceNode (sizeof (ASL_GENERAL_REGISTER_DESC));
Descriptor = Rnode->Buffer;
Descriptor->Grg.DescriptorType = RESOURCE_DESC_GENERAL_REGISTER;
Descriptor->Grg.Length = 12;
/*

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: asltransform - Parse tree transforms
* $Revision: 1.8 $
* $Revision: 1.9 $
*
*****************************************************************************/
@ -127,11 +127,12 @@
*
* FUNCTION: TrAmlGetNextTempName
*
* PARAMETERS:
* PARAMETERS: NamePath - Where a pointer to the temp name is returned
*
* RETURN: None
* RETURN: A pointer to the second character of the name
*
* DESCRIPTION: +
* DESCRIPTION: Generate an ACPI name of the form _Txx. These names are
* reserved for use by the ASL compiler.
*
******************************************************************************/
@ -169,11 +170,12 @@ TrAmlGetNextTempName (
*
* FUNCTION: TrAmlInitLineNumbers
*
* PARAMETERS:
* PARAMETERS: Node - Node to be initialized
* Neighbor - Node used for initialization values
*
* RETURN: None
*
* DESCRIPTION:
* DESCRIPTION: Initialized the various line numbers for a parse node.
*
******************************************************************************/
@ -195,11 +197,12 @@ TrAmlInitLineNumbers (
*
* FUNCTION: TrAmlInitNode
*
* PARAMETERS:
* PARAMETERS: Node - Node to be initialized
* ParseOpcode - Opcode for this node
*
* RETURN: None
*
* DESCRIPTION:
* DESCRIPTION: Initialize a node with the parse opcode and opcode name.
*
******************************************************************************/
@ -218,11 +221,12 @@ TrAmlInitNode (
*
* FUNCTION: TrAmlSetSubtreeParent
*
* PARAMETERS:
* PARAMETERS: Node - First node in a list of peer nodes
* Parent - Parent of the subtree
*
* RETURN: None
*
* DESCRIPTION:
* DESCRIPTION: Set the parent for all peer nodes in a subtree
*
******************************************************************************/
@ -233,6 +237,7 @@ TrAmlSetSubtreeParent (
{
ASL_PARSE_NODE *Next;
Next = Node;
while (Next)
{
@ -246,11 +251,12 @@ TrAmlSetSubtreeParent (
*
* FUNCTION: TrAmlInsertPeer
*
* PARAMETERS:
* PARAMETERS: Node - First node in a list of peer nodes
* NewPeer - Peer node to insert
*
* RETURN: None
*
* DESCRIPTION:
* DESCRIPTION: Insert a new peer node into a list of peers.
*
******************************************************************************/
@ -410,7 +416,8 @@ TrDoElseif (
* RETURN: None
*
*
* DESCRIPTION: Translate switch to if/else pairs
* DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is
* no actual AML opcode for SWITCH -- it must be simulated.
*
******************************************************************************/
@ -538,7 +545,6 @@ TrDoSwitch (
}
}
/*
* Add the default at the end of the if/else construct
*/

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: asltree - parse tree management
* $Revision: 1.38 $
* $Revision: 1.39 $
*
*****************************************************************************/
@ -480,7 +480,6 @@ TrCreateNode (
break;
}
/* Link the new node to its children */
PrevChild = NULL;
@ -916,7 +915,6 @@ TrWalkParseTree (
NodePreviouslyVisited = TRUE;
}
}
break;

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslutils -- compiler utilities
* $Revision: 1.38 $
* $Revision: 1.39 $
*
*****************************************************************************/
@ -488,7 +488,7 @@ UtCheckIntegerRange (
*
* FUNCTION: UtGetStringBuffer
*
* PARAMETERS: None
* PARAMETERS: Length - Size of buffer requested
*
* RETURN: Pointer to the buffer. Aborts on allocation failure
*
@ -522,7 +522,8 @@ UtGetStringBuffer (
*
* FUNCTION: UtInternalizeName
*
* PARAMETERS: None
* PARAMETERS: ExternalName - Name to convert
* ConvertedName - Where the converted name is returned
*
* RETURN: Status
*
@ -711,9 +712,8 @@ UtStrtoul64 (
String++;
}
/*
* Main loop: convert the string to an unsigned long:
*/
/* Main loop: convert the string to an unsigned long */
while (*String)
{
if (isdigit (*String))
@ -738,9 +738,8 @@ UtStrtoul64 (
goto done;
}
/*
* Check to see if value is out of range:
*/
/* Check to see if value is out of range: */
if (ReturnValue > ((ACPI_INTEGER_MAX - (ACPI_INTEGER) index) /
(ACPI_INTEGER) Base))
{