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

📄 win877.asl

📁 AMI 主板的BIOS源码。
💻 ASL
📖 第 1 页 / 共 3 页
字号:

			0x22,			// IRQ Descriptor
			0x00,			// 
			0x00,			//

			0x2A,			// DMA Descriptor
			0x00,			// 
			0x00,			// 

			0x79,			// End Tag
			0x00,
		})


	CreateByteField (BUF6, 0x02, IOLO)	// IO Port Low
	CreateByteField (BUF6, 0x03, IOHI)	// IO Port Hi 
	CreateByteField (BUF6, 0x04, IORL)	// Range Low
	CreateByteField (BUF6, 0x05, IORH)	// Range Hi
	CreateByteField (BUF6, 0x07, IOLG)	// Length
	CreateByteField (BUF6, 0x0a, EIOL)	// IO Port Low
	CreateByteField (BUF6, 0x0b, EIOH)	// IO Port Hi 
	CreateByteField (BUF6, 0x0c, IOLE)	// Range Low
	CreateByteField (BUF6, 0x0d, IORE)	// Range Hi

	CreateByteField (BUF6, 0x11, IRQL)	// IRQ
	CreateByteField (BUF6, 0x14, DMAC)
	
	ENFG()

	// Base Address
      	Store(CR23, Local2)
	If (LEqual(Local2,0xde))
	{
		Store(0x78,IOLO)
		Store(0x03,IOHI)
	}
	Else
	{
		If (LEqual(Local2,0xef)) 
		{
			Store(0xBC,IOLO)
			Store(0x03,IOHI)
			Store(0x04,IOLG)
		}
		Else
		{
			Store(0x78,IOLO)
			Store(0x02,IOHI)
		}
	}

	Store(IOLO, IORL)
	Store(IOHI, IORH)
	Store(IOLO, EIOL)
	Store(IOLO, IOLE)
	Add(IOHI, 0x04, EIOH)
	Store(EIOH, IORE)
	
	// IRQ
      	And(CR27,0x0f,Local5)
	If (LEqual(Local5,5))	// 877 IRQ_E is mapped to 8259 IRQ 7
	{
		Store(0x80,IRQL)
	}
	Else
	{
//		If (LEqual(Local5,1))	// 877 IRQ_A is mapped to 8259 IRQ 5
		Store(0x20,IRQL)
	}

	And(CR26,0x0f,Local5)
	If (LEqual(Local5,3))
	{
		Store(0x08,DMAC)		// DMA 3
	}
	Else
	{
		If (LEqual(Local5,2))
		{
			Store(0x02,DMAC)	// DMA 1
		}
		Else
		{
			Store(0x01,DMAC)	// DMA 0
		}
	}


	EXFG()
					
	Return(BUF6)				// Return BUF6 
		
	}					// End _CRS method
	

