aslmethod.c (29f37e9bcc67d5d94c9d6bbbcf2717e16bf25c4e) aslmethod.c (97c0b5ab18b6131ab11ed03b38d5e239fc811a3e)
1/******************************************************************************
2 *
3 * Module Name: aslmethod.c - Control method analysis walk
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 191 unchanged lines hidden (view full) ---

200 UINT32 i;
201 char LocalName[] = "Local0";
202 char ArgName[] = "Arg0";
203 ACPI_PARSE_OBJECT *ArgNode;
204 ACPI_PARSE_OBJECT *NextType;
205 UINT8 ActualArgs = 0;
206 BOOLEAN HidExists;
207 BOOLEAN AdrExists;
1/******************************************************************************
2 *
3 * Module Name: aslmethod.c - Control method analysis walk
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 191 unchanged lines hidden (view full) ---

200 UINT32 i;
201 char LocalName[] = "Local0";
202 char ArgName[] = "Arg0";
203 ACPI_PARSE_OBJECT *ArgNode;
204 ACPI_PARSE_OBJECT *NextType;
205 UINT8 ActualArgs = 0;
206 BOOLEAN HidExists;
207 BOOLEAN AdrExists;
208 BOOLEAN PrsExists;
209 BOOLEAN CrsExists;
210 BOOLEAN SrsExists;
211 BOOLEAN DisExists;
208
209
210 /* Build cross-reference output file if requested */
211
212 if (AslGbl_CrossReferenceOutput)
213 {
214 OtXrefWalkPart1 (Op, Level, MethodInfo);
215 }

--- 315 unchanged lines hidden (view full) ---

531
532 /* Check usage of _HID and _ADR objects */
533
534 HidExists = ApFindNameInDeviceTree (METHOD_NAME__HID, Op);
535 AdrExists = ApFindNameInDeviceTree (METHOD_NAME__ADR, Op);
536
537 if (!HidExists && !AdrExists)
538 {
212
213
214 /* Build cross-reference output file if requested */
215
216 if (AslGbl_CrossReferenceOutput)
217 {
218 OtXrefWalkPart1 (Op, Level, MethodInfo);
219 }

--- 315 unchanged lines hidden (view full) ---

535
536 /* Check usage of _HID and _ADR objects */
537
538 HidExists = ApFindNameInDeviceTree (METHOD_NAME__HID, Op);
539 AdrExists = ApFindNameInDeviceTree (METHOD_NAME__ADR, Op);
540
541 if (!HidExists && !AdrExists)
542 {
539 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
540 "Device object requires a _HID or _ADR in same scope");
543 AslError (ASL_ERROR, ASL_MSG_MISSING_DEPENDENCY, Op,
544 "Device object requires a _HID or _ADR");
541 }
542 else if (HidExists && AdrExists)
543 {
544 /*
545 * According to the ACPI spec, "A device object must contain
546 * either an _HID object or an _ADR object, but should not contain
547 * both".
548 */
549 AslError (ASL_WARNING, ASL_MSG_MULTIPLE_TYPES, Op,
550 "Device object requires either a _HID or _ADR, but not both");
551 }
545 }
546 else if (HidExists && AdrExists)
547 {
548 /*
549 * According to the ACPI spec, "A device object must contain
550 * either an _HID object or an _ADR object, but should not contain
551 * both".
552 */
553 AslError (ASL_WARNING, ASL_MSG_MULTIPLE_TYPES, Op,
554 "Device object requires either a _HID or _ADR, but not both");
555 }
556
557 /*
558 * Check usage of _CRS, _DIS, _PRS, and _SRS objects (July 2021).
559 *
560 * Under the Device Object:
561 *
562 * 1) If _DIS is present, must have a _CRS, _PRS, and _SRS
563 * 2) If _PRS is present, must have a _CRS and _SRS
564 * 3) If _SRS is present, must have a _CRS and _PRS
565 */
566 CrsExists = ApFindNameInDeviceTree (METHOD_NAME__CRS, Op);
567 DisExists = ApFindNameInDeviceTree (METHOD_NAME__DIS, Op);
568 PrsExists = ApFindNameInDeviceTree (METHOD_NAME__PRS, Op);
569 SrsExists = ApFindNameInDeviceTree (METHOD_NAME__SRS, Op);
570
571 /* 1) If _DIS is present, must have a _CRS, _PRS, and _SRS */
572
573 if (DisExists)
574 {
575 if (!CrsExists)
576 {
577 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
578 "_DIS is missing a _CRS, requires a _CRS, _PRS, and a _SRS");
579 }
580
581 if (!PrsExists)
582 {
583 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
584 "_DIS is missing a _PRS, requires a _CRS, _PRS, and a _SRS");
585 }
586
587 if (!SrsExists)
588 {
589 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
590 "_DIS is missing a _SRS, requires a _CRS, _PRS, and a _SRS");
591 }
592 }
593
594 /* 2) If _PRS is present, must have a _CRS and _SRS */
595
596 if (PrsExists)
597 {
598 if (!CrsExists)
599 {
600 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
601 "_PRS is missing a _CRS, requires a _CRS and a _SRS");
602 }
603
604 if (!SrsExists)
605 {
606 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
607 "_PRS is missing a _SRS, requires a _CRS and a _SRS");
608 }
609 }
610
611 /* 3) If _SRS is present, must have a _CRS and _PRS */
612
613 if (SrsExists)
614 {
615 if (!CrsExists)
616 {
617 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
618 "_SRS is missing a _CRS, requires a _CRS and a _PRS");
619 }
620 if (!PrsExists)
621 {
622 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
623 "_SRS is missing a _PRS, requires a _CRS and a _PRS");
624 }
625 if (!DisExists)
626 {
627 AslError (ASL_REMARK, ASL_MSG_MISSING_DEPENDENCY, Op,
628 "_SRS is missing a _DIS");
629 }
630 }
552 break;
553
554 case PARSEOP_EVENT:
555 case PARSEOP_MUTEX:
556 case PARSEOP_OPERATIONREGION:
557 case PARSEOP_POWERRESOURCE:
558 case PARSEOP_PROCESSOR:
559 case PARSEOP_THERMALZONE:

--- 484 unchanged lines hidden ---
631 break;
632
633 case PARSEOP_EVENT:
634 case PARSEOP_MUTEX:
635 case PARSEOP_OPERATIONREGION:
636 case PARSEOP_POWERRESOURCE:
637 case PARSEOP_PROCESSOR:
638 case PARSEOP_THERMALZONE:

--- 484 unchanged lines hidden ---