diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2019-10-18 18:00:41 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2019-10-18 18:00:41 +0000 |
commit | 858f47305dae045d81f39451ade697ba99b3266f (patch) | |
tree | 67a913169f2c94028780a7a2a0c84fc9f84e8c60 /source/compiler/aslmethod.c | |
parent | e63852a7532181a14cec2928b31af2209e98414a (diff) |
Notes
Diffstat (limited to 'source/compiler/aslmethod.c')
-rw-r--r-- | source/compiler/aslmethod.c | 20 |
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: |