⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 8661uar2.asl

📁 award bios 源代码,喜欢汇编程序及想研究主板BIOS程序的人可以参考哦.我是费了老大的劲才找到的哦.
💻 ASL
字号:

Device(UAR2)	{ 			//Control Methods for RS232 operation
        Name(_HID,EISAID("PNP0501"))	// PnP ID for ITE8661 UART2 Port
        Name(_UID,0x02)
        Method (_STA, 0){		// UART2 Device Status
                ENFG() 			// Config Mode
                Store(0x02, LDN_)	// set logical device number for Serial Port 2

                If (ACTR) {	
                        EXFG()
                        Return(0x0F)
                        }	// Device present and active
                Else	{
                        If (LOr(IOAH,IOAL)) {
                                EXFG()

                                Return(0x0D)
                                }
                        Else {
                                EXFG()

                                Return(0x00)  // code = Device not even Present
                                }
                        }
        } 			// end of _STA method

        Method(_DIS,0)	{ 		// Disable
                ENFG() 			// Config Mode
                Store(0x02, LDN_)	// set logical device number for Serial Port 2
                Store(Zero, ACTR)   	// Set Activate Register to zero
                EXFG()
                } 			// end _DIS method


        Method(_CRS,0)	{ 		// Current Serial 2 Resource
                Name(BUF2,Buffer()
                        {
                        0x47, 		// IO Port Descriptor
                        0x01, 		// 16 bit decode
                        0x00, 		// IO Port Range Minimum Base Low
                        0x00, 		// IO Port Range Minimum Base High
                        0x00, 		// IO Port Range Maximum Base LOW
                        0x00, 		// IO Port Range Maximum Base High
                        0x00, 		// Base Alignment
                        0x08, 		// Length of contiguous IO Ports

                        0x22, 		// IRQ Descriptor
                        0x00, 		// IRQ Mask Lo=bit 2
                        0x00,

                        0x79, 		// end tag
                        0x00, 		//
                        }
                )
                CreateByteField (BUF2, 0x02, IOLO) 	//IO Port Low
                CreateByteField (BUF2, 0x03, IOHI) 	//IO Port High
                CreateByteField (BUF2, 0x04, IORL) 	//IO Port Range Low
                CreateByteField (BUF2, 0x05, IORH) 	//IO Port Range High
                CreateByteField (BUF2, 0x09, IRQL) 	//IRQ low

                ENFG() 			// Config Mode

                Store(0x02,LDN_) 	// Logical device number for serial port 2
                Store (One,ACTR)

                Store(IOAL,IOLO)
                Store(IOAL,IORL)
                Store(IOAH,IOHI)
                Store(IOAH,IORH)

                Store(One,Local0)
                ShiftLeft(Local0,INTR,IRQL)
                EXFG() 			// Normal Mode
                Return(BUF2) 		// Return BUF1
        } 				// end _CRS method

        Name(_PRS,Buffer()
                { 			//
                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xF8, 			//IO Port Range Minimum Base Low
                0x03, 			//IO Port Range Minimum Base High
                0xF8, 			//IO Port Range Maximum Base LOW
                0x03, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x00,

                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xF8, 			//IO Port Range Minimum Base Low
                0x02, 			//IO Port Range Minimum Base High
                0xF8, 			//IO Port Range Maximum Base LOW
                0x02, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x00,

                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xE8, 			//IO Port Range Minimum Base Low
                0x03, 			//IO Port Range Minimum Base High
                0xE8, 			//IO Port Range Maximum Base LOW
                0x03, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x00,

                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xE8, 			//IO Port Range Minimum Base Low
                0x02, 			//IO Port Range Minimum Base High
                0xE8, 			//IO Port Range Maximum Base LOW
                0x02, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x00,

                0x38, 			// End Dependent Function

                0x79, 			//end tag
                0x00, 			// Checksum = 0 Treat as if the
                } 			// end of Buffer
        )

        Method(_SRS,1)	{ 		//Set Resource

                CreateByteField (Arg0, 0x02, IOLO) 	//IO Port Low
                CreateByteField (Arg0, 0x03, IOHI) 	//IO Port High
                CreateByteField (Arg0, 0x09, IRQL) 	//IRQ

                ENFG() 			//Config Mode

                Store(0x02, LDN_)
                Store(IOLO, IOAL)
                Store(IOHI, IOAH)
                FindSetRightBit(IRQL,Local0)
                Subtract(Local0, 0x01, INTR)
                Store(ONE, ACTR) 	//Set activate configuration register
                EXFG() 			// Normal Mode
                } 			// end _SRS method
        } 				// end UAR2 device





