summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2021-07-22 08:46:43 -0700
committerRobert Moore <Robert.Moore@intel.com>2021-07-22 08:46:43 -0700
commit67e059001d58af1df1d2be2c91550b333ba97155 (patch)
tree6ce7b84cbf8fcfbf89d35dc32256f07c5f9f5e2e
parentd93601cc4d943652082a001fb13ce4ee66078fb6 (diff)
downloadacpica-67e059001d58af1df1d2be2c91550b333ba97155.tar.gz
iasl: Check usage of _CRS, _DIS, _PRS, and _SRS objects (July 2021).
+ * + * Under the Device Object: + * + * 1) If _DIS is present, must have a _CRS and _SRS + * 2) If _PRS is present, must have a _CRS, _DIS, and _SRS + * 3) If _SRS is present, must have a _CRS and _DIS
-rw-r--r--source/compiler/aslmethod.c79
1 files changed, 77 insertions, 2 deletions
diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c
index e9aa7f2dd..3e186a527 100644
--- a/source/compiler/aslmethod.c
+++ b/source/compiler/aslmethod.c
@@ -205,6 +205,10 @@ MtMethodAnalysisWalkBegin (
UINT8 ActualArgs = 0;
BOOLEAN HidExists;
BOOLEAN AdrExists;
+ BOOLEAN PrsExists;
+ BOOLEAN CrsExists;
+ BOOLEAN SrsExists;
+ BOOLEAN DisExists;
/* Build cross-reference output file if requested */
@@ -536,8 +540,8 @@ MtMethodAnalysisWalkBegin (
if (!HidExists && !AdrExists)
{
- AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
- "Device object requires a _HID or _ADR in same scope");
+ AslError (ASL_ERROR, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "Device object requires a _HID or _ADR");
}
else if (HidExists && AdrExists)
{
@@ -549,6 +553,77 @@ MtMethodAnalysisWalkBegin (
AslError (ASL_WARNING, ASL_MSG_MULTIPLE_TYPES, Op,
"Device object requires either a _HID or _ADR, but not both");
}
+
+ /*
+ * Check usage of _CRS, _DIS, _PRS, and _SRS objects (July 2021).
+ *
+ * Under the Device Object:
+ *
+ * 1) If _DIS is present, must have a _CRS and _SRS
+ * 2) If _PRS is present, must have a _CRS, _DIS, and _SRS
+ * 3) If _SRS is present, must have a _CRS and _DIS
+ */
+ CrsExists = ApFindNameInDeviceTree (METHOD_NAME__CRS, Op);
+ DisExists = ApFindNameInDeviceTree (METHOD_NAME__DIS, Op);
+ PrsExists = ApFindNameInDeviceTree (METHOD_NAME__PRS, Op);
+ SrsExists = ApFindNameInDeviceTree (METHOD_NAME__SRS, Op);
+
+ /* 1) If _DIS is present, must have a _CRS and _SRS */
+
+ if (DisExists)
+ {
+ if (!CrsExists)
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_DIS is missing a _CRS, requires a _CRS and a _SRS");
+ }
+
+ if (!SrsExists)
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_DIS is missing a _SRS, requires a _CRS and a _SRS");
+ }
+ }
+
+ /* 2) If _PRS is present, must have a _CRS, _DIS, and _SRS */
+
+ if (PrsExists)
+ {
+ if (!CrsExists)
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PRS is missing a _CRS, requires a _CRS, _DIS, and a _SRS");
+ }
+
+ if (!DisExists)
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PRS is missing a _DIS, requires a _CRS, _DIS, and a _SRS");
+ }
+
+ if (!SrsExists)
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PRS is missing a _SRS, requires a _CRS, _DIS, and a _SRS");
+ }
+ }
+
+ /* 3) If _SRS is present, must have a _CRS and _DIS */
+
+ if (SrsExists)
+ {
+ if (!CrsExists)
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_SRS is missing a _CRS, requires a _CRS and a _DIS");
+ }
+
+ if (!DisExists)
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_SRS is missing a _DIS, requires a _CRS and a _DIS");
+ }
+ }
break;
case PARSEOP_EVENT: