Merge ACPICA 20170531.

This commit is contained in:
Jung-uk Kim 2017-06-01 00:01:19 +00:00
commit af05116143
115 changed files with 6741 additions and 1205 deletions

View File

@ -488,6 +488,7 @@ contrib/dev/acpica/components/utilities/utobject.c optional acpi
contrib/dev/acpica/components/utilities/utosi.c optional acpi
contrib/dev/acpica/components/utilities/utownerid.c optional acpi
contrib/dev/acpica/components/utilities/utpredef.c optional acpi
contrib/dev/acpica/components/utilities/utresdecode.c optional acpi acpi_debug
contrib/dev/acpica/components/utilities/utresrc.c optional acpi
contrib/dev/acpica/components/utilities/utstate.c optional acpi
contrib/dev/acpica/components/utilities/utstring.c optional acpi

View File

@ -21,9 +21,10 @@ stripdirs="generate libraries parsers preprocessor tests tools"
stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \
acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \
acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \
acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \
osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \
oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c utprint.c"
acwin.h acwin64.h acwinex.h dspkginit.c new_table.txt \
osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \
osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \
readme.txt utclib.c utprint.c"
# include files to canonify
src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \

View File

@ -1,3 +1,133 @@
----------------------------------------
31 May 2017. Summary of changes for version 20170531:
0) ACPI 6.2 support:
The ACPI specification version 6.2 has been released and is available at
http://uefi.org/specifications
This version of ACPICA fully supports the ACPI 6.2 specification. Changes
are summarized below.
New ACPI tables (Table Compiler/Disassembler/Templates):
HMAT (Heterogeneous Memory Attributes Table)
WSMT (Windows SMM Security Mitigation Table)
PPTT (Processor Properties Topology Table)
New subtables for existing ACPI tables:
HEST (New subtable, Arch-deferred machine check)
SRAT (New subtable, Arch-specific affinity structure)
PCCT (New subtables, Extended PCC subspaces (types 3 and 4))
Simple updates for existing ACPI tables:
BGRT (two new flag bits)
HEST (New bit defined for several subtables, GHES_ASSIST)
New Resource Descriptors and Resource macros (Compiler/Disassembler):
PinConfig()
PinFunction()
PinGroup()
PinGroupConfig()
PinGroupFunction()
New type for hardware error notification (section 18.3.2.9)
New predefined names/methods (Compiler/Interpreter):
_HMA (Heterogeneous Memory Attributes)
_LSI (Label Storage Information)
_LSR (Label Storage Read)
_LSW (Label Storage Write)
ASL grammar/macro changes (Compiler):
For() ASL macro, implemented with the AML while operator
Extensions to Concatenate operator
Support for multiple definition blocks in same ASL file
Clarification for Buffer operator
Allow executable AML code underneath all scopes (Devices, etc.)
Clarification/change for the _OSI return value
ASL grammar update for reference operators
Allow a zero-length string for AML filename in DefinitionBlock
Miscellaneous:
New device object notification value
Remove a notify value (0x0C) for graceful shutdown
New UUIDs for processor/cache properties and
physical package property
New _HID, ACPI0014 (Wireless Power Calibration Device)
1) ACPICA kernel-resident subsystem:
Added support to disable ACPI events on hardware-reduced platforms.
Eliminates error messages of the form "Could not enable fixed event". Lv
Zheng
Fixed a problem using Device/Thermal objects with the ObjectType and
DerefOf ASL operators. This support had not been fully/properly
implemented.
Fixed a problem where if a Buffer object containing a resource template
was longer than the actual resource template, an error was generated --
even though the AML is legal. This case has been seen in the field.
Fixed a problem with the header definition of the MADT PCAT_COMPAT flag.
The values for DUAL_PIC and MULTIPLE_APIC were reversed.
Added header file changes for the TPM2 ACPI table. Update to new version
of the TCG specification. Adds a new TPM2 subtable for ARM SMC.
Exported the external interfaces AcpiAcquireMutex and AcpiReleaseMutex.
These interfaces are intended to be used only in conjunction with the
predefined _DLM method (Device Lock Method). "This object appears in a
device scope when AML access to the device must be synchronized with the
OS environment".
Example Code and Data Size: These are the sizes for the OS-independent
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
debug version of the code includes the debug output trace mechanism and
has a much larger code and data size.
Current Release:
Non-Debug Version: 143.1K Code, 60.0K Data, 203.1K Total
Debug Version: 204.0K Code, 84.3K Data, 288.3K Total
Previous Release:
Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total
Debug Version: 207.5K Code, 82.7K Data, 290.2K Total
2) iASL Compiler/Disassembler and Tools:
iASL: Fixed a problem where an External() declaration could not refer to
a Field Unit. Erik Schmauss.
Disassembler: Improved support for the Switch/Case operators. This
feature will disassemble AML code back to the original Switch operators
when possible, instead of an If..Else sequence. David Box
iASL and disassembler: Improved the handling of multiple extraneous
parentheses for both ASL input and disassembled ASL output.
Improved the behavior of the iASL compiler and disassembler to detect
improper use of external declarations
Disassembler: Now aborts immediately upon detection of an unknown AML
opcode. The AML parser has no real way to recover from this, and can
result in the creation of an ill-formed parse tree that causes errors
later during the disassembly.
All tools: Fixed a problem where the Unix application OSL did not handle
control-c correctly. For example, a control-c could incorrectly wake the
debugger.
AcpiExec: Improved the Control-C handling and added a handler for
segmentation faults (SIGSEGV). Supports both Windows and Unix-like
environments.
Reduced the verbosity of the generic unix makefiles. Previously, each
compilation displayed the full set of compiler options. This has been
eliminated as the options are easily inspected within the makefiles. Each
compilation now results in a single line of output.
----------------------------------------
03 March 2017. Summary of changes for version 20170303:

