From 343270ea8777fa95ce2c287fc00c2eaa53255265 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 13 Dec 2011 15:39:04 +0100 Subject: apic: Introduce apic_report_irq_delivered The in-kernel i8259 and IOAPIC backends for KVM will need this, so encapsulate the shared bits. Signed-off-by: Jan Kiszka --- hw/apic.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'hw/apic.c') diff --git a/hw/apic.c b/hw/apic.c index b9d733c31a..bec493bf63 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -413,6 +413,13 @@ static void apic_update_irq(APICState *s) } } +void apic_report_irq_delivered(int delivered) +{ + apic_irq_delivered += delivered; + + trace_apic_report_irq_delivered(apic_irq_delivered); +} + void apic_reset_irq_delivered(void) { trace_apic_reset_irq_delivered(apic_irq_delivered); @@ -429,9 +436,7 @@ int apic_get_irq_delivered(void) static void apic_set_irq(APICState *s, int vector_num, int trigger_mode) { - apic_irq_delivered += !get_bit(s->irr, vector_num); - - trace_apic_set_irq(apic_irq_delivered); + apic_report_irq_delivered(!get_bit(s->irr, vector_num)); set_bit(s->irr, vector_num); if (trigger_mode) -- cgit v1.2.3