From: Pavel Butsykin <[email protected]> It's necessary to work with bitmap isr, tmr, irr outside hw/intc/apic.c
Signed-off-by: Pavel Butsykin <[email protected]> Signed-off-by: Denis V. Lunev <[email protected]> CC: Andreas Färber <[email protected]> CC: Paolo Bonzini <[email protected]> --- hw/intc/apic.c | 16 ---------------- include/hw/i386/apic_internal.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/intc/apic.c b/hw/intc/apic.c index 77b639c..e4ee032 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -51,14 +51,6 @@ static int apic_ffs_bit(uint32_t value) return ctz32(value); } -static inline void apic_set_bit(uint32_t *tab, int index) -{ - int i, mask; - i = index >> 5; - mask = 1 << (index & 0x1f); - tab[i] |= mask; -} - static inline void apic_reset_bit(uint32_t *tab, int index) { int i, mask; @@ -67,14 +59,6 @@ static inline void apic_reset_bit(uint32_t *tab, int index) tab[i] &= ~mask; } -static inline int apic_get_bit(uint32_t *tab, int index) -{ - int i, mask; - i = index >> 5; - mask = 1 << (index & 0x1f); - return !!(tab[i] & mask); -} - /* return -1 if no bit is set */ static int get_highest_priority_int(uint32_t *tab) { diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h index 26632ac..6a40156 100644 --- a/include/hw/i386/apic_internal.h +++ b/include/hw/i386/apic_internal.h @@ -147,4 +147,20 @@ void apic_enable_vapic(DeviceState *d, hwaddr paddr); void vapic_report_tpr_access(DeviceState *dev, CPUState *cpu, target_ulong ip, TPRAccess access); +static inline void apic_set_bit(uint32_t *tab, int index) +{ + int i, mask; + i = index >> 5; + mask = 1 << (index & 0x1f); + tab[i] |= mask; +} + +static inline int apic_get_bit(uint32_t *tab, int index) +{ + int i, mask; + i = index >> 5; + mask = 1 << (index & 0x1f); + return !!(tab[i] & mask); +} + #endif /* !QEMU_APIC_INTERNAL_H */ -- 2.1.4