View File

@ -531,8 +531,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);
}

View File

@ -316,11 +316,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 */
@ -364,11 +359,6 @@ FlStrdup (
NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1);
if (!NewString)
{
return (NULL);
}
strcpy (NewString, String);
return (NewString);
}

View File

@ -537,7 +537,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))
@ -553,7 +553,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 */
@ -616,7 +616,7 @@ AdReparseOneTable (
fprintf (stderr,
"\nFound %u external control methods, "
"reparsing with new information\n",
AcpiDmGetExternalMethodCount ());
AcpiDmGetUnresolvedExternalMethodCount ());
/* Reparse, rebuild namespace */
@ -642,7 +642,7 @@ AdReparseOneTable (
/* New namespace, add the external definitions first */
AcpiDmAddExternalsToNamespace ();
AcpiDmAddExternalListToNamespace ();
/* For -ca option: clear the list of comment addresses. */

View File

@ -208,11 +208,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);
/*******************************************************************************
*
@ -395,21 +400,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)
{
@ -443,9 +448,14 @@ AcpiDmConvertResourceIndexes (
Info.Level = 0;
Info.WalkState = WalkState;
AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp,
AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmCommonDescendingOp,
AcpiDmCommonAscendingOp, &Info);
ACPI_FREE (WalkState);
if (AcpiGbl_TempListHead) {
AcpiDmClearTempList();
}
return;
}
@ -737,7 +747,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 */
@ -754,7 +763,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)
{
@ -875,7 +884,6 @@ AcpiDmXrefDescendingOp (
WalkState = Info->WalkState;
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
ObjectType = OpInfo->ObjectType;
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
if ((!(OpInfo->Flags & AML_NAMED)) &&
@ -885,25 +893,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 */
@ -924,9 +913,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)
@ -1060,21 +1050,59 @@ Exit:
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDmResourceDescendingOp
* FUNCTION: AcpiDmCommonDescendingOp
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: None
* RETURN: ACPI_STATUS
*
* DESCRIPTION: Process one parse op during symbolic resource index conversion.
* DESCRIPTION: Perform parse tree preprocessing before main disassembly walk.
*
******************************************************************************/
static ACPI_STATUS
AcpiDmResourceDescendingOp (
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: AcpiDmProcessResourceDescriptors
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: ACPI_STATUS
*
* DESCRIPTION: Convert fixed-offset references to resource descriptors to
* symbolic references. Should only be called after namespace has
* been cross referenced.
*
******************************************************************************/
static ACPI_STATUS
AcpiDmProcessResourceDescriptors (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
@ -1085,7 +1113,6 @@ AcpiDmResourceDescendingOp (
ACPI_OBJECT_TYPE ObjectType;
ACPI_STATUS Status;
WalkState = Info->WalkState;
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
@ -1111,10 +1138,10 @@ AcpiDmResourceDescendingOp (
* If so, convert the reference into a symbolic reference.
*/
AcpiDmCheckResourceReference (Op, WalkState);
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDmCommonAscendingOp
@ -1135,14 +1162,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))
@ -1153,7 +1177,6 @@ AcpiDmCommonAscendingOp (
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDmInspectPossibleArgs

View File

@ -187,6 +187,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"},

View File

@ -254,6 +254,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"),
@ -270,6 +271,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"),
@ -287,6 +289,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"),
@ -439,6 +444,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"),

View File

@ -218,6 +218,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"},
@ -232,6 +233,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"},
@ -253,6 +255,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}

View File

@ -186,6 +186,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},

View File

@ -199,6 +199,9 @@ static const char *AcpiGbl_DmTypeNames[] =
#define METHOD_SEPARATORS " \t,()\n"
static const char *ExternalConflictMessage =
" // Conflicts with a later declaration";
/* Local prototypes */
@ -211,6 +214,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,
@ -226,6 +239,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);
/*******************************************************************************
*
@ -582,7 +610,7 @@ AcpiDmGetExternalsFromFile (
{
/* Add the external(s) to the namespace */
AcpiDmAddExternalsToNamespace ();
AcpiDmAddExternalListToNamespace ();
AcpiOsPrintf ("%s: Imported %u external method definitions\n",
Gbl_ExternalRefFilename, ImportCount);
@ -696,6 +724,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
@ -727,46 +835,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 */
@ -1013,68 +1102,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_OPERAND_OBJECT *ObjDesc;
switch (Type)
{
case ACPI_TYPE_METHOD:
/* For methods, we need to save the argument count */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
ObjDesc->Method.ParamCount = (UINT8) ParamCount;
(*Node)->Object = ObjDesc;
break;
case ACPI_TYPE_REGION:
/* Regions require a region sub-object */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
ObjDesc->Region.Node = *Node;
(*Node)->Object = ObjDesc;
break;
default:
break;
}
}
/*******************************************************************************
*
* 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;
ACPI_OPERAND_OBJECT *ObjDesc;
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)
{
/* Add the external name (object) into the namespace */
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);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"while adding external to namespace [%s]",
External->Path));
}
else switch (External->Type)
{
case ACPI_TYPE_METHOD:
/* For methods, we need to save the argument count */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
ObjDesc->Method.ParamCount = (UINT8) External->Value;
Node->Object = ObjDesc;
break;
case ACPI_TYPE_REGION:
/* Regions require a region sub-object */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
ObjDesc->Region.Node = Node;
Node->Object = ObjDesc;
break;
default:
break;
}
AcpiDmAddOneExternalToNamespace (External->InternalPath,
External->Type, External->Value);
External = External->Next;
}
}
@ -1082,23 +1274,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;
@ -1107,7 +1304,8 @@ AcpiDmGetExternalMethodCount (
while (External)
{
if (External->Type == ACPI_TYPE_METHOD)
if (External->Type == ACPI_TYPE_METHOD &&
!(External->Flags & ACPI_EXT_ORIGIN_FROM_OPCODE))
{
Count++;
}
@ -1251,6 +1449,11 @@ AcpiDmEmitExternals (
}
}
if (AcpiGbl_ExternalList->Flags &= ACPI_EXT_CONFLICTING_DECLARATION)
{
AcpiOsPrintf ("%s", ExternalConflictMessage);
AcpiDmConflictingDeclaration (AcpiGbl_ExternalList->Path);
}
AcpiOsPrintf ("\n");
}
@ -1271,6 +1474,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
@ -1280,7 +1583,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.
*
******************************************************************************/
@ -1290,12 +1594,74 @@ 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
@ -1311,7 +1677,7 @@ AcpiDmEmitExternal (
*
******************************************************************************/
#if 0
/*
Summary of the external control method problem:
When the -e option is used with disassembly, the various SSDTs are simply
@ -1380,7 +1746,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];

View File

@ -424,6 +424,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[] =
@ -488,8 +516,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 */

View File

@ -0,0 +1,679 @@
/******************************************************************************
*
* Module Name: adwalk - Disassembler routines for switch statements
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acdisasm.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/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);
}

View File

@ -298,6 +298,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 */
};
@ -314,9 +315,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 */
@ -355,6 +365,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 */
};
@ -366,12 +378,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 */
};
@ -452,6 +473,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},
@ -466,6 +488,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},
@ -485,6 +508,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}
@ -891,6 +915,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:
@ -907,6 +932,7 @@ AcpiDmDumpTable (
case ACPI_DMT_UINT16:
case ACPI_DMT_DMAR:
case ACPI_DMT_HEST:
case ACPI_DMT_HMAT:
case ACPI_DMT_NFIT:
ByteLength = 2;
@ -1088,6 +1114,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:
@ -1409,6 +1460,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,
@ -1480,6 +1545,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)