// Possible Resource Settings

	Name(_PRS, Buffer(){
	
//-------------------------- 1st Set
		
			0x30,			// Dependent Function Start

			0x47,			// IO port descriptor
			0x01,			// 16 Bit Decode
			0x78,			// LPT1 @ 0x378h
                        0x03,
			0x78,
                        0x03,

			0x01,			// Alignment
			0x08,			// Number of Ports

			0x47,			// IO port descriptor
			0x01,			// 16 bit decode
			0x78,			// LPT1 @ 0x778h
			0x07,
			0x78,
			0x07,

			0x01,			// Alignment
			0x04,			// Number of Ports

			0x22,			// IRQ Descriptor
			0xA0,			// IRQ7,5 
			0x00,

			0x2A,			// DMA Descriptor
                        0x0B,                   // DMA 
			0x00,			// 8-bit,not a Bus Master, 
						// Compatibility Mode Chn Spd
//-------------------------- 2nd Set

			0x30,			// Dependent Function Start

			0x47,			// IO port descriptor
			0x01,			// 16 Bit Decode
			0x78,			// LPT1 @ 0x278h
                        0x02,
			0x78,
                        0x02,

			0x01,			// Alignment
			0x08,			// Number of Ports

			0x47,			// IO port descriptor
			0x01,			// 16 bit decode
			0x78,			// LPT1 @ 0x678h
			0x06,
			0x78,
			0x06,

			0x01,			// Alignment
			0x04,			// Number of Ports

			0x22,			// IRQ Descriptor
			0xA0,			// IRQ7,5 
			0x00,

			0x2A,			// DMA Descriptor
                        0x0B,                   // DMA 
			0x00,			// 8-bit,not a Bus Master, 
						// Compatibility Mode Chn Spd

//-------------------------- 3nd Set

			0x30,			// Dependent Function Start

			0x47,			// IO port descriptor
			0x01,			// 16 Bit Decode
			0xBC,			// LPT1 @ 0x3BCh
                        0x03,
			0xBC,
                        0x03,

			0x01,			// Alignment
			0x04,			// Number of Ports

			0x47,			// IO port descriptor
			0x01,			// 16 bit decode
			0xBC,			// LPT1 @ 0x7BCh
			0x07,
			0xBC,
			0x07,

			0x01,			// Alignment
			0x04,			// Number of Ports

			0x22,			// IRQ Descriptor
			0xA0,			// IRQ7,5 
			0x00,

			0x2A,			// DMA Descriptor
                        0x0B,                   // DMA 
			0x00,			// 8-bit,not a Bus Master, 
						// Compatibility Mode Chn Spd

                        0x38,                   // End Dependent Function

			0x79,			// End Tag
			0x00,
			}) // End buffer

// Set Resource Settings

	Method ( _SRS,1 ) {		
	


	CreateByteField (ARG0, 0x02, IOLO)	// IO Port Low
	CreateByteField (ARG0, 0x03, IOHI)	// IO Port Hi
	CreateByteField (ARG0, 0x11, IRQL)	// IRQ
	CreateByteField (ARG0, 0x14, DMAC)	// DMA Channel 

	// Set the requested resources on the device

	ENFG()
	
	// Set Base IO Address
	If (LEqual(IOHI,0x03))
	{
		If (LEqual(IOLO,0x78))
		{
			Store(0xde, CR23)	// 378
		}
		Else
		{
			Store(0xef, CR23)	// 3bc
		}
	}
	Else
	{
		Store(0x9e, CR23)	// 278
	}
			
	// Set IRQ
	And(CR27,0xf0,Local0)
	If (LEqual(IRQL,0x80))		// IRQ 7
	{
		Or(Local0,0x05,CR27)
	}
	Else
	{
		Or(Local0,0x01,CR27)
	}


	// Set DMA
	And(CR26,0xf0,Local0)
	If (LEqual(DMAC,0x08))
	{
		Or(Local0,0x03,CR26)	// DMA 3
	}
	Else
	{
		If (LEqual(DMAC,0x02))
		{
			Or(Local0,0x02,CR26)	// DMA 1
		}
		Else
		{
			Or(Local0,0x01,CR26)	// DMA 0
		}
	}

	EXFG()

	} 					// End _SRS Method

} 						// End ECP Device

// LPT DEVICE

