From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M28gp-0001uG-6c for qemu-devel@nongnu.org; Thu, 07 May 2009 14:51:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M28gj-0001pI-IT for qemu-devel@nongnu.org; Thu, 07 May 2009 14:51:25 -0400 Received: from [199.232.76.173] (port=35429 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M28gi-0001ox-SJ for qemu-devel@nongnu.org; Thu, 07 May 2009 14:51:20 -0400 Received: from mx20.gnu.org ([199.232.41.8]:28166) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M28gh-0007Jf-EJ for qemu-devel@nongnu.org; Thu, 07 May 2009 14:51:19 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M28gd-0008TC-AA for qemu-devel@nongnu.org; Thu, 07 May 2009 14:51:18 -0400 From: Glauber Costa Date: Thu, 7 May 2009 14:51:03 -0400 Message-Id: <1241722263-26541-5-git-send-email-glommer@redhat.com> In-Reply-To: <1241722263-26541-4-git-send-email-glommer@redhat.com> References: <1241722263-26541-1-git-send-email-glommer@redhat.com> <1241722263-26541-2-git-send-email-glommer@redhat.com> <1241722263-26541-3-git-send-email-glommer@redhat.com> <1241722263-26541-4-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 4/4] move apic functions to a separate apic.h header List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com Later on, we'll want to call an apic function from helper.c. The inclusion of pc.h, besides totally ugly, leads to a lot of clashes. Signed-off-by: Glauber Costa --- hw/apic.c | 1 + hw/apic.h | 19 +++++++++++++++++++ hw/ioapic.c | 1 + hw/mc146818rtc.c | 1 + hw/pc.c | 1 + hw/pc.h | 15 --------------- 6 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 hw/apic.h diff --git a/hw/apic.c b/hw/apic.c index d63d74b..72dbe88 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -19,6 +19,7 @@ */ #include "hw.h" #include "pc.h" +#include "apic.h" #include "qemu-timer.h" #include "host-utils.h" diff --git a/hw/apic.h b/hw/apic.h new file mode 100644 index 0000000..2437e9f --- /dev/null +++ b/hw/apic.h @@ -0,0 +1,19 @@ +#ifndef _APIC_H_ +#define _APIC_H_ + +/* APIC */ +typedef struct IOAPICState IOAPICState; +void apic_deliver_irq(uint8_t dest, uint8_t dest_mode, + uint8_t delivery_mode, + uint8_t vector_num, uint8_t polarity, + uint8_t trigger_mode); +int apic_init(CPUState *env); +int apic_accept_pic_intr(CPUState *env); +void apic_deliver_pic_intr(CPUState *env, int level); +int apic_get_interrupt(CPUState *env); +IOAPICState *ioapic_init(void); +void ioapic_set_irq(void *opaque, int vector, int level); +void apic_reset_irq_delivered(void); +int apic_get_irq_delivered(void); + +#endif diff --git a/hw/ioapic.c b/hw/ioapic.c index 317c2c2..064f9ce 100644 --- a/hw/ioapic.c +++ b/hw/ioapic.c @@ -22,6 +22,7 @@ */ #include "hw.h" +#include "apic.h" #include "pc.h" #include "qemu-timer.h" #include "host-utils.h" diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 888b85a..b71624f 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -25,6 +25,7 @@ #include "qemu-timer.h" #include "sysemu.h" #include "pc.h" +#include "apic.h" #include "isa.h" #include "hpet_emul.h" diff --git a/hw/pc.c b/hw/pc.c index 06d1fca..2035705 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -23,6 +23,7 @@ */ #include "hw.h" #include "pc.h" +#include "apic.h" #include "fdc.h" #include "pci.h" #include "block.h" diff --git a/hw/pc.h b/hw/pc.h index 50e6c39..417ff65 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -40,21 +40,6 @@ uint32_t pic_intack_read(PicState2 *s); void pic_info(Monitor *mon); void irq_info(Monitor *mon); -/* APIC */ -typedef struct IOAPICState IOAPICState; -void apic_deliver_irq(uint8_t dest, uint8_t dest_mode, - uint8_t delivery_mode, - uint8_t vector_num, uint8_t polarity, - uint8_t trigger_mode); -int apic_init(CPUState *env); -int apic_accept_pic_intr(CPUState *env); -void apic_deliver_pic_intr(CPUState *env, int level); -int apic_get_interrupt(CPUState *env); -IOAPICState *ioapic_init(void); -void ioapic_set_irq(void *opaque, int vector, int level); -void apic_reset_irq_delivered(void); -int apic_get_irq_delivered(void); - /* i8254.c */ #define PIT_FREQ 1193182 -- 1.5.6.6