View File

@ -1730,6 +1730,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 */
@ -1782,6 +1790,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
@ -3010,6 +3215,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 (
@ -3240,6 +3455,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
@ -3498,6 +3843,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);

View File

@ -204,6 +204,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)
@ -230,6 +231,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 */
@ -273,8 +275,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)
@ -329,11 +336,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)
@ -343,6 +356,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)
@ -355,11 +369,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)
@ -367,6 +384,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)
@ -392,13 +412,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
@ -780,7 +804,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},
@ -1349,6 +1376,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}, \
@ -1373,6 +1401,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},
@ -1392,6 +1421,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},
@ -1482,6 +1512,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},
@ -1535,6 +1586,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
@ -2406,7 +2556,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
};
@ -2440,7 +2590,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},
@ -2460,7 +2610,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},
@ -2473,12 +2623,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
};
/*******************************************************************************
*
@ -2553,6 +2764,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
@ -2779,7 +3066,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
ACPI_DMT_TERMINATOR
};
/* : GICC Affinity (ACPI 5.1) */
/* 3: GICC Affinity (ACPI 5.1) */
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
{
@ -2791,6 +3078,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
};
/*******************************************************************************
*
@ -3056,6 +3353,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)

View File

@ -194,7 +194,7 @@ FlIsFileAsciiSource (
BOOLEAN DisplayErrors)
{
UINT8 Byte;
ACPI_SIZE BadBytes = 0;
UINT32 BadBytes = 0;
BOOLEAN OpeningComment = FALSE;
ASL_FILE_STATUS Status;
FILE *Handle;
@ -285,6 +285,9 @@ FlIsFileAsciiSource (
if (BadBytes)
{
fprintf (stderr,
"File appears to be binary: found %u non-ASCII characters, disassembling\n",
BadBytes);
if (DisplayErrors)
{
AcpiOsPrintf (

View File

@ -568,7 +568,7 @@ AslCompilerSignon (
/* Running compiler or disassembler? */
if (Gbl_DisasmFlag)
if (AcpiGbl_DisasmFlag)
{
UtilityName = AML_DISASSEMBLER_NAME;
}