Device(LPT) {

	Name (_HID, EISAID("PNP0400"))	// PnP ID LPT Port
	

	// LPT Device Status  
	
	Method (_STA, 0) {		
	
	ENFG()
	
	And(CR09, 0x80, Local0)
	And(CR00, 0x08, Local1)
	If(LAnd(Local1, Local0))
	{
	EXFG()			
	Return(0) 	// Device Absent
	}
	Else
	{
		If(CR23)
		{
			EXFG()			
			Return(0xf)	// Return Device Present and device Active
		}
		Else
		{
			EXFG()			
			Return(0x1)	// Return Device Present and Disable
		}
	}
	} 				// End of _STA Method
	

	// Device Disable 
	
	Method (_DIS) {			
	
	ENFG()

	Store (Zero, CR23)	// Set Activate Reg = 0
	
	EXFG()	
	
	} 				// End of _DIS Method

// Current Resource Settings 
	 
	Method (_CRS) {			

		Name(BUF6,Buffer(){
			0x47,			// IO Port Descriptor
			0x01,			// 16 bit decode
			0x00,			// 
			0x00,
			0x00,			
			0x00,

			0x01,			// Alignment
			0x08,			// Number of ports
			
			0x22,			// IRQ Descriptor
			0x00,			// 
			0x00,			//

			0x79,			// End Tag
			0x00,
		})


	CreateByteField (BUF6, 0x02, IOLO)	// IO Port Low
	CreateByteField (BUF6, 0x03, IOHI)	// IO Port Hi 
	CreateByteField (BUF6, 0x04, IORL)	// Range Low
	CreateByteField (BUF6, 0x05, IORH)	// Range Hi
	CreateByteField (BUF6, 0x07, IOLG)	// Length

	CreateByteField (BUF6, 0x09, IRQL)	// IRQ
	
	ENFG()

	// Base Address
      	Store(CR23, Local2)
	If (LEqual(Local2,0xde))
	{
		Store(0x78,IOLO)
		Store(0x03,IOHI)
	}
	Else
	{
		If (LEqual(Local2,0xef)) 
		{
			Store(0xBC,IOLO)
			Store(0x03,IOHI)
			Store(0x04,IOLG)
		}
		Else
		{
			Store(0x78,IOLO)
			Store(0x02,IOHI)
		}
	}

	Store(IOLO, IORL)
	Store(IOHI, IORH)
	
	// IRQ
      	And(CR27,0x0f,Local5)
	If (LEqual(Local5,5))	// 877 IRQ_E is mapped to 8259 IRQ 7
	{
		Store(0x80,IRQL)
	}
	Else
	{
//		If (LEqual(Local5,1))	// 877 IRQ_A is mapped to 8259 IRQ 5
		Store(0x20,IRQL)
	}

	EXFG()
					
	Return(BUF6)				// Return BUF6 
		
	}					// End _CRS method
	

// Possible Resource Settings

	Name(_PRS, Buffer(){
	
//-------------------------- 1st Set
		
			0x30,			// Dependent Function Start

			0x47,			// IO port descriptor
			0x01,			// 16 Bit Decode
			0x78,			// LPT1 @ 0x378h
                        0x03,
			0x78,
                        0x03,

			0x01,			// Alignment
			0x08,			// Number of Ports

			0x22,			// IRQ Descriptor
			0xA0,			// IRQ7,5 
			0x00,

//-------------------------- 2nd Set

			0x30,			// Dependent Function Start

			0x47,			// IO port descriptor
			0x01,			// 16 Bit Decode
			0x78,			// LPT1 @ 0x278h
                        0x02,
			0x78,
                        0x02,

			0x01,			// Alignment
			0x08,			// Number of Ports

			0x22,			// IRQ Descriptor
			0xA0,			// IRQ7,5 
			0x00,

//-------------------------- 3nd Set

			0x30,			// Dependent Function Start

			0x47,			// IO port descriptor
			0x01,			// 16 Bit Decode
			0xbc,			// LPT1 @ 0x3BCh
                        0x03,
			0xbc,
                        0x03,

			0x01,			// Alignment
			0x04,			// Number of Ports

			0x22,			// IRQ Descriptor
			0xA0,			// IRQ7,5 
			0x00,

                        0x38,                   // End Dependent Function

			0x79,			// End Tag
			0x00,
			}) // End buffer

// Set Resource Settings

	Method ( _SRS,1 ) {		
	


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

	// Set the requested resources on the device

	ENFG()
	
	// Set Base IO Address
	If (LEqual(IOHI,0x03))
	{
		If (LEqual(IOLO,0x78))
		{
			Store(0xde, CR23)	// 378
		}
		Else
		{
			Store(0xef, CR23)	// 3bc
		}
	}
	Else
	{
		Store(0x9e, CR23)	// 278
	}
			
	// Set IRQ
	And(CR27,0xf0,Local0)
	If (LEqual(IRQL,0x80))		// IRQ 7
	{
		Or(Local0,0x05,CR27)
	}
	Else
	{
		Or(Local0,0x01,CR27)
	}


	EXFG()

	} 					// End _SRS Method

} 						// End ECP Device

// End of WIN877

⌨️ 快捷键说明

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