From 93444a0ce0652750c7c457229a38b5a1845fe772 Mon Sep 17 00:00:00 2001 From: "Evie (Ivi) Ballou" Date: Sat, 31 Jan 2026 23:04:42 +0200 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/91033 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/mainboard/emulation/qemu-i440fx/dsdt.asl | 15 ++++++++------- src/mainboard/emulation/qemu-q35/dsdt.asl | 13 +++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/mainboard/emulation/qemu-i440fx/dsdt.asl b/src/mainboard/emulation/qemu-i440fx/dsdt.asl index 749ecfe664..89f9d5fad0 100644 --- a/src/mainboard/emulation/qemu-i440fx/dsdt.asl +++ b/src/mainboard/emulation/qemu-i440fx/dsdt.asl @@ -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) \ diff --git a/src/mainboard/emulation/qemu-q35/dsdt.asl b/src/mainboard/emulation/qemu-q35/dsdt.asl index 3fb615050a..da809d6e61 100644 --- a/src/mainboard/emulation/qemu-q35/dsdt.asl +++ b/src/mainboard/emulation/qemu-q35/dsdt.asl @@ -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) \