From ce3d88446fc33bf55692ea049f512f4327d2e7f6 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Apr 26 2016 01:33:48 +0000 Subject: Imported Upstream version 20160422 --- diff --git a/changes.txt b/changes.txt index d797ded..19f5c0d 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,99 @@ ---------------------------------------- +22 April 2016. Summary of changes for version 20160422: + +1) ACPICA kernel-resident subsystem: + +Fixed a regression in the GAS (generic address structure) arbitrary bit +support in AcpiHwRead/AcpiHwWrite. Problem could cause incorrect behavior +and incorrect return values. Lv Zheng. ACPICA BZ 1270. + +ACPI 6.0: Added support for new/renamed resource macros. One new argument +was added to each of these macros, and the original name has been +deprecated. The AML disassembler will always disassemble to the new +names. Support for the new macros was added to iASL, disassembler, +resource manager, and the acpihelp utility. ACPICA BZ 1274. + + I2cSerialBus -> I2cSerialBusV2 + SpiSerialBus -> SpiSerialBusV2 + UartSerialBus -> UartSerialBusV2 + +ACPI 6.0: Added support for a new integer field that was appended to the +package object returned by the _BIX method. This adds iASL compile-time +and AML runtime error checking. ACPICA BZ 1273. + +ACPI 6.1: Added support for a new PCCT subtable, "HW-Reduced Comm +Subspace Type2" (Headers, Disassembler, and data table compiler). + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total + Debug Version: 201.5K Code, 82.2K Data, 283.7K Total + Previous Release: + Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total + Debug Version: 201.0K Code, 82.0K Data, 283.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented an ASL grammar extension to allow/enable executable +"module-level code" to be created and executed under the various +operators that create new scopes. This type of AML code is already +supported in all known AML interpreters, and the grammar change will +appear in the next version of the ACPI specification. Simplifies the +conditional runtime creation of named objects under these object types: + + Device + PowerResource + Processor + Scope + ThermalZone + +iASL: Implemented a new ASL extension, a "For" loop macro to add greater +ease-of-use to the ASL language. The syntax is similar to the +corresponding C operator, and is implemented with the existing AML While +opcode -- thus requiring no changes to existing AML interpreters. + + For (Initialize, Predicate, Update) {TermList} + +Grammar: + ForTerm := + For ( + Initializer // Nothing | TermArg => ComputationalData + Predicate // Nothing | TermArg => ComputationalData + Update // Nothing | TermArg => ComputationalData + ) {TermList} + + +iASL: The _HID/_ADR detection and validation has been enhanced to search +under conditionals in order to allow these objects to be conditionally +created at runtime. + +iASL: Fixed several issues with the constant folding feature. The +improvement allows better detection and resolution of statements that can +be folded at compile time. ACPICA BZ 1266. + +iASL/Disassembler: Fixed a couple issues with the Else{If{}...} +conversion to the ASL ElseIf operator where incorrect ASL code could be +generated. + +iASL/Disassembler: Fixed a problem with the ASL+ code disassembly where +sometimes an extra (and extraneous) set of parentheses were emitted for +some combinations of operators. Although this did not cause any problems +with recompilation of the disassembled code, it made the code more +difficult to read. David Box. ACPICA BZ 1231. + +iASL: Changed to ignore the unreferenced detection for predefined names +of resource descriptor elements, when the resource descriptor is +created/defined within a control method. + +iASL: Disassembler: Fix a possible fault with externally declared Buffer +objects. + +---------------------------------------- 18 March 2016. Summary of changes for version 20160318: 1) ACPICA kernel-resident subsystem: diff --git a/generate/unix/acpibin/Makefile b/generate/unix/acpibin/Makefile index 1be484d..e856499 100644 --- a/generate/unix/acpibin/Makefile +++ b/generate/unix/acpibin/Makefile @@ -32,6 +32,7 @@ OBJECTS = \ $(OBJDIR)/cmfsize.o\ $(OBJDIR)/getopt.o\ $(OBJDIR)/utalloc.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utcache.o\ $(OBJDIR)/utdebug.o\ diff --git a/generate/unix/acpidump/Makefile b/generate/unix/acpidump/Makefile index 67e7e94..d6e1964 100644 --- a/generate/unix/acpidump/Makefile +++ b/generate/unix/acpidump/Makefile @@ -39,6 +39,7 @@ OBJECTS = \ $(OBJDIR)/osunixxf.o\ $(OBJDIR)/tbprint.o\ $(OBJDIR)/tbxfroot.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utexcep.o\ diff --git a/generate/unix/acpiexamples/Makefile b/generate/unix/acpiexamples/Makefile index f40c11b..54d7473 100644 --- a/generate/unix/acpiexamples/Makefile +++ b/generate/unix/acpiexamples/Makefile @@ -131,6 +131,7 @@ OBJECTS = \ $(OBJDIR)/tbxfroot.o\ $(OBJDIR)/utaddress.o\ $(OBJDIR)/utalloc.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utcache.o\ $(OBJDIR)/utcopy.o\ diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile index e473664..7f8befa 100644 --- a/generate/unix/acpiexec/Makefile +++ b/generate/unix/acpiexec/Makefile @@ -201,6 +201,7 @@ OBJECTS = \ $(OBJDIR)/tbxfroot.o\ $(OBJDIR)/utaddress.o\ $(OBJDIR)/utalloc.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utcache.o\ $(OBJDIR)/utcopy.o\ diff --git a/generate/unix/acpinames/Makefile b/generate/unix/acpinames/Makefile index 7457b1b..4ff5558 100644 --- a/generate/unix/acpinames/Makefile +++ b/generate/unix/acpinames/Makefile @@ -96,6 +96,7 @@ OBJECTS = \ $(OBJDIR)/tbxfroot.o\ $(OBJDIR)/utaddress.o\ $(OBJDIR)/utalloc.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utcache.o\ $(OBJDIR)/utdebug.o\ diff --git a/generate/unix/acpisrc/Makefile b/generate/unix/acpisrc/Makefile index 6511fd7..93a9868 100644 --- a/generate/unix/acpisrc/Makefile +++ b/generate/unix/acpisrc/Makefile @@ -39,6 +39,7 @@ OBJECTS = \ $(OBJDIR)/oslibcfs.o\ $(OBJDIR)/osunixdir.o\ $(OBJDIR)/osunixxf.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ diff --git a/generate/unix/acpixtract/Makefile b/generate/unix/acpixtract/Makefile index 58722e8..272cbd0 100644 --- a/generate/unix/acpixtract/Makefile +++ b/generate/unix/acpixtract/Makefile @@ -33,6 +33,7 @@ OBJECTS = \ $(OBJDIR)/getopt.o\ $(OBJDIR)/oslibcfs.o\ $(OBJDIR)/osunixxf.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile index 36c93d5..73682f8 100644 --- a/generate/unix/iasl/Makefile +++ b/generate/unix/iasl/Makefile @@ -201,6 +201,7 @@ OBJECTS = \ $(OBJDIR)/tbxfload.o\ $(OBJDIR)/utaddress.o\ $(OBJDIR)/utalloc.o\ + $(OBJDIR)/utascii.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utcache.o\ $(OBJDIR)/utcopy.o\ @@ -274,12 +275,14 @@ include ../Makefile.rules # Function to safely execute yacc # safe_yacc = \ - _f=`echo $(1) | tr '[:upper:]' '[:lower:]'` &&\ - _d=`mktemp -d $(OBJDIR)/$$_f.XXXXXX` &&\ - _t=`basename $(3)` &&\ - $(YACC) $(YFLAGS) -p$(1) -o$$_d/$$_f.c -d $(2) &&\ - mv $$_d/$$_f.$${_t\#\#*.} $(3);\ - test -d $$_d && rm -fr $$_d + _d=`mktemp -d $(OBJDIR)/$(1).XXXXXX` &&\ + cd $$_d &&\ + $(YACC) $(YFLAGS) -d -p$(1) $(abspath $(2)) &&\ + cd - &&\ + mv $$_d/y.tab$(suffix $(3)) $(3);\ + _r=$$?;\ + rm -fr $$_d;\ + exit $$_r # # Macro processing for iASL .y files diff --git a/source/common/acfileio.c b/source/common/acfileio.c index 2c69c23..589eaea 100644 --- a/source/common/acfileio.c +++ b/source/common/acfileio.c @@ -112,7 +112,8 @@ AcGetAllTablesFromFile ( FileSize = CmGetFileSize (File); if (FileSize == ACPI_UINT32_MAX) { - return (AE_ERROR); + Status = AE_ERROR; + goto ErrorExit; } fprintf (stderr, @@ -123,7 +124,8 @@ AcGetAllTablesFromFile ( if (FileSize < sizeof (ACPI_TABLE_HEADER)) { - return (AE_BAD_HEADER); + Status = AE_BAD_HEADER; + goto ErrorExit; } /* Check for an non-binary file */ @@ -156,7 +158,7 @@ AcGetAllTablesFromFile ( } else if (ACPI_FAILURE (Status)) { - return (Status); + goto ErrorExit; } /* Print table header for iASL/disassembler only */ @@ -203,6 +205,7 @@ AcGetAllTablesFromFile ( *ReturnListHead = ListHead; } +ErrorExit: fclose(File); return (Status); } @@ -409,7 +412,7 @@ AcValidateTableHeader ( /* Validate the signature (limited ASCII chars) */ - if (!AcpiIsValidSignature (TableHeader.Signature)) + if (!AcpiUtValidNameseg (TableHeader.Signature)) { fprintf (stderr, "Invalid table signature: 0x%8.8X\n", *ACPI_CAST_PTR (UINT32, TableHeader.Signature)); diff --git a/source/common/dmextern.c b/source/common/dmextern.c index 924c42f..d1a6755 100644 --- a/source/common/dmextern.c +++ b/source/common/dmextern.c @@ -1101,7 +1101,6 @@ AcpiDmEmitExternals ( */ while (AcpiGbl_ExternalList) { - AcpiGbl_ExternalList = AcpiGbl_ExternalList; if (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_EXTERNAL_EMITTED)) { AcpiOsPrintf (" External (%s%s)", diff --git a/source/common/dmrestag.c b/source/common/dmrestag.c index 310ddac..bfeb283 100644 --- a/source/common/dmrestag.c +++ b/source/common/dmrestag.c @@ -279,6 +279,7 @@ static const ACPI_RESOURCE_TAG AcpiDmGpioIoTags[] = static const ACPI_RESOURCE_TAG AcpiDmI2cSerialBusTags[] = { {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, + {( 6 * 8) + 2, ACPI_RESTAG_INTERRUPTSHARE}, /* V2 - ACPI 6.0 */ {( 7 * 8) + 0, ACPI_RESTAG_MODE}, {(12 * 8), ACPI_RESTAG_SPEED}, {(16 * 8), ACPI_RESTAG_ADDRESS}, @@ -288,6 +289,7 @@ static const ACPI_RESOURCE_TAG AcpiDmI2cSerialBusTags[] = static const ACPI_RESOURCE_TAG AcpiDmSpiSerialBusTags[] = { {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, + {( 6 * 8) + 2, ACPI_RESTAG_INTERRUPTSHARE}, /* V2 - ACPI 6.0 */ {( 7 * 8) + 0, ACPI_RESTAG_MODE}, {( 7 * 8) + 1, ACPI_RESTAG_DEVICEPOLARITY}, {(12 * 8), ACPI_RESTAG_SPEED}, @@ -300,7 +302,8 @@ static const ACPI_RESOURCE_TAG AcpiDmSpiSerialBusTags[] = static const ACPI_RESOURCE_TAG AcpiDmUartSerialBusTags[] = { - {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, /* Note: not part of original macro */ + {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, /* Note: not part of original macro */ + {( 6 * 8) + 2, ACPI_RESTAG_INTERRUPTSHARE}, /* V2 - ACPI 6.0 */ {( 7 * 8) + 0, ACPI_RESTAG_FLOWCONTROL}, {( 7 * 8) + 2, ACPI_RESTAG_STOPBITS}, {( 7 * 8) + 4, ACPI_RESTAG_LENGTH}, diff --git a/source/common/dmtable.c b/source/common/dmtable.c index 14f0861..5ad46e9 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -58,15 +58,6 @@ AcpiAhGetTableInfo ( char *Signature); -/* Local Prototypes */ - -static void -AcpiDmCheckAscii ( - UINT8 *Target, - char *RepairedName, - UINT32 Count); - - /* Common format strings for commented values */ #define UINT8_FORMAT "%2.2X [%s]\n" @@ -255,6 +246,7 @@ static const char *AcpiDmPcctSubnames[] = { "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */ "HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */ + "HW-Reduced Comm Subspace Type2", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */ "Unknown Subtable Type" /* Reserved */ }; @@ -1059,7 +1051,7 @@ AcpiDmDumpTable ( case ACPI_DMT_SIG: - AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiUtCheckAndRepairAscii (Target, RepairedName, 4); AcpiOsPrintf ("\"%.4s\" ", RepairedName); TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target)); @@ -1075,19 +1067,19 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME4: - AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiUtCheckAndRepairAscii (Target, RepairedName, 4); AcpiOsPrintf ("\"%.4s\"\n", RepairedName); break; case ACPI_DMT_NAME6: - AcpiDmCheckAscii (Target, RepairedName, 6); + AcpiUtCheckAndRepairAscii (Target, RepairedName, 6); AcpiOsPrintf ("\"%.6s\"\n", RepairedName); break; case ACPI_DMT_NAME8: - AcpiDmCheckAscii (Target, RepairedName, 8); + AcpiUtCheckAndRepairAscii (Target, RepairedName, 8); AcpiOsPrintf ("\"%.8s\"\n", RepairedName); break; @@ -1490,42 +1482,3 @@ AcpiDmDumpTable ( return (AE_OK); } - - -/******************************************************************************* - * - * FUNCTION: AcpiDmCheckAscii - * - * PARAMETERS: Name - Ascii string - * Count - Number of characters to check - * - * RETURN: None - * - * DESCRIPTION: Ensure that the requested number of characters are printable - * Ascii characters. Sets non-printable and null chars to . - * - ******************************************************************************/ - -static void -AcpiDmCheckAscii ( - UINT8 *Name, - char *RepairedName, - UINT32 Count) -{ - UINT32 i; - - - for (i = 0; i < Count; i++) - { - RepairedName[i] = (char) Name[i]; - - if (!Name[i]) - { - return; - } - if (!isprint (Name[i])) - { - RepairedName[i] = ' '; - } - } -} diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c index efc383d..789256c 100644 --- a/source/common/dmtbdump.c +++ b/source/common/dmtbdump.c @@ -2897,6 +2897,11 @@ AcpiDmDumpPcct ( InfoTable = AcpiDmTableInfoPcct1; break; + case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2: + + InfoTable = AcpiDmTableInfoPcct2; + break; + default: AcpiOsPrintf ( diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c index bc9cc3b..2ae6594 100644 --- a/source/common/dmtbinfo.c +++ b/source/common/dmtbinfo.c @@ -218,6 +218,7 @@ #define ACPI_NFIT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_FLUSH_ADDRESS,f) #define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) #define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f) +#define ACPI_PCCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f) #define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) #define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f) #define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f) @@ -279,6 +280,7 @@ #define ACPI_NFIT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CONTROL_REGION,f,o) #define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o) #define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o) +#define ACPI_PCCT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o) #define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o) #define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o) #define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) @@ -2339,6 +2341,29 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] = ACPI_DMT_TERMINATOR }; +/* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[] = +{ + {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0}, + {ACPI_DMT_UINT8, ACPI_PCCT2_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_PCCT2_FLAG_OFFSET (Flags,0), "Polarity", 0}, + {ACPI_DMT_FLAG1, ACPI_PCCT2_FLAG_OFFSET (Flags,0), "Mode", 0}, + {ACPI_DMT_UINT8, ACPI_PCCT2_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (BaseAddress), "Base Address", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (Length), "Address Length", 0}, + {ACPI_DMT_GAS, ACPI_PCCT2_OFFSET (DoorbellRegister), "Doorbell Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (PreserveMask), "Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (WriteMask), "Write Mask", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (Latency), "Command Latency", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, + {ACPI_DMT_UINT16, ACPI_PCCT2_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, + {ACPI_DMT_GAS, ACPI_PCCT2_OFFSET (DoorbellAckRegister), "Doorbell ACK Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (AckWriteMask), "ACK Write Mask", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c index 668f660..bf5b37c 100644 --- a/source/compiler/aslanalyze.c +++ b/source/compiler/aslanalyze.c @@ -50,6 +50,15 @@ ACPI_MODULE_NAME ("aslanalyze") +/* Local Prototypes */ + +static ACPI_STATUS +ApDeviceSubtreeWalk ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + + /******************************************************************************* * * FUNCTION: AnIsInternalMethod @@ -579,6 +588,108 @@ ApCheckRegMethod ( /******************************************************************************* * + * FUNCTION: ApFindNameInDeviceTree + * + * PARAMETERS: Name - Name to search for + * Op - Current parse op + * + * RETURN: TRUE if name found in the same scope as Op. + * + * DESCRIPTION: Determine if a name appears in the same scope as Op, as either + * a Method() or a Name(). "Same scope" can mean under an If or + * Else statement. + * + * NOTE: Detects _HID/_ADR in this type of construct (legal in ACPI 6.1+) + * + * Scope (\_SB.PCI0) + * { + * Device (I2C0) + * { + * If (SMD0 != 4) { + * Name (_HID, "INT3442") + * } Else { + * Name (_ADR, 0x400) + * } + * } + * } + ******************************************************************************/ + +BOOLEAN +ApFindNameInDeviceTree ( + char *Name, + ACPI_PARSE_OBJECT *Op) +{ + ACPI_STATUS Status; + + + Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD, + ApDeviceSubtreeWalk, NULL, Name); + + if (Status == AE_CTRL_TRUE) + { + return (TRUE); /* Found a match */ + } + + return (FALSE); +} + + +/* Callback function for interface above */ + +static ACPI_STATUS +ApDeviceSubtreeWalk ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context) +{ + char *Name = ACPI_CAST_PTR (char, Context); + + + switch (Op->Asl.ParseOpcode) + { + case PARSEOP_DEVICE: + + /* Level 0 is the starting device, ignore it */ + + if (Level > 0) + { + /* Ignore sub-devices */ + + return (AE_CTRL_DEPTH); + } + break; + + case PARSEOP_NAME: + case PARSEOP_METHOD: + + /* These are what we are looking for */ + + if (ACPI_COMPARE_NAME (Name, Op->Asl.NameSeg)) + { + return (AE_CTRL_TRUE); + } + return (AE_CTRL_DEPTH); + + case PARSEOP_SCOPE: + case PARSEOP_FIELD: + case PARSEOP_OPERATIONREGION: + + /* + * We want to ignore these, because either they can be large + * subtrees or open a scope to somewhere else. + */ + return (AE_CTRL_DEPTH); + + default: + break; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: ApFindNameInScope * * PARAMETERS: Name - Name to search for diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c index a2a03e9..ce070ef 100644 --- a/source/compiler/aslcompile.c +++ b/source/compiler/aslcompile.c @@ -207,8 +207,8 @@ CmDoCompile ( if (Gbl_FoldConstants) { - TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, - OpcAmlConstantWalk, NULL, NULL); + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, + NULL, OpcAmlConstantWalk, NULL); } else { diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h index 1446dc8..b346863 100644 --- a/source/compiler/aslcompiler.h +++ b/source/compiler/aslcompiler.h @@ -287,6 +287,10 @@ ApFindNameInScope ( char *Name, ACPI_PARSE_OBJECT *Op); +BOOLEAN +ApFindNameInDeviceTree ( + char *Name, + ACPI_PARSE_OBJECT *Op); /* * aslerror - error handling/reporting @@ -709,6 +713,11 @@ ExDoExternal ( #define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD) +void +TrSetParent ( + ACPI_PARSE_OBJECT *Op, + ACPI_PARSE_OBJECT *ParentOp); + ACPI_PARSE_OBJECT * TrAllocateNode ( UINT32 ParseOpcode); diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index a34387c..15c9dae 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -332,6 +332,7 @@ NamePathTail [.]{NameSeg} "GpioInt" { count (1); return (PARSEOP_GPIO_INT); } "GpioIo" { count (1); return (PARSEOP_GPIO_IO); } "I2cSerialBus" { count (1); return (PARSEOP_I2C_SERIALBUS); } +"I2cSerialBusV2" { count (1); return (PARSEOP_I2C_SERIALBUS_V2); } "Interrupt" { count (1); return (PARSEOP_INTERRUPT); } "IO" { count (1); return (PARSEOP_IO); } "IRQ" { count (1); return (PARSEOP_IRQ); } @@ -344,9 +345,11 @@ NamePathTail [.]{NameSeg} "QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); } "Register" { count (1); return (PARSEOP_REGISTER); } "SpiSerialBus" { count (1); return (PARSEOP_SPI_SERIALBUS); } +"SpiSerialBusV2" { count (1); return (PARSEOP_SPI_SERIALBUS_V2); } "StartDependentFn" { count (1); return (PARSEOP_STARTDEPENDENTFN); } "StartDependentFnNoPri" { count (1); return (PARSEOP_STARTDEPENDENTFN_NOPRI); } "UartSerialBus" { count (1); return (PARSEOP_UART_SERIALBUS); } +"UartSerialBusV2" { count (1); return (PARSEOP_UART_SERIALBUS_V2); } "VendorLong" { count (1); return (PARSEOP_VENDORLONG); } "VendorShort" { count (1); return (PARSEOP_VENDORSHORT); } "WordBusNumber" { count (1); return (PARSEOP_WORDBUSNUMBER); } @@ -672,9 +675,14 @@ NamePathTail [.]{NameSeg} /* printf debug macros */ + "printf" { count (0); return (PARSEOP_PRINTF); } "fprintf" { count (0); return (PARSEOP_FPRINTF); } + /* Other macros */ + +"For" { count (0); return (PARSEOP_FOR); } + /* Predefined compiler names */ "__DATE__" { count (0); return (PARSEOP___DATE__); } diff --git a/source/compiler/aslfold.c b/source/compiler/aslfold.c index 9f219d9..93b49b0 100644 --- a/source/compiler/aslfold.c +++ b/source/compiler/aslfold.c @@ -101,6 +101,7 @@ TrInstallReducedConstant ( * RETURN: Status * * DESCRIPTION: Reduce an Op and its subtree to a constant if possible. + * Called during ascent of the parse tree. * ******************************************************************************/ @@ -192,9 +193,7 @@ OpcAmlConstantWalk ( OpcUpdateIntegerNode (Op, 0); } - /* Abort the walk of this subtree, we are done with it */ - - return (AE_CTRL_DEPTH); + return (AE_OK); } @@ -207,7 +206,7 @@ OpcAmlConstantWalk ( * RETURN: Status * * DESCRIPTION: Check one Op for a reducible type 3/4/5 AML opcode. - * This is performed via a downward walk of the parse subtree. + * This is performed via an upward walk of the parse subtree. * ******************************************************************************/ @@ -373,7 +372,6 @@ OpcAmlCheckForConstant ( goto CleanupAndExit; } - /* Debug output */ DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345"); @@ -519,9 +517,6 @@ TrTransformToStoreOp ( ACPI_STATUS Status; - DbgPrint (ASL_PARSE_OUTPUT, - "Reduction/Transform to StoreOp: Store(Constant, Target)\n"); - /* Extract the operands */ Child1 = Op->Asl.Child; @@ -543,6 +538,10 @@ TrTransformToStoreOp ( } } + DbgPrint (ASL_PARSE_OUTPUT, + "Reduction/Transform to StoreOp: Store(%s, %s)\n", + Child1->Asl.ParseOpName, Child2->Asl.ParseOpName); + /* * Create a NULL (zero) target so that we can use the * interpreter to evaluate the expression. diff --git a/source/compiler/asllookup.c b/source/compiler/asllookup.c index c10959f..fed35fd 100644 --- a/source/compiler/asllookup.c +++ b/source/compiler/asllookup.c @@ -207,6 +207,7 @@ LkIsObjectUsed ( case ACPI_TYPE_POWER: case ACPI_TYPE_THERMAL: case ACPI_TYPE_LOCAL_RESOURCE: + case ACPI_TYPE_LOCAL_RESOURCE_FIELD: /* Names assigned to descriptor elements */ return (AE_OK); @@ -227,8 +228,8 @@ LkIsObjectUsed ( * Issue a remark even if it is a reserved name (starts * with an underscore). */ - sprintf (MsgBuffer, "Name is within method [%4.4s]", - Next->Name.Ascii); + sprintf (MsgBuffer, "Name [%4.4s] is within a method [%4.4s]", + Node->Name.Ascii, Next->Name.Ascii); AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), MsgBuffer); return (AE_OK); diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index 013f7c9..7875621 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -238,6 +238,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* 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), /* INCLUDE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* INCLUDE_END */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), @@ -395,6 +396,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* SLAVEMODE_DEVICEINIT */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* SLEEP */ OP_TABLE_ENTRY (AML_SLEEP_OP, 0, 0, 0), /* SPISERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* SPISERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* STALL */ OP_TABLE_ENTRY (AML_STALL_OP, 0, 0, 0), /* STARTDEPENDENTFN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* STARTDEPENDENTFN_NOPRI */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), @@ -420,6 +422,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* 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), /* 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), diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c index 2c74ff0..226aa79 100644 --- a/source/compiler/aslmethod.c +++ b/source/compiler/aslmethod.c @@ -406,10 +406,8 @@ MtMethodAnalysisWalkBegin ( case PARSEOP_DEVICE: - Next = Op->Asl.Child; - - if (!ApFindNameInScope (METHOD_NAME__HID, Next) && - !ApFindNameInScope (METHOD_NAME__ADR, Next)) + if (!ApFindNameInDeviceTree (METHOD_NAME__HID, Op) && + !ApFindNameInDeviceTree (METHOD_NAME__ADR, Op)) { AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op, "Device object requires a _HID or _ADR in same scope"); diff --git a/source/compiler/aslparser.y b/source/compiler/aslparser.y index 00718e4..b3d83b8 100644 --- a/source/compiler/aslparser.y +++ b/source/compiler/aslparser.y @@ -58,7 +58,7 @@ * each list element and possibly overflow on very large lists (>4000 items). * This dramatically reduces use of the parse stack overall. * - * ArgList, TermList, Objectlist, ByteList, DWordList, PackageList, + * ArgList, TermList, ByteList, DWordList, PackageList, * ResourceMacroList, and FieldUnitList */ @@ -99,7 +99,7 @@ AslLocalAllocate ( * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 89 +%expect 101 /*! [Begin] no source code translation */ diff --git a/source/compiler/aslpredef.c b/source/compiler/aslpredef.c index f18befa..1aa627b 100644 --- a/source/compiler/aslpredef.c +++ b/source/compiler/aslpredef.c @@ -454,8 +454,8 @@ ApCheckForPredefinedName ( if (Name[0] == 0) { - AcpiOsPrintf ("Found a null name, external = %s\n", - Op->Asl.ExternalName); + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op, + "zero length name found"); } /* All reserved names are prefixed with a single underscore */ diff --git a/source/compiler/aslprepkg.c b/source/compiler/aslprepkg.c index f82b4e3..824a0c5 100644 --- a/source/compiler/aslprepkg.c +++ b/source/compiler/aslprepkg.c @@ -52,7 +52,7 @@ /* Local prototypes */ -static void +static ACPI_PARSE_OBJECT * ApCheckPackageElements ( const char *PredefinedName, ACPI_PARSE_OBJECT *Op, @@ -88,6 +88,11 @@ ApPackageTooLarge ( UINT32 Count, UINT32 ExpectedCount); +static void +ApCustomPackage ( + ACPI_PARSE_OBJECT *ParentOp, + const ACPI_PREDEFINED_INFO *Predefined); + /******************************************************************************* * @@ -168,6 +173,11 @@ ApCheckPackage ( switch (Package->RetInfo.Type) { + case ACPI_PTYPE_CUSTOM: + + ApCustomPackage (ParentOp, Predefined); + break; + case ACPI_PTYPE1_FIXED: /* * The package count is fixed and there are no subpackages @@ -382,6 +392,86 @@ PackageTooSmall: /******************************************************************************* * + * FUNCTION: ApCustomPackage + * + * PARAMETERS: ParentOp - Parse op for the package + * Predefined - Pointer to package-specific info for + * the method + * + * RETURN: None + * + * DESCRIPTION: Validate packages that don't fit into the standard model and + * require custom code. + * + * NOTE: Currently used for the _BIX method only. When needed for two or more + * methods, probably a detect/dispatch mechanism will be required. + * + ******************************************************************************/ + +static void +ApCustomPackage ( + ACPI_PARSE_OBJECT *ParentOp, + const ACPI_PREDEFINED_INFO *Predefined) +{ + ACPI_PARSE_OBJECT *Op; + UINT32 Count; + UINT32 ExpectedCount; + UINT32 Version; + + + /* First child is the package length */ + + Op = ParentOp->Asl.Child; + Count = (UINT32) Op->Asl.Value.Integer; + + /* Get the version number, must be Integer */ + + Op = Op->Asl.Next; + Version = (UINT32) Op->Asl.Value.Integer; + if (Op->Asl.ParseOpcode != PARSEOP_INTEGER) + { + AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer); + return; + } + + /* Validate count (# of elements) */ + + ExpectedCount = 21; /* Version 1 */ + if (Version == 0) + { + ExpectedCount = 20; /* Version 0 */ + } + + if (Count < ExpectedCount) + { + ApPackageTooSmall (Predefined->Info.Name, ParentOp, + Count, ExpectedCount); + return; + } + else if (Count > ExpectedCount) + { + ApPackageTooLarge (Predefined->Info.Name, ParentOp, + Count, ExpectedCount); + } + + /* Validate all elements of the package */ + + Op = ApCheckPackageElements (Predefined->Info.Name, Op, + ACPI_RTYPE_INTEGER, 16, + ACPI_RTYPE_STRING, 4); + + /* Version 1 has a single trailing integer */ + + if (Version > 0) + { + ApCheckPackageElements (Predefined->Info.Name, Op, + ACPI_RTYPE_INTEGER, 1, 0, 0); + } +} + + +/******************************************************************************* + * * FUNCTION: ApCheckPackageElements * * PARAMETERS: PredefinedName - Name of the predefined object @@ -391,7 +481,9 @@ PackageTooSmall: * Type2 - Object type for second group * Count2 - Count for second group * - * RETURN: None + * RETURN: Next Op peer in the parse tree, after all specified elements + * have been validated. Used for multiple validations (calls + * to this function). * * DESCRIPTION: Validate all elements of a package. Works with packages that * are defined to contain up to two groups of different object @@ -399,7 +491,7 @@ PackageTooSmall: * ******************************************************************************/ -static void +static ACPI_PARSE_OBJECT * ApCheckPackageElements ( const char *PredefinedName, ACPI_PARSE_OBJECT *Op, @@ -431,6 +523,8 @@ ApCheckPackageElements ( ApCheckObjectType (PredefinedName, Op, Type2, (i + Count1)); Op = Op->Asl.Next; } + + return (Op); } diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index 001d110..9c023ff 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -865,16 +865,19 @@ RsDoOneResourceDescriptor ( break; case PARSEOP_I2C_SERIALBUS: + case PARSEOP_I2C_SERIALBUS_V2: Rnode = RsDoI2cSerialBusDescriptor (Info); break; case PARSEOP_SPI_SERIALBUS: + case PARSEOP_SPI_SERIALBUS_V2: Rnode = RsDoSpiSerialBusDescriptor (Info); break; case PARSEOP_UART_SERIALBUS: + case PARSEOP_UART_SERIALBUS_V2: Rnode = RsDoUartSerialBusDescriptor (Info); break; diff --git a/source/compiler/aslresources.y b/source/compiler/aslresources.y index fcde7e5..074536b 100644 --- a/source/compiler/aslresources.y +++ b/source/compiler/aslresources.y @@ -392,6 +392,7 @@ ResourceMacroTerm | GpioIntTerm {} | GpioIoTerm {} | I2cSerialBusTerm {} + | I2cSerialBusTermV2 {} | InterruptTerm {} | IOTerm {} | IRQNoFlagsTerm {} @@ -404,9 +405,11 @@ ResourceMacroTerm | QWordSpaceTerm {} | RegisterTerm {} | SpiSerialBusTerm {} + | SpiSerialBusTermV2 {} | StartDependentFnNoPriTerm {} | StartDependentFnTerm {} | UartSerialBusTerm {} + | UartSerialBusTermV2 {} | VendorLongTerm {} | VendorShortTerm {} | WordBusNumberTerm {} @@ -630,11 +633,30 @@ I2cSerialBusTerm OptionalResourceType /* 12: ResourceType */ OptionalNameString /* 13: DescriptorName */ OptionalBuffer_Last /* 14: VendorData */ - ')' {$$ = TrLinkChildren ($3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} + ')' {$$ = TrLinkChildren ($3,10,$4,$5,$7,$8,$10,$11,$12,$13, + TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$14);} | PARSEOP_I2C_SERIALBUS '(' error ')' {$$ = AslDoError(); yyclearin;} ; +I2cSerialBusTermV2 + : PARSEOP_I2C_SERIALBUS_V2 '(' {$$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);} + WordConstExpr /* 04: SlaveAddress */ + OptionalSlaveMode /* 05: SlaveMode */ + ',' DWordConstExpr /* 07: ConnectionSpeed */ + OptionalAddressingMode /* 08: AddressingMode */ + ',' StringData /* 10: ResourceSource */ + OptionalByteConstExpr /* 11: ResourceSourceIndex */ + OptionalResourceType /* 12: ResourceType */ + OptionalNameString /* 13: DescriptorName */ + OptionalShareType /* 14: Share */ + OptionalBuffer_Last /* 15: VendorData */ + ')' {$$ = TrLinkChildren ($3,10,$4,$5,$7,$8,$10,$11,$12,$13, + $14,$15);} + | PARSEOP_I2C_SERIALBUS_V2 '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + InterruptTerm : PARSEOP_INTERRUPT '(' {$$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} OptionalResourceType_First @@ -815,11 +837,34 @@ SpiSerialBusTerm OptionalResourceType /* 19: ResourceType */ OptionalNameString /* 20: DescriptorName */ OptionalBuffer_Last /* 21: VendorData */ - ')' {$$ = TrLinkChildren ($3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);} + ')' {$$ = TrLinkChildren ($3,14,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20, + TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} | PARSEOP_SPI_SERIALBUS '(' error ')' {$$ = AslDoError(); yyclearin;} ; +SpiSerialBusTermV2 + : PARSEOP_SPI_SERIALBUS_V2 '(' {$$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);} + WordConstExpr /* 04: DeviceSelection */ + OptionalDevicePolarity /* 05: DevicePolarity */ + OptionalWireMode /* 06: WireMode */ + ',' ByteConstExpr /* 08: DataBitLength */ + OptionalSlaveMode /* 09: SlaveMode */ + ',' DWordConstExpr /* 11: ConnectionSpeed */ + ',' ClockPolarityKeyword /* 13: ClockPolarity */ + ',' ClockPhaseKeyword /* 15: ClockPhase */ + ',' StringData /* 17: ResourceSource */ + OptionalByteConstExpr /* 18: ResourceSourceIndex */ + OptionalResourceType /* 19: ResourceType */ + OptionalNameString /* 20: DescriptorName */ + OptionalShareType /* 21: Share */ + OptionalBuffer_Last /* 22: VendorData */ + ')' {$$ = TrLinkChildren ($3,14,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20, + $21,$22);} + | PARSEOP_SPI_SERIALBUS_V2 '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + StartDependentFnNoPriTerm : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} ')' '{' @@ -854,11 +899,35 @@ UartSerialBusTerm OptionalResourceType /* 19: ResourceType */ OptionalNameString /* 20: DescriptorName */ OptionalBuffer_Last /* 21: VendorData */ - ')' {$$ = TrLinkChildren ($3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);} + ')' {$$ = TrLinkChildren ($3,15,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20, + TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);} | PARSEOP_UART_SERIALBUS '(' error ')' {$$ = AslDoError(); yyclearin;} ; +UartSerialBusTermV2 + : PARSEOP_UART_SERIALBUS_V2 '(' {$$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);} + DWordConstExpr /* 04: ConnectionSpeed */ + OptionalBitsPerByte /* 05: BitsPerByte */ + OptionalStopBits /* 06: StopBits */ + ',' ByteConstExpr /* 08: LinesInUse */ + OptionalEndian /* 09: Endianess */ + OptionalParityType /* 10: Parity */ + OptionalFlowControl /* 11: FlowControl */ + ',' WordConstExpr /* 13: Rx BufferSize */ + ',' WordConstExpr /* 15: Tx BufferSize */ + ',' StringData /* 17: ResourceSource */ + OptionalByteConstExpr /* 18: ResourceSourceIndex */ + OptionalResourceType /* 19: ResourceType */ + OptionalNameString /* 20: DescriptorName */ + OptionalShareType /* 21: Share */ + OptionalBuffer_Last /* 22: VendorData */ + ')' {$$ = TrLinkChildren ($3,15,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20, + $21,$22);} + | PARSEOP_UART_SERIALBUS_V2 '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + VendorLongTerm : PARSEOP_VENDORLONG '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} OptionalNameString_First diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c index ecdab19..fcd8e23 100644 --- a/source/compiler/aslrestype2s.c +++ b/source/compiler/aslrestype2s.c @@ -734,6 +734,11 @@ RsDoI2cSerialBusDescriptor ( Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE; Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength; + if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_I2C_SERIALBUS_V2) + { + Descriptor->I2cSerialBus.RevisionId = 2; + } + /* Build pointers to optional areas */ VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_I2C_SERIALBUS)); @@ -803,7 +808,18 @@ RsDoI2cSerialBusDescriptor ( UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); break; - case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + case 8: + /* + * Connection Share - Added for V2 (ACPI 6.0) version of the descriptor + * Note: For V1, the share bit will be zero (Op is DEFAULT_ARG from + * the ASL parser) + */ + RsSetFlagBits (&Descriptor->I2cSerialBus.Flags, InitializerOp, 2, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.Flags), 2); + break; + + case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ RsGetVendorData (InitializerOp, VendorData, CurrentByteOffset + sizeof (AML_RESOURCE_I2C_SERIALBUS)); @@ -877,6 +893,11 @@ RsDoSpiSerialBusDescriptor ( Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE; Descriptor->SpiSerialBus.TypeDataLength = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength; + if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_SPI_SERIALBUS_V2) + { + Descriptor->I2cSerialBus.RevisionId = 2; + } + /* Build pointers to optional areas */ VendorData = ACPI_ADD_PTR (UINT8, Descriptor, @@ -975,7 +996,18 @@ RsDoSpiSerialBusDescriptor ( UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); break; - case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + case 12: + /* + * Connection Share - Added for V2 (ACPI 6.0) version of the descriptor + * Note: For V1, the share bit will be zero (Op is DEFAULT_ARG from + * the ASL parser) + */ + RsSetFlagBits (&Descriptor->SpiSerialBus.Flags, InitializerOp, 2, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.Flags), 2); + break; + + case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ RsGetVendorData (InitializerOp, VendorData, CurrentByteOffset + sizeof (AML_RESOURCE_SPI_SERIALBUS)); @@ -1049,6 +1081,11 @@ RsDoUartSerialBusDescriptor ( Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE; Descriptor->UartSerialBus.TypeDataLength = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength; + if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_UART_SERIALBUS_V2) + { + Descriptor->I2cSerialBus.RevisionId = 2; + } + /* Build pointers to optional areas */ VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_UART_SERIALBUS)); @@ -1163,7 +1200,18 @@ RsDoUartSerialBusDescriptor ( UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); break; - case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + case 13: + /* + * Connection Share - Added for V2 (ACPI 6.0) version of the descriptor + * Note: For V1, the share bit will be zero (Op is DEFAULT_ARG from + * the ASL parser) + */ + RsSetFlagBits (&Descriptor->UartSerialBus.Flags, InitializerOp, 2, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.Flags), 2); + break; + + case 14: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ RsGetVendorData (InitializerOp, VendorData, CurrentByteOffset + sizeof (AML_RESOURCE_UART_SERIALBUS)); diff --git a/source/compiler/aslrules.y b/source/compiler/aslrules.y index 33aef64..a5d8387 100644 --- a/source/compiler/aslrules.y +++ b/source/compiler/aslrules.y @@ -74,6 +74,10 @@ AslCode * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the * original use of {TermList} instead (see below.) This allows the use * of Type1 and Type2 opcodes at module level. + * + * 04/2016: The module-level code is now allowed in the following terms: + * DeviceTerm, PowerResTerm, ProcessorTerm, ScopeTerm, ThermalZoneTerm. + * The ObjectList term is obsolete and has been removed. */ DefinitionBlockTerm : PARSEOP_DEFINITION_BLOCK '(' {$$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK);} @@ -189,12 +193,6 @@ FieldUnitEntry AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} ; -ObjectList - : {$$ = NULL;} - | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} - | error {$$ = AslDoError(); yyclearin;} - ; - Object : CompilerDirective {} | NamedObject {} @@ -489,6 +487,7 @@ Type1Opcode | BreakPointTerm {} | ContinueTerm {} | FatalTerm {} + | ForTerm {} | ElseIfTerm {} | LoadTerm {} | NoOpTerm {} @@ -697,7 +696,7 @@ BreakPointTerm BufferTerm : PARSEOP_BUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_BUFFER);} - OptionalTermArg + OptionalBufferLength ')' '{' BufferTermData '}' {$$ = TrLinkChildren ($3,2,$4,$7);} | PARSEOP_BUFFER '(' @@ -878,7 +877,7 @@ DeviceTerm : PARSEOP_DEVICE '(' {$$ = TrCreateLeafNode (PARSEOP_DEVICE);} NameString ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + TermList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} | PARSEOP_DEVICE '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -989,6 +988,23 @@ FindSetRightBitTerm error ')' {$$ = AslDoError(); yyclearin;} ; + /* Convert a For() loop to a While() loop */ +ForTerm + : PARSEOP_FOR '(' {$$ = TrCreateLeafNode (PARSEOP_WHILE);} + OptionalTermArg ',' {} + OptionalPredicate ',' + OptionalTermArg {$$ = TrLinkPeerNode ($4,$3); + TrSetParent ($9,$3);} /* New parent is WHILE */ + ')' '{' TermList '}' {$$ = TrLinkChildren ($3,2,$7,$13);} + {$$ = TrLinkPeerNode ($13,$9); + $$ = $10;} + ; + +OptionalPredicate + : {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, 1);} + | TermArg {$$ = $1;} + ; + FprintfTerm : PARSEOP_FPRINTF '(' {$$ = TrCreateLeafNode (PARSEOP_FPRINTF);} TermArg ',' @@ -1361,7 +1377,7 @@ PowerResTerm ',' ByteConstExpr ',' WordConstExpr ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} + TermList '}' {$$ = TrLinkChildren ($3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} | PARSEOP_POWERRESOURCE '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -1389,7 +1405,7 @@ ProcessorTerm OptionalDWordConstExpr OptionalByteConstExpr ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} + TermList '}' {$$ = TrLinkChildren ($3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} | PARSEOP_PROCESSOR '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -1444,7 +1460,7 @@ ScopeTerm : PARSEOP_SCOPE '(' {$$ = TrCreateLeafNode (PARSEOP_SCOPE);} NameString ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + TermList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} | PARSEOP_SCOPE '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -1533,7 +1549,7 @@ ThermalZoneTerm : PARSEOP_THERMALZONE '(' {$$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} NameString ')' '{' - ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + TermList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} | PARSEOP_THERMALZONE '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -1715,6 +1731,11 @@ OptionalSerializeRuleKeyword ; OptionalTermArg + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} + | TermArg {$$ = $1;} + ; + +OptionalBufferLength : {$$ = NULL;} | TermArg {$$ = $1;} ; diff --git a/source/compiler/asltokens.y b/source/compiler/asltokens.y index e7b161e..429fa42 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -166,6 +166,7 @@ NoEcho(' %token PARSEOP_GPIO_INT %token PARSEOP_GPIO_IO %token PARSEOP_I2C_SERIALBUS +%token PARSEOP_I2C_SERIALBUS_V2 %token PARSEOP_IF %token PARSEOP_INCLUDE %token PARSEOP_INCLUDE_END @@ -323,6 +324,7 @@ NoEcho(' %token PARSEOP_SLAVEMODE_DEVICEINIT %token PARSEOP_SLEEP %token PARSEOP_SPI_SERIALBUS +%token PARSEOP_SPI_SERIALBUS_V2 %token PARSEOP_STALL %token PARSEOP_STARTDEPENDENTFN %token PARSEOP_STARTDEPENDENTFN_NOPRI @@ -348,6 +350,7 @@ NoEcho(' %token PARSEOP_TYPE_STATIC %token PARSEOP_TYPE_TRANSLATION %token PARSEOP_UART_SERIALBUS +%token PARSEOP_UART_SERIALBUS_V2 %token PARSEOP_UNICODE %token PARSEOP_UNLOAD %token PARSEOP_UPDATERULE_ONES @@ -457,8 +460,11 @@ NoEcho(' %left PARSEOP_EXP_INDEX_LEFT %right PARSEOP_EXP_INDEX_RIGHT +/* Macros */ + %token PARSEOP_PRINTF %token PARSEOP_FPRINTF +%token PARSEOP_FOR /* Specific parentheses tokens are not used at this time */ /* PARSEOP_EXP_PAREN_OPEN */ diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c index 97a56ec..af67467 100644 --- a/source/compiler/asltree.c +++ b/source/compiler/asltree.c @@ -58,6 +58,29 @@ TrGetNextNode ( /******************************************************************************* * + * FUNCTION: TrSetParent + * + * PARAMETERS: Op - To be set to new parent + * ParentOp - The parent + * + * RETURN: None, sets Op parent directly + * + * DESCRIPTION: Change the parent of a parse op. + * + ******************************************************************************/ + +void +TrSetParent ( + ACPI_PARSE_OBJECT *Op, + ACPI_PARSE_OBJECT *ParentOp) +{ + + Op->Asl.Parent = ParentOp; +} + + +/******************************************************************************* + * * FUNCTION: TrGetNextNode * * PARAMETERS: None diff --git a/source/compiler/asltypes.y b/source/compiler/asltypes.y index 8d9c4d2..1faecb4 100644 --- a/source/compiler/asltypes.y +++ b/source/compiler/asltypes.y @@ -62,7 +62,6 @@ NoEcho(' %type NamedObject %type NameSpaceModifier %type Object -%type ObjectList %type PackageData %type ParameterTypePackage %type ParameterTypePackageList @@ -295,6 +294,7 @@ NoEcho(' %type PrintfArgList %type PrintfTerm %type FprintfTerm +%type ForTerm /* Resource Descriptors */ @@ -312,6 +312,7 @@ NoEcho(' %type GpioIntTerm %type GpioIoTerm %type I2cSerialBusTerm +%type I2cSerialBusTermV2 %type InterruptTerm %type IOTerm %type IRQNoFlagsTerm @@ -326,9 +327,11 @@ NoEcho(' %type QWordSpaceTerm %type RegisterTerm %type SpiSerialBusTerm +%type SpiSerialBusTermV2 %type StartDependentFnNoPriTerm %type StartDependentFnTerm %type UartSerialBusTerm +%type UartSerialBusTermV2 %type VendorLongTerm %type VendorShortTerm %type WordBusNumberTerm @@ -347,6 +350,7 @@ NoEcho(' %type OptionalAddressRange %type OptionalBitsPerByte %type OptionalBuffer_Last +%type OptionalBufferLength %type OptionalByteConstExpr %type OptionalCount %type OptionalDecodeType @@ -366,6 +370,7 @@ NoEcho(' %type OptionalParameterTypePackage %type OptionalParameterTypesPackage %type OptionalParityType +%type OptionalPredicate %type OptionalQWordConstExpr %type OptionalRangeType %type OptionalReference diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index 65be505..9eb0411 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -758,6 +758,11 @@ DtCompilePcct ( InfoTable = AcpiDmTableInfoPcct1; break; + case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2: + + InfoTable = AcpiDmTableInfoPcct2; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT"); diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index 93747fc..23ef051 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -844,28 +844,39 @@ const unsigned char TemplateMtmr[] = const unsigned char TemplatePcct[] = { - 0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00, /* 00000000 "PCCT...." */ - 0x01,0xCF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ - 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ + 0x50,0x43,0x43,0x54,0x06,0x01,0x00,0x00, /* 00000000 "PCCT...." */ + 0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x27,0x06,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "'.. ...." */ + 0x18,0x03,0x16,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ - 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ - 0x01,0x32,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ".2......" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ - 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000058 "........" */ - 0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00, /* 00000060 "........" */ - 0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x3E, /* 00000068 ".......>" */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, /* 00000078 "........" */ + 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, /* 00000038 "........" */ + 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000040 """""""""" */ + 0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33, /* 00000048 ".2..3333" */ + 0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44, /* 00000050 "3333DDDD" */ + 0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55, /* 00000058 "DDDDUUUU" */ + 0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66, /* 00000060 "UUUUffff" */ + 0x77,0x77,0x77,0x77,0x88,0x88,0x01,0x3E, /* 00000068 "wwww...>" */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000080 ".......2" */ - 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ - 0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000098 "........" */ - 0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0x00, /* 000000A0 "........" */ - 0x00,0x00,0x01,0x00 /* 000000A8 "...." */ + 0x00,0x03,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000088 "..DDDDDD" */ + 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000090 "DDDDDDDD" */ + 0x44,0x44,0x55,0x55,0x55,0x55,0x55,0x55, /* 00000098 "DDUUUUUU" */ + 0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77, /* 000000A0 "UUffffww" */ + 0x77,0x77,0x88,0x88,0x02,0x5A,0x01,0x00, /* 000000A8 "ww...Z.." */ + 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x32,0x00,0x03, /* 000000C0 ".....2.." */ + 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000C8 "DDDDDDDD" */ + 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000D0 "DDDDDDDD" */ + 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, /* 000000D8 "UUUUUUUU" */ + 0x66,0x66,0x66,0x66,0x77,0x77,0x77,0x77, /* 000000E0 "ffffwwww" */ + 0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33, /* 000000E8 "...2..33" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 000000F0 "333333DD" */ + 0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55, /* 000000F8 "DDDDDDUU" */ + 0x55,0x55,0x55,0x55,0x55,0x55 /* 00000100 "UUUUUU" */ }; const unsigned char TemplatePmtt[] = diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index f7cbb91..581cc29 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -798,7 +798,7 @@ AcpiDbIntegrityWalk ( return (AE_OK); } - if (!AcpiUtValidAcpiName (Node->Name.Ascii)) + if (!AcpiUtValidNameseg (Node->Name.Ascii)) { AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node); return (AE_OK); diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c index 32ab5be..2f61dea 100644 --- a/source/components/disassembler/dmcstyle.c +++ b/source/components/disassembler/dmcstyle.c @@ -215,6 +215,7 @@ AcpiDmCheckForSymbolicOpcode ( Child1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX; Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX; + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; /* Save symbol string in the next child (not peer) */ @@ -378,7 +379,7 @@ AcpiDmCheckForSymbolicOpcode ( /* Convert operator to compound assignment */ - Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; Child1->Common.OperatorSymbol = NULL; return (TRUE); } @@ -406,7 +407,7 @@ AcpiDmCheckForSymbolicOpcode ( /* Convert operator to compound assignment */ - Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND_ASSIGNMENT; Child1->Common.OperatorSymbol = NULL; return (TRUE); } @@ -522,6 +523,19 @@ AcpiDmCheckForSymbolicOpcode ( break; } + /* + * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens + * output here. We also need to check the parent to see if this op + * is part of a compound test (!=, >=, <=). + */ + if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) || + ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && + (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX))) + { + /* Do Nothing. Paren already generated */ + return (TRUE); + } + /* All other operators, emit an open paren */ AcpiOsPrintf ("("); @@ -547,6 +561,7 @@ void AcpiDmCloseOperator ( ACPI_PARSE_OBJECT *Op) { + BOOLEAN IsCStyleOp = FALSE; /* Always emit paren if ASL+ disassembly disabled */ @@ -578,7 +593,7 @@ AcpiDmCloseOperator ( /* Emit paren only if this is not a compound assignment */ - if (Op->Common.DisasmFlags & ACPI_PARSEOP_COMPOUND) + if (Op->Common.DisasmFlags & ACPI_PARSEOP_COMPOUND_ASSIGNMENT) { return; } @@ -589,6 +604,8 @@ AcpiDmCloseOperator ( { AcpiOsPrintf (")"); } + + IsCStyleOp = TRUE; break; case AML_INDEX_OP: @@ -616,7 +633,21 @@ AcpiDmCloseOperator ( break; } + /* + * Nodes marked with ACPI_PARSEOP_PARAMLIST don't need a parens + * output here. We also need to check the parent to see if this op + * is part of a compound test (!=, >=, <=). + */ + if (IsCStyleOp && + ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) || + ((Op->Common.Parent->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && + (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX)))) + { + return; + } + AcpiOsPrintf (")"); + return; } diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 8f163ca..f4d1319 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -249,11 +249,11 @@ AcpiDmPredefinedDescription ( /* Ensure that the comment field is emitted only once */ - if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED) + if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED) { return; } - Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED; + Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED; /* Predefined name must start with an underscore */ @@ -385,11 +385,11 @@ AcpiDmFieldPredefinedDescription ( /* Ensure that the comment field is emitted only once */ - if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED) + if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED) { return; } - Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED; + Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED; /* * Op must be one of the Create* operators: CreateField, CreateBitField, @@ -1051,10 +1051,16 @@ AcpiDmConvertToElseIf ( ACPI_PARSE_OBJECT *ElseOp; - /* Examine the first child of the Else */ - + /* + * To be able to perform the conversion, two conditions must be satisfied: + * 1) The first child of the Else must be an If statement. + * 2) The If block can only be followed by an Else block and these must + * be the only blocks under the original Else. + */ IfOp = OriginalElseOp->Common.Value.Arg; - if (!IfOp || (IfOp->Common.AmlOpcode != AML_IF_OP)) + if (!IfOp || + (IfOp->Common.AmlOpcode != AML_IF_OP) || + (IfOp->Asl.Next && (IfOp->Asl.Next->Common.AmlOpcode != AML_ELSE_OP))) { /* Not an Else..If sequence, cannot convert to ElseIf */ diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index da56e4f..c725bec 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -500,7 +500,7 @@ AcpiDmI2cSerialBusDescriptor ( /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */ AcpiDmIndent (Level); - AcpiOsPrintf ("I2cSerialBus (0x%4.4X, %s, 0x%8.8X,\n", + AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n", Resource->I2cSerialBus.SlaveAddress, AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)], Resource->I2cSerialBus.ConnectionSpeed); @@ -529,7 +529,11 @@ AcpiDmI2cSerialBusDescriptor ( /* Insert a descriptor name */ AcpiDmDescriptorName (); - AcpiOsPrintf (",\n"); + + /* Share */ + + AcpiOsPrintf (", %s,\n", + AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 2)]); /* Dump the vendor data */ @@ -570,7 +574,7 @@ AcpiDmSpiSerialBusDescriptor ( /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */ AcpiDmIndent (Level); - AcpiOsPrintf ("SpiSerialBus (0x%4.4X, %s, %s, 0x%2.2X,\n", + AcpiOsPrintf ("SpiSerialBusV2 (0x%4.4X, %s, %s, 0x%2.2X,\n", Resource->SpiSerialBus.DeviceSelection, AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)], AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)], @@ -608,7 +612,11 @@ AcpiDmSpiSerialBusDescriptor ( /* Insert a descriptor name */ AcpiDmDescriptorName (); - AcpiOsPrintf (",\n"); + + /* Share */ + + AcpiOsPrintf (", %s,\n", + AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 2)]); /* Dump the vendor data */ @@ -649,7 +657,7 @@ AcpiDmUartSerialBusDescriptor ( /* ConnectionSpeed, BitsPerByte, StopBits */ AcpiDmIndent (Level); - AcpiOsPrintf ("UartSerialBus (0x%8.8X, %s, %s,\n", + AcpiOsPrintf ("UartSerialBusV2 (0x%8.8X, %s, %s,\n", Resource->UartSerialBus.DefaultBaudRate, AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)], AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]); @@ -690,7 +698,11 @@ AcpiDmUartSerialBusDescriptor ( /* Insert a descriptor name */ AcpiDmDescriptorName (); - AcpiOsPrintf (",\n"); + + /* Share */ + + AcpiOsPrintf (", %s,\n", + AcpiGbl_ShrDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 2)]); /* Dump the vendor data */ diff --git a/source/components/disassembler/dmutils.c b/source/components/disassembler/dmutils.c index 2a82e1e..02717bc 100644 --- a/source/components/disassembler/dmutils.c +++ b/source/components/disassembler/dmutils.c @@ -279,8 +279,8 @@ AcpiDmCommaIfListMember ( } } - if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST) && - (!(Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST))) + if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && + (!(Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST))) { return (FALSE); } @@ -295,8 +295,8 @@ AcpiDmCommaIfListMember ( return (TRUE); } - else if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST) && - (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) + else if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) && + (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST)) { AcpiOsPrintf (", "); return (TRUE); diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 43f5686..7465e75 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -460,24 +460,24 @@ AcpiDmDescendingOp ( NextOp = AcpiPsGetDepthNext (NULL, Op); if (NextOp) { - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; - } - - /* - * A Zero predicate indicates the possibility of one or more - * External() opcodes within the If() block. - */ - if (NextOp->Common.AmlOpcode == AML_ZERO_OP) - { - NextOp2 = NextOp->Common.Next; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; - if (NextOp2 && - (NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP)) + /* + * A Zero predicate indicates the possibility of one or more + * External() opcodes within the If() block. + */ + if (NextOp->Common.AmlOpcode == AML_ZERO_OP) { - /* Ignore the If 0 block and all children */ + NextOp2 = NextOp->Common.Next; - Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - return (AE_CTRL_DEPTH); + if (NextOp2 && + (NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP)) + { + /* Ignore the If 0 block and all children */ + + Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + return (AE_CTRL_DEPTH); + } } } } @@ -514,7 +514,7 @@ AcpiDmDescendingOp ( } } else if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) && - (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) && + (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST)) && (!(Op->Common.DisasmFlags & ACPI_PARSEOP_ELSEIF)) && (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP)) { @@ -668,10 +668,10 @@ AcpiDmDescendingOp ( AcpiOsPrintf (", "); NextOp = AcpiPsGetDepthNext (NULL, Op); - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; NextOp = NextOp->Common.Next; - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; return (AE_OK); case AML_PROCESSOR_OP: @@ -680,13 +680,13 @@ AcpiDmDescendingOp ( AcpiOsPrintf (", "); NextOp = AcpiPsGetDepthNext (NULL, Op); - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; NextOp = NextOp->Common.Next; - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; NextOp = NextOp->Common.Next; - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; return (AE_OK); case AML_MUTEX_OP: @@ -745,12 +745,12 @@ AcpiDmDescendingOp ( * Bank Value. This is a TermArg in the middle of the parameter * list, must handle it here. * - * Disassemble the TermArg parse tree. ACPI_PARSEOP_PARAMLIST + * Disassemble the TermArg parse tree. ACPI_PARSEOP_PARAMETER_LIST * eliminates newline in the output. */ NextOp = NextOp->Common.Next; - Info->Flags = ACPI_PARSEOP_PARAMLIST; + Info->Flags = ACPI_PARSEOP_PARAMETER_LIST; AcpiDmWalkParseTree (NextOp, AcpiDmDescendingOp, AcpiDmAscendingOp, Info); Info->Flags = 0; @@ -812,7 +812,7 @@ AcpiDmDescendingOp ( /* Normal Buffer, mark size as in the parameter list */ - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; return (AE_OK); case AML_IF_OP: @@ -824,7 +824,7 @@ AcpiDmDescendingOp ( NextOp = AcpiPsGetDepthNext (NULL, Op); if (NextOp) { - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; } return (AE_OK); @@ -835,7 +835,7 @@ AcpiDmDescendingOp ( NextOp = AcpiPsGetDepthNext (NULL, Op); if (NextOp) { - NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; } return (AE_OK); @@ -934,14 +934,14 @@ AcpiDmAscendingOp ( if (!AcpiDmCommaIfListMember (Op)) { if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) && - (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) && + (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST)) && (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP)) { /* * This is a first-level element of a term list * start a new line */ - if (!(Info->Flags & ACPI_PARSEOP_PARAMLIST)) + if (!(Info->Flags & ACPI_PARSEOP_PARAMETER_LIST)) { AcpiOsPrintf ("\n"); } @@ -996,7 +996,7 @@ AcpiDmAscendingOp ( if (!AcpiDmCommaIfListMember (Op)) { if ((AcpiDmBlockType (Op->Common.Parent) & BLOCK_BRACE) && - (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) && + (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST)) && (Op->Common.AmlOpcode != AML_INT_BYTELIST_OP)) { /* @@ -1013,7 +1013,7 @@ AcpiDmAscendingOp ( case AML_PACKAGE_OP: case AML_VAR_PACKAGE_OP: - if (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) + if (!(Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST)) { AcpiOsPrintf ("\n"); } @@ -1027,17 +1027,17 @@ AcpiDmAscendingOp ( break; } - if (Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST) + if (Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST) { if ((Op->Common.Next) && - (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST)) + (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMETER_LIST)) { return (AE_OK); } /* * The parent Op is guaranteed to be valid because of the flag - * ACPI_PARSEOP_PARAMLIST -- which means that this op is part of + * ACPI_PARSEOP_PARAMETER_LIST -- which means that this op is part of * a parameter list and thus has a valid parent. */ ParentOp = Op->Common.Parent; diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c index 25d278c..334dadc 100644 --- a/source/components/dispatcher/dsmethod.c +++ b/source/components/dispatcher/dsmethod.c @@ -460,6 +460,9 @@ AcpiDsBeginMethodExecution ( { ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel = ObjDesc->Method.Mutex->Mutex.SyncLevel; + + ObjDesc->Method.Mutex->Mutex.ThreadId = + AcpiOsGetThreadId (); } } diff --git a/source/components/executer/exfldio.c b/source/components/executer/exfldio.c index fd46a0c..a865a86 100644 --- a/source/components/executer/exfldio.c +++ b/source/components/executer/exfldio.c @@ -946,20 +946,9 @@ AcpiExInsertIntoField ( AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth); - /* - * Create the bitmasks used for bit insertion. - * Note: This if/else is used to bypass compiler differences with the - * shift operator - */ - if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE) - { - WidthMask = ACPI_UINT64_MAX; - } - else - { - WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth); - } + /* Create the bitmasks used for bit insertion */ + WidthMask = ACPI_MASK_BITS_ABOVE_64 (AccessBitWidth); Mask = WidthMask & ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset); diff --git a/source/components/executer/exnames.c b/source/components/executer/exnames.c index 4ed1664..817a011 100644 --- a/source/components/executer/exnames.c +++ b/source/components/executer/exnames.c @@ -204,7 +204,7 @@ AcpiExNameSegment ( ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Bytes from stream:\n")); for (Index = 0; - (Index < ACPI_NAME_SIZE) && (AcpiUtValidAcpiChar (*AmlAddress, 0)); + (Index < ACPI_NAME_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0)); Index++) { CharBuf[Index] = *AmlAddress++; diff --git a/source/components/hardware/hwregs.c b/source/components/hardware/hwregs.c index 55cdd07..87c18d1 100644 --- a/source/components/hardware/hwregs.c +++ b/source/components/hardware/hwregs.c @@ -54,6 +54,11 @@ /* Local Prototypes */ +static UINT8 +AcpiHwGetAccessBitWidth ( + ACPI_GENERIC_ADDRESS *Reg, + UINT8 MaxBitWidth); + static ACPI_STATUS AcpiHwReadMultiple ( UINT32 *Value, @@ -71,6 +76,43 @@ AcpiHwWriteMultiple ( /****************************************************************************** * + * FUNCTION: AcpiHwGetAccessBitWidth + * + * PARAMETERS: Reg - GAS register structure + * MaxBitWidth - Max BitWidth supported (32 or 64) + * + * RETURN: Status + * + * DESCRIPTION: Obtain optimal access bit width + * + ******************************************************************************/ + +static UINT8 +AcpiHwGetAccessBitWidth ( + ACPI_GENERIC_ADDRESS *Reg, + UINT8 MaxBitWidth) +{ + + if (!Reg->AccessWidth) + { + if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO) + { + return (32); + } + else + { + return (MaxBitWidth); + } + } + else + { + return (1 << (Reg->AccessWidth + 2)); + } +} + + +/****************************************************************************** + * * FUNCTION: AcpiHwValidateRegister * * PARAMETERS: Reg - GAS register structure @@ -134,8 +176,7 @@ AcpiHwValidateRegister ( /* Validate the BitWidth, convert AccessWidth into number of bits */ - AccessWidth = Reg->AccessWidth ? Reg->AccessWidth : 1; - AccessWidth = 1 << (AccessWidth + 2); + AccessWidth = AcpiHwGetAccessBitWidth (Reg, MaxBitWidth); BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth); if (MaxBitWidth < BitWidth) { @@ -198,9 +239,8 @@ AcpiHwRead ( * into number of bits based */ *Value = 0; - AccessWidth = Reg->AccessWidth ? Reg->AccessWidth : 1; - AccessWidth = 1 << (AccessWidth + 2); - BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth); + AccessWidth = AcpiHwGetAccessBitWidth (Reg, 32); + BitWidth = Reg->BitOffset + Reg->BitWidth; BitOffset = Reg->BitOffset; /* @@ -243,7 +283,7 @@ AcpiHwRead ( } ACPI_SET_BITS (Value, Index * AccessWidth, - ((1 << AccessWidth) - 1), Value32); + ACPI_MASK_BITS_ABOVE_32 (AccessWidth), Value32); BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth; Index++; @@ -301,9 +341,8 @@ AcpiHwWrite ( /* Convert AccessWidth into number of bits based */ - AccessWidth = Reg->AccessWidth ? Reg->AccessWidth : 1; - AccessWidth = 1 << (AccessWidth + 2); - BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth); + AccessWidth = AcpiHwGetAccessBitWidth (Reg, 32); + BitWidth = Reg->BitOffset + Reg->BitWidth; BitOffset = Reg->BitOffset; /* @@ -313,8 +352,8 @@ AcpiHwWrite ( Index = 0; while (BitWidth) { - NewValue32 = ACPI_GET_BITS (&Value, (Index * AccessWidth), - ((1 << AccessWidth) - 1)); + NewValue32 = ACPI_GET_BITS (&Value, Index * AccessWidth, + ACPI_MASK_BITS_ABOVE_32 (AccessWidth)); if (BitOffset > AccessWidth) { diff --git a/source/components/namespace/nsinit.c b/source/components/namespace/nsinit.c index 067dffe..dbe6c7c 100644 --- a/source/components/namespace/nsinit.c +++ b/source/components/namespace/nsinit.c @@ -215,7 +215,7 @@ AcpiNsInitializeDevices ( /* * Execute \_SB._INI. - * There appears to be a strict order requirement for \_SB._INI, + * There appears to be a strict order requirement for \_SB._INI, * which should be evaluated before any _REG evaluations. */ Status = AcpiGetHandle (NULL, "\\_SB", &Handle); diff --git a/source/components/namespace/nsprepkg.c b/source/components/namespace/nsprepkg.c index 141251f..ae75c1a 100644 --- a/source/components/namespace/nsprepkg.c +++ b/source/components/namespace/nsprepkg.c @@ -70,6 +70,12 @@ AcpiNsCheckPackageElements ( UINT32 Count2, UINT32 StartIndex); +static ACPI_STATUS +AcpiNsCustomPackage ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count); + /******************************************************************************* * @@ -148,6 +154,11 @@ AcpiNsCheckPackage ( */ switch (Package->RetInfo.Type) { + case ACPI_PTYPE_CUSTOM: + + Status = AcpiNsCustomPackage (Info, Elements, Count); + break; + case ACPI_PTYPE1_FIXED: /* * The package count is fixed and there are no subpackages @@ -626,6 +637,92 @@ PackageTooSmall: /******************************************************************************* * + * FUNCTION: AcpiNsCustomPackage + * + * PARAMETERS: Info - Method execution information block + * Elements - Pointer to the package elements array + * Count - Element count for the package + * + * RETURN: Status + * + * DESCRIPTION: Check a returned package object for the correct count and + * correct type of all sub-objects. + * + * NOTE: Currently used for the _BIX method only. When needed for two or more + * methods, probably a detect/dispatch mechanism will be required. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsCustomPackage ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count) +{ + UINT32 ExpectedCount; + UINT32 Version; + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_NAME (NsCustomPackage); + + + /* Get version number, must be Integer */ + + if ((*Elements)->Common.Type != ACPI_TYPE_INTEGER) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Return Package has invalid object type for version number")); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } + + Version = (UINT32) (*Elements)->Integer.Value; + ExpectedCount = 21; /* Version 1 */ + + if (Version == 0) + { + ExpectedCount = 20; /* Version 0 */ + } + + if (Count < ExpectedCount) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Return Package is too small - found %u elements, expected %u", + Count, ExpectedCount)); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); + } + else if (Count > ExpectedCount) + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Return Package is larger than needed - " + "found %u, expected %u\n", + Info->FullPathname, Count, ExpectedCount)); + } + + /* Validate all elements of the returned package */ + + Status = AcpiNsCheckPackageElements (Info, Elements, + ACPI_RTYPE_INTEGER, 16, + ACPI_RTYPE_STRING, 4, 0); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Version 1 has a single trailing integer */ + + if (Version > 0) + { + Status = AcpiNsCheckPackageElements (Info, Elements + 20, + ACPI_RTYPE_INTEGER, 1, 0, 0, 20); + } + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiNsCheckPackageElements * * PARAMETERS: Info - Method execution information block diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c index 91f8b72..b88ecf5 100644 --- a/source/components/namespace/nsxfeval.c +++ b/source/components/namespace/nsxfeval.c @@ -305,13 +305,12 @@ AcpiEvaluateObject ( } -#if 0 +#ifdef _FUTURE_FEATURE /* * Begin incoming argument count analysis. Check for too few args * and too many args. */ - switch (AcpiNsGetType (Info->Node)) { case ACPI_TYPE_METHOD: @@ -399,69 +398,74 @@ AcpiEvaluateObject ( * If we are expecting a return value, and all went well above, * copy the return value to an external object. */ - if (ReturnBuffer) + if (!ReturnBuffer) + { + goto CleanupReturnObject; + } + + if (!Info->ReturnObject) + { + ReturnBuffer->Length = 0; + goto Cleanup; + } + + if (ACPI_GET_DESCRIPTOR_TYPE (Info->ReturnObject) == + ACPI_DESC_TYPE_NAMED) { - if (!Info->ReturnObject) + /* + * If we received a NS Node as a return object, this means that + * the object we are evaluating has nothing interesting to + * return (such as a mutex, etc.) We return an error because + * these types are essentially unsupported by this interface. + * We don't check up front because this makes it easier to add + * support for various types at a later date if necessary. + */ + Status = AE_TYPE; + Info->ReturnObject = NULL; /* No need to delete a NS Node */ + ReturnBuffer->Length = 0; + } + + if (ACPI_FAILURE (Status)) + { + goto CleanupReturnObject; + } + + /* Dereference Index and RefOf references */ + + AcpiNsResolveReferences (Info); + + /* Get the size of the returned object */ + + Status = AcpiUtGetObjectSize (Info->ReturnObject, + &BufferSpaceNeeded); + if (ACPI_SUCCESS (Status)) + { + /* Validate/Allocate/Clear caller buffer */ + + Status = AcpiUtInitializeBuffer (ReturnBuffer, + BufferSpaceNeeded); + if (ACPI_FAILURE (Status)) { - ReturnBuffer->Length = 0; + /* + * Caller's buffer is too small or a new one can't + * be allocated + */ + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Needed buffer size %X, %s\n", + (UINT32) BufferSpaceNeeded, + AcpiFormatException (Status))); } else { - if (ACPI_GET_DESCRIPTOR_TYPE (Info->ReturnObject) == - ACPI_DESC_TYPE_NAMED) - { - /* - * If we received a NS Node as a return object, this means that - * the object we are evaluating has nothing interesting to - * return (such as a mutex, etc.) We return an error because - * these types are essentially unsupported by this interface. - * We don't check up front because this makes it easier to add - * support for various types at a later date if necessary. - */ - Status = AE_TYPE; - Info->ReturnObject = NULL; /* No need to delete a NS Node */ - ReturnBuffer->Length = 0; - } + /* We have enough space for the object, build it */ - if (ACPI_SUCCESS (Status)) - { - /* Dereference Index and RefOf references */ - - AcpiNsResolveReferences (Info); - - /* Get the size of the returned object */ - - Status = AcpiUtGetObjectSize (Info->ReturnObject, - &BufferSpaceNeeded); - if (ACPI_SUCCESS (Status)) - { - /* Validate/Allocate/Clear caller buffer */ - - Status = AcpiUtInitializeBuffer (ReturnBuffer, - BufferSpaceNeeded); - if (ACPI_FAILURE (Status)) - { - /* - * Caller's buffer is too small or a new one can't - * be allocated - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Needed buffer size %X, %s\n", - (UINT32) BufferSpaceNeeded, - AcpiFormatException (Status))); - } - else - { - /* We have enough space for the object, build it */ - - Status = AcpiUtCopyIobjectToEobject ( - Info->ReturnObject, ReturnBuffer); - } - } - } + Status = AcpiUtCopyIobjectToEobject ( + Info->ReturnObject, ReturnBuffer); } } +CleanupReturnObject: + if (Info->ReturnObject) { /* diff --git a/source/components/parser/psutils.c b/source/components/parser/psutils.c index 29cac85..9b1019c 100644 --- a/source/components/parser/psutils.c +++ b/source/components/parser/psutils.c @@ -148,7 +148,7 @@ AcpiPsAllocOp ( } else if (OpInfo->Flags & AML_NAMED) { - Flags = ACPI_PARSEOP_NAMED; + Flags = ACPI_PARSEOP_NAMED_OBJECT; } else if (Opcode == AML_INT_BYTELIST_OP) { diff --git a/source/components/resources/rsdumpinfo.c b/source/components/resources/rsdumpinfo.c index bec10dc..bc779ce 100644 --- a/source/components/resources/rsdumpinfo.c +++ b/source/components/resources/rsdumpinfo.c @@ -265,19 +265,20 @@ ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[4] = {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.Type), "Type", AcpiGbl_SbtDecode}, \ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, \ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.SlaveMode), "SlaveMode", AcpiGbl_SmDecode}, \ + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.ConnectionSharing),"ConnectionSharing", AcpiGbl_ShrDecode}, \ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.TypeRevisionId), "TypeRevisionId", NULL}, \ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.TypeDataLength), "TypeDataLength", NULL}, \ {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (CommonSerialBus.ResourceSource), "ResourceSource", NULL}, \ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.VendorLength), "VendorLength", NULL}, \ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (CommonSerialBus.VendorData), "VendorData", NULL}, -ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[10] = +ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[11] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpCommonSerialBus), "Common Serial Bus", NULL}, ACPI_RS_DUMP_COMMON_SERIAL_BUS }; -ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[13] = +ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[14] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpI2cSerialBus), "I2C Serial Bus", NULL}, ACPI_RS_DUMP_COMMON_SERIAL_BUS @@ -286,7 +287,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[13] = {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (I2cSerialBus.SlaveAddress), "SlaveAddress", NULL}, }; -ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[17] = +ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[18] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpSpiSerialBus), "Spi Serial Bus", NULL}, ACPI_RS_DUMP_COMMON_SERIAL_BUS @@ -299,7 +300,7 @@ ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[17] = {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (SpiSerialBus.ConnectionSpeed), "ConnectionSpeed", NULL}, }; -ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[19] = +ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[20] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpUartSerialBus), "Uart Serial Bus", NULL}, ACPI_RS_DUMP_COMMON_SERIAL_BUS diff --git a/source/components/resources/rsserial.c b/source/components/resources/rsserial.c index bbc6900..1eae450 100644 --- a/source/components/resources/rsserial.c +++ b/source/components/resources/rsserial.c @@ -153,7 +153,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] = * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[16] = +ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[17] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS), @@ -179,6 +179,10 @@ ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[16] = AML_OFFSET (CommonSerialBus.Flags), 1}, + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing), + AML_OFFSET (CommonSerialBus.Flags), + 2}, + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), AML_OFFSET (CommonSerialBus.TypeRevisionId), 1}, @@ -233,7 +237,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[16] = * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[20] = +ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[21] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS), @@ -259,6 +263,10 @@ ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[20] = AML_OFFSET (CommonSerialBus.Flags), 1}, + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing), + AML_OFFSET (CommonSerialBus.Flags), + 2}, + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), AML_OFFSET (CommonSerialBus.TypeRevisionId), 1}, @@ -329,7 +337,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[20] = * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[22] = +ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[23] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS), @@ -355,6 +363,10 @@ ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[22] = AML_OFFSET (CommonSerialBus.Flags), 1}, + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing), + AML_OFFSET (CommonSerialBus.Flags), + 2}, + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), AML_OFFSET (CommonSerialBus.TypeRevisionId), 1}, diff --git a/source/components/tables/tbdata.c b/source/components/tables/tbdata.c index fd69a57..31fa25b 100644 --- a/source/components/tables/tbdata.c +++ b/source/components/tables/tbdata.c @@ -441,7 +441,7 @@ AcpiTbVerifyTempTable ( ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, "%4.4s 0x%8.8X%8.8X" " Attempted table install failed", - AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ? + AcpiUtValidNameseg (TableDesc->Signature.Ascii) ? TableDesc->Signature.Ascii : "????", ACPI_FORMAT_UINT64 (TableDesc->Address))); diff --git a/source/components/tables/tbfind.c b/source/components/tables/tbfind.c index d144cab..32839a3 100644 --- a/source/components/tables/tbfind.c +++ b/source/components/tables/tbfind.c @@ -83,7 +83,7 @@ AcpiTbFindTable ( /* Validate the input table signature */ - if (!AcpiIsValidSignature (Signature)) + if (!AcpiUtValidNameseg (Signature)) { return_ACPI_STATUS (AE_BAD_SIGNATURE); } diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c index 32d63ee..78e8b4e 100644 --- a/source/components/tables/tbinstal.c +++ b/source/components/tables/tbinstal.c @@ -326,7 +326,7 @@ AcpiTbInstallStandardTable ( ACPI_BIOS_ERROR ((AE_INFO, "Table has invalid signature [%4.4s] (0x%8.8X), " "must be SSDT or OEMx", - AcpiUtValidAcpiName (NewTableDesc.Signature.Ascii) ? + AcpiUtValidNameseg (NewTableDesc.Signature.Ascii) ? NewTableDesc.Signature.Ascii : "????", NewTableDesc.Signature.Integer)); diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index 3e68d75..5fc07b7 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -411,36 +411,3 @@ NextTable: AcpiOsUnmapMemory (Table, Length); return_ACPI_STATUS (AE_OK); } - - -/******************************************************************************* - * - * FUNCTION: AcpiIsValidSignature - * - * PARAMETERS: Signature - Sig string to be validated - * - * RETURN: TRUE if signature is has 4 valid ACPI characters - * - * DESCRIPTION: Validate an ACPI table signature. - * - ******************************************************************************/ - -BOOLEAN -AcpiIsValidSignature ( - char *Signature) -{ - UINT32 i; - - - /* Validate each character in the signature */ - - for (i = 0; i < ACPI_NAME_SIZE; i++) - { - if (!AcpiUtValidAcpiChar (Signature[i], i)) - { - return (FALSE); - } - } - - return (TRUE); -} diff --git a/source/components/utilities/utascii.c b/source/components/utilities/utascii.c new file mode 100644 index 0000000..25c02e6 --- /dev/null +++ b/source/components/utilities/utascii.c @@ -0,0 +1,161 @@ +/****************************************************************************** + * + * Module Name: utascii - Utility ascii functions + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2016, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include "acpi.h" +#include "accommon.h" + + +/******************************************************************************* + * + * FUNCTION: AcpiUtValidNameseg + * + * PARAMETERS: Name - The name or table signature to be examined. + * Four characters, does not have to be a + * NULL terminated string. + * + * RETURN: TRUE if signature is has 4 valid ACPI characters + * + * DESCRIPTION: Validate an ACPI table signature. + * + ******************************************************************************/ + +BOOLEAN +AcpiUtValidNameseg ( + char *Name) +{ + UINT32 i; + + + /* Validate each character in the signature */ + + for (i = 0; i < ACPI_NAME_SIZE; i++) + { + if (!AcpiUtValidNameChar (Name[i], i)) + { + return (FALSE); + } + } + + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtValidNameChar + * + * PARAMETERS: Char - The character to be examined + * Position - Byte position (0-3) + * + * RETURN: TRUE if the character is valid, FALSE otherwise + * + * DESCRIPTION: Check for a valid ACPI character. Must be one of: + * 1) Upper case alpha + * 2) numeric + * 3) underscore + * + * We allow a '!' as the last character because of the ASF! table + * + ******************************************************************************/ + +BOOLEAN +AcpiUtValidNameChar ( + char Character, + UINT32 Position) +{ + + if (!((Character >= 'A' && Character <= 'Z') || + (Character >= '0' && Character <= '9') || + (Character == '_'))) + { + /* Allow a '!' in the last position */ + + if (Character == '!' && Position == 3) + { + return (TRUE); + } + + return (FALSE); + } + + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtCheckAndRepairAscii + * + * PARAMETERS: Name - Ascii string + * Count - Number of characters to check + * + * RETURN: None + * + * DESCRIPTION: Ensure that the requested number of characters are printable + * Ascii characters. Sets non-printable and null chars to . + * + ******************************************************************************/ + +void +AcpiUtCheckAndRepairAscii ( + UINT8 *Name, + char *RepairedName, + UINT32 Count) +{ + UINT32 i; + + + for (i = 0; i < Count; i++) + { + RepairedName[i] = (char) Name[i]; + + if (!Name[i]) + { + return; + } + if (!isprint (Name[i])) + { + RepairedName[i] = ' '; + } + } +} diff --git a/source/components/utilities/utstring.c b/source/components/utilities/utstring.c index 646307e..cb46193 100644 --- a/source/components/utilities/utstring.c +++ b/source/components/utilities/utstring.c @@ -159,86 +159,6 @@ AcpiUtPrintString ( /******************************************************************************* * - * FUNCTION: AcpiUtValidAcpiChar - * - * PARAMETERS: Char - The character to be examined - * Position - Byte position (0-3) - * - * RETURN: TRUE if the character is valid, FALSE otherwise - * - * DESCRIPTION: Check for a valid ACPI character. Must be one of: - * 1) Upper case alpha - * 2) numeric - * 3) underscore - * - * We allow a '!' as the last character because of the ASF! table - * - ******************************************************************************/ - -BOOLEAN -AcpiUtValidAcpiChar ( - char Character, - UINT32 Position) -{ - - if (!((Character >= 'A' && Character <= 'Z') || - (Character >= '0' && Character <= '9') || - (Character == '_'))) - { - /* Allow a '!' in the last position */ - - if (Character == '!' && Position == 3) - { - return (TRUE); - } - - return (FALSE); - } - - return (TRUE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtValidAcpiName - * - * PARAMETERS: Name - The name to be examined. Does not have to - * be NULL terminated string. - * - * RETURN: TRUE if the name is valid, FALSE otherwise - * - * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: - * 1) Upper case alpha - * 2) numeric - * 3) underscore - * - ******************************************************************************/ - -BOOLEAN -AcpiUtValidAcpiName ( - char *Name) -{ - UINT32 i; - - - ACPI_FUNCTION_ENTRY (); - - - for (i = 0; i < ACPI_NAME_SIZE; i++) - { - if (!AcpiUtValidAcpiChar (Name[i], i)) - { - return (FALSE); - } - } - - return (TRUE); -} - - -/******************************************************************************* - * * FUNCTION: AcpiUtRepairName * * PARAMETERS: Name - The ACPI name to be repaired @@ -286,7 +206,7 @@ AcpiUtRepairName ( for (i = 0; i < ACPI_NAME_SIZE; i++) { - if (AcpiUtValidAcpiChar (Name[i], i)) + if (AcpiUtValidNameChar (Name[i], i)) { continue; } diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index 3a066c8..545622d 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -385,6 +385,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[]; diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 48cff57..e7a0d37 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -1025,24 +1025,24 @@ typedef struct acpi_parse_state /* Parse object flags */ -#define ACPI_PARSEOP_GENERIC 0x01 -#define ACPI_PARSEOP_NAMED 0x02 -#define ACPI_PARSEOP_DEFERRED 0x04 -#define ACPI_PARSEOP_BYTELIST 0x08 -#define ACPI_PARSEOP_IN_STACK 0x10 -#define ACPI_PARSEOP_TARGET 0x20 -#define ACPI_PARSEOP_IN_CACHE 0x80 +#define ACPI_PARSEOP_GENERIC 0x01 +#define ACPI_PARSEOP_NAMED_OBJECT 0x02 +#define ACPI_PARSEOP_DEFERRED 0x04 +#define ACPI_PARSEOP_BYTELIST 0x08 +#define ACPI_PARSEOP_IN_STACK 0x10 +#define ACPI_PARSEOP_TARGET 0x20 +#define ACPI_PARSEOP_IN_CACHE 0x80 /* Parse object DisasmFlags */ -#define ACPI_PARSEOP_IGNORE 0x01 -#define ACPI_PARSEOP_PARAMLIST 0x02 -#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 -#define ACPI_PARSEOP_PREDEF_CHECKED 0x08 -#define ACPI_PARSEOP_CLOSING_PAREN 0x10 -#define ACPI_PARSEOP_COMPOUND 0x20 -#define ACPI_PARSEOP_ASSIGNMENT 0x40 -#define ACPI_PARSEOP_ELSEIF 0x80 +#define ACPI_PARSEOP_IGNORE 0x01 +#define ACPI_PARSEOP_PARAMETER_LIST 0x02 +#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 +#define ACPI_PARSEOP_PREDEFINED_CHECKED 0x08 +#define ACPI_PARSEOP_CLOSING_PAREN 0x10 +#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x20 +#define ACPI_PARSEOP_ASSIGNMENT 0x40 +#define ACPI_PARSEOP_ELSEIF 0x80 /***************************************************************************** diff --git a/source/include/acmacros.h b/source/include/acmacros.h index ecb8050..d2f44a3 100644 --- a/source/include/acmacros.h +++ b/source/include/acmacros.h @@ -273,9 +273,21 @@ * Bit positions start at zero. * MASK_BITS_ABOVE creates a mask starting AT the position and above * MASK_BITS_BELOW creates a mask starting one bit BELOW the position + * MASK_BITS_ABOVE/BELOW accpets a bit offset to create a mask + * MASK_BITS_ABOVE/BELOW_32/64 accpets a bit width to create a mask + * Note: The ACPI_INTEGER_BIT_SIZE check is used to bypass compiler + * differences with the shift operator */ #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((UINT32) (position)))) #define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((UINT32) (position))) +#define ACPI_MASK_BITS_ABOVE_32(width) ((UINT32) ACPI_MASK_BITS_ABOVE(width)) +#define ACPI_MASK_BITS_BELOW_32(width) ((UINT32) ACPI_MASK_BITS_BELOW(width)) +#define ACPI_MASK_BITS_ABOVE_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \ + ACPI_UINT64_MAX : \ + ACPI_MASK_BITS_ABOVE(width)) +#define ACPI_MASK_BITS_BELOW_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \ + (UINT64) 0 : \ + ACPI_MASK_BITS_BELOW(width)) /* Bitfields within ACPI registers */ @@ -291,10 +303,10 @@ /* Generic bitfield macros and masks */ #define ACPI_GET_BITS(SourcePtr, Position, Mask) \ - ((*SourcePtr >> Position) & Mask) + ((*(SourcePtr) >> (Position)) & (Mask)) #define ACPI_SET_BITS(TargetPtr, Position, Mask, Value) \ - (*TargetPtr |= ((Value & Mask) << Position)) + (*(TargetPtr) |= (((Value) & (Mask)) << (Position))) #define ACPI_1BIT_MASK 0x00000001 #define ACPI_2BIT_MASK 0x00000003 diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 0c7e021..feafc34 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20160318 +#define ACPI_CA_VERSION 0x20160422 #include "acconfig.h" #include "actypes.h" diff --git a/source/include/acpredef.h b/source/include/acpredef.h index c335645..ab61c53 100644 --- a/source/include/acpredef.h +++ b/source/include/acpredef.h @@ -131,7 +131,8 @@ enum AcpiReturnPackageTypes ACPI_PTYPE2_REV_FIXED = 9, ACPI_PTYPE2_FIX_VAR = 10, ACPI_PTYPE2_VAR_VAR = 11, - ACPI_PTYPE2_UUID_PAIR = 12 + ACPI_PTYPE2_UUID_PAIR = 12, + ACPI_PTYPE_CUSTOM = 13 }; @@ -344,7 +345,7 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_BIX", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (16 Int),(4 Str) */ - PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING, 4,0), + PACKAGE_INFO (ACPI_PTYPE_CUSTOM, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING, 4,0), {{"_BLT", METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), METHOD_NO_RETURN_VALUE}}, diff --git a/source/include/acrestyp.h b/source/include/acrestyp.h index feec498..72f0d16 100644 --- a/source/include/acrestyp.h +++ b/source/include/acrestyp.h @@ -485,6 +485,7 @@ typedef struct acpi_resource_gpio UINT8 Type; \ UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\ UINT8 SlaveMode; \ + UINT8 ConnectionSharing; \ UINT8 TypeRevisionId; \ UINT16 TypeDataLength; \ UINT16 VendorLength; \ diff --git a/source/include/actables.h b/source/include/actables.h index 69fbbc8..e1a4a6e 100644 --- a/source/include/actables.h +++ b/source/include/actables.h @@ -246,10 +246,6 @@ ACPI_STATUS AcpiTbParseRootTable ( ACPI_PHYSICAL_ADDRESS RsdpAddress); -BOOLEAN -AcpiIsValidSignature ( - char *Signature); - /* * tbxfload diff --git a/source/include/actbl3.h b/source/include/actbl3.h index bc876a9..ef40f19 100644 --- a/source/include/actbl3.h +++ b/source/include/actbl3.h @@ -563,9 +563,10 @@ typedef struct acpi_table_pcct enum AcpiPcctType { - ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, - ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, - ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */ + ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, + ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, + ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */ + ACPI_PCCT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ }; /* @@ -609,6 +610,30 @@ typedef struct acpi_pcct_hw_reduced } ACPI_PCCT_HW_REDUCED; + +/* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */ + +typedef struct acpi_pcct_hw_reduced_type2 +{ + ACPI_SUBTABLE_HEADER Header; + UINT32 DoorbellInterrupt; + UINT8 Flags; + UINT8 Reserved; + UINT64 BaseAddress; + UINT64 Length; + ACPI_GENERIC_ADDRESS DoorbellRegister; + UINT64 PreserveMask; + UINT64 WriteMask; + UINT32 Latency; + UINT32 MaxAccessRate; + UINT16 MinTurnaroundTime; + ACPI_GENERIC_ADDRESS DoorbellAckRegister; + UINT64 AckPreserveMask; + UINT64 AckWriteMask; + +} ACPI_PCCT_HW_REDUCED_TYPE2; + + /* Values for doorbell flags above */ #define ACPI_PCCT_INTERRUPT_POLARITY (1) diff --git a/source/include/acutils.h b/source/include/acutils.h index ed45ef8..d63f786 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -175,6 +175,25 @@ typedef struct acpi_pkg_info /* + * utascii - ASCII utilities + */ +BOOLEAN +AcpiUtValidNameseg ( + char *Signature); + +BOOLEAN +AcpiUtValidNameChar ( + char Character, + UINT32 Position); + +void +AcpiUtCheckAndRepairAscii ( + UINT8 *Name, + char *RepairedName, + UINT32 Count); + + +/* * utnonansi - Non-ANSI C library functions */ void @@ -832,15 +851,6 @@ UtConvertBackslashes ( char *Pathname); #endif -BOOLEAN -AcpiUtValidAcpiName ( - char *Name); - -BOOLEAN -AcpiUtValidAcpiChar ( - char Character, - UINT32 Position); - void AcpiUtRepairName ( char *Name); diff --git a/source/tools/acpibin/abcompare.c b/source/tools/acpibin/abcompare.c index 93520a6..452d203 100644 --- a/source/tools/acpibin/abcompare.c +++ b/source/tools/acpibin/abcompare.c @@ -91,7 +91,7 @@ AbValidateHeader ( ACPI_TABLE_HEADER *Header) { - if (!AcpiUtValidAcpiName (Header->Signature)) + if (!AcpiUtValidNameseg (Header->Signature)) { printf ("Header signature is invalid\n"); return (FALSE); diff --git a/source/tools/acpidump/apdump.c b/source/tools/acpidump/apdump.c index ac3e9ea..58e430c 100644 --- a/source/tools/acpidump/apdump.c +++ b/source/tools/acpidump/apdump.c @@ -74,7 +74,7 @@ ApIsValidHeader ( { /* Make sure signature is all ASCII and a valid ACPI name */ - if (!AcpiUtValidAcpiName (Table->Signature)) + if (!AcpiUtValidNameseg (Table->Signature)) { AcpiLogError ("Table signature (0x%8.8X) is invalid\n", *(UINT32 *) Table->Signature); @@ -465,6 +465,13 @@ ApDumpTableFromFile ( return (-1); } + if (!AcpiUtValidNameseg (Table->Signature)) + { + AcpiLogError ( + "No valid ACPI signature was found in input file %s\n", + Pathname); + } + /* File must be at least as long as the table length */ if (Table->Length > FileSize) diff --git a/source/tools/acpihelp/ahamlops.c b/source/tools/acpihelp/ahamlops.c index 70863e4..8ca2872 100644 --- a/source/tools/acpihelp/ahamlops.c +++ b/source/tools/acpihelp/ahamlops.c @@ -147,14 +147,14 @@ const AH_AML_OPCODE AmlOpcodeInfo[] = "DefOpRegion := OpRegionOp NameString RegionSpace RegionOffset RegionLen"}, {0x5B81, 0x5B81, "0x5B81", "FieldOp", "TermObject", "NameString ByteData", "FieldList", "DefField := FieldOp PkgLength NameString FieldFlags FieldList"}, - {0x5B82, 0x5B82, "0x5B82", "DeviceOp", "TermObject", "NameString", "ObjectList", - "DefDevice := DeviceOp PkgLength NameString ObjectList"}, - {0x5B83, 0x5B83, "0x5B83", "ProcessorOp", "TermObject", "NameString ByteData DWordData ByteData", "ObjectList", - "DefProcessor := ProcessorOp PkgLength NameString ProcId PblkAddr PblkLen ObjectList"}, - {0x5B84, 0x5B84, "0x5B84", "PowerResOp", "TermObject", "NameString ByteData WordData", "ObjectList", - "DefPowerRes := PowerResOp PkgLength NameString SystemLevel ResourceOrder ObjectList"}, - {0x5B85, 0x5B85, "0x5B85", "ThermalZoneOp", "TermObject", "NameString", "ObjectList", - "DefThermalZone := ThermalZoneOp PkgLength NameString ObjectList"}, + {0x5B82, 0x5B82, "0x5B82", "DeviceOp", "TermObject", "NameString", "TermList", + "DefDevice := DeviceOp PkgLength NameString TermList"}, + {0x5B83, 0x5B83, "0x5B83", "ProcessorOp", "TermObject", "NameString ByteData DWordData ByteData", "TermList", + "DefProcessor := ProcessorOp PkgLength NameString ProcId PblkAddr PblkLen TermList"}, + {0x5B84, 0x5B84, "0x5B84", "PowerResOp", "TermObject", "NameString ByteData WordData", "TermList", + "DefPowerRes := PowerResOp PkgLength NameString SystemLevel ResourceOrder TermList"}, + {0x5B85, 0x5B85, "0x5B85", "ThermalZoneOp", "TermObject", "NameString", "TermList", + "DefThermalZone := ThermalZoneOp PkgLength NameString TermList"}, {0x5B86, 0x5B86, "0x5B86", "IndexFieldOp", "TermObject", "NameString NameString ByteData", "FieldList", "DefIndexField := IndexFieldOp PkgLength NameString NameString FieldFlags FieldList"}, {0x5B87, 0x5B87, "0x5B87", "BankFieldOp", "TermObject", "NameString NameString TermArg ByteData", "FieldList", diff --git a/source/tools/acpihelp/ahaslops.c b/source/tools/acpihelp/ahaslops.c index 9fcca7d..39abc31 100644 --- a/source/tools/acpihelp/ahaslops.c +++ b/source/tools/acpihelp/ahaslops.c @@ -112,7 +112,7 @@ const AH_ASL_OPERATOR AslOperatorInfo[] = "Declare a Definition Block"}, {"DerefOf", "(Source) => Object", "Dereference an object reference"}, - {"Device", "(DeviceName) {ObjectList}", + {"Device", "(DeviceName) {TermList}", "Declare a bus/device object"}, {"Divide", "(Dividend, Divisor, Remainder, Result) => Integer", "Integer Divide"}, @@ -193,9 +193,9 @@ const AH_ASL_OPERATOR AslOperatorInfo[] = "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, " "RawDataBuffer() {VendorData}) {PinList}", "GPIO I/O Connection Resource Descriptor Macro"}, - {"I2cSerialBus", "(SlaveAddress, SlaveModeKeyword, ConnectionSpeed, " + {"I2cSerialBusV2", "(SlaveAddress, SlaveModeKeyword, ConnectionSpeed, " "AddressingModeKeyword, ResourceSource, " - "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, " + "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, Shared, " "RawDataBuffer() {VendorData})", "I2C Serial Bus Connection Resource Descriptor Macro"}, {"If", "(Predicate) {TermList}", @@ -295,9 +295,9 @@ const AH_ASL_OPERATOR AslOperatorInfo[] = "Integer Bitwise Or"}, {"Package", "(NumElements) {PackageList} => Package", "Declare a package object"}, - {"PowerResource", "(ResourceName, SystemLevel, ResourceOrder) {ObjectList}", + {"PowerResource", "(ResourceName, SystemLevel, ResourceOrder) {TermList}", "Declare a power resource object"}, - {"Processor", "(ProcessorName, ProcessorID, PBlockAddress, PblockLength) {ObjectList}", + {"Processor", "(ProcessorName, ProcessorID, PBlockAddress, PblockLength) {TermList}", "Declare a processor package"}, {"QWordIo", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, DecodeKeyword, " "RangeTypeKeyword, AddressGranularity, " @@ -335,7 +335,7 @@ const AH_ASL_OPERATOR AslOperatorInfo[] = "Return from method execution"}, {"Revision", "=> Integer", "Constant revision object"}, - {"Scope", "(Location) {ObjectList}", + {"Scope", "(Location) {TermList}", "Open named scope "}, {"ShiftLeft", "(Source, ShiftCount, Result) => Integer", "Integer shift value left"}, @@ -347,11 +347,11 @@ const AH_ASL_OPERATOR AslOperatorInfo[] = "Get the size of a buffer}, string}, or package"}, {"Sleep", "(Milliseconds)", "Sleep n milliseconds (yields the processor)"}, - {"SpiSerialBus", "(DeviceSelection, PolarityKeyword, WireModeKeyword, " + {"SpiSerialBusV2", "(DeviceSelection, PolarityKeyword, WireModeKeyword, " "DataBitLength, SlaveModeKeyword, " "ConnectionSpeed, ClockPolarityKeyword, ClockPhaseKeyword, " "ResourceSource, ResourceSourceIndex, " - "ResourceTypeKeyword, DescriptorName, RawDataBuffer() {VendorData})", + "ResourceTypeKeyword, DescriptorName, Shared, RawDataBuffer() {VendorData})", "SPI Serial Bus Connection Resource Descriptor Macro"}, {"Stall", "(Microseconds)", "Delay n microseconds (does not yield the processor)"}, @@ -365,7 +365,7 @@ const AH_ASL_OPERATOR AslOperatorInfo[] = "Integer Subtract"}, {"Switch", "(Expression) {CaseTermList}", "Select code to execute based on expression value"}, - {"ThermalZone", "(ThermalZoneName) {ObjectList}", + {"ThermalZone", "(ThermalZoneName) {TermList}", "Declare a thermal zone package"}, {"Timer", "=> Integer", "Get 64-bit timer value"}, @@ -383,10 +383,10 @@ const AH_ASL_OPERATOR AslOperatorInfo[] = "Copy ASCII string from buffer"}, {"ToUuid", "(AsciiString) => Buffer", "Convert Ascii string to UUID"}, - {"UartSerialBus", "(ConnectionSpeed, ByteLengthKeyword, StopBitsKeyword, " + {"UartSerialBusV2", "(ConnectionSpeed, ByteLengthKeyword, StopBitsKeyword, " "LinesInUse, EndianKeyword, ParityKeyword, " "FlowControlKeyword, ReceiveBufferSize, TransmitBufferSize, ResourceSource, " - "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, " + "ResourceSourceIndex, ResourceTypeKeyword, DescriptorName, Shared, " "RawDataBuffer() {VendorData})", "UART Serial Bus Connection Resource Descriptor Macro"}, {"Unicode", "(String) => Buffer", diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 9671834..63e78f9 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -624,6 +624,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_IORT_NODE", SRC_TYPE_STRUCT}, {"ACPI_IORT_ROOT_COMPLEX", SRC_TYPE_STRUCT}, {"ACPI_IORT_SMMU", SRC_TYPE_STRUCT}, + {"ACPI_IORT_SMMU_V3", SRC_TYPE_STRUCT}, {"ACPI_IVRS_HEADER", SRC_TYPE_STRUCT}, {"ACPI_IVRS_HARDWARE", SRC_TYPE_STRUCT}, {"ACPI_IVRS_DE_HEADER", SRC_TYPE_STRUCT}, @@ -666,6 +667,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_NFIT_DATA_REGION", SRC_TYPE_STRUCT}, {"ACPI_NFIT_FLUSH_ADDRESS", SRC_TYPE_STRUCT}, {"ACPI_PCCT_HW_REDUCED", SRC_TYPE_STRUCT}, + {"ACPI_PCCT_HW_REDUCED_TYPE2", SRC_TYPE_STRUCT}, {"ACPI_PCCT_SHARED_MEMORY", SRC_TYPE_STRUCT}, {"ACPI_PCCT_SUBSPACE", SRC_TYPE_STRUCT}, {"ACPI_RSDP_COMMON", SRC_TYPE_STRUCT}, diff --git a/source/tools/acpixtract/acpixtract.c b/source/tools/acpixtract/acpixtract.c index e0d1755..1573cee 100644 --- a/source/tools/acpixtract/acpixtract.c +++ b/source/tools/acpixtract/acpixtract.c @@ -239,7 +239,7 @@ CleanupAndExit: if (Gbl_TableCount > 1) { - printf ("\n%d binary ACPI tables extracted\n", + printf ("\n%u binary ACPI tables extracted\n", Gbl_TableCount); } @@ -383,7 +383,7 @@ CleanupAndExit: ThisSignature, ThisTableBytesWritten, Gbl_OutputFilename); } - printf ("\n%d binary ACPI tables extracted and written to %s (%u bytes)\n", + printf ("\n%u binary ACPI tables extracted and written to %s (%u bytes)\n", Gbl_TableCount, Gbl_OutputFilename, TotalBytesWritten); fclose (InputFile); @@ -471,7 +471,7 @@ AxListTables ( continue; } - if (!AcpiIsValidSignature (TableHeader->Signature)) + if (!AcpiUtValidNameseg (TableHeader->Signature)) { continue; } diff --git a/source/tools/acpixtract/acpixtract.h b/source/tools/acpixtract/acpixtract.h index c280102..14df786 100644 --- a/source/tools/acpixtract/acpixtract.h +++ b/source/tools/acpixtract/acpixtract.h @@ -148,10 +148,6 @@ void AxNormalizeSignature ( char *Signature); -BOOLEAN -AcpiIsValidSignature ( - char *Signature); - void AxCheckAscii ( char *Name, diff --git a/source/tools/acpixtract/axutils.c b/source/tools/acpixtract/axutils.c index 6d1d0d8..6af8cdc 100644 --- a/source/tools/acpixtract/axutils.c +++ b/source/tools/acpixtract/axutils.c @@ -46,81 +46,6 @@ /******************************************************************************* * - * FUNCTION: AcpiIsValidSignature - * - * PARAMETERS: Signature - Sig string to be validated - * - * RETURN: TRUE if signature is has 4 valid ACPI characters - * - * DESCRIPTION: Validate an ACPI table signature. - * - ******************************************************************************/ - -BOOLEAN -AcpiIsValidSignature ( - char *Signature) -{ - UINT32 i; - - - /* Validate each character in the signature */ - - for (i = 0; i < ACPI_NAME_SIZE; i++) - { - if (!AcpiUtValidAcpiChar (Signature[i], i)) - { - return (FALSE); - } - } - - return (TRUE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtValidAcpiChar - * - * PARAMETERS: Char - The character to be examined - * Position - Byte position (0-3) - * - * RETURN: TRUE if the character is valid, FALSE otherwise - * - * DESCRIPTION: Check for a valid ACPI character. Must be one of: - * 1) Upper case alpha - * 2) numeric - * 3) underscore - * - * We allow a '!' as the last character because of the ASF! table - * - ******************************************************************************/ - -BOOLEAN -AcpiUtValidAcpiChar ( - char Character, - UINT32 Position) -{ - - if (!((Character >= 'A' && Character <= 'Z') || - (Character >= '0' && Character <= '9') || - (Character == '_'))) - { - /* Allow a '!' in the last position */ - - if (Character == '!' && Position == 3) - { - return (TRUE); - } - - return (FALSE); - } - - return (TRUE); -} - - -/******************************************************************************* - * * FUNCTION: AxCheckAscii * * PARAMETERS: Name - Ascii string, at least as long as Count diff --git a/tests/misc/grammar.aml b/tests/misc/grammar.aml deleted file mode 100755 index 51bc535..0000000 Binary files a/tests/misc/grammar.aml and /dev/null differ