Merge ACPICA 20170728.
This commit is contained in:
commit
5f9b24fa43
@ -355,6 +355,7 @@ contrib/dev/acpica/components/dispatcher/dsmethod.c optional acpi
|
||||
contrib/dev/acpica/components/dispatcher/dsmthdat.c optional acpi
|
||||
contrib/dev/acpica/components/dispatcher/dsobject.c optional acpi
|
||||
contrib/dev/acpica/components/dispatcher/dsopcode.c optional acpi
|
||||
contrib/dev/acpica/components/dispatcher/dspkginit.c optional acpi
|
||||
contrib/dev/acpica/components/dispatcher/dsutils.c optional acpi
|
||||
contrib/dev/acpica/components/dispatcher/dswexec.c optional acpi
|
||||
contrib/dev/acpica/components/dispatcher/dswload.c optional acpi
|
||||
|
@ -21,10 +21,9 @@ stripdirs="generate libraries parsers preprocessor tests tools"
|
||||
stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \
|
||||
acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \
|
||||
acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \
|
||||
acwin.h acwin64.h acwinex.h dspkginit.c new_table.txt \
|
||||
osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \
|
||||
osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \
|
||||
readme.txt utclib.c utprint.c"
|
||||
acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \
|
||||
osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \
|
||||
oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c utprint.c"
|
||||
|
||||
# include files to canonify
|
||||
src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \
|
||||
|
@ -1,3 +1,155 @@
|
||||
----------------------------------------
|
||||
28 July 2017. Summary of changes for version 20170728:
|
||||
|
||||
|
||||
1) ACPICA kernel-resident subsystem:
|
||||
|
||||
Fixed a regression seen with small resource descriptors that could cause
|
||||
an inadvertent AE_AML_NO_RESOURCE_END_TAG exception.
|
||||
|
||||
AML interpreter: Implemented a new feature that allows forward references
|
||||
from individual named references within package objects that are
|
||||
contained within blocks of "module-level code". This provides
|
||||
compatibility with other ACPI implementations and supports existing
|
||||
firmware that depends on this feature. Example:
|
||||
|
||||
Name (ABCD, 1)
|
||||
If (ABCD) /* An If() at module-level */
|
||||
{
|
||||
Name (PKG1, Package()
|
||||
{
|
||||
INT1 /* Forward reference to object INT1
|
||||
*/
|
||||
})
|
||||
Name (INT1, 0x1234)
|
||||
}
|
||||
|
||||
AML Interpreter: Fixed a problem with the Alias() operator where aliases
|
||||
to some ASL objects were not handled properly. Objects affected are:
|
||||
Mutex, Event, and OperationRegion.
|
||||
|
||||
AML Debugger: Enhanced to properly handle AML Alias objects. These
|
||||
objects have one level of indirection which was not fully supported by
|
||||
the debugger.
|
||||
|
||||
Table Manager: Added support to detect and ignore duplicate SSDTs within
|
||||
the XSDT/RSDT. This error in the XSDT has been seen in the field.
|
||||
|
||||
EFI and EDK2 support:
|
||||
Enabled /WX flag for MSVC builds
|
||||
Added support for AcpiOsStall, AcpiOsSleep, and AcpiOsGetTimer
|
||||
Added local support for 64-bit multiply and shift operations
|
||||
Added support to compile acpidump.efi on Windows
|
||||
Added OSL function stubs for interfaces not used under EFI
|
||||
|
||||
Added additional support for the _DMA predefined name. _DMA returns a
|
||||
buffer containing a resource template. This change add support within the
|
||||
resource manager (AcpiWalkResourceBuffer) to walk and parse this list of
|
||||
resource descriptors. Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
|
||||
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Fixed a problem where the internal input line buffer(s) could
|
||||
overflow if there are very long lines in the input ASL source code file.
|
||||
Implemented buffer management that automatically increases the size of
|
||||
the buffers as necessary.
|
||||
|
||||
iASL: Added an option (-vx) to "expect" particular remarks, warnings and
|
||||
errors. If the specified exception is not raised during compilation, the
|
||||
compiler emits an error. This is intended to support the ASL test suite,
|
||||
but may be useful in other contexts.
|
||||
|
||||
iASL: Implemented a new predefined macro, __METHOD__, which returns a
|
||||
string containing the name of the current control method that is being
|
||||
compiled.
|
||||
|
||||
iASL: Implemented debugger and table compiler support for the SDEI ACPI
|
||||
table (Software Delegated Exception Interface). James Morse
|
||||
<james.morse@arm.com>
|
||||
|
||||
Unix/Linux makefiles: Added an option to disable compile optimizations.
|
||||
The disable occurs when the NOOPT flag is set to TRUE.
|
||||
theracermaster@gmail.com
|
||||
|
||||
Acpidump: Added support for multiple DSDT and FACS tables. This can occur
|
||||
when there are different tables for 32-bit versus 64-bit.
|
||||
|
||||
Enhanced error reporting for the ASL test suite (ASLTS) by removing
|
||||
unnecessary/verbose text, and emit the actual line number where an error
|
||||
has occurred. These changes are intended to improve the usefulness of the
|
||||
test suite.
|
||||
|
||||
----------------------------------------
|
||||
29 June 2017. Summary of changes for version 20170629:
|
||||
|
||||
|
||||
1) ACPICA kernel-resident subsystem:
|
||||
|
||||
Tables: Implemented a deferred ACPI table verification. This is useful
|
||||
for operating systems where the tables cannot be verified in the early
|
||||
initialization stage due to early memory mapping limitations on some
|
||||
architectures. Lv Zheng.
|
||||
|
||||
Tables: Removed the signature validation for dynamically loaded tables.
|
||||
Provides compatibility with other ACPI implementations. Previously, only
|
||||
SSDT tables were allowed, as per the ACPI specification. Now, any table
|
||||
signature can be used via the Load() operator. Lv Zheng.
|
||||
|
||||
Tables: Fixed several mutex issues that could cause errors during table
|
||||
acquisition. Lv Zheng.
|
||||
|
||||
Tables: Fixed a problem where an ACPI warning could be generated if a
|
||||
null pointer was passed to the AcpiPutTable interface. Lv Zheng.
|
||||
|
||||
Tables: Added a mechanism to handle imbalances for the AcpiGetTable and
|
||||
AcpiPutTable interfaces. This applies to the "late stage" table loading
|
||||
when the use of AcpiPutTable is no longer required (since the system
|
||||
memory manager is fully running and available). Lv Zheng.
|
||||
|
||||
Fixed/Reverted a regression during processing of resource descriptors
|
||||
that contain only a single EndTag. Fixes an AE_AML_NO_RESOURCE_END_TAG
|
||||
exception in this case.
|
||||
|
||||
Headers: IORT/SMMU support: Updated the SMMU models for Revision C of the
|
||||
I/O Remapping specification. Robin Murphy <robin.murphy@arm.com>
|
||||
|
||||
Interpreter: Fixed a possible fault if an Alias operator with an invalid
|
||||
or duplicate target is encountered during Alias creation in
|
||||
AcpiExCreateAlias. Alex James <theracermaster@gmail.com>
|
||||
|
||||
Added an option to use designated initializers for function pointers.
|
||||
Kees Cook <keescook@google.com>
|
||||
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Allow compilation of External declarations with target pathnames
|
||||
that refer to existing named objects within the table. Erik Schmauss.
|
||||
|
||||
iASL: Fixed a regression when compiling FieldUnits. Fixes an error if a
|
||||
FieldUnit name also is declared via External in the same table. Erik
|
||||
Schmauss.
|
||||
|
||||
iASL: Allow existing scope names within pathnames used in External
|
||||
statements. For example:
|
||||
External (ABCD.EFGH) // ABCD exists, but EFGH is truly external
|
||||
Device (ABCD)
|
||||
|
||||
iASL: IORT ACPI table: Implemented changes required to decode the new
|
||||
Proximity Domain for the SMMUv3 IORT. Disassembler and Data Table
|
||||
compiler. Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
|
||||
|
||||
Disassembler: Don't abort disassembly on errors from External()
|
||||
statements. Erik Schmauss.
|
||||
|
||||
Disassembler: fixed a possible fault when one of the Create*Field
|
||||
operators references a Resource Template. ACPICA Bugzilla 1396.
|
||||
|
||||
iASL: In the source code, resolved some naming inconsistences across the
|
||||
parsing support. Fixes confusion between "Parse Op" and "Parse Node".
|
||||
Adds a new file, aslparseop.c
|
||||
|
||||
----------------------------------------
|
||||
31 May 2017. Summary of changes for version 20170531:
|
||||
|
||||
|
@ -173,6 +173,36 @@ AcCheckTextModeCorruption (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcDeleteTableList
|
||||
*
|
||||
* PARAMETERS: ListHead - List to delete
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Delete a list of tables. This is useful for removing memory
|
||||
* allocated by AcGetAllTablesFromFile
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcDeleteTableList (
|
||||
ACPI_NEW_TABLE_DESC *ListHead)
|
||||
{
|
||||
ACPI_NEW_TABLE_DESC *Current = ListHead;
|
||||
ACPI_NEW_TABLE_DESC *Previous = Current;
|
||||
|
||||
|
||||
while (Current)
|
||||
{
|
||||
Current = Current->Next;
|
||||
AcpiOsFree (Previous);
|
||||
Previous = Current;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcGetAllTablesFromFile
|
||||
|
@ -408,6 +408,8 @@ Cleanup:
|
||||
ACPI_FREE (Table);
|
||||
}
|
||||
|
||||
AcDeleteTableList (ListHead);
|
||||
|
||||
if (File)
|
||||
{
|
||||
fclose (File);
|
||||
@ -748,6 +750,7 @@ AdDoExternalFileList (
|
||||
continue;
|
||||
}
|
||||
|
||||
AcDeleteTableList (ExternalListHead);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
@ -761,6 +764,7 @@ AdDoExternalFileList (
|
||||
{
|
||||
AcpiOsPrintf ("Could not parse external ACPI tables, %s\n",
|
||||
AcpiFormatException (Status));
|
||||
AcDeleteTableList (ExternalListHead);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
@ -780,6 +784,8 @@ AdDoExternalFileList (
|
||||
ExternalFileList = ExternalFileList->Next;
|
||||
}
|
||||
|
||||
AcDeleteTableList (ExternalListHead);
|
||||
|
||||
if (ACPI_FAILURE (GlobalStatus))
|
||||
{
|
||||
return (GlobalStatus);
|
||||
|
@ -536,11 +536,20 @@ AcpiDmDumpDescending (
|
||||
case AML_NAME_OP:
|
||||
case AML_METHOD_OP:
|
||||
case AML_DEVICE_OP:
|
||||
|
||||
AcpiOsPrintf ("%4.4s",
|
||||
ACPI_CAST_PTR (char, &Op->Named.Name));
|
||||
break;
|
||||
|
||||
case AML_INT_NAMEDFIELD_OP:
|
||||
|
||||
AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name));
|
||||
AcpiOsPrintf ("%4.4s Length: (bits) %8.8X%8.8X (bytes) %8.8X%8.8X",
|
||||
ACPI_CAST_PTR (char, &Op->Named.Name),
|
||||
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer),
|
||||
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer / 8));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
@ -1070,10 +1079,10 @@ AcpiDmCommonDescendingOp (
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Resource descriptor conversion */
|
||||
|
||||
Status = AcpiDmProcessResourceDescriptors (Op, Level, Context);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -1082,7 +1091,6 @@ AcpiDmCommonDescendingOp (
|
||||
/* Switch/Case conversion */
|
||||
|
||||
Status = AcpiDmProcessSwitch (Op);
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@ -1113,6 +1121,7 @@ AcpiDmProcessResourceDescriptors (
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
WalkState = Info->WalkState;
|
||||
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
|
||||
|
||||
@ -1138,7 +1147,6 @@ AcpiDmProcessResourceDescriptors (
|
||||
* If so, convert the reference into a symbolic reference.
|
||||
*/
|
||||
AcpiDmCheckResourceReference (Op, WalkState);
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -474,6 +474,15 @@ AcpiAhMatchPredefinedName (
|
||||
const AH_PREDEFINED_NAME *Info;
|
||||
|
||||
|
||||
/* Nameseg must start with an underscore */
|
||||
|
||||
if (*Nameseg != '_')
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Search for a match in the predefined name table */
|
||||
|
||||
for (Info = AslPredefinedInfo; Info->Name; Info++)
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Nameseg, Info->Name))
|
||||
|
@ -239,6 +239,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] =
|
||||
{ACPI_SIG_RSDT, "Root System Description Table"},
|
||||
{ACPI_SIG_S3PT, "S3 Performance Table"},
|
||||
{ACPI_SIG_SBST, "Smart Battery Specification Table"},
|
||||
{ACPI_SIG_SDEI, "Software Delegated Exception Interface Table"},
|
||||
{ACPI_SIG_SLIC, "Software Licensing Description Table"},
|
||||
{ACPI_SIG_SLIT, "System Locality Information Table"},
|
||||
{ACPI_SIG_SPCR, "Serial Port Console Redirection table"},
|
||||
|
@ -493,6 +493,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt},
|
||||
{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt},
|
||||
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst},
|
||||
{ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei},
|
||||
{ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic},
|
||||
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit},
|
||||
{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr},
|
||||
|
@ -218,6 +218,7 @@
|
||||
#define ACPI_RASF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RASF,f)
|
||||
#define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f)
|
||||
#define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f)
|
||||
#define ACPI_SDEI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEI,f)
|
||||
#define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f)
|
||||
#define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f)
|
||||
#define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
|
||||
@ -1838,6 +1839,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] =
|
||||
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Flags), "Flags (decoded below)", 0},
|
||||
{ACPI_DMT_FLAG0, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "COHACC Override", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "HTTU Override", 0},
|
||||
{ACPI_DMT_FLAG3, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "Proximity Domain Valid", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (VatosAddress), "VATOS Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Model), "Model", 0},
|
||||
@ -1845,6 +1847,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] =
|
||||
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERR GSIV", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync GSIV", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
@ -2763,6 +2768,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SDEI - Software Delegated Execption Interface Descriptor Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSdei[] =
|
||||
{
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@ -435,13 +435,13 @@ AnCheckMethodReturnValue (
|
||||
/* Examine the parent op of this method */
|
||||
|
||||
OwningOp = Node->Op;
|
||||
if (OwningOp->Asl.CompileFlags & NODE_METHOD_NO_RETVAL)
|
||||
if (OwningOp->Asl.CompileFlags & OP_METHOD_NO_RETVAL)
|
||||
{
|
||||
/* Method NEVER returns a value */
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_NO_RETVAL, Op, Op->Asl.ExternalName);
|
||||
}
|
||||
else if (OwningOp->Asl.CompileFlags & NODE_METHOD_SOME_NO_RETVAL)
|
||||
else if (OwningOp->Asl.CompileFlags & OP_METHOD_SOME_NO_RETVAL)
|
||||
{
|
||||
/* Method SOMETIMES returns a value, SOMETIMES not */
|
||||
|
||||
|
@ -560,7 +560,7 @@ AnGetBtype (
|
||||
return (ACPI_UINT32_MAX);
|
||||
}
|
||||
|
||||
if (ReferencedNode->Asl.CompileFlags & NODE_METHOD_TYPED)
|
||||
if (ReferencedNode->Asl.CompileFlags & OP_METHOD_TYPED)
|
||||
{
|
||||
ThisNodeBtype = ReferencedNode->Asl.AcpiBtype;
|
||||
}
|
||||
|
@ -291,6 +291,8 @@ CgAmlWriteWalk (
|
||||
/* 19 */ Op->Asl.LogicalLineNumber,
|
||||
/* 20 */ Op->Asl.EndLogicalLine);
|
||||
|
||||
TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT);
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@ -438,7 +440,7 @@ CgWriteAmlOpcode (
|
||||
|
||||
/* Does this opcode have an associated "PackageLength" field? */
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
|
||||
if (Op->Asl.CompileFlags & OP_AML_PACKAGE)
|
||||
{
|
||||
if (Op->Asl.AmlPkgLenBytes == 1)
|
||||
{
|
||||
|
@ -815,6 +815,7 @@ CmCleanupAndExit (
|
||||
BOOLEAN DeleteAmlFile = FALSE;
|
||||
|
||||
|
||||
AslCheckExpectedExceptions ();
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
|
@ -413,12 +413,20 @@ AslError (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *ExtraMessage);
|
||||
|
||||
void
|
||||
AslCheckExpectedExceptions (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AslExpectException (
|
||||
char *MessageIdString);
|
||||
|
||||
ACPI_STATUS
|
||||
AslDisableException (
|
||||
char *MessageIdString);
|
||||
|
||||
BOOLEAN
|
||||
AslIsExceptionDisabled (
|
||||
AslIsExceptionIgnored (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId);
|
||||
|
||||
@ -789,17 +797,6 @@ TrAmlTransformWalkEnd (
|
||||
void *Context);
|
||||
|
||||
|
||||
/*
|
||||
* asltree - parse tree support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
TrWalkParseTree (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Visitation,
|
||||
ASL_WALK_CALLBACK DescendingCallback,
|
||||
ASL_WALK_CALLBACK AscendingCallback,
|
||||
void *Context);
|
||||
|
||||
/*
|
||||
* aslexternal - External opcode support
|
||||
*/
|
||||
@ -826,104 +823,112 @@ ExDoExternal (
|
||||
#define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD)
|
||||
|
||||
|
||||
void
|
||||
TrSetParent (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_PARSE_OBJECT *ParentOp);
|
||||
|
||||
/*
|
||||
* aslparseop.c - Parse op create/allocate/cache
|
||||
*/
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrAllocateNode (
|
||||
UINT32 ParseOpcode);
|
||||
|
||||
void
|
||||
TrPrintNodeCompileFlags (
|
||||
UINT32 Flags);
|
||||
|
||||
void
|
||||
TrReleaseNode (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrUpdateNode (
|
||||
UINT32 ParseOpcode,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateNode (
|
||||
TrCreateOp (
|
||||
UINT32 ParseOpcode,
|
||||
UINT32 NumChildren,
|
||||
...);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateLeafNode (
|
||||
TrCreateLeafOp (
|
||||
UINT32 ParseOpcode);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateNullTarget (
|
||||
TrCreateNullTargetOp (
|
||||
void);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateAssignmentNode (
|
||||
TrCreateAssignmentOp (
|
||||
ACPI_PARSE_OBJECT *Target,
|
||||
ACPI_PARSE_OBJECT *Source);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateTargetOperand (
|
||||
TrCreateTargetOp (
|
||||
ACPI_PARSE_OBJECT *OriginalOp,
|
||||
ACPI_PARSE_OBJECT *ParentOp);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateValuedLeafNode (
|
||||
TrCreateValuedLeafOp (
|
||||
UINT32 ParseOpcode,
|
||||
UINT64 Value);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateConstantLeafNode (
|
||||
TrCreateConstantLeafOp (
|
||||
UINT32 ParseOpcode);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrLinkChildren (
|
||||
TrAllocateOp (
|
||||
UINT32 ParseOpcode);
|
||||
|
||||
void
|
||||
TrPrintOpFlags (
|
||||
UINT32 Flags,
|
||||
UINT32 OutputLevel);
|
||||
|
||||
|
||||
/*
|
||||
* asltree.c - Parse tree management
|
||||
*/
|
||||
void
|
||||
TrSetOpParent (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_PARSE_OBJECT *ParentOp);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrSetOpIntegerValue (
|
||||
UINT32 ParseOpcode,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
TrSetOpEndLineNumber (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
TrSetOpCurrentFilename (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrLinkOpChildren (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 NumChildren,
|
||||
...);
|
||||
|
||||
void
|
||||
TrSetEndLineNumber (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
TrSetCurrentFilename (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
TrWalkTree (
|
||||
void);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrLinkPeerNode (
|
||||
TrLinkPeerOp (
|
||||
ACPI_PARSE_OBJECT *Op1,
|
||||
ACPI_PARSE_OBJECT *Op2);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrLinkChildNode (
|
||||
TrLinkChildOp (
|
||||
ACPI_PARSE_OBJECT *Op1,
|
||||
ACPI_PARSE_OBJECT *Op2);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrSetNodeFlags (
|
||||
TrSetOpFlags (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Flags);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrSetNodeAmlLength (
|
||||
TrSetOpAmlLength (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Length);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrLinkPeerNodes (
|
||||
TrLinkPeerOps (
|
||||
UINT32 NumPeers,
|
||||
...);
|
||||
|
||||
ACPI_STATUS
|
||||
TrWalkParseTree (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Visitation,
|
||||
ASL_WALK_CALLBACK DescendingCallback,
|
||||
ASL_WALK_CALLBACK AscendingCallback,
|
||||
void *Context);
|
||||
|
||||
|
||||
/*
|
||||
* aslfiles - File I/O support
|
||||
|
@ -809,7 +809,7 @@ NamePathTail [.]{NameSeg}
|
||||
"__FILE__" { count (0); return (PARSEOP___FILE__); }
|
||||
"__LINE__" { count (0); return (PARSEOP___LINE__); }
|
||||
"__PATH__" { count (0); return (PARSEOP___PATH__); }
|
||||
|
||||
"__METHOD__" { count (0); return (PARSEOP___METHOD__); }
|
||||
|
||||
{NameSeg} { char *s;
|
||||
count (0);
|
||||
|
@ -201,59 +201,59 @@ Expression
|
||||
|
||||
/* Unary operators */
|
||||
|
||||
: PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
|
||||
| PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());}
|
||||
: PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafOp (PARSEOP_LNOT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>2,1,$3);}
|
||||
| PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafOp (PARSEOP_NOT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>2,2,$3,TrCreateNullTargetOp ());}
|
||||
|
||||
| SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
|
||||
{$$ = TrLinkChildren ($<n>3,1,$1);}
|
||||
| SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
|
||||
{$$ = TrLinkChildren ($<n>3,1,$1);}
|
||||
| SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafOp (PARSEOP_INCREMENT);}
|
||||
{$$ = TrLinkOpChildren ($<n>3,1,$1);}
|
||||
| SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafOp (PARSEOP_DECREMENT);}
|
||||
{$$ = TrLinkOpChildren ($<n>3,1,$1);}
|
||||
|
||||
/* Binary operators: math and logical */
|
||||
|
||||
| TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
|
||||
TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,4,$1,$4,TrCreateNullTargetOp (),
|
||||
TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
|
||||
| TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
|
||||
| TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafOp (PARSEOP_AND);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafOp (PARSEOP_OR);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
| TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
|
||||
|
||||
| TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATER);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATEREQUAL);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafOp (PARSEOP_LLESS);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LLESSEQUAL);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
|
||||
| TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LEQUAL);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LNOTEQUAL);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
|
||||
| TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafOp (PARSEOP_LAND);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
| TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafOp (PARSEOP_LOR);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
|
||||
|
||||
/* Parentheses */
|
||||
|
||||
@ -280,8 +280,8 @@ IndexExpTerm
|
||||
: SuperName
|
||||
PARSEOP_EXP_INDEX_LEFT
|
||||
TermArg
|
||||
PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX);
|
||||
TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());}
|
||||
PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafOp (PARSEOP_INDEX);
|
||||
TrLinkOpChildren ($$,3,$1,$3,TrCreateNullTargetOp ());}
|
||||
;
|
||||
|
||||
|
||||
@ -304,7 +304,7 @@ EqualsTerm
|
||||
|
||||
| SuperName
|
||||
PARSEOP_EXP_EQUALS
|
||||
TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
|
||||
TermArg {$$ = TrCreateAssignmentOp ($1, $3);}
|
||||
|
||||
/* Chained equals: (a=RefOf)=b, a=b=c=d etc. */
|
||||
|
||||
@ -312,47 +312,47 @@ EqualsTerm
|
||||
EqualsTerm
|
||||
PARSEOP_CLOSE_PAREN
|
||||
PARSEOP_EXP_EQUALS
|
||||
TermArg {$$ = TrCreateAssignmentNode ($2, $5);}
|
||||
TermArg {$$ = TrCreateAssignmentOp ($2, $5);}
|
||||
|
||||
/* Compound assignments -- Add (operand, operand, target) */
|
||||
|
||||
| TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,4,$1,$4,TrCreateNullTargetOp (),
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_AND);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_OR);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
|
||||
| TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
|
||||
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
|
||||
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
|
||||
| TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);}
|
||||
TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
|
||||
TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
|
||||
;
|
||||
|
@ -290,7 +290,7 @@
|
||||
|
||||
#define ASL_PARSE_TREE_DEBUG2 \
|
||||
" %08X %04X %04X %01X %04X %04X %05X %05X "\
|
||||
"%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d\n"
|
||||
"%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d"
|
||||
|
||||
/*
|
||||
* Macros for ASL/ASL+ converter
|
||||
|
@ -160,6 +160,16 @@ static void
|
||||
AeAddToErrorLog (
|
||||
ASL_ERROR_MSG *Enode);
|
||||
|
||||
static BOOLEAN
|
||||
AslIsExceptionExpected (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId);
|
||||
|
||||
static BOOLEAN
|
||||
AslIsExceptionDisabled (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -806,6 +816,115 @@ AslCommonError (
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslIsExceptionIgnored
|
||||
*
|
||||
* PARAMETERS: Level - Seriousness (Warning/error, etc.)
|
||||
* MessageId - Index into global message buffer
|
||||
*
|
||||
* RETURN: BOOLEAN
|
||||
*
|
||||
* DESCRIPTION: Check if a particular exception is ignored. In this case it
|
||||
* means that the exception is (expected or disabled.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
AslIsExceptionIgnored (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId)
|
||||
{
|
||||
BOOLEAN ExceptionIgnored;
|
||||
|
||||
|
||||
/* Note: this allows exception to be disabled and expected */
|
||||
|
||||
ExceptionIgnored = AslIsExceptionDisabled (Level, MessageId);
|
||||
ExceptionIgnored |= AslIsExceptionExpected (Level, MessageId);
|
||||
|
||||
return (Gbl_AllExceptionsDisabled || ExceptionIgnored);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslCheckExpectException
|
||||
*
|
||||
* PARAMETERS: none
|
||||
*
|
||||
* RETURN: none
|
||||
*
|
||||
* DESCRIPTION: Check the global expected messages table and raise an error
|
||||
* for each message that has not been received.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AslCheckExpectedExceptions (
|
||||
void)
|
||||
{
|
||||
UINT8 i;
|
||||
|
||||
for (i = 0; i < Gbl_ExpectedMessagesIndex; ++i)
|
||||
{
|
||||
if (!Gbl_ExpectedMessages[i].MessageReceived)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_EXCEPTION_NOT_RECEIVED, NULL,
|
||||
Gbl_ExpectedMessages[i].MessageIdStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslExpectException
|
||||
*
|
||||
* PARAMETERS: MessageIdString - ID of excepted exception during compile
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enter a message ID into the global expected messages table
|
||||
* If these messages are not raised during the compilation, throw
|
||||
* an error.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AslExpectException (
|
||||
char *MessageIdString)
|
||||
{
|
||||
UINT32 MessageId;
|
||||
|
||||
|
||||
/* Convert argument to an integer and validate it */
|
||||
|
||||
MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);
|
||||
|
||||
if (MessageId > 6999)
|
||||
{
|
||||
printf ("\"%s\" is not a valid warning/remark/erro ID\n",
|
||||
MessageIdString);
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Insert value into the global expected message array */
|
||||
|
||||
if (Gbl_ExpectedMessagesIndex >= ASL_MAX_EXPECTED_MESSAGES)
|
||||
{
|
||||
printf ("Too many messages have been registered as expected (max %u)\n",
|
||||
ASL_MAX_DISABLED_MESSAGES);
|
||||
return (AE_LIMIT);
|
||||
}
|
||||
|
||||
Gbl_ExpectedMessages[Gbl_ExpectedMessagesIndex].MessageId = MessageId;
|
||||
Gbl_ExpectedMessages[Gbl_ExpectedMessagesIndex].MessageIdStr = MessageIdString;
|
||||
Gbl_ExpectedMessages[Gbl_ExpectedMessagesIndex].MessageReceived = FALSE;
|
||||
Gbl_ExpectedMessagesIndex++;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -866,7 +985,48 @@ AslDisableException (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
static BOOLEAN
|
||||
AslIsExceptionExpected (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId)
|
||||
{
|
||||
UINT32 EncodedMessageId;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/*
|
||||
* Mark this exception as received
|
||||
*/
|
||||
EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
|
||||
for (i = 0; i < Gbl_ExpectedMessagesIndex; i++)
|
||||
{
|
||||
/* Simple implementation via fixed array */
|
||||
|
||||
if (EncodedMessageId == Gbl_ExpectedMessages[i].MessageId)
|
||||
{
|
||||
return (Gbl_ExpectedMessages[i].MessageReceived = TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslIsExceptionDisabled
|
||||
*
|
||||
* PARAMETERS: Level - Seriousness (Warning/error, etc.)
|
||||
* MessageId - Index into global message buffer
|
||||
*
|
||||
* RETURN: TRUE if exception/message should be ignored
|
||||
*
|
||||
* DESCRIPTION: Check if the user has specified options such that this
|
||||
* exception should be ignored
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AslIsExceptionDisabled (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId)
|
||||
@ -940,8 +1100,7 @@ AslError (
|
||||
|
||||
/* Check if user wants to ignore this exception */
|
||||
|
||||
if (Gbl_AllExceptionsDisabled ||
|
||||
AslIsExceptionDisabled (Level, MessageId))
|
||||
if (AslIsExceptionIgnored (Level, MessageId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ ExDoExternal (
|
||||
|
||||
/* Create new list node of arbitrary type */
|
||||
|
||||
ListOp = TrAllocateNode (PARSEOP_DEFAULT_ARG);
|
||||
ListOp = TrAllocateOp (PARSEOP_DEFAULT_ARG);
|
||||
|
||||
/* Store External node as child */
|
||||
|
||||
@ -266,7 +266,7 @@ ExInsertArgCount (
|
||||
|
||||
/* Skip if External node already handled */
|
||||
|
||||
if (Next->Asl.Child->Asl.CompileFlags & NODE_VISITED)
|
||||
if (Next->Asl.Child->Asl.CompileFlags & OP_VISITED)
|
||||
{
|
||||
Next = Next->Asl.Next;
|
||||
continue;
|
||||
@ -282,7 +282,7 @@ ExInsertArgCount (
|
||||
continue;
|
||||
}
|
||||
|
||||
Next->Asl.Child->Asl.CompileFlags |= NODE_VISITED;
|
||||
Next->Asl.Child->Asl.CompileFlags |= OP_VISITED;
|
||||
|
||||
/*
|
||||
* Since we will reposition Externals to the Root, set Namepath
|
||||
@ -544,7 +544,7 @@ ExMoveExternals (
|
||||
Next->Asl.Child->Asl.Next->Asl.Value.Integer;
|
||||
|
||||
if (ObjType == ACPI_TYPE_METHOD &&
|
||||
!(Next->Asl.CompileFlags & NODE_VISITED))
|
||||
!(Next->Asl.CompileFlags & OP_VISITED))
|
||||
{
|
||||
if (Next == Prev)
|
||||
{
|
||||
@ -578,12 +578,12 @@ ExMoveExternals (
|
||||
|
||||
Gbl_ExternalsListHead->Asl.ParseOpcode = PARSEOP_IF;
|
||||
Gbl_ExternalsListHead->Asl.AmlOpcode = AML_IF_OP;
|
||||
Gbl_ExternalsListHead->Asl.CompileFlags = NODE_AML_PACKAGE;
|
||||
Gbl_ExternalsListHead->Asl.CompileFlags = OP_AML_PACKAGE;
|
||||
UtSetParseOpName (Gbl_ExternalsListHead);
|
||||
|
||||
/* Create a Zero op for the If predicate */
|
||||
|
||||
PredicateOp = TrAllocateNode (PARSEOP_ZERO);
|
||||
PredicateOp = TrAllocateOp (PARSEOP_ZERO);
|
||||
PredicateOp->Asl.AmlOpcode = AML_ZERO_OP;
|
||||
|
||||
PredicateOp->Asl.Parent = Gbl_ExternalsListHead;
|
||||
|
@ -232,8 +232,8 @@ OpcAmlConstantWalk (
|
||||
* Only interested in subtrees that could possibly contain
|
||||
* expressions that can be evaluated at this time
|
||||
*/
|
||||
if ((!(Op->Asl.CompileFlags & NODE_COMPILE_TIME_CONST)) ||
|
||||
(Op->Asl.CompileFlags & NODE_IS_TARGET))
|
||||
if ((!(Op->Asl.CompileFlags & OP_COMPILE_TIME_CONST)) ||
|
||||
(Op->Asl.CompileFlags & OP_IS_TARGET))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
@ -412,7 +412,7 @@ OpcAmlCheckForConstant (
|
||||
{
|
||||
/* Error if there is a target operand */
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TARGET)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_INVALID_TARGET, Op, NULL);
|
||||
Status = AE_TYPE;
|
||||
@ -420,11 +420,11 @@ OpcAmlCheckForConstant (
|
||||
|
||||
/* Error if expression cannot be reduced (folded) */
|
||||
|
||||
if (!(NextOp->Asl.CompileFlags & NODE_COULD_NOT_REDUCE))
|
||||
if (!(NextOp->Asl.CompileFlags & OP_COULD_NOT_REDUCE))
|
||||
{
|
||||
/* Ensure only one error message per statement */
|
||||
|
||||
NextOp->Asl.CompileFlags |= NODE_COULD_NOT_REDUCE;
|
||||
NextOp->Asl.CompileFlags |= OP_COULD_NOT_REDUCE;
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"**** Could not reduce operands for NAME opcode ****\n");
|
||||
|
||||
@ -441,7 +441,7 @@ OpcAmlCheckForConstant (
|
||||
|
||||
/* This is not a 3/4/5 opcode, but maybe can convert to STORE */
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TARGET)
|
||||
{
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"**** Valid Target, transform to Store ****\n");
|
||||
@ -484,7 +484,7 @@ OpcAmlCheckForConstant (
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345");
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TARGET)
|
||||
{
|
||||
if (Op->Asl.ParseOpcode == PARSEOP_ZERO)
|
||||
{
|
||||
@ -496,7 +496,7 @@ OpcAmlCheckForConstant (
|
||||
}
|
||||
}
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TERM_ARG)
|
||||
{
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " TERMARG");
|
||||
}
|
||||
@ -505,7 +505,7 @@ CleanupAndExit:
|
||||
|
||||
/* Dump the node compile flags also */
|
||||
|
||||
TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
|
||||
TrPrintOpFlags (Op->Asl.CompileFlags, ASL_PARSE_OUTPUT);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\n");
|
||||
return (Status);
|
||||
}
|
||||
@ -543,7 +543,7 @@ TrSimpleConstantReduction (
|
||||
|
||||
/* Allocate a new temporary root for this subtree */
|
||||
|
||||
RootOp = TrAllocateNode (PARSEOP_INTEGER);
|
||||
RootOp = TrAllocateOp (PARSEOP_INTEGER);
|
||||
if (!RootOp)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
@ -654,7 +654,7 @@ TrTransformToStoreOp (
|
||||
* Create a NULL (zero) target so that we can use the
|
||||
* interpreter to evaluate the expression.
|
||||
*/
|
||||
NewTarget = TrCreateNullTarget ();
|
||||
NewTarget = TrCreateNullTargetOp ();
|
||||
NewTarget->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
|
||||
|
||||
/* Handle one-operand cases (NOT, TOBCD, etc.) */
|
||||
@ -670,7 +670,7 @@ TrTransformToStoreOp (
|
||||
Child2->Asl.Next = NewTarget;
|
||||
NewTarget->Asl.Parent = OriginalTarget->Asl.Parent;
|
||||
|
||||
NewParent = TrAllocateNode (PARSEOP_INTEGER);
|
||||
NewParent = TrAllocateOp (PARSEOP_INTEGER);
|
||||
NewParent->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
|
||||
|
||||
OriginalParent = Op->Common.Parent;
|
||||
@ -799,12 +799,12 @@ TrInstallReducedConstant (
|
||||
*/
|
||||
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
|
||||
Op->Common.AmlOpcode = AML_BUFFER_OP;
|
||||
Op->Asl.CompileFlags = NODE_AML_PACKAGE;
|
||||
Op->Asl.CompileFlags = OP_AML_PACKAGE;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Child node is the buffer length */
|
||||
|
||||
LengthOp = TrAllocateNode (PARSEOP_INTEGER);
|
||||
LengthOp = TrAllocateOp (PARSEOP_INTEGER);
|
||||
|
||||
LengthOp->Asl.AmlOpcode = AML_DWORD_OP;
|
||||
LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
|
||||
@ -815,7 +815,7 @@ TrInstallReducedConstant (
|
||||
|
||||
/* Next child is the raw buffer data */
|
||||
|
||||
DataOp = TrAllocateNode (PARSEOP_RAW_DATA);
|
||||
DataOp = TrAllocateOp (PARSEOP_RAW_DATA);
|
||||
DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
|
||||
DataOp->Asl.AmlLength = ObjDesc->Buffer.Length;
|
||||
DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
|
||||
@ -863,25 +863,25 @@ OpcUpdateIntegerNode (
|
||||
{
|
||||
case 1:
|
||||
|
||||
TrUpdateNode (PARSEOP_BYTECONST, Op);
|
||||
TrSetOpIntegerValue (PARSEOP_BYTECONST, Op);
|
||||
Op->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
TrUpdateNode (PARSEOP_WORDCONST, Op);
|
||||
TrSetOpIntegerValue (PARSEOP_WORDCONST, Op);
|
||||
Op->Asl.AmlOpcode = AML_RAW_DATA_WORD;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
||||
TrUpdateNode (PARSEOP_DWORDCONST, Op);
|
||||
TrSetOpIntegerValue (PARSEOP_DWORDCONST, Op);
|
||||
Op->Asl.AmlOpcode = AML_RAW_DATA_DWORD;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
|
||||
TrUpdateNode (PARSEOP_QWORDCONST, Op);
|
||||
TrSetOpIntegerValue (PARSEOP_QWORDCONST, Op);
|
||||
Op->Asl.AmlOpcode = AML_RAW_DATA_QWORD;
|
||||
break;
|
||||
|
||||
@ -889,7 +889,7 @@ OpcUpdateIntegerNode (
|
||||
default:
|
||||
|
||||
OpcSetOptimalIntegerSize (Op);
|
||||
TrUpdateNode (PARSEOP_INTEGER, Op);
|
||||
TrSetOpIntegerValue (PARSEOP_INTEGER, Op);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -196,9 +196,37 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
|
||||
{NULL, NULL, "Converter db :", "Converter debug Output"}
|
||||
};
|
||||
|
||||
/* Table below must match the defines with the same names in actypes.h */
|
||||
|
||||
const char *Gbl_OpFlagNames[ACPI_NUM_OP_FLAGS] =
|
||||
{
|
||||
"OP_VISITED",
|
||||
"OP_AML_PACKAGE",
|
||||
"OP_IS_TARGET",
|
||||
"OP_IS_RESOURCE_DESC",
|
||||
"OP_IS_RESOURCE_FIELD",
|
||||
"OP_HAS_NO_EXIT",
|
||||
"OP_IF_HAS_NO_EXIT",
|
||||
"OP_NAME_INTERNALIZED",
|
||||
"OP_METHOD_NO_RETVAL",
|
||||
"OP_METHOD_SOME_NO_RETVAL",
|
||||
"OP_RESULT_NOT_USED",
|
||||
"OP_METHOD_TYPED",
|
||||
"OP_COULD_NOT_REDUCE",
|
||||
"OP_COMPILE_TIME_CONST",
|
||||
"OP_IS_TERM_ARG",
|
||||
"OP_WAS_ONES_OP",
|
||||
"OP_IS_NAME_DECLARATION",
|
||||
"OP_COMPILER_EMITTED",
|
||||
"OP_IS_DUPLICATE",
|
||||
"OP_IS_RESOURCE_DATA",
|
||||
"OP_IS_NULL_RETURN"
|
||||
};
|
||||
|
||||
#else
|
||||
extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
|
||||
extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
|
||||
extern const char *Gbl_OpFlagNames[ACPI_NUM_OP_FLAGS];
|
||||
#endif
|
||||
|
||||
|
||||
@ -224,6 +252,7 @@ extern int AslCompilerdebug;
|
||||
#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */
|
||||
#define ASL_MSG_BUFFER_SIZE (1024 * 32) /* 32k */
|
||||
#define ASL_MAX_DISABLED_MESSAGES 32
|
||||
#define ASL_MAX_EXPECTED_MESSAGES 32
|
||||
#define HEX_TABLE_LINE_SIZE 8
|
||||
#define HEX_LISTING_LINE_SIZE 8
|
||||
|
||||
@ -368,6 +397,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLine, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_DisabledMessagesIndex, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ExpectedMessagesIndex, 0);
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_HexBytesWereWritten, FALSE);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
|
||||
@ -387,9 +417,9 @@ ASL_EXTERN ASL_COMMENT_STATE Gbl_CommentState;
|
||||
* Determines if an inline comment should be saved in the InlineComment or NodeEndComment
|
||||
* field of ACPI_PARSE_OBJECT.
|
||||
*/
|
||||
ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_Comment_List_Head, NULL);
|
||||
ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_Comment_List_Tail, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Inline_Comment_Buffer, NULL);
|
||||
ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_CommentListHead, NULL);
|
||||
ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_CommentListTail, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_InlineCommentBuffer, NULL);
|
||||
|
||||
/* Static structures */
|
||||
|
||||
@ -410,6 +440,7 @@ ASL_EXTERN char MsgBuffer[ASL_MSG_BUFFER_SIZE];
|
||||
ASL_EXTERN char StringBuffer[ASL_MSG_BUFFER_SIZE];
|
||||
ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE];
|
||||
ASL_EXTERN UINT32 Gbl_DisabledMessages[ASL_MAX_DISABLED_MESSAGES];
|
||||
ASL_EXTERN ASL_EXPECTED_MESSAGE Gbl_ExpectedMessages[ASL_MAX_EXPECTED_MESSAGES];
|
||||
|
||||
|
||||
#endif /* __ASLGLOBAL_H */
|
||||
|
@ -204,6 +204,7 @@ Usage (
|
||||
ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs");
|
||||
ACPI_OPTION ("-vr", "Disable remarks");
|
||||
ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
|
||||
ACPI_OPTION ("-vx <messageid>", "Expect a specific warning, remark, or error");
|
||||
ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level");
|
||||
ACPI_OPTION ("-we", "Report warnings as errors");
|
||||
|
||||
|
@ -160,11 +160,11 @@ NoEcho('
|
||||
******************************************************************************/
|
||||
|
||||
OptionalBusMasterKeyword
|
||||
: ',' {$$ = TrCreateLeafNode (
|
||||
: ',' {$$ = TrCreateLeafOp (
|
||||
PARSEOP_BUSMASTERTYPE_MASTER);}
|
||||
| ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (
|
||||
| ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafOp (
|
||||
PARSEOP_BUSMASTERTYPE_MASTER);}
|
||||
| ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (
|
||||
| ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafOp (
|
||||
PARSEOP_BUSMASTERTYPE_NOTMASTER);}
|
||||
;
|
||||
|
||||
@ -176,9 +176,9 @@ OptionalAccessAttribTerm
|
||||
;
|
||||
|
||||
OptionalAccessSize
|
||||
: {$$ = TrCreateValuedLeafNode (
|
||||
: {$$ = TrCreateValuedLeafOp (
|
||||
PARSEOP_BYTECONST, 0);}
|
||||
| ',' {$$ = TrCreateValuedLeafNode (
|
||||
| ',' {$$ = TrCreateValuedLeafOp (
|
||||
PARSEOP_BYTECONST, 0);}
|
||||
| ',' ByteConstExpr {$$ = $2;}
|
||||
;
|
||||
@ -243,10 +243,10 @@ OptionalIoRestriction
|
||||
;
|
||||
|
||||
OptionalListString
|
||||
: {$$ = TrCreateValuedLeafNode (
|
||||
: {$$ = TrCreateValuedLeafOp (
|
||||
PARSEOP_STRING_LITERAL,
|
||||
ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
|
||||
| ',' {$$ = TrCreateValuedLeafNode (
|
||||
| ',' {$$ = TrCreateValuedLeafOp (
|
||||
PARSEOP_STRING_LITERAL,
|
||||
ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
|
||||
| ',' TermArg {$$ = $2;}
|
||||
@ -280,13 +280,13 @@ OptionalNameString_Last
|
||||
;
|
||||
|
||||
OptionalNameString_First
|
||||
: {$$ = TrCreateLeafNode (
|
||||
: {$$ = TrCreateLeafOp (
|
||||
PARSEOP_ZERO);}
|
||||
| NameString {$$ = $1;}
|
||||
;
|
||||
|
||||
OptionalObjectTypeKeyword
|
||||
: {$$ = TrCreateLeafNode (
|
||||
: {$$ = TrCreateLeafOp (
|
||||
PARSEOP_OBJECTTYPE_UNK);}
|
||||
| ',' ObjectTypeKeyword {$$ = $2;}
|
||||
;
|
||||
@ -308,33 +308,33 @@ OptionalRangeType
|
||||
;
|
||||
|
||||
OptionalReadWriteKeyword
|
||||
: {$$ = TrCreateLeafNode (
|
||||
: {$$ = TrCreateLeafOp (
|
||||
PARSEOP_READWRITETYPE_BOTH);}
|
||||
| PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (
|
||||
| PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafOp (
|
||||
PARSEOP_READWRITETYPE_BOTH);}
|
||||
| PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (
|
||||
| PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafOp (
|
||||
PARSEOP_READWRITETYPE_READONLY);}
|
||||
;
|
||||
|
||||
OptionalResourceType_First
|
||||
: {$$ = TrCreateLeafNode (
|
||||
: {$$ = TrCreateLeafOp (
|
||||
PARSEOP_RESOURCETYPE_CONSUMER);}
|
||||
| ResourceTypeKeyword {$$ = $1;}
|
||||
;
|
||||
|
||||
OptionalResourceType
|
||||
: {$$ = TrCreateLeafNode (
|
||||
: {$$ = TrCreateLeafOp (
|
||||
PARSEOP_RESOURCETYPE_CONSUMER);}
|
||||
| ',' {$$ = TrCreateLeafNode (
|
||||
| ',' {$$ = TrCreateLeafOp (
|
||||
PARSEOP_RESOURCETYPE_CONSUMER);}
|
||||
| ',' ResourceTypeKeyword {$$ = $2;}
|
||||
;
|
||||
|
||||
/* Same as above except default is producer */
|
||||
OptionalProducerResourceType
|
||||
: {$$ = TrCreateLeafNode (
|
||||
: {$$ = TrCreateLeafOp (
|
||||
PARSEOP_RESOURCETYPE_PRODUCER);}
|
||||
| ',' {$$ = TrCreateLeafNode (
|
||||
| ',' {$$ = TrCreateLeafOp (
|
||||
PARSEOP_RESOURCETYPE_PRODUCER);}
|
||||
| ',' ResourceTypeKeyword {$$ = $2;}
|
||||
;
|
||||
@ -395,9 +395,9 @@ OptionalWordConstExpr
|
||||
;
|
||||
|
||||
OptionalXferSize
|
||||
: {$$ = TrCreateValuedLeafNode (
|
||||
: {$$ = TrCreateValuedLeafOp (
|
||||
PARSEOP_XFERSIZE_32, 2);}
|
||||
| ',' {$$ = TrCreateValuedLeafNode (
|
||||
| ',' {$$ = TrCreateValuedLeafOp (
|
||||
PARSEOP_XFERSIZE_32, 2);}
|
||||
| ',' XferSizeKeyword {$$ = $2;}
|
||||
;
|
||||
|
@ -159,46 +159,46 @@ NoEcho('
|
||||
******************************************************************************/
|
||||
|
||||
AccessAttribKeyword
|
||||
: PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);}
|
||||
| PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);}
|
||||
| PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);}
|
||||
| PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );}
|
||||
| PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);}
|
||||
| PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);}
|
||||
| PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);}
|
||||
: PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BLOCK);}
|
||||
| PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BLOCK_CALL);}
|
||||
| PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BYTE);}
|
||||
| PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_QUICK );}
|
||||
| PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_SND_RCV);}
|
||||
| PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_WORD);}
|
||||
| PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_WORD_CALL);}
|
||||
| PARSEOP_ACCESSATTRIB_MULTIBYTE
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_MULTIBYTE);}
|
||||
ByteConst
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
|
||||
| PARSEOP_ACCESSATTRIB_RAW_BYTES
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_RAW_BYTES);}
|
||||
ByteConst
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
|
||||
| PARSEOP_ACCESSATTRIB_RAW_PROCESS
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_RAW_PROCESS);}
|
||||
ByteConst
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
|
||||
;
|
||||
|
||||
AccessTypeKeyword
|
||||
: PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);}
|
||||
| PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);}
|
||||
| PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);}
|
||||
| PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);}
|
||||
| PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);}
|
||||
| PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);}
|
||||
: PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_ANY);}
|
||||
| PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_BYTE);}
|
||||
| PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_WORD);}
|
||||
| PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_DWORD);}
|
||||
| PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_QWORD);}
|
||||
| PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_BUF);}
|
||||
;
|
||||
|
||||
AddressingModeKeyword
|
||||
: PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);}
|
||||
| PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);}
|
||||
: PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafOp (PARSEOP_ADDRESSINGMODE_7BIT);}
|
||||
| PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafOp (PARSEOP_ADDRESSINGMODE_10BIT);}
|
||||
;
|
||||
|
||||
AddressKeyword
|
||||
: PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);}
|
||||
| PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);}
|
||||
| PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);}
|
||||
| PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);}
|
||||
: PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_MEMORY);}
|
||||
| PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_RESERVED);}
|
||||
| PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_NVS);}
|
||||
| PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_ACPI);}
|
||||
;
|
||||
|
||||
AddressSpaceKeyword
|
||||
@ -207,130 +207,130 @@ AddressSpaceKeyword
|
||||
;
|
||||
|
||||
BitsPerByteKeyword
|
||||
: PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);}
|
||||
| PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);}
|
||||
| PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);}
|
||||
| PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);}
|
||||
| PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);}
|
||||
: PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_FIVE);}
|
||||
| PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_SIX);}
|
||||
| PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_SEVEN);}
|
||||
| PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_EIGHT);}
|
||||
| PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_NINE);}
|
||||
;
|
||||
|
||||
ClockPhaseKeyword
|
||||
: PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);}
|
||||
| PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);}
|
||||
: PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafOp (PARSEOP_CLOCKPHASE_FIRST);}
|
||||
| PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafOp (PARSEOP_CLOCKPHASE_SECOND);}
|
||||
;
|
||||
|
||||
ClockPolarityKeyword
|
||||
: PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);}
|
||||
| PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);}
|
||||
: PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafOp (PARSEOP_CLOCKPOLARITY_LOW);}
|
||||
| PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafOp (PARSEOP_CLOCKPOLARITY_HIGH);}
|
||||
;
|
||||
|
||||
DecodeKeyword
|
||||
: PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);}
|
||||
| PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);}
|
||||
: PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafOp (PARSEOP_DECODETYPE_POS);}
|
||||
| PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafOp (PARSEOP_DECODETYPE_SUB);}
|
||||
;
|
||||
|
||||
DevicePolarityKeyword
|
||||
: PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);}
|
||||
| PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);}
|
||||
: PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafOp (PARSEOP_DEVICEPOLARITY_LOW);}
|
||||
| PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafOp (PARSEOP_DEVICEPOLARITY_HIGH);}
|
||||
;
|
||||
|
||||
DMATypeKeyword
|
||||
: PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);}
|
||||
| PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);}
|
||||
| PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);}
|
||||
| PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);}
|
||||
: PARSEOP_DMATYPE_A {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_A);}
|
||||
| PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_COMPATIBILITY);}
|
||||
| PARSEOP_DMATYPE_B {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_B);}
|
||||
| PARSEOP_DMATYPE_F {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_F);}
|
||||
;
|
||||
|
||||
EndianKeyword
|
||||
: PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);}
|
||||
| PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);}
|
||||
: PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafOp (PARSEOP_ENDIAN_LITTLE);}
|
||||
| PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafOp (PARSEOP_ENDIAN_BIG);}
|
||||
;
|
||||
|
||||
FlowControlKeyword
|
||||
: PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);}
|
||||
| PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);}
|
||||
| PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);}
|
||||
: PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_HW);}
|
||||
| PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_NONE);}
|
||||
| PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_SW);}
|
||||
;
|
||||
|
||||
InterruptLevel
|
||||
: PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);}
|
||||
| PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);}
|
||||
| PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);}
|
||||
: PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVEBOTH);}
|
||||
| PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVEHIGH);}
|
||||
| PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVELOW);}
|
||||
;
|
||||
|
||||
InterruptTypeKeyword
|
||||
: PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);}
|
||||
| PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);}
|
||||
: PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafOp (PARSEOP_INTTYPE_EDGE);}
|
||||
| PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafOp (PARSEOP_INTTYPE_LEVEL);}
|
||||
;
|
||||
|
||||
IODecodeKeyword
|
||||
: PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);}
|
||||
| PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);}
|
||||
: PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafOp (PARSEOP_IODECODETYPE_16);}
|
||||
| PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafOp (PARSEOP_IODECODETYPE_10);}
|
||||
;
|
||||
|
||||
IoRestrictionKeyword
|
||||
: PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);}
|
||||
| PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);}
|
||||
| PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);}
|
||||
| PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);}
|
||||
: PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_IN);}
|
||||
| PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_OUT);}
|
||||
| PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_NONE);}
|
||||
| PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_PRESERVE);}
|
||||
;
|
||||
|
||||
LockRuleKeyword
|
||||
: PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);}
|
||||
| PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);}
|
||||
: PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafOp (PARSEOP_LOCKRULE_LOCK);}
|
||||
| PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafOp (PARSEOP_LOCKRULE_NOLOCK);}
|
||||
;
|
||||
|
||||
MatchOpKeyword
|
||||
: PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);}
|
||||
| PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);}
|
||||
| PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);}
|
||||
| PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);}
|
||||
| PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);}
|
||||
| PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);}
|
||||
: PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MTR);}
|
||||
| PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MEQ);}
|
||||
| PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MLE);}
|
||||
| PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MLT);}
|
||||
| PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MGE);}
|
||||
| PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MGT);}
|
||||
;
|
||||
|
||||
MaxKeyword
|
||||
: PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);}
|
||||
| PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);}
|
||||
: PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafOp (PARSEOP_MAXTYPE_FIXED);}
|
||||
| PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafOp (PARSEOP_MAXTYPE_NOTFIXED);}
|
||||
;
|
||||
|
||||
MemTypeKeyword
|
||||
: PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);}
|
||||
| PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);}
|
||||
| PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);}
|
||||
| PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);}
|
||||
: PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_CACHEABLE);}
|
||||
| PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_WRITECOMBINING);}
|
||||
| PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_PREFETCHABLE);}
|
||||
| PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_NONCACHEABLE);}
|
||||
;
|
||||
|
||||
MinKeyword
|
||||
: PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);}
|
||||
| PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);}
|
||||
: PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafOp (PARSEOP_MINTYPE_FIXED);}
|
||||
| PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafOp (PARSEOP_MINTYPE_NOTFIXED);}
|
||||
;
|
||||
|
||||
ObjectTypeKeyword
|
||||
: PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);}
|
||||
| PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);}
|
||||
| PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);}
|
||||
| PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);}
|
||||
| PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);}
|
||||
| PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);}
|
||||
| PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);}
|
||||
| PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);}
|
||||
| PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);}
|
||||
| PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);}
|
||||
| PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);}
|
||||
| PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);}
|
||||
| PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);}
|
||||
| PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);}
|
||||
| PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);}
|
||||
| PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);}
|
||||
: PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_UNK);}
|
||||
| PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_INT);}
|
||||
| PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_STR);}
|
||||
| PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_BUF);}
|
||||
| PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_PKG);}
|
||||
| PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_FLD);}
|
||||
| PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_DEV);}
|
||||
| PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_EVT);}
|
||||
| PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_MTH);}
|
||||
| PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_MTX);}
|
||||
| PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_OPR);}
|
||||
| PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_POW);}
|
||||
| PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_PRO);}
|
||||
| PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_THZ);}
|
||||
| PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_BFF);}
|
||||
| PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_DDB);}
|
||||
;
|
||||
|
||||
ParityTypeKeyword
|
||||
: PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);}
|
||||
| PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);}
|
||||
| PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);}
|
||||
| PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);}
|
||||
| PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);}
|
||||
: PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_SPACE);}
|
||||
| PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_MARK);}
|
||||
| PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_ODD);}
|
||||
| PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_EVEN);}
|
||||
| PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_NONE);}
|
||||
;
|
||||
|
||||
PinConfigByte
|
||||
@ -339,125 +339,125 @@ PinConfigByte
|
||||
;
|
||||
|
||||
PinConfigKeyword
|
||||
: PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);}
|
||||
| PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);}
|
||||
| PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);}
|
||||
| PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);}
|
||||
: PARSEOP_PIN_NOPULL {$$ = TrCreateLeafOp (PARSEOP_PIN_NOPULL);}
|
||||
| PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLDOWN);}
|
||||
| PARSEOP_PIN_PULLUP {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLUP);}
|
||||
| PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLDEFAULT);}
|
||||
;
|
||||
|
||||
PldKeyword
|
||||
: PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);}
|
||||
| PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);}
|
||||
| PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);}
|
||||
| PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);}
|
||||
| PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);}
|
||||
| PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);}
|
||||
| PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);}
|
||||
| PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);}
|
||||
| PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);}
|
||||
| PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);}
|
||||
| PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);}
|
||||
| PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);}
|
||||
| PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);}
|
||||
| PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);}
|
||||
| PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);}
|
||||
| PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);}
|
||||
| PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);}
|
||||
| PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);}
|
||||
| PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);}
|
||||
| PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);}
|
||||
| PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);}
|
||||
| PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);}
|
||||
| PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);}
|
||||
| PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);}
|
||||
| PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);}
|
||||
| PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);}
|
||||
| PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);}
|
||||
| PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);}
|
||||
: PARSEOP_PLD_REVISION {$$ = TrCreateLeafOp (PARSEOP_PLD_REVISION);}
|
||||
| PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafOp (PARSEOP_PLD_IGNORECOLOR);}
|
||||
| PARSEOP_PLD_RED {$$ = TrCreateLeafOp (PARSEOP_PLD_RED);}
|
||||
| PARSEOP_PLD_GREEN {$$ = TrCreateLeafOp (PARSEOP_PLD_GREEN);}
|
||||
| PARSEOP_PLD_BLUE {$$ = TrCreateLeafOp (PARSEOP_PLD_BLUE);}
|
||||
| PARSEOP_PLD_WIDTH {$$ = TrCreateLeafOp (PARSEOP_PLD_WIDTH);}
|
||||
| PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafOp (PARSEOP_PLD_HEIGHT);}
|
||||
| PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafOp (PARSEOP_PLD_USERVISIBLE);}
|
||||
| PARSEOP_PLD_DOCK {$$ = TrCreateLeafOp (PARSEOP_PLD_DOCK);}
|
||||
| PARSEOP_PLD_LID {$$ = TrCreateLeafOp (PARSEOP_PLD_LID);}
|
||||
| PARSEOP_PLD_PANEL {$$ = TrCreateLeafOp (PARSEOP_PLD_PANEL);}
|
||||
| PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_VERTICALPOSITION);}
|
||||
| PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_HORIZONTALPOSITION);}
|
||||
| PARSEOP_PLD_SHAPE {$$ = TrCreateLeafOp (PARSEOP_PLD_SHAPE);}
|
||||
| PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPORIENTATION);}
|
||||
| PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPTOKEN);}
|
||||
| PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPPOSITION);}
|
||||
| PARSEOP_PLD_BAY {$$ = TrCreateLeafOp (PARSEOP_PLD_BAY);}
|
||||
| PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafOp (PARSEOP_PLD_EJECTABLE);}
|
||||
| PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafOp (PARSEOP_PLD_EJECTREQUIRED);}
|
||||
| PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafOp (PARSEOP_PLD_CABINETNUMBER);}
|
||||
| PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafOp (PARSEOP_PLD_CARDCAGENUMBER);}
|
||||
| PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafOp (PARSEOP_PLD_REFERENCE);}
|
||||
| PARSEOP_PLD_ROTATION {$$ = TrCreateLeafOp (PARSEOP_PLD_ROTATION);}
|
||||
| PARSEOP_PLD_ORDER {$$ = TrCreateLeafOp (PARSEOP_PLD_ORDER);}
|
||||
| PARSEOP_PLD_RESERVED {$$ = TrCreateLeafOp (PARSEOP_PLD_RESERVED);}
|
||||
| PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafOp (PARSEOP_PLD_VERTICALOFFSET);}
|
||||
| PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafOp (PARSEOP_PLD_HORIZONTALOFFSET);}
|
||||
;
|
||||
|
||||
RangeTypeKeyword
|
||||
: PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);}
|
||||
| PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);}
|
||||
| PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);}
|
||||
: PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_ISAONLY);}
|
||||
| PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_NONISAONLY);}
|
||||
| PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_ENTIRE);}
|
||||
;
|
||||
|
||||
RegionSpaceKeyword
|
||||
: PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);}
|
||||
| PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);}
|
||||
| PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);}
|
||||
| PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);}
|
||||
| PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);}
|
||||
| PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);}
|
||||
| PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);}
|
||||
| PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);}
|
||||
| PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);}
|
||||
| PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);}
|
||||
| PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);}
|
||||
| PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);}
|
||||
: PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_IO);}
|
||||
| PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_MEM);}
|
||||
| PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCI);}
|
||||
| PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_EC);}
|
||||
| PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_SMBUS);}
|
||||
| PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_CMOS);}
|
||||
| PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCIBAR);}
|
||||
| PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_IPMI);}
|
||||
| PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GPIO);}
|
||||
| PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GSBUS);}
|
||||
| PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCC);}
|
||||
| PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_FFIXEDHW);}
|
||||
;
|
||||
|
||||
ResourceTypeKeyword
|
||||
: PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
|
||||
| PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);}
|
||||
: PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafOp (PARSEOP_RESOURCETYPE_CONSUMER);}
|
||||
| PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafOp (PARSEOP_RESOURCETYPE_PRODUCER);}
|
||||
;
|
||||
|
||||
SerializeRuleKeyword
|
||||
: PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);}
|
||||
| PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);}
|
||||
: PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafOp (PARSEOP_SERIALIZERULE_SERIAL);}
|
||||
| PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafOp (PARSEOP_SERIALIZERULE_NOTSERIAL);}
|
||||
;
|
||||
|
||||
ShareTypeKeyword
|
||||
: PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);}
|
||||
| PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);}
|
||||
| PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);}
|
||||
| PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);}
|
||||
: PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_SHARED);}
|
||||
| PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_EXCLUSIVE);}
|
||||
| PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_SHAREDWAKE);}
|
||||
| PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);}
|
||||
;
|
||||
|
||||
SlaveModeKeyword
|
||||
: PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);}
|
||||
| PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);}
|
||||
: PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafOp (PARSEOP_SLAVEMODE_CONTROLLERINIT);}
|
||||
| PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafOp (PARSEOP_SLAVEMODE_DEVICEINIT);}
|
||||
;
|
||||
|
||||
StopBitsKeyword
|
||||
: PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);}
|
||||
| PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);}
|
||||
| PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);}
|
||||
| PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);}
|
||||
: PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_TWO);}
|
||||
| PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ONEPLUSHALF);}
|
||||
| PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ONE);}
|
||||
| PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ZERO);}
|
||||
;
|
||||
|
||||
TranslationKeyword
|
||||
: PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);}
|
||||
| PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);}
|
||||
: PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafOp (PARSEOP_TRANSLATIONTYPE_SPARSE);}
|
||||
| PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafOp (PARSEOP_TRANSLATIONTYPE_DENSE);}
|
||||
;
|
||||
|
||||
TypeKeyword
|
||||
: PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);}
|
||||
| PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);}
|
||||
: PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafOp (PARSEOP_TYPE_TRANSLATION);}
|
||||
| PARSEOP_TYPE_STATIC {$$ = TrCreateLeafOp (PARSEOP_TYPE_STATIC);}
|
||||
;
|
||||
|
||||
UpdateRuleKeyword
|
||||
: PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);}
|
||||
| PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);}
|
||||
| PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);}
|
||||
: PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_PRESERVE);}
|
||||
| PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_ONES);}
|
||||
| PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_ZEROS);}
|
||||
;
|
||||
|
||||
WireModeKeyword
|
||||
: PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);}
|
||||
| PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);}
|
||||
: PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafOp (PARSEOP_WIREMODE_FOUR);}
|
||||
| PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafOp (PARSEOP_WIREMODE_THREE);}
|
||||
;
|
||||
|
||||
XferSizeKeyword
|
||||
: PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);}
|
||||
| PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);}
|
||||
| PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
|
||||
| PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);}
|
||||
| PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);}
|
||||
| PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);}
|
||||
: PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_8, 0);}
|
||||
| PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_16, 1);}
|
||||
| PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_32, 2);}
|
||||
| PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_64, 3);}
|
||||
| PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_128, 4);}
|
||||
| PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_256, 5);}
|
||||
;
|
||||
|
||||
XferTypeKeyword
|
||||
: PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);}
|
||||
| PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);}
|
||||
| PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);}
|
||||
: PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_8);}
|
||||
| PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_8_16);}
|
||||
| PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_16);}
|
||||
;
|
||||
|
@ -338,7 +338,7 @@ CgGenerateAmlOpcodeLength (
|
||||
/* Does this opcode have an associated "PackageLength" field? */
|
||||
|
||||
Op->Asl.AmlPkgLenBytes = 0;
|
||||
if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
|
||||
if (Op->Asl.CompileFlags & OP_AML_PACKAGE)
|
||||
{
|
||||
Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount (
|
||||
Op, Op->Asl.AmlSubtreeLength);
|
||||
@ -459,7 +459,7 @@ CgGenerateAmlLengths (
|
||||
case PARSEOP_NAMESTRING:
|
||||
case PARSEOP_METHODCALL:
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_NAME_INTERNALIZED)
|
||||
if (Op->Asl.CompileFlags & OP_NAME_INTERNALIZED)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@ -475,7 +475,7 @@ CgGenerateAmlLengths (
|
||||
|
||||
Op->Asl.ExternalName = Op->Asl.Value.String;
|
||||
Op->Asl.Value.String = Buffer;
|
||||
Op->Asl.CompileFlags |= NODE_NAME_INTERNALIZED;
|
||||
Op->Asl.CompileFlags |= OP_NAME_INTERNALIZED;
|
||||
Op->Asl.AmlLength = strlen (Buffer);
|
||||
|
||||
/*
|
||||
|
@ -313,7 +313,7 @@ LsAmlListingWalk (
|
||||
|
||||
LsWriteNodeToListing (Op, FileId);
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
|
||||
if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DATA)
|
||||
{
|
||||
/* Buffer is a resource template, don't dump the data all at once */
|
||||
|
||||
@ -445,7 +445,7 @@ LsTreeWriteWalk (
|
||||
Op->Asl.LineNumber, Op->Asl.EndLine,
|
||||
Op->Asl.LogicalLineNumber, Op->Asl.EndLogicalLine);
|
||||
|
||||
TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
|
||||
TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT);
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
@ -616,7 +616,7 @@ LsWriteNodeToListing (
|
||||
|
||||
case PARSEOP_DEFAULT_ARG:
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
|
||||
if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
|
||||
{
|
||||
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.EndLogicalLine,
|
||||
FileId);
|
||||
@ -660,7 +660,7 @@ LsWriteNodeToListing (
|
||||
|
||||
case AML_NAME_OP:
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
|
||||
if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
|
||||
{
|
||||
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.LogicalLineNumber,
|
||||
FileId);
|
||||
@ -779,7 +779,7 @@ LsWriteNodeToListing (
|
||||
default:
|
||||
|
||||
if ((Op->Asl.ParseOpcode == PARSEOP_BUFFER) &&
|
||||
(Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
|
||||
(Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -316,7 +316,8 @@ LdLoadFieldElements (
|
||||
return (Status);
|
||||
}
|
||||
else if (Status == AE_ALREADY_EXISTS &&
|
||||
(Node->Flags & ANOBJ_IS_EXTERNAL))
|
||||
(Node->Flags & ANOBJ_IS_EXTERNAL) &&
|
||||
Node->OwnerId != WalkState->OwnerId)
|
||||
{
|
||||
Node->Type = (UINT8) ACPI_TYPE_LOCAL_REGION_FIELD;
|
||||
}
|
||||
@ -564,7 +565,7 @@ LdNamespace1Begin (
|
||||
* a new scope so that the resource subfield names can be entered into
|
||||
* the namespace underneath this name
|
||||
*/
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
|
||||
if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
|
||||
{
|
||||
ForceNewScope = TRUE;
|
||||
}
|
||||
@ -614,7 +615,7 @@ LdNamespace1Begin (
|
||||
|
||||
case PARSEOP_DEFAULT_ARG:
|
||||
|
||||
if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC)
|
||||
if (Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC)
|
||||
{
|
||||
Status = LdLoadResourceElements (Op, WalkState);
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -823,11 +824,16 @@ LdNamespace1Begin (
|
||||
|
||||
Status = AE_OK;
|
||||
|
||||
if (Node->OwnerId == WalkState->OwnerId)
|
||||
if (Node->OwnerId == WalkState->OwnerId &&
|
||||
!(Node->Flags & IMPLICIT_EXTERNAL))
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op,
|
||||
Op->Asl.ExternalName);
|
||||
}
|
||||
if (Node->Flags & IMPLICIT_EXTERNAL)
|
||||
{
|
||||
Node->Flags &= ~IMPLICIT_EXTERNAL;
|
||||
}
|
||||
}
|
||||
else if (!(Node->Flags & ANOBJ_IS_EXTERNAL) &&
|
||||
(Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
|
||||
@ -1000,7 +1006,7 @@ LdNamespace2Begin (
|
||||
/* Get the type to determine if we should push the scope */
|
||||
|
||||
if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) &&
|
||||
(Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC))
|
||||
(Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC))
|
||||
{
|
||||
ObjectType = ACPI_TYPE_LOCAL_RESOURCE;
|
||||
}
|
||||
@ -1013,7 +1019,7 @@ LdNamespace2Begin (
|
||||
|
||||
if (Op->Asl.ParseOpcode == PARSEOP_NAME)
|
||||
{
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
|
||||
if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
|
||||
{
|
||||
ForceNewScope = TRUE;
|
||||
}
|
||||
@ -1124,7 +1130,7 @@ LdCommonNamespaceEnd (
|
||||
/* Get the type to determine if we should pop the scope */
|
||||
|
||||
if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) &&
|
||||
(Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC))
|
||||
(Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC))
|
||||
{
|
||||
/* TBD: Merge into AcpiDsMapNamedOpcodeToDataType */
|
||||
|
||||
@ -1139,7 +1145,7 @@ LdCommonNamespaceEnd (
|
||||
|
||||
if (Op->Asl.ParseOpcode == PARSEOP_NAME)
|
||||
{
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
|
||||
if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
|
||||
{
|
||||
ForceNewScope = TRUE;
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ LkGetNameOp (
|
||||
/* Name must appear as the last parameter */
|
||||
|
||||
NameOp = Op->Asl.Child;
|
||||
while (!(NameOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
|
||||
while (!(NameOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION))
|
||||
{
|
||||
NameOp = NameOp->Asl.Next;
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* ARG4 */ OP_TABLE_ENTRY (AML_ARG4, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
|
||||
/* ARG5 */ OP_TABLE_ENTRY (AML_ARG5, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
|
||||
/* ARG6 */ OP_TABLE_ENTRY (AML_ARG6, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
|
||||
/* BANKFIELD */ OP_TABLE_ENTRY (AML_BANK_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* BANKFIELD */ OP_TABLE_ENTRY (AML_BANK_FIELD_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* BITSPERBYTE_EIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
|
||||
/* BITSPERBYTE_FIVE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* BITSPERBYTE_NINE */ OP_TABLE_ENTRY (AML_BYTE_OP, 4, 0, 0),
|
||||
@ -275,7 +275,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* BITSPERBYTE_SIX */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* BREAK */ OP_TABLE_ENTRY (AML_BREAK_OP, 0, 0, 0),
|
||||
/* BREAKPOINT */ OP_TABLE_ENTRY (AML_BREAKPOINT_OP, 0, 0, 0),
|
||||
/* BUFFER */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_BUFFER),
|
||||
/* BUFFER */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_BUFFER),
|
||||
/* BUSMASTERTYPE_MASTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* BUSMASTERTYPE_NOTMASTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* BYTECONST */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
@ -306,7 +306,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* DEFAULT_ARG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* DEFINITIONBLOCK */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* DEREFOF */ OP_TABLE_ENTRY (AML_DEREF_OF_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE | ACPI_BTYPE_STRING),
|
||||
/* DEVICE */ OP_TABLE_ENTRY (AML_DEVICE_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* DEVICE */ OP_TABLE_ENTRY (AML_DEVICE_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* DEVICEPOLARITY_HIGH */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* DEVICEPOLARITY_LOW */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* DIVIDE */ OP_TABLE_ENTRY (AML_DIVIDE_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
@ -320,8 +320,8 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* DWORDMEMORY */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* DWORDSPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* EISAID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* 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),
|
||||
/* ELSE */ OP_TABLE_ENTRY (AML_ELSE_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* ELSEIF */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* ENDDEPENDENTFN */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* ENDIAN_BIG */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* ENDIAN_LITTLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
@ -333,7 +333,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* EXTENDEDSPACE */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* EXTERNAL */ OP_TABLE_ENTRY (AML_EXTERNAL_OP, 0, 0, 0),
|
||||
/* FATAL */ OP_TABLE_ENTRY (AML_FATAL_OP, 0, 0, 0),
|
||||
/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* FINDSETLEFTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_LEFT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* FINDSETRIGHTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_RIGHT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* FIXEDDMA */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
@ -342,17 +342,17 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* FLOWCONTROL_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* FLOWCONTROL_SW */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
|
||||
/* FROMBCD */ OP_TABLE_ENTRY (AML_FROM_BCD_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* FUNCTION */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* FUNCTION */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* GPIOINT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* GPIOIO */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* I2CSERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* I2CSERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* IF */ OP_TABLE_ENTRY (AML_IF_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* IF */ OP_TABLE_ENTRY (AML_IF_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* INCLUDE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* INCLUDE_END */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* INCREMENT */ OP_TABLE_ENTRY (AML_INCREMENT_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* INDEX */ OP_TABLE_ENTRY (AML_INDEX_OP, 0, 0, ACPI_BTYPE_REFERENCE_OBJECT),
|
||||
/* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* INTEGER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* INTERRUPT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* INTLEVEL_ACTIVEBOTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
|
||||
@ -406,7 +406,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* MEMTYPE_NONCACHEABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* MEMTYPE_PREFETCHABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
|
||||
/* MEMTYPE_WRITECOMBINING */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
|
||||
/* METHOD */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* METHOD */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* METHODCALL */ OP_TABLE_ENTRY (AML_INT_METHODCALL_OP, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
|
||||
/* MID */ OP_TABLE_ENTRY (AML_MID_OP, 0, 0, ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER),
|
||||
/* MINTYPE_FIXED */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
@ -444,8 +444,8 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* ONES */ OP_TABLE_ENTRY (AML_ONES_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* OPERATIONREGION */ OP_TABLE_ENTRY (AML_REGION_OP, 0, 0, 0),
|
||||
/* OR */ OP_TABLE_ENTRY (AML_BIT_OR_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* PACKAGE */ OP_TABLE_ENTRY (AML_PACKAGE_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
|
||||
/* PACKAGEP_LENGTH */ OP_TABLE_ENTRY (AML_PACKAGE_LENGTH, 0, NODE_AML_PACKAGE, 0),
|
||||
/* PACKAGE */ OP_TABLE_ENTRY (AML_PACKAGE_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
|
||||
/* PACKAGEP_LENGTH */ OP_TABLE_ENTRY (AML_PACKAGE_LENGTH, 0, OP_AML_PACKAGE, 0),
|
||||
/* PARITYTYPE_EVEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* PARITYTYPE_MARK */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
|
||||
/* PARITYTYPE_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
@ -460,8 +460,8 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* PIN_PULLDEFAULT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* PIN_PULLDOWN */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
|
||||
/* PIN_PULLUP */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* POWERRESOURCE */ OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* POWERRESOURCE */ OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* QWORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* QWORDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* QWORDMEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
@ -494,7 +494,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* RESOURCETYPE_PRODUCER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* RETURN */ OP_TABLE_ENTRY (AML_RETURN_OP, 0, 0, 0),
|
||||
/* REVISION */ OP_TABLE_ENTRY (AML_REVISION_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* SCOPE */ OP_TABLE_ENTRY (AML_SCOPE_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* SCOPE */ OP_TABLE_ENTRY (AML_SCOPE_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* SERIALIZERULE_NOTSERIAL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* SERIALIZERULE_SERIAL */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* SHARETYPE_EXCLUSIVE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
@ -521,7 +521,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* STRING_LITERAL */ OP_TABLE_ENTRY (AML_STRING_OP, 0, 0, ACPI_BTYPE_STRING),
|
||||
/* SUBTRACT */ OP_TABLE_ENTRY (AML_SUBTRACT_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* SWITCH */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* THERMALZONE */ OP_TABLE_ENTRY (AML_THERMAL_ZONE_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* THERMALZONE */ OP_TABLE_ENTRY (AML_THERMAL_ZONE_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* TIMER */ OP_TABLE_ENTRY (AML_TIMER_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* TOBCD */ OP_TABLE_ENTRY (AML_TO_BCD_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* TOBUFFER */ OP_TABLE_ENTRY (AML_TO_BUFFER_OP, 0, 0, ACPI_BTYPE_BUFFER),
|
||||
@ -529,23 +529,23 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* TOHEXSTRING */ OP_TABLE_ENTRY (AML_TO_HEX_STRING_OP, 0, 0, ACPI_BTYPE_STRING),
|
||||
/* TOINTEGER */ OP_TABLE_ENTRY (AML_TO_INTEGER_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* TOSTRING */ OP_TABLE_ENTRY (AML_TO_STRING_OP, 0, 0, ACPI_BTYPE_STRING),
|
||||
/* TOUUID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
|
||||
/* TOUUID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_INTEGER),
|
||||
/* TRANSLATIONTYPE_DENSE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* TRANSLATIONTYPE_SPARSE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* TYPE_STATIC */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* TYPE_TRANSLATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* UART_SERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* UART_SERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
|
||||
/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* UNLOAD */ OP_TABLE_ENTRY (AML_UNLOAD_OP, 0, 0, 0),
|
||||
/* UPDATERULE_ONES */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ONES, 0, 0),
|
||||
/* UPDATERULE_PRESERVE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_PRESERVE, 0, 0),
|
||||
/* UPDATERULE_ZEROS */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ZEROS,0, 0),
|
||||
/* VARIABLE_PACKAGE */ OP_TABLE_ENTRY (AML_VARIABLE_PACKAGE_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
|
||||
/* VARIABLE_PACKAGE */ OP_TABLE_ENTRY (AML_VARIABLE_PACKAGE_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
|
||||
/* VENDORLONG */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* VENDORSHORT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* WAIT */ OP_TABLE_ENTRY (AML_WAIT_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* WHILE */ OP_TABLE_ENTRY (AML_WHILE_OP, 0, NODE_AML_PACKAGE, 0),
|
||||
/* WHILE */ OP_TABLE_ENTRY (AML_WHILE_OP, 0, OP_AML_PACKAGE, 0),
|
||||
/* WIREMODE_FOUR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* WIREMODE_THREE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
|
||||
/* WORDBUSNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
@ -563,7 +563,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
|
||||
/* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER),
|
||||
/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
|
||||
/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_INTEGER),
|
||||
/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
/* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
|
||||
|
@ -685,7 +685,7 @@ MpNamespaceXrefBegin (
|
||||
* are references to other objects within the namespace and the
|
||||
* parent objects of name declarations
|
||||
*/
|
||||
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
|
||||
if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
@ -348,7 +348,8 @@ const char *AslCompilerMsgs [] =
|
||||
/* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used",
|
||||
/* ASL_MSG_ARG_NOT_USED */ "Method Argument is never used",
|
||||
/* ASL_MSG_CONSTANT_REQUIRED */ "Non-reducible expression",
|
||||
/* ASL_MSG_CROSS_TABLE_SCOPE */ "Illegal open scope on external object from within DSDT"
|
||||
/* ASL_MSG_CROSS_TABLE_SCOPE */ "Illegal open scope on external object from within DSDT",
|
||||
/* ASL_MSG_EXCEPTION_NOT_RECEIVED */ "Expected remark, warning, or error did not occur. Message ID:"
|
||||
};
|
||||
|
||||
/* Table compiler */
|
||||
|
@ -351,6 +351,7 @@ typedef enum
|
||||
ASL_MSG_ARG_NOT_USED,
|
||||
ASL_MSG_CONSTANT_REQUIRED,
|
||||
ASL_MSG_CROSS_TABLE_SCOPE,
|
||||
ASL_MSG_EXCEPTION_NOT_RECEIVED,
|
||||
|
||||
/* These messages are used by the Data Table compiler only */
|
||||
|
||||
|
@ -380,7 +380,7 @@ MtMethodAnalysisWalkBegin (
|
||||
* If the local is being used as a target, mark the local
|
||||
* initialized
|
||||
*/
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TARGET)
|
||||
{
|
||||
MethodInfo->LocalInitialized[RegisterNumber] = TRUE;
|
||||
}
|
||||
@ -425,7 +425,7 @@ MtMethodAnalysisWalkBegin (
|
||||
* If the Arg is being used as a target, mark the local
|
||||
* initialized
|
||||
*/
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TARGET)
|
||||
{
|
||||
MethodInfo->ArgInitialized[RegisterNumber] = TRUE;
|
||||
}
|
||||
@ -464,7 +464,7 @@ MtMethodAnalysisWalkBegin (
|
||||
|
||||
/*
|
||||
* A child indicates a possible return value. A simple Return or
|
||||
* Return() is marked with NODE_IS_NULL_RETURN by the parser so
|
||||
* Return() is marked with OP_IS_NULL_RETURN by the parser so
|
||||
* that it is not counted as a "real" return-with-value, although
|
||||
* the AML code that is actually emitted is Return(0). The AML
|
||||
* definition of Return has a required parameter, so we are
|
||||
@ -472,7 +472,7 @@ MtMethodAnalysisWalkBegin (
|
||||
*/
|
||||
if ((Op->Asl.Child) &&
|
||||
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
|
||||
(!(Op->Asl.Child->Asl.CompileFlags & NODE_IS_NULL_RETURN)))
|
||||
(!(Op->Asl.Child->Asl.CompileFlags & OP_IS_NULL_RETURN)))
|
||||
{
|
||||
MethodInfo->NumReturnWithValue++;
|
||||
}
|
||||
@ -704,7 +704,7 @@ MtMethodAnalysisWalkEnd (
|
||||
* of the method can possibly terminate without a return statement.
|
||||
*/
|
||||
if ((!AnLastStatementIsReturn (Op)) &&
|
||||
(!(Op->Asl.CompileFlags & NODE_HAS_NO_EXIT)))
|
||||
(!(Op->Asl.CompileFlags & OP_HAS_NO_EXIT)))
|
||||
{
|
||||
/*
|
||||
* No return statement, and execution can possibly exit
|
||||
@ -736,11 +736,11 @@ MtMethodAnalysisWalkEnd (
|
||||
{
|
||||
if (MethodInfo->NumReturnWithValue)
|
||||
{
|
||||
Op->Asl.CompileFlags |= NODE_METHOD_SOME_NO_RETVAL;
|
||||
Op->Asl.CompileFlags |= OP_METHOD_SOME_NO_RETVAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
Op->Asl.CompileFlags |= NODE_METHOD_NO_RETVAL;
|
||||
Op->Asl.CompileFlags |= OP_METHOD_NO_RETVAL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -784,7 +784,7 @@ MtMethodAnalysisWalkEnd (
|
||||
* The parent block does not "exit" and continue execution -- the
|
||||
* method is terminated here with the Return() statement.
|
||||
*/
|
||||
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
|
||||
Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT;
|
||||
|
||||
/* Used in the "typing" pass later */
|
||||
|
||||
@ -804,7 +804,7 @@ MtMethodAnalysisWalkEnd (
|
||||
|
||||
case PARSEOP_IF:
|
||||
|
||||
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
|
||||
if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) &&
|
||||
(Op->Asl.Next) &&
|
||||
(Op->Asl.Next->Asl.ParseOpcode == PARSEOP_ELSE))
|
||||
{
|
||||
@ -813,32 +813,32 @@ MtMethodAnalysisWalkEnd (
|
||||
* (it contains an unconditional Return)
|
||||
* mark the ELSE block to remember this fact.
|
||||
*/
|
||||
Op->Asl.Next->Asl.CompileFlags |= NODE_IF_HAS_NO_EXIT;
|
||||
Op->Asl.Next->Asl.CompileFlags |= OP_IF_HAS_NO_EXIT;
|
||||
}
|
||||
break;
|
||||
|
||||
case PARSEOP_ELSE:
|
||||
|
||||
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
|
||||
(Op->Asl.CompileFlags & NODE_IF_HAS_NO_EXIT))
|
||||
if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) &&
|
||||
(Op->Asl.CompileFlags & OP_IF_HAS_NO_EXIT))
|
||||
{
|
||||
/*
|
||||
* This ELSE block has no exit and the corresponding IF block
|
||||
* has no exit either. Therefore, the parent node has no exit.
|
||||
*/
|
||||
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
|
||||
Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
|
||||
if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) &&
|
||||
(Op->Asl.Parent))
|
||||
{
|
||||
/* If this node has no exit, then the parent has no exit either */
|
||||
|
||||
Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
|
||||
Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ LsAmlOffsetWalk (
|
||||
|
||||
/* Ignore actual data blocks for resource descriptors */
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
|
||||
if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DATA)
|
||||
{
|
||||
return (AE_OK); /* Do NOT update the global AML offset */
|
||||
}
|
||||
@ -228,7 +228,7 @@ LsAmlOffsetWalk (
|
||||
/* Named resource descriptor (has a descriptor tag) */
|
||||
|
||||
if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE) &&
|
||||
(Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
|
||||
(Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC))
|
||||
{
|
||||
LsEmitOffsetTableEntry (FileId, Node, 0, Gbl_CurrentAmlOffset,
|
||||
Op->Asl.ParseOpName, 0, Op->Asl.Extra, AML_BUFFER_OP);
|
||||
|
@ -550,7 +550,7 @@ OpcDoConnection (
|
||||
*/
|
||||
BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER;
|
||||
BufferOp->Asl.AmlOpcode = AML_BUFFER_OP;
|
||||
BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
|
||||
BufferOp->Asl.CompileFlags = OP_AML_PACKAGE | OP_IS_RESOURCE_DESC;
|
||||
UtSetParseOpName (BufferOp);
|
||||
|
||||
BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
|
||||
@ -598,7 +598,7 @@ OpcDoUnicode (
|
||||
|
||||
/* Change op into a buffer object */
|
||||
|
||||
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
|
||||
Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
|
||||
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
@ -756,7 +756,7 @@ OpcDoEisaId (
|
||||
*/
|
||||
Op->Asl.Value.Integer = EisaId;
|
||||
|
||||
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
|
||||
Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
|
||||
Op->Asl.ParseOpcode = PARSEOP_INTEGER;
|
||||
(void) OpcSetOptimalIntegerSize (Op);
|
||||
|
||||
@ -808,12 +808,12 @@ OpcDoUuId (
|
||||
|
||||
/* Disable further optimization */
|
||||
|
||||
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
|
||||
Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Child node is the buffer length */
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_INTEGER);
|
||||
NewOp = TrAllocateOp (PARSEOP_INTEGER);
|
||||
|
||||
NewOp->Asl.AmlOpcode = AML_BYTE_OP;
|
||||
NewOp->Asl.Value.Integer = 16;
|
||||
@ -824,7 +824,7 @@ OpcDoUuId (
|
||||
|
||||
/* Peer to the child is the raw buffer data */
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
|
||||
NewOp = TrAllocateOp (PARSEOP_RAW_DATA);
|
||||
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
|
||||
NewOp->Asl.AmlLength = 16;
|
||||
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
|
||||
|
@ -699,7 +699,7 @@ OptOptimizeNamePath (
|
||||
|
||||
if (!(Flags & (AML_NAMED | AML_CREATE)))
|
||||
{
|
||||
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
|
||||
if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION)
|
||||
{
|
||||
/* We don't want to fuss with actual name declaration nodes here */
|
||||
|
||||
@ -893,7 +893,7 @@ OptOptimizeNamePath (
|
||||
/* Name must appear as the last parameter */
|
||||
|
||||
NextOp = Op->Asl.Child;
|
||||
while (!(NextOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
|
||||
while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION))
|
||||
{
|
||||
NextOp = NextOp->Asl.Next;
|
||||
}
|
||||
|
@ -945,6 +945,22 @@ AslDoOptions (
|
||||
}
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
|
||||
/* Get the required argument */
|
||||
|
||||
if (AcpiGetoptArgument (argc, argv))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
Status = AslExpectException (AcpiGbl_Optarg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
|
||||
|
953
sys/contrib/dev/acpica/compiler/aslparseop.c
Normal file
953
sys/contrib/dev/acpica/compiler/aslparseop.c
Normal file
@ -0,0 +1,953 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslparseop - Parse op create/allocate/cache interfaces
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* following license:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/acapps.h>
|
||||
#include <contrib/dev/acpica/include/acconvert.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslparseop")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_PARSE_OBJECT *
|
||||
TrGetOpFromCache (
|
||||
void);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateOp
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - Opcode to be assigned to the op
|
||||
* NumChildren - Number of children to follow
|
||||
* ... - A list of child ops to link to the new
|
||||
* op. NumChildren long.
|
||||
*
|
||||
* RETURN: Pointer to the new op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Create a new parse op and link together a list of child
|
||||
* ops underneath the new op.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateOp (
|
||||
UINT32 ParseOpcode,
|
||||
UINT32 NumChildren,
|
||||
...)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_PARSE_OBJECT *Child;
|
||||
ACPI_PARSE_OBJECT *PrevChild;
|
||||
va_list ap;
|
||||
UINT32 i;
|
||||
BOOLEAN FirstChild;
|
||||
|
||||
|
||||
va_start (ap, NumChildren);
|
||||
|
||||
/* Allocate one new op */
|
||||
|
||||
Op = TrAllocateOp (ParseOpcode);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateOp Ln/Col %u/%u NewParent %p Child %u Op %s ",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op,
|
||||
NumChildren, UtGetOpName(ParseOpcode));
|
||||
|
||||
/* Some extra debug output based on the parse opcode */
|
||||
|
||||
switch (ParseOpcode)
|
||||
{
|
||||
case PARSEOP_ASL_CODE:
|
||||
|
||||
Gbl_ParseTreeRoot = Op;
|
||||
Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
|
||||
break;
|
||||
|
||||
case PARSEOP_DEFINITION_BLOCK:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
|
||||
break;
|
||||
|
||||
case PARSEOP_OPERATIONREGION:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "OPREGION->");
|
||||
break;
|
||||
|
||||
case PARSEOP_OR:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "OR->");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Nothing to do for other opcodes */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* Link the new op to its children */
|
||||
|
||||
PrevChild = NULL;
|
||||
FirstChild = TRUE;
|
||||
for (i = 0; i < NumChildren; i++)
|
||||
{
|
||||
/* Get the next child */
|
||||
|
||||
Child = va_arg (ap, ACPI_PARSE_OBJECT *);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "%p, ", Child);
|
||||
|
||||
/*
|
||||
* If child is NULL, this means that an optional argument
|
||||
* was omitted. We must create a placeholder with a special
|
||||
* opcode (DEFAULT_ARG) so that the code generator will know
|
||||
* that it must emit the correct default for this argument
|
||||
*/
|
||||
if (!Child)
|
||||
{
|
||||
Child = TrAllocateOp (PARSEOP_DEFAULT_ARG);
|
||||
}
|
||||
|
||||
/* Link first child to parent */
|
||||
|
||||
if (FirstChild)
|
||||
{
|
||||
FirstChild = FALSE;
|
||||
Op->Asl.Child = Child;
|
||||
|
||||
/*
|
||||
* For the ASL-/ASL+ converter: if the ParseOp is a Connection,
|
||||
* External, Offset or AccessAs, it means that the comments in the
|
||||
* FirstChild belongs to their parent due to the parsing order in
|
||||
* the .y files. To correct this, take the comments in the
|
||||
* FirstChild place it in the parent. This also means that
|
||||
* legitimate comments for the child gets put to the parent.
|
||||
*/
|
||||
if (Gbl_CaptureComments &&
|
||||
((ParseOpcode == PARSEOP_CONNECTION) ||
|
||||
(ParseOpcode == PARSEOP_EXTERNAL) ||
|
||||
(ParseOpcode == PARSEOP_OFFSET) ||
|
||||
(ParseOpcode == PARSEOP_ACCESSAS)))
|
||||
{
|
||||
Op->Asl.CommentList = Child->Asl.CommentList;
|
||||
Op->Asl.EndBlkComment = Child->Asl.EndBlkComment;
|
||||
Op->Asl.InlineComment = Child->Asl.InlineComment;
|
||||
Op->Asl.FileChanged = Child->Asl.FileChanged;
|
||||
|
||||
Child->Asl.CommentList = NULL;
|
||||
Child->Asl.EndBlkComment = NULL;
|
||||
Child->Asl.InlineComment = NULL;
|
||||
Child->Asl.FileChanged = FALSE;
|
||||
|
||||
/*
|
||||
* These do not need to be "passed off". They can be copied
|
||||
* because the code for these opcodes should be printed in the
|
||||
* same file.
|
||||
*/
|
||||
Op->Asl.Filename = Child->Asl.Filename;
|
||||
Op->Asl.ParentFilename = Child->Asl.ParentFilename;
|
||||
}
|
||||
}
|
||||
|
||||
/* Point all children to parent */
|
||||
|
||||
Child->Asl.Parent = Op;
|
||||
|
||||
/* Link children in a peer list */
|
||||
|
||||
if (PrevChild)
|
||||
{
|
||||
PrevChild->Asl.Next = Child;
|
||||
};
|
||||
|
||||
/* Get the comment from last child in the resource template call */
|
||||
|
||||
if (Gbl_CaptureComments &&
|
||||
(Op->Asl.ParseOpcode == PARSEOP_RESOURCETEMPLATE))
|
||||
{
|
||||
CvDbgPrint ("Transferred current comment list to this op.\n");
|
||||
Op->Asl.CommentList = Child->Asl.CommentList;
|
||||
Child->Asl.CommentList = NULL;
|
||||
|
||||
Op->Asl.InlineComment = Child->Asl.InlineComment;
|
||||
Child->Asl.InlineComment = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* This child might be a list, point all ops in the list
|
||||
* to the same parent
|
||||
*/
|
||||
while (Child->Asl.Next)
|
||||
{
|
||||
Child = Child->Asl.Next;
|
||||
Child->Asl.Parent = Op;
|
||||
}
|
||||
|
||||
PrevChild = Child;
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\n");
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateLeafOp
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - New opcode to be assigned to the op
|
||||
*
|
||||
* RETURN: Pointer to the new op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Create a simple leaf op (no children or peers, and no value
|
||||
* assigned to the op)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateLeafOp (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
|
||||
|
||||
Op = TrAllocateOp (ParseOpcode);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateLeafOp Ln/Col %u/%u NewOp %p Op %s\n\n",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode));
|
||||
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateValuedLeafOp
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - New opcode to be assigned to the op
|
||||
* Value - Value to be assigned to the op
|
||||
*
|
||||
* RETURN: Pointer to the new op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Create a leaf op (no children or peers) with a value
|
||||
* assigned to it
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateValuedLeafOp (
|
||||
UINT32 ParseOpcode,
|
||||
UINT64 Value)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
|
||||
|
||||
Op = TrAllocateOp (ParseOpcode);
|
||||
Op->Asl.Value.Integer = Value;
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateValuedLeafOp Ln/Col %u/%u NewOp %p "
|
||||
"Op %s Value %8.8X%8.8X ",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
|
||||
ACPI_FORMAT_UINT64 (Value));
|
||||
|
||||
switch (ParseOpcode)
|
||||
{
|
||||
case PARSEOP_STRING_LITERAL:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value);
|
||||
break;
|
||||
|
||||
case PARSEOP_NAMESEG:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value);
|
||||
break;
|
||||
|
||||
case PARSEOP_NAMESTRING:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value);
|
||||
break;
|
||||
|
||||
case PARSEOP_EISAID:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value);
|
||||
break;
|
||||
|
||||
case PARSEOP_METHOD:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "METHOD");
|
||||
break;
|
||||
|
||||
case PARSEOP_INTEGER:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X",
|
||||
ACPI_FORMAT_UINT64 (Value));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateTargetOp
|
||||
*
|
||||
* PARAMETERS: OriginalOp - Op to be copied
|
||||
*
|
||||
* RETURN: Pointer to the new op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Copy an existing op (and subtree). Used in ASL+ (C-style)
|
||||
* expressions where the target is the same as one of the
|
||||
* operands. A new op and subtree must be created from the
|
||||
* original so that the parse tree can be linked properly.
|
||||
*
|
||||
* NOTE: This code is specific to target operands that are the last
|
||||
* operand in an ASL/AML operator. Meaning that the top-level
|
||||
* parse Op in a possible subtree has a NULL Next pointer.
|
||||
* This simplifies the recursion.
|
||||
*
|
||||
* Subtree example:
|
||||
* DeRefOf (Local1) += 32
|
||||
*
|
||||
* This gets converted to:
|
||||
* Add (DeRefOf (Local1), 32, DeRefOf (Local1))
|
||||
*
|
||||
* Each DeRefOf has a single child, Local1. Even more complex
|
||||
* subtrees can be created via the Index and DeRefOf operators.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateTargetOp (
|
||||
ACPI_PARSE_OBJECT *OriginalOp,
|
||||
ACPI_PARSE_OBJECT *ParentOp)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
|
||||
|
||||
if (!OriginalOp)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Op = TrGetOpFromCache ();
|
||||
|
||||
/* Copy the pertinent values (omit link pointer fields) */
|
||||
|
||||
Op->Asl.Value = OriginalOp->Asl.Value;
|
||||
Op->Asl.Filename = OriginalOp->Asl.Filename;
|
||||
Op->Asl.LineNumber = OriginalOp->Asl.LineNumber;
|
||||
Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber;
|
||||
Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset;
|
||||
Op->Asl.Column = OriginalOp->Asl.Column;
|
||||
Op->Asl.Flags = OriginalOp->Asl.Flags;
|
||||
Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags;
|
||||
Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode;
|
||||
Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode;
|
||||
Op->Asl.Parent = ParentOp;
|
||||
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Copy a possible subtree below this op */
|
||||
|
||||
if (OriginalOp->Asl.Child)
|
||||
{
|
||||
Op->Asl.Child = TrCreateTargetOp (OriginalOp->Asl.Child, Op);
|
||||
}
|
||||
|
||||
if (OriginalOp->Asl.Next) /* Null for top-level op */
|
||||
{
|
||||
Op->Asl.Next = TrCreateTargetOp (OriginalOp->Asl.Next, ParentOp);
|
||||
}
|
||||
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateAssignmentOp
|
||||
*
|
||||
* PARAMETERS: Target - Assignment target
|
||||
* Source - Assignment source
|
||||
*
|
||||
* RETURN: Pointer to the new op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Implements the C-style '=' operator. It changes the parse
|
||||
* tree if possible to utilize the last argument of the math
|
||||
* operators which is a target operand -- thus saving invocation
|
||||
* of and additional Store() operator. An optimization.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateAssignmentOp (
|
||||
ACPI_PARSE_OBJECT *Target,
|
||||
ACPI_PARSE_OBJECT *Source)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *TargetOp;
|
||||
ACPI_PARSE_OBJECT *SourceOp1;
|
||||
ACPI_PARSE_OBJECT *SourceOp2;
|
||||
ACPI_PARSE_OBJECT *Operator;
|
||||
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nTrCreateAssignmentOp Line [%u to %u] Source %s Target %s\n",
|
||||
Source->Asl.LineNumber, Source->Asl.EndLine,
|
||||
UtGetOpName (Source->Asl.ParseOpcode),
|
||||
UtGetOpName (Target->Asl.ParseOpcode));
|
||||
|
||||
TrSetOpFlags (Target, OP_IS_TARGET);
|
||||
|
||||
switch (Source->Asl.ParseOpcode)
|
||||
{
|
||||
/*
|
||||
* Only these operators can be optimized because they have
|
||||
* a target operand
|
||||
*/
|
||||
case PARSEOP_ADD:
|
||||
case PARSEOP_AND:
|
||||
case PARSEOP_DIVIDE:
|
||||
case PARSEOP_INDEX:
|
||||
case PARSEOP_MOD:
|
||||
case PARSEOP_MULTIPLY:
|
||||
case PARSEOP_NOT:
|
||||
case PARSEOP_OR:
|
||||
case PARSEOP_SHIFTLEFT:
|
||||
case PARSEOP_SHIFTRIGHT:
|
||||
case PARSEOP_SUBTRACT:
|
||||
case PARSEOP_XOR:
|
||||
|
||||
break;
|
||||
|
||||
/* Otherwise, just create a normal Store operator */
|
||||
|
||||
default:
|
||||
goto CannotOptimize;
|
||||
}
|
||||
|
||||
/*
|
||||
* Transform the parse tree such that the target is moved to the
|
||||
* last operand of the operator
|
||||
*/
|
||||
SourceOp1 = Source->Asl.Child;
|
||||
SourceOp2 = SourceOp1->Asl.Next;
|
||||
|
||||
/* NOT only has one operand, but has a target */
|
||||
|
||||
if (Source->Asl.ParseOpcode == PARSEOP_NOT)
|
||||
{
|
||||
SourceOp2 = SourceOp1;
|
||||
}
|
||||
|
||||
/* DIVIDE has an extra target operand (remainder) */
|
||||
|
||||
if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE)
|
||||
{
|
||||
SourceOp2 = SourceOp2->Asl.Next;
|
||||
}
|
||||
|
||||
TargetOp = SourceOp2->Asl.Next;
|
||||
|
||||
/*
|
||||
* Can't perform this optimization if there already is a target
|
||||
* for the operator (ZERO is a "no target" placeholder).
|
||||
*/
|
||||
if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO)
|
||||
{
|
||||
goto CannotOptimize;
|
||||
}
|
||||
|
||||
/* Link in the target as the final operand */
|
||||
|
||||
SourceOp2->Asl.Next = Target;
|
||||
Target->Asl.Parent = Source;
|
||||
return (Source);
|
||||
|
||||
|
||||
CannotOptimize:
|
||||
|
||||
Operator = TrAllocateOp (PARSEOP_STORE);
|
||||
TrLinkOpChildren (Operator, 2, Source, Target);
|
||||
|
||||
/* Set the appropriate line numbers for the new op */
|
||||
|
||||
Operator->Asl.LineNumber = Target->Asl.LineNumber;
|
||||
Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber;
|
||||
Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset;
|
||||
Operator->Asl.Column = Target->Asl.Column;
|
||||
|
||||
return (Operator);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateNullTargetOp
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Pointer to the new op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Create a "null" target op. This is defined by the ACPI
|
||||
* specification to be a zero AML opcode, and indicates that
|
||||
* no target has been specified for the parent operation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateNullTargetOp (
|
||||
void)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
|
||||
|
||||
Op = TrAllocateOp (PARSEOP_ZERO);
|
||||
Op->Asl.CompileFlags |= (OP_IS_TARGET | OP_COMPILE_TIME_CONST);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateNullTargetOp Ln/Col %u/%u NewOp %p Op %s\n",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op,
|
||||
UtGetOpName (Op->Asl.ParseOpcode));
|
||||
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrCreateConstantLeafOp
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - The constant opcode
|
||||
*
|
||||
* RETURN: Pointer to the new op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Create a leaf op (no children or peers) for one of the
|
||||
* special constants - __LINE__, __FILE__, and __DATE__.
|
||||
*
|
||||
* Note: The fullimplemenation of __METHOD__ cannot happen here because we
|
||||
* don't have a full parse tree at this time and cannot find the parent
|
||||
* control method. __METHOD__ must be implemented later, after the parse
|
||||
* tree has been fully constructed.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateConstantLeafOp (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op = NULL;
|
||||
time_t CurrentTime;
|
||||
char *StaticTimeString;
|
||||
char *TimeString;
|
||||
char *Filename;
|
||||
|
||||
|
||||
switch (ParseOpcode)
|
||||
{
|
||||
case PARSEOP___LINE__:
|
||||
|
||||
Op = TrAllocateOp (PARSEOP_INTEGER);
|
||||
Op->Asl.Value.Integer = Op->Asl.LineNumber;
|
||||
break;
|
||||
|
||||
case PARSEOP___METHOD__:
|
||||
|
||||
/* Will become a string literal later */
|
||||
|
||||
Op = TrAllocateOp (PARSEOP___METHOD__);
|
||||
Op->Asl.Value.String = NULL;
|
||||
break;
|
||||
|
||||
case PARSEOP___PATH__:
|
||||
|
||||
Op = TrAllocateOp (PARSEOP_STRING_LITERAL);
|
||||
|
||||
/* Op.Asl.Filename contains the full pathname to the file */
|
||||
|
||||
Op->Asl.Value.String = Op->Asl.Filename;
|
||||
break;
|
||||
|
||||
case PARSEOP___FILE__:
|
||||
|
||||
Op = TrAllocateOp (PARSEOP_STRING_LITERAL);
|
||||
|
||||
/* Get the simple filename from the full path */
|
||||
|
||||
FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
|
||||
Op->Asl.Value.String = Filename;
|
||||
break;
|
||||
|
||||
case PARSEOP___DATE__:
|
||||
|
||||
Op = TrAllocateOp (PARSEOP_STRING_LITERAL);
|
||||
|
||||
/* Get a copy of the current time */
|
||||
|
||||
CurrentTime = time (NULL);
|
||||
StaticTimeString = ctime (&CurrentTime);
|
||||
TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1);
|
||||
strcpy (TimeString, StaticTimeString);
|
||||
|
||||
TimeString[strlen(TimeString) -1] = 0; /* Remove trailing newline */
|
||||
Op->Asl.Value.String = TimeString;
|
||||
break;
|
||||
|
||||
default: /* This would be an internal error */
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateConstantLeafOp Ln/Col %u/%u NewOp %p "
|
||||
"Op %s Value %8.8X%8.8X \n",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
|
||||
ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
|
||||
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrAllocateOp
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - Opcode to be assigned to the op
|
||||
*
|
||||
* RETURN: New parse op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Allocate and initialize a new parse op for the parse tree
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrAllocateOp (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_PARSE_OBJECT *LatestOp;
|
||||
|
||||
|
||||
Op = TrGetOpFromCache ();
|
||||
|
||||
Op->Asl.ParseOpcode = (UINT16) ParseOpcode;
|
||||
Op->Asl.Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
|
||||
Op->Asl.LineNumber = Gbl_CurrentLineNumber;
|
||||
Op->Asl.LogicalLineNumber = Gbl_LogicalLineNumber;
|
||||
Op->Asl.LogicalByteOffset = Gbl_CurrentLineOffset;
|
||||
Op->Asl.Column = Gbl_CurrentColumn;
|
||||
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* The following is for capturing comments */
|
||||
|
||||
if(Gbl_CaptureComments)
|
||||
{
|
||||
LatestOp = Gbl_CommentState.LatestParseOp;
|
||||
Op->Asl.InlineComment = NULL;
|
||||
Op->Asl.EndNodeComment = NULL;
|
||||
Op->Asl.CommentList = NULL;
|
||||
Op->Asl.FileChanged = FALSE;
|
||||
|
||||
/*
|
||||
* Check to see if the file name has changed before resetting the
|
||||
* latest parse op.
|
||||
*/
|
||||
if (LatestOp &&
|
||||
(ParseOpcode != PARSEOP_INCLUDE) &&
|
||||
(ParseOpcode != PARSEOP_INCLUDE_END) &&
|
||||
strcmp (LatestOp->Asl.Filename, Op->Asl.Filename))
|
||||
{
|
||||
CvDbgPrint ("latest op: %s\n", LatestOp->Asl.ParseOpName);
|
||||
Op->Asl.FileChanged = TRUE;
|
||||
if (Gbl_IncludeFileStack)
|
||||
{
|
||||
Op->Asl.ParentFilename = Gbl_IncludeFileStack->Filename;
|
||||
}
|
||||
else
|
||||
{
|
||||
Op->Asl.ParentFilename = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Gbl_CommentState.LatestParseOp = Op;
|
||||
CvDbgPrint ("TrAllocateOp=Set latest parse op to this op.\n");
|
||||
CvDbgPrint (" Op->Asl.ParseOpName = %s\n",
|
||||
Gbl_CommentState.LatestParseOp->Asl.ParseOpName);
|
||||
CvDbgPrint (" Op->Asl.ParseOpcode = 0x%x\n", ParseOpcode);
|
||||
|
||||
if (Op->Asl.FileChanged)
|
||||
{
|
||||
CvDbgPrint(" file has been changed!\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* if this parse op's syntax uses () and {} (i.e. Package(1){0x00}) then
|
||||
* set a flag in the comment state. This facilitates paring comments for
|
||||
* these types of opcodes.
|
||||
*/
|
||||
if ((CvParseOpBlockType(Op) == (BLOCK_PAREN | BLOCK_BRACE)) &&
|
||||
(ParseOpcode != PARSEOP_DEFINITION_BLOCK))
|
||||
{
|
||||
CvDbgPrint ("Parsing paren/Brace op now!\n");
|
||||
Gbl_CommentState.ParsingParenBraceNode = Op;
|
||||
}
|
||||
|
||||
if (Gbl_CommentListHead)
|
||||
{
|
||||
CvDbgPrint ("Transferring...\n");
|
||||
Op->Asl.CommentList = Gbl_CommentListHead;
|
||||
Gbl_CommentListHead = NULL;
|
||||
Gbl_CommentListTail = NULL;
|
||||
CvDbgPrint (" Transferred current comment list to this op.\n");
|
||||
CvDbgPrint (" %s\n", Op->Asl.CommentList->Comment);
|
||||
}
|
||||
|
||||
if (Gbl_InlineCommentBuffer)
|
||||
{
|
||||
Op->Asl.InlineComment = Gbl_InlineCommentBuffer;
|
||||
Gbl_InlineCommentBuffer = NULL;
|
||||
CvDbgPrint ("Transferred current inline comment list to this op.\n");
|
||||
}
|
||||
}
|
||||
|
||||
return (Op);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrGetOpFromCache
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: New parse op. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Allocate a new parse op for the parse tree. Bypass the local
|
||||
* dynamic memory manager for performance reasons (This has a
|
||||
* major impact on the speed of the compiler.)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_PARSE_OBJECT *
|
||||
TrGetOpFromCache (
|
||||
void)
|
||||
{
|
||||
ASL_CACHE_INFO *Cache;
|
||||
|
||||
|
||||
if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
|
||||
{
|
||||
/* Allocate a new buffer */
|
||||
|
||||
Cache = UtLocalCalloc (sizeof (Cache->Next) +
|
||||
(sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
|
||||
|
||||
/* Link new cache buffer to head of list */
|
||||
|
||||
Cache->Next = Gbl_ParseOpCacheList;
|
||||
Gbl_ParseOpCacheList = Cache;
|
||||
|
||||
/* Setup cache management pointers */
|
||||
|
||||
Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
|
||||
Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
|
||||
}
|
||||
|
||||
Gbl_ParseOpCount++;
|
||||
return (Gbl_ParseOpCacheNext++);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: TrPrintOpFlags
|
||||
*
|
||||
* PARAMETERS: Flags - Flags word to be decoded
|
||||
* OutputLevel - Debug output level: ASL_TREE_OUTPUT etc.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Decode a flags word to text. Displays all flags that are set.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
TrPrintOpFlags (
|
||||
UINT32 Flags,
|
||||
UINT32 OutputLevel)
|
||||
{
|
||||
UINT32 FlagBit = 1;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
for (i = 0; i < ACPI_NUM_OP_FLAGS; i++)
|
||||
{
|
||||
if (Flags & FlagBit)
|
||||
{
|
||||
DbgPrint (OutputLevel, " %s", Gbl_OpFlagNames[i]);
|
||||
}
|
||||
|
||||
FlagBit <<= 1;
|
||||
}
|
||||
}
|
@ -682,12 +682,12 @@ OpcDoPld (
|
||||
|
||||
/* Disable further optimization */
|
||||
|
||||
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
|
||||
Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Child node is the buffer length */
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_INTEGER);
|
||||
NewOp = TrAllocateOp (PARSEOP_INTEGER);
|
||||
|
||||
NewOp->Asl.AmlOpcode = AML_BYTE_OP;
|
||||
NewOp->Asl.Value.Integer = 20;
|
||||
@ -698,7 +698,7 @@ OpcDoPld (
|
||||
|
||||
/* Peer to the child is the raw buffer data */
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
|
||||
NewOp = TrAllocateOp (PARSEOP_RAW_DATA);
|
||||
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
|
||||
NewOp->Asl.AmlLength = 20;
|
||||
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
|
||||
|
@ -666,7 +666,7 @@ ApCheckForSpecialName (
|
||||
{
|
||||
/* Ignore if actually emitted by the compiler */
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_COMPILER_EMITTED)
|
||||
if (Op->Asl.CompileFlags & OP_COMPILER_EMITTED)
|
||||
{
|
||||
return (ACPI_NOT_RESERVED_NAME);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -191,7 +191,7 @@ OpcDoPrintf (
|
||||
|
||||
/* Store destination is the Debug op */
|
||||
|
||||
DestOp = TrAllocateNode (PARSEOP_DEBUG);
|
||||
DestOp = TrAllocateOp (PARSEOP_DEBUG);
|
||||
DestOp->Asl.AmlOpcode = AML_DEBUG_OP;
|
||||
DestOp->Asl.Parent = Op;
|
||||
DestOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
|
||||
@ -296,7 +296,7 @@ OpcParsePrintf (
|
||||
NewString = UtStringCacheCalloc (StringLength + 1);
|
||||
strncpy (NewString, StartPosition, StringLength);
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
|
||||
NewOp->Asl.Value.String = NewString;
|
||||
NewOp->Asl.AmlOpcode = AML_STRING_OP;
|
||||
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
|
||||
@ -357,7 +357,7 @@ OpcParsePrintf (
|
||||
*/
|
||||
if (!Op->Asl.Child)
|
||||
{
|
||||
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
|
||||
NewOp->Asl.Value.String = "";
|
||||
NewOp->Asl.AmlOpcode = AML_STRING_OP;
|
||||
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
|
||||
@ -385,7 +385,7 @@ OpcParsePrintf (
|
||||
NewString = UtStringCacheCalloc (StringLength + 1);
|
||||
strncpy (NewString, StartPosition, StringLength);
|
||||
|
||||
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
|
||||
NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
|
||||
NewOp->Asl.Value.String = NewString;
|
||||
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
|
||||
NewOp->Asl.AmlOpcode = AML_STRING_OP;
|
||||
@ -423,7 +423,7 @@ OpcParsePrintf (
|
||||
|
||||
/* Disable further optimization */
|
||||
|
||||
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
|
||||
Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Set Store destination */
|
||||
@ -461,7 +461,7 @@ OpcCreateConcatenateNode (
|
||||
return;
|
||||
}
|
||||
|
||||
NewConcatOp = TrAllocateNode (PARSEOP_CONCATENATE);
|
||||
NewConcatOp = TrAllocateOp (PARSEOP_CONCATENATE);
|
||||
NewConcatOp->Asl.AmlOpcode = AML_CONCATENATE_OP;
|
||||
NewConcatOp->Asl.AcpiBtype = 0x7;
|
||||
NewConcatOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
|
||||
@ -479,7 +479,7 @@ OpcCreateConcatenateNode (
|
||||
/* Third arg is Zero (not used) */
|
||||
|
||||
NewConcatOp->Asl.Child->Asl.Next->Asl.Next =
|
||||
TrAllocateNode (PARSEOP_ZERO);
|
||||
TrAllocateOp (PARSEOP_ZERO);
|
||||
NewConcatOp->Asl.Child->Asl.Next->Asl.Next->Asl.Parent =
|
||||
NewConcatOp;
|
||||
|
||||
|
@ -573,7 +573,7 @@ RsCreateResourceField (
|
||||
{
|
||||
|
||||
Op->Asl.ExternalName = Name;
|
||||
Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD;
|
||||
Op->Asl.CompileFlags |= OP_IS_RESOURCE_FIELD;
|
||||
|
||||
Op->Asl.Value.Tag.BitOffset = (ByteOffset * 8) + BitOffset;
|
||||
Op->Asl.Value.Tag.BitLength = BitLength;
|
||||
@ -719,9 +719,9 @@ RsCheckListForDuplicates (
|
||||
{
|
||||
/* Emit error only once per duplicate node */
|
||||
|
||||
if (!(NextOp->Asl.CompileFlags & NODE_IS_DUPLICATE))
|
||||
if (!(NextOp->Asl.CompileFlags & OP_IS_DUPLICATE))
|
||||
{
|
||||
NextOp->Asl.CompileFlags |= NODE_IS_DUPLICATE;
|
||||
NextOp->Asl.CompileFlags |= OP_IS_DUPLICATE;
|
||||
AslError (ASL_ERROR, ASL_MSG_DUPLICATE_ITEM,
|
||||
NextOp, NULL);
|
||||
}
|
||||
@ -1033,7 +1033,7 @@ RsDoOneResourceDescriptor (
|
||||
* references to the descriptor can be resolved.
|
||||
*/
|
||||
Info->DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
|
||||
Info->DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
|
||||
Info->DescriptorTypeOp->Asl.CompileFlags = OP_IS_RESOURCE_DESC;
|
||||
Info->DescriptorTypeOp->Asl.Value.Integer = Info->CurrentByteOffset;
|
||||
|
||||
if (Rnode)
|
||||
@ -1132,7 +1132,7 @@ RsDoResourceTemplate (
|
||||
|
||||
if (Op->Asl.Parent)
|
||||
{
|
||||
Op->Asl.Parent->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
|
||||
Op->Asl.Parent->Asl.CompileFlags |= OP_IS_RESOURCE_DESC;
|
||||
}
|
||||
|
||||
/* ResourceTemplate Opcode is first (Op) */
|
||||
@ -1171,7 +1171,7 @@ RsDoResourceTemplate (
|
||||
Info.DescriptorTypeOp = DescriptorTypeOp;
|
||||
Info.CurrentByteOffset = CurrentByteOffset;
|
||||
|
||||
DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
|
||||
DescriptorTypeOp->Asl.CompileFlags |= OP_IS_RESOURCE_DESC;
|
||||
Rnode = RsDoOneResourceDescriptor (&Info, &State);
|
||||
|
||||
/*
|
||||
@ -1206,7 +1206,7 @@ RsDoResourceTemplate (
|
||||
*/
|
||||
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
|
||||
Op->Asl.AmlOpcode = AML_BUFFER_OP;
|
||||
Op->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
|
||||
Op->Asl.CompileFlags = OP_AML_PACKAGE | OP_IS_RESOURCE_DESC;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
|
||||
@ -1219,7 +1219,7 @@ RsDoResourceTemplate (
|
||||
BufferOp->Asl.AmlOpcodeLength = 0;
|
||||
BufferOp->Asl.AmlLength = CurrentByteOffset;
|
||||
BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next;
|
||||
BufferOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DATA;
|
||||
BufferOp->Asl.CompileFlags |= OP_IS_RESOURCE_DATA;
|
||||
UtSetParseOpName (BufferOp);
|
||||
|
||||
return;
|
||||
|
@ -169,11 +169,11 @@ ResourceTemplateTerm
|
||||
: PARSEOP_RESOURCETEMPLATE {COMMENT_CAPTURE_OFF;}
|
||||
OptionalParentheses
|
||||
'{'
|
||||
ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4,
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
|
||||
ResourceMacroList '}' {$$ = TrCreateOp (PARSEOP_RESOURCETEMPLATE,4,
|
||||
TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
|
||||
TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
|
||||
$5,
|
||||
TrCreateLeafNode (PARSEOP_ENDTAG));
|
||||
TrCreateLeafOp (PARSEOP_ENDTAG));
|
||||
COMMENT_CAPTURE_ON;}
|
||||
;
|
||||
|
||||
@ -186,7 +186,7 @@ OptionalParentheses
|
||||
ResourceMacroList
|
||||
: {$$ = NULL;}
|
||||
| ResourceMacroList
|
||||
ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);}
|
||||
ResourceMacroTerm {$$ = TrLinkPeerOp ($1,$2);}
|
||||
;
|
||||
|
||||
ResourceMacroTerm
|
||||
@ -235,13 +235,13 @@ ResourceMacroTerm
|
||||
|
||||
DMATerm
|
||||
: PARSEOP_DMA
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DMA);}
|
||||
DMATypeKeyword
|
||||
OptionalBusMasterKeyword
|
||||
',' XferTypeKeyword
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);}
|
||||
ByteList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$7,$8,$11);}
|
||||
| PARSEOP_DMA
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -249,7 +249,7 @@ DMATerm
|
||||
|
||||
DWordIOTerm
|
||||
: PARSEOP_DWORDIO
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDIO);}
|
||||
OptionalResourceType_First
|
||||
OptionalMinType
|
||||
OptionalMaxType
|
||||
@ -265,7 +265,7 @@ DWordIOTerm
|
||||
OptionalNameString
|
||||
OptionalType
|
||||
OptionalTranslationType_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
|
||||
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
|
||||
| PARSEOP_DWORDIO
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -274,7 +274,7 @@ DWordIOTerm
|
||||
|
||||
DWordMemoryTerm
|
||||
: PARSEOP_DWORDMEMORY
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDMEMORY);}
|
||||
OptionalResourceType_First
|
||||
OptionalDecodeType
|
||||
OptionalMinType
|
||||
@ -291,7 +291,7 @@ DWordMemoryTerm
|
||||
OptionalNameString
|
||||
OptionalAddressRange
|
||||
OptionalType_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,16,
|
||||
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
|
||||
| PARSEOP_DWORDMEMORY
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -300,7 +300,7 @@ DWordMemoryTerm
|
||||
|
||||
DWordSpaceTerm
|
||||
: PARSEOP_DWORDSPACE
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDSPACE);}
|
||||
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
|
||||
OptionalResourceType
|
||||
OptionalDecodeType
|
||||
@ -315,7 +315,7 @@ DWordSpaceTerm
|
||||
OptionalByteConstExpr
|
||||
OptionalStringData
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
|
||||
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
|
||||
| PARSEOP_DWORDSPACE
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -325,7 +325,7 @@ DWordSpaceTerm
|
||||
EndDependentFnTerm
|
||||
: PARSEOP_ENDDEPENDENTFN
|
||||
PARSEOP_OPEN_PAREN
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafOp (PARSEOP_ENDDEPENDENTFN);}
|
||||
| PARSEOP_ENDDEPENDENTFN
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -333,7 +333,7 @@ EndDependentFnTerm
|
||||
|
||||
ExtendedIOTerm
|
||||
: PARSEOP_EXTENDEDIO
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDIO);}
|
||||
OptionalResourceType_First
|
||||
OptionalMinType
|
||||
OptionalMaxType
|
||||
@ -348,7 +348,7 @@ ExtendedIOTerm
|
||||
OptionalNameString
|
||||
OptionalType
|
||||
OptionalTranslationType_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
|
||||
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);}
|
||||
| PARSEOP_EXTENDEDIO
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -357,7 +357,7 @@ ExtendedIOTerm
|
||||
|
||||
ExtendedMemoryTerm
|
||||
: PARSEOP_EXTENDEDMEMORY
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDMEMORY);}
|
||||
OptionalResourceType_First
|
||||
OptionalDecodeType
|
||||
OptionalMinType
|
||||
@ -373,7 +373,7 @@ ExtendedMemoryTerm
|
||||
OptionalNameString
|
||||
OptionalAddressRange
|
||||
OptionalType_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
|
||||
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);}
|
||||
| PARSEOP_EXTENDEDMEMORY
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -381,7 +381,7 @@ ExtendedMemoryTerm
|
||||
;
|
||||
|
||||
ExtendedSpaceTerm
|
||||
: PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);}
|
||||
: PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDSPACE);}
|
||||
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
|
||||
OptionalResourceType
|
||||
OptionalDecodeType
|
||||
@ -395,7 +395,7 @@ ExtendedSpaceTerm
|
||||
',' QWordConstExpr
|
||||
OptionalQWordConstExpr
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,13,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,13,
|
||||
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);}
|
||||
| PARSEOP_EXTENDEDSPACE
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -404,12 +404,12 @@ ExtendedSpaceTerm
|
||||
|
||||
FixedDmaTerm
|
||||
: PARSEOP_FIXEDDMA
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDDMA);}
|
||||
WordConstExpr /* 04: DMA RequestLines */
|
||||
',' WordConstExpr /* 06: DMA Channels */
|
||||
OptionalXferSize /* 07: DMA TransferSize */
|
||||
OptionalNameString /* 08: DescriptorName */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$7,$8);}
|
||||
| PARSEOP_FIXEDDMA
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -417,11 +417,11 @@ FixedDmaTerm
|
||||
|
||||
FixedIOTerm
|
||||
: PARSEOP_FIXEDIO
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDIO);}
|
||||
WordConstExpr
|
||||
',' ByteConstExpr
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);}
|
||||
| PARSEOP_FIXEDIO
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -429,7 +429,7 @@ FixedIOTerm
|
||||
|
||||
GpioIntTerm
|
||||
: PARSEOP_GPIO_INT
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_INT);}
|
||||
InterruptTypeKeyword /* 04: InterruptType */
|
||||
',' InterruptLevel /* 06: InterruptLevel */
|
||||
OptionalShareType /* 07: SharedType */
|
||||
@ -441,7 +441,7 @@ GpioIntTerm
|
||||
OptionalNameString /* 15: DescriptorName */
|
||||
OptionalBuffer_Last /* 16: VendorData */
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,
|
||||
DWordConstExpr '}' {$$ = TrLinkOpChildren ($<n>3,11,
|
||||
$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
|
||||
| PARSEOP_GPIO_INT
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -450,7 +450,7 @@ GpioIntTerm
|
||||
|
||||
GpioIoTerm
|
||||
: PARSEOP_GPIO_IO
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_IO);}
|
||||
OptionalShareType_First /* 04: SharedType */
|
||||
',' PinConfigByte /* 06: PinConfig */
|
||||
OptionalWordConstExpr /* 07: DebounceTimeout */
|
||||
@ -462,7 +462,7 @@ GpioIoTerm
|
||||
OptionalNameString /* 14: DescriptorName */
|
||||
OptionalBuffer_Last /* 15: VendorData */
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
DWordList '}' {$$ = TrLinkChildren ($<n>3,11,
|
||||
DWordList '}' {$$ = TrLinkOpChildren ($<n>3,11,
|
||||
$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
|
||||
| PARSEOP_GPIO_IO
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -471,7 +471,7 @@ GpioIoTerm
|
||||
|
||||
I2cSerialBusTerm
|
||||
: PARSEOP_I2C_SERIALBUS
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS);}
|
||||
WordConstExpr /* 04: SlaveAddress */
|
||||
OptionalSlaveMode /* 05: SlaveMode */
|
||||
',' DWordConstExpr /* 07: ConnectionSpeed */
|
||||
@ -481,9 +481,9 @@ I2cSerialBusTerm
|
||||
OptionalResourceType /* 12: ResourceType */
|
||||
OptionalNameString /* 13: DescriptorName */
|
||||
OptionalBuffer_Last /* 14: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,10,
|
||||
$4,$5,$7,$8,$10,$11,$12,$13,
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$14);}
|
||||
TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$14);}
|
||||
| PARSEOP_I2C_SERIALBUS
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -491,7 +491,7 @@ I2cSerialBusTerm
|
||||
|
||||
I2cSerialBusTermV2
|
||||
: PARSEOP_I2C_SERIALBUS_V2
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS_V2);}
|
||||
WordConstExpr /* 04: SlaveAddress */
|
||||
OptionalSlaveMode /* 05: SlaveMode */
|
||||
',' DWordConstExpr /* 07: ConnectionSpeed */
|
||||
@ -502,7 +502,7 @@ I2cSerialBusTermV2
|
||||
OptionalNameString /* 13: DescriptorName */
|
||||
OptionalShareType /* 14: Share */
|
||||
OptionalBuffer_Last /* 15: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,10,
|
||||
$4,$5,$7,$8,$10,$11,$12,$13,$14,$15);}
|
||||
| PARSEOP_I2C_SERIALBUS_V2
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -511,7 +511,7 @@ I2cSerialBusTermV2
|
||||
|
||||
InterruptTerm
|
||||
: PARSEOP_INTERRUPT
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INTERRUPT);}
|
||||
OptionalResourceType_First
|
||||
',' InterruptTypeKeyword
|
||||
',' InterruptLevel
|
||||
@ -520,7 +520,7 @@ InterruptTerm
|
||||
OptionalStringData
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
DWordList '}' {$$ = TrLinkChildren ($<n>3,8,
|
||||
DWordList '}' {$$ = TrLinkOpChildren ($<n>3,8,
|
||||
$4,$6,$8,$9,$10,$11,$12,$15);}
|
||||
| PARSEOP_INTERRUPT
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -529,14 +529,14 @@ InterruptTerm
|
||||
|
||||
IOTerm
|
||||
: PARSEOP_IO
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IO);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IO);}
|
||||
IODecodeKeyword
|
||||
',' WordConstExpr
|
||||
',' WordConstExpr
|
||||
',' ByteConstExpr
|
||||
',' ByteConstExpr
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
|
||||
| PARSEOP_IO
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -544,10 +544,10 @@ IOTerm
|
||||
|
||||
IRQNoFlagsTerm
|
||||
: PARSEOP_IRQNOFLAGS
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IRQNOFLAGS);}
|
||||
OptionalNameString_First
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
|
||||
ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
|
||||
| PARSEOP_IRQNOFLAGS
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -555,13 +555,13 @@ IRQNoFlagsTerm
|
||||
|
||||
IRQTerm
|
||||
: PARSEOP_IRQ
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IRQ);}
|
||||
InterruptTypeKeyword
|
||||
',' InterruptLevel
|
||||
OptionalShareType
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);}
|
||||
ByteList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$6,$7,$8,$11);}
|
||||
| PARSEOP_IRQ
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -569,14 +569,14 @@ IRQTerm
|
||||
|
||||
Memory24Term
|
||||
: PARSEOP_MEMORY24
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY24);}
|
||||
OptionalReadWriteKeyword
|
||||
',' WordConstExpr
|
||||
',' WordConstExpr
|
||||
',' WordConstExpr
|
||||
',' WordConstExpr
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
|
||||
| PARSEOP_MEMORY24
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -584,12 +584,12 @@ Memory24Term
|
||||
|
||||
Memory32FixedTerm
|
||||
: PARSEOP_MEMORY32FIXED
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32FIXED);}
|
||||
OptionalReadWriteKeyword
|
||||
',' DWordConstExpr
|
||||
',' DWordConstExpr
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$8,$9);}
|
||||
| PARSEOP_MEMORY32FIXED
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -597,14 +597,14 @@ Memory32FixedTerm
|
||||
|
||||
Memory32Term
|
||||
: PARSEOP_MEMORY32
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32);}
|
||||
OptionalReadWriteKeyword
|
||||
',' DWordConstExpr
|
||||
',' DWordConstExpr
|
||||
',' DWordConstExpr
|
||||
',' DWordConstExpr
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
|
||||
| PARSEOP_MEMORY32
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -612,7 +612,7 @@ Memory32Term
|
||||
|
||||
PinConfigTerm
|
||||
: PARSEOP_PINCONFIG
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINCONFIG);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINCONFIG);}
|
||||
OptionalShareType_First /* 04: SharedType */
|
||||
',' ByteConstExpr /* 06: PinConfigType */
|
||||
',' DWordConstExpr /* 08: PinConfigValue */
|
||||
@ -622,7 +622,7 @@ PinConfigTerm
|
||||
OptionalNameString /* 13: DescriptorName */
|
||||
OptionalBuffer_Last /* 14: VendorData */
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
DWordList '}' {$$ = TrLinkChildren ($<n>3,9,
|
||||
DWordList '}' {$$ = TrLinkOpChildren ($<n>3,9,
|
||||
$4,$6,$8,$10,$11,$12,$13,$14,$17);}
|
||||
| PARSEOP_PINCONFIG
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -631,7 +631,7 @@ PinConfigTerm
|
||||
|
||||
PinFunctionTerm
|
||||
: PARSEOP_PINFUNCTION
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINFUNCTION);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINFUNCTION);}
|
||||
OptionalShareType_First /* 04: SharedType */
|
||||
',' PinConfigByte /* 06: PinConfig */
|
||||
',' WordConstExpr /* 08: FunctionNumber */
|
||||
@ -641,7 +641,7 @@ PinFunctionTerm
|
||||
OptionalNameString /* 13: DescriptorName */
|
||||
OptionalBuffer_Last /* 14: VendorData */
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
DWordList '}' {$$ = TrLinkChildren ($<n>3,9,
|
||||
DWordList '}' {$$ = TrLinkOpChildren ($<n>3,9,
|
||||
$4,$6,$8,$10,$11,$12,$13,$14,$17);}
|
||||
| PARSEOP_PINFUNCTION
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -650,13 +650,13 @@ PinFunctionTerm
|
||||
|
||||
PinGroupTerm
|
||||
: PARSEOP_PINGROUP
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINGROUP);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUP);}
|
||||
StringData /* 04: ResourceLabel */
|
||||
OptionalProducerResourceType /* 05: ResourceType */
|
||||
OptionalNameString /* 06: DescriptorName */
|
||||
OptionalBuffer_Last /* 07: VendorData */
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
DWordList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$6,$7,$10);}
|
||||
DWordList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$6,$7,$10);}
|
||||
| PARSEOP_PINGROUP
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -664,7 +664,7 @@ PinGroupTerm
|
||||
|
||||
PinGroupConfigTerm
|
||||
: PARSEOP_PINGROUPCONFIG
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINGROUPCONFIG);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPCONFIG);}
|
||||
OptionalShareType_First /* 04: SharedType */
|
||||
',' ByteConstExpr /* 06: PinConfigType */
|
||||
',' DWordConstExpr /* 08: PinConfigValue */
|
||||
@ -674,7 +674,7 @@ PinGroupConfigTerm
|
||||
OptionalResourceType /* 14: ResourceType */
|
||||
OptionalNameString /* 15: DescriptorName */
|
||||
OptionalBuffer_Last /* 16: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,9,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,9,
|
||||
$4,$6,$8,$10,$11,$13,$14,$15,$16);}
|
||||
| PARSEOP_PINGROUPCONFIG
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -683,7 +683,7 @@ PinGroupConfigTerm
|
||||
|
||||
PinGroupFunctionTerm
|
||||
: PARSEOP_PINGROUPFUNCTION
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PINGROUPFUNCTION);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPFUNCTION);}
|
||||
OptionalShareType_First /* 04: SharedType */
|
||||
',' WordConstExpr /* 06: FunctionNumber */
|
||||
',' StringData /* 08: ResourceSource */
|
||||
@ -692,7 +692,7 @@ PinGroupFunctionTerm
|
||||
OptionalResourceType /* 12: ResourceType */
|
||||
OptionalNameString /* 13: DescriptorName */
|
||||
OptionalBuffer_Last /* 14: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,8,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,8,
|
||||
$4,$6,$8,$9,$11,$12,$13,$14);}
|
||||
| PARSEOP_PINGROUPFUNCTION
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -701,7 +701,7 @@ PinGroupFunctionTerm
|
||||
|
||||
QWordIOTerm
|
||||
: PARSEOP_QWORDIO
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDIO);}
|
||||
OptionalResourceType_First
|
||||
OptionalMinType
|
||||
OptionalMaxType
|
||||
@ -717,7 +717,7 @@ QWordIOTerm
|
||||
OptionalNameString
|
||||
OptionalType
|
||||
OptionalTranslationType_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
|
||||
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
|
||||
| PARSEOP_QWORDIO
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -726,7 +726,7 @@ QWordIOTerm
|
||||
|
||||
QWordMemoryTerm
|
||||
: PARSEOP_QWORDMEMORY
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDMEMORY);}
|
||||
OptionalResourceType_First
|
||||
OptionalDecodeType
|
||||
OptionalMinType
|
||||
@ -743,7 +743,7 @@ QWordMemoryTerm
|
||||
OptionalNameString
|
||||
OptionalAddressRange
|
||||
OptionalType_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,16,
|
||||
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
|
||||
| PARSEOP_QWORDMEMORY
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -752,7 +752,7 @@ QWordMemoryTerm
|
||||
|
||||
QWordSpaceTerm
|
||||
: PARSEOP_QWORDSPACE
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDSPACE);}
|
||||
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
|
||||
OptionalResourceType
|
||||
OptionalDecodeType
|
||||
@ -767,7 +767,7 @@ QWordSpaceTerm
|
||||
OptionalByteConstExpr
|
||||
OptionalStringData
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
|
||||
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
|
||||
| PARSEOP_QWORDSPACE
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -776,14 +776,14 @@ QWordSpaceTerm
|
||||
|
||||
RegisterTerm
|
||||
: PARSEOP_REGISTER
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_REGISTER);}
|
||||
AddressSpaceKeyword
|
||||
',' ByteConstExpr
|
||||
',' ByteConstExpr
|
||||
',' QWordConstExpr
|
||||
OptionalAccessSize
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);}
|
||||
| PARSEOP_REGISTER
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -791,7 +791,7 @@ RegisterTerm
|
||||
|
||||
SpiSerialBusTerm
|
||||
: PARSEOP_SPI_SERIALBUS
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS);}
|
||||
WordConstExpr /* 04: DeviceSelection */
|
||||
OptionalDevicePolarity /* 05: DevicePolarity */
|
||||
OptionalWireMode /* 06: WireMode */
|
||||
@ -805,9 +805,9 @@ SpiSerialBusTerm
|
||||
OptionalResourceType /* 19: ResourceType */
|
||||
OptionalNameString /* 20: DescriptorName */
|
||||
OptionalBuffer_Last /* 21: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
|
||||
$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);}
|
||||
TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);}
|
||||
| PARSEOP_SPI_SERIALBUS
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -815,7 +815,7 @@ SpiSerialBusTerm
|
||||
|
||||
SpiSerialBusTermV2
|
||||
: PARSEOP_SPI_SERIALBUS_V2
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS_V2);}
|
||||
WordConstExpr /* 04: DeviceSelection */
|
||||
OptionalDevicePolarity /* 05: DevicePolarity */
|
||||
OptionalWireMode /* 06: WireMode */
|
||||
@ -830,7 +830,7 @@ SpiSerialBusTermV2
|
||||
OptionalNameString /* 20: DescriptorName */
|
||||
OptionalShareType /* 21: Share */
|
||||
OptionalBuffer_Last /* 22: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
|
||||
$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21,$22);}
|
||||
| PARSEOP_SPI_SERIALBUS_V2
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -839,9 +839,9 @@ SpiSerialBusTermV2
|
||||
|
||||
StartDependentFnNoPriTerm
|
||||
: PARSEOP_STARTDEPENDENTFN_NOPRI
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN_NOPRI);}
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);}
|
||||
ResourceMacroList '}' {$$ = TrLinkOpChildren ($<n>3,1,$6);}
|
||||
| PARSEOP_STARTDEPENDENTFN_NOPRI
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -849,11 +849,11 @@ StartDependentFnNoPriTerm
|
||||
|
||||
StartDependentFnTerm
|
||||
: PARSEOP_STARTDEPENDENTFN
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN);}
|
||||
ByteConstExpr
|
||||
',' ByteConstExpr
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);}
|
||||
ResourceMacroList '}' {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$9);}
|
||||
| PARSEOP_STARTDEPENDENTFN
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -861,7 +861,7 @@ StartDependentFnTerm
|
||||
|
||||
UartSerialBusTerm
|
||||
: PARSEOP_UART_SERIALBUS
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS);}
|
||||
DWordConstExpr /* 04: ConnectionSpeed */
|
||||
OptionalBitsPerByte /* 05: BitsPerByte */
|
||||
OptionalStopBits /* 06: StopBits */
|
||||
@ -876,9 +876,9 @@ UartSerialBusTerm
|
||||
OptionalResourceType /* 19: ResourceType */
|
||||
OptionalNameString /* 20: DescriptorName */
|
||||
OptionalBuffer_Last /* 21: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
|
||||
$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);}
|
||||
TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);}
|
||||
| PARSEOP_UART_SERIALBUS
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -886,7 +886,7 @@ UartSerialBusTerm
|
||||
|
||||
UartSerialBusTermV2
|
||||
: PARSEOP_UART_SERIALBUS_V2
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS_V2);}
|
||||
DWordConstExpr /* 04: ConnectionSpeed */
|
||||
OptionalBitsPerByte /* 05: BitsPerByte */
|
||||
OptionalStopBits /* 06: StopBits */
|
||||
@ -902,7 +902,7 @@ UartSerialBusTermV2
|
||||
OptionalNameString /* 20: DescriptorName */
|
||||
OptionalShareType /* 21: Share */
|
||||
OptionalBuffer_Last /* 22: VendorData */
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
|
||||
$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21,$22);}
|
||||
| PARSEOP_UART_SERIALBUS_V2
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -911,10 +911,10 @@ UartSerialBusTermV2
|
||||
|
||||
VendorLongTerm
|
||||
: PARSEOP_VENDORLONG
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORLONG);}
|
||||
OptionalNameString_First
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
|
||||
ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
|
||||
| PARSEOP_VENDORLONG
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -922,10 +922,10 @@ VendorLongTerm
|
||||
|
||||
VendorShortTerm
|
||||
: PARSEOP_VENDORSHORT
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORSHORT);}
|
||||
OptionalNameString_First
|
||||
PARSEOP_CLOSE_PAREN '{'
|
||||
ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
|
||||
ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
|
||||
| PARSEOP_VENDORSHORT
|
||||
PARSEOP_OPEN_PAREN
|
||||
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
|
||||
@ -933,7 +933,7 @@ VendorShortTerm
|
||||
|
||||
WordBusNumberTerm
|
||||
: PARSEOP_WORDBUSNUMBER
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDBUSNUMBER);}
|
||||
OptionalResourceType_First
|
||||
OptionalMinType
|
||||
OptionalMaxType
|
||||
@ -946,7 +946,7 @@ WordBusNumberTerm
|
||||
OptionalByteConstExpr
|
||||
OptionalStringData
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,12,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,12,
|
||||
$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);}
|
||||
| PARSEOP_WORDBUSNUMBER
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -955,7 +955,7 @@ WordBusNumberTerm
|
||||
|
||||
WordIOTerm
|
||||
: PARSEOP_WORDIO
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDIO);}
|
||||
OptionalResourceType_First
|
||||
OptionalMinType
|
||||
OptionalMaxType
|
||||
@ -971,7 +971,7 @@ WordIOTerm
|
||||
OptionalNameString
|
||||
OptionalType
|
||||
OptionalTranslationType_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
|
||||
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
|
||||
| PARSEOP_WORDIO
|
||||
PARSEOP_OPEN_PAREN
|
||||
@ -980,7 +980,7 @@ WordIOTerm
|
||||
|
||||
WordSpaceTerm
|
||||
: PARSEOP_WORDSPACE
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDSPACE);}
|
||||
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
|
||||
OptionalResourceType
|
||||
OptionalDecodeType
|
||||
@ -995,7 +995,7 @@ WordSpaceTerm
|
||||
OptionalByteConstExpr
|
||||
OptionalStringData
|
||||
OptionalNameString_Last
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
|
||||
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
|
||||
| PARSEOP_WORDSPACE
|
||||
PARSEOP_OPEN_PAREN
|
||||
|
@ -165,8 +165,8 @@ NoEcho('
|
||||
* to handle output from preprocessors
|
||||
*/
|
||||
AslCode
|
||||
: DefinitionBlockList {$<n>$ = TrLinkChildren (
|
||||
TrCreateLeafNode (PARSEOP_ASL_CODE),1, $1);}
|
||||
: DefinitionBlockList {$<n>$ = TrLinkOpChildren (
|
||||
TrCreateLeafOp (PARSEOP_ASL_CODE),1, $1);}
|
||||
| error {YYABORT; $$ = NULL;}
|
||||
;
|
||||
|
||||
@ -192,22 +192,22 @@ AslCode
|
||||
*/
|
||||
DefinitionBlockTerm
|
||||
: PARSEOP_DEFINITION_BLOCK
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK); COMMENT_CAPTURE_OFF;}
|
||||
PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DEFINITION_BLOCK); COMMENT_CAPTURE_OFF;}
|
||||
String ','
|
||||
String ','
|
||||
ByteConst ','
|
||||
String ','
|
||||
String ','
|
||||
DWordConst
|
||||
PARSEOP_CLOSE_PAREN {TrSetEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;}
|
||||
'{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,
|
||||
PARSEOP_CLOSE_PAREN {TrSetOpEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;}
|
||||
'{' TermList '}' {$$ = TrLinkOpChildren ($<n>3,7,
|
||||
$4,$6,$8,$10,$12,$14,$18);}
|
||||
;
|
||||
|
||||
DefinitionBlockList
|
||||
: DefinitionBlockTerm
|
||||
| DefinitionBlockTerm
|
||||
DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);}
|
||||
DefinitionBlockList {$$ = TrLinkPeerOps (2, $1,$2);}
|
||||
;
|
||||
|
||||
|
||||
@ -217,21 +217,21 @@ DefinitionBlockList
|
||||
|
||||
NameString
|
||||
: NameSeg {}
|
||||
| PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) $1);}
|
||||
| PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");}
|
||||
| PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");}
|
||||
| PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");}
|
||||
| PARSEOP_FOR {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "FOR");}
|
||||
| PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) $1);}
|
||||
| PARSEOP_IO {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");}
|
||||
| PARSEOP_DMA {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");}
|
||||
| PARSEOP_IRQ {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");}
|
||||
| PARSEOP_FOR {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "FOR");}
|
||||
;
|
||||
/*
|
||||
NameSeg
|
||||
: PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT)
|
||||
: PARSEOP_NAMESEG {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESEG, (ACPI_NATIVE_INT)
|
||||
TrNormalizeNameSeg ($1));}
|
||||
;
|
||||
*/
|
||||
|
||||
NameSeg
|
||||
: PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
|
||||
: PARSEOP_NAMESEG {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESEG,
|
||||
(ACPI_NATIVE_INT) AslCompilerlval.s);}
|
||||
;
|
||||
|
||||
@ -242,8 +242,8 @@ Term
|
||||
: Object {}
|
||||
| Type1Opcode {}
|
||||
| Type2Opcode {}
|
||||
| Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
| Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
| Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| Type2BufferOpcode {}
|
||||
| Type2BufferOrStringOpcode {}
|
||||
| error {$$ = AslDoError(); yyclearin;}
|
||||
@ -256,45 +256,45 @@ SuperName
|
||||
;
|
||||
|
||||
Target
|
||||
: {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
|
||||
| ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
|
||||
| ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
|
||||
: {$$ = TrCreateNullTargetOp ();} /* Placeholder is a ZeroOp object */
|
||||
| ',' {$$ = TrCreateNullTargetOp ();} /* Placeholder is a ZeroOp object */
|
||||
| ',' SuperName {$$ = TrSetOpFlags ($2, OP_IS_TARGET);}
|
||||
;
|
||||
|
||||
RequiredTarget
|
||||
: ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
|
||||
: ',' SuperName {$$ = TrSetOpFlags ($2, OP_IS_TARGET);}
|
||||
;
|
||||
|
||||
TermArg
|
||||
: SimpleName {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
: SimpleName {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
|
||||
| Type2Opcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
|
||||
| DataObject {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
|
||||
| PARSEOP_OPEN_PAREN
|
||||
TermArg
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrSetNodeFlags ($2, NODE_IS_TERM_ARG);}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrSetOpFlags ($2, OP_IS_TERM_ARG);}
|
||||
;
|
||||
|
||||
/*
|
||||
NOTE: Removed from TermArg due to reduce/reduce conflicts:
|
||||
| Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
|
||||
| Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
|
||||
| Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
|
||||
| Type2BufferOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
|
||||
| Type2BufferOrStringOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
|
||||
|
||||
*/
|
||||
|
||||
MethodInvocationTerm
|
||||
: NameString
|
||||
PARSEOP_OPEN_PAREN {TrUpdateNode (PARSEOP_METHODCALL, $1); COMMENT_CAPTURE_OFF;}
|
||||
PARSEOP_OPEN_PAREN {TrSetOpIntegerValue (PARSEOP_METHODCALL, $1); COMMENT_CAPTURE_OFF;}
|
||||
ArgList
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildNode ($1,$4); COMMENT_CAPTURE_ON;}
|
||||
PARSEOP_CLOSE_PAREN {$$ = TrLinkChildOp ($1,$4); COMMENT_CAPTURE_ON;}
|
||||
;
|
||||
|
||||
/* OptionalCount must appear before ByteList or an incorrect reduction will result */
|
||||
|
||||
OptionalCount
|
||||
: {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
|
||||
| ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
|
||||
: {$$ = TrCreateLeafOp (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
|
||||
| ',' {$$ = TrCreateLeafOp (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
|
||||
| ',' TermArg {$$ = $2;}
|
||||
;
|
||||
|
||||
@ -334,14 +334,14 @@ OptionalDataCount
|
||||
|
||||
TermList
|
||||
: {$$ = NULL;}
|
||||
| TermList Term {$$ = TrLinkPeerNode (
|
||||
TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
|
||||
| TermList Term ';' {$$ = TrLinkPeerNode (
|
||||
TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
|
||||
| TermList ';' Term {$$ = TrLinkPeerNode (
|
||||
TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
|
||||
| TermList ';' Term ';' {$$ = TrLinkPeerNode (
|
||||
TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
|
||||
| TermList Term {$$ = TrLinkPeerOp (
|
||||
TrSetOpFlags ($1, OP_RESULT_NOT_USED),$2);}
|
||||
| TermList Term ';' {$$ = TrLinkPeerOp (
|
||||
TrSetOpFlags ($1, OP_RESULT_NOT_USED),$2);}
|
||||
| TermList ';' Term {$$ = TrLinkPeerOp (
|
||||
TrSetOpFlags ($1, OP_RESULT_NOT_USED),$3);}
|
||||
| TermList ';' Term ';' {$$ = TrLinkPeerOp (
|
||||
TrSetOpFlags ($1, OP_RESULT_NOT_USED),$3);}
|
||||
;
|
||||
|
||||
ArgList
|
||||
@ -349,7 +349,7 @@ ArgList
|
||||
| TermArg
|
||||
| ArgList ',' /* Allows a trailing comma at list end */
|
||||
| ArgList ','
|
||||
TermArg {$$ = TrLinkPeerNode ($1,$3);}
|
||||
TermArg {$$ = TrLinkPeerOp ($1,$3);}
|
||||
;
|
||||
|
||||
ByteList
|
||||
@ -357,7 +357,7 @@ ByteList
|
||||
| ByteConstExpr
|
||||
| ByteList ',' /* Allows a trailing comma at list end */
|
||||
| ByteList ','
|
||||
ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);}
|
||||
ByteConstExpr {$$ = TrLinkPeerOp ($1,$3);}
|
||||
;
|
||||
|
||||
DWordList
|
||||
@ -365,7 +365,7 @@ DWordList
|
||||
| DWordConstExpr
|
||||
| DWordList ',' /* Allows a trailing comma at list end */
|
||||
| DWordList ','
|
||||
DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);}
|
||||
DWordConstExpr {$$ = TrLinkPeerOp ($1,$3);}
|
||||
;
|
||||
|
||||
FieldUnitList
|
||||
@ -373,7 +373,7 @@ FieldUnitList
|
||||
| FieldUnit
|
||||
| FieldUnitList ',' /* Allows a trailing comma at list end */
|
||||
| FieldUnitList ','
|
||||
FieldUnit {$$ = TrLinkPeerNode ($1,$3);}
|
||||
FieldUnit {$$ = TrLinkPeerOp ($1,$3);}
|
||||
;
|
||||
|
||||
FieldUnit
|
||||
@ -384,9 +384,9 @@ FieldUnit
|
||||
;
|
||||
|
||||
FieldUnitEntry
|
||||
: ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);}
|
||||
: ',' AmlPackageLengthTerm {$$ = TrCreateOp (PARSEOP_RESERVED_BYTES,1,$2);}
|
||||
| NameSeg ','
|
||||
AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);}
|
||||
AmlPackageLengthTerm {$$ = TrLinkChildOp ($1,$3);}
|
||||
;
|
||||
|
||||
Object
|
||||
@ -401,7 +401,7 @@ PackageList
|
||||
| PackageElement
|
||||
| PackageList ',' /* Allows a trailing comma at list end */
|
||||
| PackageList ','
|
||||
PackageElement {$$ = TrLinkPeerNode ($1,$3);}
|
||||
PackageElement {$$ = TrLinkPeerOp ($1,$3);}
|
||||
;
|
||||
|
||||
PackageElement
|
||||
@ -415,7 +415,7 @@ ParameterTypePackage
|
||||
: {$$ = NULL;}
|
||||
| ObjectTypeKeyword {$$ = $1;}
|
||||
| ParameterTypePackage ','
|
||||
ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);}
|
||||
ObjectTypeKeyword {$$ = TrLinkPeerOps (2,$1,$3);}
|
||||
;
|
||||
|
||||
ParameterTypePackageList
|
||||
@ -425,9 +425,9 @@ ParameterTypePackageList
|
||||
;
|
||||
|
||||
OptionalParameterTypePackage
|
||||
: {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
|
||||
| ',' ParameterTypePackageList {$$ = TrLinkChildren (
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
|
||||
: {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);}
|
||||
| ',' ParameterTypePackageList {$$ = TrLinkOpChildren (
|
||||
TrCreateLeafOp (PARSEOP_DEFAULT_ARG),1,$2);}
|
||||
;
|
||||
|
||||
/* Rules for specifying the types for method arguments */
|
||||
@ -435,7 +435,7 @@ OptionalParameterTypePackage
|
||||
ParameterTypesPackage
|
||||
: ParameterTypePackageList {$$ = $1;}
|
||||
| ParameterTypesPackage ','
|
||||
ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);}
|
||||
ParameterTypePackageList {$$ = TrLinkPeerOps (2,$1,$3);}
|
||||
;
|
||||
|
||||
ParameterTypesPackageList
|
||||
@ -445,9 +445,9 @@ ParameterTypesPackageList
|
||||
;
|
||||
|
||||
OptionalParameterTypesPackage
|
||||
: {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
|
||||
| ',' ParameterTypesPackageList {$$ = TrLinkChildren (
|
||||
TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
|
||||
: {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);}
|
||||
| ',' ParameterTypesPackageList {$$ = TrLinkOpChildren (
|
||||
TrCreateLeafOp (PARSEOP_DEFAULT_ARG),1,$2);}
|
||||
;
|
||||
|
||||
/*
|
||||
@ -458,9 +458,9 @@ CaseDefaultTermList
|
||||
| CaseTerm {}
|
||||
| DefaultTerm {}
|
||||
| CaseDefaultTermList
|
||||
CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
|
||||
CaseTerm {$$ = TrLinkPeerOp ($1,$2);}
|
||||
| CaseDefaultTermList
|
||||
DefaultTerm {$$ = TrLinkPeerNode ($1,$2);}
|
||||
DefaultTerm {$$ = TrLinkPeerOp ($1,$2);}
|
||||
|
||||
/* Original - attempts to force zero or one default term within the switch */
|
||||
|
||||
@ -469,16 +469,16 @@ CaseDefaultTermList
|
||||
: {$$ = NULL;}
|
||||
| CaseTermList
|
||||
DefaultTerm
|
||||
CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));}
|
||||
CaseTermList {$$ = TrLinkPeerOp ($1,TrLinkPeerOp ($2, $3));}
|
||||
| CaseTermList
|
||||
CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
|
||||
CaseTerm {$$ = TrLinkPeerOp ($1,$2);}
|
||||
;
|
||||
|
||||
CaseTermList
|
||||
: {$$ = NULL;}
|
||||
| CaseTerm {}
|
||||
| CaseTermList
|
||||
CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
|
||||
CaseTerm {$$ = TrLinkPeerOp ($1,$2);}
|
||||
;
|
||||
*/
|
||||
|
||||
@ -497,9 +497,9 @@ DataObject
|
||||
;
|
||||
|
||||
BufferData
|
||||
: Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
| Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
| Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
: Type5Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| Type2BufferOrStringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| Type2BufferOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| BufferTerm {}
|
||||
;
|
||||
|
||||
@ -508,35 +508,35 @@ PackageData
|
||||
;
|
||||
|
||||
IntegerData
|
||||
: Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
| Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
: Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| Integer {}
|
||||
| ConstTerm {}
|
||||
;
|
||||
|
||||
StringData
|
||||
: Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
: Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| String {}
|
||||
;
|
||||
|
||||
ByteConst
|
||||
: Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
|
||||
: Integer {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);}
|
||||
;
|
||||
|
||||
WordConst
|
||||
: Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
|
||||
: Integer {$$ = TrSetOpIntegerValue (PARSEOP_WORDCONST, $1);}
|
||||
;
|
||||
|
||||
DWordConst
|
||||
: Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
|
||||
: Integer {$$ = TrSetOpIntegerValue (PARSEOP_DWORDCONST, $1);}
|
||||
;
|
||||
|
||||
QWordConst
|
||||
: Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
|
||||
: Integer {$$ = TrSetOpIntegerValue (PARSEOP_QWORDCONST, $1);}
|
||||
;
|
||||
|
||||
/*
|
||||
* The NODE_COMPILE_TIME_CONST flag in the following constant expressions
|
||||
* The OP_COMPILE_TIME_CONST flag in the following constant expressions
|
||||
* enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
|
||||
* to simple integers. It is an error if these types of expressions cannot be
|
||||
* reduced, since the AML grammar for ****ConstExpr requires a simple constant.
|
||||
@ -544,63 +544,64 @@ QWordConst
|
||||
* constant folding code in the node AmlLength field.
|
||||
*/
|
||||
ByteConstExpr
|
||||
: Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 1);}
|
||||
| Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 1);}
|
||||
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
|
||||
: Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 1);}
|
||||
| Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 1);}
|
||||
| ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);}
|
||||
| ByteConst {}
|
||||
;
|
||||
|
||||
WordConstExpr
|
||||
: Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 2);}
|
||||
| Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 2);}
|
||||
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
|
||||
: Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 2);}
|
||||
| Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 2);}
|
||||
| ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_WORDCONST, $1);}
|
||||
| WordConst {}
|
||||
;
|
||||
|
||||
DWordConstExpr
|
||||
: Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 4);}
|
||||
| Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 4);}
|
||||
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
|
||||
: Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 4);}
|
||||
| Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 4);}
|
||||
| ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_DWORDCONST, $1);}
|
||||
| DWordConst {}
|
||||
;
|
||||
|
||||
QWordConstExpr
|
||||
: Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 8);}
|
||||
| Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
|
||||
TrSetNodeAmlLength ($1, 8);}
|
||||
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
|
||||
: Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 8);}
|
||||
| Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
|
||||
TrSetOpAmlLength ($1, 8);}
|
||||
| ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_QWORDCONST, $1);}
|
||||
| QWordConst {}
|
||||
;
|
||||
|
||||
ConstTerm
|
||||
: ConstExprTerm {}
|
||||
| PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);}
|
||||
| PARSEOP_REVISION {$$ = TrCreateLeafOp (PARSEOP_REVISION);}
|
||||
;
|
||||
|
||||
ConstExprTerm
|
||||
: PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);}
|
||||
| PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);}
|
||||
| PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);}
|
||||
| PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);}
|
||||
| PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);}
|
||||
| PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);}
|
||||
| PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
|
||||
: PARSEOP_ZERO {$$ = TrCreateValuedLeafOp (PARSEOP_ZERO, 0);}
|
||||
| PARSEOP_ONE {$$ = TrCreateValuedLeafOp (PARSEOP_ONE, 1);}
|
||||
| PARSEOP_ONES {$$ = TrCreateValuedLeafOp (PARSEOP_ONES, ACPI_UINT64_MAX);}
|
||||
| PARSEOP___DATE__ {$$ = TrCreateConstantLeafOp (PARSEOP___DATE__);}
|
||||
| PARSEOP___FILE__ {$$ = TrCreateConstantLeafOp (PARSEOP___FILE__);}
|
||||
| PARSEOP___LINE__ {$$ = TrCreateConstantLeafOp (PARSEOP___LINE__);}
|
||||
| PARSEOP___PATH__ {$$ = TrCreateConstantLeafOp (PARSEOP___PATH__);}
|
||||
| PARSEOP___METHOD__ {$$ = TrCreateConstantLeafOp (PARSEOP___METHOD__);}
|
||||
;
|
||||
|
||||
Integer
|
||||
: PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER,
|
||||
: PARSEOP_INTEGER {$$ = TrCreateValuedLeafOp (PARSEOP_INTEGER,
|
||||
AslCompilerlval.i);}
|
||||
;
|
||||
|
||||
String
|
||||
: PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
|
||||
: PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafOp (PARSEOP_STRING_LITERAL,
|
||||
(ACPI_NATIVE_INT) AslCompilerlval.s);}
|
||||
;
|
||||
|
||||
@ -739,7 +740,7 @@ Type2Opcode
|
||||
* Type 3/4/5 opcodes
|
||||
*/
|
||||
Type2IntegerOpcode /* "Type3" opcodes */
|
||||
: Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
: Expression {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| AddTerm {}
|
||||
| AndTerm {}
|
||||
| DecTerm {}
|
||||
@ -788,7 +789,7 @@ Type2BufferOpcode /* "Type5" Opcodes */
|
||||
;
|
||||
|
||||
Type2BufferOrStringOpcode
|
||||
: ConcatTerm {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
|
||||
: ConcatTerm {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
|
||||
| PrintfTerm {}
|
||||
| FprintfTerm {}
|
||||
| MidTerm {}
|
||||
@ -838,7 +839,7 @@ Type6Opcode
|
||||
******************************************************************************/
|
||||
|
||||
AmlPackageLengthTerm
|
||||
: Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,
|
||||
: Integer {$$ = TrSetOpIntegerValue (PARSEOP_PACKAGE_LENGTH,
|
||||
(ACPI_PARSE_OBJECT *) $1);}
|
||||
;
|
||||
|
||||
@ -853,14 +854,14 @@ TermArgItem
|
||||
;
|
||||
|
||||
OptionalReference
|
||||
: {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
|
||||
| ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
|
||||
: {$$ = TrCreateLeafOp (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
|
||||
| ',' {$$ = TrCreateLeafOp (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
|
||||
| ',' TermArg {$$ = $2;}
|
||||
;
|
||||
|
||||
OptionalReturnArg
|
||||
: {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO),
|
||||
NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */
|
||||
: {$$ = TrSetOpFlags (TrCreateLeafOp (PARSEOP_ZERO),
|
||||
OP_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */
|
||||
| TermArg {$$ = $1;}
|
||||
;
|
||||
|
||||
@ -871,7 +872,7 @@ OptionalSerializeRuleKeyword
|
||||
;
|
||||
|
||||
OptionalTermArg
|
||||
: {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
|
||||
: {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);}
|
||||
| TermArg {$$ = $1;}
|
||||
;
|
||||
|
||||
|
@ -237,7 +237,7 @@ AslInitializeGlobals (
|
||||
{
|
||||
Gbl_CommentState.SpacesBefore = 0;
|
||||
Gbl_CommentState.CommentType = 1;
|
||||
Gbl_CommentState.Latest_Parse_Node = NULL;
|
||||
Gbl_CommentState.LatestParseOp = NULL;
|
||||
Gbl_CommentState.ParsingParenBraceNode = NULL;
|
||||
Gbl_CommentState.CaptureComments = TRUE;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ AslDoError (
|
||||
void)
|
||||
{
|
||||
|
||||
return (TrCreateLeafNode (PARSEOP_ERRORNODE));
|
||||
return (TrCreateLeafOp (PARSEOP_ERRORNODE));
|
||||
}
|
||||
|
||||
|
||||
|
@ -637,3 +637,4 @@ NoEcho('
|
||||
%token <i> PARSEOP___FILE__
|
||||
%token <i> PARSEOP___LINE__
|
||||
%token <i> PARSEOP___PATH__
|
||||
%token <i> PARSEOP___METHOD__
|
||||
|
@ -430,6 +430,8 @@ static void
|
||||
TrTransformSubtree (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *MethodOp;
|
||||
|
||||
|
||||
if (Op->Asl.AmlOpcode == AML_RAW_DATA_BYTE)
|
||||
{
|
||||
@ -465,6 +467,35 @@ TrTransformSubtree (
|
||||
|
||||
break;
|
||||
|
||||
case PARSEOP___METHOD__:
|
||||
|
||||
/* Transform to a string op containing the parent method name */
|
||||
|
||||
Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
|
||||
UtSetParseOpName (Op);
|
||||
|
||||
/* Find the parent control method op */
|
||||
|
||||
MethodOp = Op;
|
||||
while (MethodOp)
|
||||
{
|
||||
if (MethodOp->Asl.ParseOpcode == PARSEOP_METHOD)
|
||||
{
|
||||
/* First child contains the method name */
|
||||
|
||||
MethodOp = MethodOp->Asl.Child;
|
||||
Op->Asl.Value.String = MethodOp->Asl.Value.String;
|
||||
return;
|
||||
}
|
||||
|
||||
MethodOp = MethodOp->Asl.Parent;
|
||||
}
|
||||
|
||||
/* At the root, invocation not within a control method */
|
||||
|
||||
Op->Asl.Value.String = "\\";
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Nothing to do here for other opcodes */
|
||||
@ -602,7 +633,7 @@ TrDoSwitch (
|
||||
{
|
||||
/* Add an ELSE to complete the previous CASE */
|
||||
|
||||
NewOp = TrCreateLeafNode (PARSEOP_ELSE);
|
||||
NewOp = TrCreateLeafOp (PARSEOP_ELSE);
|
||||
NewOp->Asl.Parent = Conditional->Asl.Parent;
|
||||
TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent);
|
||||
|
||||
@ -627,49 +658,49 @@ TrDoSwitch (
|
||||
* If (LNotEqual (Match (Package(<size>){<data>},
|
||||
* MEQ, _T_x, MTR, Zero, Zero), Ones))
|
||||
*/
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_MATCHTYPE_MEQ);
|
||||
Predicate->Asl.Next = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Conditional);
|
||||
|
||||
NewOp = NewOp2;
|
||||
NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
|
||||
NewOp2 = TrCreateValuedLeafOp (PARSEOP_NAMESTRING,
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
NewOp->Asl.Next = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Predicate);
|
||||
|
||||
NewOp = NewOp2;
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_MATCHTYPE_MTR);
|
||||
NewOp->Asl.Next = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Predicate);
|
||||
|
||||
NewOp = NewOp2;
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_ZERO);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_ZERO);
|
||||
NewOp->Asl.Next = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Predicate);
|
||||
|
||||
NewOp = NewOp2;
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_ZERO);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_ZERO);
|
||||
NewOp->Asl.Next = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Predicate);
|
||||
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_MATCH);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_MATCH);
|
||||
NewOp2->Asl.Child = Predicate; /* PARSEOP_PACKAGE */
|
||||
TrAmlInitLineNumbers (NewOp2, Conditional);
|
||||
TrAmlSetSubtreeParent (Predicate, NewOp2);
|
||||
|
||||
NewOp = NewOp2;
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_ONES);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_ONES);
|
||||
NewOp->Asl.Next = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Conditional);
|
||||
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_LEQUAL);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_LEQUAL);
|
||||
NewOp2->Asl.Child = NewOp;
|
||||
NewOp->Asl.Parent = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Conditional);
|
||||
TrAmlSetSubtreeParent (NewOp, NewOp2);
|
||||
|
||||
NewOp = NewOp2;
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_LNOT);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_LNOT);
|
||||
NewOp2->Asl.Child = NewOp;
|
||||
NewOp2->Asl.Parent = Conditional;
|
||||
NewOp->Asl.Parent = NewOp2;
|
||||
@ -690,12 +721,12 @@ TrDoSwitch (
|
||||
* CaseOp->Child is the case value
|
||||
* CaseOp->Child->Peer is the beginning of the case block
|
||||
*/
|
||||
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
|
||||
NewOp = TrCreateValuedLeafOp (PARSEOP_NAMESTRING,
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
NewOp->Asl.Next = Predicate;
|
||||
TrAmlInitLineNumbers (NewOp, Predicate);
|
||||
|
||||
NewOp2 = TrCreateLeafNode (PARSEOP_LEQUAL);
|
||||
NewOp2 = TrCreateLeafOp (PARSEOP_LEQUAL);
|
||||
NewOp2->Asl.Parent = Conditional;
|
||||
NewOp2->Asl.Child = NewOp;
|
||||
TrAmlInitLineNumbers (NewOp2, Conditional);
|
||||
@ -792,7 +823,7 @@ TrDoSwitch (
|
||||
/* Create the Name node */
|
||||
|
||||
Predicate = StartNode->Asl.Child;
|
||||
NewOp = TrCreateLeafNode (PARSEOP_NAME);
|
||||
NewOp = TrCreateLeafOp (PARSEOP_NAME);
|
||||
TrAmlInitLineNumbers (NewOp, StartNode);
|
||||
|
||||
/* Find the parent method */
|
||||
@ -805,7 +836,7 @@ TrDoSwitch (
|
||||
}
|
||||
MethodOp = Next;
|
||||
|
||||
NewOp->Asl.CompileFlags |= NODE_COMPILER_EMITTED;
|
||||
NewOp->Asl.CompileFlags |= OP_COMPILER_EMITTED;
|
||||
NewOp->Asl.Parent = Next;
|
||||
|
||||
/* Insert name after the method name and arguments */
|
||||
@ -836,10 +867,10 @@ TrDoSwitch (
|
||||
|
||||
/* Create the NameSeg child for the Name node */
|
||||
|
||||
NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
|
||||
NewOp2 = TrCreateValuedLeafOp (PARSEOP_NAMESEG,
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
TrAmlInitLineNumbers (NewOp2, NewOp);
|
||||
NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION;
|
||||
NewOp2->Asl.CompileFlags |= OP_IS_NAME_DECLARATION;
|
||||
NewOp->Asl.Child = NewOp2;
|
||||
|
||||
/* Create the initial value for the Name. Btype was already validated above */
|
||||
@ -848,31 +879,32 @@ TrDoSwitch (
|
||||
{
|
||||
case ACPI_BTYPE_INTEGER:
|
||||
|
||||
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO,
|
||||
NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_ZERO,
|
||||
(UINT64) 0);
|
||||
TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp);
|
||||
break;
|
||||
|
||||
case ACPI_BTYPE_STRING:
|
||||
|
||||
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
|
||||
NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_STRING_LITERAL,
|
||||
(UINT64) ACPI_TO_INTEGER (""));
|
||||
TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp);
|
||||
break;
|
||||
|
||||
case ACPI_BTYPE_BUFFER:
|
||||
|
||||
(void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER,
|
||||
(void) TrLinkPeerOp (NewOp2, TrCreateValuedLeafOp (PARSEOP_BUFFER,
|
||||
(UINT64) 0));
|
||||
Next = NewOp2->Asl.Next;
|
||||
TrAmlInitLineNumbers (Next, NewOp2);
|
||||
(void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO,
|
||||
|
||||
(void) TrLinkOpChildren (Next, 1, TrCreateValuedLeafOp (PARSEOP_ZERO,
|
||||
(UINT64) 1));
|
||||
TrAmlInitLineNumbers (Next->Asl.Child, Next);
|
||||
|
||||
BufferOp = TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0);
|
||||
BufferOp = TrCreateValuedLeafOp (PARSEOP_DEFAULT_ARG, (UINT64) 0);
|
||||
TrAmlInitLineNumbers (BufferOp, Next->Asl.Child);
|
||||
(void) TrLinkPeerNode (Next->Asl.Child, BufferOp);
|
||||
(void) TrLinkPeerOp (Next->Asl.Child, BufferOp);
|
||||
|
||||
TrAmlSetSubtreeParent (Next->Asl.Child, Next);
|
||||
break;
|
||||
@ -891,7 +923,7 @@ TrDoSwitch (
|
||||
* where _T_x is the temp variable.
|
||||
*/
|
||||
TrAmlInitNode (StartNode, PARSEOP_WHILE);
|
||||
NewOp = TrCreateLeafNode (PARSEOP_ONE);
|
||||
NewOp = TrCreateLeafOp (PARSEOP_ONE);
|
||||
TrAmlInitLineNumbers (NewOp, StartNode);
|
||||
NewOp->Asl.Next = Predicate->Asl.Next;
|
||||
NewOp->Asl.Parent = StartNode;
|
||||
@ -899,7 +931,7 @@ TrDoSwitch (
|
||||
|
||||
/* Create a Store() node */
|
||||
|
||||
StoreOp = TrCreateLeafNode (PARSEOP_STORE);
|
||||
StoreOp = TrCreateLeafOp (PARSEOP_STORE);
|
||||
TrAmlInitLineNumbers (StoreOp, NewOp);
|
||||
StoreOp->Asl.Parent = StartNode;
|
||||
TrAmlInsertPeer (NewOp, StoreOp);
|
||||
@ -909,7 +941,7 @@ TrDoSwitch (
|
||||
StoreOp->Asl.Child = Predicate;
|
||||
Predicate->Asl.Parent = StoreOp;
|
||||
|
||||
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
|
||||
NewOp = TrCreateValuedLeafOp (PARSEOP_NAMESEG,
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
TrAmlInitLineNumbers (NewOp, StoreOp);
|
||||
NewOp->Asl.Parent = StoreOp;
|
||||
@ -923,7 +955,7 @@ TrDoSwitch (
|
||||
Conditional = Conditional->Asl.Next;
|
||||
}
|
||||
|
||||
BreakOp = TrCreateLeafNode (PARSEOP_BREAK);
|
||||
BreakOp = TrCreateLeafOp (PARSEOP_BREAK);
|
||||
TrAmlInitLineNumbers (BreakOp, NewOp);
|
||||
BreakOp->Asl.Parent = StartNode;
|
||||
TrAmlInsertPeer (Conditional, BreakOp);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -162,27 +162,29 @@
|
||||
|
||||
/* Op flags for the ACPI_PARSE_OBJECT */
|
||||
|
||||
#define NODE_VISITED 0x00000001
|
||||
#define NODE_AML_PACKAGE 0x00000002
|
||||
#define NODE_IS_TARGET 0x00000004
|
||||
#define NODE_IS_RESOURCE_DESC 0x00000008
|
||||
#define NODE_IS_RESOURCE_FIELD 0x00000010
|
||||
#define NODE_HAS_NO_EXIT 0x00000020
|
||||
#define NODE_IF_HAS_NO_EXIT 0x00000040
|
||||
#define NODE_NAME_INTERNALIZED 0x00000080
|
||||
#define NODE_METHOD_NO_RETVAL 0x00000100
|
||||
#define NODE_METHOD_SOME_NO_RETVAL 0x00000200
|
||||
#define NODE_RESULT_NOT_USED 0x00000400
|
||||
#define NODE_METHOD_TYPED 0x00000800
|
||||
#define NODE_COULD_NOT_REDUCE 0x00001000
|
||||
#define NODE_COMPILE_TIME_CONST 0x00002000
|
||||
#define NODE_IS_TERM_ARG 0x00004000
|
||||
#define NODE_WAS_ONES_OP 0x00008000
|
||||
#define NODE_IS_NAME_DECLARATION 0x00010000
|
||||
#define NODE_COMPILER_EMITTED 0x00020000
|
||||
#define NODE_IS_DUPLICATE 0x00040000
|
||||
#define NODE_IS_RESOURCE_DATA 0x00080000
|
||||
#define NODE_IS_NULL_RETURN 0x00100000
|
||||
#define OP_VISITED 0x00000001
|
||||
#define OP_AML_PACKAGE 0x00000002
|
||||
#define OP_IS_TARGET 0x00000004
|
||||
#define OP_IS_RESOURCE_DESC 0x00000008
|
||||
#define OP_IS_RESOURCE_FIELD 0x00000010
|
||||
#define OP_HAS_NO_EXIT 0x00000020
|
||||
#define OP_IF_HAS_NO_EXIT 0x00000040
|
||||
#define OP_NAME_INTERNALIZED 0x00000080
|
||||
#define OP_METHOD_NO_RETVAL 0x00000100
|
||||
#define OP_METHOD_SOME_NO_RETVAL 0x00000200
|
||||
#define OP_RESULT_NOT_USED 0x00000400
|
||||
#define OP_METHOD_TYPED 0x00000800
|
||||
#define OP_COULD_NOT_REDUCE 0x00001000
|
||||
#define OP_COMPILE_TIME_CONST 0x00002000
|
||||
#define OP_IS_TERM_ARG 0x00004000
|
||||
#define OP_WAS_ONES_OP 0x00008000
|
||||
#define OP_IS_NAME_DECLARATION 0x00010000
|
||||
#define OP_COMPILER_EMITTED 0x00020000
|
||||
#define OP_IS_DUPLICATE 0x00040000
|
||||
#define OP_IS_RESOURCE_DATA 0x00080000
|
||||
#define OP_IS_NULL_RETURN 0x00100000
|
||||
|
||||
#define ACPI_NUM_OP_FLAGS 0x21
|
||||
|
||||
/* Keeps information about individual control methods */
|
||||
|
||||
@ -353,6 +355,15 @@ typedef struct asl_error_msg
|
||||
|
||||
} ASL_ERROR_MSG;
|
||||
|
||||
/* An entry in the expected messages array */
|
||||
typedef struct asl_expected_message
|
||||
{
|
||||
UINT32 MessageId;
|
||||
char *MessageIdStr;
|
||||
BOOLEAN MessageReceived;
|
||||
|
||||
} ASL_EXPECTED_MESSAGE;
|
||||
|
||||
|
||||
/* An entry in the listing file stack (for include files) */
|
||||
|
||||
|
@ -174,6 +174,12 @@ UtAttachNameseg (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Name);
|
||||
|
||||
static void
|
||||
UtReallocLineBuffers (
|
||||
char **Buffer,
|
||||
UINT32 OldSize,
|
||||
UINT32 NewSize);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -733,43 +739,48 @@ UtExpandLineBuffers (
|
||||
Gbl_LineBufferSize, NewSize);
|
||||
}
|
||||
|
||||
Gbl_CurrentLineBuffer = realloc (Gbl_CurrentLineBuffer, NewSize);
|
||||
UtReallocLineBuffers (&Gbl_CurrentLineBuffer, Gbl_LineBufferSize, NewSize);
|
||||
UtReallocLineBuffers (&Gbl_MainTokenBuffer, Gbl_LineBufferSize, NewSize);
|
||||
UtReallocLineBuffers (&Gbl_MacroTokenBuffer, Gbl_LineBufferSize, NewSize);
|
||||
UtReallocLineBuffers (&Gbl_ExpressionTokenBuffer, Gbl_LineBufferSize, 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 */
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtReallocLineBuffers
|
||||
*
|
||||
* PARAMETERS: Buffer - Buffer to realloc
|
||||
* OldSize - Old size of Buffer
|
||||
* NewSize - New size of Buffer
|
||||
*
|
||||
* RETURN: none
|
||||
*
|
||||
* DESCRIPTION: Reallocate and initialize Buffer
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
UtReallocLineBuffers (
|
||||
char **Buffer,
|
||||
UINT32 OldSize,
|
||||
UINT32 NewSize)
|
||||
{
|
||||
|
||||
*Buffer = realloc (*Buffer, NewSize);
|
||||
if (*Buffer)
|
||||
{
|
||||
memset (*Buffer + OldSize, 0, NewSize - OldSize);
|
||||
return;
|
||||
}
|
||||
|
||||
ErrorExit:
|
||||
printf ("Could not increase line buffer size from %u to %u\n",
|
||||
Gbl_LineBufferSize, Gbl_LineBufferSize * 2);
|
||||
OldSize, NewSize);
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION,
|
||||
NULL, NULL);
|
||||
AslError (ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, NULL, NULL);
|
||||
AslAbort ();
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ AnMethodTypingWalkEnd (
|
||||
{
|
||||
case PARSEOP_METHOD:
|
||||
|
||||
Op->Asl.CompileFlags |= NODE_METHOD_TYPED;
|
||||
Op->Asl.CompileFlags |= OP_METHOD_TYPED;
|
||||
break;
|
||||
|
||||
case PARSEOP_RETURN:
|
||||
|
@ -533,7 +533,7 @@ XfNamespaceLocateBegin (
|
||||
* references to other objects within the namespace and the parent objects
|
||||
* of name declarations
|
||||
*/
|
||||
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
|
||||
if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
@ -559,7 +559,7 @@ XfNamespaceLocateBegin (
|
||||
RegisterNumber = Op->Asl.AmlOpcode & 0x0007; /* 0x60 through 0x67 */
|
||||
MethodLocals = Node->MethodLocals;
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TARGET)
|
||||
{
|
||||
/* Local is being initialized */
|
||||
|
||||
@ -603,7 +603,7 @@ XfNamespaceLocateBegin (
|
||||
MethodArgs[RegisterNumber].Flags |= ASL_ARG_REFERENCED;
|
||||
MethodArgs[RegisterNumber].Op = Op;
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
|
||||
if (Op->Asl.CompileFlags & OP_IS_TARGET)
|
||||
{
|
||||
/* Arg is being initialized */
|
||||
|
||||
@ -676,7 +676,7 @@ XfNamespaceLocateBegin (
|
||||
/* Name must appear as the last parameter */
|
||||
|
||||
NextOp = Op->Asl.Child;
|
||||
while (!(NextOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
|
||||
while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION))
|
||||
{
|
||||
NextOp = NextOp->Asl.Next;
|
||||
}
|
||||
@ -916,7 +916,7 @@ XfNamespaceLocateBegin (
|
||||
Op->Asl.AmlLength = 0;
|
||||
Op->Asl.ParseOpcode = PARSEOP_INTEGER;
|
||||
Op->Asl.Value.Integer = (UINT64) Offset;
|
||||
Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD;
|
||||
Op->Asl.CompileFlags |= OP_IS_RESOURCE_FIELD;
|
||||
|
||||
OpcGenerateAmlOpcode (Op);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@
|
||||
* StringBuffer Buffer containing the comment being processed
|
||||
* c1 Current input
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Process a single line comment of a c Style comment. This
|
||||
* function captures a line of a c style comment in a char* and
|
||||
@ -217,14 +217,15 @@ CvProcessComment (
|
||||
{
|
||||
FinalLineToken[strlen(FinalLineToken)-1] = 0;
|
||||
}
|
||||
|
||||
CvAddToCommentList (FinalLineToken);
|
||||
LineToken = strtok (NULL, "\n");
|
||||
while (LineToken != NULL)
|
||||
{
|
||||
/*
|
||||
* It is assumed that each line has some sort of indentation.
|
||||
* This means that we need to find the first character that is not
|
||||
* a white space within each line.
|
||||
* This means that we need to find the first character that
|
||||
* is not a white space within each line.
|
||||
*/
|
||||
CharStart = FALSE;
|
||||
for (i = 0; (i < (strlen (LineToken) + 1)) && !CharStart; i++)
|
||||
@ -236,6 +237,7 @@ CvProcessComment (
|
||||
LineToken [0] = ' '; /* Pad for Formatting */
|
||||
}
|
||||
}
|
||||
|
||||
FinalLineToken = UtStringCacheCalloc (strlen (LineToken) + 1);
|
||||
strcat (FinalLineToken, LineToken);
|
||||
|
||||
@ -245,32 +247,36 @@ CvProcessComment (
|
||||
{
|
||||
FinalLineToken[strlen(FinalLineToken) - 1] = 0;
|
||||
}
|
||||
|
||||
CvAddToCommentList (FinalLineToken);
|
||||
LineToken = strtok (NULL,"\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If this only spans a single line, check to see whether if this comment
|
||||
* appears on the same line as a line of code. If does, retain it's
|
||||
* position for stylistic reasons. If it doesn't, add it to the comment
|
||||
* List so that it can be associated with the next node that's created.
|
||||
* If this only spans a single line, check to see whether if this
|
||||
* comment appears on the same line as a line of code. If does,
|
||||
* retain it's position for stylistic reasons. If it doesn't,
|
||||
* add it to the comment list so that it can be associated with
|
||||
* the next node that's created.
|
||||
*/
|
||||
else
|
||||
{
|
||||
/*
|
||||
* if this is not a regular comment, pad with extra spaces that appeared
|
||||
* in the original source input to retain the original spacing.
|
||||
* If this is not a regular comment, pad with extra spaces that
|
||||
* appeared in the original source input to retain the original
|
||||
* spacing.
|
||||
*/
|
||||
FinalCommentString =
|
||||
UtStringCacheCalloc (strlen (CommentString) +
|
||||
CurrentState.SpacesBefore + 1);
|
||||
|
||||
for (i=0; (CurrentState.CommentType != ASL_COMMENT_STANDARD) &&
|
||||
(i < CurrentState.SpacesBefore); ++i)
|
||||
for (i = 0; (CurrentState.CommentType != ASL_COMMENT_STANDARD) &&
|
||||
(i < CurrentState.SpacesBefore); i++)
|
||||
{
|
||||
FinalCommentString[i] = ' ';
|
||||
}
|
||||
|
||||
strcat (FinalCommentString, CommentString);
|
||||
CvPlaceComment (CurrentState.CommentType, FinalCommentString);
|
||||
}
|
||||
@ -310,10 +316,10 @@ CvProcessCommentType2 (
|
||||
CommentString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
|
||||
strcpy (CommentString, MsgBuffer);
|
||||
|
||||
/* If this comment lies on the same line as the latest parse node,
|
||||
* assign it to that node's CommentAfter field. Saving in this field
|
||||
* will allow us to support comments that come after code on the same
|
||||
* line as the code itself. For example,
|
||||
/* If this comment lies on the same line as the latest parse op,
|
||||
* assign it to that op's CommentAfter field. Saving in this field
|
||||
* will allow us to support comments that come after code on the
|
||||
* same line as the code itself. For example,
|
||||
* Name(A,"") //comment
|
||||
*
|
||||
* will be retained rather than transformed into
|
||||
@ -330,7 +336,8 @@ CvProcessCommentType2 (
|
||||
* Create a new string with the approperiate spaces. Since we need
|
||||
* to account for the proper spacing, the actual comment,
|
||||
* extra 2 spaces so that this comment can be converted to the "/ *"
|
||||
* style and the null terminator, the string would look something like
|
||||
* style and the null terminator, the string would look something
|
||||
* like:
|
||||
*
|
||||
* [ (spaces) (comment) ( * /) ('\0') ]
|
||||
*
|
||||
@ -338,23 +345,27 @@ CvProcessCommentType2 (
|
||||
FinalCommentString = UtStringCacheCalloc (CurrentState.SpacesBefore +
|
||||
strlen (CommentString) + 3 + 1);
|
||||
|
||||
for (i=0; (CurrentState.CommentType!=1) && (i<CurrentState.SpacesBefore); ++i)
|
||||
for (i = 0; (CurrentState.CommentType != 1) &&
|
||||
(i < CurrentState.SpacesBefore); i++)
|
||||
{
|
||||
FinalCommentString[i] = ' ';
|
||||
}
|
||||
|
||||
strcat (FinalCommentString, CommentString);
|
||||
|
||||
/* convert to a "/ *" style comment */
|
||||
|
||||
strcat (FinalCommentString, " */");
|
||||
FinalCommentString [CurrentState.SpacesBefore + strlen (CommentString) + 3] = 0;
|
||||
FinalCommentString [CurrentState.SpacesBefore +
|
||||
strlen (CommentString) + 3] = 0;
|
||||
|
||||
/* get rid of the carriage return */
|
||||
|
||||
if (FinalCommentString[strlen (FinalCommentString) - 1] == 0x0D)
|
||||
{
|
||||
FinalCommentString[strlen(FinalCommentString)-1] = 0;
|
||||
FinalCommentString[strlen(FinalCommentString) - 1] = 0;
|
||||
}
|
||||
|
||||
CvPlaceComment (CurrentState.CommentType, FinalCommentString);
|
||||
}
|
||||
}
|
||||
@ -366,9 +377,9 @@ CvProcessCommentType2 (
|
||||
*
|
||||
* PARAMETERS: Op - Calculate all comments of this Op
|
||||
*
|
||||
* RETURN: TotalCommentLength - Length of all comments within this node.
|
||||
* RETURN: TotalCommentLength - Length of all comments within this op.
|
||||
*
|
||||
* DESCRIPTION: calculate the length that the each comment takes up within Op.
|
||||
* DESCRIPTION: Calculate the length that the each comment takes up within Op.
|
||||
* Comments look like the follwoing: [0xA9 OptionBtye comment 0x00]
|
||||
* therefore, we add 1 + 1 + strlen (comment) + 1 to get the actual
|
||||
* length of this comment.
|
||||
@ -389,7 +400,9 @@ CvCalculateCommentLengths(
|
||||
return (0);
|
||||
}
|
||||
|
||||
CvDbgPrint ("==Calculating comment lengths for %s\n", Op->Asl.ParseOpName);
|
||||
CvDbgPrint ("==Calculating comment lengths for %s\n",
|
||||
Op->Asl.ParseOpName);
|
||||
|
||||
if (Op->Asl.FileChanged)
|
||||
{
|
||||
TotalCommentLength += strlen (Op->Asl.Filename) + 3;
|
||||
@ -400,6 +413,7 @@ CvCalculateCommentLengths(
|
||||
TotalCommentLength += strlen (Op->Asl.ParentFilename) + 3;
|
||||
}
|
||||
}
|
||||
|
||||
if (Op->Asl.CommentList)
|
||||
{
|
||||
Current = Op->Asl.CommentList;
|
||||
@ -412,6 +426,7 @@ CvCalculateCommentLengths(
|
||||
Current = Current->Next;
|
||||
}
|
||||
}
|
||||
|
||||
if (Op->Asl.EndBlkComment)
|
||||
{
|
||||
Current = Op->Asl.EndBlkComment;
|
||||
@ -424,6 +439,7 @@ CvCalculateCommentLengths(
|
||||
Current = Current->Next;
|
||||
}
|
||||
}
|
||||
|
||||
if (Op->Asl.InlineComment)
|
||||
{
|
||||
CommentLength = strlen (Op->Asl.InlineComment)+3;
|
||||
@ -431,6 +447,7 @@ CvCalculateCommentLengths(
|
||||
CvDbgPrint (" Comment string: %s\n\n", Op->Asl.InlineComment);
|
||||
TotalCommentLength += CommentLength;
|
||||
}
|
||||
|
||||
if (Op->Asl.EndNodeComment)
|
||||
{
|
||||
CommentLength = strlen(Op->Asl.EndNodeComment)+3;
|
||||
@ -448,9 +465,7 @@ CvCalculateCommentLengths(
|
||||
}
|
||||
|
||||
CvDbgPrint("\n\n");
|
||||
|
||||
return TotalCommentLength;
|
||||
|
||||
return (TotalCommentLength);
|
||||
}
|
||||
|
||||
|
||||
@ -490,7 +505,7 @@ CgWriteAmlDefBlockComment(
|
||||
|
||||
CvDbgPrint ("Printing comments for a definition block..\n");
|
||||
|
||||
/* first, print the file name comment after changing .asl to .dsl */
|
||||
/* First, print the file name comment after changing .asl to .dsl */
|
||||
|
||||
NewFilename = UtStringCacheCalloc (strlen (Op->Asl.Filename));
|
||||
strcpy (NewFilename, Op->Asl.Filename);
|
||||
@ -518,15 +533,17 @@ CgWriteAmlDefBlockComment(
|
||||
|
||||
Current = Op->Asl.CommentList;
|
||||
CommentOption = STD_DEFBLK_COMMENT;
|
||||
|
||||
while (Current)
|
||||
{
|
||||
CgWriteOneAmlComment(Op, Current->Comment, CommentOption);
|
||||
CvDbgPrint ("Printing comment: %s\n", Current->Comment);
|
||||
Current = Current->Next;
|
||||
}
|
||||
|
||||
Op->Asl.CommentList = NULL;
|
||||
|
||||
/* print any Inline comments associated with this node */
|
||||
/* Print any Inline comments associated with this node */
|
||||
|
||||
if (Op->Asl.CloseBraceComment)
|
||||
{
|
||||
@ -557,8 +574,8 @@ CgWriteOneAmlComment(
|
||||
char* CommentToPrint,
|
||||
UINT8 InputOption)
|
||||
{
|
||||
UINT8 CommentOption = InputOption;
|
||||
UINT8 CommentOpcode = (UINT8)AML_COMMENT_OP;
|
||||
UINT8 CommentOption = InputOption;
|
||||
UINT8 CommentOpcode = (UINT8) AML_COMMENT_OP;
|
||||
|
||||
|
||||
if (!CommentToPrint)
|
||||
@ -583,8 +600,7 @@ CgWriteOneAmlComment(
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: write all comments pertaining to the
|
||||
* current parse op
|
||||
* DESCRIPTION: Write all comments pertaining to the current parse op
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -609,7 +625,7 @@ CgWriteAmlComment(
|
||||
if (Op->Asl.FileChanged)
|
||||
{
|
||||
|
||||
/* first, print the file name comment after changing .asl to .dsl */
|
||||
/* First, print the file name comment after changing .asl to .dsl */
|
||||
|
||||
NewFilename =
|
||||
FlGenerateFilename (Op->Asl.Filename, FILE_SUFFIX_DISASSEMBLY);
|
||||
@ -629,7 +645,7 @@ CgWriteAmlComment(
|
||||
CgWriteOneAmlComment(Op, ParentFilename, PARENTFILENAME_COMMENT);
|
||||
}
|
||||
|
||||
/* prevent multiple writes of the same comment */
|
||||
/* Prevent multiple writes of the same comment */
|
||||
|
||||
Op->Asl.FileChanged = FALSE;
|
||||
}
|
||||
@ -654,6 +670,7 @@ CgWriteAmlComment(
|
||||
CgWriteOneAmlComment(Op, Current->Comment, CommentOption);
|
||||
Current = Current->Next;
|
||||
}
|
||||
|
||||
Op->Asl.CommentList = NULL;
|
||||
|
||||
Current = Op->Asl.EndBlkComment;
|
||||
@ -663,9 +680,10 @@ CgWriteAmlComment(
|
||||
CgWriteOneAmlComment(Op, Current->Comment, CommentOption);
|
||||
Current = Current->Next;
|
||||
}
|
||||
|
||||
Op->Asl.EndBlkComment = NULL;
|
||||
|
||||
/* print any Inline comments associated with this node */
|
||||
/* Print any Inline comments associated with this node */
|
||||
|
||||
if (Op->Asl.InlineComment)
|
||||
{
|
||||
@ -694,7 +712,7 @@ CgWriteAmlComment(
|
||||
*
|
||||
* FUNCTION: CvCommentNodeCalloc
|
||||
*
|
||||
* PARAMETERS: none
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Pointer to the comment node. Aborts on allocation failure
|
||||
*
|
||||
@ -733,6 +751,7 @@ UINT32
|
||||
CvParseOpBlockType (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
return (BLOCK_NONE);
|
||||
@ -740,8 +759,7 @@ CvParseOpBlockType (
|
||||
|
||||
switch (Op->Asl.ParseOpcode)
|
||||
{
|
||||
|
||||
/* from aslprimaries.y */
|
||||
/* From aslprimaries.y */
|
||||
|
||||
case PARSEOP_VAR_PACKAGE:
|
||||
case PARSEOP_BANKFIELD:
|
||||
@ -763,7 +781,7 @@ CvParseOpBlockType (
|
||||
case PARSEOP_THERMALZONE:
|
||||
case PARSEOP_WHILE:
|
||||
|
||||
/* from aslresources.y */
|
||||
/* From aslresources.y */
|
||||
|
||||
case PARSEOP_RESOURCETEMPLATE: /* optional parens */
|
||||
case PARSEOP_VENDORLONG:
|
||||
@ -775,13 +793,12 @@ CvParseOpBlockType (
|
||||
case PARSEOP_GPIO_IO:
|
||||
case PARSEOP_DMA:
|
||||
|
||||
/*from aslrules.y */
|
||||
/* From aslrules.y */
|
||||
|
||||
case PARSEOP_DEFINITION_BLOCK:
|
||||
return (BLOCK_PAREN | BLOCK_BRACE);
|
||||
|
||||
default:
|
||||
|
||||
return (BLOCK_NONE);
|
||||
}
|
||||
}
|
||||
@ -791,7 +808,7 @@ CvParseOpBlockType (
|
||||
*
|
||||
* FUNCTION: CvProcessCommentState
|
||||
*
|
||||
* PARAMETERS: char
|
||||
* PARAMETERS: Input - Input character
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -803,15 +820,15 @@ CvParseOpBlockType (
|
||||
|
||||
void
|
||||
CvProcessCommentState (
|
||||
char input)
|
||||
char Input)
|
||||
{
|
||||
|
||||
if (input != ' ')
|
||||
if (Input != ' ')
|
||||
{
|
||||
Gbl_CommentState.SpacesBefore = 0;
|
||||
}
|
||||
|
||||
switch (input)
|
||||
switch (Input)
|
||||
{
|
||||
case '\n':
|
||||
|
||||
@ -856,7 +873,6 @@ CvProcessCommentState (
|
||||
|
||||
Gbl_CommentState.CommentType = ASLCOMMENT_INLINE;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -865,7 +881,7 @@ CvProcessCommentState (
|
||||
*
|
||||
* FUNCTION: CvAddToCommentList
|
||||
*
|
||||
* PARAMETERS: toAdd - Contains the comment to be inserted
|
||||
* PARAMETERS: ToAdd - Contains the comment to be inserted
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -876,24 +892,24 @@ CvProcessCommentState (
|
||||
|
||||
void
|
||||
CvAddToCommentList (
|
||||
char* ToAdd)
|
||||
char *ToAdd)
|
||||
{
|
||||
if (Gbl_Comment_List_Head)
|
||||
|
||||
if (Gbl_CommentListHead)
|
||||
{
|
||||
Gbl_Comment_List_Tail->Next = CvCommentNodeCalloc ();
|
||||
Gbl_Comment_List_Tail = Gbl_Comment_List_Tail->Next;
|
||||
Gbl_CommentListTail->Next = CvCommentNodeCalloc ();
|
||||
Gbl_CommentListTail = Gbl_CommentListTail->Next;
|
||||
}
|
||||
else
|
||||
{
|
||||
Gbl_Comment_List_Head = CvCommentNodeCalloc ();
|
||||
Gbl_Comment_List_Tail = Gbl_Comment_List_Head;
|
||||
Gbl_CommentListHead = CvCommentNodeCalloc ();
|
||||
Gbl_CommentListTail = Gbl_CommentListHead;
|
||||
}
|
||||
|
||||
Gbl_Comment_List_Tail->Comment = ToAdd;
|
||||
|
||||
return;
|
||||
Gbl_CommentListTail->Comment = ToAdd;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: CvAppendInlineComment
|
||||
@ -907,7 +923,7 @@ CvAddToCommentList (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char*
|
||||
char *
|
||||
CvAppendInlineComment (
|
||||
char *InlineComment,
|
||||
char *ToAdd)
|
||||
@ -918,21 +934,22 @@ CvAppendInlineComment (
|
||||
|
||||
if (!InlineComment)
|
||||
{
|
||||
return ToAdd;
|
||||
return (ToAdd);
|
||||
}
|
||||
|
||||
if (!ToAdd)
|
||||
{
|
||||
return InlineComment;
|
||||
return (InlineComment);
|
||||
}
|
||||
|
||||
Size = strlen (ToAdd);
|
||||
Size += strlen (InlineComment);
|
||||
Str = UtStringCacheCalloc (Size+1);
|
||||
Str = UtStringCacheCalloc (Size + 1);
|
||||
|
||||
strcpy (Str, InlineComment);
|
||||
strcat (Str, ToAdd);
|
||||
Str[Size+1] = 0;
|
||||
|
||||
return Str;
|
||||
Str[Size +1] = 0;
|
||||
return (Str);
|
||||
}
|
||||
|
||||
|
||||
@ -940,8 +957,8 @@ CvAppendInlineComment (
|
||||
*
|
||||
* FUNCTION: CvPlaceComment
|
||||
*
|
||||
* PARAMETERS: Int - Type
|
||||
* char* - CommentString
|
||||
* PARAMETERS: UINT8 - Type
|
||||
* char * - CommentString
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -959,7 +976,7 @@ CvPlaceComment(
|
||||
ACPI_PARSE_OBJECT *ParenBraceNode;
|
||||
|
||||
|
||||
LatestParseNode = Gbl_CommentState.Latest_Parse_Node;
|
||||
LatestParseNode = Gbl_CommentState.LatestParseOp;
|
||||
ParenBraceNode = Gbl_CommentState.ParsingParenBraceNode;
|
||||
CvDbgPrint ("Placing comment %s for type %d\n", CommentString, Type);
|
||||
|
||||
@ -979,8 +996,8 @@ CvPlaceComment(
|
||||
|
||||
case ASL_COMMENT_OPEN_PAREN:
|
||||
|
||||
Gbl_Inline_Comment_Buffer =
|
||||
CvAppendInlineComment(Gbl_Inline_Comment_Buffer,
|
||||
Gbl_InlineCommentBuffer =
|
||||
CvAppendInlineComment(Gbl_InlineCommentBuffer,
|
||||
CommentString);
|
||||
break;
|
||||
|
||||
@ -1008,6 +1025,5 @@ CvPlaceComment(
|
||||
default:
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -156,6 +156,8 @@
|
||||
#include <contrib/dev/acpica/include/acconvert.h>
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
CvPrintInclude(
|
||||
ACPI_FILE_NODE *FNode,
|
||||
@ -198,6 +200,7 @@ CvPrintOneCommentList (
|
||||
AcpiOsPrintf("%s\n", Current->Comment);
|
||||
Current->Comment = NULL;
|
||||
}
|
||||
|
||||
Current = Current->Next;
|
||||
AcpiOsReleaseObject(AcpiGbl_RegCommentCache, Previous);
|
||||
}
|
||||
@ -208,7 +211,7 @@ CvPrintOneCommentList (
|
||||
*
|
||||
* FUNCTION: CvListIsSingleton
|
||||
*
|
||||
* PARAMETERS: CommentList -- check to see if this is a single item list.
|
||||
* PARAMETERS: CommentList - check to see if this is a single item list.
|
||||
*
|
||||
* RETURN: BOOLEAN
|
||||
*
|
||||
@ -221,16 +224,17 @@ CvListIsSingleton (
|
||||
ACPI_COMMENT_NODE *CommentList)
|
||||
|
||||
{
|
||||
|
||||
if (!CommentList)
|
||||
{
|
||||
return FALSE;
|
||||
return (FALSE);
|
||||
}
|
||||
else if (CommentList->Next)
|
||||
{
|
||||
return FALSE;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
@ -275,6 +279,7 @@ CvPrintOneCommentType (
|
||||
{
|
||||
CvPrintOneCommentList (Op->Common.CommentList, Level);
|
||||
}
|
||||
|
||||
Op->Common.CommentList = NULL;
|
||||
return;
|
||||
|
||||
@ -333,7 +338,7 @@ CvPrintOneCommentType (
|
||||
* PARAMETERS: Op
|
||||
* Level
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print a close brace } and any open brace comments associated
|
||||
* with this parse object.
|
||||
@ -346,6 +351,7 @@ CvCloseBraceWriteComment(
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level)
|
||||
{
|
||||
|
||||
if (!Gbl_CaptureComments)
|
||||
{
|
||||
AcpiOsPrintf ("}");
|
||||
@ -365,7 +371,7 @@ CvCloseBraceWriteComment(
|
||||
* PARAMETERS: Op
|
||||
* Level
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print a closing paren ) and any end node comments associated
|
||||
* with this parse object.
|
||||
@ -378,6 +384,7 @@ CvCloseParenWriteComment(
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level)
|
||||
{
|
||||
|
||||
if (!Gbl_CaptureComments)
|
||||
{
|
||||
AcpiOsPrintf (")");
|
||||
@ -427,13 +434,15 @@ BOOLEAN
|
||||
CvFileHasSwitched(
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
if (Op->Common.CvFilename &&
|
||||
AcpiGbl_CurrentFilename &&
|
||||
AcpiUtStricmp(Op->Common.CvFilename, AcpiGbl_CurrentFilename))
|
||||
{
|
||||
return TRUE;
|
||||
return (TRUE);
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
@ -459,17 +468,21 @@ CvPrintInclude(
|
||||
ACPI_FILE_NODE *FNode,
|
||||
UINT32 Level)
|
||||
{
|
||||
|
||||
if (!FNode || FNode->IncludeWritten)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CvDbgPrint ("Writing include for %s within %s\n", FNode->Filename, FNode->Parent->Filename);
|
||||
CvDbgPrint ("Writing include for %s within %s\n",
|
||||
FNode->Filename, FNode->Parent->Filename);
|
||||
AcpiOsRedirectOutput (FNode->Parent->File);
|
||||
CvPrintOneCommentList (FNode->IncludeComment, Level);
|
||||
|
||||
AcpiDmIndent (Level);
|
||||
AcpiOsPrintf ("Include (\"%s\")\n", FNode->Filename);
|
||||
CvDbgPrint ("emitted the following: Include (\"%s\")\n", FNode->Filename);
|
||||
CvDbgPrint ("emitted the following: Include (\"%s\")\n",
|
||||
FNode->Filename);
|
||||
FNode->IncludeWritten = TRUE;
|
||||
}
|
||||
|
||||
@ -478,7 +491,7 @@ CvPrintInclude(
|
||||
*
|
||||
* FUNCTION: CvSwitchFiles
|
||||
*
|
||||
* PARAMETERS: Level - indentation level
|
||||
* PARAMETERS: Level - indentation level
|
||||
* Op
|
||||
*
|
||||
* RETURN: None
|
||||
@ -498,7 +511,9 @@ CvSwitchFiles(
|
||||
ACPI_FILE_NODE *FNode;
|
||||
ACPI_FILE_NODE *Current;
|
||||
|
||||
CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename, Filename);
|
||||
|
||||
CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename,
|
||||
Filename);
|
||||
FNode = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot);
|
||||
if (!FNode)
|
||||
{
|
||||
@ -507,10 +522,13 @@ CvSwitchFiles(
|
||||
* if it does not exist, then abort.
|
||||
*/
|
||||
FlDeleteFile (ASL_FILE_AML_OUTPUT);
|
||||
sprintf (MsgBuffer, "\"Cannot find %s\" - %s", Filename, strerror (errno));
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer);
|
||||
sprintf (MsgBuffer, "\"Cannot find %s\" - %s",
|
||||
Filename, strerror (errno));
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0,
|
||||
NULL, MsgBuffer);
|
||||
AslAbort ();
|
||||
}
|
||||
|
||||
Current = FNode;
|
||||
|
||||
/*
|
||||
|
@ -204,23 +204,24 @@ CvIsFilename (
|
||||
char *Filename)
|
||||
{
|
||||
UINT64 Length = strlen(Filename);
|
||||
UINT64 i;
|
||||
char *FileExt = Filename + Length - 4;
|
||||
UINT64 i;
|
||||
|
||||
|
||||
if ((Length > 4) && AcpiUtStricmp (FileExt, ".dsl"))
|
||||
{
|
||||
return FALSE;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
for(i = 0; i<Length; ++i)
|
||||
{
|
||||
if (!isprint ((int) Filename[i]))
|
||||
{
|
||||
return FALSE;
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
@ -232,7 +233,7 @@ CvIsFilename (
|
||||
* AmlStart - Address of the starting point of the AML.
|
||||
* AmlLength - Length of the AML file.
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Initialize the file dependency tree by scanning the AML.
|
||||
* This is referred as ASL_CV_INIT_FILETREE.
|
||||
@ -263,6 +264,7 @@ CvInitFileTree (
|
||||
CvDbgPrint ("AmlEnd?: %p\n", AmlStart+AmlLength);
|
||||
|
||||
AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
|
||||
|
||||
AcpiGbl_FileTreeRoot->FileStart = (char *)(AmlStart);
|
||||
AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + Table->Length);
|
||||
AcpiGbl_FileTreeRoot->Next = NULL;
|
||||
@ -293,25 +295,27 @@ CvInitFileTree (
|
||||
* raw data that doesn't outline a filename.
|
||||
*/
|
||||
if ((*TreeAml == AML_COMMENT_OP) &&
|
||||
(*(TreeAml+1) == FILENAME_COMMENT) &&
|
||||
(CvIsFilename ((char *)(TreeAml+2))))
|
||||
(*(TreeAml +1) == FILENAME_COMMENT) &&
|
||||
(CvIsFilename ((char *)(TreeAml +2))))
|
||||
{
|
||||
CvDbgPrint ("A9 and a 08 file\n");
|
||||
PreviousFilename = Filename;
|
||||
Filename = (char *) (TreeAml+2);
|
||||
Filename = (char *) (TreeAml +2);
|
||||
|
||||
CvAddToFileTree (Filename, PreviousFilename);
|
||||
ChildFilename = Filename;
|
||||
CvDbgPrint ("%s\n", Filename);
|
||||
}
|
||||
else if ((*TreeAml == AML_COMMENT_OP) &&
|
||||
(*(TreeAml+1) == PARENTFILENAME_COMMENT) &&
|
||||
(CvIsFilename ((char *)(TreeAml+2))))
|
||||
(*(TreeAml +1) == PARENTFILENAME_COMMENT) &&
|
||||
(CvIsFilename ((char *)(TreeAml +2))))
|
||||
{
|
||||
CvDbgPrint ("A9 and a 09 file\n");
|
||||
ParentFilename = (char *)(TreeAml+2);
|
||||
ParentFilename = (char *)(TreeAml +2);
|
||||
CvSetFileParent (ChildFilename, ParentFilename);
|
||||
CvDbgPrint ("%s\n", ParentFilename);
|
||||
}
|
||||
|
||||
++TreeAml;
|
||||
}
|
||||
}
|
||||
@ -323,7 +327,7 @@ CvInitFileTree (
|
||||
*
|
||||
* PARAMETERS: Op -- clear all comments within this Op
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Clear all converter-related fields of the given Op.
|
||||
* This is referred as ASL_CV_CLEAR_OP_COMMENTS.
|
||||
@ -334,6 +338,7 @@ void
|
||||
CvClearOpComments (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
Op->Common.InlineComment = NULL;
|
||||
Op->Common.EndNodeComment = NULL;
|
||||
Op->Common.NameComment = NULL;
|
||||
@ -349,12 +354,12 @@ CvClearOpComments (
|
||||
*
|
||||
* FUNCTION: CvCommentExists
|
||||
*
|
||||
* PARAMETERS: address - check if this address appears in the list
|
||||
* PARAMETERS: Address - check if this address appears in the list
|
||||
*
|
||||
* RETURN: BOOLEAN - TRUE if the address exists.
|
||||
*
|
||||
* DESCRIPTION: look at the pointer address and check if this appears in the
|
||||
* list of all addresses. If it exitsts in the list, return TRUE
|
||||
* DESCRIPTION: Look at the pointer address and check if this appears in the
|
||||
* list of all addresses. If it exists in the list, return TRUE
|
||||
* if it exists. Otherwise add to the list and return FALSE.
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -371,13 +376,15 @@ CvCommentExists (
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
Option = *(Address + 1);
|
||||
|
||||
/*
|
||||
* FILENAME_COMMENT and PARENTFILENAME_COMMENT are not treated as comments.
|
||||
* They serve as markers for where the file starts and ends.
|
||||
* FILENAME_COMMENT and PARENTFILENAME_COMMENT are not treated as
|
||||
* comments. They serve as markers for where the file starts and ends.
|
||||
*/
|
||||
if ((Option == FILENAME_COMMENT) || (Option == PARENTFILENAME_COMMENT))
|
||||
if ((Option == FILENAME_COMMENT) ||
|
||||
(Option == PARENTFILENAME_COMMENT))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
@ -405,13 +412,14 @@ CvCommentExists (
|
||||
}
|
||||
|
||||
/*
|
||||
* If the execution gets to this point, it means that this address
|
||||
* does not exists in the list. Add this address to the
|
||||
* If the execution gets to this point, it means that this
|
||||
* address does not exists in the list. Add this address to the
|
||||
* beginning of the list.
|
||||
*/
|
||||
Current = AcpiGbl_CommentAddrListHead;
|
||||
AcpiGbl_CommentAddrListHead =
|
||||
AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
|
||||
|
||||
AcpiGbl_CommentAddrListHead->Addr = Address;
|
||||
AcpiGbl_CommentAddrListHead->Next = Current;
|
||||
return (FALSE);
|
||||
@ -451,6 +459,7 @@ CvFilenameExists(
|
||||
{
|
||||
return (Current);
|
||||
}
|
||||
|
||||
Current = Current->Next;
|
||||
}
|
||||
return (NULL);
|
||||
@ -464,7 +473,7 @@ CvFilenameExists(
|
||||
* PARAMETERS: Address - address to look up
|
||||
* Head - file dependency tree
|
||||
*
|
||||
* RETURN: ACPI_FLE_NODE - pointer to a file node containing the address
|
||||
* RETURN: ACPI_FILE_NODE - pointer to a file node containing the address
|
||||
*
|
||||
* DESCRIPTION: Look for the given address in the file dependency tree.
|
||||
* Returns the first file node where the given address is within
|
||||
@ -472,7 +481,7 @@ CvFilenameExists(
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_FILE_NODE*
|
||||
static ACPI_FILE_NODE *
|
||||
CvFileAddressLookup(
|
||||
char *Address,
|
||||
ACPI_FILE_NODE *Head)
|
||||
@ -488,6 +497,7 @@ CvFileAddressLookup(
|
||||
{
|
||||
return (Current);
|
||||
}
|
||||
|
||||
Current = Current->Next;
|
||||
}
|
||||
|
||||
@ -522,7 +532,8 @@ CvLabelFileNode(
|
||||
return;
|
||||
}
|
||||
|
||||
Node = CvFileAddressLookup ((char *)Op->Common.Aml, AcpiGbl_FileTreeRoot);
|
||||
Node = CvFileAddressLookup ((char *)
|
||||
Op->Common.Aml, AcpiGbl_FileTreeRoot);
|
||||
if (!Node)
|
||||
{
|
||||
return;
|
||||
@ -549,7 +560,7 @@ CvLabelFileNode(
|
||||
* PreviousFilename - Address containing the name of the previous
|
||||
* filename
|
||||
*
|
||||
* RETURN: void
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Add this filename to the AcpiGbl_FileTree if it does not exist.
|
||||
*
|
||||
@ -586,9 +597,9 @@ CvAddToFileTree (
|
||||
if (Node && PreviousFilename)
|
||||
{
|
||||
/*
|
||||
* Update the end of the previous file and all of their parents' ending
|
||||
* Addresses. This is done to ensure that parent file ranges extend to
|
||||
* the end of their childrens' files.
|
||||
* Update the end of the previous file and all of their parents'
|
||||
* ending addresses. This is done to ensure that parent file
|
||||
* ranges extend to the end of their childrens' files.
|
||||
*/
|
||||
Node = CvFilenameExists (PreviousFilename, AcpiGbl_FileTreeRoot);
|
||||
if (Node && (Node->FileEnd < Filename))
|
||||
@ -601,6 +612,7 @@ CvAddToFileTree (
|
||||
{
|
||||
Node->FileEnd = Filename;
|
||||
}
|
||||
|
||||
Node = Node->Parent;
|
||||
}
|
||||
}
|
||||
@ -609,6 +621,7 @@ CvAddToFileTree (
|
||||
{
|
||||
Node = AcpiGbl_FileTreeRoot;
|
||||
AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
|
||||
|
||||
AcpiGbl_FileTreeRoot->Next = Node;
|
||||
AcpiGbl_FileTreeRoot->Parent = NULL;
|
||||
AcpiGbl_FileTreeRoot->Filename = Filename;
|
||||
@ -626,7 +639,8 @@ CvAddToFileTree (
|
||||
|
||||
FlDeleteFile (ASL_FILE_AML_OUTPUT);
|
||||
sprintf (MsgBuffer, "\"%s\" - %s", Filename, strerror (errno));
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer);
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0,
|
||||
NULL, MsgBuffer);
|
||||
AslAbort ();
|
||||
}
|
||||
}
|
||||
@ -640,9 +654,9 @@ CvAddToFileTree (
|
||||
* PARAMETERS: ChildFile - contains the filename of the child file
|
||||
* ParentFile - contains the filename of the parent file.
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: point the parent pointer of the Child to the node that
|
||||
* DESCRIPTION: Point the parent pointer of the Child to the node that
|
||||
* corresponds with the parent file node.
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -658,6 +672,7 @@ CvSetFileParent (
|
||||
|
||||
Child = CvFilenameExists (ChildFile, AcpiGbl_FileTreeRoot);
|
||||
Parent = CvFilenameExists (ParentFile, AcpiGbl_FileTreeRoot);
|
||||
|
||||
if (Child && Parent)
|
||||
{
|
||||
Child->Parent = Parent;
|
||||
@ -668,6 +683,7 @@ CvSetFileParent (
|
||||
{
|
||||
Child->Parent->FileEnd = Child->FileStart;
|
||||
}
|
||||
|
||||
Child = Child->Parent;
|
||||
}
|
||||
}
|
||||
@ -680,9 +696,9 @@ CvSetFileParent (
|
||||
*
|
||||
* PARAMETERS: ParserState - A parser state object
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: look at the aml that the parser state is pointing to,
|
||||
* DESCRIPTION: Look at the aml that the parser state is pointing to,
|
||||
* capture any AML_COMMENT_OP and it's arguments and increment the
|
||||
* aml pointer past the comment. Comments are transferred to parse
|
||||
* nodes through CvTransferComments() as well as
|
||||
@ -720,13 +736,15 @@ CvCaptureCommentsOnly (
|
||||
}
|
||||
else
|
||||
{
|
||||
CommentOption = *(Aml+1);
|
||||
|
||||
/* Increment past the comment option and point the approperiate char pointers.*/
|
||||
CommentOption = *(Aml +1);
|
||||
|
||||
/*
|
||||
* Increment past the comment option and point the
|
||||
* appropriate char pointers
|
||||
*/
|
||||
Aml += 2;
|
||||
|
||||
/* found a comment. Now, set pointers to these comments. */
|
||||
/* Found a comment. Now, set pointers to these comments. */
|
||||
|
||||
switch (CommentOption)
|
||||
{
|
||||
@ -734,9 +752,12 @@ CvCaptureCommentsOnly (
|
||||
|
||||
StdDefBlockFlag = TRUE;
|
||||
|
||||
/* add to a linked list of nodes. This list will be taken by the parse node created next. */
|
||||
|
||||
CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
|
||||
/*
|
||||
* Add to a linked list of nodes. This list will be
|
||||
* taken by the parse node created next.
|
||||
*/
|
||||
CommentNode = AcpiOsAcquireObject (
|
||||
AcpiGbl_RegCommentCache);
|
||||
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
|
||||
CommentNode->Next = NULL;
|
||||
|
||||
@ -748,7 +769,8 @@ CvCaptureCommentsOnly (
|
||||
else
|
||||
{
|
||||
AcpiGbl_DefBlkCommentListTail->Next = CommentNode;
|
||||
AcpiGbl_DefBlkCommentListTail = AcpiGbl_DefBlkCommentListTail->Next;
|
||||
AcpiGbl_DefBlkCommentListTail =
|
||||
AcpiGbl_DefBlkCommentListTail->Next;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -756,9 +778,12 @@ CvCaptureCommentsOnly (
|
||||
|
||||
CvDbgPrint ("found regular comment.\n");
|
||||
|
||||
/* add to a linked list of nodes. This list will be taken by the parse node created next. */
|
||||
|
||||
CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
|
||||
/*
|
||||
* Add to a linked list of nodes. This list will be
|
||||
* taken by the parse node created next.
|
||||
*/
|
||||
CommentNode = AcpiOsAcquireObject (
|
||||
AcpiGbl_RegCommentCache);
|
||||
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
|
||||
CommentNode->Next = NULL;
|
||||
|
||||
@ -770,7 +795,8 @@ CvCaptureCommentsOnly (
|
||||
else
|
||||
{
|
||||
AcpiGbl_RegCommentListTail->Next = CommentNode;
|
||||
AcpiGbl_RegCommentListTail = AcpiGbl_RegCommentListTail->Next;
|
||||
AcpiGbl_RegCommentListTail =
|
||||
AcpiGbl_RegCommentListTail->Next;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -778,9 +804,11 @@ CvCaptureCommentsOnly (
|
||||
|
||||
CvDbgPrint ("found endblk comment.\n");
|
||||
|
||||
/* add to a linked list of nodes. This will be taken by the next created parse node. */
|
||||
|
||||
CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
|
||||
/* Add to a linked list of nodes. This will be
|
||||
* taken by the next created parse node.
|
||||
*/
|
||||
CommentNode = AcpiOsAcquireObject (
|
||||
AcpiGbl_RegCommentCache);
|
||||
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
|
||||
CommentNode->Next = NULL;
|
||||
|
||||
@ -792,38 +820,46 @@ CvCaptureCommentsOnly (
|
||||
else
|
||||
{
|
||||
AcpiGbl_EndBlkCommentListTail->Next = CommentNode;
|
||||
AcpiGbl_EndBlkCommentListTail = AcpiGbl_EndBlkCommentListTail->Next;
|
||||
AcpiGbl_EndBlkCommentListTail =
|
||||
AcpiGbl_EndBlkCommentListTail->Next;
|
||||
}
|
||||
break;
|
||||
|
||||
case INLINE_COMMENT:
|
||||
|
||||
CvDbgPrint ("found inline comment.\n");
|
||||
AcpiGbl_CurrentInlineComment = ACPI_CAST_PTR (char, Aml);
|
||||
AcpiGbl_CurrentInlineComment =
|
||||
ACPI_CAST_PTR (char, Aml);
|
||||
break;
|
||||
|
||||
case ENDNODE_COMMENT:
|
||||
|
||||
CvDbgPrint ("found EndNode comment.\n");
|
||||
AcpiGbl_CurrentEndNodeComment = ACPI_CAST_PTR (char, Aml);
|
||||
AcpiGbl_CurrentEndNodeComment =
|
||||
ACPI_CAST_PTR (char, Aml);
|
||||
break;
|
||||
|
||||
case CLOSE_BRACE_COMMENT:
|
||||
|
||||
CvDbgPrint ("found close brace comment.\n");
|
||||
AcpiGbl_CurrentCloseBraceComment = ACPI_CAST_PTR (char, Aml);
|
||||
AcpiGbl_CurrentCloseBraceComment =
|
||||
ACPI_CAST_PTR (char, Aml);
|
||||
break;
|
||||
|
||||
case END_DEFBLK_COMMENT:
|
||||
|
||||
CvDbgPrint ("Found comment that belongs after the } for a definition block.\n");
|
||||
AcpiGbl_CurrentScope->Common.CloseBraceComment = ACPI_CAST_PTR (char, Aml);
|
||||
CvDbgPrint ("Found comment that belongs after"
|
||||
" the } for a definition block.\n");
|
||||
AcpiGbl_CurrentScope->Common.CloseBraceComment =
|
||||
ACPI_CAST_PTR (char, Aml);
|
||||
break;
|
||||
|
||||
case FILENAME_COMMENT:
|
||||
|
||||
CvDbgPrint ("Found a filename: %s\n", ACPI_CAST_PTR (char, Aml));
|
||||
FileNode = CvFilenameExists (ACPI_CAST_PTR (char, Aml), AcpiGbl_FileTreeRoot);
|
||||
CvDbgPrint ("Found a filename: %s\n",
|
||||
ACPI_CAST_PTR (char, Aml));
|
||||
FileNode = CvFilenameExists (
|
||||
ACPI_CAST_PTR (char, Aml), AcpiGbl_FileTreeRoot);
|
||||
|
||||
/*
|
||||
* If there is an INCLUDE_COMMENT followed by a
|
||||
@ -851,7 +887,8 @@ CvCaptureCommentsOnly (
|
||||
* parse node created next. See the FILENAME_COMMENT case
|
||||
* for more details
|
||||
*/
|
||||
CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
|
||||
CommentNode = AcpiOsAcquireObject (
|
||||
AcpiGbl_RegCommentCache);
|
||||
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
|
||||
CommentNode->Next = NULL;
|
||||
|
||||
@ -863,10 +900,12 @@ CvCaptureCommentsOnly (
|
||||
else
|
||||
{
|
||||
AcpiGbl_IncCommentListTail->Next = CommentNode;
|
||||
AcpiGbl_IncCommentListTail = AcpiGbl_IncCommentListTail->Next;
|
||||
AcpiGbl_IncCommentListTail =
|
||||
AcpiGbl_IncCommentListTail->Next;
|
||||
}
|
||||
|
||||
CvDbgPrint ("Found a include comment: %s\n", CommentNode->Comment);
|
||||
CvDbgPrint ("Found a include comment: %s\n",
|
||||
CommentNode->Comment);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -875,13 +914,12 @@ CvCaptureCommentsOnly (
|
||||
|
||||
Aml -= 2;
|
||||
goto DefBlock;
|
||||
break;
|
||||
|
||||
} /* end switch statement */
|
||||
} /* End switch statement */
|
||||
|
||||
} /* end else */
|
||||
} /* End else */
|
||||
|
||||
/* determine the length and move forward that amount */
|
||||
/* Determine the length and move forward that amount */
|
||||
|
||||
Length = 0;
|
||||
while (ParserState->Aml[Length])
|
||||
@ -891,12 +929,10 @@ CvCaptureCommentsOnly (
|
||||
|
||||
ParserState->Aml += Length + 1;
|
||||
|
||||
|
||||
/* Peek at the next Opcode. */
|
||||
|
||||
Aml = ParserState->Aml;
|
||||
Opcode = (UINT16) ACPI_GET8 (Aml);
|
||||
|
||||
}
|
||||
|
||||
DefBlock:
|
||||
@ -921,7 +957,7 @@ DefBlock:
|
||||
*
|
||||
* PARAMETERS: ParserState - A parser state object
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Wrapper function for CvCaptureCommentsOnly
|
||||
* This is referred as ASL_CV_CAPTURE_COMMENTS.
|
||||
@ -943,8 +979,8 @@ CvCaptureComments (
|
||||
}
|
||||
|
||||
/*
|
||||
* Before parsing, check to see that comments that come directly after
|
||||
* deferred opcodes aren't being processed.
|
||||
* Before parsing, check to see that comments that come directly
|
||||
* after deferred opcodes aren't being processed.
|
||||
*/
|
||||
Aml = WalkState->ParserState.Aml;
|
||||
Opcode = (UINT16) ACPI_GET8 (Aml);
|
||||
@ -965,9 +1001,9 @@ CvCaptureComments (
|
||||
*
|
||||
* FUNCTION: CvTransferComments
|
||||
*
|
||||
* PARAMETERS: Op - Transfer comments to this Op
|
||||
* PARAMETERS: Op - Transfer comments to this Op
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Transfer all of the commments stored in global containers to the
|
||||
* given Op. This will be invoked shortly after the parser creates
|
||||
@ -980,6 +1016,7 @@ void
|
||||
CvTransferComments (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
Op->Common.InlineComment = AcpiGbl_CurrentInlineComment;
|
||||
AcpiGbl_CurrentInlineComment = NULL;
|
||||
|
||||
@ -996,5 +1033,4 @@ CvTransferComments (
|
||||
Op->Common.EndBlkComment = AcpiGbl_EndBlkCommentListHead;
|
||||
AcpiGbl_EndBlkCommentListHead = NULL;
|
||||
AcpiGbl_EndBlkCommentListTail = NULL;
|
||||
|
||||
}
|
||||
|
@ -486,18 +486,21 @@ DtCompileDataTable (
|
||||
}
|
||||
else if (TableData->TableInfo)
|
||||
{
|
||||
/* Simple table, just walk the info table */
|
||||
/* Simple table, just walk the info table, unless its empty */
|
||||
|
||||
Subtable = NULL;
|
||||
Status = DtCompileTable (FieldList, TableData->TableInfo,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (FieldList && *FieldList)
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
Subtable = NULL;
|
||||
Status = DtCompileTable (FieldList, TableData->TableInfo,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
DtInsertSubtable (Gbl_RootTable, Subtable);
|
||||
DtPopSubtable ();
|
||||
DtInsertSubtable (Gbl_RootTable, Subtable);
|
||||
DtPopSubtable ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -726,6 +726,7 @@ extern const unsigned char TemplateRasf[];
|
||||
extern const unsigned char TemplateRsdt[];
|
||||
extern const unsigned char TemplateS3pt[];
|
||||
extern const unsigned char TemplateSbst[];
|
||||
extern const unsigned char TemplateSdei[];
|
||||
extern const unsigned char TemplateSlic[];
|
||||
extern const unsigned char TemplateSlit[];
|
||||
extern const unsigned char TemplateSpcr[];
|
||||
|
@ -1178,6 +1178,15 @@ const unsigned char TemplateSbst[] =
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSdei[] =
|
||||
{
|
||||
0x53,0x44,0x45,0x49,0x3e,0x00,0x00,0x00, /* 00000000 "SDEI>..." */
|
||||
0x01,0x59,0x41,0x52,0x4d,0x20,0x20,0x20, /* 00000008 ".mARM " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x30,0x09,0x16,0x20 /* 00000028 "0.. " */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSlic[] =
|
||||
{
|
||||
0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00, /* 00000000 "SLICv..." */
|
||||
|
@ -190,7 +190,7 @@ DtError (
|
||||
|
||||
/* Check if user wants to ignore this exception */
|
||||
|
||||
if (AslIsExceptionDisabled (Level, MessageId))
|
||||
if (AslIsExceptionIgnored (Level, MessageId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ PrAddMacro (
|
||||
{
|
||||
/* Search the macro arg list for matching arg */
|
||||
|
||||
for (i = 0; Args[i].Name && (i < PR_MAX_MACRO_ARGS); i++)
|
||||
for (i = 0; ((i < PR_MAX_MACRO_ARGS) && Args[i].Name); i++)
|
||||
{
|
||||
/*
|
||||
* Save argument offset within macro body. This is the mechanism
|
||||
|
@ -451,7 +451,7 @@ DumpNode:
|
||||
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("Object (%p) Pathname: %s\n",
|
||||
AcpiOsPrintf ("Object %p: Namespace Node - Pathname: %s\n",
|
||||
Node, (char *) RetBuf.Pointer);
|
||||
}
|
||||
|
||||
@ -468,7 +468,7 @@ DumpNode:
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (ObjDesc)
|
||||
{
|
||||
AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
|
||||
AcpiOsPrintf ("\nAttached Object %p:", ObjDesc);
|
||||
if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
|
||||
@ -476,8 +476,33 @@ DumpNode:
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiUtDebugDumpBuffer ((void *) ObjDesc,
|
||||
sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (
|
||||
((ACPI_NAMESPACE_NODE *) ObjDesc)) == ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
AcpiOsPrintf (" Namespace Node - ");
|
||||
Status = AcpiGetName ((ACPI_NAMESPACE_NODE *) ObjDesc,
|
||||
ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Could not convert name to pathname\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("Pathname: %s",
|
||||
(char *) RetBuf.Pointer);
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
AcpiUtDebugDumpBuffer ((void *) ObjDesc,
|
||||
sizeof (ACPI_NAMESPACE_NODE), Display, ACPI_UINT32_MAX);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
AcpiUtDebugDumpBuffer ((void *) ObjDesc,
|
||||
sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
|
||||
}
|
||||
|
||||
AcpiExDumpObjectDescriptor (ObjDesc, 1);
|
||||
}
|
||||
}
|
||||
|
@ -528,25 +528,30 @@ AcpiDmFieldPredefinedDescription (
|
||||
/* Major cheat: We previously put the Tag ptr in the Node field */
|
||||
|
||||
Tag = ACPI_CAST_PTR (char, IndexOp->Common.Node);
|
||||
if (!Tag)
|
||||
if (!Tag || (*Tag == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Match the name in the info table */
|
||||
/* Is the tag a predefined name? */
|
||||
|
||||
Info = AcpiAhMatchPredefinedName (Tag);
|
||||
if (Info)
|
||||
if (!Info)
|
||||
{
|
||||
AcpiOsPrintf (" // %4.4s: %s", Tag,
|
||||
ACPI_CAST_PTR (char, Info->Description));
|
||||
/* Not a predefined name (does not start with underscore) */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* AML buffer (String) was allocated in AcpiGetTagPathname */
|
||||
AcpiOsPrintf (" // %4.4s: %s", Tag,
|
||||
ACPI_CAST_PTR (char, Info->Description));
|
||||
|
||||
/* String contains the prefix path, free it */
|
||||
|
||||
ACPI_FREE (IndexOp->Common.Value.String);
|
||||
|
||||
IndexOp->Common.Value.String = NULL;
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -313,6 +313,8 @@ AcpiDsCreateBufferField (
|
||||
|
||||
if (!(WalkState->ParseFlags & ACPI_PARSE_EXECUTE))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Parse execute mode is not set"));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
@ -701,6 +703,8 @@ AcpiDsInitFieldObjects (
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Parse deferred mode is not set"));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -160,14 +160,6 @@
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dsobject")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsBuildInternalObject (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_OPERAND_OBJECT **ObjDescPtr);
|
||||
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
/*******************************************************************************
|
||||
@ -185,7 +177,7 @@ AcpiDsBuildInternalObject (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
ACPI_STATUS
|
||||
AcpiDsBuildInternalObject (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
@ -193,7 +185,6 @@ AcpiDsBuildInternalObject (
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
|
||||
@ -204,129 +195,43 @@ AcpiDsBuildInternalObject (
|
||||
{
|
||||
/*
|
||||
* This is a named object reference. If this name was
|
||||
* previously looked up in the namespace, it was stored in this op.
|
||||
* Otherwise, go ahead and look it up now
|
||||
* previously looked up in the namespace, it was stored in
|
||||
* this op. Otherwise, go ahead and look it up now
|
||||
*/
|
||||
if (!Op->Common.Node)
|
||||
{
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo,
|
||||
Op->Common.Value.String,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
|
||||
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
|
||||
if (ACPI_FAILURE (Status))
|
||||
/* Check if we are resolving a named reference within a package */
|
||||
|
||||
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
|
||||
{
|
||||
/* Check if we are resolving a named reference within a package */
|
||||
|
||||
if ((Status == AE_NOT_FOUND) && (AcpiGbl_EnableInterpreterSlack) &&
|
||||
|
||||
((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)))
|
||||
{
|
||||
/*
|
||||
* We didn't find the target and we are populating elements
|
||||
* of a package - ignore if slack enabled. Some ASL code
|
||||
* contains dangling invalid references in packages and
|
||||
* expects that no exception will be issued. Leave the
|
||||
* element as a null element. It cannot be used, but it
|
||||
* can be overwritten by subsequent ASL code - this is
|
||||
* typically the case.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Ignoring unresolved reference in package [%4.4s]\n",
|
||||
WalkState->ScopeInfo->Scope.Node->Name.Ascii));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
else
|
||||
/*
|
||||
* We won't resolve package elements here, we will do this
|
||||
* after all ACPI tables are loaded into the namespace. This
|
||||
* behavior supports both forward references to named objects
|
||||
* and external references to objects in other tables.
|
||||
*/
|
||||
goto CreateNewObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo,
|
||||
Op->Common.Value.String,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
|
||||
ACPI_CAST_INDIRECT_PTR (
|
||||
ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/* Special object resolution for elements of a package */
|
||||
|
||||
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
|
||||
{
|
||||
/*
|
||||
* Attempt to resolve the node to a value before we insert it into
|
||||
* the package. If this is a reference to a common data type,
|
||||
* resolve it immediately. According to the ACPI spec, package
|
||||
* elements can only be "data objects" or method references.
|
||||
* Attempt to resolve to an Integer, Buffer, String or Package.
|
||||
* If cannot, return the named reference (for things like Devices,
|
||||
* Methods, etc.) Buffer Fields and Fields will resolve to simple
|
||||
* objects (int/buf/str/pkg).
|
||||
*
|
||||
* NOTE: References to things like Devices, Methods, Mutexes, etc.
|
||||
* will remain as named references. This behavior is not described
|
||||
* in the ACPI spec, but it appears to be an oversight.
|
||||
*/
|
||||
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Op->Common.Node);
|
||||
|
||||
Status = AcpiExResolveNodeToValue (
|
||||
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
|
||||
WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Special handling for Alias objects. We need to setup the type
|
||||
* and the Op->Common.Node to point to the Alias target. Note,
|
||||
* Alias has at most one level of indirection internally.
|
||||
*/
|
||||
Type = Op->Common.Node->Type;
|
||||
if (Type == ACPI_TYPE_LOCAL_ALIAS)
|
||||
{
|
||||
Type = ObjDesc->Common.Type;
|
||||
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
Op->Common.Node->Object);
|
||||
}
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
/*
|
||||
* For these types, we need the actual node, not the subobject.
|
||||
* However, the subobject did not get an extra reference count above.
|
||||
*
|
||||
* TBD: should ExResolveNodeToValue be changed to fix this?
|
||||
*/
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
AcpiUtAddReference (Op->Common.Node->Object);
|
||||
|
||||
/*lint -fallthrough */
|
||||
/*
|
||||
* For these types, we need the actual node, not the subobject.
|
||||
* The subobject got an extra reference count in ExResolveNodeToValue.
|
||||
*/
|
||||
case ACPI_TYPE_MUTEX:
|
||||
case ACPI_TYPE_METHOD:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_EVENT:
|
||||
case ACPI_TYPE_REGION:
|
||||
|
||||
/* We will create a reference object for these types below */
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* All other types - the node was resolved to an actual
|
||||
* object, we are done.
|
||||
*/
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CreateNewObject:
|
||||
|
||||
/* Create and init a new internal ACPI object */
|
||||
|
||||
ObjDesc = AcpiUtCreateInternalObject (
|
||||
@ -344,7 +249,28 @@ AcpiDsBuildInternalObject (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Exit:
|
||||
/*
|
||||
* Handling for unresolved package reference elements.
|
||||
* These are elements that are namepaths.
|
||||
*/
|
||||
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
|
||||
{
|
||||
ObjDesc->Reference.Resolved = TRUE;
|
||||
|
||||
if ((Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
|
||||
!ObjDesc->Reference.Node)
|
||||
{
|
||||
/*
|
||||
* Name was unresolved above.
|
||||
* Get the prefix node for later lookup
|
||||
*/
|
||||
ObjDesc->Reference.Node = WalkState->ScopeInfo->Scope.Node;
|
||||
ObjDesc->Reference.Aml = Op->Common.Aml;
|
||||
ObjDesc->Reference.Resolved = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
*ObjDescPtr = ObjDesc;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
@ -466,209 +392,6 @@ AcpiDsBuildInternalBufferObj (
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsBuildInternalPackageObj
|
||||
*
|
||||
* PARAMETERS: WalkState - Current walk state
|
||||
* Op - Parser object to be translated
|
||||
* ElementCount - Number of elements in the package - this is
|
||||
* the NumElements argument to Package()
|
||||
* ObjDescPtr - Where the ACPI internal object is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Translate a parser Op package object to the equivalent
|
||||
* namespace object
|
||||
*
|
||||
* NOTE: The number of elements in the package will be always be the NumElements
|
||||
* count, regardless of the number of elements in the package list. If
|
||||
* NumElements is smaller, only that many package list elements are used.
|
||||
* if NumElements is larger, the Package object is padded out with
|
||||
* objects of type Uninitialized (as per ACPI spec.)
|
||||
*
|
||||
* Even though the ASL compilers do not allow NumElements to be smaller
|
||||
* than the Package list length (for the fixed length package opcode), some
|
||||
* BIOS code modifies the AML on the fly to adjust the NumElements, and
|
||||
* this code compensates for that. This also provides compatibility with
|
||||
* other AML interpreters.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsBuildInternalPackageObj (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 ElementCount,
|
||||
ACPI_OPERAND_OBJECT **ObjDescPtr)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Arg;
|
||||
ACPI_PARSE_OBJECT *Parent;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc = NULL;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT32 i;
|
||||
UINT16 Index;
|
||||
UINT16 ReferenceCount;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
|
||||
|
||||
|
||||
/* Find the parent of a possibly nested package */
|
||||
|
||||
Parent = Op->Common.Parent;
|
||||
while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
|
||||
(Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
|
||||
{
|
||||
Parent = Parent->Common.Parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are evaluating a Named package object "Name (xxxx, Package)",
|
||||
* the package object already exists, otherwise it must be created.
|
||||
*/
|
||||
ObjDesc = *ObjDescPtr;
|
||||
if (!ObjDesc)
|
||||
{
|
||||
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
|
||||
*ObjDescPtr = ObjDesc;
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ObjDesc->Package.Node = Parent->Common.Node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate the element array (array of pointers to the individual
|
||||
* objects) based on the NumElements parameter. Add an extra pointer slot
|
||||
* so that the list is always null terminated.
|
||||
*/
|
||||
ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
|
||||
((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
|
||||
|
||||
if (!ObjDesc->Package.Elements)
|
||||
{
|
||||
AcpiUtDeleteObjectDesc (ObjDesc);
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ObjDesc->Package.Count = ElementCount;
|
||||
|
||||
/*
|
||||
* Initialize the elements of the package, up to the NumElements count.
|
||||
* Package is automatically padded with uninitialized (NULL) elements
|
||||
* if NumElements is greater than the package list length. Likewise,
|
||||
* Package is truncated if NumElements is less than the list length.
|
||||
*/
|
||||
Arg = Op->Common.Value.Arg;
|
||||
Arg = Arg->Common.Next;
|
||||
for (i = 0; Arg && (i < ElementCount); i++)
|
||||
{
|
||||
if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
|
||||
{
|
||||
if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
/*
|
||||
* A method reference "looks" to the parser to be a method
|
||||
* invocation, so we special case it here
|
||||
*/
|
||||
Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
|
||||
Status = AcpiDsBuildInternalObject (
|
||||
WalkState, Arg, &ObjDesc->Package.Elements[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This package element is already built, just get it */
|
||||
|
||||
ObjDesc->Package.Elements[i] =
|
||||
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiDsBuildInternalObject (
|
||||
WalkState, Arg, &ObjDesc->Package.Elements[i]);
|
||||
}
|
||||
|
||||
if (*ObjDescPtr)
|
||||
{
|
||||
/* Existing package, get existing reference count */
|
||||
|
||||
ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
|
||||
if (ReferenceCount > 1)
|
||||
{
|
||||
/* Make new element ref count match original ref count */
|
||||
|
||||
for (Index = 0; Index < (ReferenceCount - 1); Index++)
|
||||
{
|
||||
AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Arg = Arg->Common.Next;
|
||||
}
|
||||
|
||||
/* Check for match between NumElements and actual length of PackageList */
|
||||
|
||||
if (Arg)
|
||||
{
|
||||
/*
|
||||
* NumElements was exhausted, but there are remaining elements in the
|
||||
* PackageList. Truncate the package to NumElements.
|
||||
*
|
||||
* Note: technically, this is an error, from ACPI spec: "It is an error
|
||||
* for NumElements to be less than the number of elements in the
|
||||
* PackageList". However, we just print a message and
|
||||
* no exception is returned. This provides Windows compatibility. Some
|
||||
* BIOSs will alter the NumElements on the fly, creating this type
|
||||
* of ill-formed package object.
|
||||
*/
|
||||
while (Arg)
|
||||
{
|
||||
/*
|
||||
* We must delete any package elements that were created earlier
|
||||
* and are not going to be used because of the package truncation.
|
||||
*/
|
||||
if (Arg->Common.Node)
|
||||
{
|
||||
AcpiUtRemoveReference (
|
||||
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
|
||||
Arg->Common.Node = NULL;
|
||||
}
|
||||
|
||||
/* Find out how many elements there really are */
|
||||
|
||||
i++;
|
||||
Arg = Arg->Common.Next;
|
||||
}
|
||||
|
||||
ACPI_INFO ((
|
||||
"Actual Package length (%u) is larger than "
|
||||
"NumElements field (%u), truncated",
|
||||
i, ElementCount));
|
||||
}
|
||||
else if (i < ElementCount)
|
||||
{
|
||||
/*
|
||||
* Arg list (elements) was exhausted, but we did not reach NumElements count.
|
||||
* Note: this is not an error, the package is padded out with NULLs.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Package List length (%u) smaller than NumElements "
|
||||
"count (%u), padded with null elements\n",
|
||||
i, ElementCount));
|
||||
}
|
||||
|
||||
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
|
||||
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsCreateNode
|
||||
@ -796,10 +519,20 @@ AcpiDsInitObjectFromOp (
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
/*
|
||||
* Defer evaluation of Package TermArg operand
|
||||
* Defer evaluation of Package TermArg operand and all
|
||||
* package elements. (01/2017): We defer the element
|
||||
* resolution to allow forward references from the package
|
||||
* in order to provide compatibility with other ACPI
|
||||
* implementations.
|
||||
*/
|
||||
ObjDesc->Package.Node = ACPI_CAST_PTR (
|
||||
ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
|
||||
|
||||
if (!Op->Named.Data)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ObjDesc->Package.AmlStart = Op->Named.Data;
|
||||
ObjDesc->Package.AmlLength = Op->Named.Length;
|
||||
break;
|
||||
@ -940,8 +673,11 @@ AcpiDsInitObjectFromOp (
|
||||
/* Node was saved in Op */
|
||||
|
||||
ObjDesc->Reference.Node = Op->Common.Node;
|
||||
ObjDesc->Reference.Object = Op->Common.Node->Object;
|
||||
ObjDesc->Reference.Class = ACPI_REFCLASS_NAME;
|
||||
if (Op->Common.Node)
|
||||
{
|
||||
ObjDesc->Reference.Object = Op->Common.Node->Object;
|
||||
}
|
||||
break;
|
||||
|
||||
case AML_DEBUG_OP:
|
||||
|
@ -747,6 +747,16 @@ AcpiDsEvalDataObjectOperands (
|
||||
*/
|
||||
WalkState->OperandIndex = WalkState->NumOperands;
|
||||
|
||||
/* Ignore if child is not valid */
|
||||
|
||||
if (!Op->Common.Value.Arg)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Dispatch: Missing child while executing TermArg for %X",
|
||||
Op->Common.AmlOpcode));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
Status = AcpiDsCreateOperand (WalkState, Op->Common.Value.Arg, 1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
635
sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
Normal file
635
sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
Normal file
@ -0,0 +1,635 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dspkginit - Completion of deferred package initialization
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* following license:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <contrib/dev/acpica/include/acpi.h>
|
||||
#include <contrib/dev/acpica/include/accommon.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
#include <contrib/dev/acpica/include/amlcode.h>
|
||||
#include <contrib/dev/acpica/include/acdispat.h>
|
||||
#include <contrib/dev/acpica/include/acinterp.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME ("dspkginit")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiDsResolvePackageElement (
|
||||
ACPI_OPERAND_OBJECT **Element);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsBuildInternalPackageObj
|
||||
*
|
||||
* PARAMETERS: WalkState - Current walk state
|
||||
* Op - Parser object to be translated
|
||||
* ElementCount - Number of elements in the package - this is
|
||||
* the NumElements argument to Package()
|
||||
* ObjDescPtr - Where the ACPI internal object is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Translate a parser Op package object to the equivalent
|
||||
* namespace object
|
||||
*
|
||||
* NOTE: The number of elements in the package will be always be the NumElements
|
||||
* count, regardless of the number of elements in the package list. If
|
||||
* NumElements is smaller, only that many package list elements are used.
|
||||
* if NumElements is larger, the Package object is padded out with
|
||||
* objects of type Uninitialized (as per ACPI spec.)
|
||||
*
|
||||
* Even though the ASL compilers do not allow NumElements to be smaller
|
||||
* than the Package list length (for the fixed length package opcode), some
|
||||
* BIOS code modifies the AML on the fly to adjust the NumElements, and
|
||||
* this code compensates for that. This also provides compatibility with
|
||||
* other AML interpreters.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsBuildInternalPackageObj (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 ElementCount,
|
||||
ACPI_OPERAND_OBJECT **ObjDescPtr)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Arg;
|
||||
ACPI_PARSE_OBJECT *Parent;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc = NULL;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT16 ReferenceCount;
|
||||
UINT32 Index;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
|
||||
|
||||
|
||||
/* Find the parent of a possibly nested package */
|
||||
|
||||
Parent = Op->Common.Parent;
|
||||
while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
|
||||
(Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
|
||||
{
|
||||
Parent = Parent->Common.Parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are evaluating a Named package object of the form:
|
||||
* Name (xxxx, Package)
|
||||
* the package object already exists, otherwise it must be created.
|
||||
*/
|
||||
ObjDesc = *ObjDescPtr;
|
||||
if (!ObjDesc)
|
||||
{
|
||||
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
|
||||
*ObjDescPtr = ObjDesc;
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ObjDesc->Package.Node = Parent->Common.Node;
|
||||
}
|
||||
|
||||
if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID) /* Just in case */
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate the element array (array of pointers to the individual
|
||||
* objects) based on the NumElements parameter. Add an extra pointer slot
|
||||
* so that the list is always null terminated.
|
||||
*/
|
||||
ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
|
||||
((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
|
||||
|
||||
if (!ObjDesc->Package.Elements)
|
||||
{
|
||||
AcpiUtDeleteObjectDesc (ObjDesc);
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ObjDesc->Package.Count = ElementCount;
|
||||
Arg = Op->Common.Value.Arg;
|
||||
Arg = Arg->Common.Next;
|
||||
|
||||
if (Arg)
|
||||
{
|
||||
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the elements of the package, up to the NumElements count.
|
||||
* Package is automatically padded with uninitialized (NULL) elements
|
||||
* if NumElements is greater than the package list length. Likewise,
|
||||
* Package is truncated if NumElements is less than the list length.
|
||||
*/
|
||||
for (i = 0; Arg && (i < ElementCount); i++)
|
||||
{
|
||||
if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
|
||||
{
|
||||
if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
/*
|
||||
* A method reference "looks" to the parser to be a method
|
||||
* invocation, so we special case it here
|
||||
*/
|
||||
Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
|
||||
Status = AcpiDsBuildInternalObject (
|
||||
WalkState, Arg, &ObjDesc->Package.Elements[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This package element is already built, just get it */
|
||||
|
||||
ObjDesc->Package.Elements[i] =
|
||||
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiDsBuildInternalObject (
|
||||
WalkState, Arg, &ObjDesc->Package.Elements[i]);
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found"));
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize this package element. This function handles the
|
||||
* resolution of named references within the package.
|
||||
*/
|
||||
AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
|
||||
NULL, &ObjDesc->Package.Elements[i]);
|
||||
}
|
||||
|
||||
if (*ObjDescPtr)
|
||||
{
|
||||
/* Existing package, get existing reference count */
|
||||
|
||||
ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
|
||||
if (ReferenceCount > 1)
|
||||
{
|
||||
/* Make new element ref count match original ref count */
|
||||
/* TBD: Probably need an AcpiUtAddReferences function */
|
||||
|
||||
for (Index = 0; Index < ((UINT32) ReferenceCount - 1); Index++)
|
||||
{
|
||||
AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Arg = Arg->Common.Next;
|
||||
}
|
||||
|
||||
/* Check for match between NumElements and actual length of PackageList */
|
||||
|
||||
if (Arg)
|
||||
{
|
||||
/*
|
||||
* NumElements was exhausted, but there are remaining elements in
|
||||
* the PackageList. Truncate the package to NumElements.
|
||||
*
|
||||
* Note: technically, this is an error, from ACPI spec: "It is an
|
||||
* error for NumElements to be less than the number of elements in
|
||||
* the PackageList". However, we just print a message and no
|
||||
* exception is returned. This provides compatibility with other
|
||||
* ACPI implementations. Some firmware implementations will alter
|
||||
* the NumElements on the fly, possibly creating this type of
|
||||
* ill-formed package object.
|
||||
*/
|
||||
while (Arg)
|
||||
{
|
||||
/*
|
||||
* We must delete any package elements that were created earlier
|
||||
* and are not going to be used because of the package truncation.
|
||||
*/
|
||||
if (Arg->Common.Node)
|
||||
{
|
||||
AcpiUtRemoveReference (
|
||||
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
|
||||
Arg->Common.Node = NULL;
|
||||
}
|
||||
|
||||
/* Find out how many elements there really are */
|
||||
|
||||
i++;
|
||||
Arg = Arg->Common.Next;
|
||||
}
|
||||
|
||||
ACPI_INFO ((
|
||||
"Actual Package length (%u) is larger than "
|
||||
"NumElements field (%u), truncated",
|
||||
i, ElementCount));
|
||||
}
|
||||
else if (i < ElementCount)
|
||||
{
|
||||
/*
|
||||
* Arg list (elements) was exhausted, but we did not reach
|
||||
* NumElements count.
|
||||
*
|
||||
* Note: this is not an error, the package is padded out
|
||||
* with NULLs.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Package List length (%u) smaller than NumElements "
|
||||
"count (%u), padded with null elements\n",
|
||||
i, ElementCount));
|
||||
}
|
||||
|
||||
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
|
||||
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsInitPackageElement
|
||||
*
|
||||
* PARAMETERS: ACPI_PKG_CALLBACK
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Resolve a named reference element within a package object
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsInitPackageElement (
|
||||
UINT8 ObjectType,
|
||||
ACPI_OPERAND_OBJECT *SourceObject,
|
||||
ACPI_GENERIC_STATE *State,
|
||||
void *Context)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT **ElementPtr;
|
||||
|
||||
|
||||
if (!SourceObject)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* The following code is a bit of a hack to workaround a (current)
|
||||
* limitation of the ACPI_PKG_CALLBACK interface. We need a pointer
|
||||
* to the location within the element array because a new object
|
||||
* may be created and stored there.
|
||||
*/
|
||||
if (Context)
|
||||
{
|
||||
/* A direct call was made to this function */
|
||||
|
||||
ElementPtr = (ACPI_OPERAND_OBJECT **) Context;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Call came from AcpiUtWalkPackageTree */
|
||||
|
||||
ElementPtr = State->Pkg.ThisTargetObj;
|
||||
}
|
||||
|
||||
/* We are only interested in reference objects/elements */
|
||||
|
||||
if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
|
||||
{
|
||||
/* Attempt to resolve the (named) reference to a namespace node */
|
||||
|
||||
AcpiDsResolvePackageElement (ElementPtr);
|
||||
}
|
||||
else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE)
|
||||
{
|
||||
SourceObject->Package.Flags |= AOPOBJ_DATA_VALID;
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsResolvePackageElement
|
||||
*
|
||||
* PARAMETERS: ElementPtr - Pointer to a reference object
|
||||
*
|
||||
* RETURN: Possible new element is stored to the indirect ElementPtr
|
||||
*
|
||||
* DESCRIPTION: Resolve a package element that is a reference to a named
|
||||
* object.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiDsResolvePackageElement (
|
||||
ACPI_OPERAND_OBJECT **ElementPtr)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_GENERIC_STATE ScopeInfo;
|
||||
ACPI_OPERAND_OBJECT *Element = *ElementPtr;
|
||||
ACPI_NAMESPACE_NODE *ResolvedNode;
|
||||
char *ExternalPath = NULL;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsResolvePackageElement);
|
||||
|
||||
|
||||
/* Check if reference element is already resolved */
|
||||
|
||||
if (Element->Reference.Resolved)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Element must be a reference object of correct type */
|
||||
|
||||
ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
|
||||
|
||||
Status = AcpiNsLookup (&ScopeInfo,
|
||||
(char *) Element->Reference.Aml, /* Pointer to AML path */
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
NULL, &ResolvedNode);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
|
||||
(char *) Element->Reference.Aml,
|
||||
NULL, &ExternalPath);
|
||||
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Could not find/resolve named package element: %s", ExternalPath));
|
||||
|
||||
ACPI_FREE (ExternalPath);
|
||||
*ElementPtr = NULL;
|
||||
return_VOID;
|
||||
}
|
||||
else if (ResolvedNode->Type == ACPI_TYPE_ANY)
|
||||
{
|
||||
/* Named reference not resolved, return a NULL package element */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Could not resolve named package element [%4.4s] in [%4.4s]",
|
||||
ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii));
|
||||
*ElementPtr = NULL;
|
||||
return_VOID;
|
||||
}
|
||||
#if 0
|
||||
else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
|
||||
{
|
||||
/*
|
||||
* A temporary node found here indicates that the reference is
|
||||
* to a node that was created within this method. We are not
|
||||
* going to allow it (especially if the package is returned
|
||||
* from the method) -- the temporary node will be deleted out
|
||||
* from under the method. (05/2017).
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Package element refers to a temporary name [%4.4s], "
|
||||
"inserting a NULL element",
|
||||
ResolvedNode->Name.Ascii));
|
||||
*ElementPtr = NULL;
|
||||
return_VOID;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Special handling for Alias objects. We need ResolvedNode to point
|
||||
* to the Alias target. This effectively "resolves" the alias.
|
||||
*/
|
||||
if (ResolvedNode->Type == ACPI_TYPE_LOCAL_ALIAS)
|
||||
{
|
||||
ResolvedNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
ResolvedNode->Object);
|
||||
}
|
||||
|
||||
/* Update the reference object */
|
||||
|
||||
Element->Reference.Resolved = TRUE;
|
||||
Element->Reference.Node = ResolvedNode;
|
||||
Type = Element->Reference.Node->Type;
|
||||
|
||||
/*
|
||||
* Attempt to resolve the node to a value before we insert it into
|
||||
* the package. If this is a reference to a common data type,
|
||||
* resolve it immediately. According to the ACPI spec, package
|
||||
* elements can only be "data objects" or method references.
|
||||
* Attempt to resolve to an Integer, Buffer, String or Package.
|
||||
* If cannot, return the named reference (for things like Devices,
|
||||
* Methods, etc.) Buffer Fields and Fields will resolve to simple
|
||||
* objects (int/buf/str/pkg).
|
||||
*
|
||||
* NOTE: References to things like Devices, Methods, Mutexes, etc.
|
||||
* will remain as named references. This behavior is not described
|
||||
* in the ACPI spec, but it appears to be an oversight.
|
||||
*/
|
||||
Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* TBD - alias support */
|
||||
/*
|
||||
* Special handling for Alias objects. We need to setup the type
|
||||
* and the Op->Common.Node to point to the Alias target. Note,
|
||||
* Alias has at most one level of indirection internally.
|
||||
*/
|
||||
Type = Op->Common.Node->Type;
|
||||
if (Type == ACPI_TYPE_LOCAL_ALIAS)
|
||||
{
|
||||
Type = ObjDesc->Common.Type;
|
||||
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
Op->Common.Node->Object);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
/*
|
||||
* These object types are a result of named references, so we will
|
||||
* leave them as reference objects. In other words, these types
|
||||
* have no intrinsic "value".
|
||||
*/
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
/* TBD: This may not be necesssary */
|
||||
|
||||
AcpiUtAddReference (ResolvedNode->Object);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_MUTEX:
|
||||
case ACPI_TYPE_METHOD:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_EVENT:
|
||||
case ACPI_TYPE_REGION:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* For all other types - the node was resolved to an actual
|
||||
* operand object with a value, return the object
|
||||
*/
|
||||
*ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode;
|
||||
break;
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
@ -203,65 +203,40 @@ AcpiExCreateAlias (
|
||||
TargetNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, TargetNode->Object);
|
||||
}
|
||||
|
||||
/*
|
||||
* For objects that can never change (i.e., the NS node will
|
||||
* permanently point to the same object), we can simply attach
|
||||
* the object to the new NS node. For other objects (such as
|
||||
* Integers, buffers, etc.), we have to point the Alias node
|
||||
* to the original Node.
|
||||
*/
|
||||
/* Ensure that the target node is valid */
|
||||
|
||||
if (!TargetNode)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NULL_OBJECT);
|
||||
}
|
||||
|
||||
/* Construct the alias object (a namespace node) */
|
||||
|
||||
switch (TargetNode->Type)
|
||||
{
|
||||
|
||||
/* For these types, the sub-object can change dynamically via a Store */
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
/*
|
||||
* These types open a new scope, so we need the NS node in order to access
|
||||
* any children.
|
||||
*/
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
case ACPI_TYPE_LOCAL_SCOPE:
|
||||
case ACPI_TYPE_METHOD:
|
||||
/*
|
||||
* Control method aliases need to be differentiated with
|
||||
* a special type
|
||||
*/
|
||||
AliasNode->Type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* All other object types.
|
||||
*
|
||||
* The new alias has the type ALIAS and points to the original
|
||||
* NS node, not the object itself.
|
||||
*/
|
||||
AliasNode->Type = ACPI_TYPE_LOCAL_ALIAS;
|
||||
AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
/*
|
||||
* Control method aliases need to be differentiated
|
||||
*/
|
||||
AliasNode->Type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
|
||||
AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Attach the original source object to the new Alias Node */
|
||||
|
||||
/*
|
||||
* The new alias assumes the type of the target, and it points
|
||||
* to the same object. The reference count of the object has an
|
||||
* additional reference to prevent deletion out from under either the
|
||||
* target node or the alias Node
|
||||
*/
|
||||
Status = AcpiNsAttachObject (AliasNode,
|
||||
AcpiNsGetAttachedObject (TargetNode), TargetNode->Type);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Since both operands are Nodes, we don't need to delete them */
|
||||
|
||||
AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Element Count"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},
|
||||
{ACPI_EXD_PACKAGE, 0, NULL}
|
||||
};
|
||||
@ -510,6 +510,11 @@ AcpiExDumpObject (
|
||||
|
||||
while (Count)
|
||||
{
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset);
|
||||
Name = Info->Name;
|
||||
|
||||
@ -522,7 +527,8 @@ AcpiExDumpObject (
|
||||
case ACPI_EXD_TYPE:
|
||||
|
||||
AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
|
||||
ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
|
||||
ObjDesc->Common.Type,
|
||||
AcpiUtGetObjectTypeName (ObjDesc));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_UINT8:
|
||||
@ -588,10 +594,10 @@ AcpiExDumpObject (
|
||||
Start = *ACPI_CAST_PTR (void *, Target);
|
||||
Next = Start;
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Next);
|
||||
AcpiOsPrintf ("%20s : %p ", Name, Next);
|
||||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiOsPrintf ("%s (Type %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
while (Next->Common.NextObject)
|
||||
@ -614,6 +620,10 @@ AcpiExDumpObject (
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("- No attached objects");
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
@ -1294,7 +1304,8 @@ AcpiExDumpPackageObj (
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type);
|
||||
AcpiOsPrintf ("[%s] Type: %2.2X\n",
|
||||
AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1338,10 +1349,19 @@ AcpiExDumpObjectDescriptor (
|
||||
{
|
||||
AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags);
|
||||
|
||||
AcpiOsPrintf ("\nAttached Object (%p):\n",
|
||||
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
|
||||
|
||||
ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\nAttached Object %p", ObjDesc);
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
AcpiOsPrintf (" - Namespace Node");
|
||||
}
|
||||
|
||||
AcpiOsPrintf (":\n");
|
||||
goto DumpObject;
|
||||
}
|
||||
|
||||
@ -1365,6 +1385,11 @@ AcpiExDumpObjectDescriptor (
|
||||
|
||||
DumpObject:
|
||||
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Common Fields */
|
||||
|
||||
AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
|
||||
|
@ -401,6 +401,8 @@ AcpiExDoLogicalNumericOp (
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid numeric logical opcode: %X", Opcode));
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@ -486,6 +488,9 @@ AcpiExDoLogicalOp (
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid object type for logical operator: %X",
|
||||
Operand0->Common.Type));
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@ -535,6 +540,8 @@ AcpiExDoLogicalOp (
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid comparison opcode: %X", Opcode));
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@ -613,6 +620,8 @@ AcpiExDoLogicalOp (
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid comparison opcode: %X", Opcode));
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
|
@ -556,6 +556,8 @@ AcpiExOpcode_2A_1T_1R (
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid object type: %X", (Operand[0])->Common.Type));
|
||||
Status = AE_AML_INTERNAL;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ AcpiHwGetAccessBitWidth (
|
||||
}
|
||||
else if (Reg->AccessWidth)
|
||||
{
|
||||
AccessBitWidth = (1 << (Reg->AccessWidth + 2));
|
||||
AccessBitWidth = ACPI_ACCESS_BIT_WIDTH (Reg->AccessWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -184,9 +184,18 @@ AcpiHwSleepDispatch (
|
||||
|
||||
static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
|
||||
{
|
||||
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep},
|
||||
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep},
|
||||
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake}
|
||||
{ACPI_STRUCT_INIT (legacy_function,
|
||||
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep)),
|
||||
ACPI_STRUCT_INIT (extended_function,
|
||||
AcpiHwExtendedSleep) },
|
||||
{ACPI_STRUCT_INIT (legacy_function,
|
||||
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)),
|
||||
ACPI_STRUCT_INIT (extended_function,
|
||||
AcpiHwExtendedWakePrep) },
|
||||
{ACPI_STRUCT_INIT (legacy_function,
|
||||
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)),
|
||||
ACPI_STRUCT_INIT (extended_function,
|
||||
AcpiHwExtendedWake) }
|
||||
};
|
||||
|
||||
|
||||
|
@ -410,6 +410,7 @@ AcpiNsLookup (
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *Path = Pathname;
|
||||
char *ExternalPath;
|
||||
ACPI_NAMESPACE_NODE *PrefixNode;
|
||||
ACPI_NAMESPACE_NODE *CurrentNode = NULL;
|
||||
ACPI_NAMESPACE_NODE *ThisNode = NULL;
|
||||
@ -556,11 +557,21 @@ AcpiNsLookup (
|
||||
ThisNode = ThisNode->Parent;
|
||||
if (!ThisNode)
|
||||
{
|
||||
/* Current scope has no parent scope */
|
||||
/*
|
||||
* Current scope has no parent scope. Externalize
|
||||
* the internal path for error message.
|
||||
*/
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Pathname,
|
||||
NULL, &ExternalPath);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"%s: Path has too many parent prefixes (^)",
|
||||
ExternalPath));
|
||||
|
||||
ACPI_FREE (ExternalPath);
|
||||
}
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"%s: Path has too many parent prefixes (^) "
|
||||
"- reached beyond root node", Pathname));
|
||||
return_ACPI_STATUS (AE_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
@ -764,6 +775,13 @@ AcpiNsLookup (
|
||||
ThisNode = (ACPI_NAMESPACE_NODE *) ThisNode->Object;
|
||||
}
|
||||
}
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
if (!AcpiGbl_DisasmFlag &&
|
||||
(ThisNode->Flags & ANOBJ_IS_EXTERNAL))
|
||||
{
|
||||
ThisNode->Flags |= IMPLICIT_EXTERNAL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Special handling for the last segment (NumSegments == 0) */
|
||||
|
@ -183,9 +183,14 @@ AcpiNsCheckArgumentTypes (
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* If not a predefined name, cannot typecheck args */
|
||||
|
||||
if (!Info->Predefined)
|
||||
/*
|
||||
* If not a predefined name, cannot typecheck args, because
|
||||
* we have no idea what argument types are expected.
|
||||
* Also, ignore typecheck if warnings/errors if this method
|
||||
* has already been evaluated at least once -- in order
|
||||
* to suppress repetitive messages.
|
||||
*/
|
||||
if (!Info->Predefined || (Info->Node->Flags & ANOBJ_EVALUATED))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -207,6 +212,10 @@ AcpiNsCheckArgumentTypes (
|
||||
"Found [%s], ACPI requires [%s]", (i + 1),
|
||||
AcpiUtGetTypeName (UserArgType),
|
||||
AcpiUtGetTypeName (ArgType)));
|
||||
|
||||
/* Prevent any additional typechecking for this method */
|
||||
|
||||
Info->Node->Flags |= ANOBJ_EVALUATED;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,7 +247,7 @@ AcpiNsCheckAcpiCompliance (
|
||||
UINT32 RequiredParamCount;
|
||||
|
||||
|
||||
if (!Predefined)
|
||||
if (!Predefined || (Node->Flags & ANOBJ_EVALUATED))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -332,6 +341,11 @@ AcpiNsCheckArgumentCount (
|
||||
UINT32 RequiredParamCount;
|
||||
|
||||
|
||||
if (Node->Flags & ANOBJ_EVALUATED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Predefined)
|
||||
{
|
||||
/*
|
||||
|
@ -535,6 +535,20 @@ AcpiNsInitOneObject (
|
||||
|
||||
Info->PackageInit++;
|
||||
Status = AcpiDsGetPackageArguments (ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Resolve all named references in package objects (and all
|
||||
* sub-packages). This action has been deferred until the entire
|
||||
* namespace has been loaded, in order to support external and
|
||||
* forward references from individual package elements (05/2017).
|
||||
*/
|
||||
Status = AcpiUtWalkPackageTree (ObjDesc, NULL,
|
||||
AcpiDsInitPackageElement, NULL);
|
||||
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -208,8 +208,15 @@ AcpiNsGetPathnameLength (
|
||||
ACPI_SIZE Size;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
/* Validate the Node */
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid/cached reference target node: %p, descriptor type %d",
|
||||
Node, ACPI_GET_DESCRIPTOR_TYPE (Node)));
|
||||
return (0);
|
||||
}
|
||||
|
||||
Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);
|
||||
return (Size);
|
||||
|
@ -722,6 +722,8 @@ AcpiNsCheckPackageList (
|
||||
|
||||
default: /* Should not get here, type was validated by caller */
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Invalid Package type: %X",
|
||||
Package->RetInfo.Type));
|
||||
return (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -282,6 +282,9 @@ AcpiPsGetArguments (
|
||||
INCREMENT_ARG_LIST (WalkState->ArgTypes);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Final argument count: %u pass %u\n",
|
||||
WalkState->ArgCount, WalkState->PassNumber));
|
||||
|
||||
/*
|
||||
* Handle executable code at "module-level". This refers to
|
||||
@ -380,6 +383,10 @@ AcpiPsGetArguments (
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_NAME_OP) &&
|
||||
(WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Setup Package/Buffer: Pass %u, AML Ptr: %p\n",
|
||||
WalkState->PassNumber, AmlOpStart));
|
||||
|
||||
/*
|
||||
* Skip parsing of Buffers and Packages because we don't have
|
||||
* enough info in the first pass to parse them correctly.
|
||||
@ -689,6 +696,9 @@ AcpiPsParseLoop (
|
||||
|
||||
/* Check for arguments that need to be processed */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Parseloop: argument count: %u\n", WalkState->ArgCount));
|
||||
|
||||
if (WalkState->ArgCount)
|
||||
{
|
||||
/*
|
||||
|
@ -487,6 +487,31 @@ AcpiPsCreateOp (
|
||||
{
|
||||
Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp);
|
||||
AcpiPsFreeOp (Op);
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
if (AcpiGbl_DisasmFlag && WalkState->Opcode == AML_EXTERNAL_OP &&
|
||||
Status == AE_NOT_FOUND)
|
||||
{
|
||||
/*
|
||||
* If parsing of AML_EXTERNAL_OP's name path fails, then skip
|
||||
* past this opcode and keep parsing. This is a much better
|
||||
* alternative than to abort the entire disassembler. At this
|
||||
* point, the ParserState is at the end of the namepath of the
|
||||
* external declaration opcode. Setting WalkState->Aml to
|
||||
* WalkState->ParserState.Aml + 2 moves increments the
|
||||
* WalkState->Aml past the object type and the paramcount of the
|
||||
* external opcode. For the error message, only print the AML
|
||||
* offset. We could attempt to print the name but this may cause
|
||||
* a segmentation fault when printing the namepath because the
|
||||
* AML may be incorrect.
|
||||
*/
|
||||
AcpiOsPrintf (
|
||||
"// Invalid external declaration at AML offset 0x%x.\n",
|
||||
WalkState->Aml - WalkState->ParserState.AmlStart);
|
||||
WalkState->Aml = WalkState->ParserState.Aml + 2;
|
||||
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
|
||||
}
|
||||
#endif
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -796,7 +796,7 @@ ACPI_EXPORT_SYMBOL (AcpiWalkResourceBuffer)
|
||||
* device we are querying
|
||||
* Name - Method name of the resources we want.
|
||||
* (METHOD_NAME__CRS, METHOD_NAME__PRS, or
|
||||
* METHOD_NAME__AEI)
|
||||
* METHOD_NAME__AEI or METHOD_NAME__DMA)
|
||||
* UserFunction - Called for each resource
|
||||
* Context - Passed to UserFunction
|
||||
*
|
||||
@ -827,12 +827,13 @@ AcpiWalkResources (
|
||||
if (!DeviceHandle || !UserFunction || !Name ||
|
||||
(!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) &&
|
||||
!ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS) &&
|
||||
!ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI)))
|
||||
!ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI) &&
|
||||
!ACPI_COMPARE_NAME (Name, METHOD_NAME__DMA)))
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Get the _CRS/_PRS/_AEI resource list */
|
||||
/* Get the _CRS/_PRS/_AEI/_DMA resource list */
|
||||
|
||||
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer);
|
||||
|
@ -158,6 +158,66 @@
|
||||
#define _COMPONENT ACPI_TABLES
|
||||
ACPI_MODULE_NAME ("tbdata")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiTbCheckDuplication (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
UINT32 *TableIndex);
|
||||
|
||||
static BOOLEAN
|
||||
AcpiTbCompareTables (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
UINT32 TableIndex);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbCompareTables
|
||||
*
|
||||
* PARAMETERS: TableDesc - Table 1 descriptor to be compared
|
||||
* TableIndex - Index of table 2 to be compared
|
||||
*
|
||||
* RETURN: TRUE if both tables are identical.
|
||||
*
|
||||
* DESCRIPTION: This function compares a table with another table that has
|
||||
* already been installed in the root table list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiTbCompareTables (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
UINT32 TableIndex)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
BOOLEAN IsIdentical;
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
UINT32 TableLength;
|
||||
UINT8 TableFlags;
|
||||
|
||||
|
||||
Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
|
||||
&Table, &TableLength, &TableFlags);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a table match on the entire table length,
|
||||
* not just the header.
|
||||
*/
|
||||
IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength ||
|
||||
memcmp (TableDesc->Pointer, Table, TableLength)) ?
|
||||
FALSE : TRUE);
|
||||
|
||||
/* Release the acquired table */
|
||||
|
||||
AcpiTbReleaseTable (Table, TableLength, TableFlags);
|
||||
return (IsIdentical);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -477,7 +537,7 @@ AcpiTbValidateTempTable (
|
||||
ACPI_TABLE_DESC *TableDesc)
|
||||
{
|
||||
|
||||
if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum)
|
||||
if (!TableDesc->Pointer && !AcpiGbl_EnableTableValidation)
|
||||
{
|
||||
/*
|
||||
* Only validates the header of the table.
|
||||
@ -495,24 +555,109 @@ AcpiTbValidateTempTable (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbCheckDuplication
|
||||
*
|
||||
* PARAMETERS: TableDesc - Table descriptor
|
||||
* TableIndex - Where the table index is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Avoid installing duplicated tables. However table override and
|
||||
* user aided dynamic table load is allowed, thus comparing the
|
||||
* address of the table is not sufficient, and checking the entire
|
||||
* table content is required.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiTbCheckDuplication (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
UINT32 *TableIndex)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (TbCheckDuplication);
|
||||
|
||||
|
||||
/* Check if table is already registered */
|
||||
|
||||
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
|
||||
{
|
||||
/* Do not compare with unverified tables */
|
||||
|
||||
if (!(AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_VERIFIED))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a table match on the entire table length,
|
||||
* not just the header.
|
||||
*/
|
||||
if (!AcpiTbCompareTables (TableDesc, i))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: the current mechanism does not unregister a table if it is
|
||||
* dynamically unloaded. The related namespace entries are deleted,
|
||||
* but the table remains in the root table list.
|
||||
*
|
||||
* The assumption here is that the number of different tables that
|
||||
* will be loaded is actually small, and there is minimal overhead
|
||||
* in just keeping the table in case it is needed again.
|
||||
*
|
||||
* If this assumption changes in the future (perhaps on large
|
||||
* machines with many table load/unload operations), tables will
|
||||
* need to be unregistered when they are unloaded, and slots in the
|
||||
* root table list should be reused when empty.
|
||||
*/
|
||||
if (AcpiGbl_RootTableList.Tables[i].Flags &
|
||||
ACPI_TABLE_IS_LOADED)
|
||||
{
|
||||
/* Table is still loaded, this is an error */
|
||||
|
||||
return_ACPI_STATUS (AE_ALREADY_EXISTS);
|
||||
}
|
||||
else
|
||||
{
|
||||
*TableIndex = i;
|
||||
return_ACPI_STATUS (AE_CTRL_TERMINATE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Indicate no duplication to the caller */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbVerifyTempTable
|
||||
*
|
||||
* PARAMETERS: TableDesc - Table descriptor
|
||||
* Signature - Table signature to verify
|
||||
* TableIndex - Where the table index is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: This function is called to validate and verify the table, the
|
||||
* returned table descriptor is in "VALIDATED" state.
|
||||
* Note that 'TableIndex' is required to be set to !NULL to
|
||||
* enable duplication check.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbVerifyTempTable (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
char *Signature)
|
||||
char *Signature,
|
||||
UINT32 *TableIndex)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
@ -540,10 +685,10 @@ AcpiTbVerifyTempTable (
|
||||
goto InvalidateAndExit;
|
||||
}
|
||||
|
||||
/* Verify the checksum */
|
||||
|
||||
if (AcpiGbl_VerifyTableChecksum)
|
||||
if (AcpiGbl_EnableTableValidation)
|
||||
{
|
||||
/* Verify the checksum */
|
||||
|
||||
Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -556,9 +701,32 @@ AcpiTbVerifyTempTable (
|
||||
|
||||
goto InvalidateAndExit;
|
||||
}
|
||||
|
||||
/* Avoid duplications */
|
||||
|
||||
if (TableIndex)
|
||||
{
|
||||
Status = AcpiTbCheckDuplication (TableDesc, TableIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
if (Status != AE_CTRL_TERMINATE)
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
|
||||
"%4.4s 0x%8.8X%8.8X"
|
||||
" Table is duplicated",
|
||||
AcpiUtValidNameseg (TableDesc->Signature.Ascii) ?
|
||||
TableDesc->Signature.Ascii : "????",
|
||||
ACPI_FORMAT_UINT64 (TableDesc->Address)));
|
||||
}
|
||||
|
||||
goto InvalidateAndExit;
|
||||
}
|
||||
}
|
||||
|
||||
TableDesc->Flags |= ACPI_TABLE_IS_VERIFIED;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
return_ACPI_STATUS (Status);
|
||||
|
||||
InvalidateAndExit:
|
||||
AcpiTbInvalidateTable (TableDesc);
|
||||
@ -584,6 +752,8 @@ AcpiTbResizeRootTableList (
|
||||
{
|
||||
ACPI_TABLE_DESC *Tables;
|
||||
UINT32 TableCount;
|
||||
UINT32 CurrentTableCount, MaxTableCount;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (TbResizeRootTableList);
|
||||
@ -608,9 +778,9 @@ AcpiTbResizeRootTableList (
|
||||
TableCount = AcpiGbl_RootTableList.CurrentTableCount;
|
||||
}
|
||||
|
||||
MaxTableCount = TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
|
||||
Tables = ACPI_ALLOCATE_ZEROED (
|
||||
((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) *
|
||||
sizeof (ACPI_TABLE_DESC));
|
||||
((ACPI_SIZE) MaxTableCount) * sizeof (ACPI_TABLE_DESC));
|
||||
if (!Tables)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
|
||||
@ -619,10 +789,19 @@ AcpiTbResizeRootTableList (
|
||||
|
||||
/* Copy and free the previous table array */
|
||||
|
||||
CurrentTableCount = 0;
|
||||
if (AcpiGbl_RootTableList.Tables)
|
||||
{
|
||||
memcpy (Tables, AcpiGbl_RootTableList.Tables,
|
||||
(ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC));
|
||||
for (i = 0; i < TableCount; i++)
|
||||
{
|
||||
if (AcpiGbl_RootTableList.Tables[i].Address)
|
||||
{
|
||||
memcpy (Tables + CurrentTableCount,
|
||||
AcpiGbl_RootTableList.Tables + i,
|
||||
sizeof (ACPI_TABLE_DESC));
|
||||
CurrentTableCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
|
||||
{
|
||||
@ -631,8 +810,8 @@ AcpiTbResizeRootTableList (
|
||||
}
|
||||
|
||||
AcpiGbl_RootTableList.Tables = Tables;
|
||||
AcpiGbl_RootTableList.MaxTableCount =
|
||||
TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
|
||||
AcpiGbl_RootTableList.MaxTableCount = MaxTableCount;
|
||||
AcpiGbl_RootTableList.CurrentTableCount = CurrentTableCount;
|
||||
AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
@ -1029,14 +1208,9 @@ AcpiTbLoadTable (
|
||||
AcpiEvUpdateGpes (OwnerId);
|
||||
}
|
||||
|
||||
/* Invoke table handler if present */
|
||||
|
||||
if (AcpiGbl_TableHandler)
|
||||
{
|
||||
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
|
||||
AcpiGbl_TableHandlerContext);
|
||||
}
|
||||
/* Invoke table handler */
|
||||
|
||||
AcpiTbNotifyTable (ACPI_TABLE_EVENT_LOAD, Table);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -1070,24 +1244,19 @@ AcpiTbInstallAndLoadTable (
|
||||
ACPI_FUNCTION_TRACE (TbInstallAndLoadTable);
|
||||
|
||||
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
/* Install the table and load it into the namespace */
|
||||
|
||||
Status = AcpiTbInstallStandardTable (Address, Flags, TRUE,
|
||||
Override, &i);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
Status = AcpiTbLoadTable (i, AcpiGbl_RootNode);
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
UnlockAndExit:
|
||||
Exit:
|
||||
*TableIndex = i;
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -1122,16 +1291,12 @@ AcpiTbUnloadTable (
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Invoke table handler if present */
|
||||
/* Invoke table handler */
|
||||
|
||||
if (AcpiGbl_TableHandler)
|
||||
Status = AcpiGetTableByIndex (TableIndex, &Table);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiGetTableByIndex (TableIndex, &Table);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table,
|
||||
AcpiGbl_TableHandlerContext);
|
||||
}
|
||||
AcpiTbNotifyTable (ACPI_TABLE_EVENT_UNLOAD, Table);
|
||||
}
|
||||
|
||||
/* Delete the portion of the namespace owned by this table */
|
||||
@ -1146,3 +1311,31 @@ AcpiTbUnloadTable (
|
||||
AcpiTbSetTableLoadedFlag (TableIndex, FALSE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbNotifyTable
|
||||
*
|
||||
* PARAMETERS: Event - Table event
|
||||
* Table - Validated table pointer
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Notify a table event to the users.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiTbNotifyTable (
|
||||
UINT32 Event,
|
||||
void *Table)
|
||||
{
|
||||
/* Invoke table handler if present */
|
||||
|
||||
if (AcpiGbl_TableHandler)
|
||||
{
|
||||
(void) AcpiGbl_TableHandler (Event, Table,
|
||||
AcpiGbl_TableHandlerContext);
|
||||
}
|
||||
}
|
||||
|
@ -156,61 +156,6 @@
|
||||
#define _COMPONENT ACPI_TABLES
|
||||
ACPI_MODULE_NAME ("tbinstal")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static BOOLEAN
|
||||
AcpiTbCompareTables (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
UINT32 TableIndex);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbCompareTables
|
||||
*
|
||||
* PARAMETERS: TableDesc - Table 1 descriptor to be compared
|
||||
* TableIndex - Index of table 2 to be compared
|
||||
*
|
||||
* RETURN: TRUE if both tables are identical.
|
||||
*
|
||||
* DESCRIPTION: This function compares a table with another table that has
|
||||
* already been installed in the root table list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiTbCompareTables (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
UINT32 TableIndex)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
BOOLEAN IsIdentical;
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
UINT32 TableLength;
|
||||
UINT8 TableFlags;
|
||||
|
||||
|
||||
Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
|
||||
&Table, &TableLength, &TableFlags);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a table match on the entire table length,
|
||||
* not just the header.
|
||||
*/
|
||||
IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength ||
|
||||
memcmp (TableDesc->Pointer, Table, TableLength)) ?
|
||||
FALSE : TRUE);
|
||||
|
||||
/* Release the acquired table */
|
||||
|
||||
AcpiTbReleaseTable (Table, TableLength, TableFlags);
|
||||
return (IsIdentical);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -337,105 +282,48 @@ AcpiTbInstallStandardTable (
|
||||
goto ReleaseAndExit;
|
||||
}
|
||||
|
||||
/* Acquire the table lock */
|
||||
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
/* Validate and verify a table before installation */
|
||||
|
||||
Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
|
||||
Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, &i);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ReleaseAndExit;
|
||||
}
|
||||
|
||||
if (Reload)
|
||||
{
|
||||
/*
|
||||
* Validate the incoming table signature.
|
||||
*
|
||||
* 1) Originally, we checked the table signature for "SSDT" or "PSDT".
|
||||
* 2) We added support for OEMx tables, signature "OEM".
|
||||
* 3) Valid tables were encountered with a null signature, so we just
|
||||
* gave up on validating the signature, (05/2008).
|
||||
* 4) We encountered non-AML tables such as the MADT, which caused
|
||||
* interpreter errors and kernel faults. So now, we once again allow
|
||||
* only "SSDT", "OEMx", and now, also a null signature. (05/2011).
|
||||
*/
|
||||
if ((NewTableDesc.Signature.Ascii[0] != 0x00) &&
|
||||
(!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) &&
|
||||
(strncmp (NewTableDesc.Signature.Ascii, "OEM", 3)))
|
||||
{
|
||||
ACPI_BIOS_ERROR ((AE_INFO,
|
||||
"Table has invalid signature [%4.4s] (0x%8.8X), "
|
||||
"must be SSDT or OEMx",
|
||||
AcpiUtValidNameseg (NewTableDesc.Signature.Ascii) ?
|
||||
NewTableDesc.Signature.Ascii : "????",
|
||||
NewTableDesc.Signature.Integer));
|
||||
|
||||
Status = AE_BAD_SIGNATURE;
|
||||
goto ReleaseAndExit;
|
||||
}
|
||||
|
||||
/* Check if table is already registered */
|
||||
|
||||
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
|
||||
if (Status == AE_CTRL_TERMINATE)
|
||||
{
|
||||
/*
|
||||
* Check for a table match on the entire table length,
|
||||
* not just the header.
|
||||
* Table was unloaded, allow it to be reloaded.
|
||||
* As we are going to return AE_OK to the caller, we should
|
||||
* take the responsibility of freeing the input descriptor.
|
||||
* Refill the input descriptor to ensure
|
||||
* AcpiTbInstallTableWithOverride() can be called again to
|
||||
* indicate the re-installation.
|
||||
*/
|
||||
if (!AcpiTbCompareTables (&NewTableDesc, i))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: the current mechanism does not unregister a table if it is
|
||||
* dynamically unloaded. The related namespace entries are deleted,
|
||||
* but the table remains in the root table list.
|
||||
*
|
||||
* The assumption here is that the number of different tables that
|
||||
* will be loaded is actually small, and there is minimal overhead
|
||||
* in just keeping the table in case it is needed again.
|
||||
*
|
||||
* If this assumption changes in the future (perhaps on large
|
||||
* machines with many table load/unload operations), tables will
|
||||
* need to be unregistered when they are unloaded, and slots in the
|
||||
* root table list should be reused when empty.
|
||||
*/
|
||||
if (AcpiGbl_RootTableList.Tables[i].Flags &
|
||||
ACPI_TABLE_IS_LOADED)
|
||||
{
|
||||
/* Table is still loaded, this is an error */
|
||||
|
||||
Status = AE_ALREADY_EXISTS;
|
||||
goto ReleaseAndExit;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Table was unloaded, allow it to be reloaded.
|
||||
* As we are going to return AE_OK to the caller, we should
|
||||
* take the responsibility of freeing the input descriptor.
|
||||
* Refill the input descriptor to ensure
|
||||
* AcpiTbInstallTableWithOverride() can be called again to
|
||||
* indicate the re-installation.
|
||||
*/
|
||||
AcpiTbUninstallTable (&NewTableDesc);
|
||||
*TableIndex = i;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
AcpiTbUninstallTable (&NewTableDesc);
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
*TableIndex = i;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Add the table to the global root table list */
|
||||
|
||||
AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex);
|
||||
|
||||
/* Invoke table handler if present */
|
||||
/* Invoke table handler */
|
||||
|
||||
if (AcpiGbl_TableHandler)
|
||||
{
|
||||
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_INSTALL,
|
||||
NewTableDesc.Pointer, AcpiGbl_TableHandlerContext);
|
||||
}
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
AcpiTbNotifyTable (ACPI_TABLE_EVENT_INSTALL, NewTableDesc.Pointer);
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
UnlockAndExit:
|
||||
|
||||
/* Release the table lock */
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
|
||||
ReleaseAndExit:
|
||||
|
||||
@ -503,9 +391,11 @@ AcpiTbOverrideTable (
|
||||
|
||||
FinishOverride:
|
||||
|
||||
/* Validate and verify a table before overriding */
|
||||
|
||||
Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
|
||||
/*
|
||||
* Validate and verify a table before overriding, no nested table
|
||||
* duplication check as it's too complicated and unnecessary.
|
||||
*/
|
||||
Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
|
@ -559,14 +559,19 @@ AcpiTbGetTable (
|
||||
}
|
||||
}
|
||||
|
||||
TableDesc->ValidationCount++;
|
||||
if (TableDesc->ValidationCount == 0)
|
||||
if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Table %p, Validation count is zero after increment\n",
|
||||
TableDesc));
|
||||
TableDesc->ValidationCount--;
|
||||
return_ACPI_STATUS (AE_LIMIT);
|
||||
TableDesc->ValidationCount++;
|
||||
|
||||
/*
|
||||
* Detect ValidationCount overflows to ensure that the warning
|
||||
* message will only be printed once.
|
||||
*/
|
||||
if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS)
|
||||
{
|
||||
ACPI_WARNING((AE_INFO,
|
||||
"Table %p, Validation count overflows\n", TableDesc));
|
||||
}
|
||||
}
|
||||
|
||||
*OutTable = TableDesc->Pointer;
|
||||
@ -597,14 +602,21 @@ AcpiTbPutTable (
|
||||
ACPI_FUNCTION_TRACE (AcpiTbPutTable);
|
||||
|
||||
|
||||
if (TableDesc->ValidationCount == 0)
|
||||
if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Table %p, Validation count is zero before decrement\n",
|
||||
TableDesc));
|
||||
return_VOID;
|
||||
TableDesc->ValidationCount--;
|
||||
|
||||
/*
|
||||
* Detect ValidationCount underflows to ensure that the warning
|
||||
* message will only be printed once.
|
||||
*/
|
||||
if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Table %p, Validation count underflows\n", TableDesc));
|
||||
return_VOID;
|
||||
}
|
||||
}
|
||||
TableDesc->ValidationCount--;
|
||||
|
||||
if (TableDesc->ValidationCount == 0)
|
||||
{
|
||||
|
@ -292,7 +292,8 @@ AcpiReallocateRootTable (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 i;
|
||||
ACPI_TABLE_DESC *TableDesc;
|
||||
UINT32 i, j;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiReallocateRootTable);
|
||||
@ -307,6 +308,8 @@ AcpiReallocateRootTable (
|
||||
return_ACPI_STATUS (AE_SUPPORT);
|
||||
}
|
||||
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
/*
|
||||
* Ensure OS early boot logic, which is required by some hosts. If the
|
||||
* table state is reported to be wrong, developers should fix the
|
||||
@ -315,17 +318,41 @@ AcpiReallocateRootTable (
|
||||
*/
|
||||
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
|
||||
{
|
||||
if (AcpiGbl_RootTableList.Tables[i].Pointer)
|
||||
TableDesc = &AcpiGbl_RootTableList.Tables[i];
|
||||
if (TableDesc->Pointer)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Table [%4.4s] is not invalidated during early boot stage",
|
||||
AcpiGbl_RootTableList.Tables[i].Signature.Ascii));
|
||||
TableDesc->Signature.Ascii));
|
||||
}
|
||||
}
|
||||
|
||||
if (!AcpiGbl_EnableTableValidation)
|
||||
{
|
||||
/*
|
||||
* Now it's safe to do full table validation. We can do deferred
|
||||
* table initilization here once the flag is set.
|
||||
*/
|
||||
AcpiGbl_EnableTableValidation = TRUE;
|
||||
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
|
||||
{
|
||||
TableDesc = &AcpiGbl_RootTableList.Tables[i];
|
||||
if (!(TableDesc->Flags & ACPI_TABLE_IS_VERIFIED))
|
||||
{
|
||||
Status = AcpiTbVerifyTempTable (TableDesc, NULL, &j);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiTbUninstallTable (TableDesc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE;
|
||||
|
||||
Status = AcpiTbResizeRootTableList ();
|
||||
AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -522,6 +549,11 @@ AcpiPutTable (
|
||||
ACPI_FUNCTION_TRACE (AcpiPutTable);
|
||||
|
||||
|
||||
if (!Table)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
/* Walk the root table list */
|
||||
|
@ -336,11 +336,11 @@ AcpiTbLoadNamespace (
|
||||
{
|
||||
Table = &AcpiGbl_RootTableList.Tables[i];
|
||||
|
||||
if (!AcpiGbl_RootTableList.Tables[i].Address ||
|
||||
if (!Table->Address ||
|
||||
(!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_SSDT) &&
|
||||
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_PSDT) &&
|
||||
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_OSDT)) ||
|
||||
ACPI_FAILURE (AcpiTbValidateTable (Table)))
|
||||
ACPI_FAILURE (AcpiTbValidateTable (Table)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -183,8 +183,10 @@ AcpiUtHexToAsciiChar (
|
||||
UINT64 Integer,
|
||||
UINT32 Position)
|
||||
{
|
||||
UINT64 Index;
|
||||
|
||||
return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
|
||||
AcpiUtShortShiftRight (Integer, Position, &Index);
|
||||
return (AcpiGbl_HexToAscii[Index & 0xF]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -156,16 +156,6 @@
|
||||
#define _COMPONENT ACPI_UTILITIES
|
||||
ACPI_MODULE_NAME ("utmath")
|
||||
|
||||
/*
|
||||
* Optional support for 64-bit double-precision integer divide. This code
|
||||
* is configurable and is implemented in order to support 32-bit kernel
|
||||
* environments where a 64-bit double-precision math library is not available.
|
||||
*
|
||||
* Support for a more normal 64-bit divide/modulo (with check for a divide-
|
||||
* by-zero) appears after this optional section of code.
|
||||
*/
|
||||
#ifndef ACPI_USE_NATIVE_DIVIDE
|
||||
|
||||
/* Structures used only for 64-bit divide */
|
||||
|
||||
typedef struct uint64_struct
|
||||
@ -182,6 +172,257 @@ typedef union uint64_overlay
|
||||
|
||||
} UINT64_OVERLAY;
|
||||
|
||||
/*
|
||||
* Optional support for 64-bit double-precision integer multiply and shift.
|
||||
* This code is configurable and is implemented in order to support 32-bit
|
||||
* kernel environments where a 64-bit double-precision math library is not
|
||||
* available.
|
||||
*/
|
||||
#ifndef ACPI_USE_NATIVE_MATH64
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtShortMultiply
|
||||
*
|
||||
* PARAMETERS: Multiplicand - 64-bit multiplicand
|
||||
* Multiplier - 32-bit multiplier
|
||||
* OutProduct - Pointer to where the product is returned
|
||||
*
|
||||
* DESCRIPTION: Perform a short multiply.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtShortMultiply (
|
||||
UINT64 Multiplicand,
|
||||
UINT32 Multiplier,
|
||||
UINT64 *OutProduct)
|
||||
{
|
||||
UINT64_OVERLAY MultiplicandOvl;
|
||||
UINT64_OVERLAY Product;
|
||||
UINT32 Carry32;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtShortMultiply);
|
||||
|
||||
|
||||
MultiplicandOvl.Full = Multiplicand;
|
||||
|
||||
/*
|
||||
* The Product is 64 bits, the carry is always 32 bits,
|
||||
* and is generated by the second multiply.
|
||||
*/
|
||||
ACPI_MUL_64_BY_32 (0, MultiplicandOvl.Part.Hi, Multiplier,
|
||||
Product.Part.Hi, Carry32);
|
||||
|
||||
ACPI_MUL_64_BY_32 (0, MultiplicandOvl.Part.Lo, Multiplier,
|
||||
Product.Part.Lo, Carry32);
|
||||
|
||||
Product.Part.Hi += Carry32;
|
||||
|
||||
/* Return only what was requested */
|
||||
|
||||
if (OutProduct)
|
||||
{
|
||||
*OutProduct = Product.Full;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtShortShiftLeft
|
||||
*
|
||||
* PARAMETERS: Operand - 64-bit shift operand
|
||||
* Count - 32-bit shift count
|
||||
* OutResult - Pointer to where the result is returned
|
||||
*
|
||||
* DESCRIPTION: Perform a short left shift.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtShortShiftLeft (
|
||||
UINT64 Operand,
|
||||
UINT32 Count,
|
||||
UINT64 *OutResult)
|
||||
{
|
||||
UINT64_OVERLAY OperandOvl;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtShortShiftLeft);
|
||||
|
||||
|
||||
OperandOvl.Full = Operand;
|
||||
|
||||
if ((Count & 63) >= 32)
|
||||
{
|
||||
OperandOvl.Part.Hi = OperandOvl.Part.Lo;
|
||||
OperandOvl.Part.Lo ^= OperandOvl.Part.Lo;
|
||||
Count = (Count & 63) - 32;
|
||||
}
|
||||
ACPI_SHIFT_LEFT_64_BY_32 (OperandOvl.Part.Hi,
|
||||
OperandOvl.Part.Lo, Count);
|
||||
|
||||
/* Return only what was requested */
|
||||
|
||||
if (OutResult)
|
||||
{
|
||||
*OutResult = OperandOvl.Full;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtShortShiftRight
|
||||
*
|
||||
* PARAMETERS: Operand - 64-bit shift operand
|
||||
* Count - 32-bit shift count
|
||||
* OutResult - Pointer to where the result is returned
|
||||
*
|
||||
* DESCRIPTION: Perform a short right shift.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtShortShiftRight (
|
||||
UINT64 Operand,
|
||||
UINT32 Count,
|
||||
UINT64 *OutResult)
|
||||
{
|
||||
UINT64_OVERLAY OperandOvl;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtShortShiftRight);
|
||||
|
||||
|
||||
OperandOvl.Full = Operand;
|
||||
|
||||
if ((Count & 63) >= 32)
|
||||
{
|
||||
OperandOvl.Part.Lo = OperandOvl.Part.Hi;
|
||||
OperandOvl.Part.Hi ^= OperandOvl.Part.Hi;
|
||||
Count = (Count & 63) - 32;
|
||||
}
|
||||
ACPI_SHIFT_RIGHT_64_BY_32 (OperandOvl.Part.Hi,
|
||||
OperandOvl.Part.Lo, Count);
|
||||
|
||||
/* Return only what was requested */
|
||||
|
||||
if (OutResult)
|
||||
{
|
||||
*OutResult = OperandOvl.Full;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
#else
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtShortMultiply
|
||||
*
|
||||
* PARAMETERS: See function headers above
|
||||
*
|
||||
* DESCRIPTION: Native version of the UtShortMultiply function.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtShortMultiply (
|
||||
UINT64 Multiplicand,
|
||||
UINT32 Multiplier,
|
||||
UINT64 *OutProduct)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtShortMultiply);
|
||||
|
||||
|
||||
/* Return only what was requested */
|
||||
|
||||
if (OutProduct)
|
||||
{
|
||||
*OutProduct = Multiplicand * Multiplier;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtShortShiftLeft
|
||||
*
|
||||
* PARAMETERS: See function headers above
|
||||
*
|
||||
* DESCRIPTION: Native version of the UtShortShiftLeft function.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtShortShiftLeft (
|
||||
UINT64 Operand,
|
||||
UINT32 Count,
|
||||
UINT64 *OutResult)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtShortShiftLeft);
|
||||
|
||||
|
||||
/* Return only what was requested */
|
||||
|
||||
if (OutResult)
|
||||
{
|
||||
*OutResult = Operand << Count;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtShortShiftRight
|
||||
*
|
||||
* PARAMETERS: See function headers above
|
||||
*
|
||||
* DESCRIPTION: Native version of the UtShortShiftRight function.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtShortShiftRight (
|
||||
UINT64 Operand,
|
||||
UINT32 Count,
|
||||
UINT64 *OutResult)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtShortShiftRight);
|
||||
|
||||
|
||||
/* Return only what was requested */
|
||||
|
||||
if (OutResult)
|
||||
{
|
||||
*OutResult = Operand >> Count;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Optional support for 64-bit double-precision integer divide. This code
|
||||
* is configurable and is implemented in order to support 32-bit kernel
|
||||
* environments where a 64-bit double-precision math library is not available.
|
||||
*
|
||||
* Support for a more normal 64-bit divide/modulo (with check for a divide-
|
||||
* by-zero) appears after this optional section of code.
|
||||
*/
|
||||
#ifndef ACPI_USE_NATIVE_DIVIDE
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@ -363,7 +363,7 @@ AcpiUtCreateUpdateStateAndPush (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Walk through a package
|
||||
* DESCRIPTION: Walk through a package, including subpackages
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -377,8 +377,8 @@ AcpiUtWalkPackageTree (
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *StateList = NULL;
|
||||
ACPI_GENERIC_STATE *State;
|
||||
UINT32 ThisIndex;
|
||||
ACPI_OPERAND_OBJECT *ThisSourceObj;
|
||||
UINT32 ThisIndex;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtWalkPackageTree);
|
||||
@ -395,8 +395,10 @@ AcpiUtWalkPackageTree (
|
||||
/* Get one element of the package */
|
||||
|
||||
ThisIndex = State->Pkg.Index;
|
||||
ThisSourceObj = (ACPI_OPERAND_OBJECT *)
|
||||
ThisSourceObj =
|
||||
State->Pkg.SourceObject->Package.Elements[ThisIndex];
|
||||
State->Pkg.ThisTargetObj =
|
||||
&State->Pkg.SourceObject->Package.Elements[ThisIndex];
|
||||
|
||||
/*
|
||||
* Check for:
|
||||
@ -412,7 +414,7 @@ AcpiUtWalkPackageTree (
|
||||
(ThisSourceObj->Common.Type != ACPI_TYPE_PACKAGE))
|
||||
{
|
||||
Status = WalkCallback (ACPI_COPY_TYPE_SIMPLE, ThisSourceObj,
|
||||
State, Context);
|
||||
State, Context);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -485,6 +487,9 @@ AcpiUtWalkPackageTree (
|
||||
|
||||
/* We should never get here */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"State list did not terminate correctly"));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -651,6 +651,10 @@ AcpiUtGetSimpleObjectSize (
|
||||
{
|
||||
/* A namespace node should never get here */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Received a namespace node [%4.4s] "
|
||||
"where an operand object is required",
|
||||
ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, InternalObject)->Name.Ascii));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -303,11 +303,9 @@ AcpiUtWalkAmlResources (
|
||||
ACPI_FUNCTION_TRACE (UtWalkAmlResources);
|
||||
|
||||
|
||||
/*
|
||||
* The absolute minimum resource template is one EndTag descriptor.
|
||||
* However, we will treat a lone EndTag as just a simple buffer.
|
||||
*/
|
||||
if (AmlLength <= sizeof (AML_RESOURCE_END_TAG))
|
||||
/* The absolute minimum resource template is one EndTag descriptor */
|
||||
|
||||
if (AmlLength < sizeof (AML_RESOURCE_END_TAG))
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
@ -362,14 +360,11 @@ AcpiUtWalkAmlResources (
|
||||
}
|
||||
|
||||
/*
|
||||
* The EndTag opcode must be followed by a zero byte.
|
||||
* Although this byte is technically defined to be a checksum,
|
||||
* in practice, all ASL compilers set this byte to zero.
|
||||
* Don't attempt to perform any validation on the 2nd byte.
|
||||
* Although all known ASL compilers insert a zero for the 2nd
|
||||
* byte, it can also be a checksum (as per the ACPI spec),
|
||||
* and this is occasionally seen in the field. July 2017.
|
||||
*/
|
||||
if (*(Aml + 1) != 0)
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
|
||||
}
|
||||
|
||||
/* Return the pointer to the EndTag if requested */
|
||||
|
||||
@ -378,10 +373,8 @@ AcpiUtWalkAmlResources (
|
||||
*Context = Aml;
|
||||
}
|
||||
|
||||
/*
|
||||
* Normal exit. Note: We allow the buffer to be larger than
|
||||
* the resource template, as long as the END_TAG exists.
|
||||
*/
|
||||
/* Normal exit */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ ACPI_GENERIC_STATE *
|
||||
AcpiUtCreatePkgState (
|
||||
void *InternalObject,
|
||||
void *ExternalObject,
|
||||
UINT16 Index)
|
||||
UINT32 Index)
|
||||
{
|
||||
ACPI_GENERIC_STATE *State;
|
||||
|
||||
|
@ -419,8 +419,8 @@ AcpiUtStrtoulBase10 (
|
||||
|
||||
/* Convert and insert (add) the decimal digit */
|
||||
|
||||
NextValue =
|
||||
(ReturnValue * 10) + (AsciiDigit - ACPI_ASCII_ZERO);
|
||||
AcpiUtShortMultiply (ReturnValue, 10, &NextValue);
|
||||
NextValue += (AsciiDigit - ACPI_ASCII_ZERO);
|
||||
|
||||
/* Check for overflow (32 or 64 bit) - return current converted value */
|
||||
|
||||
@ -486,8 +486,8 @@ AcpiUtStrtoulBase16 (
|
||||
|
||||
/* Convert and insert the hex digit */
|
||||
|
||||
ReturnValue =
|
||||
(ReturnValue << 4) | AcpiUtAsciiCharToHex (AsciiDigit);
|
||||
AcpiUtShortShiftLeft (ReturnValue, 4, &ReturnValue);
|
||||
ReturnValue |= AcpiUtAsciiCharToHex (AsciiDigit);
|
||||
|
||||
String++;
|
||||
ValidDigits++;
|
||||
|
@ -776,6 +776,11 @@ AcpiUtDumpAllocations (
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
if (!AcpiGbl_GlobalList)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Element = AcpiGbl_GlobalList->ListHead;
|
||||
while (Element)
|
||||
{
|
||||
@ -787,7 +792,7 @@ AcpiUtDumpAllocations (
|
||||
|
||||
if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
|
||||
{
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u "
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u "
|
||||
"[Not a Descriptor - too small]\n",
|
||||
Descriptor, Element->Size, Element->Module,
|
||||
Element->Line);
|
||||
@ -799,7 +804,7 @@ AcpiUtDumpAllocations (
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) !=
|
||||
ACPI_DESC_TYPE_CACHED)
|
||||
{
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u [%s] ",
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u [%s] ",
|
||||
Descriptor, Element->Size, Element->Module,
|
||||
Element->Line, AcpiUtGetDescriptorName (Descriptor));
|
||||
|
||||
@ -875,6 +880,7 @@ AcpiUtDumpAllocations (
|
||||
Element = Element->Next;
|
||||
}
|
||||
|
||||
Exit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
|
||||
|
||||
/* Print summary */
|
||||
|
@ -226,6 +226,10 @@ AcGetAllTablesFromFile (
|
||||
UINT8 GetOnlyAmlTables,
|
||||
ACPI_NEW_TABLE_DESC **ReturnListHead);
|
||||
|
||||
void
|
||||
AcDeleteTableList (
|
||||
ACPI_NEW_TABLE_DESC *ListHead);
|
||||
|
||||
BOOLEAN
|
||||
AcIsFileBinary (
|
||||
FILE *File);
|
||||
|
@ -271,6 +271,7 @@ typedef enum
|
||||
ACPI_DMT_PCCT,
|
||||
ACPI_DMT_PMTT,
|
||||
ACPI_DMT_PPTT,
|
||||
ACPI_DMT_SDEI,
|
||||
ACPI_DMT_SLIC,
|
||||
ACPI_DMT_SRAT,
|
||||
|
||||
@ -527,6 +528,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdei[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[];
|
||||
|
@ -409,6 +409,12 @@ AcpiDsInitializeObjects (
|
||||
* dsobject - Parser/Interpreter interface - object initialization and conversion
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsBuildInternalObject (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_OPERAND_OBJECT **ObjDescPtr);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsBuildInternalBufferObj (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
@ -436,6 +442,17 @@ AcpiDsCreateNode (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* dspkginit - Package object initialization
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsInitPackageElement (
|
||||
UINT8 ObjectType,
|
||||
ACPI_OPERAND_OBJECT *SourceObject,
|
||||
ACPI_GENERIC_STATE *State,
|
||||
void *Context);
|
||||
|
||||
|
||||
/*
|
||||
* dsutils - Parser/Interpreter interface utility routines
|
||||
*/
|
||||
|
@ -328,6 +328,7 @@ typedef struct acpi_namespace_node
|
||||
#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
|
||||
#define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */
|
||||
|
||||
#define IMPLICIT_EXTERNAL 0x02 /* iASL only: This object created implicitly via External */
|
||||
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
|
||||
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
|
||||
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
|
||||
@ -812,7 +813,7 @@ typedef struct acpi_update_state
|
||||
typedef struct acpi_pkg_state
|
||||
{
|
||||
ACPI_STATE_COMMON
|
||||
UINT16 Index;
|
||||
UINT32 Index;
|
||||
union acpi_operand_object *SourceObject;
|
||||
union acpi_operand_object *DestObject;
|
||||
struct acpi_walk_state *WalkState;
|
||||
@ -1146,7 +1147,7 @@ typedef struct acpi_parse_obj_named
|
||||
|
||||
/* This version is used by the iASL compiler only */
|
||||
|
||||
#define ACPI_MAX_PARSEOP_NAME 20
|
||||
#define ACPI_MAX_PARSEOP_NAME 20
|
||||
|
||||
typedef struct acpi_parse_obj_asl
|
||||
{
|
||||
@ -1190,11 +1191,12 @@ typedef union acpi_parse_object
|
||||
|
||||
typedef struct asl_comment_state
|
||||
{
|
||||
UINT8 CommentType;
|
||||
UINT32 SpacesBefore;
|
||||
ACPI_PARSE_OBJECT *Latest_Parse_Node;
|
||||
ACPI_PARSE_OBJECT *ParsingParenBraceNode;
|
||||
BOOLEAN CaptureComments;
|
||||
UINT8 CommentType;
|
||||
UINT32 SpacesBefore;
|
||||
ACPI_PARSE_OBJECT *LatestParseOp;
|
||||
ACPI_PARSE_OBJECT *ParsingParenBraceNode;
|
||||
BOOLEAN CaptureComments;
|
||||
|
||||
} ASL_COMMENT_STATE;
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user