link.asl

来自「惠普公司bios完整源代码大机密!」· ASL 代码 · 共 293 行

ASL
293
字号

        Device(LNKA)	{
                Name(_HID, EISAID("PNP0C0F")) 	// PCI interrupt link
                Name(_UID, 1)
                Method(_STA, 0) {
                               And(PIRA, 0xF0, Local0)
                        If(LEqual(Local0, 0x00)) {
                                Return(0x09)	//disabled
                                }
                        Else {
                                Return(0x0B)  	//enabled, but no UI
                                }
                        }

                Method(_PRS) {
                        Name(BUFB, ResourceTemplate() {
                                IRQ(Level, ActiveLow, Shared) {
                                        1,3,4,5,6,7,10,11,12,14,15}
                        }) // Name(BUFB, ...)

                        Return(BUFB)
                } // Method(_PRS)

                Method(_DIS) {

                               And(PIRA, 0x0F, PIRA)
                }

                Method(_CRS) {
                        Name(BUFB, Buffer(){
                                0x23, 0x00, 0x00, 0x18,

                                0x79, 0})

                        CreateByteField(BUFB, 0x01, IRB1) // IRQ mask 1
                        CreateByteField(BUFB, 0x02, IRB2) // IRQ mask 2

                        Store(0x00, Local3)
                        Store(0x00, Local4)
                        And(PIRA, 0xF0, Local1)
                        ShiftRight(Local1, 4, Local1)
                        If(LNotEqual(Local1, 0x00)) { // Routing enable
                                If(LGreater(Local1, 0x07)) { // For upper byte mask
                                        Subtract(Local1, 8, Local2) // Adjust it
                                        ShiftLeft(One, Local2, Local4)} // Convert to bit mask
                                Else {If(LGreater(Local1, 0)) { // For lower byte mask
                                        ShiftLeft(One, Local1, Local3)}} // Convert to bit mask
                                Store(Local3, IRB1)     // update buffer
                                Store(Local4, IRB2)
                                }
                        Return(BUFB)
                } // Method(_CRS)

                Method(_SRS, 1) {
                        CreateByteField(ARG0, 0x01, IRB1) // IRQ mask 1
                        CreateByteField(ARG0, 0x02, IRB2) // IRQ mask 2

                        ShiftLeft(IRB2, 8, Local0) // Shift into upper byte
                        Or(Local0, IRB1, Local0)   // Convert to word

                        Store(0, Local1)
                        ShiftRight(Local0, 1, Local0) // Adjust for zero based
                        While(LGreater(Local0, 0)) { // Convert bit position to number
                                Increment(Local1)
                                ShiftRight(Local0, 1, Local0) 
                        }       

                        And(PIRA, 0x0F, PIRA)
                        ShiftLeft(Local1, 4, Local1)
                        Or(PIRA, Local1, PIRA)

                } // Method(_SRS)
        }


        Device(LNKB)	{
                Name(_HID, EISAID("PNP0C0F")) 	// PCI interrupt link
                Name(_UID, 2)
                Method(_STA, 0) {
                        And(PIBC, 0x0F, Local0)
                        If(LEqual(Local0, 0x00)) {
                                Return(0x09)	//disabled
                                }
                        Else {
                                Return(0x0B)  	//enabled, but no UI
                                }
                        }

                Method(_PRS) {
                        Name(BUFA, ResourceTemplate() {
                                IRQ(Level, ActiveLow, Shared) {
                                        1,3,4,5,6,7,10,11,12,14,15}
                        }) // Name(BUFA, ...)

                        Return(BUFA)
                } // Method(_PRS)

                Method(_DIS) {

                               And(PIBC, 0xF0, PIBC)
                }

                Method(_CRS) {
                        Name(BUFA, Buffer(){
                                0x23, 0x00, 0x00, 0x18,

                                0x79, 0})

                        CreateByteField(BUFA, 0x01, IRA1) // IRQ mask 1
                        CreateByteField(BUFA, 0x02, IRA2) // IRQ mask 2

                        Store(0x00, Local3)
                        Store(0x00, Local4)
                        And(PIBC, 0x0F, Local1)
                        If(LNotEqual(Local1, 0x00)) { // Routing enable
                                If(LGreater(Local1, 0x07)) { // For upper byte mask
                                        Subtract(Local1, 8, Local2) // Adjust it
                                        ShiftLeft(One, Local2, Local4)} // Convert to bit mask
                                Else {If(LGreater(Local1, 0)) { // For lower byte mask
                                        ShiftLeft(One, Local1, Local3)}} // Convert to bit mask
                                Store(Local3, IRA1)     // update buffer
                                Store(Local4, IRA2)
                                }
                        Return(BUFA)
                } // Method(_CRS)

                Method(_SRS, 1) {
                        CreateByteField(ARG0, 0x01, IRA1) // IRQ mask 1
                        CreateByteField(ARG0, 0x02, IRA2) // IRQ mask 2

                        ShiftLeft(IRA2, 8, Local0) // Shift into upper byte
                        Or(Local0, IRA1, Local0)   // Convert to word

                        Store(0, Local1)
                        ShiftRight(Local0, 1, Local0) // Adjust for zero based
                        While(LGreater(Local0, 0)) { // Convert bit position to number
                                Increment(Local1)
                                ShiftRight(Local0, 1, Local0) 
                        }       
                        And(PIBC, 0xF0, PIBC)
                        Or(PIBC, Local1, PIBC)

                } // Method(_SRS)
        }


        Device(LNKC)	{
                Name(_HID, EISAID("PNP0C0F")) 	// PCI interrupt link
                Name(_UID, 3)
                Method(_STA, 0) {
                               And(PIBC, 0xF0, Local0)
                        If(LEqual(Local0, 0x00)) {
                                Return(0x09)	//disabled
                                }
                        Else {
                                Return(0x0B)  	//enabled, but no UI
                                }
                        }

                Method(_PRS) {
                        Name(BUFC, ResourceTemplate() {
                                IRQ(Level, ActiveLow, Shared) {
                                        1,3,4,5,6,7,10,11,12,14,15}
                        }) // Name(BUFC, ...)

                        Return(BUFC)
                } // Method(_PRS)

                Method(_DIS) {

                               And(PIBC, 0x0F, PIBC)
                }

                Method(_CRS) {
                        Name(BUFC, Buffer(){
                                0x23, 0x00, 0x00, 0x18,

                                0x79, 0})

                        CreateByteField(BUFC, 0x01, IRC1) // IRQ mask 1
                        CreateByteField(BUFC, 0x02, IRC2) // IRQ mask 2

                        Store(0x00, Local3)
                        Store(0x00, Local4)
                        And(PIBC, 0xF0, Local1)
                        ShiftRight(Local1, 4, Local1)
                        If(LNotEqual(Local1, 0x00)) { // Routing enable
                                If(LGreater(Local1, 0x07)) { // For upper byte mask
                                        Subtract(Local1, 8, Local2) // Adjust it
                                        ShiftLeft(One, Local2, Local4)} // Convert to bit mask
                                Else {If(LGreater(Local1, 0)) { // For lower byte mask
                                        ShiftLeft(One, Local1, Local3)}} // Convert to bit mask
                                Store(Local3, IRC1)     // update buffer
                                Store(Local4, IRC2)
                                }
                        Return(BUFC)
                } // Method(_CRS)

                Method(_SRS, 1) {
                        CreateByteField(ARG0, 0x01, IRC1) // IRQ mask 1
                        CreateByteField(ARG0, 0x02, IRC2) // IRQ mask 2

                        ShiftLeft(IRC2, 8, Local0) // Shift into upper byte
                        Or(Local0, IRC1, Local0)   // Convert to word

                        Store(0, Local1)
                        ShiftRight(Local0, 1, Local0) // Adjust for zero based
                        While(LGreater(Local0, 0)) { // Convert bit position to number
                                Increment(Local1)
                                ShiftRight(Local0, 1, Local0) 
                        }       

                        And(PIBC, 0x0F, PIBC)
                        ShiftLeft(Local1, 4, Local1)
                        Or(PIBC, Local1, PIBC)

                } // Method(_SRS)
        }

        Device(LNKD)	{
                Name(_HID, EISAID("PNP0C0F")) 	// PCI interrupt link
                Name(_UID, 4)
                Method(_STA, 0) {
                               And(PIRD, 0xF0, Local0)
                        If(LEqual(Local0, 0x00)) {
                                Return(0x09)	//disabled
                                }
                        Else {
                                Return(0x0B)  	//enabled, but no UI
                                }
                        }

                Method(_PRS) {
                        Name(BUFD, ResourceTemplate() {
                                IRQ(Level, ActiveLow, Shared) {
                                        1,3,4,5,6,7,10,11,12,14,15}
                        }) // Name(BUFD, ...)

                        Return(BUFD)
                } // Method(_PRS)

                Method(_DIS) {

                               And(PIRD, 0x0F, PIRD)
                }

                Method(_CRS) {
                        Name(BUFD, Buffer(){
                                0x23, 0x00, 0x00, 0x18,

                                0x79, 0})

                        CreateByteField(BUFD, 0x01, IRD1) // IRQ mask 1
                        CreateByteField(BUFD, 0x02, IRD2) // IRQ mask 2

                        Store(0x00, Local3)
                        Store(0x00, Local4)
                        And(PIRD, 0xF0, Local1)
                        ShiftRight(Local1, 4, Local1)
                        If(LNotEqual(Local1, 0x00)) { // Routing enable
                                If(LGreater(Local1, 0x07)) { // For upper byte mask
                                        Subtract(Local1, 8, Local2) // Adjust it
                                        ShiftLeft(One, Local2, Local4)} // Convert to bit mask
                                Else {If(LGreater(Local1, 0)) { // For lower byte mask
                                        ShiftLeft(One, Local1, Local3)}} // Convert to bit mask
                                Store(Local3, IRD1)     // update buffer
                                Store(Local4, IRD2)
                                }
                        Return(BUFD)
                } // Method(_CRS)

                Method(_SRS, 1) {
                        CreateByteField(ARG0, 0x01, IRD1) // IRQ mask 1
                        CreateByteField(ARG0, 0x02, IRD2) // IRQ mask 2

                        ShiftLeft(IRD2, 8, Local0) // Shift into upper byte
                        Or(Local0, IRD1, Local0)   // Convert to word

                        Store(0, Local1)
                        ShiftRight(Local0, 1, Local0) // Adjust for zero based
                        While(LGreater(Local0, 0)) { // Convert bit position to number
                                Increment(Local1)
                                ShiftRight(Local0, 1, Local0) 
                        }       

                        And(PIRD, 0x0F, PIRD)
                        ShiftLeft(Local1, 4, Local1)
                        Or(PIRD, Local1, PIRD)

                } // Method(_SRS)
        }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?