mirror of https://github.com/acidanthera/audk.git
OvmfPkg: simplify _CRS, _PRS, _SRS methods in the DSDT
Use Extended Interrupt Descriptors in the _CRS, _PRS, _SRS methods of \_SB.PCI0.LPC.LNK[A-D], eliminating bit shifting. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13619 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5e57fb754a
commit
cc16a9298b
|
@ -250,46 +250,46 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "OVMF ", 3) {
|
|||
// _CRS method for LNKA, LNKB, LNKC, LNKD
|
||||
//
|
||||
Method (PCRS, 1, NotSerialized) {
|
||||
Name (BUF0, ResourceTemplate () {IRQ (Level, ActiveLow, Shared){0}})
|
||||
//
|
||||
// Define references to buffer elements
|
||||
// create temporary buffer with an Extended Interrupt Descriptor
|
||||
// whose single vector defaults to zero
|
||||
//
|
||||
CreateWordField (BUF0, 0x01, IRQW) // IRQ low
|
||||
Name (BUF0, ResourceTemplate () {
|
||||
Interrupt (ResourceConsumer, Level, ActiveLow, Shared){0}
|
||||
}
|
||||
)
|
||||
|
||||
//
|
||||
// Write current settings into IRQ descriptor
|
||||
// define reference to first interrupt vector in buffer
|
||||
//
|
||||
If (And (Arg0, 0x80)) {
|
||||
Store (Zero, Local0)
|
||||
} Else {
|
||||
Store (One, Local0)
|
||||
CreateDWordField (BUF0, 0x05, IRQW)
|
||||
|
||||
//
|
||||
// If the disable-bit is clear, overwrite the default zero vector
|
||||
// with the value in Arg0 (ie. PIRQRC[A:D]). Reserved bits are read
|
||||
// as 0.
|
||||
//
|
||||
If (LNot (And (Arg0, 0x80))) {
|
||||
Store (Arg0, IRQW)
|
||||
}
|
||||
//
|
||||
// Shift 1 by value in register 70
|
||||
//
|
||||
ShiftLeft (Local0, And (Arg0, 0x0F), IRQW) // Save in buffer
|
||||
Return (BUF0) // Return Buf0
|
||||
Return (BUF0)
|
||||
}
|
||||
|
||||
//
|
||||
// _PRS resource for LNKA, LNKB, LNKC, LNKD
|
||||
//
|
||||
Name (PPRS, ResourceTemplate () {
|
||||
IRQ (Level, ActiveLow, Shared) {3, 4, 5, 7, 9, 10, 11, 12, 14, 15}
|
||||
Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {
|
||||
3, 4, 5, 7, 9, 10, 11, 12, 14, 15
|
||||
}
|
||||
})
|
||||
|
||||
//
|
||||
// _SRS method for LNKA, LNKB, LNKC, LNKD
|
||||
//
|
||||
Method (PSRS, 2, NotSerialized) {
|
||||
CreateWordField (Arg1, 0x01, IRQW) // IRQ low
|
||||
FindSetRightBit (IRQW, Local0) // Set IRQ
|
||||
If (LNotEqual (IRQW, Zero)) {
|
||||
And (Local0, 0x7F, Local0)
|
||||
Decrement (Local0)
|
||||
} Else {
|
||||
Or (Local0, 0x80, Local0)
|
||||
}
|
||||
Store (Local0, Arg0)
|
||||
CreateDWordField (Arg1, 0x05, IRQW)
|
||||
Store (IRQW, Arg0)
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue