mirror of
https://github.com/acpica/acpica/
synced 2025-01-22 17:32:05 +03:00
Support to emit AML immediately after resource desc in listing
This commit is contained in:
parent
fa487cb584
commit
53021a386a
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslcodegen - AML code generation
|
||||
* $Revision: 1.51 $
|
||||
* $Revision: 1.58 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@ -123,6 +123,36 @@
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslcodegen")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
CgAmlWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
static void
|
||||
CgLocalWriteAmlData (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
void *Buffer,
|
||||
UINT32 Length);
|
||||
|
||||
static void
|
||||
CgWriteAmlOpcode (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static void
|
||||
CgWriteTableHeader (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static void
|
||||
CgCloseTable (
|
||||
void);
|
||||
|
||||
static void
|
||||
CgWriteNode (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -138,7 +168,8 @@
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
CgGenerateAmlOutput (void)
|
||||
CgGenerateAmlOutput (
|
||||
void)
|
||||
{
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nWriting AML\n\n");
|
||||
@ -149,7 +180,8 @@ CgGenerateAmlOutput (void)
|
||||
Gbl_SourceLine = 0;
|
||||
Gbl_NextError = Gbl_ErrorLog;
|
||||
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, CgAmlWriteWalk, NULL, NULL);
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
CgAmlWriteWalk, NULL, NULL);
|
||||
CgCloseTable ();
|
||||
}
|
||||
|
||||
@ -166,7 +198,7 @@ CgGenerateAmlOutput (void)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
CgAmlWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
@ -174,8 +206,19 @@ CgAmlWriteWalk (
|
||||
{
|
||||
|
||||
/*
|
||||
* Debug output
|
||||
* Print header at level 0. Alignment assumes 32-bit pointers
|
||||
*/
|
||||
if (!Level)
|
||||
{
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"Final parse tree used for AML output:\n");
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n",
|
||||
76, " ");
|
||||
}
|
||||
|
||||
/* Debug output */
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
|
||||
UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
|
||||
@ -192,27 +235,27 @@ CgAmlWriteWalk (
|
||||
DbgPrint (ASL_TREE_OUTPUT, " ");
|
||||
}
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"Val-%08X POp-%04X AOp-%04X OpLen-%01X PByts-%01X Len-%04X SubLen-%04X PSubLen-%04X Op-%08X Chld-%08X Paren-%08X Flags-%04X AcTyp-%08X C-%2d L-%d\n",
|
||||
(UINT32) Op->Asl.Value.Integer,
|
||||
Op->Asl.ParseOpcode,
|
||||
Op->Asl.AmlOpcode,
|
||||
Op->Asl.AmlOpcodeLength,
|
||||
Op->Asl.AmlPkgLenBytes,
|
||||
Op->Asl.AmlLength,
|
||||
Op->Asl.AmlSubtreeLength,
|
||||
Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
|
||||
Op,
|
||||
Op->Asl.Child,
|
||||
Op->Asl.Parent,
|
||||
Op->Asl.CompileFlags,
|
||||
Op->Asl.AcpiBtype,
|
||||
Op->Asl.Column,
|
||||
Op->Asl.LineNumber);
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n",
|
||||
/* 1 */ (UINT32) Op->Asl.Value.Integer,
|
||||
/* 2 */ Op->Asl.ParseOpcode,
|
||||
/* 3 */ Op->Asl.AmlOpcode,
|
||||
/* 4 */ Op->Asl.AmlOpcodeLength,
|
||||
/* 5 */ Op->Asl.AmlPkgLenBytes,
|
||||
/* 6 */ Op->Asl.AmlLength,
|
||||
/* 7 */ Op->Asl.AmlSubtreeLength,
|
||||
/* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
|
||||
/* 9 */ Op,
|
||||
/* 10 */ Op->Asl.Child,
|
||||
/* 11 */ Op->Asl.Parent,
|
||||
/* 12 */ Op->Asl.CompileFlags,
|
||||
/* 13 */ Op->Asl.AcpiBtype,
|
||||
/* 14 */ Op->Asl.FinalAmlLength,
|
||||
/* 15 */ Op->Asl.Column,
|
||||
/* 16 */ Op->Asl.LineNumber);
|
||||
|
||||
/* Generate the AML for this node */
|
||||
|
||||
/*
|
||||
* Generate the AML for this node
|
||||
*/
|
||||
CgWriteNode (Op);
|
||||
return (AE_OK);
|
||||
}
|
||||
@ -222,7 +265,8 @@ CgAmlWriteWalk (
|
||||
*
|
||||
* FUNCTION: CgLocalWriteAmlData
|
||||
*
|
||||
* PARAMETERS: Buffer - Buffer to write
|
||||
* PARAMETERS: Op - Current parse op
|
||||
* Buffer - Buffer to write
|
||||
* Length - Size of data in buffer
|
||||
*
|
||||
* RETURN: None
|
||||
@ -231,14 +275,13 @@ CgAmlWriteWalk (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
CgLocalWriteAmlData (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
void *Buffer,
|
||||
UINT32 Length)
|
||||
{
|
||||
|
||||
|
||||
/* Write the raw data to the AML file */
|
||||
|
||||
FlWriteFile (ASL_FILE_AML_OUTPUT, Buffer, Length);
|
||||
@ -264,22 +307,21 @@ CgLocalWriteAmlData (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
CgWriteAmlOpcode (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
UINT8 PkgLenFirstByte;
|
||||
UINT32 i;
|
||||
union {
|
||||
UINT16 Opcode;
|
||||
UINT8 OpcodeBytes[2];
|
||||
UINT16 Opcode;
|
||||
UINT8 OpcodeBytes[2];
|
||||
} Aml;
|
||||
union {
|
||||
UINT32 Len;
|
||||
UINT8 LenBytes[4];
|
||||
UINT32 Len;
|
||||
UINT8 LenBytes[4];
|
||||
} PkgLen;
|
||||
|
||||
UINT8 PkgLenFirstByte;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* We expect some DEFAULT_ARGs, just ignore them */
|
||||
|
||||
@ -360,13 +402,16 @@ CgWriteAmlOpcode (
|
||||
* Encode the "bytes to follow" in the first byte, top two bits.
|
||||
* The low-order nybble of the length is in the bottom 4 bits
|
||||
*/
|
||||
PkgLenFirstByte = (UINT8) (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
|
||||
(PkgLen.LenBytes[0] & 0x0F));
|
||||
PkgLenFirstByte = (UINT8)
|
||||
(((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
|
||||
(PkgLen.LenBytes[0] & 0x0F));
|
||||
|
||||
CgLocalWriteAmlData (Op, &PkgLenFirstByte, 1);
|
||||
|
||||
/* Shift the length over by the 4 bits we just stuffed in the first byte */
|
||||
|
||||
/*
|
||||
* Shift the length over by the 4 bits we just stuffed
|
||||
* in the first byte
|
||||
*/
|
||||
PkgLen.Len >>= 4;
|
||||
|
||||
/* Now we can write the remaining bytes - either 1, 2, or 3 bytes */
|
||||
@ -382,17 +427,17 @@ CgWriteAmlOpcode (
|
||||
{
|
||||
case AML_BYTE_OP:
|
||||
|
||||
CgLocalWriteAmlData (Op, (UINT8 *) &Op->Asl.Value.Integer, 1);
|
||||
CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 1);
|
||||
break;
|
||||
|
||||
case AML_WORD_OP:
|
||||
|
||||
CgLocalWriteAmlData (Op, (UINT16 *) &Op->Asl.Value.Integer, 2);
|
||||
CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 2);
|
||||
break;
|
||||
|
||||
case AML_DWORD_OP:
|
||||
|
||||
CgLocalWriteAmlData (Op, (UINT32 *) &Op->Asl.Value.Integer, 4);
|
||||
CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 4);
|
||||
break;
|
||||
|
||||
case AML_QWORD_OP:
|
||||
@ -418,17 +463,17 @@ CgWriteAmlOpcode (
|
||||
*
|
||||
* PARAMETERS: Op - The DEFINITIONBLOCK node
|
||||
*
|
||||
* RETURN: None.
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Write a table header corresponding to the DEFINITIONBLOCK
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
CgWriteTableHeader (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Child;
|
||||
ACPI_PARSE_OBJECT *Child;
|
||||
|
||||
|
||||
/* AML filename */
|
||||
@ -475,7 +520,7 @@ CgWriteTableHeader (
|
||||
|
||||
TableHeader.AslCompilerRevision = CompilerCreatorRevision;
|
||||
|
||||
/* Table length. Checksum zero for now, will rewrite later */
|
||||
/* Table length. Checksum zero for now, will rewrite later */
|
||||
|
||||
TableHeader.Length = Gbl_TableLength;
|
||||
TableHeader.Checksum = 0;
|
||||
@ -497,8 +542,9 @@ CgWriteTableHeader (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
CgCloseTable (void)
|
||||
static void
|
||||
CgCloseTable (
|
||||
void)
|
||||
{
|
||||
signed char Sum;
|
||||
UINT8 FileByte;
|
||||
@ -535,14 +581,13 @@ CgCloseTable (void)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
CgWriteNode (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ASL_RESOURCE_NODE *Rnode;
|
||||
|
||||
|
||||
Op->Asl.FinalAmlLength = 0;
|
||||
|
||||
/* Always check for DEFAULT_ARG and other "Noop" nodes */
|
||||
/* TBD: this may not be the best place for this check */
|
||||
@ -555,6 +600,8 @@ CgWriteNode (
|
||||
return;
|
||||
}
|
||||
|
||||
Op->Asl.FinalAmlLength = 0;
|
||||
|
||||
switch (Op->Asl.AmlOpcode)
|
||||
{
|
||||
case AML_RAW_DATA_BYTE:
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslcompile - top level compile module
|
||||
* $Revision: 1.90 $
|
||||
* $Revision: 1.91 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -579,6 +579,10 @@ CmDoCompile (
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Optional parse tree dump, compiler debug output only */
|
||||
|
||||
LsDumpParseTree ();
|
||||
|
||||
OpcGetIntegerWidth (RootNode);
|
||||
UtEndEvent (Event);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslcompiler.h - common include file for iASL
|
||||
* $Revision: 1.142 $
|
||||
* $Revision: 1.143 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -333,6 +333,9 @@ void
|
||||
LsDoHexOutput (
|
||||
void);
|
||||
|
||||
void
|
||||
LsDumpParseTree (
|
||||
void);
|
||||
|
||||
/*
|
||||
* aslfold - constant folding
|
||||
@ -760,6 +763,11 @@ RsDoResourceTemplate (
|
||||
* aslrestype1 - generate Small descriptors
|
||||
*/
|
||||
ASL_RESOURCE_NODE *
|
||||
RsDoEndTagDescriptor (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 CurrentByteOffset);
|
||||
|
||||
ASL_RESOURCE_NODE *
|
||||
RsDoDmaDescriptor (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 CurrentByteOffset);
|
||||
|
@ -3,7 +3,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslcompiler.y - Bison input file (ASL grammar and actions)
|
||||
* $Revision: 1.94 $
|
||||
* $Revision: 1.95 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -272,6 +272,7 @@ AslLocalAllocate (unsigned int Size);
|
||||
%token <i> PARSEOP_ELSE
|
||||
%token <i> PARSEOP_ELSEIF
|
||||
%token <i> PARSEOP_ENDDEPENDENTFN
|
||||
%token <i> PARSEOP_ENDTAG
|
||||
%token <i> PARSEOP_ERRORNODE
|
||||
%token <i> PARSEOP_EVENT
|
||||
%token <i> PARSEOP_EXTENDEDIO
|
||||
@ -2443,12 +2444,18 @@ EISAIDTerm
|
||||
/******* Resources and Memory ***********************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Note: Create two default nodes to allow conversion to a Buffer AML opcode
|
||||
* Also, insert the EndTag at the end of the template.
|
||||
*/
|
||||
ResourceTemplateTerm
|
||||
: PARSEOP_RESOURCETEMPLATE '(' ')'
|
||||
'{'
|
||||
ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,3,
|
||||
ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4,
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$5);}
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
|
||||
$5,
|
||||
TrCreateLeafNode (PARSEOP_ENDTAG));}
|
||||
;
|
||||
|
||||
UnicodeTerm
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asllisting - Listing file generation
|
||||
* $Revision: 1.58 $
|
||||
* $Revision: 1.59 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -200,6 +200,54 @@ LsDoHexOutputAsm (
|
||||
void);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsTreeWriteWalk
|
||||
*
|
||||
* PARAMETERS: ASL_WALK_CALLBACK
|
||||
*
|
||||
*
|
||||
* RETURN: None.
|
||||
*
|
||||
* DESCRIPTION: Dump entire parse tree, for compiler debug only
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
LsTreeWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context)
|
||||
{
|
||||
|
||||
/* Debug output */
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
|
||||
UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
|
||||
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LsDumpParseTree (
|
||||
void)
|
||||
{
|
||||
|
||||
if (!Gbl_DebugFlag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
LsTreeWriteWalk, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsDumpAscii
|
||||
@ -324,6 +372,13 @@ LsAmlListingWalk (
|
||||
|
||||
LsWriteNodeToListing (Op, FileId);
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
|
||||
{
|
||||
/* Buffer is a resource template, don't dump the data all at once */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Write the hex bytes to the listing file(s) (if requested) */
|
||||
|
||||
for (i = 0; i < Op->Asl.FinalAmlLength; i++)
|
||||
@ -1081,6 +1136,12 @@ LsWriteNodeToListing (
|
||||
|
||||
|
||||
case PARSEOP_DEFAULT_ARG:
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
|
||||
{
|
||||
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.EndLogicalLine,
|
||||
FileId);
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
@ -1109,7 +1170,6 @@ LsWriteNodeToListing (
|
||||
case AML_FIELD_OP:
|
||||
case AML_INDEX_FIELD_OP:
|
||||
case AML_BANK_FIELD_OP:
|
||||
case AML_NAME_OP:
|
||||
|
||||
/*
|
||||
* For fields, we want to dump all the AML after the
|
||||
@ -1119,6 +1179,24 @@ LsWriteNodeToListing (
|
||||
FileId);
|
||||
break;
|
||||
|
||||
case AML_NAME_OP:
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
|
||||
{
|
||||
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.LogicalLineNumber,
|
||||
FileId);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* For fields, we want to dump all the AML after the
|
||||
* entire definition
|
||||
*/
|
||||
LsWriteSourceLines (Op->Asl.EndLine, Op->Asl.EndLogicalLine,
|
||||
FileId);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.LogicalLineNumber,
|
||||
FileId);
|
||||
@ -1209,6 +1287,12 @@ LsWriteNodeToListing (
|
||||
case AML_CLASS_CREATE:
|
||||
default:
|
||||
|
||||
if ((Op->Asl.ParseOpcode == PARSEOP_BUFFER) &&
|
||||
(Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.LogicalLineNumber,
|
||||
FileId);
|
||||
break;
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslmap - parser to AML opcode mapping table
|
||||
* $Revision: 1.79 $
|
||||
* $Revision: 1.81 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -170,6 +170,56 @@ AslMapNamedOpcodeToDataType (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: MpDisplayReservedNames
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print the table above
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
MpDisplayReservedNames (
|
||||
void)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
printf ("Reserved name information\n\n");
|
||||
|
||||
for (i = 0; ReservedMethods[i].Name; i++)
|
||||
{
|
||||
printf ("%s ", ReservedMethods[i].Name);
|
||||
|
||||
if (ReservedMethods[i].Flags & ASL_RSVD_SCOPE)
|
||||
{
|
||||
printf ("Reserved scope name\n");
|
||||
}
|
||||
else if (ReservedMethods[i].Flags & ASL_RSVD_RESOURCE_NAME)
|
||||
{
|
||||
printf ("Resource data type reserved field name\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("Method with %d arguments, ",
|
||||
ReservedMethods[i].NumArguments);
|
||||
|
||||
if (ReservedMethods[i].Flags & ASL_RSVD_RETURN_VALUE)
|
||||
{
|
||||
printf ("must return a value\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("no return value\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* DATA STRUCTURE: ReservedMethods
|
||||
@ -399,54 +449,6 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: MpDisplayReservedNames
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print the table above
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
MpDisplayReservedNames (
|
||||
void)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
printf ("Reserved name information\n\n");
|
||||
|
||||
for (i = 0; ReservedMethods[i].Name; i++)
|
||||
{
|
||||
printf ("%s ", ReservedMethods[i].Name);
|
||||
|
||||
if (ReservedMethods[i].Flags & ASL_RSVD_SCOPE)
|
||||
{
|
||||
printf ("Reserved scope name\n");
|
||||
}
|
||||
else if (ReservedMethods[i].Flags & ASL_RSVD_RESOURCE_NAME)
|
||||
{
|
||||
printf ("Resource data type reserved field name\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("Method with %d arguments, ", ReservedMethods[i].NumArguments);
|
||||
if (ReservedMethods[i].Flags & ASL_RSVD_RETURN_VALUE)
|
||||
{
|
||||
printf ("must return a value\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("no return value\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* DATA STRUCTURE: AslKeywordMapping
|
||||
@ -549,6 +551,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* ELSE */ OP_TABLE_ENTRY (AML_ELSE_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* ELSEIF */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* ENDDEPENDENTFN */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* ENDTAG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* ERRORNODE */ OP_TABLE_ENTRY (AML_NOOP_OP, 0, 0, 0),
|
||||
/* EVENT */ OP_TABLE_ENTRY (AML_EVENT_OP, 0, 0, 0),
|
||||
/* EXTENDEDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslresource - Resource templates and descriptors
|
||||
* $Revision: 1.38 $
|
||||
* $Revision: 1.39 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -423,6 +423,11 @@ RsDoOneResourceDescriptor (
|
||||
CurrentByteOffset);
|
||||
break;
|
||||
|
||||
case PARSEOP_ENDTAG:
|
||||
Rnode = RsDoEndTagDescriptor (DescriptorTypeOp,
|
||||
CurrentByteOffset);
|
||||
break;
|
||||
|
||||
case PARSEOP_EXTENDEDIO:
|
||||
Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp,
|
||||
CurrentByteOffset);
|
||||
@ -581,6 +586,11 @@ RsDoOneResourceDescriptor (
|
||||
DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
|
||||
DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
|
||||
|
||||
if (Rnode)
|
||||
{
|
||||
DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
|
||||
}
|
||||
|
||||
return (Rnode);
|
||||
}
|
||||
|
||||
@ -658,7 +668,6 @@ RsDoResourceTemplate (
|
||||
ACPI_PARSE_OBJECT *BufferOp;
|
||||
ACPI_PARSE_OBJECT *DescriptorTypeOp;
|
||||
ACPI_PARSE_OBJECT *LastOp = NULL;
|
||||
AML_RESOURCE *Descriptor;
|
||||
UINT32 CurrentByteOffset = 0;
|
||||
ASL_RESOURCE_NODE HeadRnode;
|
||||
ASL_RESOURCE_NODE *PreviousRnode;
|
||||
@ -666,6 +675,13 @@ RsDoResourceTemplate (
|
||||
UINT8 State;
|
||||
|
||||
|
||||
/* Mark parent as containing a resource template */
|
||||
|
||||
if (Op->Asl.Parent)
|
||||
{
|
||||
Op->Asl.Parent->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
|
||||
}
|
||||
|
||||
/* ResourceTemplate Opcode is first (Op) */
|
||||
/* Buffer Length node is first child */
|
||||
|
||||
@ -679,12 +695,16 @@ RsDoResourceTemplate (
|
||||
|
||||
DescriptorTypeOp = ASL_GET_PEER_NODE (BufferOp);
|
||||
|
||||
/* Process all resource descriptors in the list */
|
||||
|
||||
/*
|
||||
* Process all resource descriptors in the list
|
||||
* Note: It is assumed that the EndTag node has been automatically
|
||||
* inserted at the end of the template by the parser.
|
||||
*/
|
||||
State = ACPI_RSTATE_NORMAL;
|
||||
PreviousRnode = &HeadRnode;
|
||||
while (DescriptorTypeOp)
|
||||
{
|
||||
DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
|
||||
Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset,
|
||||
&State);
|
||||
|
||||
@ -711,19 +731,6 @@ RsDoResourceTemplate (
|
||||
AslError (ASL_ERROR, ASL_MSG_MISSING_ENDDEPENDENT, LastOp, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert the EndTag descriptor after all other descriptors have
|
||||
* been processed
|
||||
*/
|
||||
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_TAG));
|
||||
|
||||
Descriptor = Rnode->Buffer;
|
||||
Descriptor->EndTag.DescriptorType = ACPI_RESOURCE_NAME_END_TAG |
|
||||
ASL_RDESC_END_TAG_SIZE;
|
||||
Descriptor->EndTag.Checksum = 0;
|
||||
|
||||
CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, Rnode);
|
||||
|
||||
/*
|
||||
* Transform the nodes into the following
|
||||
*
|
||||
@ -733,11 +740,10 @@ RsDoResourceTemplate (
|
||||
*/
|
||||
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
|
||||
Op->Asl.AmlOpcode = AML_BUFFER_OP;
|
||||
Op->Asl.CompileFlags = NODE_AML_PACKAGE;
|
||||
Op->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
|
||||
|
||||
BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
|
||||
BufferLengthOp->Asl.Value.Integer = CurrentByteOffset;
|
||||
|
||||
(void) OpcSetOptimalIntegerSize (BufferLengthOp);
|
||||
|
||||
BufferOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
|
||||
@ -745,6 +751,7 @@ RsDoResourceTemplate (
|
||||
BufferOp->Asl.AmlOpcodeLength = 0;
|
||||
BufferOp->Asl.AmlLength = CurrentByteOffset;
|
||||
BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next;
|
||||
BufferOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DATA;
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslrestype1 - Short (type1) resource templates and descriptors
|
||||
* $Revision: 1.35 $
|
||||
* $Revision: 1.36 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -123,6 +123,40 @@
|
||||
ACPI_MODULE_NAME ("aslrestype1")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: RsDoEndTagDescriptor
|
||||
*
|
||||
* PARAMETERS: Op - Parent resource descriptor parse node
|
||||
* CurrentByteOffset - Offset into the resource template AML
|
||||
* buffer (to track references to the desc)
|
||||
*
|
||||
* RETURN: Completed resource node
|
||||
*
|
||||
* DESCRIPTION: Construct a short "EndDependentFn" descriptor
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ASL_RESOURCE_NODE *
|
||||
RsDoEndTagDescriptor (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 CurrentByteOffset)
|
||||
{
|
||||
AML_RESOURCE *Descriptor;
|
||||
ASL_RESOURCE_NODE *Rnode;
|
||||
|
||||
|
||||
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_TAG));
|
||||
|
||||
Descriptor = Rnode->Buffer;
|
||||
Descriptor->EndTag.DescriptorType = ACPI_RESOURCE_NAME_END_TAG |
|
||||
ASL_RDESC_END_TAG_SIZE;
|
||||
Descriptor->EndTag.Checksum = 0;
|
||||
|
||||
return (Rnode);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: RsDoDmaDescriptor
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asltypes.h - compiler data types and struct definitions
|
||||
* $Revision: 1.79 $
|
||||
* $Revision: 1.80 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -148,6 +148,7 @@
|
||||
#define NODE_IS_NAME_DECLARATION 0x00010000
|
||||
#define NODE_COMPILER_EMITTED 0x00020000
|
||||
#define NODE_IS_DUPLICATE 0x00040000
|
||||
#define NODE_IS_RESOURCE_DATA 0x00080000
|
||||
|
||||
/* Keeps information about individual control methods */
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslutils -- compiler utilities
|
||||
* $Revision: 1.66 $
|
||||
* $Revision: 1.67 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -430,9 +430,13 @@ UtPrintFormattedName (
|
||||
UINT32 Level)
|
||||
{
|
||||
|
||||
if (Level)
|
||||
{
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%*s", (3 * Level), " ");
|
||||
}
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%*s %-16.16s", (3 * Level), " ",
|
||||
UtGetOpName (ParseOpcode));
|
||||
" %-20.20s", UtGetOpName (ParseOpcode));
|
||||
|
||||
if (Level < TEXT_OFFSET)
|
||||
{
|
||||
@ -459,7 +463,8 @@ UtSetParseOpName (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
strncpy (Op->Asl.ParseOpName, UtGetOpName (Op->Asl.ParseOpcode), 12);
|
||||
strncpy (Op->Asl.ParseOpName, UtGetOpName (Op->Asl.ParseOpcode),
|
||||
ACPI_MAX_PARSEOP_NAME);
|
||||
}
|
||||
|
||||
|
||||
@ -484,7 +489,8 @@ UtGetOpName (
|
||||
* First entries (ASL_YYTNAME_START) in yytname are special reserved names.
|
||||
* Ignore first 8 characters of the name
|
||||
*/
|
||||
return ((char *) yytname [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
|
||||
return ((char *) yytname
|
||||
[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user