View File

@ -1398,6 +1398,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
*/

View File

@ -455,6 +455,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); }

View File

@ -161,8 +161,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 */

View File

@ -435,6 +435,7 @@ ExMoveExternals (
ACPI_PARSE_OBJECT *Next;
char *ExternalName;
ACPI_OBJECT_TYPE ObjType;
ACPI_STATUS Status;
UINT32 i;
@ -473,8 +474,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;

View File

@ -275,7 +275,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);

View File

@ -180,7 +180,6 @@ Usage (
ACPI_OPTION ("-@ <file>", "Specify command file");
ACPI_OPTION ("-I <dir>", "Specify additional include directory");
ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
ACPI_OPTION ("-ca <file>", "convert a given ASL file to ASL+ (retains comments)");
ACPI_OPTION ("-v", "Display compiler version");
ACPI_OPTION ("-vo", "Enable optimization comments");
ACPI_OPTION ("-vs", "Disable signon");
@ -208,7 +207,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");
@ -225,20 +224,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 <file>", "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 <sig list>|ALL", "Create ACPI table template/example files");

View File

@ -330,6 +330,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;}

View File

@ -315,13 +315,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
{
@ -458,12 +465,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)
@ -778,7 +803,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;
@ -795,6 +822,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))
@ -802,15 +835,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))
{

View File

@ -207,6 +207,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
@ -224,7 +227,6 @@ main (
/* Initialize preprocessor and compiler before command line processing */
signal (SIGINT, AslSignalHandler);
AcpiGbl_ExternalFileList = NULL;
AcpiDbgLevel = 0;
PrInitializePreprocessor ();
@ -254,6 +256,7 @@ main (
}
}
/* Process each pathname/filename in the list, with possible wildcards */
while (argv[Index2])
@ -301,8 +304,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).
*
*****************************************************************************/
@ -314,11 +319,34 @@ AslSignalHandler (
signal (Sig, SIG_IGN);
printf ("Aborting\n\n");
fflush (stdout);
fflush (stderr);
/* Close all open files */
switch (Sig)
{
case SIGINT:
Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */
printf ("\n" ASL_PREFIX "<Control-C>\n");
break;
case SIGSEGV:
/* 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++)
{
@ -332,6 +360,7 @@ AslSignalHandler (
FlDeleteFile (i);
}
printf (ASL_PREFIX "Terminating\n");
exit (0);
}

View File

@ -451,6 +451,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),

View File

@ -250,7 +250,6 @@ LsAmlOffsetWalk (
}
Length = Op->Asl.FinalAmlLength;
NamepathOffset = Gbl_CurrentAmlOffset + Length;
/* Get to the NameSeg/NamePath Op (and length of the name) */

View File

@ -226,7 +226,7 @@ AslCommandLine (
/* Next parameter must be the input filename */
if (!argv[AcpiGbl_Optind] &&
!Gbl_DisasmFlag)
!AcpiGbl_DisasmFlag)
{
printf ("Missing input filename\n");
BadCommandLine = TRUE;
@ -466,7 +466,7 @@ AslDoOptions (
return (-1);
}
Gbl_DisasmFlag = TRUE;
AcpiGbl_DisasmFlag = TRUE;
break;
case 'D': /* Define a symbol */
@ -538,6 +538,7 @@ AslDoOptions (
{
case '^':
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
Usage ();
exit (0);

View File

@ -208,7 +208,7 @@ AslLocalAllocate (
* These shift/reduce conflicts are expected. There should be zero
* reduce/reduce conflicts.
*/
%expect 102
%expect 118
/*! [Begin] no source code translation */

View File

@ -990,6 +990,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 */

View File

@ -211,6 +211,11 @@ ResourceMacroTerm
| Memory24Term {}
| Memory32FixedTerm {}
| Memory32Term {}
| PinConfigTerm {}
| PinFunctionTerm {}
| PinGroupTerm {}
| PinGroupConfigTerm {}
| PinGroupFunctionTerm {}
| QWordIOTerm {}
| QWordMemoryTerm {}
| QWordSpaceTerm {}
@ -605,6 +610,95 @@ Memory32Term
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
PinConfigTerm
: PARSEOP_PINCONFIG
PARSEOP_OPEN_PAREN {$<n>$ = 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 ($<n>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 {$<n>$ = 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 ($<n>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 {$<n>$ = TrCreateLeafNode (PARSEOP_PINGROUP);}
StringData /* 04: ResourceLabel */
OptionalProducerResourceType /* 05: ResourceType */
OptionalNameString /* 06: DescriptorName */
OptionalBuffer_Last /* 07: VendorData */
PARSEOP_CLOSE_PAREN '{'
DWordList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$6,$7,$10);}
| PARSEOP_PINGROUP
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
PinGroupConfigTerm
: PARSEOP_PINGROUPCONFIG
PARSEOP_OPEN_PAREN {$<n>$ = 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 ($<n>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 {$<n>$ = 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 ($<n>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 {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);}

View File

@ -163,7 +163,8 @@ RsGetBufferDataLength (
static UINT16
RsGetInterruptDataLength (
ACPI_PARSE_OBJECT *InitializerOp);
ACPI_PARSE_OBJECT *InitializerOp,
UINT32 StartIndex);
static BOOLEAN
RsGetVendorData (
@ -171,6 +172,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:
*
@ -179,6 +185,11 @@ RsGetVendorData (
* I2cSerialBus
* SpiSerialBus
* UartSerialBus
* PinFunction
* PinConfig
* PinGroup
* PinGroupFunction
* PinGroupConfig
*/
@ -238,6 +249,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
*
@ -248,7 +260,8 @@ RsGetBufferDataLength (
static UINT16
RsGetInterruptDataLength (
ACPI_PARSE_OBJECT *InitializerOp)
ACPI_PARSE_OBJECT *InitializerOp,
UINT32 StartIndex)
{
UINT16 InterruptLength;
UINT32 i;
@ -261,9 +274,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;
}
@ -371,6 +384,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
@ -414,7 +464,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;
@ -623,7 +673,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) +
@ -1336,3 +1386,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);
}

View File

@ -269,11 +269,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);}
;
/*
@ -395,7 +393,7 @@ Object
: CompilerDirective {}
| NamedObject {}
| NameSpaceModifier {}
// | StructureTerm {}
/* | StructureTerm {} */
;
PackageList
@ -644,7 +642,7 @@ NamedObject
NameSpaceModifier
: AliasTerm {}
| NameTerm {}
// | NameTermAslPlus {}
/* | NameTermAslPlus {} */
| ScopeTerm {}
;
@ -751,8 +749,8 @@ Type2IntegerOpcode /* "Type3" opcodes */
| FromBCDTerm {}
| IncTerm {}
| IndexTerm {}
// | StructureIndexTerm {}
// | StructurePointerTerm {}
/* | StructureIndexTerm {} */
/* | StructurePointerTerm {} */
| LAndTerm {}
| LEqualTerm {}
| LGreaterTerm {}
@ -827,8 +825,8 @@ Type6Opcode
| DerefOfTerm {}
| IndexTerm {}
| IndexExpTerm {}
// | StructureIndexTerm {}
// | StructurePointerTerm {}
/* | StructureIndexTerm {} */
/* | StructurePointerTerm {} */
| MethodInvocationTerm {}
;

View File

@ -316,6 +316,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;
@ -456,7 +461,7 @@ AslDoOneFile (
/*
* AML Disassembly (Optional)
*/
if (Gbl_DisasmFlag)
if (AcpiGbl_DisasmFlag)
{
Status = AslDoDisassembly ();
if (Status != AE_CTRL_CONTINUE)
@ -581,7 +586,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 ();
@ -601,7 +606,7 @@ AslDoOneFile (
FlCloseFile (ASL_FILE_INPUT);
Gbl_DoCompile = FALSE;
Gbl_DisasmFlag = TRUE;
AcpiGbl_DisasmFlag = TRUE;
Status = AslDoDisassembly ();
return (Status);

View File

@ -697,15 +697,19 @@ AslDoCommentType2 (
AslInsertLineBuffer ('/');
AslInsertLineBuffer ('*');
if (Gbl_CaptureComments && CurrentState.CaptureComments)
{
AslInsertLineBuffer ('*');
*StringBuffer = '/';
++StringBuffer;
*StringBuffer = '*';
++StringBuffer;
}
else
{
AslInsertLineBuffer ('/');
}
while (((c = input ()) != '\n') && (c != EOF))
{
@ -1006,15 +1010,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);

View File

@ -389,6 +389,11 @@ NoEcho('
%token <i> PARSEOP_PARITYTYPE_NONE
%token <i> PARSEOP_PARITYTYPE_ODD
%token <i> PARSEOP_PARITYTYPE_SPACE
%token <i> PARSEOP_PINCONFIG
%token <i> PARSEOP_PINFUNCTION
%token <i> PARSEOP_PINGROUP
%token <i> PARSEOP_PINGROUPCONFIG
%token <i> PARSEOP_PINGROUPFUNCTION
%token <i> PARSEOP_PIN_NOPULL
%token <i> PARSEOP_PIN_PULLDEFAULT
%token <i> PARSEOP_PIN_PULLDOWN

View File

@ -1657,7 +1657,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)
{

View File

@ -432,6 +432,11 @@ NoEcho('
%type <n> Memory32Term
%type <n> NameSeg
%type <n> NameString
%type <n> PinConfigTerm
%type <n> PinFunctionTerm
%type <n> PinGroupTerm
%type <n> PinGroupConfigTerm
%type <n> PinGroupFunctionTerm
%type <n> QWordIOTerm
%type <n> QWordMemoryTerm
%type <n> QWordSpaceTerm
@ -487,6 +492,7 @@ NoEcho('
%type <n> OptionalReference
%type <n> OptionalResourceType
%type <n> OptionalResourceType_First
%type <n> OptionalProducerResourceType
%type <n> OptionalReturnArg
%type <n> OptionalSerializeRuleKeyword
%type <n> OptionalShareType

View File

@ -635,7 +635,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
@ -833,10 +833,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 */

View File

@ -621,7 +621,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);
}
@ -644,7 +645,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
@ -1183,7 +1185,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);
}

View File

@ -191,6 +191,7 @@ CvProcessComment (
*StringBuffer = (char) c1;
++StringBuffer;
*StringBuffer = 0;
CvDbgPrint ("Multi-line comment\n");
CommentString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
strcpy (CommentString, MsgBuffer);
@ -198,17 +199,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);
@ -263,7 +262,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)
{
@ -333,7 +335,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) && (i<CurrentState.SpacesBefore); ++i)
{
FinalCommentString[i] = ' ';
@ -556,6 +560,12 @@ CgWriteOneAmlComment(
UINT8 CommentOption = InputOption;
UINT8 CommentOpcode = (UINT8)AML_COMMENT_OP;
if (!CommentToPrint)
{
return;
}
CgLocalWriteAmlData (Op, &CommentOpcode, 1);
CgLocalWriteAmlData (Op, &CommentOption, 1);
@ -603,8 +613,12 @@ CgWriteAmlComment(
NewFilename =
FlGenerateFilename (Op->Asl.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 &&
@ -688,17 +702,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);
}
@ -907,10 +920,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);

View File

@ -314,6 +314,7 @@ CvPrintOneCommentType (
if (*CommentToPrint)
{
CommentExists = TRUE;
AcpiOsPrintf ("%s", *CommentToPrint);
*CommentToPrint = NULL;
}
@ -495,6 +496,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);
@ -509,23 +511,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;
}

View File

@ -215,7 +215,7 @@ CvIsFilename (
for(i = 0; i<Length; ++i)
{
if (!isprint (Filename[i]))
if (!isprint ((int) Filename[i]))
{
return FALSE;
}
@ -440,6 +440,11 @@ CvFilenameExists(
ACPI_FILE_NODE *Current = Head;
if (!Filename)
{
return (NULL);
}
while (Current)
{
if (!AcpiUtStricmp (Current->Filename, Filename))

View File

@ -577,6 +577,10 @@ ACPI_STATUS
DtCompileHest (
void **PFieldList);
ACPI_STATUS
DtCompileHmat (
void **PFieldList);
ACPI_STATUS
DtCompileIort (
void **PFieldList);
@ -617,6 +621,10 @@ ACPI_STATUS
DtCompilePmtt (
void **PFieldList);
ACPI_STATUS
DtCompilePptt (
void **PFieldList);
ACPI_STATUS
DtCompilePcct (
void **PFieldList);
@ -698,6 +706,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[];
@ -712,6 +721,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[];
@ -731,6 +741,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[];

View File

@ -679,6 +679,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");

View File

@ -1249,6 +1249,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 */
@ -1283,6 +1293,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;
@ -1306,6 +1322,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

View File

@ -871,6 +871,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");
@ -1035,6 +1045,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
@ -1324,6 +1453,11 @@ DtCompileSrat (
InfoTable = AcpiDmTableInfoSrat3;
break;
case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY:
InfoTable = AcpiDmTableInfoSrat4;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");

View File

@ -577,11 +577,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 "........" */
@ -596,7 +596,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 "........" */
@ -635,7 +635,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[] =
@ -958,39 +1003,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[] =
@ -1020,6 +1106,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..." */
@ -1213,11 +1318,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 "........" */
@ -1231,7 +1336,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[] =
@ -1379,6 +1485,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..." */

View File

@ -371,6 +371,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;
@ -512,6 +517,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:
@ -527,6 +537,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:
@ -543,6 +554,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:

View File

@ -314,6 +314,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));

View File

@ -588,7 +588,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++)
@ -604,7 +604,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));
}
}
@ -667,7 +667,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++)
{

View File

@ -379,7 +379,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");
}
/*

View File

@ -261,7 +261,7 @@ AcpiDmDisasmByteList (
/* Dump the ASCII equivalents within a comment */
AcpiOsPrintf (" /* ");
AcpiOsPrintf (" // ");
for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++)
{
CurrentIndex = i + j;
@ -283,7 +283,7 @@ AcpiDmDisasmByteList (
/* Finished with this line */
AcpiOsPrintf (" */\n");
AcpiOsPrintf ("\n");
}
}

View File

@ -190,7 +190,7 @@ AcpiDmParseDeferredOps (
ACPI_STATUS Status;
ACPI_FUNCTION_ENTRY ();
ACPI_FUNCTION_TRACE (DmParseDeferredOps);
/* Traverse the entire parse tree */
@ -217,7 +217,7 @@ AcpiDmParseDeferredOps (
Op, Op->Named.Data, Op->Named.Length);
if (ACPI_FAILURE (Status))
{
return (Status);
return_ACPI_STATUS (Status);
}
break;
@ -245,7 +245,7 @@ AcpiDmParseDeferredOps (
Op = AcpiPsGetDepthNext (Root, Op);
}
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}

View File

@ -177,15 +177,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
@ -1127,9 +1118,7 @@ AcpiDmDisassembleOneOp (
if (AcpiGbl_DmEmitExternalOpcodes)
{
AcpiDmEmitExternal (AcpiPsGetArg(Op, 0),
AcpiPsGetArg(Op, 1));
break;
AcpiDmEmitExternal (Op, AcpiPsGetArg(Op, 0));
}
break;
@ -1367,414 +1356,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);
}

View File

@ -197,8 +197,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 */
};
@ -540,6 +544,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)
{

View File

@ -517,6 +517,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");
}
/*******************************************************************************
*
@ -856,3 +962,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");
}

View File

@ -161,8 +161,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
@ -584,13 +582,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 */
@ -642,10 +633,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);
}
}
}
@ -782,7 +779,7 @@ AcpiDmDescendingOp (
Name = AcpiPsGetName (Op);
if (Op->Named.Path)
{
AcpiDmNamestring ((char *) Op->Named.Path);
AcpiDmNamestring (Op->Named.Path);
}
else
{

View File

@ -197,7 +197,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 */
@ -474,7 +474,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 */

View File

@ -320,6 +320,7 @@ AcpiDsDumpMethodStack (
Op->Common.Next = NULL;
#ifdef ACPI_DISASSEMBLER
AcpiOsPrintf ("Failed at ");
AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
#endif
Op->Common.Next = Next;

View File

@ -333,6 +333,7 @@ AcpiDsMethodError (
ACPI_WALK_STATE *WalkState)
{
UINT32 AmlOffset;
ACPI_NAME Name = 0;
ACPI_FUNCTION_ENTRY ();
@ -361,9 +362,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 ();
}

View File

@ -353,10 +353,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;

View File

@ -791,12 +791,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

View File

@ -723,7 +723,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)
{

View File

@ -518,7 +518,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)
@ -558,6 +558,10 @@ AcpiDsLoad1EndOp (
ACPI_OBJECT_TYPE ObjectType;
ACPI_STATUS Status = AE_OK;
#ifdef ACPI_ASL_COMPILER
UINT8 ParamCount;
#endif
ACPI_FUNCTION_TRACE (DsLoad1EndOp);
@ -642,6 +646,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.
@ -689,6 +724,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",

View File

@ -428,6 +428,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,

View File

@ -306,6 +306,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)
@ -372,6 +379,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)
@ -433,6 +447,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)

