'target_get_irq_delivered' and 'target_reset_irq_delivered' point to functions that are called by update_irq() to detect coalesced interrupts. Initially they point to stub functions which pretend successful interrupt injection. apic code calls two registration functions to replace the stubs with apic_get_irq_delivered() and apic_reset_irq_delivered().
This change can be replaced if a generic feedback infrastructure to track coalesced IRQs for periodic, clock providing devices becomes available. Signed-off-by: Ulrich Obergfell <uober...@redhat.com> --- hw/apic.c | 4 ++++ hw/pc.h | 13 +++++++++++++ vl.c | 13 +++++++++++++ 3 files changed, 30 insertions(+), 0 deletions(-) diff --git a/hw/apic.c b/hw/apic.c index a45b57f..94b1d15 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -17,6 +17,7 @@ * License along with this library; if not, see <http://www.gnu.org/licenses/> */ #include "hw.h" +#include "pc.h" #include "apic.h" #include "ioapic.h" #include "qemu-timer.h" @@ -1143,6 +1144,9 @@ static SysBusDeviceInfo apic_info = { static void apic_register_devices(void) { + register_target_get_irq_delivered(apic_get_irq_delivered); + register_target_reset_irq_delivered(apic_reset_irq_delivered); + sysbus_register_withprop(&apic_info); } diff --git a/hw/pc.h b/hw/pc.h index 1291e2d..79885f4 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -7,6 +7,19 @@ #include "fdc.h" #include "net.h" +extern int (*target_get_irq_delivered)(void); +extern void (*target_reset_irq_delivered)(void); + +static inline void register_target_get_irq_delivered(int (*func)(void)) +{ + target_get_irq_delivered = func; +} + +static inline void register_target_reset_irq_delivered(void (*func)(void)) +{ + target_reset_irq_delivered = func; +} + /* PC-style peripherals (also used by other machines). */ /* serial.c */ diff --git a/vl.c b/vl.c index a143250..a2bbc61 100644 --- a/vl.c +++ b/vl.c @@ -233,6 +233,19 @@ const char *prom_envs[MAX_PROM_ENVS]; const char *nvram = NULL; int boot_menu; +static int target_get_irq_delivered_stub(void) +{ + return 1; +} + +static void target_reset_irq_delivered_stub(void) +{ + return; +} + +int (*target_get_irq_delivered)(void) = target_get_irq_delivered_stub; +void (*target_reset_irq_delivered)(void) = target_reset_irq_delivered_stub; + typedef struct FWBootEntry FWBootEntry; struct FWBootEntry { -- 1.6.2.5