From 82a5e042fafe3def60380c847fa194220069f888 Mon Sep 17 00:00:00 2001 From: Pavel Butsykin Date: Tue, 22 Sep 2015 16:18:13 +0300 Subject: [PATCH] apic_internal.h: make some apic_get_* functions externally visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move apic_get_bit(), apic_set_bit() to apic_internal.h, make the apic_get_ppr symbol external. It's necessary to work with isr, tmr, irr and ppr outside hw/intc/apic.c Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Andreas Färber Message-Id: <1442927901-1084-2-git-send-email-den@openvz.org> Signed-off-by: Paolo Bonzini --- hw/intc/apic.c | 18 +----------------- include/hw/i386/apic_internal.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/hw/intc/apic.c b/hw/intc/apic.c index 77b639cce8..52ac8b23b3 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) { @@ -318,7 +302,7 @@ static uint8_t apic_get_tpr(APICCommonState *s) return s->tpr >> 4; } -static int apic_get_ppr(APICCommonState *s) +int apic_get_ppr(APICCommonState *s) { int tpr, isrv, ppr; diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h index 26632acf37..5a213bc11b 100644 --- a/include/hw/i386/apic_internal.h +++ b/include/hw/i386/apic_internal.h @@ -147,4 +147,22 @@ void apic_enable_vapic(DeviceState *d, hwaddr paddr); void vapic_report_tpr_access(DeviceState *dev, CPUState *cpu, target_ulong ip, TPRAccess access); +int apic_get_ppr(APICCommonState *s); + +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 */