View File

@ -237,11 +237,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, " ");
}
}

View File

@ -775,12 +775,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 */
@ -818,8 +819,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:
@ -1158,12 +1161,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)
@ -1281,9 +1287,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;

View File

@ -959,7 +959,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)))
@ -1072,11 +1072,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
{

View File

@ -493,12 +493,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;

View File

@ -155,6 +155,9 @@
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acdispat.h>
#ifdef ACPI_ASL_COMPILER
#include <contrib/dev/acpica/include/acdisasm.h>
#endif
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsaccess")
@ -710,6 +713,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);
}

View File

@ -324,10 +324,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));

View File

@ -206,7 +206,7 @@ AcpiNsPrintNodePathname (
AcpiOsPrintf ("%s ", Message);
}
AcpiOsPrintf ("[%s] (Node %p)", (char *) Buffer.Pointer, Node);
AcpiOsPrintf ("%s", (char *) Buffer.Pointer);
ACPI_FREE (Buffer.Pointer);
}
}

View File

@ -199,6 +199,8 @@ AcpiEvaluateObjectTyped (
{
ACPI_STATUS Status;
BOOLEAN FreeBufferOnError = FALSE;
ACPI_HANDLE TargetHandle;
char *FullPathname;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@ -216,41 +218,56 @@ AcpiEvaluateObjectTyped (
FreeBufferOnError = TRUE;
}
/* Evaluate the object */
Status = AcpiEvaluateObject (Handle, Pathname,
ExternalParams, ReturnBuffer);
Status = AcpiGetHandle (Handle, Pathname, &TargetHandle);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Type ANY means "don't care" */
FullPathname = AcpiNsGetExternalPathname (TargetHandle);
if (!FullPathname)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Evaluate the object */
Status = AcpiEvaluateObject (TargetHandle, NULL, ExternalParams,
ReturnBuffer);
if (ACPI_FAILURE (Status))
{
goto Exit;
}
/* 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)));
@ -268,7 +285,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)

View File

@ -237,12 +237,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
}
@ -458,6 +469,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 */

View File

@ -445,7 +445,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 !*/

View File

@ -164,6 +164,7 @@
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psparse")
@ -664,8 +665,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 */

View File

@ -471,6 +471,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:
@ -483,6 +492,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;
@ -668,6 +713,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[
@ -677,6 +742,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;

View File

@ -215,6 +215,11 @@ static void
AcpiRsDumpResourceSource (
ACPI_RESOURCE_SOURCE *ResourceSource);
static void
AcpiRsDumpResourceLabel (
char *Title,
ACPI_RESOURCE_LABEL *ResourceLabel);
static void
AcpiRsDumpAddressCommon (
ACPI_RESOURCE_DATA *Resource);
@ -531,6 +536,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",
@ -578,6 +599,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

View File

@ -360,6 +360,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},

View File

@ -192,6 +192,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 */
@ -232,8 +237,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 */
@ -273,6 +282,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[] =
@ -312,6 +326,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 */
};
@ -351,7 +370,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[] =

View File

@ -705,10 +705,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;

View File

@ -254,6 +254,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},
};
/*******************************************************************************
*
@ -545,3 +617,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},
};

View File

@ -597,8 +597,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

View File

@ -257,9 +257,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
@ -368,7 +368,7 @@ AcpiTbGetRootTableEntry (
*
* FUNCTION: AcpiTbParseRootTable
*
* PARAMETERS: Rsdp - Pointer to the RSDP
* PARAMETERS: RsdpAddress - Pointer to the RSDP
*
* RETURN: Status
*

View File

@ -629,8 +629,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] =

View File

@ -225,14 +225,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);
@ -328,7 +334,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 */

