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

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

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 *
1/******************************************************************************
2 *
3 * Module Name: aslmethod.c - Control method analysis walk
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

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

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
562 * 1) If _PRS present, must have _CRS and _SRS
563 * 2) If _SRS present, must have _PRS (_PRS requires _CRS and _SRS)
564 * 3) If _DIS present, must have _SRS (_SRS requires _PRS, _PRS requires _CRS and _SRS)
565 * 4) If _SRS present, probably should have a _DIS (Remark only)
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
566 */
567 CrsExists = ApFindNameInDeviceTree (METHOD_NAME__CRS, Op);
568 DisExists = ApFindNameInDeviceTree (METHOD_NAME__DIS, Op);
569 PrsExists = ApFindNameInDeviceTree (METHOD_NAME__PRS, Op);
570 SrsExists = ApFindNameInDeviceTree (METHOD_NAME__SRS, Op);
571
571 /* 1) If _DIS is present, must have a _CRS, _PRS, and _SRS */
572 /* 1) If _PRS is present, must have a _CRS and _SRS */
572
573
573 if (DisExists)
574 if (PrsExists)
574 {
575 if (!CrsExists)
576 {
577 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
575 {
576 if (!CrsExists)
577 {
578 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
578 "_DIS is missing a _CRS, requires a _CRS, _PRS, and a _SRS");
579 "Device has a _PRS, missing a _CRS, required");
579 }
580 }
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,
581 if (!SrsExists)
582 {
583 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
590 "_DIS is missing a _SRS, requires a _CRS, _PRS, and a _SRS");
584 "Device has a _PRS, missing a _SRS, required");
591 }
592 }
593
585 }
586 }
587
594 /* 2) If _PRS is present, must have a _CRS and _SRS */
588 /* 2) If _SRS is present, must have _PRS (_PRS requires _CRS and _SRS) */
595
589
596 if (PrsExists)
590 if ((SrsExists) && (!PrsExists))
597 {
591 {
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 }
592 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
593 "Device has a _SRS, missing a _PRS, required");
609 }
610
594 }
595
611 /* 3) If _SRS is present, must have a _CRS and _PRS */
596 /* 3) If _DIS is present, must have a _SRS */
612
597
613 if (SrsExists)
598 if ((DisExists) && (!SrsExists))
614 {
599 {
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 }
600 AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
601 "Device has a _DIS, missing a _SRS, required");
630 }
602 }
603
604 /*
605 * 4) If _SRS is present, should have a _DIS (_PRS requires _CRS
606 * and _SRS) Remark only.
607 */
608 if ((SrsExists) && (!DisExists))
609 {
610 AslError (ASL_REMARK, ASL_MSG_MISSING_DEPENDENCY, Op,
611 "Device has a _SRS, no corresponding _DIS");
612 }
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 ---
613 break;
614
615 case PARSEOP_EVENT:
616 case PARSEOP_MUTEX:
617 case PARSEOP_OPERATIONREGION:
618 case PARSEOP_POWERRESOURCE:
619 case PARSEOP_PROCESSOR:
620 case PARSEOP_THERMALZONE:

--- 484 unchanged lines hidden ---