diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-12-13 15:39:04 +0100 |
---|---|---|
committer | Jan Kiszka <jan.kiszka@siemens.com> | 2012-01-19 12:14:40 +0100 |
commit | 343270ea8777fa95ce2c287fc00c2eaa53255265 (patch) | |
tree | 3625eec20259e3526edc6886adf85626f0473871 /hw | |
parent | 02c091953cd8c24db46649ad2862b9648c50f865 (diff) |
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 <jan.kiszka@siemens.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/apic.c | 11 | ||||
-rw-r--r-- | hw/apic.h | 1 |
2 files changed, 9 insertions, 3 deletions
@@ -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) @@ -10,6 +10,7 @@ int apic_accept_pic_intr(DeviceState *s); void apic_deliver_pic_intr(DeviceState *s, int level); void apic_deliver_nmi(DeviceState *d); int apic_get_interrupt(DeviceState *s); +void apic_report_irq_delivered(int delivered); void apic_reset_irq_delivered(void); int apic_get_irq_delivered(void); void cpu_set_apic_base(DeviceState *s, uint64_t val); |