From 6a5be76741463ab95aa335a8e30200d0dbd1d6f6 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Aug 19 2017 00:48:23 +0000 Subject: New upstream version 20170531 --- diff --git a/generate/unix/Makefile.common b/generate/unix/Makefile.common index 743fd3c..71f282f 100644 --- a/generate/unix/Makefile.common +++ b/generate/unix/Makefile.common @@ -7,22 +7,36 @@ $(PROGS): FORCE @cd $(BUILD_DIRECTORY_PATH)/$@; \ mkdir -p obj; \ $(MAKE) || exit "$$?"; \ - ls -al ../bin/$@; \ echo ""; # +# List just shows the status of each tool +# +status: FORCE + @for toolname in $(PROGS); do \ + (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ + if [ -d "obj" ] ; then \ + echo " `ls -1 obj | wc -l` files, `stat -c%s obj/$$toolname` bytes"; \ + else \ + echo " Clean"; \ + fi; \ + ); \ + done; + +# # Simple clean removes all .obj files, but leaves the executables # in the local bin directory # clean: FORCE @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ if [ -d "obj" ] ; then \ - echo "Removing $$toolname:"; \ - pwd; \ - $(MAKE) clean; \ - rmdir obj; \ - echo ""; \ + echo " Removing `ls -1 obj | wc -l` files"; \ + rm -r obj; \ + else \ + echo " Clean"; \ fi; \ ); \ done; @@ -53,7 +67,11 @@ install: FORCE @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ pwd; \ - $(MAKE) PROG=$$toolname install; \ + if [ -d "obj" ] ; then \ + $(MAKE) PROG=$$toolname install; \ + else \ + echo " Clean"; \ + fi; \ ); \ done; diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index a1f0313..4d4f182 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -89,7 +89,7 @@ INSTALLPROG = \ RENAMEPROG = \ @if [ -e "$(PROG).exe" ] ; then \ mv $(PROG).exe $(PROG); \ - echo "Renamed $(PROG).exe to $(PROG)"; \ + echo "- Rename $(PROG).exe to $(PROG)"; \ fi; # @@ -98,7 +98,7 @@ RENAMEPROG = \ COPYPROG = \ @mkdir -p ../$(BINDIR); \ cp -f $(PROG) ../$(BINDIR); \ - echo "Copied $(PROG) to $(FINAL_PROG)"; + echo "- Copy $(PROG) to $(FINAL_PROG)"; # # Main ACPICA source directories diff --git a/generate/unix/Makefile.rules b/generate/unix/Makefile.rules index b9aa9a9..f2a16be 100644 --- a/generate/unix/Makefile.rules +++ b/generate/unix/Makefile.rules @@ -11,14 +11,16 @@ $(FINAL_PROG) : $(PROG) $(COPYPROG) $(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS) - $(LINKPROG) + @echo "- Link" $(PROG) + @$(LINKPROG) $(RENAMEPROG) $(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS) - $(COMPILEOBJ) + @echo $(PROG) $< + @$(COMPILEOBJ) clean : - rm -f $(PROG) $(PROG).exe $(OBJECTS) $(OBJDIR)/*.o $(INTERMEDIATES) $(MISC) + @rm -f $(PROG) $(PROG).exe $(OBJECTS) $(OBJDIR)/*.o $(INTERMEDIATES) $(MISC) install : $(INSTALLPROG) diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile index 3191850..9ed3f5f 100644 --- a/generate/unix/acpiexec/Makefile +++ b/generate/unix/acpiexec/Makefile @@ -42,6 +42,7 @@ OBJECTS = \ $(OBJDIR)/acgetline.o\ $(OBJDIR)/acfileio.o\ $(OBJDIR)/aeexec.o\ + $(OBJDIR)/aeexception.o\ $(OBJDIR)/aehandlers.o\ $(OBJDIR)/aeinitfile.o\ $(OBJDIR)/aemain.o\ @@ -224,6 +225,7 @@ OBJECTS = \ $(OBJDIR)/utownerid.o\ $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utpredef.o\ + $(OBJDIR)/utresdecode.o\ $(OBJDIR)/utresrc.o\ $(OBJDIR)/utstate.o\ $(OBJDIR)/utstring.o\ diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile index aa6e429..156c23a 100644 --- a/generate/unix/iasl/Makefile +++ b/generate/unix/iasl/Makefile @@ -121,6 +121,7 @@ OBJECTS = \ $(OBJDIR)/dmresrcl2.o\ $(OBJDIR)/dmresrcs.o\ $(OBJDIR)/dmrestag.o\ + $(OBJDIR)/dmswitch.o\ $(OBJDIR)/dmtable.o\ $(OBJDIR)/dmtables.o\ $(OBJDIR)/dmtbdump.o\ @@ -224,6 +225,7 @@ OBJECTS = \ $(OBJDIR)/utobject.o\ $(OBJDIR)/utownerid.o\ $(OBJDIR)/utpredef.o\ + $(OBJDIR)/utresdecode.o\ $(OBJDIR)/utresrc.o\ $(OBJDIR)/utstate.o\ $(OBJDIR)/utstrtoul64.o\ @@ -277,13 +279,15 @@ CFLAGS += \ include ../Makefile.rules # -# Function to safely execute yacc +# Function to safely execute yacc: +# Generate the output files to a temporary directory, +# move the file to $(OBJDIR), and discard the directory. # safe_yacc = \ _d=`mktemp -d $(OBJDIR)/$(1).XXXXXX` &&\ cd $$_d &&\ $(YACC) $(YFLAGS) -v -d -p$(1) $(abspath $(2)) &&\ - cd - &&\ + cd - > /dev/null;\ mv $$_d/y.tab$(suffix $(3)) $(3);\ _r=$$?;\ rm -fr $$_d;\ @@ -293,28 +297,35 @@ safe_yacc = \ # Macro processing for iASL .y files # $(OBJDIR)/aslcompiler.y : $(ASL_PARSER) - $(MACROPROC) $(MFLAGS) $(ASL_COMPILER)/aslparser.y > $@ + @echo "- " $(MACROPROC) " Preprocess main iASL parser" + @$(MACROPROC) $(MFLAGS) $(ASL_COMPILER)/aslparser.y > $@ # # Parser and Lexer - intermediate C files # $(OBJDIR)/aslcompilerlex.c : $(ASL_LEXER) - $(LEX) $(LFLAGS) -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l + @echo "- " $(LEX) " "$< + @$(LEX) $(LFLAGS) -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l $(OBJDIR)/aslcompilerparse.c $(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompiler.y - $(call safe_yacc,AslCompiler,$<,$@) + @echo "- " $(YACC) " "$< + @$(call safe_yacc,AslCompiler,$<,$@) $(OBJDIR)/dtparserlex.c : $(ASL_COMPILER)/dtparser.l $(OBJDIR)/dtparser.y.h - $(LEX) $(LFLAGS) -PDtParser -o$@ $< + @echo "- " $(LEX) " "$< + @$(LEX) $(LFLAGS) -PDtParser -o$@ $< $(OBJDIR)/dtparserparse.c $(OBJDIR)/dtparser.y.h : $(ASL_COMPILER)/dtparser.y - $(call safe_yacc,DtParser,$<,$@) + @echo "- " $(YACC) " "$< + @$(call safe_yacc,DtParser,$<,$@) $(OBJDIR)/prparserlex.c : $(ASL_COMPILER)/prparser.l $(OBJDIR)/prparser.y.h - $(LEX) $(LFLAGS) -PPrParser -o$@ $< + @echo "- " $(LEX) " "$< + @$(LEX) $(LFLAGS) -PPrParser -o$@ $< $(OBJDIR)/prparserparse.c $(OBJDIR)/prparser.y.h : $(ASL_COMPILER)/prparser.y - $(call safe_yacc,PrParser,$<,$@) + @echo "- " $(YACC) " "$< + @$(call safe_yacc,PrParser,$<,$@) # # Parsers and Lexers - final object files @@ -323,19 +334,25 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prparser.y.h : $(ASL_COMPILER)/prparse # by the utilities above and they are not necessarily ANSI C, etc. # $(OBJDIR)/aslcompilerlex.o : $(OBJDIR)/aslcompilerlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< diff --git a/source/common/acfileio.c b/source/common/acfileio.c index 291f595..c4bc7ee 100644 --- a/source/common/acfileio.c +++ b/source/common/acfileio.c @@ -423,8 +423,6 @@ AcValidateTableHeader ( if (!AcpiUtValidNameseg (TableHeader.Signature)) { - fprintf (stderr, "Invalid table signature: 0x%8.8X\n", - *ACPI_CAST_PTR (UINT32, TableHeader.Signature)); return (AE_BAD_SIGNATURE); } diff --git a/source/common/adfile.c b/source/common/adfile.c index 7431b66..ab9f2ca 100644 --- a/source/common/adfile.c +++ b/source/common/adfile.c @@ -208,11 +208,6 @@ FlGenerateFilename ( */ NewFilename = UtStringCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); - if (!NewFilename) - { - return (NULL); - } - strcpy (NewFilename, InputFilename); /* Try to find the last dot in the filename */ @@ -256,11 +251,6 @@ FlStrdup ( NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); - if (!NewString) - { - return (NULL); - } - strcpy (NewString, String); return (NewString); } diff --git a/source/common/adisasm.c b/source/common/adisasm.c index d1f6950..b580a05 100644 --- a/source/common/adisasm.c +++ b/source/common/adisasm.c @@ -429,7 +429,7 @@ AdDisassembleOneTable ( * the entire tree with the new information (namely, the * number of arguments per method) */ - if (AcpiDmGetExternalMethodCount ()) + if (AcpiDmGetUnresolvedExternalMethodCount ()) { Status = AdReparseOneTable (Table, File, OwnerId); if (ACPI_FAILURE (Status)) @@ -445,7 +445,7 @@ AdDisassembleOneTable ( * 1) Convert fixed-offset references to resource descriptors * to symbolic references (Note: modifies namespace) */ - AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); + AcpiDmConvertParseObjects (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); /* Optional displays */ @@ -508,7 +508,7 @@ AdReparseOneTable ( fprintf (stderr, "\nFound %u external control methods, " "reparsing with new information\n", - AcpiDmGetExternalMethodCount ()); + AcpiDmGetUnresolvedExternalMethodCount ()); /* Reparse, rebuild namespace */ @@ -534,7 +534,7 @@ AdReparseOneTable ( /* New namespace, add the external definitions first */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); /* For -ca option: clear the list of comment addresses. */ diff --git a/source/common/adwalk.c b/source/common/adwalk.c index c1da64c..0992fbb 100644 --- a/source/common/adwalk.c +++ b/source/common/adwalk.c @@ -100,11 +100,16 @@ AcpiDmInspectPossibleArgs ( ACPI_PARSE_OBJECT *Op); static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmCommonDescendingOp ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); +static ACPI_STATUS +AcpiDmProcessResourceDescriptors ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); /******************************************************************************* * @@ -287,21 +292,21 @@ AcpiDmCrossReferenceNamespace ( /******************************************************************************* * - * FUNCTION: AcpiDmConvertResourceIndexes + * FUNCTION: AcpiDmConvertParseObjects * * PARAMETERS: ParseTreeRoot - Root of the parse tree * NamespaceRoot - Root of the internal namespace * * RETURN: None * - * DESCRIPTION: Convert fixed-offset references to resource descriptors to - * symbolic references. Should only be called after namespace has - * been cross referenced. + * DESCRIPTION: Begin parse tree walk to perform conversions needed for + * disassembly. These include resource descriptors and switch/case + * operations. * ******************************************************************************/ void -AcpiDmConvertResourceIndexes ( +AcpiDmConvertParseObjects ( ACPI_PARSE_OBJECT *ParseTreeRoot, ACPI_NAMESPACE_NODE *NamespaceRoot) { @@ -335,9 +340,14 @@ AcpiDmConvertResourceIndexes ( Info.Level = 0; Info.WalkState = WalkState; - AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp, + AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmCommonDescendingOp, AcpiDmCommonAscendingOp, &Info); ACPI_FREE (WalkState); + + if (AcpiGbl_TempListHead) { + AcpiDmClearTempList(); + } + return; } @@ -629,7 +639,6 @@ AcpiDmLoadDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); /* Only interested in operators that create new names */ @@ -646,7 +655,7 @@ AcpiDmLoadDescendingOp ( { /* For all named operators, get the new name */ - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP) { @@ -767,7 +776,6 @@ AcpiDmXrefDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if ((!(OpInfo->Flags & AML_NAMED)) && @@ -777,25 +785,6 @@ AcpiDmXrefDescendingOp ( { goto Exit; } - else if (Op->Common.Parent && - Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP) - { - /* External() NamePath */ - - Path = Op->Common.Value.String; - ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer; - if (ObjectType == ACPI_TYPE_METHOD) - { - ParamCount = (UINT32) - Op->Common.Next->Common.Next->Common.Value.Integer; - } - - Flags |= ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_OPCODE; - AcpiDmAddOpToExternalList (Op, Path, - (UINT8) ObjectType, ParamCount, Flags); - - goto Exit; - } /* Get the NamePath from the appropriate place */ @@ -816,9 +805,10 @@ AcpiDmXrefDescendingOp ( Path = NextOp->Common.Value.String; } } - else if (Op->Common.AmlOpcode == AML_SCOPE_OP) + else if (Op->Common.AmlOpcode == AML_SCOPE_OP || + Op->Common.AmlOpcode == AML_EXTERNAL_OP) { - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; } } else if (OpInfo->Flags & AML_CREATE) @@ -952,21 +942,59 @@ Exit: return (AE_OK); } +/******************************************************************************* + * + * FUNCTION: AcpiDmCommonDescendingOp + * + * PARAMETERS: ASL_WALK_CALLBACK + * + * RETURN: ACPI_STATUS + * + * DESCRIPTION: Perform parse tree preprocessing before main disassembly walk. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmCommonDescendingOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context) +{ + ACPI_STATUS Status; + + /* Resource descriptor conversion */ + + Status = AcpiDmProcessResourceDescriptors (Op, Level, Context); + + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Switch/Case conversion */ + + Status = AcpiDmProcessSwitch (Op); + + return (AE_OK); +} + /******************************************************************************* * - * FUNCTION: AcpiDmResourceDescendingOp + * FUNCTION: AcpiDmProcessResourceDescriptors * * PARAMETERS: ASL_WALK_CALLBACK * - * RETURN: None + * RETURN: ACPI_STATUS * - * DESCRIPTION: Process one parse op during symbolic resource index conversion. + * DESCRIPTION: Convert fixed-offset references to resource descriptors to + * symbolic references. Should only be called after namespace has + * been cross referenced. * ******************************************************************************/ static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmProcessResourceDescriptors ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context) @@ -977,7 +1005,6 @@ AcpiDmResourceDescendingOp ( ACPI_OBJECT_TYPE ObjectType; ACPI_STATUS Status; - WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); @@ -1003,10 +1030,10 @@ AcpiDmResourceDescendingOp ( * If so, convert the reference into a symbolic reference. */ AcpiDmCheckResourceReference (Op, WalkState); + return (AE_OK); } - /******************************************************************************* * * FUNCTION: AcpiDmCommonAscendingOp @@ -1027,14 +1054,11 @@ AcpiDmCommonAscendingOp ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; ACPI_OBJECT_TYPE ObjectType; /* Close scope if necessary */ - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if (AcpiNsOpensScope (ObjectType)) @@ -1045,7 +1069,6 @@ AcpiDmCommonAscendingOp ( return (AE_OK); } - /******************************************************************************* * * FUNCTION: AcpiDmInspectPossibleArgs diff --git a/source/common/ahids.c b/source/common/ahids.c index aee6cb8..75e1397 100644 --- a/source/common/ahids.c +++ b/source/common/ahids.c @@ -79,6 +79,7 @@ const AH_DEVICE_ID AslDeviceIds[] = {"ACPI0011", "Generic Buttons Device"}, {"ACPI0012", "NVDIMM Root Device"}, {"ACPI0013", "Generic Event Device"}, + {"ACPI0014", "Wireless Power Calibration Device"}, {"ADMA0F28", "Intel Audio DMA"}, {"AMCR0F28", "Intel Audio Machine Driver"}, {"ATK4001", "Asus Radio Control Button"}, diff --git a/source/common/ahpredef.c b/source/common/ahpredef.c index 439c00e..70627b5 100644 --- a/source/common/ahpredef.c +++ b/source/common/ahpredef.c @@ -146,6 +146,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"), AH_PREDEF ("_FSL", "Fan Set Level", "Control method that sets the fan device's speed level (performance state)"), AH_PREDEF ("_FST", "Fan Status", "Returns current status information for a fan device"), + AH_PREDEF ("_FUN", "Function Number", "Resource descriptor field"), AH_PREDEF ("_GAI", "Get Averaging Interval", "Returns the power meter averaging interval"), AH_PREDEF ("_GCP", "Get Capabilities", "Get device time capabilities"), AH_PREDEF ("_GHL", "Get Hardware Limit", "Returns the hardware limit enforced by the power meter"), @@ -162,6 +163,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_GWS", "Get Wake Status", "Return status of wake alarms"), AH_PREDEF ("_HE_", "High-Edge", "Interrupt triggering, Resource Descriptor field"), AH_PREDEF ("_HID", "Hardware ID", "Returns a device's Plug and Play Hardware ID"), + AH_PREDEF ("_HMA", "Heterogeneous Memory Attributes", "Returns a list of HMAT structures."), AH_PREDEF ("_HOT", "Hot Temperature", "Returns the critical temperature for sleep (entry to S4)"), AH_PREDEF ("_HPP", "Hot Plug Parameters", "Returns a list of hot-plug information for a PCI device"), AH_PREDEF ("_HPX", "Hot Plug Parameter Extensions", "Returns a list of hot-plug information for a PCI device. Supersedes _HPP"), @@ -179,6 +181,9 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"), AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"), AH_PREDEF ("_LPI", "Low Power Idle States", "Returns a list of supported low power idle states"), + AH_PREDEF ("_LSI", "Label Storage Information", "Returns information about the Label Storage Area associated with the NVDIMM object."), + AH_PREDEF ("_LSR", "Label Storage Read", "Returns label data from the Label Storage Area of the NVDIMM object."), + AH_PREDEF ("_LSW", "Label Storage Write", "Writes label data in to the Label Storage Area of the NVDIMM object."), AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"), AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"), AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"), @@ -331,6 +336,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_UPC", "USB Port Capabilities", "Returns a list of USB port capabilities"), AH_PREDEF ("_UPD", "User Presence Detect", "Returns user detection information"), AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"), + AH_PREDEF ("_VAL", "Pin Configuration Value", "Resource Descriptor field"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), diff --git a/source/common/ahtable.c b/source/common/ahtable.c index bd656de..3c7a4ca 100644 --- a/source/common/ahtable.c +++ b/source/common/ahtable.c @@ -110,6 +110,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_FPDT, "Firmware Performance Data Table"}, {ACPI_SIG_GTDT, "Generic Timer Description Table"}, {ACPI_SIG_HEST, "Hardware Error Source Table"}, + {ACPI_SIG_HMAT, "Heterogeneous Memory Attributes Table"}, {ACPI_SIG_HPET, "High Precision Event Timer table"}, {ACPI_SIG_IORT, "IO Remapping Table"}, {ACPI_SIG_IVRS, "I/O Virtualization Reporting Structure"}, @@ -124,6 +125,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, + {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, {ACPI_RSDP_NAME,"Root System Description Pointer"}, {ACPI_SIG_RSDT, "Root System Description Table"}, @@ -145,6 +147,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_WDDT, "Watchdog Description Table"}, {ACPI_SIG_WDRT, "Watchdog Resource Table"}, {ACPI_SIG_WPBT, "Windows Platform Binary Table"}, + {ACPI_SIG_WSMT, "Windows SMM Security Migrations Table"}, {ACPI_SIG_XENV, "Xen Environment table"}, {ACPI_SIG_XSDT, "Extended System Description Table"}, {NULL, NULL} diff --git a/source/common/ahuuids.c b/source/common/ahuuids.c index fc45f99..f2cef4e 100644 --- a/source/common/ahuuids.c +++ b/source/common/ahuuids.c @@ -78,6 +78,10 @@ const AH_UUID Gbl_AcpiUuids[] = {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + {"[Processor Properties]", NULL}, + {"Cache Properties", UUID_CACHE_PROPERTIES}, + {"Physical Package Property", UUID_PHYSICAL_PROPERTY}, + {"[Miscellaneous]", NULL}, {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, diff --git a/source/common/dmextern.c b/source/common/dmextern.c index 66e3d21..fcf896e 100644 --- a/source/common/dmextern.c +++ b/source/common/dmextern.c @@ -91,6 +91,9 @@ static const char *AcpiGbl_DmTypeNames[] = #define METHOD_SEPARATORS " \t,()\n" +static const char *ExternalConflictMessage = + " // Conflicts with a later declaration"; + /* Local prototypes */ @@ -103,6 +106,16 @@ AcpiDmNormalizeParentPrefix ( ACPI_PARSE_OBJECT *Op, char *Path); +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath); + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path); + static void AcpiDmAddPathToExternalList ( char *Path, @@ -118,6 +131,21 @@ AcpiDmCreateNewExternal ( UINT32 Value, UINT16 Flags); +static void +AcpiDmCheckForExternalConflict ( + char *Path); + +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node); + + +static void +AcpiDmConflictingDeclaration ( + char *Path); + /******************************************************************************* * @@ -474,7 +502,7 @@ AcpiDmGetExternalsFromFile ( { /* Add the external(s) to the namespace */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); AcpiOsPrintf ("%s: Imported %u external method definitions\n", Gbl_ExternalRefFilename, ImportCount); @@ -590,6 +618,86 @@ AcpiDmAddOpToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmGetExternalAndInternalPath + * + * PARAMETERS: Node - Namespace node for object to be added + * ExternalPath - Will contain the external path of the node + * InternalPath - Will contain the internal path of the node + * + * RETURN: None + * + * DESCRIPTION: Get the External and Internal path from the given node. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath) +{ + ACPI_STATUS Status; + + + if (!Node) + { + return (AE_BAD_PARAMETER); + } + + /* Get the full external and internal pathnames to the node */ + + *ExternalPath = AcpiNsGetExternalPathname (Node); + if (!*ExternalPath) + { + return (AE_BAD_PATHNAME); + } + + Status = AcpiNsInternalizeName (*ExternalPath, InternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (*ExternalPath); + return (Status); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmRemoveRootPrefix + * + * PARAMETERS: Path - Remove Root prefix from this Path + * + * RETURN: None + * + * DESCRIPTION: Remove the root prefix character '\' from Path. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path) +{ + char *InputPath = *Path; + + + if ((*InputPath == AML_ROOT_PREFIX) && (InputPath[1])) + { + if (!memmove(InputPath, InputPath+1, strlen(InputPath))) + { + return (AE_ERROR); + } + + *Path = InputPath; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddNodeToExternalList * * PARAMETERS: Node - Namespace node for object to be added @@ -619,46 +727,27 @@ AcpiDmAddNodeToExternalList ( { char *ExternalPath; char *InternalPath; - char *Temp; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (DmAddNodeToExternalList); - - if (!Node) - { - return_VOID; - } - /* Get the full external and internal pathnames to the node */ - ExternalPath = AcpiNsGetExternalPathname (Node); - if (!ExternalPath) - { - return_VOID; - } - - Status = AcpiNsInternalizeName (ExternalPath, &InternalPath); + Status = AcpiDmGetExternalAndInternalPath (Node, &ExternalPath, &InternalPath); if (ACPI_FAILURE (Status)) { - ACPI_FREE (ExternalPath); return_VOID; } /* Remove the root backslash */ - if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) + Status = AcpiDmRemoveRootPrefix (&ExternalPath); + if (ACPI_FAILURE (Status)) { - Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); - if (!Temp) - { - return_VOID; - } - - strcpy (Temp, &ExternalPath[1]); ACPI_FREE (ExternalPath); - ExternalPath = Temp; + ACPI_FREE (InternalPath); + return_VOID; } /* Create the new External() declaration node */ @@ -905,68 +994,171 @@ AcpiDmCreateNewExternal ( /******************************************************************************* * - * FUNCTION: AcpiDmAddExternalsToNamespace + * FUNCTION: AcpiDmResolveExternal * - * PARAMETERS: None + * PARAMETERS: Path - Path of the external + * Type - Type of the external + * Node - Input node for AcpiNsLookup + * + * RETURN: Status + * + * DESCRIPTION: Resolve the external within the namespace by AcpiNsLookup. + * If the returned node is an external and has the same type + * we assume that it was either an existing external or a + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node) +{ + ACPI_STATUS Status; + + + Status = AcpiNsLookup (NULL, Path, Type, + ACPI_IMODE_LOAD_PASS1, + ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, + NULL, Node); + + if (!Node) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "while adding external to namespace [%s]", Path)); + } + + /* Note the asl code "external(a) external(a)" is acceptable ASL */ + + else if ((*Node)->Type == Type && + (*Node)->Flags & ANOBJ_IS_EXTERNAL) + { + return (AE_OK); + } + else + { + ACPI_EXCEPTION ((AE_INFO, AE_ERROR, + "[%s] has conflicting declarations", Path)); + } + + return (AE_ERROR); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmCreateSubobjectForExternal + * + * PARAMETERS: Type - Type of the external + * Node - Namespace node from AcpiNsLookup + * ParamCount - Value to be used for Method * * RETURN: None * - * DESCRIPTION: Add all externals to the namespace. Allows externals to be + * DESCRIPTION: Add one external to the namespace. Allows external to be * "resolved". * ******************************************************************************/ void -AcpiDmAddExternalsToNamespace ( - void) +AcpiDmCreateSubobjectForExternal ( + UINT8 Type, + ACPI_NAMESPACE_NODE **Node, + UINT32 ParamCount) { - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - while (External) + switch (Type) { - /* Add the external name (object) into the namespace */ + case ACPI_TYPE_METHOD: - Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + /* For methods, we need to save the argument count */ - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "while adding external to namespace [%s]", - External->Path)); - } + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + ObjDesc->Method.ParamCount = (UINT8) ParamCount; + (*Node)->Object = ObjDesc; + break; - else switch (External->Type) - { - case ACPI_TYPE_METHOD: + case ACPI_TYPE_REGION: - /* For methods, we need to save the argument count */ + /* Regions require a region sub-object */ - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - ObjDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = ObjDesc; - break; + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + ObjDesc->Region.Node = *Node; + (*Node)->Object = ObjDesc; + break; - case ACPI_TYPE_REGION: + default: - /* Regions require a region sub-object */ + break; + } +} - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); - ObjDesc->Region.Node = Node; - Node->Object = ObjDesc; - break; - default: +/******************************************************************************* + * + * FUNCTION: AcpiDmAddOneExternalToNamespace + * + * PARAMETERS: Path - External parse object + * Type - Type of parse object + * ParamCount - External method parameter count + * + * RETURN: None + * + * DESCRIPTION: Add one external to the namespace by resolvign the external + * (by performing a namespace lookup) and annotating the resulting + * namespace node with the approperiate information if the type + * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD. + * + ******************************************************************************/ + +void +AcpiDmAddOneExternalToNamespace ( + char *Path, + UINT8 Type, + UINT32 ParamCount) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; - break; - } + Status = AcpiDmResolveExternal (Path, Type, &Node); + + if (ACPI_FAILURE (Status)) + { + return; + } + + AcpiDmCreateSubobjectForExternal (Type, &Node, ParamCount); + +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddExternalListToNamespace + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Add all externals within AcpiGbl_ExternalList to the namespace. + * Allows externals to be "resolved". + * + ******************************************************************************/ + +void +AcpiDmAddExternalListToNamespace ( + void) +{ + ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; + + + while (External) + { + AcpiDmAddOneExternalToNamespace (External->InternalPath, + External->Type, External->Value); External = External->Next; } } @@ -974,23 +1166,28 @@ AcpiDmAddExternalsToNamespace ( /******************************************************************************* * - * FUNCTION: AcpiDmGetExternalMethodCount + * FUNCTION: AcpiDmGetUnresolvedExternalMethodCount * * PARAMETERS: None * - * RETURN: The number of control method externals in the external list + * RETURN: The number of unresolved control method externals in the + * external list * - * DESCRIPTION: Return the number of method externals that have been generated. - * If any control method externals have been found, we must - * re-parse the entire definition block with the new information - * (number of arguments for the methods.) This is limitation of - * AML, we don't know the number of arguments from the control - * method invocation itself. + * DESCRIPTION: Return the number of unresolved external methods that have been + * generated. If any unresolved control method externals have been + * found, we must re-parse the entire definition block with the new + * information (number of arguments for the methods.) + * This is limitation of AML, we don't know the number of arguments + * from the control method invocation itself. + * + * Note: resolved external control methods are external control + * methods encoded with the AML_EXTERNAL_OP bytecode within the + * AML being disassembled. * ******************************************************************************/ UINT32 -AcpiDmGetExternalMethodCount ( +AcpiDmGetUnresolvedExternalMethodCount ( void) { ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; @@ -999,7 +1196,8 @@ AcpiDmGetExternalMethodCount ( while (External) { - if (External->Type == ACPI_TYPE_METHOD) + if (External->Type == ACPI_TYPE_METHOD && + !(External->Flags & ACPI_EXT_ORIGIN_FROM_OPCODE)) { Count++; } @@ -1143,6 +1341,11 @@ AcpiDmEmitExternals ( } } + if (AcpiGbl_ExternalList->Flags &= ACPI_EXT_CONFLICTING_DECLARATION) + { + AcpiOsPrintf ("%s", ExternalConflictMessage); + AcpiDmConflictingDeclaration (AcpiGbl_ExternalList->Path); + } AcpiOsPrintf ("\n"); } @@ -1165,6 +1368,106 @@ AcpiDmEmitExternals ( /******************************************************************************* * + * FUNCTION: AcpiDmMarkExternalConflict + * + * PARAMETERS: Path - Namepath to search + * + * RETURN: ExternalList + * + * DESCRIPTION: Search the AcpiGbl_ExternalList for a matching path + * + ******************************************************************************/ + +void +AcpiDmMarkExternalConflict ( + ACPI_NAMESPACE_NODE *Node) +{ + ACPI_EXTERNAL_LIST *ExternalList = AcpiGbl_ExternalList; + char *ExternalPath; + char *InternalPath; + char *Temp; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (DmMarkExternalConflict); + + + if (Node->Flags & ANOBJ_IS_EXTERNAL) + { + return_VOID; + } + + /* Get the full external and internal pathnames to the node */ + + Status = AcpiDmGetExternalAndInternalPath (Node, + &ExternalPath, &InternalPath); + if (ACPI_FAILURE (Status)) + { + return_VOID; + } + + /* Remove the root backslash */ + + Status = AcpiDmRemoveRootPrefix (&InternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (InternalPath); + ACPI_FREE (ExternalPath); + return_VOID; + } + + while (ExternalList) + { + Temp = ExternalList->InternalPath; + if ((*ExternalList->InternalPath == AML_ROOT_PREFIX) && + (ExternalList->InternalPath[1])) + { + Temp++; + } + + if (!strcmp (ExternalList->InternalPath, InternalPath)) + { + ExternalList->Flags |= ACPI_EXT_CONFLICTING_DECLARATION; + } + ExternalList = ExternalList->Next; + } + + ACPI_FREE (InternalPath); + ACPI_FREE (ExternalPath); + + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmConflictingDeclaration + * + * PARAMETERS: Path - Path with conflicting declaration + * + * RETURN: None + * + * DESCRIPTION: Emit a warning when printing conflicting ASL external + * declarations. + * + ******************************************************************************/ + +static void +AcpiDmConflictingDeclaration ( + char *Path) +{ + fprintf (stderr, + " Warning - Emitting ASL code \"External (%s)\"\n" + " This is a conflicting declaration with some " + "other declaration within the ASL code.\n" + " This external declaration may need to be " + "deleted in order to recompile the dsl file.\n\n", + Path); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmEmitExternal * * PARAMETERS: Op External Parse Object @@ -1172,7 +1475,8 @@ AcpiDmEmitExternals ( * RETURN: None * * DESCRIPTION: Emit an External() ASL statement for the current External - * parse object + * parse object. Note: External Ops are named types so the + * namepath is contained within NameOp->Name.Path. * ******************************************************************************/ @@ -1182,14 +1486,76 @@ AcpiDmEmitExternal ( ACPI_PARSE_OBJECT *TypeOp) { AcpiOsPrintf ("External ("); - AcpiDmNamestring (NameOp->Common.Value.Name); - AcpiOsPrintf ("%s)\n", + AcpiDmNamestring (NameOp->Named.Path); + AcpiOsPrintf ("%s)", AcpiDmGetObjectTypeName ((ACPI_OBJECT_TYPE) TypeOp->Common.Value.Integer)); + AcpiDmCheckForExternalConflict (NameOp->Named.Path); + AcpiOsPrintf ("\n"); } /******************************************************************************* * + * FUNCTION: AcpiDmCheckForExternalConflict + * + * PARAMETERS: Path - Path to check + * + * RETURN: None + * + * DESCRIPTION: Search the External List to see if the input Path has a + * conflicting declaration. + * + ******************************************************************************/ + +static void +AcpiDmCheckForExternalConflict ( + char *Path) +{ + ACPI_EXTERNAL_LIST *ExternalList = AcpiGbl_ExternalList; + char *ListItemPath; + char *InputPath; + + + if (!Path) + { + return; + } + + /* Move past the root prefix '\' */ + + InputPath = Path; + if ((*InputPath == AML_ROOT_PREFIX) && InputPath[1]) + { + InputPath++; + } + + while (ExternalList) + { + ListItemPath = ExternalList->Path; + if (ListItemPath) + { + /* Move past the root prefix '\' */ + + if ((*ListItemPath == AML_ROOT_PREFIX) && + ListItemPath[1]) + { + ListItemPath++; + } + + if (!strcmp (ListItemPath, InputPath) && + (ExternalList->Flags & ACPI_EXT_CONFLICTING_DECLARATION)) + { + AcpiOsPrintf ("%s", ExternalConflictMessage); + AcpiDmConflictingDeclaration (Path); + + return; + } + } + ExternalList = ExternalList->Next; + } +} +/******************************************************************************* + * * FUNCTION: AcpiDmUnresolvedWarning * * PARAMETERS: Type - Where to output the warning. @@ -1203,7 +1569,7 @@ AcpiDmEmitExternal ( * ******************************************************************************/ -#if 0 +/* Summary of the external control method problem: When the -e option is used with disassembly, the various SSDTs are simply @@ -1272,7 +1638,7 @@ disassembler, otherwise it does not know how to handle the method invocations. In other words, if ABCD and EFGH are actually external control methods appearing in an SSDT, the disassembler does not know what to do unless the owning SSDT has been loaded via the -e option. -#endif +*/ static char ExternalWarningPart1[600]; static char ExternalWarningPart2[400]; diff --git a/source/common/dmrestag.c b/source/common/dmrestag.c index 2ee1e08..671a1e4 100644 --- a/source/common/dmrestag.c +++ b/source/common/dmrestag.c @@ -316,6 +316,34 @@ static const ACPI_RESOURCE_TAG AcpiDmUartSerialBusTags[] = {0, NULL} }; +/* Subtype tables for PinFunction descriptor */ + +static const ACPI_RESOURCE_TAG AcpiDmPinFunctionTags[] = +{ + {( 4 * 8), ACPI_RESTAG_INTERRUPTSHARE}, + {( 6 * 8), ACPI_RESTAG_PINCONFIG}, + {( 7 * 8), ACPI_RESTAG_FUNCTION}, + {0, NULL} +}; + +/* Subtype tables for PinConfig descriptor */ + +static const ACPI_RESOURCE_TAG AcpiDmPinConfigTags[] = +{ + {( 4 * 8), ACPI_RESTAG_INTERRUPTSHARE}, + {( 6 * 8), ACPI_RESTAG_PINCONFIG_TYPE}, + {( 7 * 8), ACPI_RESTAG_PINCONFIG_VALUE}, + {0, NULL} +}; + +/* Subtype tables for PinGroupFunction descriptor */ + +static const ACPI_RESOURCE_TAG AcpiDmPinGroupFunctionTags[] = +{ + {( 6 * 8), ACPI_RESTAG_FUNCTION}, + {0, NULL} +}; + /* Subtype tables for Address descriptor type-specific flags */ static const ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] = @@ -380,8 +408,12 @@ static const ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags[] = AcpiDmAddress64Tags, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */ AcpiDmExtendedAddressTags, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */ NULL, /* 0x0C, ACPI_RESOURCE_NAME_GPIO - Use Subtype table below */ - NULL, /* 0x0D, Reserved */ - NULL /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use Subtype table below */ + AcpiDmPinFunctionTags, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */ + NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use Subtype table below */ + AcpiDmPinConfigTags, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */ + NULL, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */ + AcpiDmPinGroupFunctionTags, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */ + AcpiDmPinConfigTags, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG - Same as PinConfig */ }; /* GPIO Subtypes */ diff --git a/source/common/dmswitch.c b/source/common/dmswitch.c new file mode 100644 index 0000000..0ef7b80 --- /dev/null +++ b/source/common/dmswitch.c @@ -0,0 +1,571 @@ +/****************************************************************************** + * + * Module Name: adwalk - Disassembler routines for switch statements + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2017, 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" +#include "acparser.h" +#include "amlcode.h" +#include "acdisasm.h" +#include "acdispat.h" +#include "acnamesp.h" +#include "acapps.h" + + +#define _COMPONENT ACPI_CA_DISASSEMBLER + ACPI_MODULE_NAME ("dmswitch") + +static BOOLEAN +AcpiDmIsSwitchBlock ( + ACPI_PARSE_OBJECT *Op, + char **Temp); + +static BOOLEAN +AcpiDmIsCaseBlock ( + ACPI_PARSE_OBJECT *Op); + + +/******************************************************************************* + * + * FUNCTION: AcpiDmProcessSwitch + * + * PARAMETERS: Op - Object to be examined + * + * RETURN: ACPI_STATUS + * + * DESCRIPTION: Walk function to create a list of all temporary (_T_) objects. + * If a While loop is found that can be converted to a Switch, do + * the conversion, remove the temporary name from the list, and + * mark the parse op with an IGNORE flag. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDmProcessSwitch ( + ACPI_PARSE_OBJECT *Op) +{ + char *Temp = NULL; + ACPI_PARSE_OBJECT_LIST *NewTemp; + ACPI_PARSE_OBJECT_LIST *Current; + ACPI_PARSE_OBJECT_LIST *Previous; + BOOLEAN FoundTemp = FALSE; + + + switch (Op->Common.AmlOpcode) + { + case AML_NAME_OP: + + Temp = (char *) (&Op->Named.Name); + + if (!strncmp(Temp, "_T_", 3)) + { + /* Allocate and init a new Temp List node */ + + NewTemp = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PARSE_OBJECT_LIST)); + if (!NewTemp) + { + return (AE_NO_MEMORY); + } + + if (AcpiGbl_TempListHead) + { + Current = AcpiGbl_TempListHead; + AcpiGbl_TempListHead = NewTemp; + AcpiGbl_TempListHead->Op = Op; + AcpiGbl_TempListHead->Next = Current; + } + else + { + AcpiGbl_TempListHead = NewTemp; + AcpiGbl_TempListHead->Op = Op; + AcpiGbl_TempListHead->Next = NULL; + } + } + break; + + case AML_WHILE_OP: + + if (!AcpiDmIsSwitchBlock (Op, &Temp)) + { + break; + } + + /* Found a Switch */ + + Op->Common.DisasmOpcode = ACPI_DASM_SWITCH; + + Previous = Current = AcpiGbl_TempListHead; + while (Current) + { + /* Note, if we get here Temp is not NULL */ + + if (!strncmp(Temp, (char *) (&Current->Op->Named.Name), 4)) + { + /* Match found. Ignore disassembly */ + + Current->Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + + /* Remove from list */ + + if (Current == AcpiGbl_TempListHead) + { + AcpiGbl_TempListHead = Current->Next; + } + else + { + Previous->Next = Current->Next; + } + + Current->Op = NULL; + Current->Next = NULL; + ACPI_FREE (Current); + FoundTemp = TRUE; + break; + } + + Previous = Current; + Current = Current->Next; + } + + if (!FoundTemp) + { + fprintf (stderr, + "Warning: Declaration for temp name %.4s not found\n", Temp); + } + break; + + default: + break; + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmClearTempList + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Removes any remaining temporary objects from global list and + * frees + * + ******************************************************************************/ + +void +AcpiDmClearTempList ( + void) +{ + ACPI_PARSE_OBJECT_LIST *Current; + + + while (AcpiGbl_TempListHead) + { + Current = AcpiGbl_TempListHead; + AcpiGbl_TempListHead = AcpiGbl_TempListHead->Next; + Current->Op = NULL; + Current->Next = NULL; + ACPI_FREE (Current); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmIsSwitchBlock + * + * PARAMETERS: Op - While Object + * + * RETURN: TRUE if While block can be converted to a Switch/Case block + * + * DESCRIPTION: Determines if While block is a Switch/Case statement. Modifies + * parse tree to allow for Switch/Case disassembly during walk. + * + * EXAMPLE: Example of parse tree to be converted + * + * While + * One + * Store + * ByteConst + * -NamePath- + * If + * LEqual + * -NamePath- + * Zero + * Return + * One + * Else + * Return + * WordConst + * Break + * + ******************************************************************************/ + +BOOLEAN +AcpiDmIsSwitchBlock ( + ACPI_PARSE_OBJECT *Op, + char **Temp) +{ + ACPI_PARSE_OBJECT *OneOp; + ACPI_PARSE_OBJECT *StoreOp; + ACPI_PARSE_OBJECT *NamePathOp; + ACPI_PARSE_OBJECT *PredicateOp; + ACPI_PARSE_OBJECT *CurrentOp; + ACPI_PARSE_OBJECT *TempOp; + + + /* Check for One Op Predicate */ + + OneOp = AcpiPsGetArg (Op, 0); + if (!OneOp || (OneOp->Common.AmlOpcode != AML_ONE_OP)) + { + return (FALSE); + } + + /* Check for Store Op */ + + StoreOp = OneOp->Common.Next; + if (!StoreOp || (StoreOp->Common.AmlOpcode != AML_STORE_OP)) + { + return (FALSE); + } + + /* Check for Name Op with _T_ string */ + + NamePathOp = AcpiPsGetArg (StoreOp, 1); + if (!NamePathOp || + (NamePathOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP)) + { + return (FALSE); + } + + if (strncmp ((char *) (NamePathOp->Common.Value.Name), "_T_", 3)) + { + return (FALSE); + } + + *Temp = (char *) (NamePathOp->Common.Value.Name); + + /* This is a Switch/Case control block */ + + /* Ignore the One Op Predicate */ + + OneOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + + /* Ignore the Store Op, but not the children */ + + StoreOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE; + + /* + * First arg of Store Op is the Switch condition. + * Mark it as a Switch predicate and as a parameter list for paren + * closing and correct indentation. + */ + PredicateOp = AcpiPsGetArg (StoreOp, 0); + PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE; + PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; + + /* Ignore the Name Op */ + + NamePathOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE; + + /* Remaining opcodes are the Case statements (If/ElseIf's) */ + + CurrentOp = StoreOp->Common.Next; + while (AcpiDmIsCaseBlock (CurrentOp)) + { + /* Block is a Case structure */ + + if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + /* ElseIf */ + + CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE; + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + } + + /* If */ + + CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE; + + /* + * Mark the parse tree for Case disassembly. There are two + * types of Case statements. The first type of statement begins with + * an LEqual. The second starts with an LNot and uses a Match statement + * on a Package of constants. + */ + TempOp = AcpiPsGetArg (CurrentOp, 0); + switch (TempOp->Common.AmlOpcode) + { + case (AML_LOGICAL_EQUAL_OP): + + /* Ignore just the LEqual Op */ + + TempOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE; + + /* Ignore the NamePath Op */ + + TempOp = AcpiPsGetArg (TempOp, 0); + TempOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE; + + /* + * Second arg of LEqual will be the Case predicate. + * Mark it as a predicate and also as a parameter list for paren + * closing and correct indentation. + */ + PredicateOp = TempOp->Common.Next; + PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE; + PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; + break; + + case (AML_LOGICAL_NOT_OP): + + /* + * The Package will be the predicate of the Case statement. + * It's under: + * LNOT + * LEQUAL + * MATCH + * PACKAGE + */ + + /* Get the LEqual Op from LNot */ + + TempOp = AcpiPsGetArg (TempOp, 0); + + /* Get the Match Op from LEqual */ + + TempOp = AcpiPsGetArg (TempOp, 0); + + /* Get the Package Op from Match */ + + PredicateOp = AcpiPsGetArg (TempOp, 0); + + /* Mark as parameter list for paren closing */ + + PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; + + /* + * The Package list would be too deeply indented if we + * chose to simply ignore the all the parent opcodes, so + * we rearrange the parse tree instead. + */ + + /* + * Save the second arg of the If/Else Op which is the + * block code of code for this Case statement. + */ + TempOp = AcpiPsGetArg (CurrentOp, 1); + + /* + * Move the Package Op to the child (predicate) of the + * Case statement. + */ + CurrentOp->Common.Value.Arg = PredicateOp; + PredicateOp->Common.Parent = CurrentOp; + + /* Add the block code */ + + PredicateOp->Common.Next = TempOp; + break; + + default: + + /* Should never get here */ + break; + } + + /* Advance to next Case block */ + + CurrentOp = CurrentOp->Common.Next; + } + + /* If CurrentOp is now an Else, then this is a Default block */ + + if (CurrentOp && CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + CurrentOp->Common.DisasmOpcode = ACPI_DASM_DEFAULT; + } + + /* + * From the first If advance to the Break op. It's possible to + * have an Else (Default) op here when there is only one Case + * statement, so check for it. + */ + CurrentOp = StoreOp->Common.Next->Common.Next; + if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + CurrentOp = CurrentOp->Common.Next; + } + + /* Ignore the Break Op */ + + CurrentOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmIsCaseBlock + * + * PARAMETERS: Op - Object to test + * + * RETURN: TRUE if Object is beginning of a Case block. + * + * DESCRIPTION: Determines if an Object is the beginning of a Case block for a + * Switch/Case statement. Parse tree must be one of the following + * forms: + * + * Else (Optional) + * If + * LEqual + * -NamePath- _T_x + * + * Else (Optional) + * If + * LNot + * LEqual + * Match + * Package + * ByteConst + * -NamePath- _T_x + * + ******************************************************************************/ + +static BOOLEAN +AcpiDmIsCaseBlock ( + ACPI_PARSE_OBJECT *Op) +{ + ACPI_PARSE_OBJECT *CurrentOp; + + + if (!Op) + { + return (FALSE); + } + + /* Look for an If or ElseIf */ + + CurrentOp = Op; + if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp) + { + return (FALSE); + } + } + + if (!CurrentOp || CurrentOp->Common.AmlOpcode != AML_IF_OP) + { + return (FALSE); + } + + /* Child must be LEqual or LNot */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp) + { + return (FALSE); + } + + switch (CurrentOp->Common.AmlOpcode) + { + case (AML_LOGICAL_EQUAL_OP): + + /* Next child must be NamePath with string _T_ */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || !CurrentOp->Common.Value.Name || + strncmp(CurrentOp->Common.Value.Name, "_T_", 3)) + { + return (FALSE); + } + break; + + case (AML_LOGICAL_NOT_OP): + + /* Child of LNot must be LEqual op */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_LOGICAL_EQUAL_OP)) + { + return (FALSE); + } + + /* Child of LNot must be Match op */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_MATCH_OP)) + { + return (FALSE); + } + + /* First child of Match must be Package op */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_PACKAGE_OP)) + { + return (FALSE); + } + + /* Third child of Match must be NamePath with string _T_ */ + + CurrentOp = AcpiPsGetArg (CurrentOp->Common.Parent, 2); + if (!CurrentOp || !CurrentOp->Common.Value.Name || + strncmp(CurrentOp->Common.Value.Name, "_T_", 3)) + { + return (FALSE); + } + break; + + default: + + return (FALSE); + } + + return (TRUE); +} diff --git a/source/common/dmtable.c b/source/common/dmtable.c index 5a629d3..188657a 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -190,6 +190,7 @@ static const char *AcpiDmHestSubnames[] = "PCI Express/PCI-X Bridge AER", "Generic Hardware Error Source", "Generic Hardware Error Source V2", + "IA-32 Deferred Machine Check", "Unknown Subtable Type" /* Reserved */ }; @@ -206,9 +207,18 @@ static const char *AcpiDmHestNotifySubnames[] = "SEA", /* ACPI 6.1 */ "SEI", /* ACPI 6.1 */ "GSIV", /* ACPI 6.1 */ + "Software Delegated Exception", /* ACPI 6.2 */ "Unknown Notify Type" /* Reserved */ }; +static const char *AcpiDmHmatSubnames[] = +{ + "Memory Subystem Address Range", + "System Locality Latency and Bandwidth Information", + "Memory Side Cache Information", + "Unknown Structure Type" /* Reserved */ +}; + static const char *AcpiDmMadtSubnames[] = { "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */ @@ -247,6 +257,8 @@ 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 */ + "Extended PCC Master Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */ + "Extended PCC Slave Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */ "Unknown Subtable Type" /* Reserved */ }; @@ -258,12 +270,21 @@ static const char *AcpiDmPmttSubnames[] = "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmPpttSubnames[] = +{ + "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */ + "Cache Type", /* ACPI_PPTT_TYPE_CACHE */ + "ID", /* ACPI_PMTT_TYPE_ID */ + "Unknown Subtable Type" /* Reserved */ +}; + static const char *AcpiDmSratSubnames[] = { "Processor Local APIC/SAPIC Affinity", "Memory Affinity", "Processor Local x2APIC Affinity", "GICC Affinity", + "GIC ITS Affinity", /* Acpi 6.2 */ "Unknown Subtable Type" /* Reserved */ }; @@ -344,6 +365,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt}, {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest}, + {ACPI_SIG_HMAT, NULL, AcpiDmDumpHmat, DtCompileHmat, TemplateHmat}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet}, {ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort}, {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs}, @@ -358,6 +380,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt}, + {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt}, {ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt}, {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt}, @@ -377,6 +400,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt}, {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt}, {ACPI_SIG_WPBT, NULL, AcpiDmDumpWpbt, DtCompileWpbt, TemplateWpbt}, + {ACPI_SIG_WSMT, AcpiDmTableInfoWsmt, NULL, NULL, TemplateWsmt}, {ACPI_SIG_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv}, {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt}, {NULL, NULL, NULL, NULL, NULL} @@ -783,6 +807,7 @@ AcpiDmDumpTable ( case ACPI_DMT_MADT: case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: + case ACPI_DMT_PPTT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -799,6 +824,7 @@ AcpiDmDumpTable ( case ACPI_DMT_UINT16: case ACPI_DMT_DMAR: case ACPI_DMT_HEST: + case ACPI_DMT_HMAT: case ACPI_DMT_NFIT: ByteLength = 2; @@ -980,6 +1006,31 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03); break; + case ACPI_DMT_FLAGS4_0: + + AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F); + break; + + case ACPI_DMT_FLAGS4_4: + + AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F); + break; + + case ACPI_DMT_FLAGS4_8: + + AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F); + break; + + case ACPI_DMT_FLAGS4_12: + + AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F); + break; + + case ACPI_DMT_FLAGS16_16: + + AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF); + break; + /* Integer Data Types */ case ACPI_DMT_UINT8: @@ -1301,6 +1352,20 @@ AcpiDmDumpTable ( AcpiDmHestNotifySubnames[Temp8]); break; + case ACPI_DMT_HMAT: + + /* HMAT subtable types */ + + Temp16 = *Target; + if (Temp16 > ACPI_HMAT_TYPE_RESERVED) + { + Temp16 = ACPI_HMAT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT16_FORMAT, *Target, + AcpiDmHmatSubnames[Temp16]); + break; + case ACPI_DMT_IORTMEM: AcpiOsPrintf (STRING_FORMAT, @@ -1372,6 +1437,20 @@ AcpiDmDumpTable ( AcpiDmPmttSubnames[Temp8]); break; + case ACPI_DMT_PPTT: + + /* PPTT subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_PPTT_TYPE_RESERVED) + { + Temp8 = ACPI_PPTT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmPpttSubnames[Temp8]); + break; + case ACPI_DMT_UNICODE: if (ByteLength == 0) diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c index db6230a..180de6c 100644 --- a/source/common/dmtbdump.c +++ b/source/common/dmtbdump.c @@ -1622,6 +1622,14 @@ AcpiDmDumpHest ( SubTableLength = sizeof (ACPI_HEST_GENERIC_V2); break; + case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK: + + InfoTable = AcpiDmTableInfoHest11; + SubTableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK); + BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK, + SubTable))->NumHardwareBanks; + break; + default: /* Cannot continue on unknown type - no length */ @@ -1676,6 +1684,203 @@ AcpiDmDumpHest ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpHmat + * + * PARAMETERS: Table - A HMAT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a HMAT. + * + ******************************************************************************/ + +void +AcpiDmDumpHmat ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_HMAT_STRUCTURE *HmatStruct; + ACPI_HMAT_LOCALITY *HmatLocality; + ACPI_HMAT_CACHE *HmatCache; + UINT32 Offset; + UINT32 SubTableOffset; + UINT32 Length; + ACPI_DMTABLE_INFO *InfoTable; + UINT32 i, j; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset = sizeof (ACPI_TABLE_HMAT); + + while (Offset < Table->Length) + { + AcpiOsPrintf ("\n"); + SubTableOffset = 0; + + /* Dump HMAT structure header */ + + HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset); + if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE)) + { + AcpiOsPrintf ("Invalid HMAT structure length\n"); + return; + } + Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct, + HmatStruct->Length, AcpiDmTableInfoHmatHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (HmatStruct->Type) + { + case ACPI_HMAT_TYPE_ADDRESS_RANGE: + + InfoTable = AcpiDmTableInfoHmat0; + Length = sizeof (ACPI_HMAT_ADDRESS_RANGE); + break; + + case ACPI_HMAT_TYPE_LOCALITY: + + InfoTable = AcpiDmTableInfoHmat1; + Length = sizeof (ACPI_HMAT_LOCALITY); + break; + + case ACPI_HMAT_TYPE_CACHE: + + InfoTable = AcpiDmTableInfoHmat2; + Length = sizeof (ACPI_HMAT_CACHE); + break; + + default: + + AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n", + HmatStruct->Type); + + /* Attempt to continue */ + + goto NextSubTable; + } + + /* Dump HMAT structure body */ + + if (HmatStruct->Length < Length) + { + AcpiOsPrintf ("Invalid HMAT structure length\n"); + return; + } + Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct, + HmatStruct->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Dump HMAT structure additionals */ + + switch (HmatStruct->Type) + { + case ACPI_HMAT_TYPE_LOCALITY: + + HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct); + SubTableOffset = sizeof (ACPI_HMAT_LOCALITY); + + /* Dump initiator proximity domains */ + + if ((UINT32)(HmatStruct->Length - SubTableOffset) < + (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4)) + { + AcpiOsPrintf ("Invalid initiator proximity domain number\n"); + return; + } + for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++) + { + Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset, + ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset), + 4, AcpiDmTableInfoHmat1a); + SubTableOffset += 4; + } + + /* Dump target proximity domains */ + + if ((UINT32)(HmatStruct->Length - SubTableOffset) < + (UINT32)(HmatLocality->NumberOfTargetPDs * 4)) + { + AcpiOsPrintf ("Invalid target proximity domain number\n"); + return; + } + for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++) + { + Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset, + ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset), + 4, AcpiDmTableInfoHmat1b); + SubTableOffset += 4; + } + + /* Dump latency/bandwidth entris */ + + if ((UINT32)(HmatStruct->Length - SubTableOffset) < + (UINT32)(HmatLocality->NumberOfInitiatorPDs * + HmatLocality->NumberOfTargetPDs * 2)) + { + AcpiOsPrintf ("Invalid latency/bandwidth entry number\n"); + return; + } + for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++) + { + for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++) + { + Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset, + ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset), + 2, AcpiDmTableInfoHmat1c); + SubTableOffset += 2; + } + } + break; + + case ACPI_HMAT_TYPE_CACHE: + + HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct); + SubTableOffset = sizeof (ACPI_HMAT_CACHE); + + /* Dump SMBIOS handles */ + + if ((UINT32)(HmatStruct->Length - SubTableOffset) < + (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2)) + { + AcpiOsPrintf ("Invalid SMBIOS handle number\n"); + return; + } + for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++) + { + Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset, + ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset), + 2, AcpiDmTableInfoHmat2a); + SubTableOffset += 2; + } + break; + + default: + + break; + } + +NextSubTable: + /* Point to next HMAT structure subtable */ + + Offset += (HmatStruct->Length); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpIort * * PARAMETERS: Table - A IORT table @@ -2902,6 +3107,16 @@ AcpiDmDumpPcct ( InfoTable = AcpiDmTableInfoPcct2; break; + case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE: + + InfoTable = AcpiDmTableInfoPcct3; + break; + + case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE: + + InfoTable = AcpiDmTableInfoPcct4; + break; + default: AcpiOsPrintf ( @@ -3134,6 +3349,136 @@ AcpiDmDumpPmtt ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpPptt + * + * PARAMETERS: Table - A PMTT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a PPTT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpPptt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_SUBTABLE_HEADER *SubTable; + ACPI_PPTT_PROCESSOR *PpttProcessor; + UINT8 Length; + UINT8 SubTableOffset; + UINT32 Offset = sizeof (ACPI_TABLE_FPDT); + ACPI_DMTABLE_INFO *InfoTable; + UINT32 i; + + + /* There is no main table (other than the standard ACPI header) */ + + /* Subtables */ + + Offset = sizeof (ACPI_TABLE_HEADER); + while (Offset < Table->Length) + { + AcpiOsPrintf ("\n"); + + /* Common subtable header */ + + SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset); + if (SubTable->Length < sizeof (ACPI_SUBTABLE_HEADER)) + { + AcpiOsPrintf ("Invalid subtable length\n"); + return; + } + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoPpttHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (SubTable->Type) + { + case ACPI_PPTT_TYPE_PROCESSOR: + + InfoTable = AcpiDmTableInfoPptt0; + Length = sizeof (ACPI_PPTT_PROCESSOR); + break; + + case ACPI_PPTT_TYPE_CACHE: + + InfoTable = AcpiDmTableInfoPptt1; + Length = sizeof (ACPI_PPTT_CACHE); + break; + + case ACPI_PPTT_TYPE_ID: + + InfoTable = AcpiDmTableInfoPptt2; + Length = sizeof (ACPI_PPTT_ID); + break; + + default: + + AcpiOsPrintf ("\n**** Unknown PPTT subtable type 0x%X\n\n", + SubTable->Type); + + /* Attempt to continue */ + + goto NextSubTable; + } + + if (SubTable->Length < Length) + { + AcpiOsPrintf ("Invalid subtable length\n"); + return; + } + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + SubTableOffset = Length; + + switch (SubTable->Type) + { + case ACPI_PPTT_TYPE_PROCESSOR: + + PpttProcessor = ACPI_CAST_PTR (ACPI_PPTT_PROCESSOR, SubTable); + + /* Dump SMBIOS handles */ + + if ((UINT8)(SubTable->Length - SubTableOffset) < + (UINT8)(PpttProcessor->NumberOfPrivResources * 4)) + { + AcpiOsPrintf ("Invalid private resource number\n"); + return; + } + for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++) + { + Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset, + ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTableOffset), + 4, AcpiDmTableInfoPptt0a); + SubTableOffset += 4; + } + break; + + default: + + break; + } + +NextSubTable: + /* Point to next subtable */ + + Offset += SubTable->Length; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpS3pt * * PARAMETERS: Table - A S3PT table @@ -3390,6 +3735,11 @@ AcpiDmDumpSrat ( InfoTable = AcpiDmTableInfoSrat3; break; + case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY: + + InfoTable = AcpiDmTableInfoSrat4; + break; + default: AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type); diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c index 0cdbe50..5149f3d 100644 --- a/source/common/dmtbinfo.c +++ b/source/common/dmtbinfo.c @@ -96,6 +96,7 @@ #define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f) #define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f) #define ACPI_HPET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HPET,f) +#define ACPI_HMAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HMAT,f) #define ACPI_IORT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IORT,f) #define ACPI_IVRS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MADT,f) @@ -122,6 +123,7 @@ #define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f) #define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f) #define ACPI_WPBT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WPBT,f) +#define ACPI_WSMT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WSMT,f) #define ACPI_XENV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_XENV,f) /* Subtables */ @@ -165,8 +167,13 @@ #define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) #define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f) #define ACPI_HEST10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC_V2,f) +#define ACPI_HEST11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f) #define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) #define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) +#define ACPI_HMAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_ADDRESS_RANGE,f) +#define ACPI_HMAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_LOCALITY,f) +#define ACPI_HMAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_CACHE,f) +#define ACPI_HMATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_STRUCTURE,f) #define ACPI_IORT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ITS_GROUP,f) #define ACPI_IORT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT,f) #define ACPI_IORT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ROOT_COMPLEX,f) @@ -221,11 +228,17 @@ #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_PCCT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f) +#define ACPI_PCCT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,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) #define ACPI_PMTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f) #define ACPI_PMTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_HEADER,f) +#define ACPI_PPTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) +#define ACPI_PPTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_PROCESSOR,f) +#define ACPI_PPTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_CACHE,f) +#define ACPI_PPTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_ID,f) #define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f) #define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f) #define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) @@ -235,6 +248,7 @@ #define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) #define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) #define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f) +#define ACPI_SRAT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GIC_ITS_AFFINITY,f) #define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f) #define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f) #define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f) @@ -247,11 +261,14 @@ /* Flags */ +#define ACPI_BGRT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_BGRT,f,o) #define ACPI_DRTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_DRTM,f,o) #define ACPI_DRTM1a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_DRTM_RESOURCE,f,o) #define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FADT,f,o) #define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FACS,f,o) #define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_HPET,f,o) +#define ACPI_PPTT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_PROCESSOR,f,o) +#define ACPI_PPTT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_CACHE,f,o) #define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o) #define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o) #define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o) @@ -259,6 +276,9 @@ #define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o) #define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o) #define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o) +#define ACPI_HMAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_ADDRESS_RANGE,f,o) +#define ACPI_HMAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_LOCALITY,f,o) +#define ACPI_HMAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_CACHE,f,o) #define ACPI_IORT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,f,o) #define ACPI_IORT3a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_GSI,f,o) #define ACPI_IORT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_V3,f,o) @@ -284,13 +304,17 @@ #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_PCCT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f,o) +#define ACPI_PCCT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,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_WSMT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WSMT,f,o) #define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) #define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) #define ACPI_HEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f,o) #define ACPI_HEST1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_CORRECTED,f,o) #define ACPI_HEST6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_AER_ROOT,f,o) +#define ACPI_HEST11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f,o) /* * Required terminator for all tables below @@ -672,7 +696,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBert[] = ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[] = { {ACPI_DMT_UINT16, ACPI_BGRT_OFFSET (Version), "Version", 0}, - {ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (Status), "Status", 0}, + {ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (Status), "Status (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_BGRT_FLAG_OFFSET (Status, 0), "Displayed", 0}, + {ACPI_DMT_FLAGS1, ACPI_BGRT_FLAG_OFFSET (Status, 0), "Orientation Offset", 0}, + {ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (ImageType), "Image Type", 0}, {ACPI_DMT_UINT64, ACPI_BGRT_OFFSET (ImageAddress), "Image Address", 0}, {ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetX), "Image OffsetX", 0}, @@ -1241,6 +1268,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] = {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved", 0}, \ {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags (decoded below)", DT_FLAG}, \ {ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Firmware First", 0}, \ + {ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Global", 0}, \ {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record", 0}, \ @@ -1265,6 +1293,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] = {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_HEST0_FLAG_OFFSET (Flags,0), "Firmware First", 0}, + {ACPI_DMT_FLAG2, ACPI_HEST0_FLAG_OFFSET (Flags,0), "GHES Assist", 0}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, @@ -1284,6 +1313,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] = {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved1", 0}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_HEST1_FLAG_OFFSET (Flags,0), "Firmware First", 0}, + {ACPI_DMT_FLAG2, ACPI_HEST1_FLAG_OFFSET (Flags,0), "GHES Assist", 0}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, @@ -1374,6 +1404,27 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[] = ACPI_DMT_TERMINATOR }; +/* 11: IA32 Deferred Machine Check */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHest11[] = +{ + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST11_OFFSET (Reserved1), "Reserved1", 0}, + {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_HEST11_FLAG_OFFSET (Flags,0), "Firmware First", 0}, + {ACPI_DMT_FLAG2, ACPI_HEST11_FLAG_OFFSET (Flags,0), "GHES Assist", 0}, + + {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (Enabled), "Enabled", 0}, + {ACPI_DMT_UINT32, ACPI_HEST11_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, + {ACPI_DMT_UINT32, ACPI_HEST11_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, + {ACPI_DMT_HESTNTFY, ACPI_HEST11_OFFSET (Notify), "Notify", 0}, + {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0}, + {ACPI_DMT_UINT24, ACPI_HEST11_OFFSET (Reserved2[0]), "Reserved2", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Notification Structure */ + ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] = { {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type", 0}, @@ -1429,6 +1480,105 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[] = /******************************************************************************* * + * HMAT - Heterogeneous Memory Attributes Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat[] = +{ + {ACPI_DMT_UINT32, ACPI_HMAT_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Common HMAT structure header (one per Subtable) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[] = +{ + {ACPI_DMT_HMAT, ACPI_HMATH_OFFSET (Type), "Structure Type", 0}, + {ACPI_DMT_UINT16, ACPI_HMATH_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_HMATH_OFFSET (Length), "Length", 0}, + ACPI_DMT_TERMINATOR +}; + +/* HMAT subtables */ + +/* 0x00: Memory Subsystem Address Range */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[] = +{ + {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Flags), "Flags (decoded below)", 0}, + {ACPI_DMT_FLAG0, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Processor Proximity Domain Valid", 0}, + {ACPI_DMT_FLAG1, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Memory Proximity Domain Valid", 0}, + {ACPI_DMT_FLAG2, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Reservation Hint", 0}, + {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Reserved1), "Reserved1", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (ProcessorPD), "Processor Proximity Domain", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (MemoryPD), "Memory Proximity Domain", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (Reserved2), "Reserved2", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressBase), "Physical Address Range Base", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressLength), "Physical Address Range Size", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 0x01: System Locality Latency and Bandwidth Information */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1[] = +{ + {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (Flags), "Flags (decoded below)", 0}, + {ACPI_DMT_FLAGS4_0, ACPI_HMAT1_FLAG_OFFSET (Flags,0), "Memory Hierarchy", 0}, + {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (DataType), "Data Type", 0}, + {ACPI_DMT_UINT16, ACPI_HMAT1_OFFSET (Reserved1), "Reserved1", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (NumberOfInitiatorPDs), "Initiator Proximity Domains #", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (NumberOfTargetPDs), "Target Proximity Domains #", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (Reserved2), "Reserved2", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT1_OFFSET (EntryBaseUnit), "Entry Base Unit", 0}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1a[] = +{ + {ACPI_DMT_UINT32, 0, "Initiator Proximity Domain List", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1b[] = +{ + {ACPI_DMT_UINT32, 0, "Target Proximity Domain List", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1c[] = +{ + {ACPI_DMT_UINT16, 0, "Entry", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +/* 0x02: Memory Side Cache Information */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2[] = +{ + {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (MemoryPD), "Memory Proximity Domain", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (Reserved1), "Reserved1", 0}, + {ACPI_DMT_UINT64, ACPI_HMAT2_OFFSET (CacheSize), "Memory Side Cache Size", 0}, + {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (CacheAttributes), "Cache Attributes (decoded below)", 0}, + {ACPI_DMT_FLAGS4_0, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Total Cache Levels", 0}, + {ACPI_DMT_FLAGS4_4, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Level", 0}, + {ACPI_DMT_FLAGS4_8, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Associativity", 0}, + {ACPI_DMT_FLAGS4_12, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Write Policy", 0}, + {ACPI_DMT_FLAGS16_16, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Line Size", 0}, + {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (Reserved2), "Reserved2", 0}, + {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (NumberOfSMBIOSHandles), "SMBIOS Handle #", 0}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2a[] = +{ + {ACPI_DMT_UINT16, 0, "SMBIOS Handle", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * IORT - IO Remapping Table * ******************************************************************************/ @@ -2298,7 +2448,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[] = ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[] = { {ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, - {ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Doorbell", 0}, + {ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Platform", 0}, {ACPI_DMT_UINT64, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; @@ -2332,7 +2482,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] = ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] = { - {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (PlatformInterrupt), "Platform Interrupt", 0}, {ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Polarity", 0}, {ACPI_DMT_FLAG1, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Mode", 0}, @@ -2352,7 +2502,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] = ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[] = { - {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (PlatformInterrupt), "Platform 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}, @@ -2365,12 +2515,73 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[] = {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_GAS, ACPI_PCCT2_OFFSET (PlatformAckRegister), "Platform 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 }; +/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPcct3[] = +{ + {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (PlatformInterrupt), "Platform Interrupt", 0}, + {ACPI_DMT_UINT8, ACPI_PCCT3_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_PCCT3_FLAG_OFFSET (Flags,0), "Polarity", 0}, + {ACPI_DMT_FLAG1, ACPI_PCCT3_FLAG_OFFSET (Flags,0), "Mode", 0}, + {ACPI_DMT_UINT8, ACPI_PCCT3_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (BaseAddress), "Base Address", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (Length), "Address Length", 0}, + {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (DoorbellRegister), "Doorbell Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (PreserveMask), "Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (WriteMask), "Write Mask", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (Latency), "Command Latency", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, + {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (PlatformAckRegister), "Platform ACK Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (AckSetMask), "ACK Set Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (CmdCompleteRegister), "Command Complete Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdCompleteMask), "Command Complete Check Mask", 0}, + {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (CmdUpdateRegister), "Command Update Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdUpdatePreserveMask), "Command Update Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdUpdateSetMask), "Command Update Set Mask", 0}, + {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (ErrorStatusRegister), "Error Status Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (ErrorStatusMask), "Error Status Mask", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPcct4[] = +{ + {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (PlatformInterrupt), "Platform Interrupt", 0}, + {ACPI_DMT_UINT8, ACPI_PCCT4_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_PCCT4_FLAG_OFFSET (Flags,0), "Polarity", 0}, + {ACPI_DMT_FLAG1, ACPI_PCCT4_FLAG_OFFSET (Flags,0), "Mode", 0}, + {ACPI_DMT_UINT8, ACPI_PCCT4_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (BaseAddress), "Base Address", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (Length), "Address Length", 0}, + {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (DoorbellRegister), "Doorbell Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (PreserveMask), "Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (WriteMask), "Write Mask", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (Latency), "Command Latency", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (MaxAccessRate), "Maximum Access Rate", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0}, + {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (PlatformAckRegister), "Platform ACK Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (AckSetMask), "ACK Set Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (CmdCompleteRegister), "Command Complete Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdCompleteMask), "Command Complete Check Mask", 0}, + {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (CmdUpdateRegister), "Command Update Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdUpdatePreserveMask), "Command Update Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdUpdateSetMask), "Command Update Set Mask", 0}, + {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (ErrorStatusRegister), "Error Status Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (ErrorStatusMask), "Error Status Mask", 0}, + ACPI_DMT_TERMINATOR +}; /******************************************************************************* * @@ -2447,6 +2658,82 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[] = /******************************************************************************* * + * PPTT - Processor Properties Topology Table (ACPI 6.2) + * + ******************************************************************************/ + +/* Main table consists of only the standard ACPI header - subtables follow */ + +/* Common Subtable header (one per Subtable) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPpttHdr[] = +{ + {ACPI_DMT_PPTT, ACPI_PPTTH_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_PPTTH_OFFSET (Length), "Length", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 0: Processor hierarchy node */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[] = +{ + {ACPI_DMT_UINT16, ACPI_PPTT0_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_FLAG0, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Physical package", 0}, + {ACPI_DMT_FLAG1, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "ACPI Processor ID valid", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Parent), "Parent", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (AcpiProcessorId), "ACPI Processor ID", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (NumberOfPrivResources), "Private Resource Number", 0}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0a[] = +{ + {ACPI_DMT_UINT32, 0, "Private Resource", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +/* 1: Cache type */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[] = +{ + {ACPI_DMT_UINT16, ACPI_PPTT1_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_FLAG0, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Size valid", 0}, + {ACPI_DMT_FLAG1, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Number of Sets valid", 0}, + {ACPI_DMT_FLAG2, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Associativity valid", 0}, + {ACPI_DMT_FLAG3, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Allocation Type valid", 0}, + {ACPI_DMT_FLAG4, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Cache Type valid", 0}, + {ACPI_DMT_FLAG5, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Write Policy valid", 0}, + {ACPI_DMT_FLAG5, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Line Size valid", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NextLevelOfCache), "Next Level of Cache", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (Size), "Size", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NumberOfSets), "Number of Sets", 0}, + {ACPI_DMT_UINT8, ACPI_PPTT1_OFFSET (Associativity), "Associativity", 0}, + {ACPI_DMT_UINT8, ACPI_PPTT1_OFFSET (Attributes), "Attributes", 0}, + {ACPI_DMT_FLAGS0, ACPI_PPTT1_OFFSET (Attributes), "Allocation Type", 0}, + {ACPI_DMT_FLAGS2, ACPI_PPTT1_OFFSET (Attributes), "Cache Type", 0}, + {ACPI_DMT_FLAG4, ACPI_PPTT1_OFFSET (Attributes), "Write Policy", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT1_OFFSET (LineSize), "Line Size", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 2: ID */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[] = +{ + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "VENDOR_ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "LEVEL_1_ID", 0}, + {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "LEVEL_2_ID", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "MAJOR_REV", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "MINOR_REV", 0}, + {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "SPIN_REV", 0}, + ACPI_DMT_TERMINATOR +}; + +/******************************************************************************* + * * RASF - RAS Feature table * ******************************************************************************/ @@ -2671,7 +2958,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] = ACPI_DMT_TERMINATOR }; -/* : GICC Affinity (ACPI 5.1) */ +/* 3: GICC Affinity (ACPI 5.1) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] = { @@ -2683,6 +2970,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] = ACPI_DMT_TERMINATOR }; +/* 4: GCC ITS Affinity (ACPI 6.2) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[] = +{ + {ACPI_DMT_UINT32, ACPI_SRAT4_OFFSET (ProximityDomain), "Proximity Domain", 0}, + {ACPI_DMT_UINT16, ACPI_SRAT4_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT4_OFFSET (ItsId), "ITS ID", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * @@ -2950,6 +3247,22 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[] = /******************************************************************************* * + * WSMT - Windows SMM Security Migrations Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoWsmt[] = +{ + {ACPI_DMT_UINT32, ACPI_WSMT_OFFSET (ProtectionFlags), "Protection Flags", 0}, + {ACPI_DMT_FLAG0, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "FIXED_COMM_BUFFERS", 0}, + {ACPI_DMT_FLAG1, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "COMM_BUFFER_NESTED_PTR_PROTECTION", 0}, + {ACPI_DMT_FLAG2, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "SYSTEM_RESOURCE_PROTECTION", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * XENV - Xen Environment table (ACPI 6.0) * ******************************************************************************/ diff --git a/source/compiler/aslascii.c b/source/compiler/aslascii.c index cacf302..807364a 100644 --- a/source/compiler/aslascii.c +++ b/source/compiler/aslascii.c @@ -86,7 +86,7 @@ FlIsFileAsciiSource ( BOOLEAN DisplayErrors) { UINT8 Byte; - ACPI_SIZE BadBytes = 0; + UINT32 BadBytes = 0; BOOLEAN OpeningComment = FALSE; ASL_FILE_STATUS Status; FILE *Handle; @@ -177,6 +177,9 @@ FlIsFileAsciiSource ( if (BadBytes) { + fprintf (stderr, + "File appears to be binary: found %u non-ASCII characters, disassembling\n", + BadBytes); if (DisplayErrors) { AcpiOsPrintf ( diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c index 5da664f..32ae24f 100644 --- a/source/compiler/aslcompile.c +++ b/source/compiler/aslcompile.c @@ -460,7 +460,7 @@ AslCompilerSignon ( /* Running compiler or disassembler? */ - if (Gbl_DisasmFlag) + if (AcpiGbl_DisasmFlag) { UtilityName = AML_DISASSEMBLER_NAME; } diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h index 0b7403f..99596c2 100644 --- a/source/compiler/aslcompiler.h +++ b/source/compiler/aslcompiler.h @@ -1290,6 +1290,26 @@ ASL_RESOURCE_NODE * RsDoUartSerialBusDescriptor ( ASL_RESOURCE_INFO *Info); +ASL_RESOURCE_NODE * +RsDoPinFunctionDescriptor ( + ASL_RESOURCE_INFO *Info); + +ASL_RESOURCE_NODE * +RsDoPinConfigDescriptor ( + ASL_RESOURCE_INFO *Info); + +ASL_RESOURCE_NODE * +RsDoPinGroupDescriptor ( + ASL_RESOURCE_INFO *Info); + +ASL_RESOURCE_NODE * +RsDoPinGroupFunctionDescriptor ( + ASL_RESOURCE_INFO *Info); + +ASL_RESOURCE_NODE * +RsDoPinGroupConfigDescriptor ( + ASL_RESOURCE_INFO *Info); + /* * aslrestype2d - DWord address descriptors */ diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index b609291..71a9002 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -347,6 +347,11 @@ NamePathTail [.]{NameSeg} "Memory24" { count (1); return (PARSEOP_MEMORY24); } "Memory32" { count (1); return (PARSEOP_MEMORY32); } "Memory32Fixed" { count (1); return (PARSEOP_MEMORY32FIXED); } +"PinConfig" { count (1); return (PARSEOP_PINCONFIG); } +"PinFunction" { count (1); return (PARSEOP_PINFUNCTION); } +"PinGroup" { count (1); return (PARSEOP_PINGROUP); } +"PinGroupConfig" { count (1); return (PARSEOP_PINGROUPCONFIG); } +"PinGroupFunction" { count (1); return (PARSEOP_PINGROUPFUNCTION); } "QWordIO" { count (1); return (PARSEOP_QWORDIO); } "QWordMemory" { count (1); return (PARSEOP_QWORDMEMORY); } "QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); } diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h index 85ecfc9..f3623f4 100644 --- a/source/compiler/asldefine.h +++ b/source/compiler/asldefine.h @@ -53,8 +53,8 @@ #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" #define ASL_DEFINE "__IASL__" - -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.1" +#define ASL_PREFIX "iASL: " +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2" /* Configuration constants */ diff --git a/source/compiler/aslexternal.c b/source/compiler/aslexternal.c index f63a80b..b250333 100644 --- a/source/compiler/aslexternal.c +++ b/source/compiler/aslexternal.c @@ -327,6 +327,7 @@ ExMoveExternals ( ACPI_PARSE_OBJECT *Next; char *ExternalName; ACPI_OBJECT_TYPE ObjType; + ACPI_STATUS Status; UINT32 i; @@ -365,8 +366,16 @@ ExMoveExternals ( { Next->Asl.ParseOpcode = PARSEOP_NAMESTRING; } + Next->Asl.ExternalName = ExternalName; - UtInternalizeName (ExternalName, &Next->Asl.Value.String); + Status = UtInternalizeName (ExternalName, &Next->Asl.Value.String); + if (ACPI_FAILURE (Status)) + { + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, + Next, "Could not internalize namestring"); + return; + } + Next->Asl.AmlLength = strlen (Next->Asl.Value.String); Next = Next->Asl.Next; diff --git a/source/compiler/aslglobal.h b/source/compiler/aslglobal.h index 23d1a14..07f39a3 100644 --- a/source/compiler/aslglobal.h +++ b/source/compiler/aslglobal.h @@ -167,7 +167,6 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_WarningsAsErrors, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE); -ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE); diff --git a/source/compiler/aslhelp.c b/source/compiler/aslhelp.c index 982aa56..6dd43bb 100644 --- a/source/compiler/aslhelp.c +++ b/source/compiler/aslhelp.c @@ -72,7 +72,6 @@ Usage ( ACPI_OPTION ("-@ ", "Specify command file"); ACPI_OPTION ("-I ", "Specify additional include directory"); ACPI_OPTION ("-p ", "Specify path/filename prefix for all output files"); - ACPI_OPTION ("-ca ", "convert a given ASL file to ASL+ (retains comments)"); ACPI_OPTION ("-v", "Display compiler version"); ACPI_OPTION ("-vd", "Display compiler build date and time"); ACPI_OPTION ("-vo", "Enable optimization comments"); @@ -101,7 +100,7 @@ Usage ( ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level"); ACPI_OPTION ("-we", "Report warnings as errors"); - printf ("\nAML Code Generation (*.aml):\n"); + printf ("\nAML Bytecode Generation (*.aml):\n"); ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)"); ACPI_OPTION ("-of", "Disable constant folding"); ACPI_OPTION ("-oi", "Disable integer optimization to Zero/One/Ones"); @@ -118,20 +117,24 @@ Usage ( ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)"); ACPI_OPTION ("-lx", "Create cross-reference file (*.xrf)"); - printf ("\nFirmware Support - C Output:\n"); + printf ("\nFirmware Support - C Text Output:\n"); ACPI_OPTION ("-tc", "Create hex AML table in C (*.hex)"); ACPI_OPTION ("-sc", "Create named hex AML arrays in C (*.c)"); ACPI_OPTION ("-ic", "Create include file in C for -sc symbols (*.h)"); ACPI_OPTION ("-so", "Create namespace AML offset table in C (*.offset.h)"); - printf ("\nFirmware Support - Assembler Output:\n"); + printf ("\nFirmware Support - Assembler Text Output:\n"); ACPI_OPTION ("-ta", "Create hex AML table in assembler (*.hex)"); ACPI_OPTION ("-sa", "Create named hex AML arrays in assembler (*.asm)"); ACPI_OPTION ("-ia", "Create include file in assembler for -sa symbols (*.inc)"); - printf ("\nFirmware Support - ASL Output:\n"); + printf ("\nFirmware Support - ASL Text Output:\n"); ACPI_OPTION ("-ts", "Create hex AML table in ASL (Buffer object) (*.hex)"); + printf ("\nLegacy-ASL to ASL+ Converter:\n"); + ACPI_OPTION ("-ca ", "Convert legacy-ASL source file to new ASL+ file"); + ACPI_OPTION ("", " (Original comments are passed through to ASL+ file)"); + printf ("\nData Table Compiler:\n"); ACPI_OPTION ("-G", "Compile custom table that contains generic operators"); ACPI_OPTION ("-T |ALL", "Create ACPI table template/example files"); diff --git a/source/compiler/aslhelpers.y b/source/compiler/aslhelpers.y index e0f3e89..4d54ecf 100644 --- a/source/compiler/aslhelpers.y +++ b/source/compiler/aslhelpers.y @@ -222,6 +222,15 @@ OptionalResourceType | ',' ResourceTypeKeyword {$$ = $2;} ; +/* Same as above except default is producer */ +OptionalProducerResourceType + : {$$ = TrCreateLeafNode ( + PARSEOP_RESOURCETYPE_PRODUCER);} + | ',' {$$ = TrCreateLeafNode ( + PARSEOP_RESOURCETYPE_PRODUCER);} + | ',' ResourceTypeKeyword {$$ = $2;} + ; + OptionalSlaveMode : ',' {$$ = NULL;} | ',' SlaveModeKeyword {$$ = $2;} diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c index 4d7f0f9..805ee0f 100644 --- a/source/compiler/aslload.c +++ b/source/compiler/aslload.c @@ -207,13 +207,20 @@ LdLoadFieldElements ( Child->Asl.Value.String); return (Status); } - - /* - * The name already exists in this scope - * But continue processing the elements - */ - AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child, - Child->Asl.Value.String); + else if (Status == AE_ALREADY_EXISTS && + (Node->Flags & ANOBJ_IS_EXTERNAL)) + { + Node->Type = (UINT8) ACPI_TYPE_LOCAL_REGION_FIELD; + } + else + { + /* + * The name already exists in this scope + * But continue processing the elements + */ + AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child, + Child->Asl.Value.String); + } } else { @@ -350,12 +357,30 @@ LdNamespace1Begin ( ACPI_PARSE_OBJECT *Arg; UINT32 i; BOOLEAN ForceNewScope = FALSE; + ACPI_OWNER_ID OwnerId = 0; ACPI_FUNCTION_NAME (LdNamespace1Begin); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n", Op, Op->Asl.ParseOpName)); + if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK) + { + /* + * Allocate an OwnerId for this block. This helps identify the owners + * of each namespace node. This is used in determining whether if + * certain external declarations cause redefinition errors. + */ + Status = AcpiUtAllocateOwnerId (&OwnerId); + WalkState->OwnerId = OwnerId; + if (ACPI_FAILURE (Status)) + { + AslCoreSubsystemError (Op, Status, + "Failure to allocate owner ID to this definition block.", FALSE); + return_ACPI_STATUS (Status); + } + } + /* * We are only interested in opcodes that have an associated name * (or multiple names) @@ -670,7 +695,9 @@ LdNamespace1Begin ( { /* * Allow one create on an object or segment that was - * previously declared External + * previously declared External only if WalkState->OwnerId and + * Node->OwnerId are found in different tables (meaning that + * they have differnt OwnerIds). */ Node->Flags &= ~ANOBJ_IS_EXTERNAL; Node->Type = (UINT8) ObjectType; @@ -687,6 +714,12 @@ LdNamespace1Begin ( } Status = AE_OK; + + if (Node->OwnerId == WalkState->OwnerId) + { + AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, + Op->Asl.ExternalName); + } } else if (!(Node->Flags & ANOBJ_IS_EXTERNAL) && (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) @@ -694,15 +727,52 @@ LdNamespace1Begin ( /* * Allow externals in same scope as the definition of the * actual object. Similar to C. Allows multiple definition - * blocks that refer to each other in the same file. + * blocks that refer to each other in the same file. However, + * do not allow name declaration and an external declaration + * within the same table. This is considered a re-declaration. */ Status = AE_OK; + + if (Node->OwnerId == WalkState->OwnerId) + { + AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, + Op->Asl.ExternalName); + } } else if ((Node->Flags & ANOBJ_IS_EXTERNAL) && (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) && (ObjectType == ACPI_TYPE_ANY)) { - /* Allow update of externals of unknown type. */ + /* + * Allow update of externals of unknown type. + * In the case that multiple definition blocks are being + * parsed, updating the OwnerId allows enables subsequent calls + * of this method to understand which table the most recent + * external declaration was seen. Without this OwnerId update, + * code like the following is allowed to compile: + * + * DefinitionBlock("externtest.aml", "DSDT", 0x02, "Intel", "Many", 0x00000001) + * { + * External(ERRS,methodobj) + * Method (MAIN) + * { + * Name(NUM2, 0) + * ERRS(1,2,3) + * } + * } + * + * DefinitionBlock("externtest.aml", "SSDT", 0x02, "Intel", "Many", 0x00000001) + * { + * if (0) + * { + * External(ERRS,methodobj) + * } + * Method (ERRS,3) + * {} + * + * } + */ + Node->OwnerId = WalkState->OwnerId; if (AcpiNsOpensScope (ActualObjectType)) { diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c index 451d77d..215bff1 100644 --- a/source/compiler/aslmain.c +++ b/source/compiler/aslmain.c @@ -99,6 +99,9 @@ main ( int ReturnStatus = 0; + signal (SIGINT, AslSignalHandler); + signal (SIGSEGV, AslSignalHandler); + /* * Big-endian machines are not currently supported. ACPI tables must * be little-endian, and support for big-endian machines needs to @@ -116,7 +119,6 @@ main ( /* Initialize preprocessor and compiler before command line processing */ - signal (SIGINT, AslSignalHandler); AcpiGbl_ExternalFileList = NULL; AcpiDbgLevel = 0; PrInitializePreprocessor (); @@ -146,6 +148,7 @@ main ( } } + /* Process each pathname/filename in the list, with possible wildcards */ while (argv[Index2]) @@ -193,8 +196,10 @@ CleanupAndExit: * * RETURN: None * - * DESCRIPTION: Control-C handler. Delete any intermediate files and any - * output files that may be left in an indeterminate state. + * DESCRIPTION: Signal interrupt handler. Delete any intermediate files and + * any output files that may be left in an indeterminate state. + * Currently handles SIGINT (control-c) and SIGSEGV (segmentation + * fault). * *****************************************************************************/ @@ -206,11 +211,34 @@ AslSignalHandler ( signal (Sig, SIG_IGN); - printf ("Aborting\n\n"); + fflush (stdout); + fflush (stderr); + + switch (Sig) + { + case SIGINT: + + printf ("\n" ASL_PREFIX "\n"); + break; - /* Close all open files */ + case SIGSEGV: - Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */ + /* Even on a seg fault, we will try to delete any partial files */ + + printf (ASL_PREFIX "Segmentation Fault\n"); + break; + + default: + + printf (ASL_PREFIX "Unknown interrupt signal (%u), ignoring\n", Sig); + return; + } + + /* + * Close all open files + * Note: the .pre file is the same as the input source file + */ + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { @@ -224,6 +252,7 @@ AslSignalHandler ( FlDeleteFile (i); } + printf (ASL_PREFIX "Terminating\n"); exit (0); } diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index 72a0ba9..9437761 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -343,6 +343,11 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* PARITYTYPE_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* PARITYTYPE_ODD */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* PARITYTYPE_SPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 4, 0, 0), +/* PINCONFIG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* PINFUNCTION */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* PINGROUP */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* PINGROUPCONFIG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* PINGROUPFUNCTION */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* PIN_NOPULL */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), /* PIN_PULLDEFAULT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* PIN_PULLDOWN */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), diff --git a/source/compiler/asloffset.c b/source/compiler/asloffset.c index 3aaab33..adb9f5f 100644 --- a/source/compiler/asloffset.c +++ b/source/compiler/asloffset.c @@ -142,7 +142,6 @@ LsAmlOffsetWalk ( } Length = Op->Asl.FinalAmlLength; - NamepathOffset = Gbl_CurrentAmlOffset + Length; /* Get to the NameSeg/NamePath Op (and length of the name) */ diff --git a/source/compiler/asloptions.c b/source/compiler/asloptions.c index a982143..6b20377 100644 --- a/source/compiler/asloptions.c +++ b/source/compiler/asloptions.c @@ -121,7 +121,7 @@ AslCommandLine ( /* Next parameter must be the input filename */ if (!argv[AcpiGbl_Optind] && - !Gbl_DisasmFlag) + !AcpiGbl_DisasmFlag) { printf ("Missing input filename\n"); BadCommandLine = TRUE; @@ -361,7 +361,7 @@ AslDoOptions ( return (-1); } - Gbl_DisasmFlag = TRUE; + AcpiGbl_DisasmFlag = TRUE; break; case 'D': /* Define a symbol */ @@ -433,6 +433,7 @@ AslDoOptions ( { case '^': + printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); Usage (); exit (0); diff --git a/source/compiler/aslparser.y b/source/compiler/aslparser.y index 5c66818..3c82936 100644 --- a/source/compiler/aslparser.y +++ b/source/compiler/aslparser.y @@ -100,7 +100,7 @@ AslLocalAllocate ( * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 102 +%expect 118 /*! [Begin] no source code translation */ diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index daf559b..4f8c211 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -882,6 +882,31 @@ RsDoOneResourceDescriptor ( Rnode = RsDoUartSerialBusDescriptor (Info); break; + case PARSEOP_PINCONFIG: + + Rnode = RsDoPinConfigDescriptor (Info); + break; + + case PARSEOP_PINFUNCTION: + + Rnode = RsDoPinFunctionDescriptor (Info); + break; + + case PARSEOP_PINGROUP: + + Rnode = RsDoPinGroupDescriptor (Info); + break; + + case PARSEOP_PINGROUPFUNCTION: + + Rnode = RsDoPinGroupFunctionDescriptor (Info); + break; + + case PARSEOP_PINGROUPCONFIG: + + Rnode = RsDoPinGroupConfigDescriptor (Info); + break; + case PARSEOP_DEFAULT_ARG: /* Just ignore any of these, they are used as fillers/placeholders */ diff --git a/source/compiler/aslresources.y b/source/compiler/aslresources.y index 9283192..8182626 100644 --- a/source/compiler/aslresources.y +++ b/source/compiler/aslresources.y @@ -103,6 +103,11 @@ ResourceMacroTerm | Memory24Term {} | Memory32FixedTerm {} | Memory32Term {} + | PinConfigTerm {} + | PinFunctionTerm {} + | PinGroupTerm {} + | PinGroupConfigTerm {} + | PinGroupFunctionTerm {} | QWordIOTerm {} | QWordMemoryTerm {} | QWordSpaceTerm {} @@ -497,6 +502,95 @@ Memory32Term error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; +PinConfigTerm + : PARSEOP_PINCONFIG + PARSEOP_OPEN_PAREN {$$ = TrCreateLeafNode (PARSEOP_PINCONFIG);} + OptionalShareType_First /* 04: SharedType */ + ',' ByteConstExpr /* 06: PinConfigType */ + ',' DWordConstExpr /* 08: PinConfigValue */ + ',' StringData /* 10: ResourceSource */ + OptionalByteConstExpr /* 11: ResourceSourceIndex */ + OptionalResourceType /* 12: ResourceType */ + OptionalNameString /* 13: DescriptorName */ + OptionalBuffer_Last /* 14: VendorData */ + PARSEOP_CLOSE_PAREN '{' + DWordList '}' {$$ = TrLinkChildren ($3,9, + $4,$6,$8,$10,$11,$12,$13,$14,$17);} + | PARSEOP_PINCONFIG + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + +PinFunctionTerm + : PARSEOP_PINFUNCTION + PARSEOP_OPEN_PAREN {$$ = TrCreateLeafNode (PARSEOP_PINFUNCTION);} + OptionalShareType_First /* 04: SharedType */ + ',' PinConfigByte /* 06: PinConfig */ + ',' WordConstExpr /* 08: FunctionNumber */ + ',' StringData /* 10: ResourceSource */ + OptionalByteConstExpr /* 11: ResourceSourceIndex */ + OptionalResourceType /* 12: ResourceType */ + OptionalNameString /* 13: DescriptorName */ + OptionalBuffer_Last /* 14: VendorData */ + PARSEOP_CLOSE_PAREN '{' + DWordList '}' {$$ = TrLinkChildren ($3,9, + $4,$6,$8,$10,$11,$12,$13,$14,$17);} + | PARSEOP_PINFUNCTION + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + +PinGroupTerm + : PARSEOP_PINGROUP + PARSEOP_OPEN_PAREN {$$ = TrCreateLeafNode (PARSEOP_PINGROUP);} + StringData /* 04: ResourceLabel */ + OptionalProducerResourceType /* 05: ResourceType */ + OptionalNameString /* 06: DescriptorName */ + OptionalBuffer_Last /* 07: VendorData */ + PARSEOP_CLOSE_PAREN '{' + DWordList '}' {$$ = TrLinkChildren ($3,5,$4,$5,$6,$7,$10);} + | PARSEOP_PINGROUP + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + +PinGroupConfigTerm + : PARSEOP_PINGROUPCONFIG + PARSEOP_OPEN_PAREN {$$ = TrCreateLeafNode (PARSEOP_PINGROUPCONFIG);} + OptionalShareType_First /* 04: SharedType */ + ',' ByteConstExpr /* 06: PinConfigType */ + ',' DWordConstExpr /* 08: PinConfigValue */ + ',' StringData /* 10: ResourceSource */ + OptionalByteConstExpr /* 11: ResourceSourceIndex */ + ',' StringData /* 13: ResourceSourceLabel */ + OptionalResourceType /* 14: ResourceType */ + OptionalNameString /* 15: DescriptorName */ + OptionalBuffer_Last /* 16: VendorData */ + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($3,9, + $4,$6,$8,$10,$11,$13,$14,$15,$16);} + | PARSEOP_PINGROUPCONFIG + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + +PinGroupFunctionTerm + : PARSEOP_PINGROUPFUNCTION + PARSEOP_OPEN_PAREN {$$ = TrCreateLeafNode (PARSEOP_PINGROUPFUNCTION);} + OptionalShareType_First /* 04: SharedType */ + ',' WordConstExpr /* 06: FunctionNumber */ + ',' StringData /* 08: ResourceSource */ + OptionalByteConstExpr /* 09: ResourceSourceIndex */ + ',' StringData /* 11: ResourceSourceLabel */ + OptionalResourceType /* 12: ResourceType */ + OptionalNameString /* 13: DescriptorName */ + OptionalBuffer_Last /* 14: VendorData */ + PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($3,8, + $4,$6,$8,$9,$11,$12,$13,$14);} + | PARSEOP_PINGROUPFUNCTION + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + QWordIOTerm : PARSEOP_QWORDIO PARSEOP_OPEN_PAREN {$$ = TrCreateLeafNode (PARSEOP_QWORDIO);} diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c index 4a510f9..7d11eb0 100644 --- a/source/compiler/aslrestype2s.c +++ b/source/compiler/aslrestype2s.c @@ -55,7 +55,8 @@ RsGetBufferDataLength ( static UINT16 RsGetInterruptDataLength ( - ACPI_PARSE_OBJECT *InitializerOp); + ACPI_PARSE_OBJECT *InitializerOp, + UINT32 StartIndex); static BOOLEAN RsGetVendorData ( @@ -63,6 +64,11 @@ RsGetVendorData ( UINT8 *VendorData, ACPI_SIZE DescriptorOffset); +static UINT16 +RsGetStringDataLengthAt ( + ACPI_PARSE_OBJECT *InitializerOp, + UINT32 StartIndex); + /* * This module contains descriptors for serial buses and GPIO: * @@ -71,6 +77,11 @@ RsGetVendorData ( * I2cSerialBus * SpiSerialBus * UartSerialBus + * PinFunction + * PinConfig + * PinGroup + * PinGroupFunction + * PinGroupConfig */ @@ -130,6 +141,7 @@ RsGetBufferDataLength ( * * PARAMETERS: InitializerOp - Current parse op, start of the resource * descriptor + * StartIndex - Start index of interrupt/pin list * * RETURN: Length of the interrupt data list * @@ -140,7 +152,8 @@ RsGetBufferDataLength ( static UINT16 RsGetInterruptDataLength ( - ACPI_PARSE_OBJECT *InitializerOp) + ACPI_PARSE_OBJECT *InitializerOp, + UINT32 StartIndex) { UINT16 InterruptLength; UINT32 i; @@ -153,9 +166,9 @@ RsGetInterruptDataLength ( { InitializerOp = ASL_GET_PEER_NODE (InitializerOp); - /* Interrupt list starts at offset 10 (Gpio descriptors) */ + /* Interrupt list starts at offset StartIndex (Gpio descriptors) */ - if (i >= 10) + if (i >= StartIndex) { InterruptLength += 2; } @@ -265,6 +278,43 @@ RsGetVendorData ( /******************************************************************************* * + * FUNCTION: RsGetStringDataLengthAt + * + * PARAMETERS: InitializerOp - Start of a subtree of init nodes + * StartIndex - Starting index of the string node + * + * RETURN: Valid string length if a string node is found at given + * StartIndex or 0 otherwise. + * + * DESCRIPTION: In a list of peer nodes, find the first one at given index + * that contains a string and return length. + * + ******************************************************************************/ + +static UINT16 +RsGetStringDataLengthAt ( + ACPI_PARSE_OBJECT *InitializerOp, + UINT32 StartIndex) +{ + UINT32 i; + + for (i = 0; InitializerOp; i++) + { + if (i == StartIndex && + InitializerOp->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) + { + return ((UINT16) (strlen (InitializerOp->Asl.Value.String) + 1)); + } + + InitializerOp = ASL_GET_PEER_NODE (InitializerOp); + } + + return (0); +} + + +/******************************************************************************* + * * FUNCTION: RsDoGpioIntDescriptor * * PARAMETERS: Info - Parse Op and resource template offset @@ -306,7 +356,7 @@ RsDoGpioIntDescriptor ( */ ResSourceLength = RsGetStringDataLength (InitializerOp); VendorLength = RsGetBufferDataLength (InitializerOp); - InterruptLength = RsGetInterruptDataLength (InitializerOp); + InterruptLength = RsGetInterruptDataLength (InitializerOp, 10); DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) + ResSourceLength + VendorLength + InterruptLength; @@ -515,7 +565,7 @@ RsDoGpioIoDescriptor ( */ ResSourceLength = RsGetStringDataLength (InitializerOp); VendorLength = RsGetBufferDataLength (InitializerOp); - InterruptLength = RsGetInterruptDataLength (InitializerOp); + InterruptLength = RsGetInterruptDataLength (InitializerOp, 10); PinList = InterruptList; DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) + @@ -1228,3 +1278,858 @@ RsDoUartSerialBusDescriptor ( MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource); return (Rnode); } + + +/******************************************************************************* + * + * FUNCTION: RsDoPinFunctionDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "PinFunction" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoPinFunctionDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + UINT8 *VendorData = NULL; + UINT16 *PinList = NULL; + UINT16 ResSourceLength; + UINT16 VendorLength; + UINT16 PinListLength; + UINT16 DescriptorSize; + UINT32 CurrentByteOffset; + UINT32 PinCount = 0; + UINT32 i; + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + CurrentByteOffset = Info->CurrentByteOffset; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + * 2) Vendor Data buffer + * 3) PIN (interrupt) list + */ + ResSourceLength = RsGetStringDataLength (InitializerOp); + VendorLength = RsGetBufferDataLength (InitializerOp); + PinListLength = RsGetInterruptDataLength (InitializerOp, 8); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_FUNCTION) + + ResSourceLength + VendorLength + PinListLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->PinFunction.ResourceLength = DescriptorSize; + Descriptor->PinFunction.DescriptorType = ACPI_RESOURCE_NAME_PIN_FUNCTION; + Descriptor->PinFunction.RevisionId = AML_RESOURCE_PIN_FUNCTION_REVISION; + + /* Build pointers to optional areas */ + + PinList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_PIN_FUNCTION)); + ResourceSource = ACPI_ADD_PTR (char, PinList, PinListLength); + VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength); + + /* Setup offsets within the descriptor */ + + Descriptor->PinFunction.PinTableOffset = (UINT16) + ACPI_PTR_DIFF (PinList, Descriptor); + + Descriptor->PinFunction.ResSourceOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSource, Descriptor); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* Share Type [Flags] (_SHR) */ + + RsSetFlagBits16 (&Descriptor->PinFunction.Flags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinFunction.Flags), 0); + break; + + case 1: /* Pin Config [BYTE] (_PPI) */ + + Descriptor->PinFunction.PinConfig = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinFunction.PinConfig)); + break; + + case 2: /* Function Number [WORD] (_FUN) */ + + Descriptor->PinFunction.FunctionNumber = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_FUNCTION, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinFunction.FunctionNumber)); + break; + + case 3: /* ResSource [Optional Field - STRING] */ + + if (ResSourceLength) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSource, InitializerOp->Asl.Value.String); + } + break; + + case 4: /* Resource Index */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + Descriptor->PinFunction.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + case 5: /* Resource Usage (consumer/producer) */ + + /* Assumed to be consumer */ + + break; + + case 6: /* Resource Tag (Descriptor Name) */ + + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + case 7: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + /* + * Always set the VendorOffset even if there is no Vendor Data. + * This field is required in order to calculate the length + * of the ResourceSource at runtime. + */ + Descriptor->PinFunction.VendorOffset = (UINT16) + ACPI_PTR_DIFF (VendorData, Descriptor); + + if (RsGetVendorData (InitializerOp, VendorData, + (CurrentByteOffset + Descriptor->PinFunction.VendorOffset))) + { + Descriptor->PinFunction.VendorLength = VendorLength; + } + break; + + default: + /* + * PINs come through here, repeatedly. Each PIN must be a WORD. + * NOTE: there is no "length" field for this, so from ACPI spec: + * The number of pins in the table can be calculated from: + * PinCount = (Resource Source Name Offset - Pin Table Offset) / 2 + * (implies resource source must immediately follow the pin list.) + * Name: _PIN + */ + *PinList = (UINT16) InitializerOp->Asl.Value.Integer; + PinList++; + PinCount++; + + /* Case 8: First pin number in list */ + + if (i == 8) + { + if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + { + /* Must be at least one interrupt */ + + AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN, + InitializerOp, NULL); + } + + /* Check now for duplicates in list */ + + RsCheckListForDuplicates (InitializerOp); + + /* Create a named field at the start of the list */ + + RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN, + CurrentByteOffset + Descriptor->PinFunction.PinTableOffset); + } + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoPinConfigDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "PinConfig" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoPinConfigDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + UINT8 *VendorData = NULL; + UINT16 *PinList = NULL; + UINT16 ResSourceLength; + UINT16 VendorLength; + UINT16 PinListLength; + UINT16 DescriptorSize; + UINT32 CurrentByteOffset; + UINT32 PinCount = 0; + UINT32 i; + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + CurrentByteOffset = Info->CurrentByteOffset; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + * 2) Vendor Data buffer + * 3) PIN (interrupt) list + */ + ResSourceLength = RsGetStringDataLength (InitializerOp); + VendorLength = RsGetBufferDataLength (InitializerOp); + PinListLength = RsGetInterruptDataLength (InitializerOp, 8); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_CONFIG) + + ResSourceLength + VendorLength + PinListLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->PinConfig.ResourceLength = DescriptorSize; + Descriptor->PinConfig.DescriptorType = ACPI_RESOURCE_NAME_PIN_CONFIG; + Descriptor->PinConfig.RevisionId = AML_RESOURCE_PIN_CONFIG_REVISION; + + /* Build pointers to optional areas */ + + PinList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_PIN_CONFIG)); + ResourceSource = ACPI_ADD_PTR (char, PinList, PinListLength); + VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength); + + /* Setup offsets within the descriptor */ + + Descriptor->PinConfig.PinTableOffset = (UINT16) + ACPI_PTR_DIFF (PinList, Descriptor); + + Descriptor->PinConfig.ResSourceOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSource, Descriptor); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + BOOLEAN isValid; + + switch (i) + { + case 0: /* Share Type [Flags] (_SHR) */ + + RsSetFlagBits16 (&Descriptor->PinConfig.Flags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinConfig.Flags), 0); + break; + + case 1: /* Pin Config Type [BYTE] (_TYP) */ + + isValid = InitializerOp->Asl.Value.Integer <= 0x0d; + if (!isValid) + { + isValid = InitializerOp->Asl.Value.Integer >= 0x80 && + InitializerOp->Asl.Value.Integer <= 0xff; + } + if (!isValid) + { + AslError (ASL_ERROR, ASL_MSG_RANGE, InitializerOp, NULL); + } + + Descriptor->PinConfig.PinConfigType = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG_TYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinConfig.PinConfigType)); + + break; + + case 2: /* Pin Config Value [DWORD] (_VAL) */ + + Descriptor->PinConfig.PinConfigValue = (UINT32) InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_PINCONFIG_VALUE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinConfig.PinConfigValue)); + break; + + case 3: /* ResSource [Optional Field - STRING] */ + + if (ResSourceLength) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSource, InitializerOp->Asl.Value.String); + } + break; + + case 4: /* Resource Index */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + Descriptor->PinConfig.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + case 5: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits16 (&Descriptor->PinConfig.Flags, InitializerOp, 1, 1); + + break; + + case 6: /* Resource Tag (Descriptor Name) */ + + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + case 7: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + /* + * Always set the VendorOffset even if there is no Vendor Data. + * This field is required in order to calculate the length + * of the ResourceSource at runtime. + */ + Descriptor->PinConfig.VendorOffset = (UINT16) + ACPI_PTR_DIFF (VendorData, Descriptor); + + if (RsGetVendorData (InitializerOp, VendorData, + (CurrentByteOffset + Descriptor->PinConfig.VendorOffset))) + { + Descriptor->PinConfig.VendorLength = VendorLength; + } + break; + + default: + /* + * PINs come through here, repeatedly. Each PIN must be a WORD. + * NOTE: there is no "length" field for this, so from ACPI spec: + * The number of pins in the table can be calculated from: + * PinCount = (Resource Source Name Offset - Pin Table Offset) / 2 + * (implies resource source must immediately follow the pin list.) + * Name: _PIN + */ + *PinList = (UINT16) InitializerOp->Asl.Value.Integer; + PinList++; + PinCount++; + + /* Case 8: First pin number in list */ + + if (i == 8) + { + if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + { + /* Must be at least one interrupt */ + + AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN, + InitializerOp, NULL); + } + + /* Check now for duplicates in list */ + + RsCheckListForDuplicates (InitializerOp); + + /* Create a named field at the start of the list */ + + RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN, + CurrentByteOffset + Descriptor->PinConfig.PinTableOffset); + } + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoPinGroupDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "PinGroup" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoPinGroupDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + UINT8 *VendorData = NULL; + UINT16 *PinList = NULL; + char *Label = NULL; + UINT16 LabelLength; + UINT16 VendorLength; + UINT16 PinListLength; + UINT16 DescriptorSize; + UINT32 CurrentByteOffset; + UINT32 PinCount = 0; + UINT32 i; + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + CurrentByteOffset = Info->CurrentByteOffset; + + /* + * Calculate lengths for fields that have variable length: + * 1) Label + * 2) Vendor Data buffer + * 3) PIN (interrupt) list + */ + LabelLength = RsGetStringDataLength (InitializerOp); + VendorLength = RsGetBufferDataLength (InitializerOp); + PinListLength = RsGetInterruptDataLength (InitializerOp, 4); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP) + + LabelLength + VendorLength + PinListLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->PinGroup.ResourceLength = DescriptorSize; + Descriptor->PinGroup.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP; + Descriptor->PinGroup.RevisionId = AML_RESOURCE_PIN_GROUP_REVISION; + + /* Build pointers to optional areas */ + + PinList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_PIN_GROUP)); + Label = ACPI_ADD_PTR (char, PinList, PinListLength); + VendorData = ACPI_ADD_PTR (UINT8, Label, LabelLength); + + /* Setup offsets within the descriptor */ + + Descriptor->PinGroup.PinTableOffset = (UINT16) ACPI_PTR_DIFF (PinList, Descriptor); + Descriptor->PinGroup.LabelOffset = (UINT16) ACPI_PTR_DIFF (Label, Descriptor); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* Resource Label */ + + if (LabelLength < 2) + { + AslError(ASL_WARNING, ASL_MSG_NULL_STRING, InitializerOp, NULL); + } + strcpy (Label, InitializerOp->Asl.Value.String); + + break; + + case 1: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits16 (&Descriptor->PinGroup.Flags, InitializerOp, 0, 0); + + break; + + case 2: /* Resource Tag (Descriptor Name) */ + + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + case 3: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + /* + * Always set the VendorOffset even if there is no Vendor Data. + * This field is required in order to calculate the length + * of the ResourceSource at runtime. + */ + Descriptor->PinGroup.VendorOffset = (UINT16) + ACPI_PTR_DIFF (VendorData, Descriptor); + + if (RsGetVendorData (InitializerOp, VendorData, + (CurrentByteOffset + Descriptor->PinGroup.VendorOffset))) + { + Descriptor->PinGroup.VendorLength = VendorLength; + } + break; + + default: + /* + * PINs come through here, repeatedly. Each PIN must be a WORD. + * NOTE: there is no "length" field for this, so from ACPI spec: + * The number of pins in the table can be calculated from: + * PinCount = (Resource Source Name Offset - Pin Table Offset) / 2 + * (implies resource source must immediately follow the pin list.) + * Name: _PIN + */ + *PinList = (UINT16) InitializerOp->Asl.Value.Integer; + PinList++; + PinCount++; + + /* Case 3: First pin number in list */ + + if (i == 4) + { + if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + { + /* Must be at least one interrupt */ + + AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN, + InitializerOp, NULL); + } + + /* Check now for duplicates in list */ + + RsCheckListForDuplicates (InitializerOp); + + /* Create a named field at the start of the list */ + + RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN, + CurrentByteOffset + Descriptor->PinGroup.PinTableOffset); + } + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoPinGroupFunctionDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "PinGroupFunction" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoPinGroupFunctionDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + char *ResourceSourceLabel = NULL; + UINT8 *VendorData = NULL; + UINT16 ResSourceLength; + UINT16 ResSourceLabelLength; + UINT16 VendorLength; + UINT16 DescriptorSize; + UINT32 CurrentByteOffset; + UINT32 i; + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + CurrentByteOffset = Info->CurrentByteOffset; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + * 2) Resource Source Label string + * 3) Vendor Data buffer + */ + ResSourceLength = RsGetStringDataLengthAt (InitializerOp, 2); + ResSourceLabelLength = RsGetStringDataLengthAt (InitializerOp, 4); + VendorLength = RsGetBufferDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_FUNCTION) + + ResSourceLength + ResSourceLabelLength + VendorLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->PinGroupFunction.ResourceLength = DescriptorSize; + Descriptor->PinGroupFunction.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION; + Descriptor->PinGroupFunction.RevisionId = AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION; + + /* Build pointers to optional areas */ + + ResourceSource = ACPI_ADD_PTR (char, Descriptor, sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION)); + ResourceSourceLabel = ACPI_ADD_PTR (char, ResourceSource, ResSourceLength); + VendorData = ACPI_ADD_PTR (UINT8, ResourceSourceLabel, ResSourceLabelLength); + + /* Setup offsets within the descriptor */ + + Descriptor->PinGroupFunction.ResSourceOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSource, Descriptor); + Descriptor->PinGroupFunction.ResSourceLabelOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSourceLabel, Descriptor); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* Share Type [Flags] (_SHR) */ + + RsSetFlagBits16 (&Descriptor->PinGroupFunction.Flags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupFunction.Flags), 0); + break; + + case 1: /* Function Number [WORD] */ + + Descriptor->PinGroupFunction.FunctionNumber = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_FUNCTION, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupFunction.FunctionNumber)); + break; + + case 2: /* ResourceSource [STRING] */ + + strcpy (ResourceSource, InitializerOp->Asl.Value.String); + break; + + case 3: /* Resource Index */ + + Descriptor->PinGroupFunction.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + break; + + case 4: /* ResourceSourceLabel [STRING] */ + + if (ResSourceLabelLength < 2) + { + AslError(ASL_WARNING, ASL_MSG_NULL_STRING, InitializerOp, NULL); + } + + strcpy (ResourceSourceLabel, InitializerOp->Asl.Value.String); + break; + + case 5: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits16 (&Descriptor->PinGroupFunction.Flags, InitializerOp, 1, 1); + + break; + + case 6: /* Resource Tag (Descriptor Name) */ + + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + case 7: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + /* + * Always set the VendorOffset even if there is no Vendor Data. + * This field is required in order to calculate the length + * of the ResourceSource at runtime. + */ + Descriptor->PinGroupFunction.VendorOffset = (UINT16) + ACPI_PTR_DIFF (VendorData, Descriptor); + + if (RsGetVendorData (InitializerOp, VendorData, + (CurrentByteOffset + Descriptor->PinGroupFunction.VendorOffset))) + { + Descriptor->PinGroupFunction.VendorLength = VendorLength; + } + break; + + default: + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoPinGroupConfigDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "PinGroupConfig" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoPinGroupConfigDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + char *ResourceSourceLabel = NULL; + UINT8 *VendorData = NULL; + UINT16 ResSourceLength; + UINT16 ResSourceLabelLength; + UINT16 VendorLength; + UINT16 DescriptorSize; + UINT32 CurrentByteOffset; + UINT32 i; + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + CurrentByteOffset = Info->CurrentByteOffset; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + * 2) Resource Source Label string + * 3) Vendor Data buffer + */ + ResSourceLength = RsGetStringDataLengthAt (InitializerOp, 3); + ResSourceLabelLength = RsGetStringDataLengthAt (InitializerOp, 5); + VendorLength = RsGetBufferDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_CONFIG) + + ResSourceLength + ResSourceLabelLength + VendorLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->PinGroupConfig.ResourceLength = DescriptorSize; + Descriptor->PinGroupConfig.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG; + Descriptor->PinGroupConfig.RevisionId = AML_RESOURCE_PIN_GROUP_CONFIG_REVISION; + + /* Build pointers to optional areas */ + + ResourceSource = ACPI_ADD_PTR (char, Descriptor, sizeof (AML_RESOURCE_PIN_GROUP_CONFIG)); + ResourceSourceLabel = ACPI_ADD_PTR (char, ResourceSource, ResSourceLength); + VendorData = ACPI_ADD_PTR (UINT8, ResourceSourceLabel, ResSourceLabelLength); + + /* Setup offsets within the descriptor */ + + Descriptor->PinGroupConfig.ResSourceOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSource, Descriptor); + Descriptor->PinGroupConfig.ResSourceLabelOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSourceLabel, Descriptor); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + BOOLEAN isValid; + + switch (i) + { + case 0: /* Share Type [Flags] (_SHR) */ + + RsSetFlagBits16 (&Descriptor->PinGroupConfig.Flags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupConfig.Flags), 0); + break; + + case 1: /* Pin Config Type [BYTE] (_TYP) */ + + isValid = InitializerOp->Asl.Value.Integer <= 0x0d; + if (!isValid) + { + isValid = InitializerOp->Asl.Value.Integer >= 0x80 && + InitializerOp->Asl.Value.Integer <= 0xff; + } + if (!isValid) + { + AslError (ASL_ERROR, ASL_MSG_RANGE, InitializerOp, NULL); + } + + Descriptor->PinGroupConfig.PinConfigType = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG_TYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupConfig.PinConfigType)); + + break; + + case 2: /* Pin Config Value [DWORD] (_VAL) */ + + Descriptor->PinGroupConfig.PinConfigValue = (UINT32) InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_PINCONFIG_VALUE, + CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupConfig.PinConfigValue)); + break; + + case 3: /* ResourceSource [STRING] */ + + /* Copy string to the descriptor */ + + strcpy (ResourceSource, InitializerOp->Asl.Value.String); + break; + + case 4: /* Resource Index */ + + Descriptor->PinGroupConfig.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + break; + + case 5: /* ResourceSourceLabel [STRING] */ + + if (ResSourceLabelLength < 2) + { + AslError(ASL_WARNING, ASL_MSG_NULL_STRING, InitializerOp, NULL); + } + + strcpy (ResourceSourceLabel, InitializerOp->Asl.Value.String); + break; + + case 6: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits16 (&Descriptor->PinGroupConfig.Flags, InitializerOp, 1, 1); + + break; + + case 7: /* Resource Tag (Descriptor Name) */ + + UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp); + break; + + case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + /* + * Always set the VendorOffset even if there is no Vendor Data. + * This field is required in order to calculate the length + * of the ResourceSource at runtime. + */ + Descriptor->PinGroupConfig.VendorOffset = (UINT16) + ACPI_PTR_DIFF (VendorData, Descriptor); + + if (RsGetVendorData (InitializerOp, VendorData, + (CurrentByteOffset + Descriptor->PinGroupConfig.VendorOffset))) + { + Descriptor->PinGroupConfig.VendorLength = VendorLength; + } + break; + + default: + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} diff --git a/source/compiler/aslrules.y b/source/compiler/aslrules.y index fa6dbf8..5ad615d 100644 --- a/source/compiler/aslrules.y +++ b/source/compiler/aslrules.y @@ -161,11 +161,9 @@ TermArg : SimpleName {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} -/* | PARSEOP_OPEN_PAREN TermArg - PARSEOP_CLOSE_PAREN {} -*/ + PARSEOP_CLOSE_PAREN {$$ = TrSetNodeFlags ($2, NODE_IS_TERM_ARG);} ; /* @@ -287,7 +285,7 @@ Object : CompilerDirective {} | NamedObject {} | NameSpaceModifier {} -// | StructureTerm {} +/* | StructureTerm {} */ ; PackageList @@ -536,7 +534,7 @@ NamedObject NameSpaceModifier : AliasTerm {} | NameTerm {} -// | NameTermAslPlus {} +/* | NameTermAslPlus {} */ | ScopeTerm {} ; @@ -643,8 +641,8 @@ Type2IntegerOpcode /* "Type3" opcodes */ | FromBCDTerm {} | IncTerm {} | IndexTerm {} -// | StructureIndexTerm {} -// | StructurePointerTerm {} +/* | StructureIndexTerm {} */ +/* | StructurePointerTerm {} */ | LAndTerm {} | LEqualTerm {} | LGreaterTerm {} @@ -719,8 +717,8 @@ Type6Opcode | DerefOfTerm {} | IndexTerm {} | IndexExpTerm {} -// | StructureIndexTerm {} -// | StructurePointerTerm {} +/* | StructureIndexTerm {} */ +/* | StructurePointerTerm {} */ | MethodInvocationTerm {} ; diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c index ff0f2e5..7a3b8d2 100644 --- a/source/compiler/aslstartup.c +++ b/source/compiler/aslstartup.c @@ -208,6 +208,11 @@ AslDetectSourceFileType ( Type = ASL_INPUT_TYPE_BINARY_ACPI_TABLE; goto Cleanup; } + else + { + fprintf (stderr, + "Binary file does not contain a valid ACPI table\n"); + } Type = ASL_INPUT_TYPE_BINARY; @@ -348,7 +353,7 @@ AslDoOneFile ( /* * AML Disassembly (Optional) */ - if (Gbl_DisasmFlag) + if (AcpiGbl_DisasmFlag) { Status = AslDoDisassembly (); if (Status != AE_CTRL_CONTINUE) @@ -473,7 +478,7 @@ AslDoOneFile ( CvDbgPrint ("OUTPUTFILENAME: %s\n", Gbl_OutputFilenamePrefix); Gbl_Files[ASL_FILE_INPUT].Filename = Gbl_Files[ASL_FILE_AML_OUTPUT].Filename; - + AcpiGbl_DisasmFlag = TRUE; fprintf (stderr, "\n"); AslDoDisassembly (); @@ -493,7 +498,7 @@ AslDoOneFile ( FlCloseFile (ASL_FILE_INPUT); Gbl_DoCompile = FALSE; - Gbl_DisasmFlag = TRUE; + AcpiGbl_DisasmFlag = TRUE; Status = AslDoDisassembly (); return (Status); diff --git a/source/compiler/aslsupport.l b/source/compiler/aslsupport.l index 81d739d..4a2b86b 100644 --- a/source/compiler/aslsupport.l +++ b/source/compiler/aslsupport.l @@ -589,15 +589,19 @@ AslDoCommentType2 ( AslInsertLineBuffer ('/'); - AslInsertLineBuffer ('*'); if (Gbl_CaptureComments && CurrentState.CaptureComments) { + AslInsertLineBuffer ('*'); *StringBuffer = '/'; ++StringBuffer; *StringBuffer = '*'; ++StringBuffer; } + else + { + AslInsertLineBuffer ('/'); + } while (((c = input ()) != '\n') && (c != EOF)) { @@ -898,15 +902,6 @@ CompletedString: *StringBuffer = 0; CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1); - if (!CleanString) - { - AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION, - Gbl_CurrentLineNumber, Gbl_LogicalLineNumber, - Gbl_CurrentLineOffset, Gbl_CurrentColumn, - Gbl_Files[ASL_FILE_INPUT].Filename, NULL); - return (FALSE); - } - strcpy (CleanString, MsgBuffer); AslCompilerlval.s = CleanString; return (TRUE); diff --git a/source/compiler/asltokens.y b/source/compiler/asltokens.y index 6a67715..446089f 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -281,6 +281,11 @@ NoEcho(' %token PARSEOP_PARITYTYPE_NONE %token PARSEOP_PARITYTYPE_ODD %token PARSEOP_PARITYTYPE_SPACE +%token PARSEOP_PINCONFIG +%token PARSEOP_PINFUNCTION +%token PARSEOP_PINGROUP +%token PARSEOP_PINGROUPCONFIG +%token PARSEOP_PINGROUPFUNCTION %token PARSEOP_PIN_NOPULL %token PARSEOP_PIN_PULLDEFAULT %token PARSEOP_PIN_PULLDOWN diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c index c29c404..c621359 100644 --- a/source/compiler/asltree.c +++ b/source/compiler/asltree.c @@ -187,17 +187,14 @@ TrAllocateNode ( } Gbl_CommentState.Latest_Parse_Node = Op; - if (Gbl_CommentState.Latest_Parse_Node->Asl.ParseOpName) - { - CvDbgPrint ("trallocatenode=Set latest parse node to this node.\n"); - CvDbgPrint (" Op->Asl.ParseOpName = %s\n", - Gbl_CommentState.Latest_Parse_Node->Asl.ParseOpName); - CvDbgPrint (" Op->Asl.ParseOpcode = 0x%x\n", ParseOpcode); + CvDbgPrint ("trallocatenode=Set latest parse node to this node.\n"); + CvDbgPrint (" Op->Asl.ParseOpName = %s\n", + Gbl_CommentState.Latest_Parse_Node->Asl.ParseOpName); + CvDbgPrint (" Op->Asl.ParseOpcode = 0x%x\n", ParseOpcode); - if (Op->Asl.FileChanged) - { - CvDbgPrint(" file has been changed!\n"); - } + if (Op->Asl.FileChanged) + { + CvDbgPrint(" file has been changed!\n"); } /* @@ -1552,7 +1549,7 @@ TrLinkChildNode ( * turn on capture comments as it signifies that we are done parsing * a method call. */ - if (Gbl_CaptureComments) + if (Gbl_CaptureComments && Op1) { if (Op1->Asl.ParseOpcode == PARSEOP_METHODCALL) { diff --git a/source/compiler/asltypes.y b/source/compiler/asltypes.y index 36fec68..177aa02 100644 --- a/source/compiler/asltypes.y +++ b/source/compiler/asltypes.y @@ -324,6 +324,11 @@ NoEcho(' %type Memory32Term %type NameSeg %type NameString +%type PinConfigTerm +%type PinFunctionTerm +%type PinGroupTerm +%type PinGroupConfigTerm +%type PinGroupFunctionTerm %type QWordIOTerm %type QWordMemoryTerm %type QWordSpaceTerm @@ -379,6 +384,7 @@ NoEcho(' %type OptionalReference %type OptionalResourceType %type OptionalResourceType_First +%type OptionalProducerResourceType %type OptionalReturnArg %type OptionalSerializeRuleKeyword %type OptionalShareType diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c index 9aba5f2..9ad1347 100644 --- a/source/compiler/aslutils.c +++ b/source/compiler/aslutils.c @@ -527,7 +527,7 @@ UtCheckIntegerRange ( * * PARAMETERS: Length - Size of buffer requested * - * RETURN: Pointer to the buffer. Aborts on allocation failure + * RETURN: Pointer to the buffer. Aborts compiler on allocation failure * * DESCRIPTION: Allocate a string buffer. Bypass the local * dynamic memory manager for performance reasons (This has a @@ -725,10 +725,6 @@ UtInternalizeName ( /* We need a segment to store the internal name */ Info.InternalName = UtStringCacheCalloc (Info.Length); - if (!Info.InternalName) - { - return (AE_NO_MEMORY); - } /* Build the name */ diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c index 82c2817..afff380 100644 --- a/source/compiler/aslxref.c +++ b/source/compiler/aslxref.c @@ -513,7 +513,8 @@ XfNamespaceLocateBegin ( (!(OpInfo->Flags & AML_CREATE)) && (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) && (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) && - (Op->Asl.ParseOpcode != PARSEOP_METHODCALL)) + (Op->Asl.ParseOpcode != PARSEOP_METHODCALL) && + (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL)) { return_ACPI_STATUS (AE_OK); } @@ -536,7 +537,8 @@ XfNamespaceLocateBegin ( Flags = ACPI_NS_SEARCH_PARENT; if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || - (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)) + (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) || + (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) { /* * These are name references, do not push the scope stack @@ -1075,7 +1077,8 @@ XfNamespaceLocateEnd ( if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || - (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)) + (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) || + (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) { return_ACPI_STATUS (AE_OK); } diff --git a/source/compiler/cvcompiler.c b/source/compiler/cvcompiler.c index 07fecc3..c9be42a 100644 --- a/source/compiler/cvcompiler.c +++ b/source/compiler/cvcompiler.c @@ -83,6 +83,7 @@ CvProcessComment ( *StringBuffer = (char) c1; ++StringBuffer; *StringBuffer = 0; + CvDbgPrint ("Multi-line comment\n"); CommentString = UtStringCacheCalloc (strlen (MsgBuffer) + 1); strcpy (CommentString, MsgBuffer); @@ -90,17 +91,15 @@ CvProcessComment ( CvDbgPrint ("CommentString: %s\n", CommentString); /* - * Determine whether if this comment spans multiple lines. - * If so, break apart the comment by line so that it can be - * properly indented. + * Determine whether if this comment spans multiple lines. If so, + * break apart the comment by storing each line in a different node + * within the comment list. This allows the disassembler to + * properly indent a multi-line comment. */ - if (strchr (CommentString, '\n') != NULL) + LineToken = strtok (CommentString, "\n"); + + if (LineToken) { - /* - * Get the first token. The for loop pads subsequent lines - * for comments similar to the style of this comment. - */ - LineToken = strtok (CommentString, "\n"); FinalLineToken = UtStringCacheCalloc (strlen (LineToken) + 1); strcpy (FinalLineToken, LineToken); @@ -155,7 +154,10 @@ CvProcessComment ( * if this is not a regular comment, pad with extra spaces that appeared * in the original source input to retain the original spacing. */ - FinalCommentString = UtStringCacheCalloc (strlen (CommentString) + CurrentState.SpacesBefore + 1); + FinalCommentString = + UtStringCacheCalloc (strlen (CommentString) + + CurrentState.SpacesBefore + 1); + for (i=0; (CurrentState.CommentType != ASL_COMMENT_STANDARD) && (i < CurrentState.SpacesBefore); ++i) { @@ -225,7 +227,9 @@ CvProcessCommentType2 ( * [ (spaces) (comment) ( * /) ('\0') ] * */ - FinalCommentString = UtStringCacheCalloc (CurrentState.SpacesBefore + strlen (CommentString) + 3 + 1); + FinalCommentString = UtStringCacheCalloc (CurrentState.SpacesBefore + + strlen (CommentString) + 3 + 1); + for (i=0; (CurrentState.CommentType!=1) && (iAsl.Filename, FILE_SUFFIX_DISASSEMBLY); - CvDbgPrint ("Writing file comment, \"%s\" for %s\n", - NewFilename, Op->Asl.ParseOpName); + if (NewFilename) + { + CvDbgPrint ("Writing file comment, \"%s\" for %s\n", + NewFilename, Op->Asl.ParseOpName); + } + CgWriteOneAmlComment(Op, NewFilename, FILENAME_COMMENT); if (Op->Asl.ParentFilename && @@ -580,17 +594,16 @@ CgWriteAmlComment( * ******************************************************************************/ -ACPI_COMMENT_NODE* +ACPI_COMMENT_NODE * CvCommentNodeCalloc ( void) { ACPI_COMMENT_NODE *NewCommentNode; - NewCommentNode = - (ACPI_COMMENT_NODE*) UtLocalCalloc (sizeof(ACPI_COMMENT_NODE)); + NewCommentNode = UtLocalCalloc (sizeof (ACPI_COMMENT_NODE)); NewCommentNode->Next = NULL; - return NewCommentNode; + return (NewCommentNode); } @@ -799,10 +812,12 @@ CvAppendInlineComment ( { return ToAdd; } - if (ToAdd) + if (!ToAdd) { - Size = strlen (ToAdd); + return InlineComment; } + + Size = strlen (ToAdd); Size += strlen (InlineComment); Str = UtStringCacheCalloc (Size+1); strcpy (Str, InlineComment); diff --git a/source/compiler/cvdisasm.c b/source/compiler/cvdisasm.c index e688e85..d4d56d0 100644 --- a/source/compiler/cvdisasm.c +++ b/source/compiler/cvdisasm.c @@ -206,6 +206,7 @@ CvPrintOneCommentType ( if (*CommentToPrint) { + CommentExists = TRUE; AcpiOsPrintf ("%s", *CommentToPrint); *CommentToPrint = NULL; } @@ -387,6 +388,7 @@ CvSwitchFiles( { char *Filename = Op->Common.CvFilename; ACPI_FILE_NODE *FNode; + ACPI_FILE_NODE *Current; CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename, Filename); FNode = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot); @@ -401,23 +403,23 @@ CvSwitchFiles( AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer); AslAbort (); } + Current = FNode; /* * If the previous file is a descendent of the current file, * make sure that Include statements from the current file * to the previous have been emitted. */ - while (FNode && - FNode->Parent && - AcpiUtStricmp (FNode->Filename, AcpiGbl_CurrentFilename)) + while (Current && + Current->Parent && + AcpiUtStricmp (Current->Filename, AcpiGbl_CurrentFilename)) { - CvPrintInclude (FNode, Level); - FNode = FNode->Parent; + CvPrintInclude (Current, Level); + Current = Current->Parent; } - /* Redirect output to the Op->Common.CvFilename */ + /* Redirect output to Op->Common.CvFilename */ - FNode = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot); AcpiOsRedirectOutput (FNode->File); AcpiGbl_CurrentFilename = FNode->Filename; } diff --git a/source/compiler/cvparser.c b/source/compiler/cvparser.c index 5eeccab..21e6ac2 100644 --- a/source/compiler/cvparser.c +++ b/source/compiler/cvparser.c @@ -107,7 +107,7 @@ CvIsFilename ( for(i = 0; iFilename, Filename)) diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h index 3b458ae..d38093e 100644 --- a/source/compiler/dtcompiler.h +++ b/source/compiler/dtcompiler.h @@ -470,6 +470,10 @@ DtCompileHest ( void **PFieldList); ACPI_STATUS +DtCompileHmat ( + void **PFieldList); + +ACPI_STATUS DtCompileIort ( void **PFieldList); @@ -510,6 +514,10 @@ DtCompilePmtt ( void **PFieldList); ACPI_STATUS +DtCompilePptt ( + void **PFieldList); + +ACPI_STATUS DtCompilePcct ( void **PFieldList); @@ -590,6 +598,7 @@ extern const unsigned char TemplateFadt[]; extern const unsigned char TemplateFpdt[]; extern const unsigned char TemplateGtdt[]; extern const unsigned char TemplateHest[]; +extern const unsigned char TemplateHmat[]; extern const unsigned char TemplateHpet[]; extern const unsigned char TemplateIort[]; extern const unsigned char TemplateIvrs[]; @@ -604,6 +613,7 @@ extern const unsigned char TemplateMtmr[]; extern const unsigned char TemplateNfit[]; extern const unsigned char TemplatePcct[]; extern const unsigned char TemplatePmtt[]; +extern const unsigned char TemplatePptt[]; extern const unsigned char TemplateRasf[]; extern const unsigned char TemplateRsdt[]; extern const unsigned char TemplateS3pt[]; @@ -623,6 +633,7 @@ extern const unsigned char TemplateWdat[]; extern const unsigned char TemplateWddt[]; extern const unsigned char TemplateWdrt[]; extern const unsigned char TemplateWpbt[]; +extern const unsigned char TemplateWsmt[]; extern const unsigned char TemplateXenv[]; extern const unsigned char TemplateXsdt[]; diff --git a/source/compiler/dtfield.c b/source/compiler/dtfield.c index 0ac81aa..f7c4a49 100644 --- a/source/compiler/dtfield.c +++ b/source/compiler/dtfield.c @@ -571,6 +571,36 @@ DtCompileFlag ( BitLength = 2; break; + case ACPI_DMT_FLAGS4_0: + + BitPosition = 0; + BitLength = 4; + break; + + case ACPI_DMT_FLAGS4_4: + + BitPosition = 4; + BitLength = 4; + break; + + case ACPI_DMT_FLAGS4_8: + + BitPosition = 8; + BitLength = 4; + break; + + case ACPI_DMT_FLAGS4_12: + + BitPosition = 12; + BitLength = 4; + break; + + case ACPI_DMT_FLAGS16_16: + + BitPosition = 16; + BitLength = 16; + break; + default: DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid flag opcode"); diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c index c8fb71b..a38cfba 100644 --- a/source/compiler/dttable1.c +++ b/source/compiler/dttable1.c @@ -1141,6 +1141,16 @@ DtCompileHest ( InfoTable = AcpiDmTableInfoHest9; break; + case ACPI_HEST_TYPE_GENERIC_ERROR_V2: + + InfoTable = AcpiDmTableInfoHest10; + break; + + case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK: + + InfoTable = AcpiDmTableInfoHest11; + break; + default: /* Cannot continue on unknown type */ @@ -1175,6 +1185,12 @@ DtCompileHest ( Subtable->Buffer))->NumHardwareBanks; break; + case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK: + + BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK, + Subtable->Buffer))->NumHardwareBanks; + break; + default: break; @@ -1200,6 +1216,218 @@ DtCompileHest ( /****************************************************************************** * + * FUNCTION: DtCompileHmat + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile HMAT. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompileHmat ( + void **List) +{ + ACPI_STATUS Status; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_FIELD *SubtableStart; + DT_FIELD *EntryStart; + ACPI_HMAT_STRUCTURE *HmatStruct; + ACPI_HMAT_LOCALITY *HmatLocality; + ACPI_HMAT_CACHE *HmatCache; + ACPI_DMTABLE_INFO *InfoTable; + UINT32 IntPDNumber; + UINT32 TgtPDNumber; + UINT64 EntryNumber; + UINT16 SMBIOSHandleNumber; + + + ParentTable = DtPeekSubtable (); + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + + while (*PFieldList) + { + /* Compile HMAT structure header */ + + SubtableStart = *PFieldList; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmatHdr, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + + HmatStruct = ACPI_CAST_PTR (ACPI_HMAT_STRUCTURE, Subtable->Buffer); + HmatStruct->Length = Subtable->Length; + + /* Compile HMAT structure body */ + + switch (HmatStruct->Type) + { + case ACPI_HMAT_TYPE_ADDRESS_RANGE: + + InfoTable = AcpiDmTableInfoHmat0; + break; + + case ACPI_HMAT_TYPE_LOCALITY: + + InfoTable = AcpiDmTableInfoHmat1; + break; + + case ACPI_HMAT_TYPE_CACHE: + + InfoTable = AcpiDmTableInfoHmat2; + break; + + default: + + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HMAT"); + return (AE_ERROR); + } + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + HmatStruct->Length += Subtable->Length; + + /* Compile HMAT structure additionals */ + + switch (HmatStruct->Type) + { + case ACPI_HMAT_TYPE_LOCALITY: + + HmatLocality = ACPI_SUB_PTR (ACPI_HMAT_LOCALITY, + Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE)); + + /* Compile initiator proximity domain list */ + + IntPDNumber = 0; + while (*PFieldList) + { + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoHmat1a, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + break; + } + DtInsertSubtable (ParentTable, Subtable); + HmatStruct->Length += Subtable->Length; + IntPDNumber++; + } + HmatLocality->NumberOfInitiatorPDs = IntPDNumber; + + /* Compile target proximity domain list */ + + TgtPDNumber = 0; + while (*PFieldList) + { + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoHmat1b, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + break; + } + DtInsertSubtable (ParentTable, Subtable); + HmatStruct->Length += Subtable->Length; + TgtPDNumber++; + } + HmatLocality->NumberOfTargetPDs = TgtPDNumber; + + /* Save start of the entries for reporting errors */ + + EntryStart = *PFieldList; + + /* Compile latency/bandwidth entries */ + + EntryNumber = 0; + while (*PFieldList) + { + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoHmat1c, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + break; + } + DtInsertSubtable (ParentTable, Subtable); + HmatStruct->Length += Subtable->Length; + EntryNumber++; + } + + /* Validate number of entries */ + + if (EntryNumber != + ((UINT64)IntPDNumber * (UINT64)TgtPDNumber)) + { + DtFatal (ASL_MSG_INVALID_EXPRESSION, EntryStart, "HMAT"); + return (AE_ERROR); + } + break; + + case ACPI_HMAT_TYPE_CACHE: + + /* Compile SMBIOS handles */ + + HmatCache = ACPI_SUB_PTR (ACPI_HMAT_CACHE, + Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE)); + SMBIOSHandleNumber = 0; + while (*PFieldList) + { + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoHmat2a, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + break; + } + DtInsertSubtable (ParentTable, Subtable); + HmatStruct->Length += Subtable->Length; + SMBIOSHandleNumber++; + } + HmatCache->NumberOfSMBIOSHandles = SMBIOSHandleNumber; + break; + + default: + + break; + } + } + + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileIort * * PARAMETERS: List - Current field list pointer diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index 7ad8235..60b5dfb 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -763,6 +763,16 @@ DtCompilePcct ( InfoTable = AcpiDmTableInfoPcct2; break; + case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE: + + InfoTable = AcpiDmTableInfoPcct3; + break; + + case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE: + + InfoTable = AcpiDmTableInfoPcct4; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT"); @@ -929,6 +939,125 @@ DtCompilePmtt ( /****************************************************************************** * + * FUNCTION: DtCompilePptt + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile PPTT. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompilePptt ( + void **List) +{ + ACPI_STATUS Status; + ACPI_SUBTABLE_HEADER *PpttHeader; + ACPI_PPTT_PROCESSOR *PpttProcessor = NULL; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + ACPI_DMTABLE_INFO *InfoTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_FIELD *SubtableStart; + + + ParentTable = DtPeekSubtable (); + while (*PFieldList) + { + SubtableStart = *PFieldList; + + /* Compile PPTT subtable header */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPpttHdr, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + PpttHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); + PpttHeader->Length = (UINT8)(Subtable->Length); + + switch (PpttHeader->Type) + { + case ACPI_PPTT_TYPE_PROCESSOR: + + InfoTable = AcpiDmTableInfoPptt0; + break; + + case ACPI_PPTT_TYPE_CACHE: + + InfoTable = AcpiDmTableInfoPptt1; + break; + + case ACPI_PPTT_TYPE_ID: + + InfoTable = AcpiDmTableInfoPptt2; + break; + + default: + + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PPTT"); + return (AE_ERROR); + } + + /* Compile PPTT subtable body */ + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + DtInsertSubtable (ParentTable, Subtable); + PpttHeader->Length += (UINT8)(Subtable->Length); + + /* Compile PPTT subtable additionals */ + + switch (PpttHeader->Type) + { + case ACPI_PPTT_TYPE_PROCESSOR: + + PpttProcessor = ACPI_SUB_PTR (ACPI_PPTT_PROCESSOR, + Subtable->Buffer, sizeof (ACPI_SUBTABLE_HEADER)); + if (PpttProcessor) + { + /* Compile initiator proximity domain list */ + + PpttProcessor->NumberOfPrivResources = 0; + while (*PFieldList) + { + Status = DtCompileTable (PFieldList, + AcpiDmTableInfoPptt0a, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (!Subtable) + { + break; + } + + DtInsertSubtable (ParentTable, Subtable); + PpttHeader->Length += (UINT8)(Subtable->Length); + PpttProcessor->NumberOfPrivResources++; + } + } + break; + + default: + + break; + } + } + + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileRsdt * * PARAMETERS: List - Current field list pointer @@ -1216,6 +1345,11 @@ DtCompileSrat ( InfoTable = AcpiDmTableInfoSrat3; break; + case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY: + + InfoTable = AcpiDmTableInfoSrat4; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT"); diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index e1c7056..6164a42 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -469,11 +469,11 @@ const unsigned char TemplateGtdt[] = const unsigned char TemplateHest[] = { - 0x48,0x45,0x53,0x54,0xD4,0x01,0x00,0x00, /* 00000000 "HEST...." */ - 0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */ - 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x48,0x45,0x53,0x54,0x7C,0x02,0x00,0x00, /* 00000000 "HEST|..." */ + 0x01,0x97,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x28,0x05,0x10,0x20,0x04,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x03,0x03,0x17,0x20,0x04,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 00000028 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ @@ -488,7 +488,7 @@ const unsigned char TemplateHest[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000088 "........" */ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 000000B0 "........" */ @@ -527,7 +527,52 @@ const unsigned char TemplateHest[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ - 0x00,0x10,0x00,0x00 /* 000001D0 "...." */ + 0x00,0x10,0x00,0x00,0x0A,0x00,0x03,0x00, /* 000001D0 "........" */ + 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 000001D8 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 000001E0 "........" */ + 0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 000001E8 ".@......" */ + 0x00,0x00,0x00,0x00,0x04,0x1C,0x00,0x00, /* 000001F0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000208 "........" */ + 0x00,0x10,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000210 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000228 "........" */ + 0x0B,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000230 "........" */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000238 "........" */ + 0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000240 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000248 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000250 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000258 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000260 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000268 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000270 "........" */ + 0x00,0x00,0x00,0x00 /* 00000278 "...." */ +}; + +const unsigned char TemplateHmat[] = +{ + 0x48,0x4D,0x41,0x54,0x9C,0x00,0x00,0x00, /* 00000000 "HMAT...." */ + 0x00,0x54,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".TINTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x03,0x03,0x17,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00, /* 00000028 "....(..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ + 0x01,0x00,0x00,0x00,0x2A,0x00,0x00,0x00, /* 00000050 "....*..." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ + 0x00,0x00,0x02,0x00,0x00,0x00,0x22,0x00, /* 00000078 "......"." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x01,0x00,0x00,0x00 /* 00000098 "...." */ }; const unsigned char TemplateHpet[] = @@ -850,39 +895,80 @@ const unsigned char TemplateMtmr[] = const unsigned char TemplatePcct[] = { - 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" */ - 0x18,0x03,0x16,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x50,0x43,0x43,0x54,0x4e,0x02,0x00,0x00, /* 00000000 "PCCTN..." */ + 0x01,0x47,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 ".GINTEL " */ + 0x54,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65, /* 00000010 "Template" */ + 0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */ + 0x03,0x03,0x17,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,0x3e,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */ 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...>" */ + 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,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" */ + 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,0x03,0xa4, /* 00000100 "UUUUUU.." */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000108 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ + 0x00,0x00,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000118 "...2..33" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 00000120 "333333DD" */ + 0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55, /* 00000128 "DDDDDDUU" */ + 0x55,0x55,0x55,0x55,0x55,0x55,0x66,0x66, /* 00000130 "UUUUUUff" */ + 0x66,0x66,0x77,0x77,0x77,0x77,0x88,0x88, /* 00000138 "ffwwww.." */ + 0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000140 "...2..33" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x99,0x99, /* 00000148 "333333.." */ + 0x99,0x99,0x99,0x99,0x99,0x99,0x00,0x00, /* 00000150 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000160 ".......2" */ + 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000168 "..333333" */ + 0x33,0x33,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000170 "33""""""" */ + 0x22,0x22,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000178 """.2..33" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000180 "33333333" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 00000188 "333333DD" */ + 0x44,0x44,0x44,0x44,0x44,0x44,0x01,0x32, /* 00000190 "DDDDDD.2" */ + 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000198 "..333333" */ + 0x33,0x33,0x55,0x55,0x55,0x55,0x55,0x55, /* 000001a0 "33UUUUUU" */ + 0x55,0x55,0x04,0xa4,0x01,0x00,0x00,0x00, /* 000001a8 "UU......" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001b0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 000001b8 ".......2" */ + 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 000001c0 "..333333" */ + 0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44, /* 000001c8 "33DDDDDD" */ + 0x44,0x44,0x55,0x55,0x55,0x55,0x55,0x55, /* 000001d0 "DDUUUUUU" */ + 0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77, /* 000001d8 "UUffffww" */ + 0x77,0x77,0x88,0x88,0x88,0x88,0x01,0x32, /* 000001e0 "ww.....2" */ + 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 000001e8 "..333333" */ + 0x33,0x33,0x99,0x99,0x99,0x99,0x99,0x99, /* 000001f0 "33......" */ + 0x99,0x99,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001f8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */ + 0x00,0x00,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000208 "...2..33" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x22,0x22, /* 00000210 "333333""" */ + 0x22,0x22,0x22,0x22,0x22,0x22,0x01,0x32, /* 00000218 """"""".2" */ + 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000220 "..333333" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000228 "33333333" */ + 0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000230 "33DDDDDD" */ + 0x44,0x44,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000238 "DD.2..33" */ + 0x33,0x33,0x33,0x33,0x33,0x33,0x55,0x55, /* 00000240 "333333UU" */ + 0x55,0x55,0x55,0x55,0x55,0x55 /* 00000248 "UUUUUU| */ }; const unsigned char TemplatePmtt[] = @@ -912,6 +998,25 @@ const unsigned char TemplatePmtt[] = 0x00,0x00,0x00,0x00 /* 000000B0 "...." */ }; +const unsigned char TemplatePptt[] = +{ + 0x50,0x50,0x54,0x54,0x72,0x00,0x00,0x00, /* 00000000 "PPTTr..." */ + 0x01,0x86,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" */ + 0x03,0x03,0x17,0x20,0x00,0x18,0x00,0x00, /* 00000020 "... ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x18,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ + 0x00,0x00,0x00,0x00,0x02,0x1E,0x00,0x00, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ + 0x00,0x00 /* 00000070 ".." */ +}; + const unsigned char TemplateRasf[] = { 0x52,0x41,0x53,0x46,0x30,0x00,0x00,0x00, /* 00000000 "RASF0..." */ @@ -1105,11 +1210,11 @@ const unsigned char TemplateSpmi[] = const unsigned char TemplateSrat[] = { - 0x53,0x52,0x41,0x54,0x92,0x00,0x00,0x00, /* 00000000 "SRAT...." */ - 0x03,0x50,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".PINTEL " */ + 0x53,0x52,0x41,0x54,0x9E,0x00,0x00,0x00, /* 00000000 "SRAT...." */ + 0x03,0x55,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".UINTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x24,0x07,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "$.. ...." */ + 0x03,0x03,0x17,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ @@ -1123,7 +1228,8 @@ const unsigned char TemplateSrat[] = 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ - 0x00,0x00 /* 00000090 ".." */ + 0x00,0x00,0x04,0x0C,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x01,0x00,0x00,0x00 /* 00000098 "......" */ }; const unsigned char TemplateStao[] = @@ -1271,6 +1377,15 @@ const unsigned char TemplateWpbt[] = 0x72,0x00,0x74,0x00,0x68,0x00,0x00,0x00 /* 00000090 "r.t.h..." */ }; +const unsigned char TemplateWsmt[] = +{ + 0x57,0x53,0x4D,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WSMT(..." */ + 0x00,0x08,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x19,0x01,0x17,0x20,0x05,0x00,0x00,0x00 /* 00000020 "... ...." */ +}; + const unsigned char TemplateXenv[] = { 0x58,0x45,0x4E,0x56,0x39,0x00,0x00,0x00, /* 00000000 "XENV9..." */ diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c index 149c05d..a57add4 100644 --- a/source/compiler/dtutils.c +++ b/source/compiler/dtutils.c @@ -263,6 +263,11 @@ DtGetFieldType ( case ACPI_DMT_FLAGS1: case ACPI_DMT_FLAGS2: case ACPI_DMT_FLAGS4: + case ACPI_DMT_FLAGS4_0: + case ACPI_DMT_FLAGS4_4: + case ACPI_DMT_FLAGS4_8: + case ACPI_DMT_FLAGS4_12: + case ACPI_DMT_FLAGS16_16: Type = DT_FIELD_TYPE_FLAG; break; @@ -404,6 +409,11 @@ DtGetFieldLength ( case ACPI_DMT_FLAGS1: case ACPI_DMT_FLAGS2: case ACPI_DMT_FLAGS4: + case ACPI_DMT_FLAGS4_0: + case ACPI_DMT_FLAGS4_4: + case ACPI_DMT_FLAGS4_8: + case ACPI_DMT_FLAGS4_12: + case ACPI_DMT_FLAGS16_16: case ACPI_DMT_LABEL: case ACPI_DMT_EXTRA_TEXT: @@ -419,6 +429,7 @@ DtGetFieldLength ( case ACPI_DMT_MADT: case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: + case ACPI_DMT_PPTT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -435,6 +446,7 @@ DtGetFieldLength ( case ACPI_DMT_UINT16: case ACPI_DMT_DMAR: case ACPI_DMT_HEST: + case ACPI_DMT_HMAT: case ACPI_DMT_NFIT: case ACPI_DMT_PCI_PATH: diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index 9ec252d..e8cc7b1 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -206,6 +206,18 @@ AcpiDbExecuteMethod ( if (ACPI_FAILURE (Status)) { + if ((Status == AE_ABORT_METHOD) || AcpiGbl_AbortMethod) + { + /* Clear the abort and fall back to the debugger prompt */ + + ACPI_EXCEPTION ((AE_INFO, Status, + "Aborting top-level method")); + + AcpiGbl_AbortMethod = FALSE; + Status = AE_OK; + goto Cleanup; + } + ACPI_EXCEPTION ((AE_INFO, Status, "while executing %s from debugger", Info->Pathname)); diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c index df7f5ef..3b29285 100644 --- a/source/components/debugger/dbobject.c +++ b/source/components/debugger/dbobject.c @@ -480,7 +480,7 @@ AcpiDbDecodeLocals ( if (DisplayLocals) { - AcpiOsPrintf ("\nInitialized Local Variables for method [%4.4s]:\n", + AcpiOsPrintf ("\nInitialized Local Variables for Method [%4.4s]:\n", AcpiUtGetNodeName (Node)); for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) @@ -496,7 +496,7 @@ AcpiDbDecodeLocals ( else { AcpiOsPrintf ( - "No Local Variables are initialized for method [%4.4s]\n", + "No Local Variables are initialized for Method [%4.4s]\n", AcpiUtGetNodeName (Node)); } } @@ -559,7 +559,7 @@ AcpiDbDecodeArguments ( AcpiOsPrintf ( "Initialized Arguments for Method [%4.4s]: " "(%X arguments defined for method invocation)\n", - AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount); + AcpiUtGetNodeName (Node), Node->Object->Method.ParamCount); for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index def269d..09626de 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -271,7 +271,7 @@ AcpiDbSingleStep ( if ((AcpiGbl_DbOutputToFile) || (AcpiDbgLevel & ACPI_LV_PARSE)) { - AcpiOsPrintf ("\n[AmlDebug] Next AML Opcode to execute:\n"); + AcpiOsPrintf ("\nAML Debug: Next AML Opcode to execute:\n"); } /* diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c index ecdb873..c4bb4f6 100644 --- a/source/components/disassembler/dmbuffer.c +++ b/source/components/disassembler/dmbuffer.c @@ -153,7 +153,7 @@ AcpiDmDisasmByteList ( /* Dump the ASCII equivalents within a comment */ - AcpiOsPrintf (" /* "); + AcpiOsPrintf (" // "); for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++) { CurrentIndex = i + j; @@ -175,7 +175,7 @@ AcpiDmDisasmByteList ( /* Finished with this line */ - AcpiOsPrintf (" */\n"); + AcpiOsPrintf ("\n"); } } diff --git a/source/components/disassembler/dmdeferred.c b/source/components/disassembler/dmdeferred.c index 53fe2b2..c9a1069 100644 --- a/source/components/disassembler/dmdeferred.c +++ b/source/components/disassembler/dmdeferred.c @@ -82,7 +82,7 @@ AcpiDmParseDeferredOps ( ACPI_STATUS Status; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE (DmParseDeferredOps); /* Traverse the entire parse tree */ @@ -109,7 +109,7 @@ AcpiDmParseDeferredOps ( Op, Op->Named.Data, Op->Named.Length); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } break; @@ -137,7 +137,7 @@ AcpiDmParseDeferredOps ( Op = AcpiPsGetDepthNext (Root, Op); } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 49122b7..582efae 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -69,15 +69,6 @@ static void AcpiDmPromoteSubtree ( ACPI_PARSE_OBJECT *StartOp); -static BOOLEAN -AcpiDmIsSwitchBlock ( - ACPI_PARSE_OBJECT *Op, - char *Temp); - -static BOOLEAN -AcpiDmIsCaseBlock ( - ACPI_PARSE_OBJECT *Op); - /******************************************************************************* * * FUNCTION: AcpiDmDisplayTargetPathname @@ -1019,9 +1010,7 @@ AcpiDmDisassembleOneOp ( if (AcpiGbl_DmEmitExternalOpcodes) { - AcpiDmEmitExternal (AcpiPsGetArg(Op, 0), - AcpiPsGetArg(Op, 1)); - break; + AcpiDmEmitExternal (Op, AcpiPsGetArg(Op, 0)); } break; @@ -1259,414 +1248,3 @@ AcpiDmPromoteSubtree ( Op = Op->Common.Next; } } - -/******************************************************************************* - * - * FUNCTION: AcpiDmIsTempName - * - * PARAMETERS: Op - Object to be examined - * - * RETURN: TRUE if object is a temporary (_T_x) name for a matching While - * loop that can be converted to a Switch. - * - * DESCRIPTION: _T_X objects are only used for Switch statements. If a temporary - * name exists, search the siblings for a matching While (One) loop - * that can be converted to a Switch. Return TRUE if a match was - * found, FALSE otherwise. - * - ******************************************************************************/ - -BOOLEAN -AcpiDmIsTempName ( - ACPI_PARSE_OBJECT *Op) -{ - ACPI_PARSE_OBJECT *CurrentOp; - char *Temp; - - if (Op->Common.AmlOpcode != AML_NAME_OP) - { - return (FALSE); - } - - Temp = (char *)(Op->Common.Aml); - ++Temp; - - if (strncmp(Temp, "_T_", 3)) - { - return (FALSE); - } - - CurrentOp = Op->Common.Next; - while (CurrentOp) - { - if (CurrentOp->Common.AmlOpcode == AML_WHILE_OP && - AcpiDmIsSwitchBlock(CurrentOp, Temp)) - { - Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - CurrentOp->Common.DisasmOpcode = ACPI_DASM_SWITCH; - - return (TRUE); - } - CurrentOp = CurrentOp->Common.Next; - } - - return (FALSE); -} - -/******************************************************************************* - * - * FUNCTION: AcpiDmIsSwitchBlock - * - * PARAMETERS: Op - While Object - * - * RETURN: TRUE if While block can be converted to a Switch/Case block - * - * DESCRIPTION: Determines if While block is a Switch/Case statement. Modifies - * parse tree to allow for Switch/Case disassembly during walk. - * - * EXAMPLE: Example of parse tree to be converted - * - * While - * One - * Store - * ByteConst - * -NamePath- - * If - * LEqual - * -NamePath- - * Zero - * Return - * One - * Else - * Return - * WordConst - * Break - * - ******************************************************************************/ - -static BOOLEAN -AcpiDmIsSwitchBlock ( - ACPI_PARSE_OBJECT *Op, - char *Temp) -{ - ACPI_PARSE_OBJECT *OneOp; - ACPI_PARSE_OBJECT *StoreOp; - ACPI_PARSE_OBJECT *NamePathOp; - ACPI_PARSE_OBJECT *PredicateOp; - ACPI_PARSE_OBJECT *CurrentOp; - ACPI_PARSE_OBJECT *TempOp; - - /* Check for One Op Predicate */ - - OneOp = AcpiPsGetArg (Op, 0); - if (!OneOp || (OneOp->Common.AmlOpcode != AML_ONE_OP)) - { - return (FALSE); - } - - /* Check for Store Op */ - - StoreOp = OneOp->Common.Next; - if (!StoreOp || (StoreOp->Common.AmlOpcode != AML_STORE_OP)) - { - return (FALSE); - } - - /* Check for Name Op with _T_ string */ - - NamePathOp = AcpiPsGetArg (StoreOp, 1); - if (!NamePathOp || (NamePathOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP)) - { - return (FALSE); - } - - if (strncmp((char *)(NamePathOp->Common.Aml), Temp, 4)) - { - return (FALSE); - } - - /* This is a Switch/Case control block */ - - /* Ignore the One Op Predicate */ - - OneOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - - /* Ignore the Store Op, but not the children */ - - StoreOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE; - - /* - * First arg of Store Op is the Switch condition. - * Mark it as a Switch predicate and as a parameter list for paren - * closing and correct indentation. - */ - PredicateOp = AcpiPsGetArg (StoreOp, 0); - PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE; - PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; - - /* Ignore the Name Op */ - - NamePathOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE; - - /* Remaining opcodes are the Case statements (If/ElseIf's) */ - - CurrentOp = StoreOp->Common.Next; - while (AcpiDmIsCaseBlock (CurrentOp)) - { - /* Block is a Case structure */ - - if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) - { - /* ElseIf */ - - CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE; - CurrentOp = AcpiPsGetArg (CurrentOp, 0); - } - - /* If */ - - CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE; - - /* - * Mark the parse tree for Case disassembly. There are two - * types of Case statements. The first type of statement begins with - * an LEqual. The second starts with an LNot and uses a Match statement - * on a Package of constants. - */ - TempOp = AcpiPsGetArg (CurrentOp, 0); - switch (TempOp->Common.AmlOpcode) - { - case (AML_LOGICAL_EQUAL_OP): - - /* Ignore just the LEqual Op */ - - TempOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE; - - /* Ignore the NamePath Op */ - - TempOp = AcpiPsGetArg (TempOp, 0); - TempOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE; - - /* - * Second arg of LEqual will be the Case predicate. - * Mark it as a predicate and also as a parameter list for paren - * closing and correct indentation. - */ - PredicateOp = TempOp->Common.Next; - PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE; - PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; - - break; - - case (AML_LOGICAL_NOT_OP): - - /* - * The Package will be the predicate of the Case statement. - * It's under: - * LNOT - * LEQUAL - * MATCH - * PACKAGE - */ - - /* Get the LEqual Op from LNot */ - - TempOp = AcpiPsGetArg (TempOp, 0); - - /* Get the Match Op from LEqual */ - - TempOp = AcpiPsGetArg (TempOp, 0); - - /* Get the Package Op from Match */ - - PredicateOp = AcpiPsGetArg (TempOp, 0); - - /* Mark as parameter list for paren closing */ - - PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; - - /* - * The Package list would be too deeply indented if we - * chose to simply ignore the all the parent opcodes, so - * we rearrange the parse tree instead. - */ - - /* - * Save the second arg of the If/Else Op which is the - * block code of code for this Case statement. - */ - TempOp = AcpiPsGetArg (CurrentOp, 1); - - /* - * Move the Package Op to the child (predicate) of the - * Case statement. - */ - CurrentOp->Common.Value.Arg = PredicateOp; - PredicateOp->Common.Parent = CurrentOp; - - /* Add the block code */ - - PredicateOp->Common.Next = TempOp; - - break; - - default: - - /* Should never get here */ - - break; - } - - /* Advance to next Case block */ - - CurrentOp = CurrentOp->Common.Next; - } - - /* If CurrentOp is now an Else, then this is a Default block */ - - if (CurrentOp && CurrentOp->Common.AmlOpcode == AML_ELSE_OP) - { - CurrentOp->Common.DisasmOpcode = ACPI_DASM_DEFAULT; - } - - /* - * From the first If advance to the Break op. It's possible to - * have an Else (Default) op here when there is only one Case - * statement, so check for it. - */ - CurrentOp = StoreOp->Common.Next->Common.Next; - if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) - { - CurrentOp = CurrentOp->Common.Next; - } - - /* Ignore the Break Op */ - - CurrentOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; - - return (TRUE); -} - -/******************************************************************************* - * - * FUNCTION: AcpiDmIsCaseBlock - * - * PARAMETERS: Op - Object to test - * - * RETURN: TRUE if Object is beginning of a Case block. - * - * DESCRIPTION: Determines if an Object is the beginning of a Case block for a - * Switch/Case statement. Parse tree must be one of the following - * forms: - * - * Else (Optional) - * If - * LEqual - * -NamePath- _T_x - * - * Else (Optional) - * If - * LNot - * LEqual - * Match - * Package - * ByteConst - * -NamePath- _T_x - * - ******************************************************************************/ - -static BOOLEAN -AcpiDmIsCaseBlock ( - ACPI_PARSE_OBJECT *Op) -{ - ACPI_PARSE_OBJECT *CurrentOp; - - if (!Op) - { - return (FALSE); - } - - /* Look for an If or ElseIf */ - - CurrentOp = Op; - if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) - { - CurrentOp = AcpiPsGetArg (CurrentOp, 0); - if (!CurrentOp) - { - return (FALSE); - } - } - - if (!CurrentOp || CurrentOp->Common.AmlOpcode != AML_IF_OP) - { - return (FALSE); - } - - /* Child must be LEqual or LNot */ - - CurrentOp = AcpiPsGetArg (CurrentOp, 0); - if (!CurrentOp) - { - return (FALSE); - } - - switch (CurrentOp->Common.AmlOpcode) - { - case (AML_LOGICAL_EQUAL_OP): - - /* Next child must be NamePath with string _T_ */ - - CurrentOp = AcpiPsGetArg (CurrentOp, 0); - if (!CurrentOp || !CurrentOp->Common.Value.Name || - strncmp(CurrentOp->Common.Value.Name, "_T_", 3)) - { - return (FALSE); - } - - break; - - case (AML_LOGICAL_NOT_OP): - - /* Child of LNot must be LEqual op */ - - CurrentOp = AcpiPsGetArg (CurrentOp, 0); - if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_LOGICAL_EQUAL_OP)) - { - return (FALSE); - } - - /* Child of LNot must be Match op */ - - CurrentOp = AcpiPsGetArg (CurrentOp, 0); - if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_MATCH_OP)) - { - return (FALSE); - } - - /* First child of Match must be Package op */ - - CurrentOp = AcpiPsGetArg (CurrentOp, 0); - if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_PACKAGE_OP)) - { - return (FALSE); - } - - /* Third child of Match must be NamePath with string _T_ */ - - CurrentOp = AcpiPsGetArg (CurrentOp->Common.Parent, 2); - if (!CurrentOp || !CurrentOp->Common.Value.Name || - strncmp(CurrentOp->Common.Value.Name, "_T_", 3)) - { - return (FALSE); - } - - break; - - default: - - return (FALSE); - } - - return (TRUE); -} diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index 2f4b5ec..33cc78f 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -89,8 +89,12 @@ static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] = AcpiDmQwordDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */ AcpiDmExtendedDescriptor, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */ AcpiDmGpioDescriptor, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */ - NULL, /* 0x0D, Reserved */ - AcpiDmSerialBusDescriptor /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */ + AcpiDmPinFunctionDescriptor, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */ + AcpiDmSerialBusDescriptor, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */ + AcpiDmPinConfigDescriptor, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */ + AcpiDmPinGroupDescriptor, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */ + AcpiDmPinGroupFunctionDescriptor, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */ + AcpiDmPinGroupConfigDescriptor, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */ }; @@ -432,6 +436,15 @@ AcpiDmIsResourceTemplate ( * intialization byte list. Because the resource macros will create * a buffer of the exact required length (buffer length will be equal * to the actual length). + * + * NOTE (April 2017): Resource templates with this issue have been + * seen in the field. We still don't want to attempt to disassemble + * a buffer like this to a resource template because this output + * would not match the original input buffer (it would be shorter + * than the original when the disassembled code is recompiled). + * Basically, a buffer like this appears to be hand crafted in the + * first place, so just emitting a buffer object instead of a + * resource template more closely resembles the original ASL code. */ if (DeclaredBufferLength != BufferLength) { diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index d0ae04f..d34b36b 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -407,6 +407,112 @@ AcpiDmGpioDescriptor ( } } +/******************************************************************************* + * + * FUNCTION: AcpiDmPinFunctionDescriptor + * + * PARAMETERS: Info - Extra resource info + * Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a PinFunction descriptor + * + ******************************************************************************/ + +void +AcpiDmPinFunctionDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT16 *PinList; + UINT8 *VendorData; + char *DeviceName = NULL; + UINT32 PinCount; + UINT32 i; + + AcpiDmIndent (Level); + AcpiOsPrintf ("PinFunction (%s, ", + AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinFunction.Flags)]); + + if (Resource->PinFunction.PinConfig <= 3) + { + AcpiOsPrintf ("%s, ", + AcpiGbl_PpcDecode[Resource->PinFunction.PinConfig]); + } + else + { + AcpiOsPrintf ("0x%2.2X, ", Resource->PinFunction.PinConfig); + } + + /* FunctionNumber */ + + AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber); + + if (Resource->PinFunction.ResSourceOffset) + { + DeviceName = ACPI_ADD_PTR (char, + Resource, Resource->PinFunction.ResSourceOffset), + AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX); + } + + AcpiOsPrintf (", "); + AcpiOsPrintf ("0x%2.2X,\n", Resource->PinFunction.ResSourceIndex); + + AcpiDmIndent (Level + 1); + + /* Always ResourceConsumer */ + AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_CONSUMER]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + + AcpiOsPrintf (","); + + /* Dump the vendor data */ + + if (Resource->PinFunction.VendorLength) + { + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + VendorData = ACPI_ADD_PTR (UINT8, Resource, + Resource->PinFunction.VendorOffset); + + AcpiDmDumpRawDataBuffer (VendorData, + Resource->PinFunction.VendorLength, Level); + } + + AcpiOsPrintf (")\n"); + + AcpiDmIndent (Level + 1); + + /* Dump the interrupt list */ + + AcpiOsPrintf ("{ // Pin list\n"); + + PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset - + Resource->PinFunction.PinTableOffset)) / + sizeof (UINT16); + + PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource, + Resource->PinFunction.PinTableOffset); + + for (i = 0; i < PinCount; i++) + { + AcpiDmIndent (Level + 2); + AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], + ((i + 1) < PinCount) ? "," : ""); + } + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("}\n"); +} + /******************************************************************************* * @@ -740,3 +846,363 @@ AcpiDmSerialBusDescriptor ( SerialBusResourceDispatch [Resource->CommonSerialBus.Type] ( Info, Resource, Length, Level); } + +/******************************************************************************* + * + * FUNCTION: AcpiDmPinConfig + * + * PARAMETERS: PinConfigType - Pin configuration type + * PinConfigValue - Pin configuration value + * + * RETURN: None + * + * DESCRIPTION: Pretty prints PinConfig type and value. + * + ******************************************************************************/ + +static void +AcpiDmPinConfig( + UINT8 PinConfigType, + UINT32 PinConfigValue) +{ + if (PinConfigType <= 13) + { + AcpiOsPrintf ("0x%2.2X /* %s */, ", PinConfigType, + AcpiGbl_PtypDecode[PinConfigType]); + } + else + { + AcpiOsPrintf ("0x%2.2X, /* Vendor Defined */ ", PinConfigType); + } + + /* PinConfigValue */ + + AcpiOsPrintf ("0x%4.4X,\n", PinConfigValue); +} + +/******************************************************************************* + * + * FUNCTION: AcpiDmPinConfigDescriptor + * + * PARAMETERS: Info - Extra resource info + * Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a PinConfig descriptor + * + ******************************************************************************/ + +void +AcpiDmPinConfigDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT16 *PinList; + UINT8 *VendorData; + char *DeviceName = NULL; + UINT32 PinCount; + UINT32 i; + + AcpiDmIndent (Level); + AcpiOsPrintf ("PinConfig (%s, ", + AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinConfig.Flags)]); + + AcpiDmPinConfig (Resource->PinConfig.PinConfigType, + Resource->PinConfig.PinConfigValue); + + AcpiDmIndent (Level + 1); + + if (Resource->PinConfig.ResSourceOffset) + { + DeviceName = ACPI_ADD_PTR (char, + Resource, Resource->PinConfig.ResSourceOffset), + AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX); + } + + AcpiOsPrintf (", "); + AcpiOsPrintf ("0x%2.2X, ", Resource->PinConfig.ResSourceIndex); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinConfig.Flags, 1)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + + AcpiOsPrintf (","); + + /* Dump the vendor data */ + + if (Resource->PinConfig.VendorLength) + { + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + VendorData = ACPI_ADD_PTR (UINT8, Resource, + Resource->PinConfig.VendorOffset); + + AcpiDmDumpRawDataBuffer (VendorData, + Resource->PinConfig.VendorLength, Level); + } + + AcpiOsPrintf (")\n"); + + AcpiDmIndent (Level + 1); + + /* Dump the interrupt list */ + + AcpiOsPrintf ("{ // Pin list\n"); + + PinCount = ((UINT32) (Resource->PinConfig.ResSourceOffset - + Resource->PinConfig.PinTableOffset)) / + sizeof (UINT16); + + PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource, + Resource->PinConfig.PinTableOffset); + + for (i = 0; i < PinCount; i++) + { + AcpiDmIndent (Level + 2); + AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], + ((i + 1) < PinCount) ? "," : ""); + } + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("}\n"); +} + +/******************************************************************************* + * + * FUNCTION: AcpiDmPinGroupDescriptor + * + * PARAMETERS: Info - Extra resource info + * Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a PinGroup descriptor + * + ******************************************************************************/ + +void +AcpiDmPinGroupDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + char *Label; + UINT16 *PinList; + UINT8 *VendorData; + UINT32 PinCount; + UINT32 i; + + AcpiDmIndent (Level); + /* Always producer */ + AcpiOsPrintf ("PinGroup ("); + + Label = ACPI_ADD_PTR (char, + Resource, Resource->PinGroup.LabelOffset), + AcpiUtPrintString (Label, ACPI_UINT16_MAX); + + AcpiOsPrintf (", "); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroup.Flags)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + + AcpiOsPrintf (","); + + /* Dump the vendor data */ + + if (Resource->PinGroup.VendorLength) + { + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + VendorData = ACPI_ADD_PTR (UINT8, Resource, + Resource->PinGroup.VendorOffset); + + AcpiDmDumpRawDataBuffer (VendorData, + Resource->PinGroup.VendorLength, Level); + } + + AcpiOsPrintf (")\n"); + + AcpiDmIndent (Level + 1); + + /* Dump the interrupt list */ + + AcpiOsPrintf ("{ // Pin list\n"); + + PinCount = (Resource->PinGroup.LabelOffset - + Resource->PinGroup.PinTableOffset) / sizeof (UINT16); + + PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource, + Resource->PinGroup.PinTableOffset); + + for (i = 0; i < PinCount; i++) + { + AcpiDmIndent (Level + 2); + AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], + ((i + 1) < PinCount) ? "," : ""); + } + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("}\n"); +} + +/******************************************************************************* + * + * FUNCTION: AcpiDmPinGroupFunctionDescriptor + * + * PARAMETERS: Info - Extra resource info + * Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a PinGroupFunction descriptor + * + ******************************************************************************/ + +void +AcpiDmPinGroupFunctionDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT8 *VendorData; + char *DeviceName = NULL; + char *Label = NULL; + + AcpiDmIndent (Level); + AcpiOsPrintf ("PinGroupFunction (%s, ", + AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupFunction.Flags)]); + + /* FunctionNumber */ + + AcpiOsPrintf ("0x%4.4X, ", Resource->PinGroupFunction.FunctionNumber); + + DeviceName = ACPI_ADD_PTR (char, + Resource, Resource->PinGroupFunction.ResSourceOffset), + AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX); + + AcpiOsPrintf (", "); + AcpiOsPrintf ("0x%2.2X,\n", Resource->PinGroupFunction.ResSourceIndex); + + AcpiDmIndent (Level + 1); + + Label = ACPI_ADD_PTR (char, Resource, + Resource->PinGroupFunction.ResSourceLabelOffset); + AcpiUtPrintString (Label, ACPI_UINT16_MAX); + + AcpiOsPrintf (", "); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupFunction.Flags, 1)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + + AcpiOsPrintf (","); + + /* Dump the vendor data */ + + if (Resource->PinGroupFunction.VendorLength) + { + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + VendorData = ACPI_ADD_PTR (UINT8, Resource, + Resource->PinGroupFunction.VendorOffset); + + AcpiDmDumpRawDataBuffer (VendorData, + Resource->PinGroupFunction.VendorLength, Level); + } + + AcpiOsPrintf (")\n"); +} + +/******************************************************************************* + * + * FUNCTION: AcpiDmPinGroupConfigDescriptor + * + * PARAMETERS: Info - Extra resource info + * Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a PinGroupConfig descriptor + * + ******************************************************************************/ + +void +AcpiDmPinGroupConfigDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT8 *VendorData; + char *DeviceName = NULL; + char *Label = NULL; + + AcpiDmIndent (Level); + AcpiOsPrintf ("PinGroupConfig (%s, ", + AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupConfig.Flags)]); + + AcpiDmPinConfig(Resource->PinGroupConfig.PinConfigType, + Resource->PinGroupConfig.PinConfigValue); + + AcpiDmIndent (Level + 1); + + DeviceName = ACPI_ADD_PTR (char, + Resource, Resource->PinGroupConfig.ResSourceOffset), + AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX); + + AcpiOsPrintf (", "); + AcpiOsPrintf ("0x%2.2X, ", Resource->PinGroupConfig.ResSourceIndex); + + Label = ACPI_ADD_PTR (char, Resource, + Resource->PinGroupConfig.ResSourceLabelOffset); + AcpiUtPrintString (Label, ACPI_UINT16_MAX); + + AcpiOsPrintf (", "); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupConfig.Flags, 1)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + + AcpiOsPrintf (","); + + /* Dump the vendor data */ + + if (Resource->PinGroupConfig.VendorLength) + { + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + VendorData = ACPI_ADD_PTR (UINT8, Resource, + Resource->PinGroupConfig.VendorOffset); + + AcpiDmDumpRawDataBuffer (VendorData, + Resource->PinGroupConfig.VendorLength, Level); + } + + AcpiOsPrintf (")\n"); +} diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 548b7dc..689fda9 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -53,8 +53,6 @@ ACPI_MODULE_NAME ("dmwalk") -#define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: " - /* Stub for non-compiler code */ #ifndef ACPI_ASL_COMPILER @@ -476,13 +474,6 @@ AcpiDmDescendingOp ( return (AE_CTRL_DEPTH); } - if (AcpiDmIsTempName(Op)) - { - /* Ignore compiler generated temporary names */ - - return (AE_CTRL_DEPTH); - } - if (Op->Common.DisasmOpcode == ACPI_DASM_IGNORE_SINGLE) { /* Ignore this op, but not it's children */ @@ -534,10 +525,16 @@ AcpiDmDescendingOp ( Info->WalkState->ParserState.AmlStart); if (AcpiGbl_DmOpt_Verbose) { - AcpiOsPrintf (DB_FULL_OP_INFO, - (Info->WalkState->MethodNode ? - Info->WalkState->MethodNode->Name.Ascii : " "), - AmlOffset, (UINT32) Op->Common.AmlOpcode); + if (AcpiGbl_CmSingleStep) + { + AcpiOsPrintf ("%5.5X/%4.4X: ", + AmlOffset, (UINT32) Op->Common.AmlOpcode); + } + else + { + AcpiOsPrintf ("AML Offset %5.5X, Opcode %4.4X: ", + AmlOffset, (UINT32) Op->Common.AmlOpcode); + } } } @@ -674,7 +671,7 @@ AcpiDmDescendingOp ( Name = AcpiPsGetName (Op); if (Op->Named.Path) { - AcpiDmNamestring ((char *) Op->Named.Path); + AcpiDmNamestring (Op->Named.Path); } else { diff --git a/source/components/dispatcher/dsargs.c b/source/components/dispatcher/dsargs.c index 2d09460..714facf 100644 --- a/source/components/dispatcher/dsargs.c +++ b/source/components/dispatcher/dsargs.c @@ -89,7 +89,7 @@ AcpiDsExecuteArguments ( ACPI_WALK_STATE *WalkState; - ACPI_FUNCTION_TRACE (DsExecuteArguments); + ACPI_FUNCTION_TRACE_PTR (DsExecuteArguments, AmlStart); /* Allocate a new parser op to be the root of the parsed tree */ @@ -366,7 +366,8 @@ AcpiDsGetPackageArguments ( return_ACPI_STATUS (AE_AML_INTERNAL); } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Argument Init, AML Ptr: %p\n", + ObjDesc->Package.AmlStart)); /* Execute the AML code for the TermArg arguments */ diff --git a/source/components/dispatcher/dsdebug.c b/source/components/dispatcher/dsdebug.c index d97a34a..c70f7d6 100644 --- a/source/components/dispatcher/dsdebug.c +++ b/source/components/dispatcher/dsdebug.c @@ -212,6 +212,7 @@ AcpiDsDumpMethodStack ( Op->Common.Next = NULL; #ifdef ACPI_DISASSEMBLER + AcpiOsPrintf ("Failed at "); AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX); #endif Op->Common.Next = Next; diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c index b2f382b..c3dfa39 100644 --- a/source/components/dispatcher/dsmethod.c +++ b/source/components/dispatcher/dsmethod.c @@ -225,6 +225,7 @@ AcpiDsMethodError ( ACPI_WALK_STATE *WalkState) { UINT32 AmlOffset; + ACPI_NAME Name = 0; ACPI_FUNCTION_ENTRY (); @@ -253,9 +254,16 @@ AcpiDsMethodError ( AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml, WalkState->ParserState.AmlStart); - Status = AcpiGbl_ExceptionHandler (Status, - WalkState->MethodNode ? - WalkState->MethodNode->Name.Integer : 0, + if (WalkState->MethodNode) + { + Name = WalkState->MethodNode->Name.Integer; + } + else if (WalkState->DeferredNode) + { + Name = WalkState->DeferredNode->Name.Integer; + } + + Status = AcpiGbl_ExceptionHandler (Status, Name, WalkState->Opcode, AmlOffset, NULL); AcpiExEnterInterpreter (); } diff --git a/source/components/dispatcher/dsopcode.c b/source/components/dispatcher/dsopcode.c index ceb0dab..83b5cce 100644 --- a/source/components/dispatcher/dsopcode.c +++ b/source/components/dispatcher/dsopcode.c @@ -245,10 +245,9 @@ AcpiDsInitBufferField ( (8 * (UINT32) BufferDesc->Buffer.Length)) { ACPI_ERROR ((AE_INFO, - "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)", - AcpiUtGetNodeName (ResultDesc), - BitOffset + BitCount, - AcpiUtGetNodeName (BufferDesc->Buffer.Node), + "Field [%4.4s] at bit offset/length %u/%u " + "exceeds size of target Buffer (%u bits)", + AcpiUtGetNodeName (ResultDesc), BitOffset, BitCount, 8 * (UINT32) BufferDesc->Buffer.Length)); Status = AE_AML_BUFFER_LIMIT; goto Cleanup; diff --git a/source/components/dispatcher/dspkginit.c b/source/components/dispatcher/dspkginit.c new file mode 100755 index 0000000..5763255 --- /dev/null +++ b/source/components/dispatcher/dspkginit.c @@ -0,0 +1,530 @@ +/****************************************************************************** + * + * Module Name: dspkginit - Completion of deferred package initialization + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2017, 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" +#include "acnamesp.h" +#include "amlcode.h" +#include "acdispat.h" +#include "acinterp.h" + + +#define _COMPONENT ACPI_NAMESPACE + ACPI_MODULE_NAME ("dspkginit") + + +/* Local prototypes */ + +static void +AcpiDsResolvePackageElement ( + ACPI_OPERAND_OBJECT **Element); + + +/******************************************************************************* + * + * FUNCTION: AcpiDsBuildInternalPackageObj + * + * PARAMETERS: WalkState - Current walk state + * Op - Parser object to be translated + * ElementCount - Number of elements in the package - this is + * the NumElements argument to Package() + * ObjDescPtr - Where the ACPI internal object is returned + * + * RETURN: Status + * + * DESCRIPTION: Translate a parser Op package object to the equivalent + * namespace object + * + * NOTE: The number of elements in the package will be always be the NumElements + * count, regardless of the number of elements in the package list. If + * NumElements is smaller, only that many package list elements are used. + * if NumElements is larger, the Package object is padded out with + * objects of type Uninitialized (as per ACPI spec.) + * + * Even though the ASL compilers do not allow NumElements to be smaller + * than the Package list length (for the fixed length package opcode), some + * BIOS code modifies the AML on the fly to adjust the NumElements, and + * this code compensates for that. This also provides compatibility with + * other AML interpreters. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDsBuildInternalPackageObj ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op, + UINT32 ElementCount, + ACPI_OPERAND_OBJECT **ObjDescPtr) +{ + ACPI_PARSE_OBJECT *Arg; + ACPI_PARSE_OBJECT *Parent; + ACPI_OPERAND_OBJECT *ObjDesc = NULL; + ACPI_STATUS Status = AE_OK; + UINT16 Index; + UINT16 ReferenceCount; + UINT32 i; + + + ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj); + + + /* Find the parent of a possibly nested package */ + + Parent = Op->Common.Parent; + while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) || + (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) + { + Parent = Parent->Common.Parent; + } + + /* + * If we are evaluating a Named package object of the form: + * Name (xxxx, Package) + * the package object already exists, otherwise it must be created. + */ + ObjDesc = *ObjDescPtr; + if (!ObjDesc) + { + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE); + *ObjDescPtr = ObjDesc; + if (!ObjDesc) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + +printf ("****DS: BuildPkg - Create package object %p\n", ObjDesc); + + ObjDesc->Package.Node = Parent->Common.Node; + } + +// +printf ("****DS: BuildPkg, from DsEvalDataObjectOperands - Valid: %X, Pass %u, %p\n", + ObjDesc->Package.Flags & AOPOBJ_DATA_VALID, + WalkState->PassNumber, ObjDesc); + +// just in case +if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID) +{ + return_ACPI_STATUS (AE_OK); +} + + /* + * Allocate the element array (array of pointers to the individual + * objects) based on the NumElements parameter. Add an extra pointer slot + * so that the list is always null terminated. + */ + ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED ( + ((ACPI_SIZE) ElementCount + 1) * sizeof (void *)); + + if (!ObjDesc->Package.Elements) + { + AcpiUtDeleteObjectDesc (ObjDesc); + return_ACPI_STATUS (AE_NO_MEMORY); + } + + ObjDesc->Package.Count = ElementCount; + + /* + * Initialize the elements of the package, up to the NumElements count. + * Package is automatically padded with uninitialized (NULL) elements + * if NumElements is greater than the package list length. Likewise, + * Package is truncated if NumElements is less than the list length. + */ + Arg = Op->Common.Value.Arg; + Arg = Arg->Common.Next; + + if (Arg) + { + printf ("****DS: Mark package evaluated\n"); + ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID; + } + + for (i = 0; Arg && (i < ElementCount); i++) + { +printf ("****DS: Eval package element\n"); + + if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) + { +// Maybe this is just temp code: +/* +if (!Arg->Common.Node) +{ + printf ("****DS: No attached NS node\n"); + return_ACPI_STATUS (AE_AML_INTERNAL); +} +else */ if (Arg->Common.Node->Type == ACPI_TYPE_METHOD) + { + + /* + * A method reference "looks" to the parser to be a method + * invocation, so we special case it here + */ + Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP; + Status = AcpiDsBuildInternalObject ( + WalkState, Arg, &ObjDesc->Package.Elements[i]); + } + else + { + /* This package element is already built, just get it */ + + ObjDesc->Package.Elements[i] = + ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node); + } + } + else + { + Status = AcpiDsBuildInternalObject ( + WalkState, Arg, &ObjDesc->Package.Elements[i]); + if (Status == AE_NOT_FOUND) + { +// remove or fix + ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found")); + } + + /* + * Initialize this package element. This function handles the + * resolution of named references within the package. + */ + AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i], + NULL, &ObjDesc->Package.Elements[i]); + } + + if (*ObjDescPtr) + { + /* Existing package, get existing reference count */ + + ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount; + if (ReferenceCount > 1) + { + /* Make new element ref count match original ref count */ + + for (Index = 0; Index < (ReferenceCount - 1); Index++) + { + AcpiUtAddReference ((ObjDesc->Package.Elements[i])); + } + } + } + + Arg = Arg->Common.Next; + } + + /* Check for match between NumElements and actual length of PackageList */ + + if (Arg) + { + //ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID; + + + /* + * NumElements was exhausted, but there are remaining elements in the + * PackageList. Truncate the package to NumElements. + * + * Note: technically, this is an error, from ACPI spec: "It is an error + * for NumElements to be less than the number of elements in the + * PackageList". However, we just print a message and + * no exception is returned. This provides Windows compatibility. Some + * BIOSs will alter the NumElements on the fly, creating this type + * of ill-formed package object. + */ + while (Arg) + { + /* + * We must delete any package elements that were created earlier + * and are not going to be used because of the package truncation. + */ + if (Arg->Common.Node) + { + AcpiUtRemoveReference ( + ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node)); + Arg->Common.Node = NULL; + } + + /* Find out how many elements there really are */ + + i++; + Arg = Arg->Common.Next; + } + + ACPI_INFO (( + "Actual Package length (%u) is larger than " + "NumElements field (%u), truncated", + i, ElementCount)); + } + else if (i < ElementCount) + { + /* + * Arg list (elements) was exhausted, but we did not reach + * NumElements count. + * + * Note: this is not an error, the package is padded out + * with NULLs. + */ + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Package List length (%u) smaller than NumElements " + "count (%u), padded with null elements\n", + i, ElementCount)); + } + + Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDsInitPackageElement + * + * PARAMETERS: ACPI_PKG_CALLBACK + * + * RETURN: Status + * + * DESCRIPTION: Resolve a named reference element within a package object + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDsInitPackageElement ( + UINT8 ObjectType, + ACPI_OPERAND_OBJECT *SourceObject, + ACPI_GENERIC_STATE *State, + void *Context) +{ + ACPI_OPERAND_OBJECT **ElementPtr; + + + if (!SourceObject) + { + return (AE_OK); + } + + /* + * The following code is a bit of a hack to workaround a (current) + * limitation of the ACPI_PKG_CALLBACK interface. We need a pointer + * to the location within the element array because a new object + * may be created and stored there. + */ + if (Context) + { + /* A direct call was made to this function */ + + ElementPtr = (ACPI_OPERAND_OBJECT **) Context; + } + else + { + /* Call came from AcpiUtWalkPackageTree */ + + ElementPtr = State->Pkg.ThisTargetObj; + } + + /* We are only interested in reference objects/elements */ + + if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) + { + /* Resolve the (named) reference to a namespace node */ + + AcpiDsResolvePackageElement (ElementPtr); + } + else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE) + { + SourceObject->Package.Flags |= AOPOBJ_DATA_VALID; + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDsResolvePackageElement + * + * PARAMETERS: ElementPtr - Pointer to a reference object + * + * RETURN: Status + * + * DESCRIPTION: Resolve a package element that is a reference to a named + * object. + * + ******************************************************************************/ + +static void +AcpiDsResolvePackageElement ( + ACPI_OPERAND_OBJECT **ElementPtr) +{ + ACPI_STATUS Status; + ACPI_GENERIC_STATE ScopeInfo; + ACPI_OPERAND_OBJECT *Element = *ElementPtr; + ACPI_NAMESPACE_NODE *ResolvedNode; + ACPI_OBJECT_TYPE Type; + + + ACPI_FUNCTION_TRACE (DsResolvePackageElement); + + + /* Check if reference element is already resolved */ + + if (Element->Reference.Resolved) + { + return_VOID; + } + + /* Element must be a reference object of correct type */ + + ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */ + + Status = AcpiNsLookup (&ScopeInfo, + (char *) Element->Reference.Aml, /* Pointer to AML path */ + ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, + NULL, &ResolvedNode); + + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not resolve package element")); + return_VOID; + } + + else if (ResolvedNode->Type == ACPI_TYPE_ANY) + { + /* Named reference not resolved, return a NULL package element */ + + ACPI_ERROR ((AE_INFO, + "Could not resolve package element [%4.4s] in [%4.4s]", + ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii)); + *ElementPtr = NULL; + return_VOID; + } + + else if (ResolvedNode->Flags & ANOBJ_TEMPORARY) + { + /* + * A temporary node found here indicates that the reference is + * to a node that was created within this method. We are not + * going to allow it (especially if the package is returned + * from the method) -- the temporary node will be deleted out + * from under the method. (05/2017). + */ + ACPI_ERROR ((AE_INFO, + "Package element is a temporary name [%4.4s], " + "returning NULL element", + ResolvedNode->Name.Ascii)); + *ElementPtr = NULL; + return_VOID; + } + + /* Update the reference object */ + + Element->Reference.Resolved = TRUE; + Element->Reference.Node = ResolvedNode; + Type = Element->Reference.Node->Type; + + /* + * Attempt to resolve the node to a value before we insert it into + * the package. If this is a reference to a common data type, + * resolve it immediately. According to the ACPI spec, package + * elements can only be "data objects" or method references. + * Attempt to resolve to an Integer, Buffer, String or Package. + * If cannot, return the named reference (for things like Devices, + * Methods, etc.) Buffer Fields and Fields will resolve to simple + * objects (int/buf/str/pkg). + * + * NOTE: References to things like Devices, Methods, Mutexes, etc. + * will remain as named references. This behavior is not described + * in the ACPI spec, but it appears to be an oversight. + */ + Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL); + if (ACPI_FAILURE (Status)) + { + return_VOID; + } + +#if 0 + /* + * Special handling for Alias objects. We need to setup the type + * and the Op->Common.Node to point to the Alias target. Note, + * Alias has at most one level of indirection internally. + */ + Type = Op->Common.Node->Type; + if (Type == ACPI_TYPE_LOCAL_ALIAS) + { + Type = ObjDesc->Common.Type; + Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, + Op->Common.Node->Object); + } +#endif + + switch (Type) + { + /* + * These object types are a result of named references, so we will + * leave them as reference objects. In other words, these types + * have no intrinsic "value". + */ + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_THERMAL: + + /* TBD: This may not be necesssary */ + + AcpiUtAddReference (ResolvedNode->Object); + break; + + case ACPI_TYPE_MUTEX: + case ACPI_TYPE_METHOD: + case ACPI_TYPE_POWER: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_EVENT: + case ACPI_TYPE_REGION: + + break; + + default: + /* + * For all other types - the node was resolved to an actual + * operand object with a value, return the object + */ + *ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode; + break; + } + + return_VOID; +} diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c index f44fb9f..1b661a0 100644 --- a/source/components/dispatcher/dsutils.c +++ b/source/components/dispatcher/dsutils.c @@ -683,12 +683,6 @@ AcpiDsCreateOperand ( if ((OpInfo->Flags & AML_HAS_RETVAL) || (Arg->Common.Flags & ACPI_PARSEOP_IN_STACK)) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Argument previously created, already stacked\n")); - - AcpiDbDisplayArgumentObject ( - WalkState->Operands [WalkState->NumOperands - 1], WalkState); - /* * Use value that was already previously returned * by the evaluation of this argument diff --git a/source/components/dispatcher/dswexec.c b/source/components/dispatcher/dswexec.c index 7d7022e..a5b5db8 100644 --- a/source/components/dispatcher/dswexec.c +++ b/source/components/dispatcher/dswexec.c @@ -615,7 +615,8 @@ AcpiDsExecEndOp ( case AML_TYPE_CREATE_OBJECT: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Executing CreateObject (Buffer/Package) Op=%p\n", Op)); + "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n", + Op, Op->Named.Data)); switch (Op->Common.Parent->Common.AmlOpcode) { diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c index 72124fc..e8fea37 100644 --- a/source/components/dispatcher/dswload.c +++ b/source/components/dispatcher/dswload.c @@ -410,7 +410,7 @@ AcpiDsLoad1BeginOp ( /* Initialize the op */ #if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)) - Op->Named.Path = ACPI_CAST_PTR (UINT8, Path); + Op->Named.Path = Path; #endif if (Node) @@ -450,6 +450,10 @@ AcpiDsLoad1EndOp ( ACPI_OBJECT_TYPE ObjectType; ACPI_STATUS Status = AE_OK; +#ifdef ACPI_ASL_COMPILER + UINT8 ParamCount; +#endif + ACPI_FUNCTION_TRACE (DsLoad1EndOp); @@ -534,6 +538,37 @@ AcpiDsLoad1EndOp ( } } +#ifdef ACPI_ASL_COMPILER + /* + * For external opcode, get the object type from the argument and + * get the parameter count from the argument's next. + */ + if (AcpiGbl_DisasmFlag && + Op->Common.Node && + Op->Common.AmlOpcode == AML_EXTERNAL_OP) + { + /* + * Note, if this external is not a method + * Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0 + * Therefore, ParamCount will be 0. + */ + ParamCount = (UINT8) Op->Common.Value.Arg->Common.Next->Common.Value.Integer; + ObjectType = (UINT8) Op->Common.Value.Arg->Common.Value.Integer; + Op->Common.Node->Flags |= ANOBJ_IS_EXTERNAL; + Op->Common.Node->Type = (UINT8) ObjectType; + + AcpiDmCreateSubobjectForExternal ((UINT8)ObjectType, + &Op->Common.Node, ParamCount); + + /* + * Add the external to the external list because we may be + * emitting code based off of the items within the external list. + */ + AcpiDmAddOpToExternalList (Op, Op->Named.Path, (UINT8)ObjectType, ParamCount, + ACPI_EXT_ORIGIN_FROM_OPCODE | ACPI_EXT_RESOLVED_REFERENCE); + } +#endif + /* * If we are executing a method, do not create any namespace objects * during the load phase, only during execution. @@ -581,6 +616,7 @@ AcpiDsLoad1EndOp ( /* Pop the scope stack (only if loading a table) */ if (!WalkState->MethodNode && + Op->Common.AmlOpcode != AML_EXTERNAL_OP && AcpiNsOpensScope (ObjectType)) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n", diff --git a/source/components/dispatcher/dswload2.c b/source/components/dispatcher/dswload2.c index 4985f20..c9a142f 100644 --- a/source/components/dispatcher/dswload2.c +++ b/source/components/dispatcher/dswload2.c @@ -320,6 +320,24 @@ AcpiDsLoad2BeginOp ( } } +#ifdef ACPI_ASL_COMPILER + + /* + * Do not open a scope for AML_EXTERNAL_OP + * AcpiNsLookup can open a new scope based on the object type + * of this op. AML_EXTERNAL_OP is a declaration rather than a + * definition. In the case that this external is a method object, + * AcpiNsLookup will open a new scope. However, an AML_EXTERNAL_OP + * associated with the ACPI_TYPE_METHOD is a declaration, rather than + * a definition. Flags is set to avoid opening a scope for any + * AML_EXTERNAL_OP. + */ + if (WalkState->Opcode == AML_EXTERNAL_OP) + { + Flags |= ACPI_NS_DONT_OPEN_SCOPE; + } +#endif + /* Add new entry or lookup existing entry */ Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, diff --git a/source/components/events/evxfevnt.c b/source/components/events/evxfevnt.c index 15b8007..7ced65c 100644 --- a/source/components/events/evxfevnt.c +++ b/source/components/events/evxfevnt.c @@ -198,6 +198,13 @@ AcpiEnableEvent ( ACPI_FUNCTION_TRACE (AcpiEnableEvent); + /* If Hardware Reduced flag is set, there are no fixed events */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Decode the Fixed Event */ if (Event > ACPI_EVENT_MAX) @@ -264,6 +271,13 @@ AcpiDisableEvent ( ACPI_FUNCTION_TRACE (AcpiDisableEvent); + /* If Hardware Reduced flag is set, there are no fixed events */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Decode the Fixed Event */ if (Event > ACPI_EVENT_MAX) @@ -325,6 +339,13 @@ AcpiClearEvent ( ACPI_FUNCTION_TRACE (AcpiClearEvent); + /* If Hardware Reduced flag is set, there are no fixed events */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Decode the Fixed Event */ if (Event > ACPI_EVENT_MAX) diff --git a/source/components/executer/exdebug.c b/source/components/executer/exdebug.c index 635cad5..ea79566 100644 --- a/source/components/executer/exdebug.c +++ b/source/components/executer/exdebug.c @@ -129,11 +129,11 @@ AcpiExDoDebugObject ( Timer = ((UINT32) AcpiOsGetTimer () / 10); Timer &= 0x03FFFFFF; - AcpiOsPrintf ("[ACPI Debug T=0x%8.8X] %*s", Timer, Level, " "); + AcpiOsPrintf ("ACPI Debug: T=0x%8.8X %*s", Timer, Level, " "); } else { - AcpiOsPrintf ("[ACPI Debug] %*s", Level, " "); + AcpiOsPrintf ("ACPI Debug: %*s", Level, " "); } } diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c index 0120909..d869746 100644 --- a/source/components/executer/exdump.c +++ b/source/components/executer/exdump.c @@ -667,12 +667,13 @@ AcpiExDumpOperand ( if (Depth > 0) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ", - Depth, " ", Depth, ObjDesc)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ", + Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount)); } else { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Refs=%u ", + ObjDesc, ObjDesc->Common.ReferenceCount)); } /* Decode object type */ @@ -710,8 +711,10 @@ AcpiExDumpOperand ( case ACPI_REFCLASS_NAME: - AcpiOsPrintf ("- [%4.4s]\n", - ObjDesc->Reference.Node->Name.Ascii); + AcpiUtRepairName (ObjDesc->Reference.Node->Name.Ascii); + AcpiOsPrintf ("- [%4.4s] (Node %p)\n", + ObjDesc->Reference.Node->Name.Ascii, + ObjDesc->Reference.Node); break; case ACPI_REFCLASS_ARG: @@ -1050,12 +1053,15 @@ AcpiExDumpReferenceObj ( &RetBuf, TRUE); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf (" Could not convert name to pathname\n"); + AcpiOsPrintf (" Could not convert name to pathname: %s\n", + AcpiFormatException (Status)); } else { - AcpiOsPrintf ("%s\n", (char *) RetBuf.Pointer); - ACPI_FREE (RetBuf.Pointer); + AcpiOsPrintf ("%s: %s\n", + AcpiUtGetTypeName (ObjDesc->Reference.Node->Type), + (char *) RetBuf.Pointer); + ACPI_FREE (RetBuf.Pointer); } } else if (ObjDesc->Reference.Object) @@ -1173,9 +1179,8 @@ AcpiExDumpPackageObj ( case ACPI_TYPE_LOCAL_REFERENCE: - AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X", - AcpiUtGetReferenceName (ObjDesc), - ObjDesc->Reference.Class); + AcpiOsPrintf ("[Object Reference] Class [%s]", + AcpiUtGetReferenceName (ObjDesc)); AcpiExDumpReferenceObj (ObjDesc); break; diff --git a/source/components/executer/exoparg1.c b/source/components/executer/exoparg1.c index b3323db..5c6b942 100644 --- a/source/components/executer/exoparg1.c +++ b/source/components/executer/exoparg1.c @@ -851,7 +851,7 @@ AcpiExOpcode_1A_0T_1R ( if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED) { TempDesc = AcpiNsGetAttachedObject ( - (ACPI_NAMESPACE_NODE *) Operand[0]); + (ACPI_NAMESPACE_NODE *) Operand[0]); if (TempDesc && ((TempDesc->Common.Type == ACPI_TYPE_STRING) || (TempDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE))) @@ -964,11 +964,27 @@ AcpiExOpcode_1A_0T_1R ( * This is a DerefOf (ObjectReference) * Get the actual object from the Node (This is the dereference). * This case may only happen when a LocalX or ArgX is - * dereferenced above. + * dereferenced above, or for references to device and + * thermal objects. */ - ReturnDesc = AcpiNsGetAttachedObject ( - (ACPI_NAMESPACE_NODE *) Operand[0]); - AcpiUtAddReference (ReturnDesc); + switch (((ACPI_NAMESPACE_NODE *) Operand[0])->Type) + { + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_THERMAL: + + /* These types have no node subobject, return the NS node */ + + ReturnDesc = Operand[0]; + break; + + default: + /* For most types, get the object attached to the node */ + + ReturnDesc = AcpiNsGetAttachedObject ( + (ACPI_NAMESPACE_NODE *) Operand[0]); + AcpiUtAddReference (ReturnDesc); + break; + } } else { diff --git a/source/components/executer/exresolv.c b/source/components/executer/exresolv.c index bbef5c1..fad97d1 100644 --- a/source/components/executer/exresolv.c +++ b/source/components/executer/exresolv.c @@ -385,12 +385,26 @@ AcpiExResolveMultiple ( (ACPI_NAMESPACE_NODE *) ObjDesc); } - if (!ObjDesc) + switch (Type) { - ACPI_ERROR ((AE_INFO, - "[%4.4s] Node is unresolved or uninitialized", - AcpiUtGetNodeName (Node))); - return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE); + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_THERMAL: + + /* These types have no attached subobject */ + break; + + default: + + /* All other types require a subobject */ + + if (!ObjDesc) + { + ACPI_ERROR ((AE_INFO, + "[%4.4s] Node is unresolved or uninitialized", + AcpiUtGetNodeName (Node))); + return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE); + } + break; } break; diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index 7b5715b..9016712 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -47,6 +47,9 @@ #include "acnamesp.h" #include "acdispat.h" +#ifdef ACPI_ASL_COMPILER + #include "acdisasm.h" +#endif #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsaccess") @@ -602,6 +605,30 @@ AcpiNsLookup ( CurrentNode)); } +#ifdef ACPI_ASL_COMPILER + /* + * If this ACPI name already exists within the namespace as an + * external declaration, then mark the external as a conflicting + * declaration and proceed to process the current node as if it did + * not exist in the namespace. If this node is not processed as + * normal, then it could cause improper namespace resolution + * by failing to open a new scope. + */ + if (AcpiGbl_DisasmFlag && + (Status == AE_ALREADY_EXISTS) && + ((ThisNode->Flags & ANOBJ_IS_EXTERNAL) || + (WalkState && WalkState->Opcode == AML_EXTERNAL_OP))) + { + ThisNode->Flags &= ~ANOBJ_IS_EXTERNAL; + ThisNode->Type = (UINT8)ThisSearchType; + if (WalkState->Opcode != AML_EXTERNAL_OP) + { + AcpiDmMarkExternalConflict (ThisNode); + } + break; + } +#endif + *ReturnNode = ThisNode; return_ACPI_STATUS (Status); } diff --git a/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c index c82e17f..0ca3514 100644 --- a/source/components/namespace/nsnames.c +++ b/source/components/namespace/nsnames.c @@ -216,10 +216,6 @@ AcpiNsHandleToPathname ( (void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer, RequiredSize, NoTrailing); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X]\n", (char *) Buffer->Pointer, (UINT32) RequiredSize)); diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c index 652b19c..284d2f9 100644 --- a/source/components/namespace/nsutils.c +++ b/source/components/namespace/nsutils.c @@ -98,7 +98,7 @@ AcpiNsPrintNodePathname ( AcpiOsPrintf ("%s ", Message); } - AcpiOsPrintf ("[%s] (Node %p)", (char *) Buffer.Pointer, Node); + AcpiOsPrintf ("%s", (char *) Buffer.Pointer); ACPI_FREE (Buffer.Pointer); } } diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c index 6b2d6fb..1186fa9 100644 --- a/source/components/namespace/nsxfeval.c +++ b/source/components/namespace/nsxfeval.c @@ -91,6 +91,8 @@ AcpiEvaluateObjectTyped ( { ACPI_STATUS Status; BOOLEAN FreeBufferOnError = FALSE; + ACPI_HANDLE TargetHandle; + char *FullPathname; ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped); @@ -108,41 +110,56 @@ AcpiEvaluateObjectTyped ( FreeBufferOnError = TRUE; } + Status = AcpiGetHandle (Handle, Pathname, &TargetHandle); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + FullPathname = AcpiNsGetExternalPathname (TargetHandle); + if (!FullPathname) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + /* Evaluate the object */ - Status = AcpiEvaluateObject (Handle, Pathname, - ExternalParams, ReturnBuffer); + Status = AcpiEvaluateObject (TargetHandle, NULL, ExternalParams, + ReturnBuffer); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + goto Exit; } - /* Type ANY means "don't care" */ + /* Type ANY means "don't care about return value type" */ if (ReturnType == ACPI_TYPE_ANY) { - return_ACPI_STATUS (AE_OK); + goto Exit; } if (ReturnBuffer->Length == 0) { /* Error because caller specifically asked for a return value */ - ACPI_ERROR ((AE_INFO, "No return value")); - return_ACPI_STATUS (AE_NULL_OBJECT); + ACPI_ERROR ((AE_INFO, "%s did not return any object", + FullPathname)); + Status = AE_NULL_OBJECT; + goto Exit; } /* Examine the object type returned from EvaluateObject */ if (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type == ReturnType) { - return_ACPI_STATUS (AE_OK); + goto Exit; } /* Return object type does not match requested type */ ACPI_ERROR ((AE_INFO, - "Incorrect return type [%s] requested [%s]", + "Incorrect return type from %s - received [%s], requested [%s]", + FullPathname, AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type), AcpiUtGetTypeName (ReturnType))); @@ -160,7 +177,11 @@ AcpiEvaluateObjectTyped ( } ReturnBuffer->Length = 0; - return_ACPI_STATUS (AE_TYPE); + Status = AE_TYPE; + +Exit: + ACPI_FREE (FullPathname); + return_ACPI_STATUS (Status); } ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped) diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index bcc2aa2..59fc7db 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -129,12 +129,23 @@ AcpiPsGetAmlOpcode ( WalkState->Opcode, (UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER))); + ACPI_ERROR ((AE_INFO, + "Aborting disassembly, AML byte code is corrupt")); + /* Dump the context surrounding the invalid opcode */ AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16), 48, DB_BYTE_DISPLAY, (AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16)); AcpiOsPrintf (" */\n"); + + /* + * Just abort the disassembly, cannot continue because the + * parser is essentially lost. The disassembler can then + * randomly fail because an ill-constructed parse tree + * can result. + */ + return_ACPI_STATUS (AE_AML_BAD_OPCODE); #endif } @@ -350,6 +361,10 @@ AcpiPsCreateOp ( { return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); } + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } /* Create Op structure and append to parent's argument list */ diff --git a/source/components/parser/psopcode.c b/source/components/parser/psopcode.c index c355c3d..f7cc9ba 100644 --- a/source/components/parser/psopcode.c +++ b/source/components/parser/psopcode.c @@ -337,7 +337,7 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] = /* ACPI 6.0 opcodes */ -/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), +/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), /* 82 */ ACPI_OP ("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT) /*! [End] no source code translation !*/ diff --git a/source/components/parser/psparse.c b/source/components/parser/psparse.c index 112a4fc..1ac7a18 100644 --- a/source/components/parser/psparse.c +++ b/source/components/parser/psparse.c @@ -56,6 +56,7 @@ #include "acdispat.h" #include "amlcode.h" #include "acinterp.h" +#include "acnamesp.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psparse") @@ -556,8 +557,17 @@ AcpiPsParseAml ( /* Either the method parse or actual execution failed */ AcpiExExitInterpreter (); - ACPI_ERROR_METHOD ("Method parse/execution failed", - WalkState->MethodNode, NULL, Status); + if (Status == AE_ABORT_METHOD) + { + AcpiNsPrintNodePathname ( + WalkState->MethodNode, "Method aborted:"); + AcpiOsPrintf ("\n"); + } + else + { + ACPI_ERROR_METHOD ("Method parse/execution failed", + WalkState->MethodNode, NULL, Status); + } AcpiExEnterInterpreter (); /* Check for possible multi-thread reentrancy problem */ diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c index 4dc06cd..724d4db 100644 --- a/source/components/resources/rscalc.c +++ b/source/components/resources/rscalc.c @@ -363,6 +363,15 @@ AcpiRsGetAmlLength ( break; + case ACPI_RESOURCE_TYPE_PIN_FUNCTION: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + (Resource->Data.PinFunction.PinTableLength * 2) + + Resource->Data.PinFunction.ResourceSource.StringLength + + Resource->Data.PinFunction.VendorLength); + + break; + case ACPI_RESOURCE_TYPE_SERIAL_BUS: @@ -375,6 +384,42 @@ AcpiRsGetAmlLength ( break; + case ACPI_RESOURCE_TYPE_PIN_CONFIG: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + (Resource->Data.PinConfig.PinTableLength * 2) + + Resource->Data.PinConfig.ResourceSource.StringLength + + Resource->Data.PinConfig.VendorLength); + + break; + + case ACPI_RESOURCE_TYPE_PIN_GROUP: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + (Resource->Data.PinGroup.PinTableLength * 2) + + Resource->Data.PinGroup.ResourceLabel.StringLength + + Resource->Data.PinGroup.VendorLength); + + break; + + case ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + Resource->Data.PinGroupFunction.ResourceSource.StringLength + + Resource->Data.PinGroupFunction.ResourceSourceLabel.StringLength + + Resource->Data.PinGroupFunction.VendorLength); + + break; + + case ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + Resource->Data.PinGroupConfig.ResourceSource.StringLength + + Resource->Data.PinGroupConfig.ResourceSourceLabel.StringLength + + Resource->Data.PinGroupConfig.VendorLength); + + break; + default: break; @@ -560,6 +605,26 @@ AcpiRsGetListLength ( } break; + case ACPI_RESOURCE_NAME_PIN_FUNCTION: + + /* Vendor data is optional */ + + if (AmlResource->PinFunction.VendorLength) + { + ExtraStructBytes += + AmlResource->PinFunction.VendorOffset - + AmlResource->PinFunction.PinTableOffset + + AmlResource->PinFunction.VendorLength; + } + else + { + ExtraStructBytes += + AmlResource->LargeHeader.ResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER) - + AmlResource->PinFunction.PinTableOffset; + } + break; + case ACPI_RESOURCE_NAME_SERIAL_BUS: MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[ @@ -569,6 +634,53 @@ AcpiRsGetListLength ( MinimumAmlResourceLength; break; + case ACPI_RESOURCE_NAME_PIN_CONFIG: + + /* Vendor data is optional */ + + if (AmlResource->PinConfig.VendorLength) + { + ExtraStructBytes += + AmlResource->PinConfig.VendorOffset - + AmlResource->PinConfig.PinTableOffset + + AmlResource->PinConfig.VendorLength; + } + else + { + ExtraStructBytes += + AmlResource->LargeHeader.ResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER) - + AmlResource->PinConfig.PinTableOffset; + } + break; + + case ACPI_RESOURCE_NAME_PIN_GROUP: + + ExtraStructBytes += + AmlResource->PinGroup.VendorOffset - + AmlResource->PinGroup.PinTableOffset + + AmlResource->PinGroup.VendorLength; + + break; + + case ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION: + + ExtraStructBytes += + AmlResource->PinGroupFunction.VendorOffset - + AmlResource->PinGroupFunction.ResSourceOffset + + AmlResource->PinGroupFunction.VendorLength; + + break; + + case ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG: + + ExtraStructBytes += + AmlResource->PinGroupConfig.VendorOffset - + AmlResource->PinGroupConfig.ResSourceOffset + + AmlResource->PinGroupConfig.VendorLength; + + break; + default: break; diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c index 6be4986..b3604fe 100644 --- a/source/components/resources/rsdump.c +++ b/source/components/resources/rsdump.c @@ -108,6 +108,11 @@ AcpiRsDumpResourceSource ( ACPI_RESOURCE_SOURCE *ResourceSource); static void +AcpiRsDumpResourceLabel ( + char *Title, + ACPI_RESOURCE_LABEL *ResourceLabel); + +static void AcpiRsDumpAddressCommon ( ACPI_RESOURCE_DATA *Resource); @@ -423,6 +428,22 @@ AcpiRsDumpDescriptor ( ACPI_RESOURCE_SOURCE, Target)); break; + case ACPI_RSD_LABEL: + /* + * ResourceLabel + */ + AcpiRsDumpResourceLabel ("Resource Label", ACPI_CAST_PTR ( + ACPI_RESOURCE_LABEL, Target)); + break; + + case ACPI_RSD_SOURCE_LABEL: + /* + * ResourceSourceLabel + */ + AcpiRsDumpResourceLabel ("Resource Source Label", ACPI_CAST_PTR ( + ACPI_RESOURCE_LABEL, Target)); + break; + default: AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n", @@ -472,6 +493,32 @@ AcpiRsDumpResourceSource ( /******************************************************************************* * + * FUNCTION: AcpiRsDumpResourceLabel + * + * PARAMETERS: Title - Title of the dumped resource field + * ResourceLabel - Pointer to a Resource Label struct + * + * RETURN: None + * + * DESCRIPTION: Common routine for dumping the ResourceLabel + * + ******************************************************************************/ + +static void +AcpiRsDumpResourceLabel ( + char *Title, + ACPI_RESOURCE_LABEL *ResourceLabel) +{ + ACPI_FUNCTION_ENTRY (); + + AcpiRsOutString (Title, + ResourceLabel->StringPtr ? + ResourceLabel->StringPtr : "[Not Specified]"); +} + + +/******************************************************************************* + * * FUNCTION: AcpiRsDumpAddressCommon * * PARAMETERS: Resource - Pointer to an internal resource descriptor diff --git a/source/components/resources/rsdumpinfo.c b/source/components/resources/rsdumpinfo.c index 489a4f4..ef2b9bf 100644 --- a/source/components/resources/rsdumpinfo.c +++ b/source/components/resources/rsdumpinfo.c @@ -252,6 +252,74 @@ ACPI_RSDUMP_INFO AcpiRsDumpGpio[16] = {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (Gpio.VendorData), "VendorData", NULL}, }; +ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[10] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinFunction), "PinFunction", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinFunction.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinFunction.PinConfig), "PinConfig", AcpiGbl_PpcDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinFunction.Sharable), "Sharing", AcpiGbl_ShrDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinFunction.FunctionNumber), "FunctionNumber", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinFunction.ResourceSource), "ResourceSource", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinFunction.PinTableLength), "PinTableLength", NULL}, + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinFunction.PinTable), "PinTable", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinFunction.VendorLength), "VendorLength", NULL}, + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinFunction.VendorData), "VendorData", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[11] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinConfig), "PinConfig", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinConfig.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinConfig.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinConfig.Sharable), "Sharing", AcpiGbl_ShrDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinConfig.PinConfigType), "PinConfigType", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (PinConfig.PinConfigValue), "PinConfigValue", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinConfig.ResourceSource), "ResourceSource", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinConfig.PinTableLength), "PinTableLength", NULL}, + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinConfig.PinTable), "PinTable", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinConfig.VendorLength), "VendorLength", NULL}, + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinConfig.VendorData), "VendorData", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[8] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroup), "PinGroup", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroup.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroup.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroup.PinTableLength), "PinTableLength", NULL}, + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinGroup.PinTable), "PinTable", NULL}, + {ACPI_RSD_LABEL, ACPI_RSD_OFFSET (PinGroup.ResourceLabel), "ResourceLabel", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroup.VendorLength), "VendorLength", NULL}, + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroup.VendorData), "VendorData", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[9] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroupFunction), "PinGroupFunction", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroupFunction.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupFunction.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupFunction.Sharable), "Sharing", AcpiGbl_ShrDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroupFunction.FunctionNumber), "FunctionNumber", NULL}, + {ACPI_RSD_SOURCE_LABEL, ACPI_RSD_OFFSET (PinGroupFunction.ResourceSourceLabel), "ResourceSourceLabel", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinGroupFunction.ResourceSource), "ResourceSource", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroupFunction.VendorLength), "VendorLength", NULL}, + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroupFunction.VendorData), "VendorData", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[10] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroupConfig), "PinGroupConfig", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroupConfig.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupConfig.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupConfig.Sharable), "Sharing", AcpiGbl_ShrDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroupConfig.PinConfigType), "PinConfigType", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (PinGroupConfig.PinConfigValue), "PinConfigValue", NULL}, + {ACPI_RSD_SOURCE_LABEL, ACPI_RSD_OFFSET (PinGroupConfig.ResourceSourceLabel), "ResourceSourceLabel", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinGroupConfig.ResourceSource), "ResourceSource", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroupConfig.VendorLength), "VendorLength", NULL}, + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroupConfig.VendorData), "VendorData", NULL}, +}; + ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[4] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedDma), "FixedDma", NULL}, diff --git a/source/components/resources/rsinfo.c b/source/components/resources/rsinfo.c index b08e218..3f67260 100644 --- a/source/components/resources/rsinfo.c +++ b/source/components/resources/rsinfo.c @@ -84,6 +84,11 @@ ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[] = AcpiRsConvertGpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */ AcpiRsConvertFixedDma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */ NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */ + AcpiRsConvertPinFunction, /* 0x14, ACPI_RESOURCE_TYPE_PIN_FUNCTION */ + AcpiRsConvertPinConfig, /* 0x15, ACPI_RESOURCE_TYPE_PIN_CONFIG */ + AcpiRsConvertPinGroup, /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */ + AcpiRsConvertPinGroupFunction, /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ + AcpiRsConvertPinGroupConfig, /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ }; /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ @@ -124,8 +129,12 @@ ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[] = AcpiRsConvertAddress64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ AcpiRsConvertExtAddress64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ AcpiRsConvertGpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */ - NULL, /* 0x0D, Reserved */ + AcpiRsConvertPinFunction, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */ NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */ + AcpiRsConvertPinConfig, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */ + AcpiRsConvertPinGroup, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */ + AcpiRsConvertPinGroupFunction, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */ + AcpiRsConvertPinGroupConfig, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */ }; /* Subtype table for SerialBus -- I2C, SPI, and UART */ @@ -165,6 +174,11 @@ ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[] = AcpiRsDumpGpio, /* ACPI_RESOURCE_TYPE_GPIO */ AcpiRsDumpFixedDma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */ NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ + AcpiRsDumpPinFunction, /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */ + AcpiRsDumpPinConfig, /* ACPI_RESOURCE_TYPE_PIN_CONFIG */ + AcpiRsDumpPinGroup, /* ACPI_RESOURCE_TYPE_PIN_GROUP */ + AcpiRsDumpPinGroupFunction, /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ + AcpiRsDumpPinGroupConfig, /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ }; ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[] = @@ -204,6 +218,11 @@ const UINT8 AcpiGbl_AmlResourceSizes[] = sizeof (AML_RESOURCE_GPIO), /* ACPI_RESOURCE_TYPE_GPIO */ sizeof (AML_RESOURCE_FIXED_DMA), /* ACPI_RESOURCE_TYPE_FIXED_DMA */ sizeof (AML_RESOURCE_COMMON_SERIALBUS), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ + sizeof (AML_RESOURCE_PIN_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */ + sizeof (AML_RESOURCE_PIN_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_CONFIG */ + sizeof (AML_RESOURCE_PIN_GROUP), /* ACPI_RESOURCE_TYPE_PIN_GROUP */ + sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ + sizeof (AML_RESOURCE_PIN_GROUP_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ }; @@ -243,7 +262,12 @@ const UINT8 AcpiGbl_ResourceStructSizes[] = ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS64), ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64), ACPI_RS_SIZE (ACPI_RESOURCE_GPIO), - ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS) + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION), + ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS), + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG), + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP), + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION), + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG), }; const UINT8 AcpiGbl_AmlResourceSerialBusSizes[] = diff --git a/source/components/resources/rsmisc.c b/source/components/resources/rsmisc.c index 71374b5..eff1732 100644 --- a/source/components/resources/rsmisc.c +++ b/source/components/resources/rsmisc.c @@ -597,10 +597,7 @@ AcpiRsConvertResourceToAml ( /* Set vendor offset only if there is vendor data */ - if (Resource->Data.Gpio.VendorLength) - { - ACPI_SET16 (Target, AmlLength); - } + ACPI_SET16 (Target, AmlLength); AcpiRsSetResourceLength (AmlLength, Aml); break; diff --git a/source/components/resources/rsserial.c b/source/components/resources/rsserial.c index a17fb73..9adbc66 100644 --- a/source/components/resources/rsserial.c +++ b/source/components/resources/rsserial.c @@ -146,6 +146,78 @@ ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] = 0}, }; +/******************************************************************************* + * + * AcpiRsConvertPinfunction + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[13] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_FUNCTION, + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinFunction)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_FUNCTION, + sizeof (AML_RESOURCE_PIN_FUNCTION), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.RevisionId), + AML_OFFSET (PinFunction.RevisionId), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinFunction.Sharable), + AML_OFFSET (PinFunction.Flags), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.PinConfig), + AML_OFFSET (PinFunction.PinConfig), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinFunction.FunctionNumber), + AML_OFFSET (PinFunction.FunctionNumber), + 2}, + + /* Pin Table */ + + /* + * It is OK to use GPIO operations here because none of them refer GPIO + * structures directly but instead use offsets given here. + */ + + {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTableLength), + AML_OFFSET (PinFunction.PinTableOffset), + AML_OFFSET (PinFunction.ResSourceOffset)}, + + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTable), + AML_OFFSET (PinFunction.PinTableOffset), + 0}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.Index), + AML_OFFSET (PinFunction.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringLength), + AML_OFFSET (PinFunction.ResSourceOffset), + AML_OFFSET (PinFunction.VendorOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringPtr), + AML_OFFSET (PinFunction.ResSourceOffset), + 0}, + + /* Vendor Data */ + + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinFunction.VendorLength), + AML_OFFSET (PinFunction.VendorLength), + 1}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.VendorData), + AML_OFFSET (PinFunction.VendorOffset), + 0}, +}; + /******************************************************************************* * @@ -437,3 +509,278 @@ ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[23] = AML_OFFSET (UartSerialBus.DefaultBaudRate), 1}, }; + + +/******************************************************************************* + * + * AcpiRsConvertPinConfig + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[14] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_CONFIG, + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_CONFIG, + sizeof (AML_RESOURCE_PIN_CONFIG), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.RevisionId), + AML_OFFSET (PinConfig.RevisionId), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Sharable), + AML_OFFSET (PinConfig.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer), + AML_OFFSET (PinConfig.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.PinConfigType), + AML_OFFSET (PinConfig.PinConfigType), + 1}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue), + AML_OFFSET (PinConfig.PinConfigValue), + 1}, + + /* Pin Table */ + + /* + * It is OK to use GPIO operations here because none of them refer GPIO + * structures directly but instead use offsets given here. + */ + + {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength), + AML_OFFSET (PinConfig.PinTableOffset), + AML_OFFSET (PinConfig.ResSourceOffset)}, + + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable), + AML_OFFSET (PinConfig.PinTableOffset), + 0}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index), + AML_OFFSET (PinConfig.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength), + AML_OFFSET (PinConfig.ResSourceOffset), + AML_OFFSET (PinConfig.VendorOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr), + AML_OFFSET (PinConfig.ResSourceOffset), + 0}, + + /* Vendor Data */ + + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinConfig.VendorLength), + AML_OFFSET (PinConfig.VendorLength), + 1}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.VendorData), + AML_OFFSET (PinConfig.VendorOffset), + 0}, +}; + +/******************************************************************************* + * + * AcpiRsConvertPinGroup + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[10] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP, + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP, + sizeof (AML_RESOURCE_PIN_GROUP), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroup.RevisionId), + AML_OFFSET (PinGroup.RevisionId), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer), + AML_OFFSET (PinGroup.Flags), + 0}, + + /* Pin Table */ + + /* + * It is OK to use GPIO operations here because none of them refer GPIO + * structures directly but instead use offsets given here. + */ + + {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength), + AML_OFFSET (PinGroup.PinTableOffset), + AML_OFFSET (PinGroup.LabelOffset)}, + + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable), + AML_OFFSET (PinGroup.PinTableOffset), + 0}, + + /* Resource Label */ + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength), + AML_OFFSET (PinGroup.LabelOffset), + AML_OFFSET (PinGroup.VendorOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr), + AML_OFFSET (PinGroup.LabelOffset), + 0}, + + /* Vendor Data */ + + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroup.VendorLength), + AML_OFFSET (PinGroup.VendorLength), + 1}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.VendorData), + AML_OFFSET (PinGroup.VendorOffset), + 0}, +}; + +/******************************************************************************* + * + * AcpiRsConvertPinGroupFunction + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[13] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION, + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION, + sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId), + AML_OFFSET (PinGroupFunction.RevisionId), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Sharable), + AML_OFFSET (PinGroupFunction.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer), + AML_OFFSET (PinGroupFunction.Flags), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber), + AML_OFFSET (PinGroupFunction.FunctionNumber), + 1}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index), + AML_OFFSET (PinGroupFunction.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength), + AML_OFFSET (PinGroupFunction.ResSourceOffset), + AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr), + AML_OFFSET (PinGroupFunction.ResSourceOffset), + 0}, + + /* Resource Source Label */ + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength), + AML_OFFSET (PinGroupFunction.ResSourceLabelOffset), + AML_OFFSET (PinGroupFunction.VendorOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr), + AML_OFFSET (PinGroupFunction.ResSourceLabelOffset), + 0}, + + /* Vendor Data */ + + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength), + AML_OFFSET (PinGroupFunction.VendorLength), + 1}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData), + AML_OFFSET (PinGroupFunction.VendorOffset), + 0}, +}; + +/******************************************************************************* + * + * AcpiRsConvertPinGroupConfig + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[14] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG, + ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG, + sizeof (AML_RESOURCE_PIN_GROUP_CONFIG), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId), + AML_OFFSET (PinGroupConfig.RevisionId), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Sharable), + AML_OFFSET (PinGroupConfig.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer), + AML_OFFSET (PinGroupConfig.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType), + AML_OFFSET (PinGroupConfig.PinConfigType), + 1}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue), + AML_OFFSET (PinGroupConfig.PinConfigValue), + 1}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index), + AML_OFFSET (PinGroupConfig.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength), + AML_OFFSET (PinGroupConfig.ResSourceOffset), + AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr), + AML_OFFSET (PinGroupConfig.ResSourceOffset), + 0}, + + /* Resource Source Label */ + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength), + AML_OFFSET (PinGroupConfig.ResSourceLabelOffset), + AML_OFFSET (PinGroupConfig.VendorOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr), + AML_OFFSET (PinGroupConfig.ResSourceLabelOffset), + 0}, + + /* Vendor Data */ + + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength), + AML_OFFSET (PinGroupConfig.VendorLength), + 1}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData), + AML_OFFSET (PinGroupConfig.VendorOffset), + 0}, +}; diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c index acec947..4411979 100644 --- a/source/components/tables/tbfadt.c +++ b/source/components/tables/tbfadt.c @@ -489,8 +489,8 @@ AcpiTbCreateLocalFadt ( * The 64-bit X fields are optional extensions to the original 32-bit FADT * V1.0 fields. Even if they are present in the FADT, they are optional and * are unused if the BIOS sets them to zero. Therefore, we must copy/expand - * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is - * originally zero. + * 32-bit V1.0 fields to the 64-bit X fields if the 64-bit X field is originally + * zero. * * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address * fields are expanded to the corresponding 64-bit X fields in the internal diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index 904dca8..006e8d9 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -149,9 +149,9 @@ AcpiTbCheckDsdtHeader ( * * FUNCTION: AcpiTbCopyDsdt * - * PARAMETERS: TableDesc - Installed table to copy + * PARAMETERS: TableIndex - Index of installed table to copy * - * RETURN: None + * RETURN: The copied DSDT * * DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory. * Some very bad BIOSs are known to either corrupt the DSDT or @@ -260,7 +260,7 @@ AcpiTbGetRootTableEntry ( * * FUNCTION: AcpiTbParseRootTable * - * PARAMETERS: Rsdp - Pointer to the RSDP + * PARAMETERS: RsdpAddress - Pointer to the RSDP * * RETURN: Status * diff --git a/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c index 80ca7f6..16b70a9 100644 --- a/source/components/utilities/utdecode.c +++ b/source/components/utilities/utdecode.c @@ -521,8 +521,9 @@ static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] /* 09 */ "Device PLD Check", /* 0A */ "Reserved", /* 0B */ "System Locality Update", - /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */ - /* 0D */ "System Resource Affinity Update" + /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved in ACPI 6.0 */ + /* 0D */ "System Resource Affinity Update", + /* 0E */ "Heterogeneous Memory Attributes Update" /* ACPI 6.2 */ }; static const char *AcpiGbl_DeviceNotify[5] = diff --git a/source/components/utilities/utownerid.c b/source/components/utilities/utownerid.c index cfe9d76..40cdff6 100644 --- a/source/components/utilities/utownerid.c +++ b/source/components/utilities/utownerid.c @@ -117,14 +117,20 @@ AcpiUtAllocateOwnerId ( break; } - if (!(AcpiGbl_OwnerIdMask[j] & (1 << k))) + /* + * Note: the UINT32 cast ensures that 1 is stored as a unsigned + * integer. Omitting the cast may result in 1 being stored as an + * int. Some compilers or runtime error detection may flag this as + * an error. + */ + if (!(AcpiGbl_OwnerIdMask[j] & ((UINT32) 1 << k))) { /* * Found a free ID. The actual ID is the bit index plus one, * making zero an invalid Owner ID. Save this as the last ID * allocated and update the global ID mask. */ - AcpiGbl_OwnerIdMask[j] |= (1 << k); + AcpiGbl_OwnerIdMask[j] |= ((UINT32) 1 << k); AcpiGbl_LastOwnerIdIndex = (UINT8) j; AcpiGbl_NextOwnerIdOffset = (UINT8) (k + 1); @@ -220,7 +226,7 @@ AcpiUtReleaseOwnerId ( /* Decode ID to index/offset pair */ Index = ACPI_DIV_32 (OwnerId); - Bit = 1 << ACPI_MOD_32 (OwnerId); + Bit = (UINT32) 1 << ACPI_MOD_32 (OwnerId); /* Free the owner ID only if it is valid */ diff --git a/source/components/utilities/utresdecode.c b/source/components/utilities/utresdecode.c new file mode 100644 index 0000000..c221600 --- /dev/null +++ b/source/components/utilities/utresdecode.c @@ -0,0 +1,353 @@ +/******************************************************************************* + * + * Module Name: utresdecode - Resource descriptor keyword strings + * + ******************************************************************************/ + +/* + * Copyright (C) 2000 - 2017, 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" +#include "acresrc.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utresdecode") + + +#if defined (ACPI_DEBUG_OUTPUT) || \ + defined (ACPI_DISASSEMBLER) || \ + defined (ACPI_DEBUGGER) + +/* + * Strings used to decode resource descriptors. + * Used by both the disassembler and the debugger resource dump routines + */ +const char *AcpiGbl_BmDecode[] = +{ + "NotBusMaster", + "BusMaster" +}; + +const char *AcpiGbl_ConfigDecode[] = +{ + "0 - Good Configuration", + "1 - Acceptable Configuration", + "2 - Suboptimal Configuration", + "3 - ***Invalid Configuration***", +}; + +const char *AcpiGbl_ConsumeDecode[] = +{ + "ResourceProducer", + "ResourceConsumer" +}; + +const char *AcpiGbl_DecDecode[] = +{ + "PosDecode", + "SubDecode" +}; + +const char *AcpiGbl_HeDecode[] = +{ + "Level", + "Edge" +}; + +const char *AcpiGbl_IoDecode[] = +{ + "Decode10", + "Decode16" +}; + +const char *AcpiGbl_LlDecode[] = +{ + "ActiveHigh", + "ActiveLow", + "ActiveBoth", + "Reserved" +}; + +const char *AcpiGbl_MaxDecode[] = +{ + "MaxNotFixed", + "MaxFixed" +}; + +const char *AcpiGbl_MemDecode[] = +{ + "NonCacheable", + "Cacheable", + "WriteCombining", + "Prefetchable" +}; + +const char *AcpiGbl_MinDecode[] = +{ + "MinNotFixed", + "MinFixed" +}; + +const char *AcpiGbl_MtpDecode[] = +{ + "AddressRangeMemory", + "AddressRangeReserved", + "AddressRangeACPI", + "AddressRangeNVS" +}; + +const char *AcpiGbl_RngDecode[] = +{ + "InvalidRanges", + "NonISAOnlyRanges", + "ISAOnlyRanges", + "EntireRange" +}; + +const char *AcpiGbl_RwDecode[] = +{ + "ReadOnly", + "ReadWrite" +}; + +const char *AcpiGbl_ShrDecode[] = +{ + "Exclusive", + "Shared", + "ExclusiveAndWake", /* ACPI 5.0 */ + "SharedAndWake" /* ACPI 5.0 */ +}; + +const char *AcpiGbl_SizDecode[] = +{ + "Transfer8", + "Transfer8_16", + "Transfer16", + "InvalidSize" +}; + +const char *AcpiGbl_TrsDecode[] = +{ + "DenseTranslation", + "SparseTranslation" +}; + +const char *AcpiGbl_TtpDecode[] = +{ + "TypeStatic", + "TypeTranslation" +}; + +const char *AcpiGbl_TypDecode[] = +{ + "Compatibility", + "TypeA", + "TypeB", + "TypeF" +}; + +const char *AcpiGbl_PpcDecode[] = +{ + "PullDefault", + "PullUp", + "PullDown", + "PullNone" +}; + +const char *AcpiGbl_IorDecode[] = +{ + "IoRestrictionNone", + "IoRestrictionInputOnly", + "IoRestrictionOutputOnly", + "IoRestrictionNoneAndPreserve" +}; + +const char *AcpiGbl_DtsDecode[] = +{ + "Width8bit", + "Width16bit", + "Width32bit", + "Width64bit", + "Width128bit", + "Width256bit", +}; + +/* GPIO connection type */ + +const char *AcpiGbl_CtDecode[] = +{ + "Interrupt", + "I/O" +}; + +/* Serial bus type */ + +const char *AcpiGbl_SbtDecode[] = +{ + "/* UNKNOWN serial bus type */", + "I2C", + "SPI", + "UART" +}; + +/* I2C serial bus access mode */ + +const char *AcpiGbl_AmDecode[] = +{ + "AddressingMode7Bit", + "AddressingMode10Bit" +}; + +/* I2C serial bus slave mode */ + +const char *AcpiGbl_SmDecode[] = +{ + "ControllerInitiated", + "DeviceInitiated" +}; + +/* SPI serial bus wire mode */ + +const char *AcpiGbl_WmDecode[] = +{ + "FourWireMode", + "ThreeWireMode" +}; + +/* SPI serial clock phase */ + +const char *AcpiGbl_CphDecode[] = +{ + "ClockPhaseFirst", + "ClockPhaseSecond" +}; + +/* SPI serial bus clock polarity */ + +const char *AcpiGbl_CpoDecode[] = +{ + "ClockPolarityLow", + "ClockPolarityHigh" +}; + +/* SPI serial bus device polarity */ + +const char *AcpiGbl_DpDecode[] = +{ + "PolarityLow", + "PolarityHigh" +}; + +/* UART serial bus endian */ + +const char *AcpiGbl_EdDecode[] = +{ + "LittleEndian", + "BigEndian" +}; + +/* UART serial bus bits per byte */ + +const char *AcpiGbl_BpbDecode[] = +{ + "DataBitsFive", + "DataBitsSix", + "DataBitsSeven", + "DataBitsEight", + "DataBitsNine", + "/* UNKNOWN Bits per byte */", + "/* UNKNOWN Bits per byte */", + "/* UNKNOWN Bits per byte */" +}; + +/* UART serial bus stop bits */ + +const char *AcpiGbl_SbDecode[] = +{ + "StopBitsZero", + "StopBitsOne", + "StopBitsOnePlusHalf", + "StopBitsTwo" +}; + +/* UART serial bus flow control */ + +const char *AcpiGbl_FcDecode[] = +{ + "FlowControlNone", + "FlowControlHardware", + "FlowControlXON", + "/* UNKNOWN flow control keyword */" +}; + +/* UART serial bus parity type */ + +const char *AcpiGbl_PtDecode[] = +{ + "ParityTypeNone", + "ParityTypeEven", + "ParityTypeOdd", + "ParityTypeMark", + "ParityTypeSpace", + "/* UNKNOWN parity keyword */", + "/* UNKNOWN parity keyword */", + "/* UNKNOWN parity keyword */" +}; + +/* PinConfig type */ + +const char *AcpiGbl_PtypDecode[] = +{ + "Default", + "Bias Pull-up", + "Bias Pull-down", + "Bias Default", + "Bias Disable", + "Bias High Impedance", + "Bias Bus Hold", + "Drive Open Drain", + "Drive Open Source", + "Drive Push Pull", + "Drive Strength", + "Slew Rate", + "Input Debounce", + "Input Schmitt Trigger", +}; + +#endif diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c index f3cd77c..2a32078 100644 --- a/source/components/utilities/utresrc.c +++ b/source/components/utilities/utresrc.c @@ -50,287 +50,6 @@ ACPI_MODULE_NAME ("utresrc") -#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) - -/* - * Strings used to decode resource descriptors. - * Used by both the disassembler and the debugger resource dump routines - */ -const char *AcpiGbl_BmDecode[] = -{ - "NotBusMaster", - "BusMaster" -}; - -const char *AcpiGbl_ConfigDecode[] = -{ - "0 - Good Configuration", - "1 - Acceptable Configuration", - "2 - Suboptimal Configuration", - "3 - ***Invalid Configuration***", -}; - -const char *AcpiGbl_ConsumeDecode[] = -{ - "ResourceProducer", - "ResourceConsumer" -}; - -const char *AcpiGbl_DecDecode[] = -{ - "PosDecode", - "SubDecode" -}; - -const char *AcpiGbl_HeDecode[] = -{ - "Level", - "Edge" -}; - -const char *AcpiGbl_IoDecode[] = -{ - "Decode10", - "Decode16" -}; - -const char *AcpiGbl_LlDecode[] = -{ - "ActiveHigh", - "ActiveLow", - "ActiveBoth", - "Reserved" -}; - -const char *AcpiGbl_MaxDecode[] = -{ - "MaxNotFixed", - "MaxFixed" -}; - -const char *AcpiGbl_MemDecode[] = -{ - "NonCacheable", - "Cacheable", - "WriteCombining", - "Prefetchable" -}; - -const char *AcpiGbl_MinDecode[] = -{ - "MinNotFixed", - "MinFixed" -}; - -const char *AcpiGbl_MtpDecode[] = -{ - "AddressRangeMemory", - "AddressRangeReserved", - "AddressRangeACPI", - "AddressRangeNVS" -}; - -const char *AcpiGbl_RngDecode[] = -{ - "InvalidRanges", - "NonISAOnlyRanges", - "ISAOnlyRanges", - "EntireRange" -}; - -const char *AcpiGbl_RwDecode[] = -{ - "ReadOnly", - "ReadWrite" -}; - -const char *AcpiGbl_ShrDecode[] = -{ - "Exclusive", - "Shared", - "ExclusiveAndWake", /* ACPI 5.0 */ - "SharedAndWake" /* ACPI 5.0 */ -}; - -const char *AcpiGbl_SizDecode[] = -{ - "Transfer8", - "Transfer8_16", - "Transfer16", - "InvalidSize" -}; - -const char *AcpiGbl_TrsDecode[] = -{ - "DenseTranslation", - "SparseTranslation" -}; - -const char *AcpiGbl_TtpDecode[] = -{ - "TypeStatic", - "TypeTranslation" -}; - -const char *AcpiGbl_TypDecode[] = -{ - "Compatibility", - "TypeA", - "TypeB", - "TypeF" -}; - -const char *AcpiGbl_PpcDecode[] = -{ - "PullDefault", - "PullUp", - "PullDown", - "PullNone" -}; - -const char *AcpiGbl_IorDecode[] = -{ - "IoRestrictionNone", - "IoRestrictionInputOnly", - "IoRestrictionOutputOnly", - "IoRestrictionNoneAndPreserve" -}; - -const char *AcpiGbl_DtsDecode[] = -{ - "Width8bit", - "Width16bit", - "Width32bit", - "Width64bit", - "Width128bit", - "Width256bit", -}; - -/* GPIO connection type */ - -const char *AcpiGbl_CtDecode[] = -{ - "Interrupt", - "I/O" -}; - -/* Serial bus type */ - -const char *AcpiGbl_SbtDecode[] = -{ - "/* UNKNOWN serial bus type */", - "I2C", - "SPI", - "UART" -}; - -/* I2C serial bus access mode */ - -const char *AcpiGbl_AmDecode[] = -{ - "AddressingMode7Bit", - "AddressingMode10Bit" -}; - -/* I2C serial bus slave mode */ - -const char *AcpiGbl_SmDecode[] = -{ - "ControllerInitiated", - "DeviceInitiated" -}; - -/* SPI serial bus wire mode */ - -const char *AcpiGbl_WmDecode[] = -{ - "FourWireMode", - "ThreeWireMode" -}; - -/* SPI serial clock phase */ - -const char *AcpiGbl_CphDecode[] = -{ - "ClockPhaseFirst", - "ClockPhaseSecond" -}; - -/* SPI serial bus clock polarity */ - -const char *AcpiGbl_CpoDecode[] = -{ - "ClockPolarityLow", - "ClockPolarityHigh" -}; - -/* SPI serial bus device polarity */ - -const char *AcpiGbl_DpDecode[] = -{ - "PolarityLow", - "PolarityHigh" -}; - -/* UART serial bus endian */ - -const char *AcpiGbl_EdDecode[] = -{ - "LittleEndian", - "BigEndian" -}; - -/* UART serial bus bits per byte */ - -const char *AcpiGbl_BpbDecode[] = -{ - "DataBitsFive", - "DataBitsSix", - "DataBitsSeven", - "DataBitsEight", - "DataBitsNine", - "/* UNKNOWN Bits per byte */", - "/* UNKNOWN Bits per byte */", - "/* UNKNOWN Bits per byte */" -}; - -/* UART serial bus stop bits */ - -const char *AcpiGbl_SbDecode[] = -{ - "StopBitsZero", - "StopBitsOne", - "StopBitsOnePlusHalf", - "StopBitsTwo" -}; - -/* UART serial bus flow control */ - -const char *AcpiGbl_FcDecode[] = -{ - "FlowControlNone", - "FlowControlHardware", - "FlowControlXON", - "/* UNKNOWN flow control keyword */" -}; - -/* UART serial bus parity type */ - -const char *AcpiGbl_PtDecode[] = -{ - "ParityTypeNone", - "ParityTypeEven", - "ParityTypeOdd", - "ParityTypeMark", - "ParityTypeSpace", - "/* UNKNOWN parity keyword */", - "/* UNKNOWN parity keyword */", - "/* UNKNOWN parity keyword */" -}; - -#endif - - /* * Base sizes of the raw AML resource descriptors, indexed by resource type. * Zero indicates a reserved (and therefore invalid) resource type. @@ -371,8 +90,12 @@ const UINT8 AcpiGbl_ResourceAmlSizes[] = ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS64), ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64), ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO), - 0, + ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_FUNCTION), ACPI_AML_SIZE_LARGE (AML_RESOURCE_COMMON_SERIALBUS), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_CONFIG), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_FUNCTION), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_CONFIG), }; const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[] = @@ -426,8 +149,12 @@ static const UINT8 AcpiGbl_ResourceTypes[] = ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ ACPI_FIXED_LENGTH, /* 0B Extended* address */ ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ - 0, - ACPI_VARIABLE_LENGTH /* 0E *SerialBus */ + ACPI_VARIABLE_LENGTH, /* 0D PinFunction */ + ACPI_VARIABLE_LENGTH, /* 0E *SerialBus */ + ACPI_VARIABLE_LENGTH, /* 0F PinConfig */ + ACPI_VARIABLE_LENGTH, /* 10 PinGroup */ + ACPI_VARIABLE_LENGTH, /* 11 PinGroupFunction */ + ACPI_VARIABLE_LENGTH, /* 12 PinGroupConfig */ }; @@ -472,7 +199,7 @@ AcpiUtWalkAmlResources ( * The absolute minimum resource template is one EndTag descriptor. * However, we will treat a lone EndTag as just a simple buffer. */ - if (AmlLength < sizeof (AML_RESOURCE_END_TAG)) + if (AmlLength <= sizeof (AML_RESOURCE_END_TAG)) { return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } @@ -505,8 +232,8 @@ AcpiUtWalkAmlResources ( if (UserFunction) { - Status = UserFunction (Aml, Length, Offset, - ResourceIndex, Context); + Status = UserFunction ( + Aml, Length, Offset, ResourceIndex, Context); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -543,15 +270,10 @@ AcpiUtWalkAmlResources ( *Context = Aml; } - /* Check if buffer is defined to be longer than the resource length */ - - if (AmlLength > (Offset + Length)) - { - return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); - } - - /* Normal exit */ - + /* + * Normal exit. Note: We allow the buffer to be larger than + * the resource template, as long as the END_TAG exists. + */ return_ACPI_STATUS (AE_OK); } diff --git a/source/components/utilities/utxfmutex.c b/source/components/utilities/utxfmutex.c index 3aa3753..1488631 100644 --- a/source/components/utilities/utxfmutex.c +++ b/source/components/utilities/utxfmutex.c @@ -169,6 +169,8 @@ AcpiAcquireMutex ( return (Status); } +ACPI_EXPORT_SYMBOL (AcpiAcquireMutex) + /******************************************************************************* * @@ -209,3 +211,5 @@ AcpiReleaseMutex ( AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex); return (AE_OK); } + +ACPI_EXPORT_SYMBOL (AcpiReleaseMutex) diff --git a/source/include/acapps.h b/source/include/acapps.h index ebc1cfb..38afbf3 100644 --- a/source/include/acapps.h +++ b/source/include/acapps.h @@ -186,7 +186,7 @@ AcpiDmFinishNamespaceLoad ( ACPI_OWNER_ID OwnerId); void -AcpiDmConvertResourceIndexes ( +AcpiDmConvertParseObjects ( ACPI_PARSE_OBJECT *ParseTreeRoot, ACPI_NAMESPACE_NODE *NamespaceRoot); diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index b9b03d3..8d997c7 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -99,6 +99,11 @@ typedef enum ACPI_DMT_FLAGS1, ACPI_DMT_FLAGS2, ACPI_DMT_FLAGS4, + ACPI_DMT_FLAGS4_0, + ACPI_DMT_FLAGS4_4, + ACPI_DMT_FLAGS4_8, + ACPI_DMT_FLAGS4_12, + ACPI_DMT_FLAGS16_16, ACPI_DMT_UINT8, ACPI_DMT_UINT16, ACPI_DMT_UINT24, @@ -149,6 +154,7 @@ typedef enum ACPI_DMT_HEST, ACPI_DMT_HESTNTFY, ACPI_DMT_HESTNTYP, + ACPI_DMT_HMAT, ACPI_DMT_IORTMEM, ACPI_DMT_IVRS, ACPI_DMT_LPIT, @@ -156,6 +162,7 @@ typedef enum ACPI_DMT_NFIT, ACPI_DMT_PCCT, ACPI_DMT_PMTT, + ACPI_DMT_PPTT, ACPI_DMT_SLIC, ACPI_DMT_SRAT, @@ -304,12 +311,22 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest11[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1a[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1b[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1c[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2a[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0a[]; @@ -387,6 +404,13 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct4[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0a[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPpttHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRasf[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; @@ -405,6 +429,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoStao[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[]; @@ -421,6 +446,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoWsmt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2]; @@ -533,6 +559,10 @@ AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table); void +AcpiDmDumpHmat ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpIort ( ACPI_TABLE_HEADER *Table); @@ -576,6 +606,10 @@ void AcpiDmDumpPmtt ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpPptt ( + ACPI_TABLE_HEADER *Table); + UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table); @@ -651,10 +685,6 @@ AcpiDmDisassembleOneOp ( ACPI_OP_WALK_INFO *Info, ACPI_PARSE_OBJECT *Op); -BOOLEAN -AcpiDmIsTempName ( - ACPI_PARSE_OBJECT *Op); - UINT32 AcpiDmListType ( ACPI_PARSE_OBJECT *Op); @@ -780,6 +810,12 @@ AcpiDmAddOpToExternalList ( UINT16 Flags); void +AcpiDmCreateSubobjectForExternal ( + UINT8 Type, + ACPI_NAMESPACE_NODE **Node, + UINT32 Value); + +void AcpiDmAddNodeToExternalList ( ACPI_NAMESPACE_NODE *Node, UINT8 Type, @@ -787,11 +823,17 @@ AcpiDmAddNodeToExternalList ( UINT16 Flags); void -AcpiDmAddExternalsToNamespace ( +AcpiDmAddExternalListToNamespace ( void); +void +AcpiDmAddOneExternalToNamespace ( + char *Path, + UINT8 Type, + UINT32 Value); + UINT32 -AcpiDmGetExternalMethodCount ( +AcpiDmGetUnresolvedExternalMethodCount ( void); void @@ -815,6 +857,11 @@ void AcpiDmGetExternalsFromFile ( void); +void +AcpiDmMarkExternalConflict ( + ACPI_NAMESPACE_NODE *Node); + + /* * dmresrc */ @@ -940,6 +987,41 @@ AcpiDmGpioDescriptor ( UINT32 Level); void +AcpiDmPinFunctionDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void +AcpiDmPinConfigDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void +AcpiDmPinGroupDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void +AcpiDmPinGroupFunctionDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void +AcpiDmPinGroupConfigDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void AcpiDmSerialBusDescriptor ( ACPI_OP_WALK_INFO *Info, AML_RESOURCE *Resource, @@ -1063,6 +1145,17 @@ AcpiDmCloseOperator ( /* * dmtables */ +ACPI_STATUS +AcpiDmProcessSwitch ( + ACPI_PARSE_OBJECT *Op); + +void +AcpiDmClearTempList( + void); + +/* + * dmtables + */ void AdDisassemblerHeader ( char *Filename, diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 3dfbe42..aa66f90 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -319,6 +319,7 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmEmitExternalOpcodes, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DoDisassemblerOptimizations, TRUE); +ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT_LIST, *AcpiGbl_TempListHead, NULL); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm); ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing); @@ -372,6 +373,8 @@ ACPI_GLOBAL (const char, *AcpiGbl_PldVerticalPositionList[]); ACPI_GLOBAL (const char, *AcpiGbl_PldHorizontalPositionList[]); ACPI_GLOBAL (const char, *AcpiGbl_PldShapeList[]); +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DisasmFlag, FALSE); + #endif /* diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 47c5f8f..21019ed 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -1028,7 +1028,7 @@ typedef struct acpi_parse_obj_common typedef struct acpi_parse_obj_named { ACPI_PARSE_COMMON - UINT8 *Path; + char *Path; UINT8 *Data; /* AML body or bytelist data */ UINT32 Length; /* AML length */ UINT32 Name; /* 4-byte name or zero if no name */ @@ -1336,8 +1336,13 @@ typedef struct acpi_port_info #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B #define ACPI_RESOURCE_NAME_GPIO 0x8C +#define ACPI_RESOURCE_NAME_PIN_FUNCTION 0x8D #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E -#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E +#define ACPI_RESOURCE_NAME_PIN_CONFIG 0x8F +#define ACPI_RESOURCE_NAME_PIN_GROUP 0x90 +#define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91 +#define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92 +#define ACPI_RESOURCE_NAME_LARGE_MAX 0x92 /***************************************************************************** @@ -1374,6 +1379,7 @@ typedef struct acpi_external_list #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ #define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */ #define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */ +#define ACPI_EXT_CONFLICTING_DECLARATION 0x20 /* External has a conflicting declaration within AML */ typedef struct acpi_external_file @@ -1384,6 +1390,13 @@ typedef struct acpi_external_file } ACPI_EXTERNAL_FILE; +typedef struct acpi_parse_object_list +{ + ACPI_PARSE_OBJECT *Op; + struct acpi_parse_object_list *Next; + +} ACPI_PARSE_OBJECT_LIST; + /***************************************************************************** * * Debugger diff --git a/source/include/acopcode.h b/source/include/acopcode.h index 336d146..ad8de5f 100644 --- a/source/include/acopcode.h +++ b/source/include/acopcode.h @@ -113,7 +113,7 @@ #define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) #define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST) #define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME) -#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA) +#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAME, ARGP_BYTEDATA, ARGP_BYTEDATA) #define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG) #define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST) #define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 60ea725..526705e 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 0x20170303 +#define ACPI_CA_VERSION 0x20170531 #include "acconfig.h" #include "actypes.h" diff --git a/source/include/acpredef.h b/source/include/acpredef.h index bc89d72..08a08e1 100644 --- a/source/include/acpredef.h +++ b/source/include/acpredef.h @@ -574,6 +574,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = {{"_HID", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}}, + {{"_HMA", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + {{"_HOT", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, @@ -618,6 +621,17 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 3, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 10,0), + {{"_LSI", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0,0,0), + + {{"_LSR", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 1, ACPI_RTYPE_BUFFER, 1,0), + + {{"_LSW", METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_BUFFER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_MAT", METHOD_0ARGS, METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, diff --git a/source/include/acresrc.h b/source/include/acresrc.h index c2a013c..128ddca 100644 --- a/source/include/acresrc.h +++ b/source/include/acresrc.h @@ -155,7 +155,9 @@ typedef enum ACPI_RSD_UINT16, ACPI_RSD_UINT32, ACPI_RSD_UINT64, - ACPI_RSD_WORDLIST + ACPI_RSD_WORDLIST, + ACPI_RSD_LABEL, + ACPI_RSD_SOURCE_LABEL, } ACPI_RSDUMP_OPCODES; @@ -387,6 +389,11 @@ extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[]; /* These resources require separate get/set tables */ @@ -431,12 +438,17 @@ extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[]; extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[]; extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[]; extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[]; extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[]; extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[]; extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[]; extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[]; extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[]; extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[]; #endif #endif /* __ACRESRC_H__ */ diff --git a/source/include/acrestyp.h b/source/include/acrestyp.h index 1c8f70c..cc41102 100644 --- a/source/include/acrestyp.h +++ b/source/include/acrestyp.h @@ -327,6 +327,13 @@ typedef union acpi_resource_attribute } ACPI_RESOURCE_ATTRIBUTE; +typedef struct acpi_resource_label +{ + UINT16 StringLength; + char *StringPtr; + +} ACPI_RESOURCE_LABEL; + typedef struct acpi_resource_source { UINT8 Index; @@ -617,6 +624,90 @@ typedef struct acpi_resource_uart_serialbus #define ACPI_UART_CLEAR_TO_SEND (1<<6) #define ACPI_UART_REQUEST_TO_SEND (1<<7) +typedef struct acpi_resource_pin_function +{ + UINT8 RevisionId; + UINT8 PinConfig; + UINT8 Sharable; /* For values, see Interrupt Attributes above */ + UINT16 FunctionNumber; + UINT16 PinTableLength; + UINT16 VendorLength; + ACPI_RESOURCE_SOURCE ResourceSource; + UINT16 *PinTable; + UINT8 *VendorData; + +} ACPI_RESOURCE_PIN_FUNCTION; + +typedef struct acpi_resource_pin_config +{ + UINT8 RevisionId; + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */ + UINT8 Sharable; /* For values, see Interrupt Attributes above */ + UINT8 PinConfigType; + UINT32 PinConfigValue; + UINT16 PinTableLength; + UINT16 VendorLength; + ACPI_RESOURCE_SOURCE ResourceSource; + UINT16 *PinTable; + UINT8 *VendorData; + +} ACPI_RESOURCE_PIN_CONFIG; + +/* Values for PinConfigType field above */ + +#define ACPI_PIN_CONFIG_DEFAULT 0 +#define ACPI_PIN_CONFIG_BIAS_PULL_UP 1 +#define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2 +#define ACPI_PIN_CONFIG_BIAS_DEFAULT 3 +#define ACPI_PIN_CONFIG_BIAS_DISABLE 4 +#define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5 +#define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6 +#define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7 +#define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8 +#define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9 +#define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10 +#define ACPI_PIN_CONFIG_SLEW_RATE 11 +#define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12 +#define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13 + +typedef struct acpi_resource_pin_group +{ + UINT8 RevisionId; + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */ + UINT16 PinTableLength; + UINT16 VendorLength; + UINT16 *PinTable; + ACPI_RESOURCE_LABEL ResourceLabel; + UINT8 *VendorData; + +} ACPI_RESOURCE_PIN_GROUP; + +typedef struct acpi_resource_pin_group_function +{ + UINT8 RevisionId; + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */ + UINT8 Sharable; /* For values, see Interrupt Attributes above */ + UINT16 FunctionNumber; + UINT16 VendorLength; + ACPI_RESOURCE_SOURCE ResourceSource; + ACPI_RESOURCE_LABEL ResourceSourceLabel; + UINT8 *VendorData; + +} ACPI_RESOURCE_PIN_GROUP_FUNCTION; + +typedef struct acpi_resource_pin_group_config +{ + UINT8 RevisionId; + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */ + UINT8 Sharable; /* For values, see Interrupt Attributes above */ + UINT8 PinConfigType; /* For values, see PinConfigType above */ + UINT32 PinConfigValue; + UINT16 VendorLength; + ACPI_RESOURCE_SOURCE ResourceSource; + ACPI_RESOURCE_LABEL ResourceSourceLabel; + UINT8 *VendorData; + +} ACPI_RESOURCE_PIN_GROUP_CONFIG; /* ACPI_RESOURCE_TYPEs */ @@ -640,7 +731,12 @@ typedef struct acpi_resource_uart_serialbus #define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */ #define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */ #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */ -#define ACPI_RESOURCE_TYPE_MAX 19 +#define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */ +#define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */ +#define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */ +#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */ +#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */ +#define ACPI_RESOURCE_TYPE_MAX 24 /* Master union for resource descriptors */ @@ -669,6 +765,11 @@ typedef union acpi_resource_data ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus; ACPI_RESOURCE_UART_SERIALBUS UartSerialBus; ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus; + ACPI_RESOURCE_PIN_FUNCTION PinFunction; + ACPI_RESOURCE_PIN_CONFIG PinConfig; + ACPI_RESOURCE_PIN_GROUP PinGroup; + ACPI_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction; + ACPI_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig; /* Common fields */ diff --git a/source/include/actbl1.h b/source/include/actbl1.h index c27f499..bd60167 100644 --- a/source/include/actbl1.h +++ b/source/include/actbl1.h @@ -67,9 +67,11 @@ #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ +#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */ #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ +#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */ #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ @@ -492,7 +494,8 @@ enum AcpiHestTypes ACPI_HEST_TYPE_AER_BRIDGE = 8, ACPI_HEST_TYPE_GENERIC_ERROR = 9, ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10, - ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */ + ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11, + ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */ }; @@ -544,6 +547,7 @@ typedef struct acpi_hest_aer_common #define ACPI_HEST_FIRMWARE_FIRST (1) #define ACPI_HEST_GLOBAL (1<<1) +#define ACPI_HEST_GHES_ASSIST (1<<2) /* * Macros to access the bus/segment numbers in Bus field above: @@ -574,18 +578,19 @@ typedef struct acpi_hest_notify enum AcpiHestNotifyTypes { - ACPI_HEST_NOTIFY_POLLED = 0, - ACPI_HEST_NOTIFY_EXTERNAL = 1, - ACPI_HEST_NOTIFY_LOCAL = 2, - ACPI_HEST_NOTIFY_SCI = 3, - ACPI_HEST_NOTIFY_NMI = 4, - ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */ - ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */ - ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */ - ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */ - ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */ - ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */ - ACPI_HEST_NOTIFY_RESERVED = 11 /* 11 and greater are reserved */ + ACPI_HEST_NOTIFY_POLLED = 0, + ACPI_HEST_NOTIFY_EXTERNAL = 1, + ACPI_HEST_NOTIFY_LOCAL = 2, + ACPI_HEST_NOTIFY_SCI = 3, + ACPI_HEST_NOTIFY_NMI = 4, + ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */ + ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */ + ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */ + ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */ + ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */ + ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */ + ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */ + ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */ }; /* Values for ConfigWriteEnable bitfield above */ @@ -608,7 +613,7 @@ typedef struct acpi_hest_ia_machine_check { ACPI_HEST_HEADER Header; UINT16 Reserved1; - UINT8 Flags; + UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; @@ -626,7 +631,7 @@ typedef struct acpi_hest_ia_corrected { ACPI_HEST_HEADER Header; UINT16 Reserved1; - UINT8 Flags; + UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; @@ -791,6 +796,155 @@ typedef struct acpi_hest_generic_data_v300 #define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2) +/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */ + +typedef struct acpi_hest_ia_deferred_check +{ + ACPI_HEST_HEADER Header; + UINT16 Reserved1; + UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ + UINT8 Enabled; + UINT32 RecordsToPreallocate; + UINT32 MaxSectionsPerRecord; + ACPI_HEST_NOTIFY Notify; + UINT8 NumHardwareBanks; + UINT8 Reserved2[3]; + +} ACPI_HEST_IA_DEFERRED_CHECK; + + +/******************************************************************************* + * + * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_hmat +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Reserved; + +} ACPI_TABLE_HMAT; + + +/* Values for HMAT structure types */ + +enum AcpiHmatType +{ + ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */ + ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */ + ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */ + ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ +}; + +typedef struct acpi_hmat_structure +{ + UINT16 Type; + UINT16 Reserved; + UINT32 Length; + +} ACPI_HMAT_STRUCTURE; + + +/* + * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE + */ + +/* 0: Memory subystem address range */ + +typedef struct acpi_hmat_address_range +{ + ACPI_HMAT_STRUCTURE Header; + UINT16 Flags; + UINT16 Reserved1; + UINT32 ProcessorPD; /* Processor proximity domain */ + UINT32 MemoryPD; /* Memory proximity domain */ + UINT32 Reserved2; + UINT64 PhysicalAddressBase; /* Physical address range base */ + UINT64 PhysicalAddressLength; /* Physical address range length */ + +} ACPI_HMAT_ADDRESS_RANGE; + +/* Masks for Flags field above */ + +#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: ProcessorPD field is valid */ +#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: MemoryPD field is valid */ +#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */ + + +/* 1: System locality latency and bandwidth information */ + +typedef struct acpi_hmat_locality +{ + ACPI_HMAT_STRUCTURE Header; + UINT8 Flags; + UINT8 DataType; + UINT16 Reserved1; + UINT32 NumberOfInitiatorPDs; + UINT32 NumberOfTargetPDs; + UINT32 Reserved2; + UINT64 EntryBaseUnit; + +} ACPI_HMAT_LOCALITY; + +/* Masks for Flags field above */ + +#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F) + +/* Values for Memory Hierarchy flag */ + +#define ACPI_HMAT_MEMORY 0 +#define ACPI_HMAT_LAST_LEVEL_CACHE 1 +#define ACPI_HMAT_1ST_LEVEL_CACHE 2 +#define ACPI_HMAT_2ND_LEVEL_CACHE 3 +#define ACPI_HMAT_3RD_LEVEL_CACHE 4 + +/* Values for DataType field above */ + +#define ACPI_HMAT_ACCESS_LATENCY 0 +#define ACPI_HMAT_READ_LATENCY 1 +#define ACPI_HMAT_WRITE_LATENCY 2 +#define ACPI_HMAT_ACCESS_BANDWIDTH 3 +#define ACPI_HMAT_READ_BANDWIDTH 4 +#define ACPI_HMAT_WRITE_BANDWIDTH 5 + + +/* 2: Memory side cache information */ + +typedef struct acpi_hmat_cache +{ + ACPI_HMAT_STRUCTURE Header; + UINT32 MemoryPD; + UINT32 Reserved1; + UINT64 CacheSize; + UINT32 CacheAttributes; + UINT16 Reserved2; + UINT16 NumberOfSMBIOSHandles; + +} ACPI_HMAT_CACHE; + +/* Masks for CacheAttributes field above */ + +#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F) +#define ACPI_HMAT_CACHE_LEVEL (0x000000F0) +#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00) +#define ACPI_HMAT_WRITE_POLICY (0x0000F000) +#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000) + +/* Values for cache associativity flag */ + +#define ACPI_HMAT_CA_NONE (0) +#define ACPI_HMAT_CA_DIRECT_MAPPED (1) +#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2) + +/* Values for write policy flag */ + +#define ACPI_HMAT_CP_NONE (0) +#define ACPI_HMAT_CP_WB (1) +#define ACPI_HMAT_CP_WT (2) + + /******************************************************************************* * * MADT - Multiple APIC Description Table @@ -812,8 +966,8 @@ typedef struct acpi_table_madt /* Values for PCATCompat flag */ -#define ACPI_MADT_DUAL_PIC 0 -#define ACPI_MADT_MULTIPLE_APIC 1 +#define ACPI_MADT_DUAL_PIC 1 +#define ACPI_MADT_MULTIPLE_APIC 0 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */ @@ -1340,6 +1494,95 @@ typedef struct acpi_nfit_flush_address /******************************************************************************* * + * PPTT - Processor Properties Topology Table (ACPI 6.2) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_pptt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_PPTT; + +/* Values for Type field above */ + +enum AcpiPpttType +{ + ACPI_PPTT_TYPE_PROCESSOR = 0, + ACPI_PPTT_TYPE_CACHE = 1, + ACPI_PPTT_TYPE_ID = 2, + ACPI_PPTT_TYPE_RESERVED = 3 +}; + + +/* 0: Processor Hierarchy Node Structure */ + +typedef struct acpi_pptt_processor { + ACPI_SUBTABLE_HEADER Header; + UINT16 Reserved; + UINT32 Flags; + UINT32 Parent; + UINT32 AcpiProcessorId; + UINT32 NumberOfPrivResources; + +} ACPI_PPTT_PROCESSOR; + +/* Flags */ + +#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */ +#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */ + + +/* 1: Cache Type Structure */ + +typedef struct acpi_pptt_cache { + ACPI_SUBTABLE_HEADER Header; + UINT16 Reserved; + UINT32 Flags; + UINT32 NextLevelOfCache; + UINT32 Size; + UINT32 NumberOfSets; + UINT8 Associativity; + UINT8 Attributes; + UINT16 LineSize; + +} ACPI_PPTT_CACHE; + +/* Flags */ + +#define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */ +#define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */ +#define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */ +#define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */ +#define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */ +#define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */ +#define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */ + +/* Masks for Attributes */ + +#define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */ +#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */ +#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */ + + +/* 2: ID Structure */ + +typedef struct acpi_pptt_id { + ACPI_SUBTABLE_HEADER Header; + UINT16 Reserved; + UINT32 VendorId; + UINT64 Level1Id; + UINT64 Level2Id; + UINT16 MajorRev; + UINT16 MinorRev; + UINT16 SpinRev; + +} ACPI_PPTT_ID; + + +/******************************************************************************* + * * SBST - Smart Battery Specification Table * Version 1 * @@ -1394,7 +1637,8 @@ enum AcpiSratType ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, ACPI_SRAT_TYPE_GICC_AFFINITY = 3, - ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */ + ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */ + ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */ }; /* @@ -1478,6 +1722,18 @@ typedef struct acpi_srat_gicc_affinity #define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */ +/* 4: GCC ITS Affinity (ACPI 6.2) */ + +typedef struct acpi_srat_gic_its_affinity +{ + ACPI_SUBTABLE_HEADER Header; + UINT32 ProximityDomain; + UINT16 Reserved; + UINT32 ItsId; + +} ACPI_SRAT_GIC_ITS_AFFINITY; + + /* Reset to default packing */ #pragma pack() diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 51aafc0..e809688 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -89,6 +89,7 @@ #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ +#define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Migrations Table */ #define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */ #ifdef ACPI_UNDEFINED_TABLES @@ -1413,7 +1414,8 @@ enum AcpiSpmiInterfaceTypes * Version 2 * * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", - * December 19, 2014 + * Version 1.2, Revision 8 + * February 27, 2017 * * NOTE: There are two versions of the table with the same signature -- * the client version and the server version. The common PlatformClass @@ -1484,7 +1486,8 @@ typedef struct acpi_table_tcpa_server * Version 4 * * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", - * December 19, 2014 + * Version 1.2, Revision 8 + * February 27, 2017 * ******************************************************************************/ @@ -1507,6 +1510,42 @@ typedef struct acpi_table_tpm2 #define ACPI_TPM2_MEMORY_MAPPED 6 #define ACPI_TPM2_COMMAND_BUFFER 7 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8 +#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */ + + +/* Trailer appears after any StartMethod subtables */ + +typedef struct acpi_tpm2_trailer +{ + UINT32 MinimumLogLength; /* Minimum length for the event log area */ + UINT64 LogAddress; /* Address of the event log area */ + +} ACPI_TPM2_TRAILER; + + +/* + * Subtables (StartMethod-specific) + */ + +/* 11: Start Method for ARM SMC (V1.2 Rev 8) */ + +typedef struct acpi_tpm2_arm_smc +{ + UINT32 GlobalInterrupt; + UINT8 InterruptFlags; + UINT8 OperationFlags; + UINT16 Reserved; + UINT32 FunctionId; + +} ACPI_TPM2_ARM_SMC; + +/* Values for InterruptFlags above */ + +#define ACPI_TPM2_INTERRUPT_SUPPORT (1) + +/* Values for OperationFlags above */ + +#define ACPI_TPM2_IDLE_SUPPORT (1) /******************************************************************************* @@ -1726,6 +1765,30 @@ typedef struct acpi_table_wdrt } ACPI_TABLE_WDRT; +/******************************************************************************* + * + * WSMT - Windows SMM Security Migrations Table + * Version 1 + * + * Conforms to "Windows SMM Security Migrations Table", + * Version 1.0, April 18, 2016 + * + ******************************************************************************/ + +typedef struct acpi_table_wsmt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 ProtectionFlags; + +} ACPI_TABLE_WSMT; + +/* Flags for ProtectionFlags field above */ + +#define ACPI_WSMT_FIXED_COMM_BUFFERS (1) +#define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2) +#define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION (4) + + /* Reset to default packing */ #pragma pack() diff --git a/source/include/actbl3.h b/source/include/actbl3.h index 65711de..e1a13d0 100644 --- a/source/include/actbl3.h +++ b/source/include/actbl3.h @@ -121,6 +121,11 @@ typedef struct acpi_table_bgrt } ACPI_TABLE_BGRT; +/* Flags for Status field above */ + +#define ACPI_BGRT_DISPLAYED (1) +#define ACPI_BGRT_ORIENTATION_OFFSET (3 << 1) + /******************************************************************************* * @@ -543,7 +548,7 @@ typedef struct acpi_mpst_shared /******************************************************************************* * * PCCT - Platform Communications Channel Table (ACPI 5.0) - * Version 1 + * Version 2 (ACPI 6.2) * ******************************************************************************/ @@ -566,7 +571,9 @@ enum AcpiPcctType 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 */ + ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */ + ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */ + ACPI_PCCT_TYPE_RESERVED = 5 /* 5 and greater are reserved */ }; /* @@ -596,7 +603,7 @@ typedef struct acpi_pcct_subspace typedef struct acpi_pcct_hw_reduced { ACPI_SUBTABLE_HEADER Header; - UINT32 DoorbellInterrupt; + UINT32 PlatformInterrupt; UINT8 Flags; UINT8 Reserved; UINT64 BaseAddress; @@ -616,7 +623,7 @@ typedef struct acpi_pcct_hw_reduced typedef struct acpi_pcct_hw_reduced_type2 { ACPI_SUBTABLE_HEADER Header; - UINT32 DoorbellInterrupt; + UINT32 PlatformInterrupt; UINT8 Flags; UINT8 Reserved; UINT64 BaseAddress; @@ -627,13 +634,75 @@ typedef struct acpi_pcct_hw_reduced_type2 UINT32 Latency; UINT32 MaxAccessRate; UINT16 MinTurnaroundTime; - ACPI_GENERIC_ADDRESS DoorbellAckRegister; + ACPI_GENERIC_ADDRESS PlatformAckRegister; UINT64 AckPreserveMask; UINT64 AckWriteMask; } ACPI_PCCT_HW_REDUCED_TYPE2; +/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */ + +typedef struct acpi_pcct_ext_pcc_master +{ + ACPI_SUBTABLE_HEADER Header; + UINT32 PlatformInterrupt; + UINT8 Flags; + UINT8 Reserved1; + UINT64 BaseAddress; + UINT32 Length; + ACPI_GENERIC_ADDRESS DoorbellRegister; + UINT64 PreserveMask; + UINT64 WriteMask; + UINT32 Latency; + UINT32 MaxAccessRate; + UINT32 MinTurnaroundTime; + ACPI_GENERIC_ADDRESS PlatformAckRegister; + UINT64 AckPreserveMask; + UINT64 AckSetMask; + UINT64 Reserved2; + ACPI_GENERIC_ADDRESS CmdCompleteRegister; + UINT64 CmdCompleteMask; + ACPI_GENERIC_ADDRESS CmdUpdateRegister; + UINT64 CmdUpdatePreserveMask; + UINT64 CmdUpdateSetMask; + ACPI_GENERIC_ADDRESS ErrorStatusRegister; + UINT64 ErrorStatusMask; + +} ACPI_PCCT_EXT_PCC_MASTER; + + +/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */ + +typedef struct acpi_pcct_ext_pcc_slave +{ + ACPI_SUBTABLE_HEADER Header; + UINT32 PlatformInterrupt; + UINT8 Flags; + UINT8 Reserved1; + UINT64 BaseAddress; + UINT32 Length; + ACPI_GENERIC_ADDRESS DoorbellRegister; + UINT64 PreserveMask; + UINT64 WriteMask; + UINT32 Latency; + UINT32 MaxAccessRate; + UINT32 MinTurnaroundTime; + ACPI_GENERIC_ADDRESS PlatformAckRegister; + UINT64 AckPreserveMask; + UINT64 AckSetMask; + UINT64 Reserved2; + ACPI_GENERIC_ADDRESS CmdCompleteRegister; + UINT64 CmdCompleteMask; + ACPI_GENERIC_ADDRESS CmdUpdateRegister; + UINT64 CmdUpdatePreserveMask; + UINT64 CmdUpdateSetMask; + ACPI_GENERIC_ADDRESS ErrorStatusRegister; + UINT64 ErrorStatusMask; + +} ACPI_PCCT_EXT_PCC_SLAVE; + + /* Values for doorbell flags above */ #define ACPI_PCCT_INTERRUPT_POLARITY (1) @@ -655,6 +724,18 @@ typedef struct acpi_pcct_shared_memory } ACPI_PCCT_SHARED_MEMORY; +/* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */ + +typedef struct acpi_pcct_ext_pcc_shared_memory +{ + UINT32 Signature; + UINT32 Flags; + UINT32 Length; + UINT32 Command; + +} ACPI_PCCT_EXT_PCC_SHARED_MEMORY; + + /******************************************************************************* * * PMTT - Platform Memory Topology Table (ACPI 5.0) diff --git a/source/include/actypes.h b/source/include/actypes.h index ca96eb6..b6d4080 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -47,9 +47,9 @@ /* acpisrc:StructDefs -- for acpisrc conversion */ /* - * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header - * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of - * 12/2006. + * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent + * header and must be either 32 or 64. 16-bit ACPICA is no longer + * supported, as of 12/2006. */ #ifndef ACPI_MACHINE_WIDTH #error ACPI_MACHINE_WIDTH not defined @@ -88,9 +88,9 @@ * INT64 64-bit (8 byte) signed value * * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the - * compiler-dependent header(s) and were introduced because there is no common - * 64-bit integer type across the various compilation models, as shown in - * the table below. + * compiler-dependent header(s) and were introduced because there is no + * common 64-bit integer type across the various compilation models, as + * shown in the table below. * * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit * char 8 8 8 8 8 8 @@ -107,10 +107,10 @@ * 2) These types represent the native word size of the target mode of the * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are * usually used for memory allocation, efficient loop counters, and array - * indexes. The types are similar to the size_t type in the C library and are - * required because there is no C type that consistently represents the native - * data width. ACPI_SIZE is needed because there is no guarantee that a - * kernel-level C library is present. + * indexes. The types are similar to the size_t type in the C library and + * are required because there is no C type that consistently represents the + * native data width. ACPI_SIZE is needed because there is no guarantee + * that a kernel-level C library is present. * * ACPI_SIZE 16/32/64-bit unsigned value * ACPI_NATIVE_INT 16/32/64-bit signed value @@ -171,9 +171,10 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS; /* * In the case of the Itanium Processor Family (IPF), the hardware does not - * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag - * to indicate that special precautions must be taken to avoid alignment faults. - * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) + * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED + * flag to indicate that special precautions must be taken to avoid alignment + * faults. (IA64 or ia64 is currently used by existing compilers to indicate + * IPF.) * * Note: EM64T and other X86-64 processors support misaligned transfers, * so there is no need to define this flag. @@ -314,8 +315,8 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS; #endif /* - * Some compilers complain about unused variables. Sometimes we don't want to - * use all the variables (for example, _AcpiModuleName). This allows us + * Some compilers complain about unused variables. Sometimes we don't want + * to use all the variables (for example, _AcpiModuleName). This allows us * to tell the compiler in a per-variable manner that a variable * is unused */ @@ -324,8 +325,9 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS; #endif /* - * All ACPICA external functions that are available to the rest of the kernel - * are tagged with thes macros which can be defined as appropriate for the host. + * All ACPICA external functions that are available to the rest of the + * kernel are tagged with these macros which can be defined as appropriate + * for the host. * * Notes: * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination @@ -390,7 +392,8 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS; /****************************************************************************** * - * ACPI Specification constants (Do not change unless the specification changes) + * ACPI Specification constants (Do not change unless the specification + * changes) * *****************************************************************************/ @@ -496,10 +499,10 @@ typedef UINT8 ACPI_OWNER_ID; #define ACPI_DO_NOT_WAIT 0 /* - * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits. - * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this - * pertains to the ACPI integer type only, not to other integers used in the - * implementation of the ACPICA subsystem. + * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are + * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits. + * Note that this pertains to the ACPI integer type only, not to other + * integers used in the implementation of the ACPICA subsystem. * * 01/2010: This type is obsolete and has been removed from the entire ACPICA * code base. It remains here for compatibility with device drivers that use @@ -641,8 +644,9 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B #define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C #define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D +#define ACPI_NOTIFY_MEMORY_UPDATE (UINT8) 0x0E -#define ACPI_GENERIC_NOTIFY_MAX 0x0D +#define ACPI_GENERIC_NOTIFY_MAX 0x0E #define ACPI_SPECIFIC_NOTIFY_MAX 0x84 /* @@ -679,10 +683,11 @@ typedef UINT32 ACPI_OBJECT_TYPE; /* * These are object types that do not map directly to the ACPI - * ObjectType() operator. They are used for various internal purposes only. - * If new predefined ACPI_TYPEs are added (via the ACPI specification), these - * internal types must move upwards. (There is code that depends on these - * values being contiguous with the external types above.) + * ObjectType() operator. They are used for various internal purposes + * only. If new predefined ACPI_TYPEs are added (via the ACPI + * specification), these internal types must move upwards. (There + * is code that depends on these values being contiguous with the + * external types above.) */ #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 @@ -783,7 +788,7 @@ typedef UINT32 ACPI_EVENT_STATUS; * | | | | +-- Type of dispatch:to method, handler, notify, or none * | | | +----- Interrupt type: edge or level triggered * | | +------- Is a Wake GPE - * | +--------- Is GPE masked by the software GPE masking machanism + * | +--------- Is GPE masked by the software GPE masking mechanism * +------------ */ #define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00 @@ -929,8 +934,8 @@ typedef struct acpi_sleep_functions */ /* - * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element - * or an unresolved named reference. + * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package + * element or an unresolved named reference. */ typedef union acpi_object { @@ -1253,7 +1258,7 @@ typedef struct acpi_pnp_device_id_list /* * Structure returned from AcpiGetObjectInfo. - * Optimized for both 32- and 64-bit builds + * Optimized for both 32-bit and 64-bit builds. */ typedef struct acpi_device_info { diff --git a/source/include/acutils.h b/source/include/acutils.h index a0dbbf4..e560a6f 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -86,6 +86,7 @@ extern const char *AcpiGbl_BpbDecode[]; extern const char *AcpiGbl_SbDecode[]; extern const char *AcpiGbl_FcDecode[]; extern const char *AcpiGbl_PtDecode[]; +extern const char *AcpiGbl_PtypDecode[]; #endif /* diff --git a/source/include/acuuid.h b/source/include/acuuid.h index 5c2e313..c32219d 100644 --- a/source/include/acuuid.h +++ b/source/include/acuuid.h @@ -78,6 +78,11 @@ #define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" #define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" +/* Processor Properties (ACPI 6.2) */ + +#define UUID_CACHE_PROPERTIES "6DC63E77-257E-4E78-A973-A21F2796898D" +#define UUID_PHYSICAL_PROPERTY "DDE4D59A-AA42-4349-B407-EA40F57D9FB7" + /* Miscellaneous */ #define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48" diff --git a/source/include/amlcode.h b/source/include/amlcode.h index ed70466..e4033d0 100644 --- a/source/include/amlcode.h +++ b/source/include/amlcode.h @@ -319,6 +319,11 @@ * #A is the number of required arguments * #T is the number of target operands * #R indicates whether there is a return value + * + * These types are used for the top-level dispatch of the AML + * opcode. They group similar operators that can share common + * front-end code before dispatch to the final code that implements + * the operator. */ /* @@ -360,42 +365,42 @@ * The opcode Type is used in a dispatch table, do not change * or add anything new without updating the table. */ -#define AML_TYPE_EXEC_0A_0T_1R 0x00 -#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ -#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ -#define AML_TYPE_EXEC_1A_1T_0R 0x03 -#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* Monadic2R */ -#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ -#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ -#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* Dyadic2R */ -#define AML_TYPE_EXEC_2A_2T_1R 0x08 -#define AML_TYPE_EXEC_3A_0T_0R 0x09 -#define AML_TYPE_EXEC_3A_1T_1R 0x0A -#define AML_TYPE_EXEC_6A_0T_1R 0x0B +#define AML_TYPE_EXEC_0A_0T_1R 0x00 /* 0 Args, 0 Target, 1 RetVal */ +#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* 1 Args, 0 Target, 0 RetVal */ +#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* 1 Args, 0 Target, 1 RetVal */ +#define AML_TYPE_EXEC_1A_1T_0R 0x03 /* 1 Args, 1 Target, 0 RetVal */ +#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* 1 Args, 1 Target, 1 RetVal */ +#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* 2 Args, 0 Target, 0 RetVal */ +#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* 2 Args, 0 Target, 1 RetVal */ +#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* 2 Args, 1 Target, 1 RetVal */ +#define AML_TYPE_EXEC_2A_2T_1R 0x08 /* 2 Args, 2 Target, 1 RetVal */ +#define AML_TYPE_EXEC_3A_0T_0R 0x09 /* 3 Args, 0 Target, 0 RetVal */ +#define AML_TYPE_EXEC_3A_1T_1R 0x0A /* 3 Args, 1 Target, 1 RetVal */ +#define AML_TYPE_EXEC_6A_0T_1R 0x0B /* 6 Args, 0 Target, 1 RetVal */ /* End of types used in dispatch table */ -#define AML_TYPE_LITERAL 0x0B -#define AML_TYPE_CONSTANT 0x0C -#define AML_TYPE_METHOD_ARGUMENT 0x0D -#define AML_TYPE_LOCAL_VARIABLE 0x0E -#define AML_TYPE_DATA_TERM 0x0F +#define AML_TYPE_LITERAL 0x0C +#define AML_TYPE_CONSTANT 0x0D +#define AML_TYPE_METHOD_ARGUMENT 0x0E +#define AML_TYPE_LOCAL_VARIABLE 0x0F +#define AML_TYPE_DATA_TERM 0x10 /* Generic for an op that returns a value */ -#define AML_TYPE_METHOD_CALL 0x10 +#define AML_TYPE_METHOD_CALL 0x11 /* Miscellaneous types */ -#define AML_TYPE_CREATE_FIELD 0x11 -#define AML_TYPE_CREATE_OBJECT 0x12 -#define AML_TYPE_CONTROL 0x13 -#define AML_TYPE_NAMED_NO_OBJ 0x14 -#define AML_TYPE_NAMED_FIELD 0x15 -#define AML_TYPE_NAMED_SIMPLE 0x16 -#define AML_TYPE_NAMED_COMPLEX 0x17 -#define AML_TYPE_RETURN 0x18 -#define AML_TYPE_UNDEFINED 0x19 -#define AML_TYPE_BOGUS 0x1A +#define AML_TYPE_CREATE_FIELD 0x12 +#define AML_TYPE_CREATE_OBJECT 0x13 +#define AML_TYPE_CONTROL 0x14 +#define AML_TYPE_NAMED_NO_OBJ 0x15 +#define AML_TYPE_NAMED_FIELD 0x16 +#define AML_TYPE_NAMED_SIMPLE 0x17 +#define AML_TYPE_NAMED_COMPLEX 0x18 +#define AML_TYPE_RETURN 0x19 +#define AML_TYPE_UNDEFINED 0x1A +#define AML_TYPE_BOGUS 0x1B /* AML Package Length encodings */ diff --git a/source/include/amlresrc.h b/source/include/amlresrc.h index 79aa5ba..e386f32 100644 --- a/source/include/amlresrc.h +++ b/source/include/amlresrc.h @@ -66,6 +66,7 @@ #define ACPI_RESTAG_DRIVESTRENGTH "_DRS" #define ACPI_RESTAG_ENDIANNESS "_END" #define ACPI_RESTAG_FLOWCONTROL "_FLC" +#define ACPI_RESTAG_FUNCTION "_FUN" #define ACPI_RESTAG_GRANULARITY "_GRA" #define ACPI_RESTAG_INTERRUPT "_INT" #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */ @@ -85,6 +86,8 @@ #define ACPI_RESTAG_PHASE "_PHA" #define ACPI_RESTAG_PIN "_PIN" #define ACPI_RESTAG_PINCONFIG "_PPI" +#define ACPI_RESTAG_PINCONFIG_TYPE "_TYP" +#define ACPI_RESTAG_PINCONFIG_VALUE "_VAL" #define ACPI_RESTAG_POLARITY "_POL" #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" @@ -528,6 +531,116 @@ typedef struct aml_resource_uart_serialbus #define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */ #define AML_RESOURCE_UART_MIN_DATA_LEN 10 +typedef struct aml_resource_pin_function +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT16 Flags; + UINT8 PinConfig; + UINT16 FunctionNumber; + UINT16 PinTableOffset; + UINT8 ResSourceIndex; + UINT16 ResSourceOffset; + UINT16 VendorOffset; + UINT16 VendorLength; + /* + * Optional fields follow immediately: + * 1) PIN list (Words) + * 2) Resource Source String + * 3) Vendor Data bytes + */ + +} AML_RESOURCE_PIN_FUNCTION; + +#define AML_RESOURCE_PIN_FUNCTION_REVISION 1 /* ACPI 6.2 */ + +typedef struct aml_resource_pin_config +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT16 Flags; + UINT8 PinConfigType; + UINT32 PinConfigValue; + UINT16 PinTableOffset; + UINT8 ResSourceIndex; + UINT16 ResSourceOffset; + UINT16 VendorOffset; + UINT16 VendorLength; + /* + * Optional fields follow immediately: + * 1) PIN list (Words) + * 2) Resource Source String + * 3) Vendor Data bytes + */ + +} AML_RESOURCE_PIN_CONFIG; + +#define AML_RESOURCE_PIN_CONFIG_REVISION 1 /* ACPI 6.2 */ + +typedef struct aml_resource_pin_group +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT16 Flags; + UINT16 PinTableOffset; + UINT16 LabelOffset; + UINT16 VendorOffset; + UINT16 VendorLength; + /* + * Optional fields follow immediately: + * 1) PIN list (Words) + * 2) Resource Label String + * 3) Vendor Data bytes + */ + +} AML_RESOURCE_PIN_GROUP; + +#define AML_RESOURCE_PIN_GROUP_REVISION 1 /* ACPI 6.2 */ + +typedef struct aml_resource_pin_group_function +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT16 Flags; + UINT16 FunctionNumber; + UINT8 ResSourceIndex; + UINT16 ResSourceOffset; + UINT16 ResSourceLabelOffset; + UINT16 VendorOffset; + UINT16 VendorLength; + /* + * Optional fields follow immediately: + * 1) Resource Source String + * 2) Resource Source Label String + * 3) Vendor Data bytes + */ + +} AML_RESOURCE_PIN_GROUP_FUNCTION; + +#define AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION 1 /* ACPI 6.2 */ + +typedef struct aml_resource_pin_group_config +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT16 Flags; + UINT8 PinConfigType; + UINT32 PinConfigValue; + UINT8 ResSourceIndex; + UINT16 ResSourceOffset; + UINT16 ResSourceLabelOffset; + UINT16 VendorOffset; + UINT16 VendorLength; + /* + * Optional fields follow immediately: + * 1) Resource Source String + * 2) Resource Source Label String + * 3) Vendor Data bytes + */ + +} AML_RESOURCE_PIN_GROUP_CONFIG; + +#define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION 1 /* ACPI 6.2 */ /* restore default alignment */ @@ -572,6 +685,11 @@ typedef union aml_resource AML_RESOURCE_SPI_SERIALBUS SpiSerialBus; AML_RESOURCE_UART_SERIALBUS UartSerialBus; AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus; + AML_RESOURCE_PIN_FUNCTION PinFunction; + AML_RESOURCE_PIN_CONFIG PinConfig; + AML_RESOURCE_PIN_GROUP PinGroup; + AML_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction; + AML_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig; /* Utility overlays */ diff --git a/source/include/platform/acgcc.h b/source/include/platform/acgcc.h index 4c27349..c8ec460 100644 --- a/source/include/platform/acgcc.h +++ b/source/include/platform/acgcc.h @@ -48,7 +48,17 @@ * Use compiler specific is a good practice for even when * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. */ +#ifndef va_arg +#ifdef ACPI_USE_BUILTIN_STDARG +typedef __builtin_va_list va_list; +#define va_start(v, l) __builtin_va_start(v, l) +#define va_end(v) __builtin_va_end(v) +#define va_arg(v, l) __builtin_va_arg(v, l) +#define va_copy(d, s) __builtin_va_copy(d, s) +#else #include +#endif +#endif #define ACPI_INLINE __inline__ diff --git a/source/include/platform/acintel.h b/source/include/platform/acintel.h index 113f286..a1790f5 100644 --- a/source/include/platform/acintel.h +++ b/source/include/platform/acintel.h @@ -48,7 +48,9 @@ * Use compiler specific is a good practice for even when * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. */ +#ifndef va_arg #include +#endif /* Configuration specific to Intel 64-bit C compiler */ diff --git a/source/os_specific/service_layers/osunixxf.c b/source/os_specific/service_layers/osunixxf.c index 2711529..b13d632 100644 --- a/source/os_specific/service_layers/osunixxf.c +++ b/source/os_specific/service_layers/osunixxf.c @@ -876,9 +876,9 @@ AcpiOsWaitSemaphore ( { ACPI_STATUS Status = AE_OK; sem_t *Sem = (sem_t *) Handle; + int RetVal; #ifndef ACPI_USE_ALTERNATE_TIMEOUT struct timespec Time; - int RetVal; #endif @@ -908,12 +908,17 @@ AcpiOsWaitSemaphore ( case ACPI_WAIT_FOREVER: - if (sem_wait (Sem)) + while (((RetVal = sem_wait (Sem)) == -1) && (errno == EINTR)) + { + continue; /* Restart if interrupted */ + } + if (RetVal != 0) { Status = (AE_TIME); } break; + /* Wait with MsecTimeout */ default: @@ -967,7 +972,8 @@ AcpiOsWaitSemaphore ( while (((RetVal = sem_timedwait (Sem, &Time)) == -1) && (errno == EINTR)) { - continue; + continue; /* Restart if interrupted */ + } if (RetVal != 0) diff --git a/source/tools/acpidump/apmain.c b/source/tools/acpidump/apmain.c index 71834f5..db48f4f 100644 --- a/source/tools/acpidump/apmain.c +++ b/source/tools/acpidump/apmain.c @@ -123,8 +123,7 @@ ApDisplayUsage ( ACPI_OPTION ("-c ", "Turning on/off customized table dumping"); ACPI_OPTION ("-f ", "Get table via a binary file"); ACPI_OPTION ("-n ", "Get table via a name/signature"); - ACPI_OPTION ("-x", "Do not use but dump XSDT"); - ACPI_OPTION ("-x -x", "Do not use or dump XSDT"); + ACPI_OPTION ("-x", "Use RSDT instead of XSDT"); ACPI_USAGE_TEXT ( "\n" diff --git a/source/tools/acpiexec/aecommon.h b/source/tools/acpiexec/aecommon.h index ef6dd4e..380c89e 100644 --- a/source/tools/acpiexec/aecommon.h +++ b/source/tools/acpiexec/aecommon.h @@ -96,11 +96,21 @@ extern ACPI_CONNECTION_INFO AeMyContext; #define OSD_PRINT(lvl,fp) TEST_OUTPUT_LEVEL(lvl) {\ AcpiOsPrintf PARAM_LIST(fp);} +#define AE_PREFIX "ACPI Exec: " + void ACPI_SYSTEM_XFACE -AeCtrlCHandler ( +AeSignalHandler ( int Sig); ACPI_STATUS +AeExceptionHandler ( + ACPI_STATUS AmlStatus, + ACPI_NAME Name, + UINT16 Opcode, + UINT32 AmlOffset, + void *Context); + +ACPI_STATUS AeBuildLocalTables ( ACPI_NEW_TABLE_DESC *TableList); diff --git a/source/tools/acpiexec/aeexception.c b/source/tools/acpiexec/aeexception.c new file mode 100644 index 0000000..b649c80 --- /dev/null +++ b/source/tools/acpiexec/aeexception.c @@ -0,0 +1,333 @@ +/****************************************************************************** + * + * Module Name: aeexception - Exception and signal handlers + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2017, 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 "aecommon.h" + +#define _COMPONENT ACPI_TOOLS + ACPI_MODULE_NAME ("aeexception") + + +/* Local prototypes */ + +static void +AeDisplayMethodCallStack ( + void); + + +/****************************************************************************** + * + * FUNCTION: AeExceptionHandler + * + * PARAMETERS: Standard exception handler parameters + * + * RETURN: Status + * + * DESCRIPTION: System exception handler for AcpiExec utility. Called from + * the core ACPICA code after any exception during method + * execution. + * + *****************************************************************************/ + +ACPI_STATUS +AeExceptionHandler ( + ACPI_STATUS AmlStatus, + ACPI_NAME Name, + UINT16 Opcode, + UINT32 AmlOffset, + void *Context) +{ + ACPI_STATUS NewAmlStatus = AmlStatus; + ACPI_STATUS Status; + ACPI_BUFFER ReturnObj; + ACPI_OBJECT_LIST ArgList; + ACPI_OBJECT Arg[3]; + const char *Exception; + ACPI_HANDLE ErrHandle; + + + Exception = AcpiFormatException (AmlStatus); + AcpiOsPrintf (AE_PREFIX + "Exception %s during execution\n", Exception); + if (Name) + { + AcpiOsPrintf (AE_PREFIX + "Evaluating Method or Node: [%4.4s]", + (char *) &Name); + } + + AcpiOsPrintf ("\n" AE_PREFIX + "AML Opcode [%s], Method Offset ~%5.5X\n", + AcpiPsGetOpcodeName (Opcode), AmlOffset); + + /* Invoke the _ERR method if present */ + + Status = AcpiGetHandle (NULL, "\\_ERR", &ErrHandle); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + + /* Setup parameter object */ + + ArgList.Count = 3; + ArgList.Pointer = Arg; + + Arg[0].Type = ACPI_TYPE_INTEGER; + Arg[0].Integer.Value = AmlStatus; + + Arg[1].Type = ACPI_TYPE_STRING; + Arg[1].String.Pointer = ACPI_CAST_PTR (char, Exception); + Arg[1].String.Length = strlen (Exception); + + Arg[2].Type = ACPI_TYPE_INTEGER; + Arg[2].Integer.Value = AcpiOsGetThreadId(); + + /* Setup return buffer */ + + ReturnObj.Pointer = NULL; + ReturnObj.Length = ACPI_ALLOCATE_BUFFER; + + Status = AcpiEvaluateObject (ErrHandle, NULL, &ArgList, &ReturnObj); + if (ACPI_SUCCESS (Status)) + { + if (ReturnObj.Pointer) + { + /* Override original status */ + + NewAmlStatus = (ACPI_STATUS) + ((ACPI_OBJECT *) ReturnObj.Pointer)->Integer.Value; + + /* Free a buffer created via ACPI_ALLOCATE_BUFFER */ + + AcpiOsFree (ReturnObj.Pointer); + } + } + else if (Status != AE_NOT_FOUND) + { + AcpiOsPrintf (AE_PREFIX + "Could not execute _ERR method, %s\n", + AcpiFormatException (Status)); + } + +Cleanup: + + /* Global overrides */ + + if (AcpiGbl_IgnoreErrors) + { + NewAmlStatus = AE_OK; + } + else if (AmlStatus == AE_AML_INTERNAL) + { + NewAmlStatus = AE_AML_INTERNAL; + AcpiOsPrintf (AE_PREFIX + "Cannot override status %s\n\n", + AcpiFormatException (NewAmlStatus)); + } + else if (NewAmlStatus != AmlStatus) + { + AcpiOsPrintf (AE_PREFIX + "Exception override, new status %s\n\n", + AcpiFormatException (NewAmlStatus)); + } + + return (NewAmlStatus); +} + + +/****************************************************************************** + * + * FUNCTION: AeSignalHandler + * + * PARAMETERS: Sig + * + * RETURN: none + * + * DESCRIPTION: Master signal handler. Currently handles SIGINT (ctrl-c), + * and SIGSEGV (Segment violation). + * + *****************************************************************************/ + +void ACPI_SYSTEM_XFACE +AeSignalHandler ( + int Sig) +{ + + fflush(stdout); + AcpiOsPrintf ("\n" AE_PREFIX); + + switch (Sig) + { + case SIGINT: + signal(Sig, SIG_IGN); + AcpiOsPrintf ("\n"); + + /* Abort the application if there are no methods executing */ + + if (!AcpiGbl_MethodExecuting) + { + break; + } + + /* + * Abort the method(s). This will also dump the method call + * stack so there is no need to do it here. The application + * will then drop back into the debugger interface. + */ + AcpiGbl_AbortMethod = TRUE; + AcpiOsPrintf (AE_PREFIX "Control Method Call Stack:\n"); + signal (SIGINT, AeSignalHandler); + return; + + case SIGSEGV: + AcpiOsPrintf ("Segmentation Fault\n"); + AeDisplayMethodCallStack (); + break; + + default: + AcpiOsPrintf ("Unknown Signal, %X\n", Sig); + break; + } + + /* Terminate application -- cleanup then exit */ + + AcpiOsPrintf (AE_PREFIX "Terminating\n"); + (void) AcpiOsTerminate (); + exit (0); +} + + +/****************************************************************************** + * + * FUNCTION: AeDisplayMethodCallStack + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Display current method call stack, if possible. + * + * NOTE: Currently only called from a SIGSEGV, so AcpiExec is about + * to terminate. + * + *****************************************************************************/ + +static void +AeDisplayMethodCallStack ( + void) +{ + ACPI_WALK_STATE *WalkState; + ACPI_THREAD_STATE *ThreadList = AcpiGbl_CurrentWalkList; + char *FullPathname = NULL; + + + if (!AcpiGbl_MethodExecuting) + { + AcpiOsPrintf (AE_PREFIX "No method is executing\n"); + return; + } + + /* + * Try to find the currently executing control method(s) + * + * Note: The following code may fault if the data structures are + * in an indeterminate state when the interrupt occurs. However, + * in practice, this works quite well and can provide very + * valuable information. + * + * 1) Walk the global thread list + */ + while (ThreadList && + (ThreadList->DescriptorType == ACPI_DESC_TYPE_STATE_THREAD)) + { + /* 2) Walk the walk state list for this thread */ + + WalkState = ThreadList->WalkStateList; + while (WalkState && + (WalkState->DescriptorType == ACPI_DESC_TYPE_WALK)) + { + /* An executing control method */ + + if (WalkState->MethodNode) + { + FullPathname = AcpiNsGetExternalPathname ( + WalkState->MethodNode); + + AcpiOsPrintf (AE_PREFIX + "Executing Method: %s\n", FullPathname); + } + + /* Execution of a deferred opcode/node */ + + if (WalkState->DeferredNode) + { + FullPathname = AcpiNsGetExternalPathname ( + WalkState->DeferredNode); + + AcpiOsPrintf (AE_PREFIX + "Evaluating deferred node: %s\n", FullPathname); + } + + /* Get the currently executing AML opcode */ + + if ((WalkState->Opcode != AML_INT_METHODCALL_OP) && + FullPathname) + { + AcpiOsPrintf (AE_PREFIX + "Current AML Opcode in %s: [%s]-0x%4.4X at %p\n", + FullPathname, AcpiPsGetOpcodeName (WalkState->Opcode), + WalkState->Opcode, WalkState->Aml); + } + + if (FullPathname) + { + ACPI_FREE (FullPathname); + FullPathname = NULL; + } + + WalkState = WalkState->Next; + } + + ThreadList = ThreadList->Next; + } +} diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index e6aca2d..d6383b1 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -74,14 +74,6 @@ AeDeviceNotifyHandler ( void *Context); static ACPI_STATUS -AeExceptionHandler ( - ACPI_STATUS AmlStatus, - ACPI_NAME Name, - UINT16 Opcode, - UINT32 AmlOffset, - void *Context); - -static ACPI_STATUS AeTableHandler ( UINT32 Event, void *Table, @@ -122,50 +114,11 @@ static char *TableEvents[] = #endif /* !ACPI_REDUCED_HARDWARE */ -static UINT32 SigintCount = 0; static AE_DEBUG_REGIONS AeRegions; /****************************************************************************** * - * FUNCTION: AeCtrlCHandler - * - * PARAMETERS: Sig - * - * RETURN: none - * - * DESCRIPTION: Control-C handler. Abort running control method if any. - * - *****************************************************************************/ - -void ACPI_SYSTEM_XFACE -AeCtrlCHandler ( - int Sig) -{ - - signal (SIGINT, SIG_IGN); - SigintCount++; - - AcpiOsPrintf ("Caught a ctrl-c (#%u)\n\n", SigintCount); - - if (AcpiGbl_MethodExecuting) - { - AcpiGbl_AbortMethod = TRUE; - signal (SIGINT, AeCtrlCHandler); - - if (SigintCount < 10) - { - return; - } - } - - (void) AcpiOsTerminate (); - exit (0); -} - - -/****************************************************************************** - * * FUNCTION: AeNotifyHandler(s) * * PARAMETERS: Standard notify handler parameters @@ -217,28 +170,34 @@ AeCommonNotifyHandler ( #if 0 case 0: - printf ("[AcpiExec] Method Error 0x%X: Results not equal\n", Value); + printf (AE_PREFIX + "Method Error 0x%X: Results not equal\n", Value); if (AcpiGbl_DebugFile) { - AcpiOsPrintf ("[AcpiExec] Method Error: Results not equal\n"); + AcpiOsPrintf (AE_PREFIX + "Method Error: Results not equal\n"); } break; case 1: - printf ("[AcpiExec] Method Error: Incorrect numeric result\n"); + printf (AE_PREFIX + "Method Error: Incorrect numeric result\n"); if (AcpiGbl_DebugFile) { - AcpiOsPrintf ("[AcpiExec] Method Error: Incorrect numeric result\n"); + AcpiOsPrintf (AE_PREFIX + "Method Error: Incorrect numeric result\n"); } break; case 2: - printf ("[AcpiExec] Method Error: An operand was overwritten\n"); + printf (AE_PREFIX + "Method Error: An operand was overwritten\n"); if (AcpiGbl_DebugFile) { - AcpiOsPrintf ("[AcpiExec] Method Error: An operand was overwritten\n"); + AcpiOsPrintf (AE_PREFIX + "Method Error: An operand was overwritten\n"); } break; @@ -246,12 +205,14 @@ AeCommonNotifyHandler ( default: - printf ("[AcpiExec] Handler %u: Received a %s Notify on [%4.4s] %p Value 0x%2.2X (%s)\n", + printf (AE_PREFIX + "Handler %u: Received a %s Notify on [%4.4s] %p Value 0x%2.2X (%s)\n", HandlerId, Type, AcpiUtGetNodeName (Device), Device, Value, AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY)); if (AcpiGbl_DebugFile) { - AcpiOsPrintf ("[AcpiExec] Handler %u: Received a %s notify, Value 0x%2.2X\n", + AcpiOsPrintf (AE_PREFIX + "Handler %u: Received a %s notify, Value 0x%2.2X\n", HandlerId, Type, Value); } @@ -282,12 +243,14 @@ AeSystemNotifyHandler ( void *Context) { - printf ("[AcpiExec] Global: Received a System Notify on [%4.4s] %p Value 0x%2.2X (%s)\n", + printf (AE_PREFIX + "Global: Received a System Notify on [%4.4s] %p Value 0x%2.2X (%s)\n", AcpiUtGetNodeName (Device), Device, Value, AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY)); if (AcpiGbl_DebugFile) { - AcpiOsPrintf ("[AcpiExec] Global: Received a System Notify, Value 0x%2.2X\n", Value); + AcpiOsPrintf (AE_PREFIX + "Global: Received a System Notify, Value 0x%2.2X\n", Value); } (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL); @@ -315,12 +278,14 @@ AeDeviceNotifyHandler ( void *Context) { - printf ("[AcpiExec] Global: Received a Device Notify on [%4.4s] %p Value 0x%2.2X (%s)\n", + printf (AE_PREFIX + "Global: Received a Device Notify on [%4.4s] %p Value 0x%2.2X (%s)\n", AcpiUtGetNodeName (Device), Device, Value, AcpiUtGetNotifyName (Value, ACPI_TYPE_ANY)); if (AcpiGbl_DebugFile) { - AcpiOsPrintf ("[AcpiExec] Global: Received a Device Notify, Value 0x%2.2X\n", Value); + AcpiOsPrintf (AE_PREFIX + "Global: Received a Device Notify, Value 0x%2.2X\n", Value); } (void) AcpiEvaluateObject (Device, "_NOT", NULL, NULL); @@ -329,108 +294,6 @@ AeDeviceNotifyHandler ( /****************************************************************************** * - * FUNCTION: AeExceptionHandler - * - * PARAMETERS: Standard exception handler parameters - * - * RETURN: Status - * - * DESCRIPTION: System exception handler for AcpiExec utility. - * - *****************************************************************************/ - -static ACPI_STATUS -AeExceptionHandler ( - ACPI_STATUS AmlStatus, - ACPI_NAME Name, - UINT16 Opcode, - UINT32 AmlOffset, - void *Context) -{ - ACPI_STATUS NewAmlStatus = AmlStatus; - ACPI_STATUS Status; - ACPI_BUFFER ReturnObj; - ACPI_OBJECT_LIST ArgList; - ACPI_OBJECT Arg[3]; - const char *Exception; - - - Exception = AcpiFormatException (AmlStatus); - AcpiOsPrintf ("[AcpiExec] Exception %s during execution ", Exception); - if (Name) - { - AcpiOsPrintf ("of method [%4.4s]", (char *) &Name); - } - else - { - AcpiOsPrintf ("at module level (table load)"); - } - - AcpiOsPrintf (" Opcode [%s] @%X\n", AcpiPsGetOpcodeName (Opcode), AmlOffset); - - /* - * Invoke the _ERR method if present - * - * Setup parameter object - */ - ArgList.Count = 3; - ArgList.Pointer = Arg; - - Arg[0].Type = ACPI_TYPE_INTEGER; - Arg[0].Integer.Value = AmlStatus; - - Arg[1].Type = ACPI_TYPE_STRING; - Arg[1].String.Pointer = ACPI_CAST_PTR (char, Exception); - Arg[1].String.Length = strlen (Exception); - - Arg[2].Type = ACPI_TYPE_INTEGER; - Arg[2].Integer.Value = AcpiOsGetThreadId(); - - /* Setup return buffer */ - - ReturnObj.Pointer = NULL; - ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - - Status = AcpiEvaluateObject (NULL, "\\_ERR", &ArgList, &ReturnObj); - if (ACPI_SUCCESS (Status)) - { - if (ReturnObj.Pointer) - { - /* Override original status */ - - NewAmlStatus = (ACPI_STATUS) - ((ACPI_OBJECT *) ReturnObj.Pointer)->Integer.Value; - - /* Free a buffer created via ACPI_ALLOCATE_BUFFER */ - - AcpiOsFree (ReturnObj.Pointer); - } - } - else if (Status != AE_NOT_FOUND) - { - AcpiOsPrintf ("[AcpiExec] Could not execute _ERR method, %s\n", - AcpiFormatException (Status)); - } - - /* Global override */ - - if (AcpiGbl_IgnoreErrors) - { - NewAmlStatus = AE_OK; - } - - if (NewAmlStatus != AmlStatus) - { - AcpiOsPrintf ("[AcpiExec] Exception override, new status %s\n\n", - AcpiFormatException (NewAmlStatus)); - } - - return (NewAmlStatus); -} - - -/****************************************************************************** - * * FUNCTION: AeTableHandler * * PARAMETERS: Table handler @@ -463,8 +326,9 @@ AeTableHandler ( Status = AcpiUpdateAllGpes (); ACPI_CHECK_OK (AcpiUpdateAllGpes, Status); - printf ("[AcpiExec] Table Event %s, [%4.4s] %p\n", - TableEvents[Event], ((ACPI_TABLE_HEADER *) Table)->Signature, Table); + printf (AE_PREFIX "Table Event %s, [%4.4s] %p\n", + TableEvents[Event], + ((ACPI_TABLE_HEADER *) Table)->Signature, Table); #endif /* !ACPI_REDUCED_HARDWARE */ return (AE_OK); @@ -488,7 +352,8 @@ AeGpeHandler ( ACPI_NAMESPACE_NODE *DeviceNode = (ACPI_NAMESPACE_NODE *) GpeDevice; - AcpiOsPrintf ("[AcpiExec] GPE Handler received GPE %02X (GPE block %4.4s)\n", + AcpiOsPrintf (AE_PREFIX + "GPE Handler received GPE %02X (GPE block %4.4s)\n", GpeNumber, GpeDevice ? DeviceNode->Name.Ascii : "FADT"); return (ACPI_REENABLE_GPE); @@ -531,8 +396,8 @@ AeGlobalEventHandler ( break; } - AcpiOsPrintf ( - "[AcpiExec] Global Event Handler received: Type %s Number %.2X Dev %p\n", + AcpiOsPrintf (AE_PREFIX + "Global Event Handler received: Type %s Number %.2X Dev %p\n", TypeName, EventNumber, Device); } @@ -554,7 +419,8 @@ AeAttachedDataHandler ( ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data); - AcpiOsPrintf ("Received an attached data deletion (1) on %4.4s\n", + AcpiOsPrintf (AE_PREFIX + "Received an attached data deletion (1) on %4.4s\n", Node->Name.Ascii); } @@ -576,7 +442,8 @@ AeAttachedDataHandler2 ( ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data); - AcpiOsPrintf ("Received an attached data deletion (2) on %4.4s\n", + AcpiOsPrintf (AE_PREFIX + "Received an attached data deletion (2) on %4.4s\n", Node->Name.Ascii); } @@ -626,7 +493,8 @@ AeSciHandler ( void *Context) { - AcpiOsPrintf ("[AcpiExec] Received an SCI at handler\n"); + AcpiOsPrintf (AE_PREFIX + "Received an SCI at handler\n"); return (0); } @@ -818,16 +686,16 @@ AeInstallEarlyHandlers ( /* Install global notify handlers */ - Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY, - AeSystemNotifyHandler, NULL); + Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT, + ACPI_SYSTEM_NOTIFY, AeSystemNotifyHandler, NULL); if (ACPI_FAILURE (Status)) { printf ("Could not install a global system notify handler, %s\n", AcpiFormatException (Status)); } - Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT, ACPI_DEVICE_NOTIFY, - AeDeviceNotifyHandler, NULL); + Status = AcpiInstallNotifyHandler (ACPI_ROOT_OBJECT, + ACPI_DEVICE_NOTIFY, AeDeviceNotifyHandler, NULL); if (ACPI_FAILURE (Status)) { printf ("Could not install a global notify handler, %s\n", diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 84907e2..e8091e8 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -467,7 +467,9 @@ main ( ACPI_DEBUG_INITIALIZE (); /* For debug version only */ - signal (SIGINT, AeCtrlCHandler); + + signal (SIGINT, AeSignalHandler); + signal (SIGSEGV, AeSignalHandler); /* Init debug globals */ diff --git a/source/tools/acpisrc/asremove.c b/source/tools/acpisrc/asremove.c index 44bf1d3..3e215ba 100644 --- a/source/tools/acpisrc/asremove.c +++ b/source/tools/acpisrc/asremove.c @@ -442,6 +442,7 @@ AsReduceTypedefs ( { char *SubString; char *SubBuffer; + char *SubSubString; int NestLevel; @@ -454,56 +455,89 @@ AsReduceTypedefs ( if (SubString) { - /* Remove the typedef itself */ + SubSubString = SubString + strlen (Keyword); - SubBuffer = SubString + strlen ("typedef") + 1; - SubBuffer = AsRemoveData (SubString, SubBuffer); + /* skip spaces */ - /* Find the opening brace of the struct or union */ + while (strchr(" \t\r\n", *SubSubString)) + { + SubSubString++; + } - while (*SubString != '{') + /* skip type name */ + + while (!strchr(" \t\r\n", *SubSubString)) { - SubString++; + SubSubString++; } - SubString++; - /* Find the closing brace. Handles nested braces */ + /* skip spaces */ - NestLevel = 1; - while (*SubString) + while (strchr(" \t\r\n", *SubSubString)) + { + SubSubString++; + } + + if (*SubSubString == '{') { - if (*SubString == '{') + /* Remove the typedef itself */ + + SubBuffer = SubString + strlen ("typedef") + 1; + SubBuffer = AsRemoveData (SubString, SubBuffer); + + /* Find the opening brace of the struct or union */ + + while (*SubString != '{') { - NestLevel++; + SubString++; } - else if (*SubString == '}') + SubString++; + + /* Find the closing brace. Handles nested braces */ + + NestLevel = 1; + while (*SubString) { - NestLevel--; + if (*SubString == '{') + { + NestLevel++; + } + else if (*SubString == '}') + { + NestLevel--; + } + + SubString++; + + if (NestLevel == 0) + { + break; + } } - SubString++; + /* Remove an extra line feed if present */ - if (NestLevel == 0) + if (!strncmp (SubString - 3, "\n\n", 2)) { - break; + *(SubString -2) = '}'; + SubString--; } - } - - /* Remove an extra line feed if present */ - if (!strncmp (SubString - 3, "\n\n", 2)) - { - *(SubString -2) = '}'; - SubString--; - } + /* Find the end of the typedef name */ - /* Find the end of the typedef name */ + SubBuffer = AsSkipUntilChar (SubString, ';'); - SubBuffer = AsSkipUntilChar (SubString, ';'); + /* And remove the typedef name */ - /* And remove the typedef name */ + SubBuffer = AsRemoveData (SubString, SubBuffer); + } + else + { + /* Skip the entire definition */ - SubBuffer = AsRemoveData (SubString, SubBuffer); + SubString = strchr (SubString, ';') + 1; + SubBuffer = SubString; + } } } } diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index ff45e50..d9697b4 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -186,6 +186,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_BUS_ATTRIBUTE", SRC_TYPE_STRUCT}, {"ACPI_CACHE_T", SRC_TYPE_SIMPLE}, {"ACPI_CMTABLE_HANDLER", SRC_TYPE_SIMPLE}, + {"ACPI_COMMENT_ADDR_NODE", SRC_TYPE_STRUCT}, + {"ACPI_COMMENT_NODE", SRC_TYPE_STRUCT}, {"ACPI_COMMON_FACS", SRC_TYPE_STRUCT}, {"ACPI_COMMON_STATE", SRC_TYPE_STRUCT}, {"ACPI_COMMON_DESCRIPTOR", SRC_TYPE_STRUCT}, @@ -209,6 +211,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_DMTABLE_DATA", SRC_TYPE_STRUCT}, {"ACPI_DMTABLE_INFO", SRC_TYPE_STRUCT}, {"ACPI_DMTABLE_HANDLER", SRC_TYPE_SIMPLE}, + {"ACPI_EFI_FILE", SRC_TYPE_SIMPLE}, {"ACPI_EVALUATE_INFO", SRC_TYPE_STRUCT}, {"ACPI_EVENT_HANDLER", SRC_TYPE_SIMPLE}, {"ACPI_EVENT_STATUS", SRC_TYPE_SIMPLE}, @@ -223,6 +226,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_FADT_INFO", SRC_TYPE_STRUCT}, {"ACPI_FADT_PM_INFO", SRC_TYPE_STRUCT}, {"ACPI_FIELD_INFO", SRC_TYPE_STRUCT}, + {"ACPI_FILE_NODE", SRC_TYPE_STRUCT}, {"ACPI_FIND_CONTEXT", SRC_TYPE_STRUCT}, {"ACPI_FIXED_EVENT_HANDLER", SRC_TYPE_STRUCT}, {"ACPI_FIXED_EVENT_INFO", SRC_TYPE_STRUCT}, @@ -486,6 +490,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"AE_DEBUG_REGIONS", SRC_TYPE_STRUCT}, {"AE_REGION", SRC_TYPE_STRUCT}, {"ASL_ANALYSIS_WALK_INFO", SRC_TYPE_STRUCT}, + {"ASL_COMMENT_STATE", SRC_TYPE_STRUCT}, + {"ASL_COMMENT_TYPES", SRC_TYPE_SIMPLE}, {"ASL_ERROR_MSG", SRC_TYPE_STRUCT}, {"ASL_ERROR_MSG", SRC_TYPE_STRUCT}, {"ASL_EVENT_INFO", SRC_TYPE_STRUCT}, @@ -525,6 +531,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_FPDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_GTDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_HEST", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_HMAT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_HPET", SRC_TYPE_STRUCT}, {"ACPI_TABLE_IBFT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_IORT", SRC_TYPE_STRUCT}, @@ -537,6 +544,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_MSDM", SRC_TYPE_STRUCT}, {"ACPI_TABLE_NFIT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_PCCT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_PPTT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_RSDP", SRC_TYPE_STRUCT}, {"ACPI_TABLE_RSDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MCHI", SRC_TYPE_STRUCT}, @@ -556,6 +564,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_WDDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_WDRT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_WPBT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_WSMT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_XENV", SRC_TYPE_STRUCT}, {"ACPI_TABLE_XSDT", SRC_TYPE_STRUCT}, @@ -611,6 +620,10 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_HEST_GENERIC_STATUS", SRC_TYPE_STRUCT}, {"ACPI_HEST_GENERIC_DATA", SRC_TYPE_STRUCT}, {"ACPI_HEST_GENERIC_DATA_V300", SRC_TYPE_STRUCT}, + {"ACPI_HEST_IA_DEFERRED_CHECK", SRC_TYPE_STRUCT}, + {"ACPI_HMAT_ADDRESS_RANGE", SRC_TYPE_STRUCT}, + {"ACPI_HMAT_LOCALITY", SRC_TYPE_STRUCT}, + {"ACPI_HMAT_CACHE", SRC_TYPE_STRUCT}, {"ACPI_IBFT_HEADER", SRC_TYPE_STRUCT}, {"ACPI_IBFT_CONTROL", SRC_TYPE_STRUCT}, {"ACPI_IBFT_INITIATOR", SRC_TYPE_STRUCT}, @@ -666,22 +679,30 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_NFIT_CONTROL_REGION", SRC_TYPE_STRUCT}, {"ACPI_NFIT_DATA_REGION", SRC_TYPE_STRUCT}, {"ACPI_NFIT_FLUSH_ADDRESS", SRC_TYPE_STRUCT}, + {"ACPI_PCCT_EXT_PCC_SHARED_MEMORY", SRC_TYPE_STRUCT}, {"ACPI_PCCT_HW_REDUCED", SRC_TYPE_STRUCT}, {"ACPI_PCCT_HW_REDUCED_TYPE2", SRC_TYPE_STRUCT}, + {"ACPI_PCCT_EXT_PCC_MASTER", SRC_TYPE_STRUCT}, + {"ACPI_PCCT_EXT_PCC_SLAVE", SRC_TYPE_STRUCT}, {"ACPI_PCCT_SHARED_MEMORY", SRC_TYPE_STRUCT}, {"ACPI_PCCT_SUBSPACE", SRC_TYPE_STRUCT}, + {"ACPI_PPTT_PROCESSOR", SRC_TYPE_STRUCT}, + {"ACPI_PPTT_CACHE", SRC_TYPE_STRUCT}, + {"ACPI_PPTT_ID", SRC_TYPE_STRUCT}, {"ACPI_RSDP_COMMON", SRC_TYPE_STRUCT}, {"ACPI_RSDP_EXTENSION", SRC_TYPE_STRUCT}, {"ACPI_S3PT_RESUME", SRC_TYPE_STRUCT}, {"ACPI_S3PT_SUSPEND", SRC_TYPE_STRUCT}, {"ACPI_SRAT_CPU_AFFINITY", SRC_TYPE_STRUCT}, {"ACPI_SRAT_HEADER", SRC_TYPE_STRUCT}, + {"ACPI_SRAT_GIC_ITS_AFFINITY", SRC_TYPE_STRUCT}, + {"ACPI_SRAT_GICC_AFFINITY", SRC_TYPE_STRUCT}, {"ACPI_SRAT_MEM_AFFINITY", SRC_TYPE_STRUCT}, {"ACPI_SRAT_X2APIC_CPU_AFFINITY", SRC_TYPE_STRUCT}, - {"ACPI_SRAT_GICC_AFFINITY", SRC_TYPE_STRUCT}, {"ACPI_TABLE_TCPA_CLIENT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_TCPA_SERVER", SRC_TYPE_STRUCT}, - {"ACPI_TPM2_CONTROL", SRC_TYPE_STRUCT}, + {"ACPI_TPM2_TRAILER", SRC_TYPE_STRUCT}, + {"ACPI_TPM2_ARM_SMC", SRC_TYPE_STRUCT}, {"ACPI_WDAT_ENTRY", SRC_TYPE_STRUCT}, /* Data Table compiler */ diff --git a/tests/aslts.sh b/tests/aslts.sh index a071991..7ad7199 100755 --- a/tests/aslts.sh +++ b/tests/aslts.sh @@ -128,7 +128,7 @@ run_aslts() { fi # Execute the test suite - if [ "$BINCOMPONLY" == "no" ]; then + if [ "x$BINCOMPONLY" = "xno" ]; then echo "" echo "ASL Test Suite Started: `date`" start_time=$(date) diff --git a/tests/aslts/Makefile.def b/tests/aslts/Makefile.def index 55e3849..ab55a17 100644 --- a/tests/aslts/Makefile.def +++ b/tests/aslts/Makefile.def @@ -75,12 +75,19 @@ install_all_modes_of_test_case: ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/% "$(ASL)" $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ ret=$$?; \ echo "" >> $(COMPILER_LOG); \ - if [ $(OPT) -eq 0 ]; then \ + if [ $(OPT) -eq 0 ] && [ "x$(ADD_ASLFLAGS)" != "x-f" ]; then \ for k in ${AMLMOD}; do \ + >&2 printf " => Compile Ext in-place"; \ + "$(ASL)" -p $$k-extInPlace -oE $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS) $$j.asl >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ + if [ ! -f $$k-extInPlace.aml ]; then \ + >&2 printf " [[ Error: disassembly failed of $$k.aml failed ]]\n"; \ + >&2 printf " Flags used: -p $$k-aslminus -oE -cr -vs $$CUR_ASLFLAGS $(ADD_ASLFLAGS) -od -dl\n\n"; \ + #exit 1; \ + fi; \ >&2 printf " => Disassemble"; \ echo "---- Diasassemble: $$k.aml" >> $(COMPILER_LOG); \ echo "---- Diasassemble: $$k.aml" >> $(COMPILER_ERROR_LOG); \ - "$(ASL)" -p $$k-aslminus -cr -vs $$CUR_ASLFLAGS $(ADD_ASLFLAGS) -od -dl $$k.aml >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ + "$(ASL)" -p $$k-aslminus -oe -cr -vs $$CUR_ASLFLAGS $(ADD_ASLFLAGS) -od -dl $$k-extInPlace.aml >> $(COMPILER_LOG) 2>> $(COMPILER_ERROR_LOG); \ if [ ! -f $$k-aslminus.dsl ]; then \ >&2 printf " [[ Error: disassembly failed of $$k.aml failed ]]\n"; \ >&2 printf " Flags used: -p $$k-aslminus -cr -vs $$CUR_ASLFLAGS $(ADD_ASLFLAGS) -od -dl\n\n"; \ @@ -95,17 +102,9 @@ install_all_modes_of_test_case: ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/% >&2 printf " Flags used: $$CUR_ASLFLAGS "$(COMMON_ASL_FLAGS)" $(ADD_ASLFLAGS)\n\n"; \ #exit 1; \ fi; \ - rm $$k-aslminus.asm; \ - rm $$k-aslminus.c; \ - rm $$k-aslminus.h; \ - rm $$k-aslminus.i; \ - rm $$k-aslminus.hex; \ - rm $$k-aslminus.map; \ - rm $$k-aslminus.nsp; \ - rm $$k-aslminus.offset.h; \ - rm $$k-aslminus.src; \ if [ $$CUR_AMLDIR = "nopt/32" ] || [ $$CUR_AMLDIR = "nopt/64" ]; then \ >&2 printf " => Binary compare"; \ + rm -f comparison_output.txt; \ acpibin -c $$k.aml $$k-aslminus.aml >> comparison_output.txt; \ if [ $$? != 0 ]; then \ >&2 printf " [[ Error: comparison of $$k.aml and $$k-aslminus.aml do not match ]]"; \ @@ -115,12 +114,23 @@ install_all_modes_of_test_case: ${SETOF_AMLDIRS:%=$(TOP)/tmp/aml/$(aslversion)/% >&2 printf " "; \ #exit 1; \ else \ - >&2 printf " => Removing files"; \ - rm $$k-aslminus.lst; \ - rm $$k-aslminus.aml; \ - rm $$k-aslminus.dsl; \ + >&2 printf " => Success!"; \ + rm comparison_output.txt; \ fi; \ fi; \ + if [ ! -f comparison_output.txt ]; then \ + >&2 printf " => Removing files"; \ + rm $$k-aslminus.lst; \ + rm $$k-aslminus.aml; \ + rm $$k-aslminus.dsl; \ + fi; \ + for n in "$$k-aslminus" "$$k-extInPlace"; do \ + rm $$n.i $$n.asm $$n.nsp; \ + rm $$n.c $$n.hex $$n.map; \ + rm $$n.h $$n.src $$n.offset.h; \ + done; \ + rm $$k-extInPlace.aml; \ + rm $$k-extInPlace.lst; \ >&2 printf " => Done"; \ done; \ fi; \ diff --git a/tests/aslts/bin/common b/tests/aslts/bin/common index 22704c5..f2743a8 100755 --- a/tests/aslts/bin/common +++ b/tests/aslts/bin/common @@ -362,6 +362,8 @@ get_test_case_dir() path="`get_collection_dir "$1" $2`/ACPICA/tests/$3" elif [ $3 == bdemo -o $3 == bdemof ]; then path="`get_collection_dir "$1" $2`/ACPICA/$3" + elif [ $3 == extra -o $3 == extra_aslts ]; then + path="`get_collection_dir "$1" $2`/abbu" elif [[ $3 == mt_* ]]; then x=`echo $3 | sed 's/mt_//'g` path="`get_collection_dir "$1" $2`/$x" diff --git a/tests/aslts/bin/settings b/tests/aslts/bin/settings index 2a014c1..0c9cf20 100755 --- a/tests/aslts/bin/settings +++ b/tests/aslts/bin/settings @@ -13,7 +13,7 @@ INIT_ALL_AVAILABLE_CASES() FUNC_COLL="arithmetic bfield constant control descriptor" FUNC_COLL="$FUNC_COLL logic manipulation name reference region synchronization" - FUNC_COLL="$FUNC_COLL table module" + FUNC_COLL="$FUNC_COLL table module external" # Complex test collection @@ -112,7 +112,7 @@ INIT_SET_OF_TEST_CASES() func="arithmetic bfield constant control descriptor" func="$func logic manipulation name reference region synchronization" - func="$func table" + func="$func table external" # Complex test collection diff --git a/tests/aslts/src/runtime/cntl/common.asl b/tests/aslts/src/runtime/cntl/common.asl index 7247de8..19cbd79 100644 --- a/tests/aslts/src/runtime/cntl/common.asl +++ b/tests/aslts/src/runtime/cntl/common.asl @@ -1461,7 +1461,7 @@ Name(TNF0, Package() { "constant", "control", "descriptor", - "extern", + "external", "local", "logic", "manipulation", @@ -1710,7 +1710,7 @@ Name(TFN0, Package() { "recursion.asl", "ns-scope.asl", // 178 "ns-fullpath.asl", - "scope.asl", + "scope.asl", // 180 "object.asl", "order.asl", @@ -1720,24 +1720,38 @@ Name(TFN0, Package() { "I2MS_ns_dv00.asl", "I2MS_ns_dv10.asl", "I2MS_ns_dv20.asl", - "I2MS_ns_dv30.asl", // 170 + "I2MS_ns_dv30.asl", "I2MS_ns_device.asl", "I2MS_ns_device_abbu.asl", "I2MS_ns_device_aslts.asl", // see these files can be not used at all: - "I2MS_ns4.asl", + + "I2MS_ns4.asl", // 190 "I2MS_ns5.asl", "I2MS_ns6.asl", // ACPI 5.0 - "fixeddma.asl", // 177 - "gpioint.asl", - "gpioio.asl", - "i2cserialbus.asl", - "spiserialbus.asl", - "uartserialbus.asl", + + "fixeddma.asl", + "gpioint.asl", + "gpioio.asl", + "i2cserialbus.asl", + "spiserialbus.asl", + "uartserialbus.asl", + +// ACPI 6.2 + + "pinfunction.asl", + "pinconfig.asl", // 200 + "pingroup.asl", + "pingroupfunction.asl", + "pingroupconfig.asl", + +// External Op tests + + "external.asl" // 204 }) /* diff --git a/tests/aslts/src/runtime/cntl/ehandle.asl b/tests/aslts/src/runtime/cntl/ehandle.asl index d87c681..4d34d06 100644 --- a/tests/aslts/src/runtime/cntl/ehandle.asl +++ b/tests/aslts/src/runtime/cntl/ehandle.asl @@ -26,8 +26,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -External (_ERR, MethodObj) - /* * Exceptional conditions support */ diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0257/DECL.asl b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0257/DECL.asl index 3ea9810..c24e7cf 100644 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0257/DECL.asl +++ b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0257/DECL.asl @@ -32,6 +32,22 @@ * SUMMARY: Unexpected AE_AML_OPERAND_TYPE when the Object in Load is a Region Field */ +/* + * Original source code: + + DefinitionBlock("ssdt.aml", "SSDT", 0x02, "Intel", "Many", 0x00000001) + { + Device(AUXD) + { + Method(M000) + { + Return ("\\AUXD.M000 ()") + } + } + } + + */ + Name(B257, Buffer() { 0x53,0x53,0x44,0x54,0x42,0x00,0x00,0x00, /* 00000000 "SSDTB..." */ diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0257/ssdt.c b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0257/ssdt.c deleted file mode 100644 index d43dfe9..0000000 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0257/ssdt.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Intel ACPI Component Architecture - * ASL Optimizing Compiler version 20061011 [Oct 12 2006] - * Copyright (C) 2000 - 2006 Intel Corporation - * Supports ACPI Specification Revision 3.0a - * - * Compilation of "ssdt.asl" - Mon Oct 16 10:59:20 2006 - * - */ - /* - * 1.... - * 2....DefinitionBlock( - * 3.... "ssdt.aml", ** Output filename - * 4.... "SSDT", ** Signature - * 5.... 0x02, ** DSDT Revision - * 6.... "Intel", ** OEMID - * 7.... "Many", ** TABLE ID - * 8.... 0x00000001 ** OEM Revision - * 9.... ) { - */ - unsigned char SSDT_Many_Header [] = - { - 0x53,0x53,0x44,0x54,0x42,0x00,0x00,0x00,0x02,0x81,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000000 "SSDTB.....Intel." */ - 0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000010 "Many........INTL" */ - 0x11,0x10,0x06,0x20, /* 00000014 "... " */ - }; - - /* - * 10.... - * 11.... Device(AUXD) { - */ - unsigned char SSDT_Many_AUXD [] = - { - 0x5B,0x82,0x1C,0x41,0x55,0x58,0x44, /* 0000001B "[..AUXD" */ - }; - - /* - * 12.... Method(M000) {Return ("\\AUXD.M000 ()")} - */ - unsigned char SSDT_Many_AUXD_M000 [] = - { - 0x14,0x16,0x4D,0x30,0x30,0x30,0x00, /* 00000022 "..M000." */ - 0xA4,0x0D,0x5C,0x41,0x55,0x58,0x44,0x2E,0x4D,0x30,0x30,0x30,0x20,0x28,0x29,0x00, /* 00000032 "..\AUXD.M000 ()." */ - /* - * 13.... } - * 14....} - * 15.... - */ - }; - diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0258/DECL.asl b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0258/DECL.asl index 4ddeecd..aff409a 100644 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0258/DECL.asl +++ b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0258/DECL.asl @@ -33,6 +33,22 @@ * is not in SystemMemory */ +/* + * Original source code: + + DefinitionBlock("ssdt.aml", "SSDT", 0x02, "Intel", "Many", 0x00000001) + { + Device(AUXD) + { + Method(M000) + { + Return ("\\AUXD.M000 ()") + } + } + } + + */ + Name(B258, Buffer() { 0x53,0x53,0x44,0x54,0x42,0x00,0x00,0x00, /* 00000000 "SSDTB..." */ diff --git a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0258/ssdt.c b/tests/aslts/src/runtime/collections/bdemo/ACPICA/0258/ssdt.c deleted file mode 100644 index d43dfe9..0000000 --- a/tests/aslts/src/runtime/collections/bdemo/ACPICA/0258/ssdt.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Intel ACPI Component Architecture - * ASL Optimizing Compiler version 20061011 [Oct 12 2006] - * Copyright (C) 2000 - 2006 Intel Corporation - * Supports ACPI Specification Revision 3.0a - * - * Compilation of "ssdt.asl" - Mon Oct 16 10:59:20 2006 - * - */ - /* - * 1.... - * 2....DefinitionBlock( - * 3.... "ssdt.aml", ** Output filename - * 4.... "SSDT", ** Signature - * 5.... 0x02, ** DSDT Revision - * 6.... "Intel", ** OEMID - * 7.... "Many", ** TABLE ID - * 8.... 0x00000001 ** OEM Revision - * 9.... ) { - */ - unsigned char SSDT_Many_Header [] = - { - 0x53,0x53,0x44,0x54,0x42,0x00,0x00,0x00,0x02,0x81,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000000 "SSDTB.....Intel." */ - 0x4D,0x61,0x6E,0x79,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000010 "Many........INTL" */ - 0x11,0x10,0x06,0x20, /* 00000014 "... " */ - }; - - /* - * 10.... - * 11.... Device(AUXD) { - */ - unsigned char SSDT_Many_AUXD [] = - { - 0x5B,0x82,0x1C,0x41,0x55,0x58,0x44, /* 0000001B "[..AUXD" */ - }; - - /* - * 12.... Method(M000) {Return ("\\AUXD.M000 ()")} - */ - unsigned char SSDT_Many_AUXD_M000 [] = - { - 0x14,0x16,0x4D,0x30,0x30,0x30,0x00, /* 00000022 "..M000." */ - 0xA4,0x0D,0x5C,0x41,0x55,0x58,0x44,0x2E,0x4D,0x30,0x30,0x30,0x20,0x28,0x29,0x00, /* 00000032 "..\AUXD.M000 ()." */ - /* - * 13.... } - * 14....} - * 15.... - */ - }; - diff --git a/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl b/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl index cd75a05..ef8d2cd 100644 --- a/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl +++ b/tests/aslts/src/runtime/collections/complex/result/common/rcommon.asl @@ -272,9 +272,9 @@ Name(p6a0, Package(){ Buffer() {1,0,0,0,1,1,0}, Buffer() {1,0,0,1,1,1,1}, Buffer() {1,0,0,1,1,1,1}, - Buffer() {1,0,0,0,1,1,0}, - Buffer() {1,0,0,0,1,1,0}, - Buffer() {1,0,0,0,1,1,0}, + Buffer() {1,1,1,0,1,1,0}, + Buffer() {1,1,1,1,1,1,0}, + Buffer() {1,1,1,1,1,1,0}, Buffer() {1,0,0,0,1,1,0}, }) @@ -1938,6 +1938,8 @@ if (y361) { if (STCS) {m000(2, 0x100, arg2, arg3)} } } + // No further test if exception is expected + Return (0) } elseif (CH03(arg0, z122, 58, arg3, arg2)) { // Storing caused unexpected exception if (STCS) {m000(2, 0x100, arg2, arg3)} @@ -2327,6 +2329,8 @@ if (y361) { if (STCS) {m000(2, 0x100, arg2, arg3)} } } + // No further test if exception is expected + Return (0) } elseif (CH03(arg0, z122, 71, arg3, arg2)) { // Storing caused unexpected exception if (STCS) {m000(2, 0x100, arg2, arg3)} diff --git a/tests/aslts/src/runtime/collections/functional/Makefile b/tests/aslts/src/runtime/collections/functional/Makefile index 52c90b1..baef034 100644 --- a/tests/aslts/src/runtime/collections/functional/Makefile +++ b/tests/aslts/src/runtime/collections/functional/Makefile @@ -12,7 +12,8 @@ MDIRS = \ reference \ region \ synchronization \ - table + table \ + external # extern local FULL diff --git a/tests/aslts/src/runtime/collections/functional/descriptor/DECL.asl b/tests/aslts/src/runtime/collections/functional/descriptor/DECL.asl index 89626b2..2b99e2f 100644 --- a/tests/aslts/src/runtime/collections/functional/descriptor/DECL.asl +++ b/tests/aslts/src/runtime/collections/functional/descriptor/DECL.asl @@ -71,3 +71,11 @@ Include("../../../../runtime/collections/functional/descriptor/gpioio.asl") Include("../../../../runtime/collections/functional/descriptor/i2cserialbus.asl") Include("../../../../runtime/collections/functional/descriptor/spiserialbus.asl") Include("../../../../runtime/collections/functional/descriptor/uartserialbus.asl") + +/* ACPI 6.2 Resource Descriptors */ + +Include("../../../../runtime/collections/functional/descriptor/pinfunction.asl") +Include("../../../../runtime/collections/functional/descriptor/pinconfig.asl") +Include("../../../../runtime/collections/functional/descriptor/pingroup.asl") +Include("../../../../runtime/collections/functional/descriptor/pingroupfunction.asl") +Include("../../../../runtime/collections/functional/descriptor/pingroupconfig.asl") diff --git a/tests/aslts/src/runtime/collections/functional/descriptor/RUN.asl b/tests/aslts/src/runtime/collections/functional/descriptor/RUN.asl index 44d422a..083d093 100644 --- a/tests/aslts/src/runtime/collections/functional/descriptor/RUN.asl +++ b/tests/aslts/src/runtime/collections/functional/descriptor/RUN.asl @@ -96,6 +96,16 @@ if (STTT("Resource Descriptor macros", TCLF, 4, W004)) { RT24() SRMT("RT25") RT25() + SRMT("RT26") + RT26() + SRMT("RT27") + RT27() + SRMT("RT28") + RT28() + SRMT("RT29") + RT29() + SRMT("RT30") + RT30() } FTTT() diff --git a/tests/aslts/src/runtime/collections/functional/descriptor/pinconfig.asl b/tests/aslts/src/runtime/collections/functional/descriptor/pinconfig.asl new file mode 100644 index 0000000..e4a3ed0 --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/descriptor/pinconfig.asl @@ -0,0 +1,537 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Resource Descriptor macros + * + * PinConfig Resource Descriptor Macro + */ + +Name (P45E, Package() { + ResourceTemplate () { + PinConfig(Exclusive, 0x00 /* Default */, 0x1000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x01 /* Bias Pull-up */, 0x2000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x02 /* Bias Pull-down */, 0x3000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x03 /* Bias Default */, 0x4000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x04 /* Bias Disable */, 0x5000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x05 /* Bias High Impedance */, 0x6000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x06 /* Bias Bus Hold */, 0x7000,"\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x07 /* Drive Open Drain */, 0x8000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x08 /* Drive Open Source */, 0x9000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x09 /* Drive Push Pull */, 0xa000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x0a /* Drive Strength */, 0xb000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x0b /* Slew Rate */, 0xc000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x0c /* Input Debounce */, 0xd000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x0d /* Input Schmitt Trigger */, 0xe000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0x80 /* Vendor defined */, 0xf000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Exclusive, 0xfe /* Vendor defined */, 0xf100, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x00 /* Default */, 0x1000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x01 /* Bias Pull-up */, 0x2000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x02 /* Bias Pull-down */, 0x3000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x03 /* Bias Default */, 0x4000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x04 /* Bias Disable */, 0x5000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x05 /* Bias High Impedance */, 0x6000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x06 /* Bias Bus Hold */, 0x7000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x07 /* Drive Open Drain */, 0x8000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x08 /* Drive Open Source */, 0x9000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x09 /* Drive Push Pull */, 0xa000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x0a /* Drive Strength */, 0xb000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x0b /* Slew Rate */, 0xc000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x0c /* Input Debounce */, 0xd000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x0d /* Input Schmitt Trigger */, 0xe000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0x80 /* Vendor defined */, 0xf000, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(Shared, 0xfe /* Vendor defined */, 0xf100, "\\SB.GP01", 0x0, + ResourceConsumer,, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + }, + ResourceTemplate () { + PinConfig(, 0x00 /* Default */, 0x0000, "\\SB.GP01") + {0x1, 0x2} + }, +}) + +Name (P45F, Package () +{ + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, /* .%...... */ + /* 0008 */ 0x10, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, /* .%...... */ + /* 0008 */ 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0x0D, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, /* .%...... */ + /* 0008 */ 0x30, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* 0....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x03, 0x00, /* .%...... */ + /* 0008 */ 0x40, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* @....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x04, 0x00, /* .%...... */ + /* 0008 */ 0x50, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* P....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x05, 0x00, /* .%...... */ + /* 0008 */ 0x60, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* `....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x06, 0x00, /* .%...... */ + /* 0008 */ 0x70, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* p....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x07, 0x00, /* .%...... */ + /* 0008 */ 0x80, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x08, 0x00, /* .%...... */ + /* 0008 */ 0x90, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x09, 0x00, /* .%...... */ + /* 0008 */ 0xA0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x0A, 0x00, /* .%...... */ + /* 0008 */ 0xB0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x0B, 0x00, /* .%...... */ + /* 0008 */ 0xC0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x0C, 0x00, /* .%...... */ + /* 0008 */ 0xD0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x0D, 0x00, /* .%...... */ + /* 0008 */ 0xE0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0x80, 0x00, /* .%...... */ + /* 0008 */ 0xF0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x02, 0x00, 0xFE, 0x00, /* .%...... */ + /* 0008 */ 0xF1, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, /* .%...... */ + /* 0008 */ 0x10, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x01, 0x00, /* .%...... */ + /* 0008 */ 0x20, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0x0D, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x02, 0x00, /* .%...... */ + /* 0008 */ 0x30, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* 0....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x03, 0x00, /* .%...... */ + /* 0008 */ 0x40, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* @....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x04, 0x00, /* .%...... */ + /* 0008 */ 0x50, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* P....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x05, 0x00, /* .%...... */ + /* 0008 */ 0x60, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* `....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x06, 0x00, /* .%...... */ + /* 0008 */ 0x70, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* p....... */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x07, 0x00, /* .%...... */ + /* 0008 */ 0x80, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00, /* .%...... */ + /* 0008 */ 0x90, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x09, 0x00, /* .%...... */ + /* 0008 */ 0xA0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x0A, 0x00, /* .%...... */ + /* 0008 */ 0xB0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x0B, 0x00, /* .%...... */ + /* 0008 */ 0xC0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x0C, 0x00, /* .%...... */ + /* 0008 */ 0xD0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x0D, 0x00, /* .%...... */ + /* 0008 */ 0xE0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0x80, 0x00, /* .%...... */ + /* 0008 */ 0xF0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x2A) + { + /* 0000 */ 0x8F, 0x25, 0x00, 0x01, 0x03, 0x00, 0xFE, 0x00, /* .%...... */ + /* 0008 */ 0xF1, 0x00, 0x00, 0x14, 0x00, 0x00, 0x1C, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x03, 0x00, 0xAA, 0x00, 0xBB, 0x00, /* %....... */ + /* 0018 */ 0xCC, 0x00, 0xDD, 0x00, 0x5C, 0x53, 0x42, 0x2E, /* ....\SB. */ + /* 0020 */ 0x47, 0x50, 0x30, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* GP01.... */ + /* 0028 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x23) + { + /* 0000 */ 0x8F, 0x1E, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, /* ........ */ + /* 0008 */ 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x18, 0x00, /* ........ */ + /* 0010 */ 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, /* !....... */ + /* 0018 */ 0x5C, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x30, 0x31, /* \SB.GP01 */ + /* 0020 */ 0x00, 0x79, 0x00 /* .y. */ + } +}) + +Method(RT27,, Serialized) +{ + Name(TS, "RT27") + + // Emit test header, set the filename + + THDR (TS, "PinConfig Resource Descriptor Macro", __FILE__) + + // The main test packages must have the same number of entries + + If (LNotEqual (SizeOf (P45E), SizeOf (P45F))) + { + Err (TS, 179, 0, 0, 0, 0, "Incorrect package length") + Return () + } + + // Main test case for packages above + + m330(TS, SizeOf (P45E), "P45E", P45E, P45F) + + // Check resource descriptor tag offsets + Local0 = ResourceTemplate () { + PinConfig(Shared, 0x0c /* Input Debounce */, 0xabcd, "\\SB.GP01", 0x0, + ResourceConsumer, C0, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + PinConfig(Shared, 0x0c /* Input Debounce */, 0xabcd, "\\SB.GP01", 0x0, + ResourceConsumer, C1, RawDataBuffer () {0xa, 0xb, 0xc}) + {0xaa, 0xbb, 0xcc, 0xdd} + } + + m331(TS, 1, C0._SHR, 0x20, C1._SHR, 0x160, "_SHR") + m331(TS, 1, C0._TYP, 0x30, C1._TYP, 0x170, "_TYP") + m331(TS, 1, C0._VAL, 0x38, C1._VAL, 0x178, "_VAL") + m331(TS, 1, C0._PIN, 0xa0, C1._PIN, 0x1e0, "_PIN") + m331(TS, 1, C0._VEN, 0x128, C1._VEN, 0x268, "_VEN") +} diff --git a/tests/aslts/src/runtime/collections/functional/descriptor/pinfunction.asl b/tests/aslts/src/runtime/collections/functional/descriptor/pinfunction.asl new file mode 100644 index 0000000..95b14c1 --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/descriptor/pinfunction.asl @@ -0,0 +1,191 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Resource Descriptor macros + * + * PinFunction Resource Descriptor Macro + */ + +Name (P45C, Package() { + ResourceTemplate () { + PinFunction(Exclusive, PullDefault, 0x1000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(Exclusive, PullDown, 0x2000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(Exclusive, PullUp, 0x3000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(Exclusive, PullNone, 0x4000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(Shared, PullDefault, 0x1000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(Shared, PullDown, 0x2000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(Shared, PullUp, 0x3000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(Shared, PullNone, 0x4000, "\\_SB.GPO1", 0x0, + ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + }, + ResourceTemplate () { + PinFunction(, PullNone, 0xabcd, "\\_SB.GPO1",,) + {0x11} + }, +}) + +Name (P45D, Package() { + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* .#...... */ + /* 0008 */ 0x10, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* ......". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, /* .#...... */ + /* 0008 */ 0x20, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* .....". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, /* .#...... */ + /* 0008 */ 0x30, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* 0.....". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x00, 0x00, 0x03, 0x00, /* .#...... */ + /* 0008 */ 0x40, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* @.....". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, /* .#...... */ + /* 0008 */ 0x10, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* ......". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x01, 0x00, 0x02, 0x00, /* .#...... */ + /* 0008 */ 0x20, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* .....". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, /* .#...... */ + /* 0008 */ 0x30, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* 0.....". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x8D, 0x23, 0x00, 0x01, 0x01, 0x00, 0x03, 0x00, /* .#...... */ + /* 0008 */ 0x40, 0x12, 0x00, 0x00, 0x18, 0x00, 0x22, 0x00, /* @.....". */ + /* 0010 */ 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, /* ........ */ + /* 0018 */ 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, 0x4F, /* \_SB.GPO */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x20) + { + /* 0000 */ 0x8D, 0x1B, 0x00, 0x01, 0x00, 0x00, 0x03, 0xCD, /* ........ */ + /* 0008 */ 0xAB, 0x12, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x00, 0x00, 0x11, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* ....\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x31, 0x00, 0x79, 0x00 /* .GPO1.y. */ + } +}) + +Method(RT26,, Serialized) +{ + Name(TS, "RT26") + + // Emit test header, set the filename + + THDR (TS, "PinFunction Resource Descriptor Macro", __FILE__) + + // The main test packages must have the same number of entries + + If (LNotEqual (SizeOf (P45C), SizeOf (P45D))) + { + Err (TS, 179, 0, 0, 0, 0, "Incorrect package length") + Return () + } + + // Main test case for packages above + + m330(TS, SizeOf (P45C), "P45C", P45C, P45D) + + // Check resource descriptor tag offsets + + Local0 = ResourceTemplate () { + PinFunction(Exclusive, PullDefault, 0x1234, "\\_SB.GPO1", 0x0, + ResourceConsumer, F0, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + PinFunction(Exclusive, PullDefault, 0x1234, "\\_SB.GPO1", 0x0, + ResourceConsumer, F1, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + {0x1, 0x2, 0x3} + } + + m331(TS, 1, F0._SHR, 0x20, F1._SHR, 0x150, "_SHR") + m331(TS, 2, F0._PPI, 0x30, F1._PPI, 0x160, "_PPI") + m331(TS, 3, F0._FUN, 0x38, F1._FUN, 0x168, "_FUN") + m331(TS, 4, F0._VEN, 0x110, F1._VEN, 0x240, "_VEN") +} diff --git a/tests/aslts/src/runtime/collections/functional/descriptor/pingroup.asl b/tests/aslts/src/runtime/collections/functional/descriptor/pingroup.asl new file mode 100644 index 0000000..401e0a4 --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/descriptor/pingroup.asl @@ -0,0 +1,188 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Resource Descriptor macros + * + * PinGroup Resource Descriptor Macro + */ + +Name (P460, Package() { + ResourceTemplate () { + PinGroup ("group1", ResourceProducer, GRP1, + RawDataBuffer () {0xaa, 0xbb, 0xcc}) {1, 2, 3, 4} + }, + ResourceTemplate () { + PinGroup ("group2", ResourceProducer, GRP2) {1, 2, 3, 4} + }, + ResourceTemplate () { + PinGroup ("group3", ResourceProducer) {1, 2, 3, 4} + }, + ResourceTemplate () { + PinGroup ("group4") {1, 2, 3, 4} + }, + ResourceTemplate () { + PinGroup ("group5",, GRP3) {1, 2, 3, 4} + }, + ResourceTemplate () { + PinGroup ("group6",,, RawDataBuffer () {0xaa, 0xbb, 0xcc}) {1, 2, 3, 4} + }, + ResourceTemplate () { + PinGroup ("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + ,, RawDataBuffer () {0xaa, 0xbb, 0xcc}) {1, 2, 3, 4} + }, + // Minimal + ResourceTemplate () { + PinGroup ("a") {1, 2, 3, 4} + }, +}) + +Name (P461, Package () { + Buffer (0x22) + { + /* 0000 */ 0x90, 0x1D, 0x00, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x1D, 0x00, 0x03, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x67, 0x72, /* ......gr */ + /* 0018 */ 0x6F, 0x75, 0x70, 0x31, 0x00, 0xAA, 0xBB, 0xCC, /* oup1.... */ + /* 0020 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x1F) + { + /* 0000 */ 0x90, 0x1A, 0x00, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x67, 0x72, /* ......gr */ + /* 0018 */ 0x6F, 0x75, 0x70, 0x32, 0x00, 0x79, 0x00 /* oup2.y. */ + }, + Buffer (0x1F) + { + /* 0000 */ 0x90, 0x1A, 0x00, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x67, 0x72, /* ......gr */ + /* 0018 */ 0x6F, 0x75, 0x70, 0x33, 0x00, 0x79, 0x00 /* oup3.y. */ + }, + Buffer (0x1F) + { + /* 0000 */ 0x90, 0x1A, 0x00, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x67, 0x72, /* ......gr */ + /* 0018 */ 0x6F, 0x75, 0x70, 0x34, 0x00, 0x79, 0x00 /* oup4.y. */ + }, + Buffer (0x1F) + { + /* 0000 */ 0x90, 0x1A, 0x00, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x67, 0x72, /* ......gr */ + /* 0018 */ 0x6F, 0x75, 0x70, 0x35, 0x00, 0x79, 0x00 /* oup5.y. */ + }, + Buffer (0x22) + { + /* 0000 */ 0x90, 0x1D, 0x00, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x1D, 0x00, 0x03, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x67, 0x72, /* ......gr */ + /* 0018 */ 0x6F, 0x75, 0x70, 0x36, 0x00, 0xAA, 0xBB, 0xCC, /* oup6.... */ + /* 0020 */ 0x79, 0x00 /* y. */ + }, + Buffer (0x011C) + { + /* 0000 */ 0x90, 0x17, 0x01, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x17, 0x01, 0x03, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x41, 0x41, /* ......AA */ + /* 0018 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0020 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0028 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0030 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0038 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0040 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0048 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0050 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0058 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0060 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0068 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0070 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0078 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0080 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0088 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0090 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0098 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00A0 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00A8 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00B0 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00B8 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00C0 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00C8 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00D0 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00D8 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00E0 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00E8 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00F0 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 00F8 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0100 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0108 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ + /* 0110 */ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x00, 0xAA, /* AAAAAA.. */ + /* 0118 */ 0xBB, 0xCC, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x1A) + { + /* 0000 */ 0x90, 0x15, 0x00, 0x01, 0x00, 0x00, 0x0E, 0x00, /* ........ */ + /* 0008 */ 0x16, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, /* ........ */ + /* 0010 */ 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x61, 0x00, /* ......a. */ + /* 0018 */ 0x79, 0x00 /* y. */ + } +}) + +Method(RT28,, Serialized) +{ + Name(TS, "RT28") + + // Emit test header, set the filename + + THDR (TS, "PinGroup Resource Descriptor Macro", __FILE__) + + // The main test packages must have the same number of entries + + If (LNotEqual (SizeOf (P460), SizeOf (P461))) + { + Err (TS, 179, 0, 0, 0, 0, "Incorrect package length") + Return () + } + + // Main test case for packages above + + m330(TS, SizeOf (P460), "P460", P460, P461) + + // Check resource descriptor tag offsets + Local0 = ResourceTemplate () { + PinGroup ("group0", ResourceProducer, GRP0, RawDataBuffer () {0xaa, 0xbb, 0xcc}) + {1, 2, 3, 4} + PinGroup ("group1", ResourceProducer, GRP1, RawDataBuffer () {0xaa, 0xbb, 0xcc}) + {1, 2, 3, 4} + } + + m331(TS, 1, GRP0._VEN, 0xE8, GRP1._VEN, 0x1E8, "_VEN") + m331(TS, 1, GRP0._PIN, 0x70, GRP1._PIN, 0x170, "_PIN") +} diff --git a/tests/aslts/src/runtime/collections/functional/descriptor/pingroupconfig.asl b/tests/aslts/src/runtime/collections/functional/descriptor/pingroupconfig.asl new file mode 100644 index 0000000..e29172f --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/descriptor/pingroupconfig.asl @@ -0,0 +1,501 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Resource Descriptor macros + * + * PinGroupConfig Resource Descriptor Macro + */ + +Name (P464, Package() { + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x00 /* Default */, 0x1000, "\\_SB.GPO2", 0x0, + "group0", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x01 /* Bias Pull-up */, 0x2000, "\\_SB.GPO2", 0x0, + "group1", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x02 /* Bias Pull-down */, 0x3000, "\\_SB.GPO2", 0x0, + "group2", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x03 /* Bias Default */, 0x4000, "\\_SB.GPO2", 0x0, + "group3", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x04 /* Bias Disable */, 0x5000, "\\_SB.GPO2", 0x0, + "group4", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x05 /* Bias High Impedance */, 0x6000, "\\_SB.GPO2", 0x0, + "group5", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x06 /* Bias Bus Hold */, 0x7000, "\\_SB.GPO2", 0x0, + "group6", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x07 /* Drive Open Drain */, 0x8000, "\\_SB.GPO2", 0x0, + "group7", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x08 /* Drive Open Source */, 0x9000, "\\_SB.GPO2", 0x0, + "group8", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x09 /* Drive Push Pull */, 0xa000, "\\_SB.GPO2", 0x0, + "group9", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x0a /* Drive Strength */, 0xb000, "\\_SB.GPO2", 0x0, + "group10", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x0b /* Slew Rate */, 0xc000, "\\_SB.GPO2", 0x0, + "group11", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x0c /* Input Debounce */, 0xd000, "\\_SB.GPO2", 0x0, + "group12", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x0d /* Input Schmitt Trigger */, 0xe000, "\\_SB.GPO2", 0x0, + "group13", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0x80 /* Vendor defined */, 0xe000, "\\_SB.GPO2", 0x0, + "group128", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Exclusive, 0xf0 /* Vendor defined */, 0xf000, "\\_SB.GPO2", 0x0, + "group240", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x00 /* Default */, 0x1000, "\\_SB.GPO2", 0x0, + "group0", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x01 /* Bias Pull-up */, 0x2000, "\\_SB.GPO2", 0x0, + "group1", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x02 /* Bias Pull-down */, 0x3000, "\\_SB.GPO2", 0x0, + "group2", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x03 /* Bias Default */, 0x4000, "\\_SB.GPO2", 0x0, + "group3", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x04 /* Bias Disable */, 0x5000, "\\_SB.GPO2", 0x0, + "group4", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x05 /* Bias High Impedance */, 0x6000, "\\_SB.GPO2", 0x0, + "group5", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x06 /* Bias Bus Hold */, 0x7000, "\\_SB.GPO2", 0x0, + "group6", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x07 /* Drive Open Drain */, 0x8000, "\\_SB.GPO2", 0x0, + "group7", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x08 /* Drive Open Source */, 0x9000, "\\_SB.GPO2", 0x0, + "group8", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x09 /* Drive Push Pull */, 0xa000, "\\_SB.GPO2", 0x0, + "group9", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x0a /* Drive Strength */, 0xb000, "\\_SB.GPO2", 0x0, + "group10", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x0b /* Slew Rate */, 0xc000, "\\_SB.GPO2", 0x0, + "group11", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x0c /* Input Debounce */, 0xd000, "\\_SB.GPO2", 0x0, + "group12", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x0d /* Input Schmitt Trigger */, 0xe000, "\\_SB.GPO2", 0x0, + "group13", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0x80 /* Vendor defined */, 0xe000, "\\_SB.GPO2", 0x0, + "group128", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupConfig(Shared, 0xf0 /* Vendor defined */, 0xf000, "\\_SB.GPO2", 0x0, + "group240", ResourceConsumer,, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + // Minimal + ResourceTemplate () { + PinGroupConfig(, 0x01 /* Bias Pull-up */, 0xf000, "\\_SB.GPO2",, "group") + }, +}) + +Name (P465, Package () { + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, /* .&...... */ + /* 0008 */ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x30, 0x00, 0x0A, 0x0B, 0x0C, /* oup0.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, /* .&...... */ + /* 0008 */ 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* oup1.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, /* .&...... */ + /* 0008 */ 0x30, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* 0....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x32, 0x00, 0x0A, 0x0B, 0x0C, /* oup2.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x03, 0x00, /* .&...... */ + /* 0008 */ 0x40, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* @....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x33, 0x00, 0x0A, 0x0B, 0x0C, /* oup3.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x04, 0x00, /* .&...... */ + /* 0008 */ 0x50, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* P....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x34, 0x00, 0x0A, 0x0B, 0x0C, /* oup4.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x05, 0x00, /* .&...... */ + /* 0008 */ 0x60, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* `....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x35, 0x00, 0x0A, 0x0B, 0x0C, /* oup5.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x06, 0x00, /* .&...... */ + /* 0008 */ 0x70, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* p....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x36, 0x00, 0x0A, 0x0B, 0x0C, /* oup6.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x07, 0x00, /* .&...... */ + /* 0008 */ 0x80, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x37, 0x00, 0x0A, 0x0B, 0x0C, /* oup7.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x08, 0x00, /* .&...... */ + /* 0008 */ 0x90, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x38, 0x00, 0x0A, 0x0B, 0x0C, /* oup8.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x02, 0x00, 0x09, 0x00, /* .&...... */ + /* 0008 */ 0xA0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x39, 0x00, 0x0A, 0x0B, 0x0C, /* oup9.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x02, 0x00, 0x0A, 0x00, /* .'...... */ + /* 0008 */ 0xB0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x30, 0x00, 0x0A, 0x0B, /* oup10... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x02, 0x00, 0x0B, 0x00, /* .'...... */ + /* 0008 */ 0xC0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x31, 0x00, 0x0A, 0x0B, /* oup11... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x02, 0x00, 0x0C, 0x00, /* .'...... */ + /* 0008 */ 0xD0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x32, 0x00, 0x0A, 0x0B, /* oup12... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x02, 0x00, 0x0D, 0x00, /* .'...... */ + /* 0008 */ 0xE0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x33, 0x00, 0x0A, 0x0B, /* oup13... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2D) + { + /* 0000 */ 0x92, 0x28, 0x00, 0x01, 0x02, 0x00, 0x80, 0x00, /* .(...... */ + /* 0008 */ 0xE0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x27, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* '...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x32, 0x38, 0x00, 0x0A, /* oup128.. */ + /* 0028 */ 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* ...y. */ + }, + Buffer (0x2D) + { + /* 0000 */ 0x92, 0x28, 0x00, 0x01, 0x02, 0x00, 0xF0, 0x00, /* .(...... */ + /* 0008 */ 0xF0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x27, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* '...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x32, 0x34, 0x30, 0x00, 0x0A, /* oup240.. */ + /* 0028 */ 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* ...y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, /* .&...... */ + /* 0008 */ 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x30, 0x00, 0x0A, 0x0B, 0x0C, /* oup0.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x01, 0x00, /* .&...... */ + /* 0008 */ 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x00, 0x0A, 0x0B, 0x0C, /* oup1.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x02, 0x00, /* .&...... */ + /* 0008 */ 0x30, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* 0....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x32, 0x00, 0x0A, 0x0B, 0x0C, /* oup2.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x03, 0x00, /* .&...... */ + /* 0008 */ 0x40, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* @....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x33, 0x00, 0x0A, 0x0B, 0x0C, /* oup3.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x04, 0x00, /* .&...... */ + /* 0008 */ 0x50, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* P....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x34, 0x00, 0x0A, 0x0B, 0x0C, /* oup4.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x05, 0x00, /* .&...... */ + /* 0008 */ 0x60, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* `....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x35, 0x00, 0x0A, 0x0B, 0x0C, /* oup5.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x06, 0x00, /* .&...... */ + /* 0008 */ 0x70, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* p....... */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x36, 0x00, 0x0A, 0x0B, 0x0C, /* oup6.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x07, 0x00, /* .&...... */ + /* 0008 */ 0x80, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x37, 0x00, 0x0A, 0x0B, 0x0C, /* oup7.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x08, 0x00, /* .&...... */ + /* 0008 */ 0x90, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x38, 0x00, 0x0A, 0x0B, 0x0C, /* oup8.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2B) + { + /* 0000 */ 0x92, 0x26, 0x00, 0x01, 0x03, 0x00, 0x09, 0x00, /* .&...... */ + /* 0008 */ 0xA0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x25, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* %...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x39, 0x00, 0x0A, 0x0B, 0x0C, /* oup9.... */ + /* 0028 */ 0x0D, 0x79, 0x00 /* .y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x03, 0x00, 0x0A, 0x00, /* .'...... */ + /* 0008 */ 0xB0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x30, 0x00, 0x0A, 0x0B, /* oup10... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x03, 0x00, 0x0B, 0x00, /* .'...... */ + /* 0008 */ 0xC0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x31, 0x00, 0x0A, 0x0B, /* oup11... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x03, 0x00, 0x0C, 0x00, /* .'...... */ + /* 0008 */ 0xD0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x32, 0x00, 0x0A, 0x0B, /* oup12... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2C) + { + /* 0000 */ 0x92, 0x27, 0x00, 0x01, 0x03, 0x00, 0x0D, 0x00, /* .'...... */ + /* 0008 */ 0xE0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x26, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* &...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x33, 0x00, 0x0A, 0x0B, /* oup13... */ + /* 0028 */ 0x0C, 0x0D, 0x79, 0x00 /* ..y. */ + }, + Buffer (0x2D) + { + /* 0000 */ 0x92, 0x28, 0x00, 0x01, 0x03, 0x00, 0x80, 0x00, /* .(...... */ + /* 0008 */ 0xE0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x27, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* '...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x31, 0x32, 0x38, 0x00, 0x0A, /* oup128.. */ + /* 0028 */ 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* ...y. */ + }, + Buffer (0x2D) + { + /* 0000 */ 0x92, 0x28, 0x00, 0x01, 0x03, 0x00, 0xF0, 0x00, /* .(...... */ + /* 0008 */ 0xF0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x27, 0x00, 0x04, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* '...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x32, 0x34, 0x30, 0x00, 0x0A, /* oup240.. */ + /* 0028 */ 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* ...y. */ + }, + Buffer (0x26) + { + /* 0000 */ 0x92, 0x21, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, /* .!...... */ + /* 0008 */ 0xF0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x1E, 0x00, /* ........ */ + /* 0010 */ 0x24, 0x00, 0x00, 0x00, 0x5C, 0x5F, 0x53, 0x42, /* $...\_SB */ + /* 0018 */ 0x2E, 0x47, 0x50, 0x4F, 0x32, 0x00, 0x67, 0x72, /* .GPO2.gr */ + /* 0020 */ 0x6F, 0x75, 0x70, 0x00, 0x79, 0x00 /* oup.y. */ + } +}) + +Method(RT30,, Serialized) +{ + Name(TS, "RT30") + + // Emit test header, set the filename + + THDR (TS, "PinGroupConfig Resource Descriptor Macro", __FILE__) + + // The main test packages must have the same number of entries + + If (LNotEqual (SizeOf (P464), SizeOf (P465))) + { + Err (TS, 179, 0, 0, 0, 0, "Incorrect package length") + Return () + } + + // Main test case for packages above + + m330(TS, SizeOf (P464), "P464", P464, P465) + + // Check resource descriptor tag offsets + Local0 = ResourceTemplate () { + PinGroupConfig(Shared, 0x01 /* Bias Pull-up */, 0x2000, "\\_SB.GPO2", 0x0, "group0", + ResourceConsumer, CFG0, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + PinGroupConfig(Shared, 0x01 /* Bias Pull-up */, 0x2000, "\\_SB.GPO2", 0x0, "group1", + ResourceConsumer, CFG1, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + } + + m331(TS, 1, CFG0._SHR, 0x20, CFG1._SHR, 0x168, "_SHR") + m331(TS, 1, CFG0._TYP, 0x30, CFG1._TYP, 0x178, "_TYP") + m331(TS, 1, CFG0._VAL, 0x38, CFG1._VAL, 0x180, "_VAL") + m331(TS, 1, CFG0._VEN, 0x128, CFG1._VEN, 0x270, "_VEN") +} diff --git a/tests/aslts/src/runtime/collections/functional/descriptor/pingroupfunction.asl b/tests/aslts/src/runtime/collections/functional/descriptor/pingroupfunction.asl new file mode 100644 index 0000000..ae66ee9 --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/descriptor/pingroupfunction.asl @@ -0,0 +1,156 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Resource Descriptor macros + * + * PinGroupFunction Resource Descriptor Macro + */ + +Name (P462, Package() { + ResourceTemplate () { + PinGroupFunction(Exclusive, 0x1000, "\\_SB.GPO1", 0x0, + "group0", ResourceConsumer,, + RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupFunction(Exclusive, 0x1234, "\\_SB.GPO1", 0x0, + "group1", ResourceConsumer,, + RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupFunction(Shared, 0x1000, "\\_SB.GPO1", 0x0, + "group0", ResourceConsumer,, + RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupFunction(Shared, 0x1234, "\\_SB.GPO1", 0x0, + "group1", ResourceConsumer,, + RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + }, + ResourceTemplate () { + PinGroupFunction(Shared, 0x1000, "\\_SB.GPO1", 0x0, "group0") + }, + ResourceTemplate () { + PinGroupFunction(Shared, 0x1234, "\\_SB.GPO1", 0x0, "group1") + }, + ResourceTemplate () { + PinGroupFunction(, 0x1234, "\\_SB.GPO1", 0x0, "group0") + }, +}) + +Name (P463, Package () { + Buffer (0x28) + { + /* 0000 */ 0x91, 0x23, 0x00, 0x01, 0x02, 0x00, 0x00, 0x10, /* .#...... */ + /* 0008 */ 0x00, 0x11, 0x00, 0x1B, 0x00, 0x22, 0x00, 0x04, /* .....".. */ + /* 0010 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /* .\_SB.GP */ + /* 0018 */ 0x4F, 0x31, 0x00, 0x67, 0x72, 0x6F, 0x75, 0x70, /* O1.group */ + /* 0020 */ 0x30, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 0.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x91, 0x23, 0x00, 0x01, 0x02, 0x00, 0x34, 0x12, /* .#....4. */ + /* 0008 */ 0x00, 0x11, 0x00, 0x1B, 0x00, 0x22, 0x00, 0x04, /* .....".. */ + /* 0010 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /* .\_SB.GP */ + /* 0018 */ 0x4F, 0x31, 0x00, 0x67, 0x72, 0x6F, 0x75, 0x70, /* O1.group */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x91, 0x23, 0x00, 0x01, 0x03, 0x00, 0x00, 0x10, /* .#...... */ + /* 0008 */ 0x00, 0x11, 0x00, 0x1B, 0x00, 0x22, 0x00, 0x04, /* .....".. */ + /* 0010 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /* .\_SB.GP */ + /* 0018 */ 0x4F, 0x31, 0x00, 0x67, 0x72, 0x6F, 0x75, 0x70, /* O1.group */ + /* 0020 */ 0x30, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 0.....y. */ + }, + Buffer (0x28) + { + /* 0000 */ 0x91, 0x23, 0x00, 0x01, 0x03, 0x00, 0x34, 0x12, /* .#....4. */ + /* 0008 */ 0x00, 0x11, 0x00, 0x1B, 0x00, 0x22, 0x00, 0x04, /* .....".. */ + /* 0010 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /* .\_SB.GP */ + /* 0018 */ 0x4F, 0x31, 0x00, 0x67, 0x72, 0x6F, 0x75, 0x70, /* O1.group */ + /* 0020 */ 0x31, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x79, 0x00 /* 1.....y. */ + }, + Buffer (0x24) + { + /* 0000 */ 0x91, 0x1F, 0x00, 0x01, 0x03, 0x00, 0x00, 0x10, /* ........ */ + /* 0008 */ 0x00, 0x11, 0x00, 0x1B, 0x00, 0x22, 0x00, 0x00, /* .....".. */ + /* 0010 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /* .\_SB.GP */ + /* 0018 */ 0x4F, 0x31, 0x00, 0x67, 0x72, 0x6F, 0x75, 0x70, /* O1.group */ + /* 0020 */ 0x30, 0x00, 0x79, 0x00 /* 0.y. */ + }, + Buffer (0x24) + { + /* 0000 */ 0x91, 0x1F, 0x00, 0x01, 0x03, 0x00, 0x34, 0x12, /* ......4. */ + /* 0008 */ 0x00, 0x11, 0x00, 0x1B, 0x00, 0x22, 0x00, 0x00, /* .....".. */ + /* 0010 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /* .\_SB.GP */ + /* 0018 */ 0x4F, 0x31, 0x00, 0x67, 0x72, 0x6F, 0x75, 0x70, /* O1.group */ + /* 0020 */ 0x31, 0x00, 0x79, 0x00 /* 1.y. */ + }, + Buffer (0x24) + { + /* 0000 */ 0x91, 0x1F, 0x00, 0x01, 0x02, 0x00, 0x34, 0x12, /* ......4. */ + /* 0008 */ 0x00, 0x11, 0x00, 0x1B, 0x00, 0x22, 0x00, 0x00, /* .....".. */ + /* 0010 */ 0x00, 0x5C, 0x5F, 0x53, 0x42, 0x2E, 0x47, 0x50, /* .\_SB.GP */ + /* 0018 */ 0x4F, 0x31, 0x00, 0x67, 0x72, 0x6F, 0x75, 0x70, /* O1.group */ + /* 0020 */ 0x30, 0x00, 0x79, 0x00 /* 0.y. */ + } +}) + +Method(RT29,, Serialized) +{ + Name(TS, "RT29") + + // Emit test header, set the filename + + THDR (TS, "PinGroupFunction Resource Descriptor Macro", __FILE__) + + // The main test packages must have the same number of entries + + If (LNotEqual (SizeOf (P462), SizeOf (P463))) + { + Err (TS, 179, 0, 0, 0, 0, "Incorrect package length") + Return () + } + + // Main test case for packages above + + m330(TS, SizeOf (P462), "P462", P462, P463) + + // Check resource descriptor tag offsets + Local0 = ResourceTemplate () { + PinGroupFunction(Shared, 0x1234, "\\_SB.GPO1", 0x0, "group0", + ResourceConsumer, FUN0, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + PinGroupFunction(Shared, 0x1234, "\\_SB.GPO1", 0x0, "group0", + ResourceConsumer, FUN1, RawDataBuffer() {0xa, 0xb, 0xc, 0xd}) + } + m331(TS, 1, FUN0._SHR, 0x20, FUN1._SHR, 0x150, "_SHR") + m331(TS, 1, FUN0._FUN, 0x30, FUN1._FUN, 0x160, "_FUN") + m331(TS, 1, FUN0._VEN, 0x110, FUN1._VEN, 0x240, "_VEN") +} diff --git a/tests/aslts/src/runtime/collections/functional/external/DECL.asl b/tests/aslts/src/runtime/collections/functional/external/DECL.asl new file mode 100644 index 0000000..18d1663 --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/external/DECL.asl @@ -0,0 +1,30 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +Include("../../../../runtime/collections/functional/external/external.asl") diff --git a/tests/aslts/src/runtime/collections/functional/external/MAIN.asl b/tests/aslts/src/runtime/collections/functional/external/MAIN.asl new file mode 100644 index 0000000..87a540e --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/external/MAIN.asl @@ -0,0 +1,91 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +DefinitionBlock( + "external.aml", // Output filename + "DSDT", // Signature + 0x02, // DSDT Revision + "Intel", // OEMID + "Many", // TABLE ID + 0x00000001 // OEM Revision + ) { + + // All declarations + Include("../../../../runtime/cntl/DECL.asl") + Include("../../../../runtime/collections/functional/external/DECL.asl") + + Method(MAIN) { + + // Initialization + STRT(0) + + // Run verification methods + Include("../../../../runtime/collections/functional/external/RUN.asl") + + // Final actions + Store(FNSH(), Local7) + + return (Local7) + } +} + +DefinitionBlock( + "external.aml", // Output filename + "SSDT", // Signature + 0x02, // DSDT Revision + "Intel", // OEMID + "Many", // TABLE ID + 0x00000001 // OEM Revision + ) { + // Name(EX00, UnknownObj) + + Name(E000, 0) + Name(E001, 1) + Name(E002, "test string") + + Name (E003, Buffer(1){0}) + Name (E004, Package(){}) + + OperationRegion (E010, PCI_Config, Zero, 0xFF) + Field (E010, AnyAcc, NoLock, Preserve) + { + E005, 8 + } + + Device(E006){} + Event(E007) + Method (E008) + { + return (500) + } + Mutex(E009, 0) + PowerResource(E011, 0, 0){} + Processor(E012, 0, 1, 2){} + ThermalZone(E013){} + CreateBitField(E003, 0, E014) +} + diff --git a/tests/aslts/src/runtime/collections/functional/external/Makefile b/tests/aslts/src/runtime/collections/functional/external/Makefile new file mode 100644 index 0000000..c5cefd1 --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/external/Makefile @@ -0,0 +1,7 @@ +# constant + +AMLMOD= external +COLL= ../.. + +TOP= $(COLL)/../../.. +include $(COLL)/Makefile.install diff --git a/tests/aslts/src/runtime/collections/functional/external/RUN.asl b/tests/aslts/src/runtime/collections/functional/external/RUN.asl new file mode 100644 index 0000000..10b115c --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/external/RUN.asl @@ -0,0 +1,34 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +if (STTT("External", TCLF, 2, W002)) { + SRMT("EXT1") + EXT1() +} +FTTT() diff --git a/tests/aslts/src/runtime/collections/functional/external/external.asl b/tests/aslts/src/runtime/collections/functional/external/external.asl new file mode 100644 index 0000000..85c2ed7 --- /dev/null +++ b/tests/aslts/src/runtime/collections/functional/external/external.asl @@ -0,0 +1,118 @@ +/* + * Some or all of this work - Copyright (c) 2006 - 2017, 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: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * External declarations + */ + +Name(z204, 204) + +External(E000, UnknownObj) +External(E001, IntObj) +External(E002, StrObj) +External(E003, BuffObj) +External(E004, PkgObj) +External(E005, FieldUnitObj) +External(E006, DeviceObj) +External(E007, EventObj) +External(E008, MethodObj) +External(E009, MutexObj) +External(E010, OpRegionObj) +External(E011, PowerResObj) +External(E012, ProcessorObj) +External(E013, ThermalZoneObj) +External(E014, BuffFieldObj) +External(E015, DDBHandleObj) + +Name(NM01, 1) +Name(NM02, "test string") +Name(NM03, buffer(1){0}) +Name(NM04, package(){}) +Device(NM06){} +Event(NM07) +Method(NM08) +{ + return(500) +} +Mutex(NM09, 0) + +OperationRegion (NM10, PCI_Config, Zero, 0xFF) +Field (NM10, AnyAcc, NoLock, Preserve) +{ + NM05, 8 +} +PowerResource(NM11, 0, 0){} +Processor(NM12, 0, 1, 2){} +ThermalZone(NM13){} +CreateBitField(NM03,0, NM14) + + +/* + * Check that arg2 and arg3 have the same type + * arg0 - diagnostic message + * arg1 - index of checking + * arg2 - arg5 of err, "received value" + * arg3 - arg6 of err, "expected value" + */ +Method(EXT0, 4) +{ + Local1 = ObjectType (arg2) + Local2 = ObjectType (arg3) + if (Local1 != Local2){ + err(derefof(arg0), z204, 1, z204, arg1, Local1, Local2) + } +} + + +// Run-method +Method(EXT1,, Serialized) +{ + Name(ts, "EXT1") + + Local1 = ObjectType (E000) + if (Local1 != 1){ + err(ts, z204, 0, 0, 0, Local1, 1) + } + + EXT0(ts, 1, E001, NM01) + EXT0(ts, 2, E002, NM02) + EXT0(ts, 3, E003, NM03) + EXT0(ts, 4, E004, NM04) + EXT0(ts, 5, E005, NM05) + EXT0(ts, 6, E006, NM06) + EXT0(ts, 7, E007, NM07) + EXT0(ts, 8, E008, NM08) + EXT0(ts, 9, E009, NM09) + EXT0(ts,10, E010, NM10) + EXT0(ts,11, E011, NM11) + EXT0(ts,12, E012, NM12) + EXT0(ts,13, E013, NM13) + EXT0(ts,14, E014, NM14) + + return (0) +} diff --git a/tests/aslts/src/runtime/collections/functional/reference/ref50.asl b/tests/aslts/src/runtime/collections/functional/reference/ref50.asl index d5b175e..83df725 100644 --- a/tests/aslts/src/runtime/collections/functional/reference/ref50.asl +++ b/tests/aslts/src/runtime/collections/functional/reference/ref50.asl @@ -4644,12 +4644,6 @@ Method(m34d, 1, Serialized) Store(DerefOf(Local0), Local2) m391(Local2, c009, 0, 9) - Store(RefOf(p000), Local0) - m000(Local0, c009, c00c) - m391(p000, c009, 0, 10) - Store(DerefOf(Local0), Local2) - m391(Local2, c009, 0, 11) - // Write String Store(RefOf(i010), Local0) @@ -4670,12 +4664,6 @@ Method(m34d, 1, Serialized) Store(DerefOf(Local0), Local2) m391(Local2, c00a, 0, 17) - Store(RefOf(p010), Local0) - m000(Local0, c00a, c00c) - m391(p010, c00a, 0, 18) - Store(DerefOf(Local0), Local2) - m391(Local2, c00a, 0, 19) - // Write Buffer Store(RefOf(i020), Local0) @@ -4696,12 +4684,6 @@ Method(m34d, 1, Serialized) Store(DerefOf(Local0), Local2) m391(Local2, c00b, 0, 25) - Store(RefOf(p020), Local0) - m000(Local0, c00b, c00c) - m391(p020, c00b, 0, 26) - Store(DerefOf(Local0), Local2) - m391(Local2, c00b, 0, 27) - // Write Package if (LNot(op00)) { @@ -4744,8 +4726,6 @@ Method(m34d, 1, Serialized) m391(i040, c009, 0, 37) m000(RefOf(b040), c009, c00b) m391(i040, c009, 0, 38) - m000(RefOf(p040), c009, c00c) - m391(i040, c009, 0, 39) // Write String @@ -4755,8 +4735,6 @@ Method(m34d, 1, Serialized) m391(i050, c00a, 0, 41) m000(RefOf(b050), c00a, c00b) m391(i050, c00a, 0, 42) - m000(RefOf(p050), c00a, c00c) - m391(i050, c00a, 0, 43) // Write Bufer @@ -4766,8 +4744,6 @@ Method(m34d, 1, Serialized) m391(i060, c00b, 0, 45) m000(RefOf(b060), c00b, c00b) m391(i060, c00b, 0, 46) - m000(RefOf(p060), c00b, c00c) - m391(i060, c00b, 0, 47) // Write Package if (op01) { diff --git a/tests/aslts/src/runtime/collections/functional/region/opregions.asl b/tests/aslts/src/runtime/collections/functional/region/opregions.asl index e9029f2..3260ec9 100644 --- a/tests/aslts/src/runtime/collections/functional/region/opregions.asl +++ b/tests/aslts/src/runtime/collections/functional/region/opregions.asl @@ -496,9 +496,6 @@ Method(m702, 1) Divide(Local0, 3, , Local0) Store(0, Local1) - Store(2, Local1) - Subtract(Local0, 2, Local0) - While (Local0) { m70c(arg0, p702, Local1) Decrement(Local0) @@ -584,6 +581,8 @@ Method(m70c, 3, Serialized) elseif (LEqual(Local3, 0x04 /* SMBus */)) {} elseif (LEqual(Local3, 0x05 /* SystemCMOS */)) {} elseif (LEqual(Local3, 0x06 /* PciBarTarget */)) {} + elseif (LEqual(Local3, 0x07 /* IPMI */)) {} + elseif (LEqual(Local3, 0x08 /* GeneralPurposeIo */)) {} elseif (LGreater(Local3, 0x80 /* UserDefRegionSpace <> 0x80 */)) {} else { diff --git a/tests/misc/converterSample.asl b/tests/misc/converterSample.asl new file mode 100644 index 0000000..f3141dc --- /dev/null +++ b/tests/misc/converterSample.asl @@ -0,0 +1,84 @@ +/* + * top of the + * definition block + */ +DefinitionBlock( + "converterSample.aml", /* These comments */ + "DSDT", /* within the */ + 0x02, /* definition block header */ + "Intel", /* are not retained. */ + "Many", /* They will be */ + 0x00000001 /* Discarded */) +{ + + /* first comment of named object b */ + Name (b, 5) + Name(p008, Package() + { + 0, 0, + 0, 0xffffffff, + 0x00012345, 0x00007abc, + 0x00000012, 0x00000034, + 0x00000001, 0x000000ff, + 0x00000001, 0x0000ffff, + 0x00000001, 0xffffffff, + + // bit-size of multiplicand + 0x67812345, 2, + + // bit-size of multiplier + 3, 0x45678123, + + 0xffffffff, 0xffffffff, + + // ACPI: Overflow conditions are ignored and results are undefined. + }) + + Method(MAIN) { + /********************************************************************** + * * + * This is a long * + * multi-line * + * comment * + * * + **********************************************************************/ + //c12 + if(1==1)//c13 + { //c14 + Name(b,0); + } //c15 + } + + //c16 + Name (a, + Package(3) + {/*c20*/ + 0x04, /*c21*/ + /*c22*/ + 0x05, /*c23*/ + 0x06 /*c24*/ + }/*c25*/ + )/*c26*/ + + + //c34 + Method(SCOP) + { + //c35 + Name (a1, 0x04) + } + + OperationRegion(GNVS,SystemMemory,0xFFFF0000,0xAA55) + + Field(GNVS,AnyAcc,Lock,Preserve) + { + //c36 + Offset(0),//c37 + OSYS, 8//c38 + } + + +} //c39 +/*ending + comment*/ + diff --git a/tests/misc/grammar.aml b/tests/misc/grammar.aml index 68b7fc4..5350b60 100755 Binary files a/tests/misc/grammar.aml and b/tests/misc/grammar.aml differ