📄 p364lpt.asl
字号:
Device(ECP)
{
Name (_HID, EISAID("PNP0401"))
Method (_STA, 0)
{
Store (0x01, LDN_)
If (ACTR)
{
Return(0x0F)
} // Device present and active
Else
{
If (LOr(IOAH,IOAL))
{
Return(0x0D)
} //Device is Present, but not Active
Else
{
Return(0x00)
}
} // end of _STA method
}
Method (_DIS,0)
{
Store (0x01, LDN_)
Store (Zero, ACTR)
SLDM(DMCH, 0x4) //R01
DISD(0x02) //R01
} // end of _DIS method
Method (_CRS,0)
{
Name(BUF6, Buffer()
{ // 16*8
0x47, // IO port descriptor
0x01, // 16 bit decode
0x00, // LPT1 @ 0x278h
0x00,
0x00,
0x00,
0x08, // alignment
0x08, // number of ports
0x47, // IO port descriptor
0x01, // 16 bit decode
0x00,
0x00,
0x00,
0x00,
0x08, //R02 alignment
0x08, //R02 number of ports
0x22, // IRQ Descriptor
0x00, // IRQ7 (Bit15=IRQ15....Bit0=IRQ0)
0x00,
0x2A, // DMA Descriptor
0x00, // DMA3 (Bit7=DMA7....Bit0=DMA0)
0x00, // 8-bit, not a Bus Master, compatibility mode chn speed
0x79, // end tag
0x00,
})
CreateByteField (BUF6, 0x02, IOLO)
CreateByteField (BUF6, 0x03, IOHI)
CreateByteField (BUF6, 0x04, IORL) // IO Port Low
CreateByteField (BUF6, 0x05, IORH) // IO Port HI
CreateByteField (BUF6, 0x06, ALG1) // alignment of port
CreateByteField (BUF6, 0x07, BYE1) // number of port
CreateByteField (BUF6, 0x0A, IOEL)
CreateByteField (BUF6, 0x0B, IOEH)
CreateByteField (BUF6, 0x0C, IOML) // IO Port Low
CreateByteField (BUF6, 0x0D, IOMH) // IO Port HI
CreateWordField (BUF6, 0x11, IRQW)
CreateByteField (BUF6, 0x14, DMAC)
Store (0x01, LDN_)
Store (One, ACTR)
Store (IOAL, Local2)
Store (Local2, IOLO)
Store (IOAH, Local3)
Store (Local3, IOHI)
Or (Local3,0x04, Local3)
Store (Local3, IOEH)
Store (Local3, IOMH)
Store (IOLO, IORL)
Store (IOLO, IOEL)
Store (IOLO, IOML)
Store (IOHI, IORH)
If(LEqual(ALG1, 0xBC))
{
Store(4, ALG1) // alignment of port
Store(4, BYE1) // number of port
}
Store(Zero, IRQW)
If(LNotEqual(INTR,Zero))
{
ShiftLeft(One,INTR,IRQW)
}
Store(One,Local0)
Store(DMCH,Local5)
ShiftLeft(Local0,Local5,DMAC)
Return(BUF6) // return BUF6 filled with Current Resources
} // end _CRS method
Name(_PRS, Buffer()
{ // 16*8
0x30,
0x47,
0x01,
0x78,
0x03,
0x78,
0x03,
0x08,
0x08,
0x47,
0x01,
0x78,
0x07,
0x78,
0x07,
0x08, //R02 alignment
0x08, //R02 number of ports
0x30,
0x47,
0x01,
0x78,
0x02,
0x78,
0x02,
0x08,
0x08,
0x47,
0x01,
0x78,
0x06,
0x78,
0x06,
0x08, //R02 alignment
0x08, //R02 number of ports
0x30,
0x47,
0x01,
0xBC,
0x03,
0xBC,
0x03,
0x04,
0x04,
0x47,
0x01,
0xBC,
0x07,
0xBC,
0x07,
0x04,
0x04,
0x38,
0x22,
0xB8,
0x1E,
0x2A,
0x0B,
0x00,
0x79,
0x00,
}) // end _PRS method
Method (_SRS,1 )
{
CreateByteField (ARG0, 0x02, IOLO) // IO Port Low
CreateByteField (ARG0, 0x03, IOHI) // IO Port HI
CreateWordField (Arg0, 0x02, IOAD) //R01
CreateWordField (ARG0, 0x11, IRQW)
CreateByteField (ARG0, 0x14, DMAC) // DMA Channel to assign
Store (0x01, LDN_)
Store(One, ACTR) // Active (ie Enable) the Device
Store(IOLO, IOAL) // Write IO Port LOW to dev cfg reg
Store(IOHI, IOAH)
If(LEqual(IOAD, 0x3BC))
{
And(OPT1, 0xEF, OPT1)
}
else
{
Or(OPT1, 0x10, OPT1)
}
FindSetLeftBit(IRQW, Local0)
If(LNotEqual(Local0, Zero))
{
Subtract(Local0, 0x01, Local0)
}
Store (Local0, INTR)
FindSetLeftBit(DMAC, Local1)
Store(DMCH, Local0) //R01
Subtract(Local1, 0x01, DMCH)
SLDM(Local0, DMCH) //R01
CKIO(IOAD,0x02) //R01
} // end of _SRS method
} // end ECP device
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -