[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V5 08/14] xen: add a 8259 Interrupt Controller
From: |
anthony . perard |
Subject: |
[Qemu-devel] [PATCH V5 08/14] xen: add a 8259 Interrupt Controller |
Date: |
Mon, 11 Oct 2010 17:07:04 +0100 |
From: Anthony PERARD <address@hidden>
Introduce a 8259 Interrupt Controller for target-xen; every set_irq
call makes a Xen hypercall.
Signed-off-by: Anthony PERARD <address@hidden>
Signed-off-by: Stefano Stabellini <address@hidden>
---
hw/xen_common.h | 2 ++
hw/xen_machine_fv.c | 5 ++---
xen-all.c | 12 ++++++++++++
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/hw/xen_common.h b/hw/xen_common.h
index 4c0f97d..a24bcb3 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -44,4 +44,6 @@ typedef xc_interface *qemu_xc_interface;
# define xc_fd(xen_xc) (*(int*)xen_xc)
#endif
+qemu_irq *i8259_xen_init(void);
+
#endif /* QEMU_HW_XEN_COMMON_H */
diff --git a/hw/xen_machine_fv.c b/hw/xen_machine_fv.c
index 39ee7c7..fe4491f 100644
--- a/hw/xen_machine_fv.c
+++ b/hw/xen_machine_fv.c
@@ -36,6 +36,7 @@
#include "xen_common.h"
#include "xen/hvm/hvm_info_table.h"
#include "xen_platform.h"
+#include "xen_common.h"
#define MAX_IDE_BUS 2
@@ -51,7 +52,6 @@ static void xen_init_fv(ram_addr_t ram_size,
PCIBus *pci_bus;
PCII440FXState *i440fx_state;
int piix3_devfn = -1;
- qemu_irq *cpu_irq;
qemu_irq *isa_irq;
qemu_irq *i8259;
qemu_irq *cmos_s3;
@@ -75,8 +75,7 @@ static void xen_init_fv(ram_addr_t ram_size,
env = cpu_init(cpu_model);
env->halted = 1;
- cpu_irq = pc_allocate_cpu_irq();
- i8259 = i8259_init(cpu_irq[0]);
+ i8259 = i8259_xen_init();
isa_irq_state = qemu_mallocz(sizeof (*isa_irq_state));
isa_irq_state->i8259 = i8259;
diff --git a/xen-all.c b/xen-all.c
index f913e1f..90c03eb 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -42,6 +42,18 @@ void xen_piix_pci_write_config_client(uint32_t address,
uint32_t val, int len)
}
}
+/* i8259 */
+
+static void i8259_set_irq(void *opaque, int irq, int level)
+{
+ xc_hvm_set_isa_irq_level(xen_xc, xen_domid, irq, level);
+}
+
+qemu_irq *i8259_xen_init(void)
+{
+ return qemu_allocate_irqs(i8259_set_irq, NULL, 16);
+}
+
/* Initialise Xen */
int xen_init(int smp_cpus)
--
1.7.1
- [Qemu-devel] [PATCH V5 00/14] xen device model support, anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 02/14] xen: Support new libxc calls from xen unstable., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 03/14] xen: Add xen_machine_fv, anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 04/14] Introduce -accel command option., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 01/14] xen: Replace some tab-indents with spaces (clean-up)., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 05/14] xen: Add xen in -accel option., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 06/14] xen: Add the Xen platform pci device, anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 07/14] piix_pci: Introduces Xen specific call for irq., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 08/14] xen: add a 8259 Interrupt Controller,
anthony . perard <=
- [Qemu-devel] [PATCH V5 09/14] xen: Introduce the Xen mapcache, anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 10/14] Introduce qemu_ram_ptr_unlock., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 11/14] vl.c: Introduce getter for shutdown_requested and reset_requested., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 13/14] xen: Set running state in xenstore., anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 12/14] xen: Initialize event channels and io rings, anthony . perard, 2010/10/11
- [Qemu-devel] [PATCH V5 14/14] acpi-piix4: Add Xen hypercall for sleep state., anthony . perard, 2010/10/11