It's not a problem, but the syntax used here is technically 'legacy' vs the newer ASL 2.0 syntax.

From https://acpica.org/sites/acpica/files/ASL2.0Overview.pdf


Version 6.0 of the Advanced Configuration and Power interface (ACPI) specification introduced support for standard symbolic operators and expressions in the ACPI Source Language (ASL). These changes are known as ASL 2.0 and are detailed in chapter 19 of the ACPI specification. This document intends to increase visibility and further explain the benefits and implementation
of these changes.


Legacy ASL
As more developers begin working with ACPI, the limitations of the ASL language itself have become more apparent. The main mathematical and logical operators of ASL are expressed in Polish notation, which places operators to the left of operands, as shown in the examples below:


Add (X, Y, Z)
LEqual (X, Y)


Building complex expressions with this notation can make ASL code practically unreadable by humans. Even experienced BIOS engineers can find ASL expressions difficult to parse, while developers new to the language might find ASL to be inaccessible compared to languages that
use a more common notation.


ASL 2.0
Fortunately version 6.0 of the ACPI specification has introduced standard symbolic operators and infix expressions for ASL that are similar to those used in C and other common algebraic languages. The following examples show how the legacy ASL syntax above is expressed in
ASL 2.0:


Z = X + Y
If (X == Y)


The ASL 2.0 operator precedence and associativity rules are identical to the C language.These new symbolic operators are backwards compatible with existing legacy ASL operators, and are implemented with only minor changes to the ASL compiler and AML disassembler.

These changes to the ASL language are significant enough to warrant changing the name of the

language to ASL 2.0, as compared to legacy ASL.


--
Rebecca Cran


On 1/12/23 9:25 PM, Nhi Pham via groups.io wrote:
+    Method (_OSC, 4) {
+
+      //
+      // Look for the PCI Host Bridge Interface UUID.
+      // Section 6.2.10.3
+      //
+
+      //
+      // Create DWord-adressable fields from the Capabilities Buffer
+      // Create CDW1 outside the test as it's used in the else clause.
+      //
+
+      CreateDWordField (Arg3, 0, CDW1)
+      If (LEqual (Arg0, ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) {
+
+        CreateDWordField (Arg3, 4, CDW2)
+        CreateDWordField (Arg3, 8, CDW3)
+
+        //
+        // Save Capabilities DWord 2 & 3
+        //
+
+        Store (CDW2, SUPP)
+        Store (CDW3, CTRL)
+
+        //
+        // Only allow native hot plug control if OS supports:
+        //  ASPM
+        //  Clock PM
+        //  MSI/MSI-X
+        //
+
+        If (LNotEqual (And (SUPP, 0x16), 0x16)) {
+
+          //
+          // Mask bit 0 (and undefined bits)
+          //
+
+          And (CTRL, 0x1E, CTRL)
+        }
+


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100495): https://edk2.groups.io/g/devel/message/100495
Mute This Topic: https://groups.io/mt/96240133/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to