Device(IrDA)	{ 			//Control Methods for IrDA operation
        Name(_HID,EISAID("PNP0510"))	// PnP ID for ITE8661 IrDA Port
        Method (_STA, 0){		// IrDA Device Status
                ENFG() 			// Config Mode
                Store(0x04, LDN_)	// set logical device number for Serial Port 2

                If (ACTR) {	
                        EXFG()
                        Return(0x0F)
                        }	// Device present and active
                Else	{
                        If (LOr(IOAH,IOAL)) {
                                EXFG()

                                Return(0x0D)
                                }
                        Else {
                                EXFG()

                                Return(0x00)  // code = Device not even Present
                                }
                        }
        } 			// end of _STA method

        Method(_DIS,0)	{ 		// Disable
                ENFG() 			// Config Mode
                Store(0x04, LDN_)	// set logical device number for Serial Port 2
                Store(Zero, ACTR)   	// Set Activate Register to zero
                EXFG()
                } 			// end _DIS method


        Method(_CRS,0)	{ 		// Current Serial 2 Resource
                Name(BUF3,Buffer()
                        {
                        0x47, 		// IO Port Descriptor
                        0x01, 		// 16 bit decode
                        0x00, 		// IO Port Range Minimum Base Low
                        0x00, 		// IO Port Range Minimum Base High
                        0x00, 		// IO Port Range Maximum Base LOW
                        0x00, 		// IO Port Range Maximum Base High
                        0x00, 		// Base Alignment
                        0x08, 		// Length of contiguous IO Ports

                        0x22, 		// IRQ Descriptor
                        0x00, 		// IRQ Mask Lo=bit 2
                        0x00,

                        0x79, 		// end tag
                        0x00, 		//
                        }
                )
                CreateByteField (BUF3, 0x02, IOLO) 	//IO Port Low
                CreateByteField (BUF3, 0x03, IOHI) 	//IO Port High
                CreateByteField (BUF3, 0x04, IORL) 	//IO Port Range Low
                CreateByteField (BUF3, 0x05, IORH) 	//IO Port Range High
                CreateByteField (BUF3, 0x09, IRQL) 	//IRQ low
                CreateByteField (BUF3, 0x0A, IRQH) 	//IRQ low

                ENFG() 			// Config Mode

                Store(0x04,LDN_) 	// Logical device number for IrDA
                Store (One,ACTR)

                Store(IOAL,IOLO)
                Store(IOAL,IORL)
                Store(IOAH,IOHI)
                Store(IOAH,IORH)


                if (LGreater(INTR, 0x08))
                        {
                        Store(0x00, IRQL)
                        Subtract(INTR, 0x08, Local0)
                        ShiftLeft(0x01, Local0, IRQH)
                        }
                Else	{
                        Store(0x00, IRQH)
                        ShiftLeft(0x01, INTR, IRQL)
                        }

                EXFG() 			// Normal Mode
                Return(BUF3) 		// Return BUF1
        } 				// end _CRS method

        Name(_PRS,Buffer()
                { 			//
                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xF8, 			//IO Port Range Minimum Base Low
                0x03, 			//IO Port Range Minimum Base High
                0xF8, 			//IO Port Range Maximum Base LOW
                0x03, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x0C,

                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xF8, 			//IO Port Range Minimum Base Low
                0x02, 			//IO Port Range Minimum Base High
                0xF8, 			//IO Port Range Maximum Base LOW
                0x02, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x0C,

                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xE8, 			//IO Port Range Minimum Base Low
                0x03, 			//IO Port Range Minimum Base High
                0xE8, 			//IO Port Range Maximum Base LOW
                0x03, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x0C,

                0x30, 			// Start Dependent Function

                0x47, 			//IO Port Descriptor
                0x01, 			//16 bit decode
                0xE8, 			//IO Port Range Minimum Base Low
                0x02, 			//IO Port Range Minimum Base High
                0xE8, 			//IO Port Range Maximum Base LOW
                0x02, 			//IO Port Range Maximum Base High
                0x00, 			//Base Alignment
                0x08, 			//Length of contiguous IO Ports

                0x22, 			//IRQ Descriptor
                0xB8, 			//IRQ Mask Lo=bits 3 and 4
                0x0C,

                0x38, 			// End Dependent Function

                0x79, 			//end tag
                0x00, 			// Checksum = 0 Treat as if the
                } 			// end of Buffer
        )

        Method(_SRS,1)	{ 		//Set Resource

                CreateByteField (Arg0, 0x02, IOLO) 	//IO Port Low
                CreateByteField (Arg0, 0x03, IOHI) 	//IO Port High
                CreateByteField (Arg0, 0x09, IRQL) 	//IRQL
                CreateByteField (Arg0, 0x0A, IRQH) 	//IRQH

                ENFG() 			//Config Mode

                Store(0x04, LDN_)
                Store(ONE, ACTR) 	//Set activate configuration register

                Store(IOLO, IOAL)
                Store(IOHI, IOAH)
                if (LEqual(IRQL, 0x00))
                        {
                        FindSetRightBit(IRQH, Local0)
                        add(Local0, 0x07, INTR)
                        }
                Else	{
                        FindSetRightBit(IRQL,Local0)
                        Subtract(Local0, 0x01, INTR)
                        }
                EXFG() 			// Normal Mode
                } 			// end _SRS method
        } 				// end UAR2 device


⌨️ 快捷键说明

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