View File

@ -0,0 +1,461 @@
/*******************************************************************************
*
* Module Name: utresdecode - Resource descriptor keyword strings
*
******************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/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

View File

@ -158,287 +158,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.
@ -479,8 +198,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[] =
@ -534,8 +257,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 */
};
@ -580,7 +307,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);
}
@ -613,8 +340,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);
@ -651,15 +378,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);
}

View File

@ -277,6 +277,8 @@ AcpiAcquireMutex (
return (Status);
}
ACPI_EXPORT_SYMBOL (AcpiAcquireMutex)
/*******************************************************************************
*
@ -317,3 +319,5 @@ AcpiReleaseMutex (
AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex);
return (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiReleaseMutex)

View File

@ -294,7 +294,7 @@ AcpiDmFinishNamespaceLoad (
ACPI_OWNER_ID OwnerId);
void
AcpiDmConvertResourceIndexes (
AcpiDmConvertParseObjects (
ACPI_PARSE_OBJECT *ParseTreeRoot,
ACPI_NAMESPACE_NODE *NamespaceRoot);

View File

@ -207,6 +207,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,
@ -257,6 +262,7 @@ typedef enum
ACPI_DMT_HEST,
ACPI_DMT_HESTNTFY,
ACPI_DMT_HESTNTYP,
ACPI_DMT_HMAT,
ACPI_DMT_IORTMEM,
ACPI_DMT_IVRS,
ACPI_DMT_LPIT,
@ -264,6 +270,7 @@ typedef enum
ACPI_DMT_NFIT,
ACPI_DMT_PCCT,
ACPI_DMT_PMTT,
ACPI_DMT_PPTT,
ACPI_DMT_SLIC,
ACPI_DMT_SRAT,
@ -412,12 +419,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[];
@ -495,6 +512,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[];
@ -513,6 +537,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[];
@ -529,6 +554,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];
@ -640,6 +666,10 @@ void
AcpiDmDumpHest (
ACPI_TABLE_HEADER *Table);
void
AcpiDmDumpHmat (
ACPI_TABLE_HEADER *Table);
void
AcpiDmDumpIort (
ACPI_TABLE_HEADER *Table);
@ -684,6 +714,10 @@ void
AcpiDmDumpPmtt (
ACPI_TABLE_HEADER *Table);
void
AcpiDmDumpPptt (
ACPI_TABLE_HEADER *Table);
UINT32
AcpiDmDumpRsdp (
ACPI_TABLE_HEADER *Table);
@ -759,10 +793,6 @@ AcpiDmDisassembleOneOp (
ACPI_OP_WALK_INFO *Info,
ACPI_PARSE_OBJECT *Op);
BOOLEAN
AcpiDmIsTempName (
ACPI_PARSE_OBJECT *Op);
UINT32
AcpiDmListType (
ACPI_PARSE_OBJECT *Op);
@ -887,6 +917,12 @@ AcpiDmAddOpToExternalList (
UINT32 Value,
UINT16 Flags);
void
AcpiDmCreateSubobjectForExternal (
UINT8 Type,
ACPI_NAMESPACE_NODE **Node,
UINT32 Value);
void
AcpiDmAddNodeToExternalList (
ACPI_NAMESPACE_NODE *Node,
@ -895,11 +931,17 @@ AcpiDmAddNodeToExternalList (
UINT16 Flags);
void
AcpiDmAddExternalsToNamespace (
AcpiDmAddExternalListToNamespace (
void);
void
AcpiDmAddOneExternalToNamespace (
char *Path,
UINT8 Type,
UINT32 Value);
UINT32
AcpiDmGetExternalMethodCount (
AcpiDmGetUnresolvedExternalMethodCount (
void);
void
@ -923,6 +965,11 @@ void
AcpiDmGetExternalsFromFile (
void);
void
AcpiDmMarkExternalConflict (
ACPI_NAMESPACE_NODE *Node);
/*
* dmresrc
*/
@ -1047,6 +1094,41 @@ AcpiDmGpioDescriptor (
UINT32 Length,
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,
@ -1168,6 +1250,17 @@ AcpiDmCloseOperator (
ACPI_PARSE_OBJECT *Op);
/*
* dmtables
*/
ACPI_STATUS
AcpiDmProcessSwitch (
ACPI_PARSE_OBJECT *Op);
void
AcpiDmClearTempList(
void);
/*
* dmtables
*/

View File

@ -427,6 +427,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);
@ -480,6 +481,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
/*

View File

@ -1136,7 +1136,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 */
@ -1444,8 +1444,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
/*****************************************************************************
@ -1482,6 +1487,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
@ -1492,6 +1498,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

View File

@ -221,7 +221,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)

View File

@ -154,7 +154,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20170303
#define ACPI_CA_VERSION 0x20170531
#include <contrib/dev/acpica/include/acconfig.h>
#include <contrib/dev/acpica/include/actypes.h>

Some files were not shown because too many files have changed in this diff Show More