Merge ACPICA 20200326.

This commit is contained in:
Jung-uk Kim 2020-03-27 00:29:33 +00:00
commit 3ee58df503
40 changed files with 532 additions and 125 deletions

View File

@ -356,34 +356,16 @@ struct amdvi_domain {
SLIST_ENTRY (amdvi_domain) next;
};
/*
* I/O Virtualization Hardware Definition Block (IVHD) type 0x10 (legacy)
* uses ACPI_IVRS_HARDWARE define in contrib/dev/acpica/include/actbl2.h
* New IVHD types 0x11 and 0x40 as defined in AMD IOMMU spec[48882] are missing in
* ACPI code. These new types add extra field EFR(Extended Feature Register).
* XXX : Use definition from ACPI when it is available.
*/
typedef struct acpi_ivrs_hardware_efr_sup
{
ACPI_IVRS_HEADER Header;
UINT16 CapabilityOffset; /* Offset for IOMMU control fields */
UINT64 BaseAddress; /* IOMMU control registers */
UINT16 PciSegmentGroup;
UINT16 Info; /* MSI number and unit ID */
UINT32 Attr; /* IOMMU Feature */
UINT64 ExtFR; /* IOMMU Extended Feature */
UINT64 Reserved; /* v1 feature or v2 attribute */
} __attribute__ ((__packed__)) ACPI_IVRS_HARDWARE_EFRSUP;
CTASSERT(sizeof(ACPI_IVRS_HARDWARE_EFRSUP) == 40);
/*
* Different type of IVHD.
* XXX: Use AcpiIvrsType once new IVHD types are available.
*/
enum IvrsType
{
IVRS_TYPE_HARDWARE_LEGACY = 0x10, /* Legacy without EFRi support. */
IVRS_TYPE_HARDWARE_EFR = 0x11, /* With EFR support. */
IVRS_TYPE_HARDWARE_LEGACY = ACPI_IVRS_TYPE_HARDWARE1,
/* Legacy without EFRi support. */
IVRS_TYPE_HARDWARE_EFR = ACPI_IVRS_TYPE_HARDWARE2,
/* With EFR support. */
IVRS_TYPE_HARDWARE_MIXED = 0x40, /* Mixed with EFR support. */
};

View File

@ -54,7 +54,7 @@ int ivhd_count; /* Number of IVHD header. */
* Cached IVHD header list.
* Single entry for each IVHD, filtered the legacy one.
*/
ACPI_IVRS_HARDWARE *ivhd_hdrs[10];
ACPI_IVRS_HARDWARE1 *ivhd_hdrs[10];
extern int amdvi_ptp_level; /* Page table levels. */
@ -161,7 +161,7 @@ ivrs_hdr_find_iter(ACPI_IVRS_HEADER * ivrs_hdr, void *args)
return (1);
}
static ACPI_IVRS_HARDWARE *
static ACPI_IVRS_HARDWARE1 *
ivhd_find_by_index(int idx)
{
struct find_ivrs_hdr_args fi;
@ -171,7 +171,7 @@ ivhd_find_by_index(int idx)
ivrs_hdr_iterate_tbl(ivrs_hdr_find_iter, &fi);
return ((ACPI_IVRS_HARDWARE *)fi.ptr);
return ((ACPI_IVRS_HARDWARE1 *)fi.ptr);
}
static void
@ -195,7 +195,7 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t start_id,
* Record device attributes as suggested by BIOS.
*/
static int
ivhd_dev_parse(ACPI_IVRS_HARDWARE* ivhd, struct amdvi_softc *softc)
ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc)
{
ACPI_IVRS_DE_HEADER *de;
uint8_t *p, *end;
@ -209,12 +209,12 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE* ivhd, struct amdvi_softc *softc)
switch (ivhd->Header.Type) {
case IVRS_TYPE_HARDWARE_LEGACY:
p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE);
p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE1);
break;
case IVRS_TYPE_HARDWARE_EFR:
case IVRS_TYPE_HARDWARE_MIXED:
p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE_EFRSUP);
p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE2);
break;
default:
@ -327,7 +327,7 @@ static void
ivhd_identify(driver_t *driver, device_t parent)
{
ACPI_TABLE_IVRS *ivrs;
ACPI_IVRS_HARDWARE *ivhd;
ACPI_IVRS_HARDWARE1 *ivhd;
ACPI_STATUS status;
int i, count = 0;
uint32_t ivrs_ivinfo;
@ -408,7 +408,7 @@ ivhd_identify(driver_t *driver, device_t parent)
static int
ivhd_probe(device_t dev)
{
ACPI_IVRS_HARDWARE *ivhd;
ACPI_IVRS_HARDWARE1 *ivhd;
int unit;
if (acpi_get_handle(dev) != NULL)
@ -582,7 +582,7 @@ ivhd_print_ext_feature(device_t dev, uint64_t ext_feature)
}
static int
ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HARDWARE * ivhd)
ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HARDWARE1 * ivhd)
{
device_t dev;
int max_ptp_level;
@ -612,8 +612,8 @@ ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HARDWARE * ivhd)
static int
ivhd_attach(device_t dev)
{
ACPI_IVRS_HARDWARE *ivhd;
ACPI_IVRS_HARDWARE_EFRSUP *ivhd_efr;
ACPI_IVRS_HARDWARE1 *ivhd;
ACPI_IVRS_HARDWARE2 *ivhd_efr;
struct amdvi_softc *softc;
int status, unit;
@ -637,7 +637,7 @@ ivhd_attach(device_t dev)
* On lgeacy IVHD type(0x10), it is documented as feature
* but in newer type it is attribute.
*/
softc->ivhd_feature = ivhd->Reserved;
softc->ivhd_feature = ivhd->FeatureReporting;
/*
* PCI capability has more capabilities that are not part of IVRS.
*/
@ -648,12 +648,11 @@ ivhd_attach(device_t dev)
softc->event_msix = ivhd->Info & 0x1F;
#endif
switch (ivhd->Header.Type) {
case IVRS_TYPE_HARDWARE_EFR:
case IVRS_TYPE_HARDWARE_MIXED:
ivhd_efr = (ACPI_IVRS_HARDWARE_EFRSUP *)ivhd;
softc->ext_feature = ivhd_efr->ExtFR;
break;
case IVRS_TYPE_HARDWARE_EFR:
case IVRS_TYPE_HARDWARE_MIXED:
ivhd_efr = (ACPI_IVRS_HARDWARE2 *)ivhd;
softc->ext_feature = ivhd_efr->EfrRegisterImage;
break;
}
softc->ctrl = (struct amdvi_ctrl *) PHYS_TO_DMAP(ivhd->BaseAddress);

View File

@ -1,3 +1,98 @@
----------------------------------------
26 March 2020. Summary of changes for version 20200326:
1) ACPICA kernel-resident subsystem:
Performed a code clean-up to prevent build errors on early versions of
GCC-10.
Added the NHLT table signature. iASL data table compiler/disassembler
support for this table is coming soon.
2) iASL Compiler/Disassembler and ACPICA tools:
AcpiExec: Fixed several problems with the namespace initialization file
(-fi<filename> option). Includes fixes to prevent AE_ALREADY_EXISTS
errors, several seg faults, and enhancements to line parsing within the
init file. In addition, each object found in the init file and it's new
value is displayed, as well as any such entries that do not have a
corresponding name in the namespace. For reference, the syntax for the
various supported data types are presented below:
PCHG 0x777788889999BBBB // Integer
\DEV1.STR1 "XYZ" // String
BUF1 (88 99 AA) // Buffer
PKG1 [0x1111 0x2222] // Package
\BF1 0x7980 // BufferField
RCRV 0x0123456789ABCDEF // Field Unit
iASL: Added a custom iASL macro __EXPECT__(iASL-Error-Code). This macro
can be used anywhere in a given ASL file to configure iASL to expect an
iASL compiler error code on the line where this macro was placed. If the
error code does not exist, an error is generated. This is intended to be
used for ACPICA's ASL test suite, but can be used by ASL developers as
well.
iASL: table compiler: Implemented IVRS IVHD type 11h parsing. The AMD
IVRS table parsing supported only IVHD type 10h structures. Parsing an
IVHD type 11h caused the iasl to report unknown subtable type. Add
necessary structure definition for IVHD type 11h and apply correct
parsing method based on subtable type. Micha? ?ygowski.
iASL: table compiler: Fixed IVRS table IVHD type 10h reserved field name
According to AMD IOMMU Specification Revision 3.05 the reserved field
should be IOMMU Feature Reporting. Change the name of the field to the
correct one. Micha? ?ygowski.
acpiexec: removed redeclaration of AcpiGbl_DbOpt_NoRegionSupport. Patch
based on suggestions by David Seifert and Benjamin Berg.
iASL: table compiler: removed an unused variable (DtCompilerParserResult)
causing linking errors. Patch based on suggestions by David Seifert and
Benjamin Berg.
iASL: table compiler: make LexBuffer static to avoid linking errors in
newer compilers. Patch based on suggestions by David Seifert and Benjamin
Berg.
iASL: fixed type matching between External and Named objects. External
object types can only be expressed with ACPI object type values that are
defined in the ACPI spec. However, iASL uses ACPI object type values that
are local to ACPICA in addition to the values defined in the ACPI spec.
This change implements type matching to map some object type values
specific to ACPICA to ones that are defined in the ACPI spec.
iASL: Dropped the type mismatch compiler error that can arise from
External declarations to a warning. This warning can occur when there is
a type difference between the external declaration and the actual object
declaration (when compiling multiple files/modules simultaneously).
iASL: removed an incorrect error message regarding externals. This change
removes an incorrect error that is emitted when a duplicate external
declaration does not contain a type that opens a scope. This is incorrect
because the duplicate external with conflicting types are already caught
by iASL and it doesn't make any sense to enforce what this conflicting
type should be.
AcpiXtract: fix AX_IS_TABLE_BLOCK_HEADER macro. This macro needs to be
surrounded by parens. Otherwise, a logical statement that applies a
logical not operator to this macro could result in a computation that
applies the operator to the left side of the logical and but not the
right. Reported-by: John Levon <john.levon@joyent.com>
Fixed a problem with the local version of sprint(): On 32-bit, the
provided sprintf() is non-functional: with a size of ACPI_UINT32_MAX,
String + Size will wrap, meaning End < Start, and
AcpiUtBoundStringOutput() will never output anything as a result. The
symptom seen of this was acpixtract failing to output anything -- with a
custom build that included utprint.c. Signed-off-by: John Levon
<john.levon@joyent.com>
iASL: Changed the "PlatformCommChannel" ASL keyword to "PCC", as per the
ACPI specification.
----------------------------------------
14 February 2020. Summary of changes for version 20200214:

View File

@ -258,7 +258,7 @@ const AH_TABLE AcpiGbl_SupportedTables[] =
{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_WSMT, "Windows SMM Security Mitigations Table"},
{ACPI_SIG_XENV, "Xen Environment table"},
{ACPI_SIG_XSDT, "Extended System Description Table"},
{NULL, NULL}

View File

@ -1676,7 +1676,8 @@ AcpiDmDumpTable (
Temp8 = *Target;
switch (Temp8)
{
case ACPI_IVRS_TYPE_HARDWARE:
case ACPI_IVRS_TYPE_HARDWARE1:
case ACPI_IVRS_TYPE_HARDWARE2:
Name = AcpiDmIvrsSubnames[0];
break;

View File

@ -475,11 +475,16 @@ AcpiDmDumpIvrs (
switch (Subtable->Type)
{
case ACPI_IVRS_TYPE_HARDWARE:
case ACPI_IVRS_TYPE_HARDWARE1:
InfoTable = AcpiDmTableInfoIvrs0;
break;
case ACPI_IVRS_TYPE_HARDWARE2:
InfoTable = AcpiDmTableInfoIvrs01;
break;
case ACPI_IVRS_TYPE_MEMORY1:
case ACPI_IVRS_TYPE_MEMORY2:
case ACPI_IVRS_TYPE_MEMORY3:
@ -514,11 +519,21 @@ AcpiDmDumpIvrs (
/* The hardware subtable can contain multiple device entries */
if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE)
if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE1 ||
Subtable->Type == ACPI_IVRS_TYPE_HARDWARE2)
{
EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE);
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
sizeof (ACPI_IVRS_HARDWARE));
if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE1)
{
EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE1);
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
sizeof (ACPI_IVRS_HARDWARE1));
}
else if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE2)
{
EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE2);
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
sizeof (ACPI_IVRS_HARDWARE2));
}
while (EntryOffset < (Offset + Subtable->Length))
{

View File

@ -403,7 +403,21 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[] =
{ACPI_DMT_UINT64, ACPI_IVRS0_OFFSET (BaseAddress), "Base Address", 0},
{ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (PciSegmentGroup), "PCI Segment Group", 0},
{ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (Info), "Virtualization Info", 0},
{ACPI_DMT_UINT32, ACPI_IVRS0_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_IVRS0_OFFSET (FeatureReporting), "Feature Reporting", 0},
ACPI_DMT_TERMINATOR
};
/* 0x10: I/O Virtualization Hardware Definition (IVHD) Block */
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs01[] =
{
{ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (CapabilityOffset), "Capability Offset", 0},
{ACPI_DMT_UINT64, ACPI_IVRS01_OFFSET (BaseAddress), "Base Address", 0},
{ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (PciSegmentGroup), "PCI Segment Group", 0},
{ACPI_DMT_UINT16, ACPI_IVRS01_OFFSET (Info), "Virtualization Info", 0},
{ACPI_DMT_UINT32, ACPI_IVRS01_OFFSET (Attributes), "Attributes", 0},
{ACPI_DMT_UINT64, ACPI_IVRS01_OFFSET (EfrRegisterImage), "EFR Image", 0},
{ACPI_DMT_UINT64, ACPI_IVRS01_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};

View File

@ -691,7 +691,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[] =
/*******************************************************************************
*
* WSMT - Windows SMM Security Migrations Table
* WSMT - Windows SMM Security Mitigations Table
*
******************************************************************************/

View File

@ -283,6 +283,7 @@ CmDoCompile (
LsDumpParseTree ();
UtEndEvent (Event);
UtEndEvent (FullCompile);
return (AE_OK);

View File

@ -488,7 +488,7 @@ AslCheckExpectedExceptions (
void);
ACPI_STATUS
AslExpectException (
AslLogExpectedException (
char *MessageIdString);
ACPI_STATUS
@ -501,9 +501,15 @@ AslDisableException (
BOOLEAN
AslIsExceptionIgnored (
char *Filename,
UINT32 LineNumber,
UINT8 Level,
UINT16 MessageId);
void
AslLogExpectedExceptionByLine (
char *MessageIdString);
void
AslCoreSubsystemError (
ACPI_PARSE_OBJECT *Op,

View File

@ -156,7 +156,6 @@
#include <stdlib.h>
#include <string.h>
YYSTYPE AslCompilerlval;
/*
* Generation: Use the following command line:
@ -195,6 +194,7 @@ count (int type);
LeadNameChar [A-Za-z_]
DigitChar [0-9]
ErrorCode [(][ ]*[1-9][0-9][0-9][0-9][ ]*[)]
OctalChar [0-7]
HexDigitChar [A-Fa-f0-9]
RootChar [\\]
@ -692,7 +692,7 @@ NamePathTail [.]{NameSeg}
"IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); }
"GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */
"GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */
"PlatformCommChannel" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */
"PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */
"FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); }
/* ResourceTypeKeyword: Resource Usage - Resource Descriptors */
@ -810,6 +810,22 @@ NamePathTail [.]{NameSeg}
"__LINE__" { count (0); return (PARSEOP___LINE__); }
"__PATH__" { count (0); return (PARSEOP___PATH__); }
"__METHOD__" { count (0); return (PARSEOP___METHOD__); }
"__EXPECT__"{ErrorCode} { char *s;
int index = 0;
count (0);
while (!isdigit (AslCompilertext[index]))
{
index++;
}
/*
* The eror code is contained inside the
* {ErrorCode} pattern. Extract it and log it
* as the expected error code.
*/
s = UtLocalCacheCalloc (ASL_ERROR_CODE_LENGTH + 1);
memcpy (s, AslCompilertext + index, ASL_ERROR_CODE_LENGTH);
AslLogExpectedExceptionByLine (s); }
{NameSeg} { char *s;
count (0);

View File

@ -227,6 +227,7 @@
#define ASL_NO_ABORT FALSE
#define ASL_EOF ACPI_UINT32_MAX
#define ASL_IGNORE_LINE (ACPI_UINT32_MAX -1)
#define ASL_ERROR_CODE_LENGTH 4
/* Listings */

View File

@ -162,6 +162,8 @@ AeAddToErrorLog (
static BOOLEAN
AslIsExceptionExpected (
char *Filename,
UINT32 LineNumber,
UINT8 Level,
UINT16 MessageId);
@ -170,7 +172,8 @@ AslIsExceptionDisabled (
UINT8 Level,
UINT16 MessageId);
static void AslInitEnode (
static void
AslInitEnode (
ASL_ERROR_MSG **Enode,
UINT8 Level,
UINT16 MessageId,
@ -956,7 +959,7 @@ AslCommonError (
{
/* Check if user wants to ignore this exception */
if (AslIsExceptionIgnored (Level, MessageId))
if (AslIsExceptionIgnored (Filename, LogicalLineNumber, Level, MessageId))
{
return;
}
@ -1087,6 +1090,8 @@ GetModifiedLevel (
BOOLEAN
AslIsExceptionIgnored (
char *Filename,
UINT32 LineNumber,
UINT8 Level,
UINT16 MessageId)
{
@ -1096,7 +1101,8 @@ AslIsExceptionIgnored (
/* Note: this allows exception to be disabled and expected */
ExceptionIgnored = AslIsExceptionDisabled (Level, MessageId);
ExceptionIgnored |= AslIsExceptionExpected (Level, MessageId);
ExceptionIgnored |=
AslIsExceptionExpected (Filename, LineNumber, Level, MessageId);
return (AslGbl_AllExceptionsDisabled || ExceptionIgnored);
}
@ -1104,7 +1110,7 @@ AslIsExceptionIgnored (
/*******************************************************************************
*
* FUNCTION: AslCheckExpectException
* FUNCTION: AslCheckExpectedException
*
* PARAMETERS: none
*
@ -1120,6 +1126,8 @@ AslCheckExpectedExceptions (
void)
{
UINT8 i;
ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList;
ASL_LOCATION_NODE *LocationNode;
for (i = 0; i < AslGbl_ExpectedMessagesIndex; ++i)
@ -1130,12 +1138,32 @@ AslCheckExpectedExceptions (
AslGbl_ExpectedMessages[i].MessageIdStr);
}
}
while (Current)
{
LocationNode = Current->LocationList;
while (LocationNode)
{
if (!LocationNode->MessageReceived)
{
AslCommonError (ASL_ERROR, ASL_MSG_EXCEPTION_NOT_RECEIVED,
LocationNode->LineNumber, LocationNode->LineNumber,
LocationNode->LogicalByteOffset, LocationNode->Column,
LocationNode->Filename, Current->MessageIdStr);
}
LocationNode = LocationNode->Next;
}
Current = Current->Next;
}
}
/*******************************************************************************
*
* FUNCTION: AslExpectException
* FUNCTION: AslLogExpectedException
*
* PARAMETERS: MessageIdString - ID of excepted exception during compile
*
@ -1148,7 +1176,7 @@ AslCheckExpectedExceptions (
******************************************************************************/
ACPI_STATUS
AslExpectException (
AslLogExpectedException (
char *MessageIdString)
{
UINT32 MessageId;
@ -1182,6 +1210,61 @@ AslExpectException (
}
/*******************************************************************************
*
* FUNCTION: AslLogExpectedExceptionByLine
*
* PARAMETERS: MessageIdString - ID of excepted exception during compile
*
* RETURN: Status
*
* DESCRIPTION: Enter a message ID into the global expected messages table
* based on file and line number. If these messages are not raised
* during the compilation, throw an error.
*
******************************************************************************/
void
AslLogExpectedExceptionByLine (
char *MessageIdString)
{
ASL_LOCATION_NODE *NewErrorLocationNode;
ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList;
UINT32 MessageId;
NewErrorLocationNode = UtLocalCalloc (sizeof (ASL_LOCATION_NODE));
NewErrorLocationNode->LineNumber = AslGbl_CurrentLineNumber;
NewErrorLocationNode->Filename = AslGbl_Files[ASL_FILE_INPUT].Filename;
NewErrorLocationNode->LogicalByteOffset = AslGbl_CurrentLineOffset;
NewErrorLocationNode->Column = AslGbl_CurrentColumn;
MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);
/* search the existing list for a matching message ID */
while (Current && Current->MessageId != MessageId )
{
Current = Current->Next;
}
if (!Current)
{
/* ID was not found, create a new node for this message ID */
Current = UtLocalCalloc (sizeof (ASL_EXPECTED_MSG_NODE));
Current->Next = AslGbl_ExpectedErrorCodeList;
Current->MessageIdStr = MessageIdString;
Current->MessageId = MessageId;
AslGbl_ExpectedErrorCodeList = Current;
}
NewErrorLocationNode->Next = Current->LocationList;
Current->LocationList = NewErrorLocationNode;
}
/*******************************************************************************
*
* FUNCTION: AslDisableException
@ -1272,6 +1355,7 @@ AslElevateException (
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AslIsExceptionDisabled
@ -1288,9 +1372,13 @@ AslElevateException (
static BOOLEAN
AslIsExceptionExpected (
char *Filename,
UINT32 LineNumber,
UINT8 Level,
UINT16 MessageId)
{
ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList;
ASL_LOCATION_NODE *CurrentErrorLocation;
UINT32 EncodedMessageId;
UINT32 i;
@ -1308,6 +1396,28 @@ AslIsExceptionExpected (
}
}
while (Current && Current->MessageId != EncodedMessageId)
{
Current = Current->Next;
}
if (!Current)
{
return (FALSE);
}
CurrentErrorLocation = Current->LocationList;
while (CurrentErrorLocation)
{
if (!strcmp (CurrentErrorLocation->Filename, Filename) &&
CurrentErrorLocation->LineNumber == LineNumber)
{
return (CurrentErrorLocation->MessageReceived = TRUE);
}
CurrentErrorLocation = CurrentErrorLocation->Next;
}
return (FALSE);
}
@ -1410,7 +1520,8 @@ AslDualParseOpError (
/* Check if user wants to ignore this exception */
if (AslIsExceptionIgnored (Level, MainMsgId) || !MainOp)
if (!MainOp || AslIsExceptionIgnored (MainOp->Asl.Filename,
MainOp->Asl.LogicalLineNumber, Level, MainMsgId))
{
return;
}

View File

@ -420,6 +420,7 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*AslGbl_TableSignature, "NO
ASL_EXTERN char ASL_INIT_GLOBAL (*AslGbl_TableId, "NO_ID");
ASL_EXTERN ASL_FILE_INFO ASL_INIT_GLOBAL (*AslGbl_Files, NULL);
ASL_EXTERN ASL_GLOBAL_FILE_NODE ASL_INIT_GLOBAL (*AslGbl_FilesList, NULL);
ASL_EXTERN ASL_EXPECTED_MSG_NODE ASL_INIT_GLOBAL (*AslGbl_ExpectedErrorCodeList, NULL);
/* Specific to the -q option */

View File

@ -1018,6 +1018,74 @@ LdNamespace1Begin (
}
/*******************************************************************************
*
* FUNCTION: LdAnalyzeExternals
*
* PARAMETERS: Type1
* Type2
*
* RETURN: BOOLEAN
*
* DESCRIPTION: Match Type1 and Type2 with the assumption that one might be
* using external types and another might be using local types.
* This should be used to compare the types found in external
* declarations with types found in other external declarations or
* named object declaration. This should not be used to match two
* object type declarations.
*
******************************************************************************/
static BOOLEAN
LdTypesMatchExternType (
ACPI_OBJECT_TYPE Type1,
ACPI_OBJECT_TYPE Type2)
{
BOOLEAN Type1IsLocal = Type1 > ACPI_TYPE_EXTERNAL_MAX;
BOOLEAN Type2IsLocal = Type2 > ACPI_TYPE_EXTERNAL_MAX;
ACPI_OBJECT_TYPE ExternalType;
ACPI_OBJECT_TYPE LocalType;
/*
* The inputs could represent types that are local to ACPICA or types that
* are known externally. Some local types, such as the OperationRegion
* field units, are defined with more granularity than ACPICA local types.
*
* Therefore, map the local types to the external types before matching.
*/
if (Type1IsLocal && !Type2IsLocal)
{
LocalType = Type1;
ExternalType = Type2;
}
else if (!Type1IsLocal && Type2IsLocal)
{
LocalType = Type2;
ExternalType = Type1;
}
else
{
return (Type1 == Type2);
}
switch (LocalType)
{
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
LocalType = ACPI_TYPE_FIELD_UNIT;
break;
default:
break;
}
return (LocalType == ExternalType);
}
/*******************************************************************************
*
* FUNCTION: LdAnalyzeExternals
@ -1072,12 +1140,12 @@ LdAnalyzeExternals (
if ((ActualOpType != ACPI_TYPE_ANY) &&
(ActualExternalOpType != ACPI_TYPE_ANY) &&
(ActualExternalOpType != ActualOpType))
!LdTypesMatchExternType (ActualExternalOpType, ActualOpType))
{
if (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL &&
Node->Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)
{
AslDualParseOpError (ASL_ERROR,
AslDualParseOpError (ASL_WARNING,
ASL_MSG_DUPLICATE_EXTERN_MISMATCH, Op, NULL,
ASL_MSG_DUPLICATE_EXTERN_FOUND_HERE, Node->Op, NULL);
}
@ -1094,7 +1162,7 @@ LdAnalyzeExternals (
ExternalOp = Node->Op;
ActualOp = Op;
}
AslDualParseOpError (ASL_ERROR,
AslDualParseOpError (ASL_WARNING,
ASL_MSG_DECLARATION_TYPE_MISMATCH, ExternalOp, NULL,
ASL_MSG_TYPE_MISMATCH_FOUND_HERE, ActualOp, NULL);
}
@ -1139,18 +1207,8 @@ LdAnalyzeExternals (
{
/* Allow update of externals of unknown type. */
if (AcpiNsOpensScope (ExternalOpType))
{
Node->Type = (UINT8) ExternalOpType;
Status = AE_OK;
}
else
{
sprintf (AslGbl_MsgBuffer, "%s [%s]", Op->Asl.ExternalName,
AcpiUtGetTypeName (Node->Type));
AslError (ASL_ERROR, ASL_MSG_SCOPE_TYPE, Op, AslGbl_MsgBuffer);
Status = AE_ERROR;
}
Node->Type = (UINT8) ExternalOpType;
Status = AE_OK;
}
return (Status);

View File

@ -942,7 +942,7 @@ AslDoOptions (
return (-1);
}
Status = AslExpectException (AcpiGbl_Optarg);
Status = AslLogExpectedException (AcpiGbl_Optarg);
if (ACPI_FAILURE (Status))
{
return (-1);

View File

@ -381,12 +381,37 @@ typedef struct asl_error_msg
typedef struct asl_expected_message
{
UINT32 MessageId;
char *MessageIdStr;
BOOLEAN MessageReceived;
UINT32 MessageId;
char *MessageIdStr;
BOOLEAN MessageReceived;
} ASL_EXPECTED_MESSAGE;
/*
* An entry in the line-based expected messages list
*
* TBD: might be possible to merge this with ASL_EXPECTED_MESSAGE
*/
typedef struct asl_expected_msg_node
{
struct asl_expected_msg_node *Next;
UINT32 MessageId;
char *MessageIdStr;
struct asl_location_node *LocationList;
} ASL_EXPECTED_MSG_NODE;
typedef struct asl_location_node
{
struct asl_location_node *Next;
char *Filename;
UINT32 LineNumber;
UINT32 Column;
UINT32 LogicalByteOffset;
BOOLEAN MessageReceived;
} ASL_LOCATION_NODE;
/* An entry in the listing file stack (for include files) */

View File

@ -461,7 +461,6 @@ DtCreateTableUnit (
/* dtparser - lex/yacc files */
UINT64 DtCompilerParserResult; /* Expression return value */
int
DtCompilerParserparse (
void);

View File

@ -153,7 +153,6 @@
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "dtcompilerparser.y.h"
YYSTYPE DtCompilerlval;
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("dtcompilerscanner")

View File

@ -170,7 +170,6 @@ extern char *DtCompilerParsertext;
extern DT_FIELD *AslGbl_CurrentField;
extern int DtLabelByteOffset;
extern UINT64 DtCompilerParserResult; /* Expression return value */
extern UINT64 DtCompilerParserlineno; /* Current line number */
extern UINT32 DtTokenFirstLine;

View File

@ -208,7 +208,7 @@ NewLine [\n]
/*
* Local support functions
*/
YY_BUFFER_STATE LexBuffer;
static YY_BUFFER_STATE LexBuffer;
/******************************************************************************
*

View File

@ -1967,11 +1967,16 @@ DtCompileIvrs (
switch (IvrsHeader->Type)
{
case ACPI_IVRS_TYPE_HARDWARE:
case ACPI_IVRS_TYPE_HARDWARE1:
InfoTable = AcpiDmTableInfoIvrs0;
break;
case ACPI_IVRS_TYPE_HARDWARE2:
InfoTable = AcpiDmTableInfoIvrs01;
break;
case ACPI_IVRS_TYPE_MEMORY1:
case ACPI_IVRS_TYPE_MEMORY2:
case ACPI_IVRS_TYPE_MEMORY3:
@ -1994,7 +1999,8 @@ DtCompileIvrs (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE)
if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE1 ||
IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE2)
{
while (*PFieldList &&
!strcmp ((*PFieldList)->Name, "Entry Type"))

View File

@ -189,7 +189,8 @@ DtError (
/* Check if user wants to ignore this exception */
if (AslIsExceptionIgnored (Level, MessageId))
if (AslIsExceptionIgnored (AslGbl_Files[ASL_FILE_INPUT].Filename,
FieldObject->Line, Level, MessageId))
{
return;
}

View File

@ -224,7 +224,7 @@ Identifier [a-zA-Z][0-9a-zA-Z]*
/*
* Local support functions
*/
YY_BUFFER_STATE LexBuffer;
static YY_BUFFER_STATE LexBuffer;
/******************************************************************************

View File

@ -637,19 +637,16 @@ AcpiDbGetNextToken (
return (NULL);
}
/* Remove any spaces at the beginning */
/* Remove any spaces at the beginning, ignore blank lines */
if (*String == ' ')
while (*String && isspace (*String))
{
while (*String && (*String == ' '))
{
String++;
}
String++;
}
if (!(*String))
{
return (NULL);
}
if (!(*String))
{
return (NULL);
}
switch (*String)
@ -754,7 +751,7 @@ AcpiDbGetNextToken (
/* Find end of token */
while (*String && (*String != ' '))
while (*String && !isspace (*String))
{
String++;
}

View File

@ -594,6 +594,7 @@ AcpiInitializeDebugger (
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
AcpiGbl_DbOpt_NoIniMethods = FALSE;
AcpiGbl_DbOpt_NoRegionSupport = FALSE;
AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE);
if (!AcpiGbl_DbBuffer)

View File

@ -158,7 +158,9 @@
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acdebug.h>
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
#include "aecommon.h"
#endif
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dswexec")
@ -504,7 +506,10 @@ AcpiDsExecEndOp (
UINT32 OpClass;
ACPI_PARSE_OBJECT *NextOp;
ACPI_PARSE_OBJECT *FirstArg;
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
char *Namepath;
ACPI_OPERAND_OBJECT *ObjDesc;
#endif
ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
@ -717,6 +722,29 @@ AcpiDsExecEndOp (
}
Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
if (ACPI_FAILURE (Status))
{
break;
}
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
/*
* AcpiExec support for namespace initialization file (initialize
* BufferFields in this code.)
*/
Namepath = AcpiNsGetExternalPathname (Op->Common.Node);
Status = AeLookupInitFileEntry (Namepath, &ObjDesc);
if (ACPI_SUCCESS (Status))
{
Status = AcpiExWriteDataToField (ObjDesc, Op->Common.Node->Object, NULL);
if ACPI_FAILURE (Status)
{
ACPI_EXCEPTION ((AE_INFO, Status, "While writing to buffer field"));
}
}
ACPI_FREE (Namepath);
Status = AE_OK;
#endif
break;

View File

@ -156,7 +156,6 @@
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#ifdef ACPI_ASL_COMPILER
#include <contrib/dev/acpica/include/acdisasm.h>
#endif
@ -555,7 +554,6 @@ AcpiDsLoad1EndOp (
ACPI_PARSE_OBJECT *Op;
ACPI_OBJECT_TYPE ObjectType;
ACPI_STATUS Status = AE_OK;
#ifdef ACPI_ASL_COMPILER
UINT8 ParamCount;
#endif

View File

@ -157,6 +157,9 @@
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acevents.h>
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
#include "aecommon.h"
#endif
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dswload2")
@ -531,6 +534,10 @@ AcpiDsLoad2EndOp (
ACPI_NAMESPACE_NODE *NewNode;
UINT32 i;
UINT8 RegionSpace;
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
ACPI_OPERAND_OBJECT *ObjDesc;
char *Namepath;
#endif
ACPI_FUNCTION_TRACE (DsLoad2EndOp);
@ -627,6 +634,11 @@ AcpiDsLoad2EndOp (
* be evaluated later during the execution phase
*/
Status = AcpiDsCreateBufferField (Op, WalkState);
if ACPI_FAILURE (Status)
{
ACPI_EXCEPTION ((AE_INFO, Status, "CreateBufferField failure"));
goto Cleanup;
}
break;
case AML_TYPE_NAMED_FIELD:
@ -766,6 +778,31 @@ AcpiDsLoad2EndOp (
case AML_NAME_OP:
Status = AcpiDsCreateNode (WalkState, Node, Op);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
/*
* AcpiExec support for namespace initialization file (initialize
* Name opcodes in this code.)
*/
Namepath = AcpiNsGetExternalPathname (Node);
Status = AeLookupInitFileEntry (Namepath, &ObjDesc);
if (ACPI_SUCCESS (Status))
{
/* Detach any existing object, attach new object */
if (Node->Object)
{
AcpiNsDetachObject (Node);
}
AcpiNsAttachObject (Node, ObjDesc, ObjDesc->Common.Type);
}
ACPI_FREE (Namepath);
Status = AE_OK;
#endif
break;
case AML_METHOD_OP:

View File

@ -466,11 +466,11 @@ AcpiHwLegacyWake (
/* Enable sleep button */
(void) AcpiWriteBitRegister (
(void) AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].EnableRegisterId,
ACPI_ENABLE_EVENT);
(void) AcpiWriteBitRegister (
(void) AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].StatusRegisterId,
ACPI_CLEAR_STATUS);

View File

@ -158,12 +158,6 @@
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsnames")
/* Local Prototypes */
static void
AcpiNsNormalizePathname (
char *OriginalPath);
/*******************************************************************************
*
@ -616,7 +610,7 @@ AcpiNsBuildPrefixedPathname (
*
******************************************************************************/
static void
void
AcpiNsNormalizePathname (
char *OriginalPath)
{

View File

@ -224,7 +224,7 @@ const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
"IPMI", /* 0x07 */
"GeneralPurposeIo", /* 0x08 */
"GenericSerialBus", /* 0x09 */
"PlatformCommChannel"/* 0x0A */
"PCC" /* 0x0A */
};

View File

@ -626,13 +626,13 @@ AcpiUtUpdateRefCount (
*
* FUNCTION: AcpiUtUpdateObjectReference
*
* PARAMETERS: Object - Increment ref count for this object
* and all sub-objects
* PARAMETERS: Object - Increment or decrement the ref count for
* this object and all sub-objects
* Action - Either REF_INCREMENT or REF_DECREMENT
*
* RETURN: Status
*
* DESCRIPTION: Increment the object reference count
* DESCRIPTION: Increment or decrement the object reference count
*
* Object references are incremented when:
* 1) An object is attached to a Node (namespace object)
@ -671,7 +671,7 @@ AcpiUtUpdateObjectReference (
}
/*
* All sub-objects must have their reference count incremented
* All sub-objects must have their reference count updated
* also. Different object types have different subobjects.
*/
switch (Object->Common.Type)
@ -740,6 +740,7 @@ AcpiUtUpdateObjectReference (
break;
}
}
NextObject = NULL;
break;

View File

@ -457,6 +457,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortPad[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs01[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[];

View File

@ -487,6 +487,10 @@ AcpiNsBuildNormalizedPath (
UINT32 PathSize,
BOOLEAN NoTrailing);
void
AcpiNsNormalizePathname (
char *OriginalPath);
char *
AcpiNsGetNormalizedPathname (
ACPI_NAMESPACE_NODE *Node,

View File

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

View File

@ -264,7 +264,8 @@
#define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
#define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ID_MAPPING,f)
#define ACPI_IVRSH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HEADER,f)
#define ACPI_IVRS0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f)
#define ACPI_IVRS0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE1,f)
#define ACPI_IVRS01_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE2,f)
#define ACPI_IVRS1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_MEMORY,f)
#define ACPI_IVRSD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f)
#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f)

View File

@ -187,6 +187,7 @@
#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
#define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */
#define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
#define ACPI_SIG_NHLT "NHLT" /* Non-HDAudio Link Table */
/*
@ -457,7 +458,8 @@ typedef struct acpi_ivrs_header
enum AcpiIvrsType
{
ACPI_IVRS_TYPE_HARDWARE = 0x10,
ACPI_IVRS_TYPE_HARDWARE1 = 0x10,
ACPI_IVRS_TYPE_HARDWARE2 = 0x11,
ACPI_IVRS_TYPE_MEMORY1 = 0x20,
ACPI_IVRS_TYPE_MEMORY2 = 0x21,
ACPI_IVRS_TYPE_MEMORY3 = 0x22
@ -485,16 +487,30 @@ enum AcpiIvrsType
/* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
typedef struct acpi_ivrs_hardware
typedef struct acpi_ivrs_hardware_10
{
ACPI_IVRS_HEADER Header;
UINT16 CapabilityOffset; /* Offset for IOMMU control fields */
UINT64 BaseAddress; /* IOMMU control registers */
UINT16 PciSegmentGroup;
UINT16 Info; /* MSI number and unit ID */
UINT32 Reserved;
UINT32 FeatureReporting;
} ACPI_IVRS_HARDWARE;
} ACPI_IVRS_HARDWARE1;
/* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
typedef struct acpi_ivrs_hardware_11
{
ACPI_IVRS_HEADER Header;
UINT16 CapabilityOffset; /* Offset for IOMMU control fields */
UINT64 BaseAddress; /* IOMMU control registers */
UINT16 PciSegmentGroup;
UINT16 Info; /* MSI number and unit ID */
UINT32 Attributes;
UINT64 EfrRegisterImage;
UINT64 Reserved;
} ACPI_IVRS_HARDWARE2;
/* Masks for Info field above */

View File

@ -183,7 +183,7 @@
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
#define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Migrations Table */
#define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Mitigations Table */
#define ACPI_SIG_XENV "XENV" /* Xen Environment table */
#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */
@ -904,10 +904,10 @@ typedef struct acpi_table_wpbt
/*******************************************************************************
*
* WSMT - Windows SMM Security Migrations Table
* WSMT - Windows SMM Security Mitigations Table
* Version 1
*
* Conforms to "Windows SMM Security Migrations Table",
* Conforms to "Windows SMM Security Mitigations Table",
* Version 1.0, April 18, 2016
*
******************************************************************************/

View File

@ -200,4 +200,4 @@
#define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"
#endif /* __AUUID_H__ */
#endif /* __ACUUID_H__ */