summaryrefslogtreecommitdiff
path: root/source/compiler/aslmethod.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2019-10-18 18:00:41 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2019-10-18 18:00:41 +0000
commit858f47305dae045d81f39451ade697ba99b3266f (patch)
tree67a913169f2c94028780a7a2a0c84fc9f84e8c60 /source/compiler/aslmethod.c
parente63852a7532181a14cec2928b31af2209e98414a (diff)
Notes
Diffstat (limited to 'source/compiler/aslmethod.c')
-rw-r--r--source/compiler/aslmethod.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c
index 98884bc37ef8..667eaaaf8a81 100644
--- a/source/compiler/aslmethod.c
+++ b/source/compiler/aslmethod.c
@@ -199,6 +199,8 @@ MtMethodAnalysisWalkBegin (
ACPI_PARSE_OBJECT *NextType;
ACPI_PARSE_OBJECT *NextParamType;
UINT8 ActualArgs = 0;
+ BOOLEAN HidExists;
+ BOOLEAN AdrExists;
/* Build cross-reference output file if requested */
@@ -535,12 +537,26 @@ MtMethodAnalysisWalkBegin (
case PARSEOP_DEVICE:
- if (!ApFindNameInDeviceTree (METHOD_NAME__HID, Op) &&
- !ApFindNameInDeviceTree (METHOD_NAME__ADR, Op))
+ /* Check usage of _HID and _ADR objects */
+
+ HidExists = ApFindNameInDeviceTree (METHOD_NAME__HID, Op);
+ AdrExists = ApFindNameInDeviceTree (METHOD_NAME__ADR, Op);
+
+ if (!HidExists && !AdrExists)
{
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
"Device object requires a _HID or _ADR in same scope");
}
+ else if (HidExists && AdrExists)
+ {
+ /*
+ * According to the ACPI spec, "A device object must contain
+ * either an _HID object or an _ADR object, but should not contain
+ * both".
+ */
+ AslError (ASL_WARNING, ASL_MSG_MULTIPLE_TYPES, Op,
+ "Device object requires either a _HID or _ADR, but not both");
+ }
break;
case PARSEOP_EVENT: