mb/emul/qemu-[q35,i440fx]: Create ICQR interrupt resource locally and use defined offset
This changes out the PRR0 named object for a method local variable
and avoids the use of a hardcoded offset
This solves the remark:
```
dsdt.asl 415: Name(PRR0, ResourceTemplate() {
Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.IQCR)
```
The IQCR function was tested, by evaluating it in the new
`dsdt.aml` file, as well as the old one with `acpiexec`:
`acpiexec -b "Evaluate _SB.IQCR $4bit_num_dec" dsdt.aml`,
where `$4bit_num_in_dec`, is a number between 0 and 15.
Expected output:
```
Evaluation of \_SB.IQCR returned object 0x5648f23cedd0, external buffer length 28
[Buffer] Length 0B = 0000: 89 06 00 09 01 $4bit_num_hex 00 00 00 79 00 // .........y.
```
Change-Id: I007d6b8df4eef4e8cb13cef45b95da7659d62cef
Signed-off-by: Evie (Ivi) Ballou <iviballou@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91033
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
036af49b1d
commit
93444a0ce0
2 changed files with 14 additions and 12 deletions
|
|
@ -218,16 +218,17 @@ DefinitionBlock (
|
|||
}
|
||||
Return (0x0B)
|
||||
}
|
||||
|
||||
Method(IQCR, 1, Serialized) {
|
||||
// _CRS method - get current settings
|
||||
Name(PRR0, ResourceTemplate() {
|
||||
Interrupt(, Level, ActiveHigh, Shared) { 0 }
|
||||
})
|
||||
CreateDWordField(PRR0, 0x05, PRRI)
|
||||
If (Arg0 < 0x80) {
|
||||
PRRI = Arg0
|
||||
Local0 = ResourceTemplate() {
|
||||
Interrupt(, Level, ActiveHigh, Shared,,, IRQ0) { 0 }
|
||||
}
|
||||
Return (PRR0)
|
||||
CreateDWordField(Local0, IRQ0._INT, IRQV)
|
||||
If (Arg0 < 0x80) {
|
||||
IRQV = Arg0
|
||||
}
|
||||
Return (Local0)
|
||||
}
|
||||
|
||||
#define define_link(link, uid, reg) \
|
||||
|
|
|
|||
|
|
@ -291,14 +291,15 @@ DefinitionBlock (
|
|||
}
|
||||
Return (0x0B)
|
||||
}
|
||||
|
||||
Method(IQCR, 1, Serialized) {
|
||||
// _CRS method - get current settings
|
||||
Name(PRR0, ResourceTemplate() {
|
||||
Interrupt(, Level, ActiveHigh, Shared) { 0 }
|
||||
})
|
||||
CreateDWordField(PRR0, 0x05, PRRI)
|
||||
PRRI = Arg0 & 0x0F
|
||||
Return (PRR0)
|
||||
Local0 = ResourceTemplate() {
|
||||
Interrupt(, Level, ActiveHigh, Shared,,, IRQ0) { 0 }
|
||||
}
|
||||
CreateDWordField(Local0, IRQ0._INT, IRQV)
|
||||
IRQV = Arg0 & 0x0F
|
||||
Return (Local0)
|
||||
}
|
||||
|
||||
#define define_link(link, uid, reg) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue