qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 1/9] add base-addr field to io apic state


From: Glauber Costa
Subject: [Qemu-devel] [PATCH v2 1/9] add base-addr field to io apic state
Date: Wed, 7 Oct 2009 19:08:27 -0300

It is not saved in savevm. Will do it in another patch.

Signed-off-by: Glauber Costa <address@hidden>
---
 hw/ioapic.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/ioapic.c b/hw/ioapic.c
index b0ad78f..e37157f 100644
--- a/hw/ioapic.c
+++ b/hw/ioapic.c
@@ -28,6 +28,7 @@
 //#define DEBUG_IOAPIC
 
 #define IOAPIC_NUM_PINS                        0x18
+#define IOAPIC_DEFAULT_BASE_ADDRESS  0xfec00000
 #define IOAPIC_LVT_MASKED              (1<<16)
 
 #define IOAPIC_TRIGGER_EDGE            0
@@ -45,6 +46,7 @@
 struct IOAPICState {
     uint8_t id;
     uint8_t ioregsel;
+    uint64_t base_address;
 
     uint32_t irr;
     uint64_t ioredtbl[IOAPIC_NUM_PINS];
@@ -210,6 +212,7 @@ static void ioapic_reset(void *opaque)
     int i;
 
     memset(s, 0, sizeof(*s));
+    s->base_address = IOAPIC_DEFAULT_BASE_ADDRESS;
     for(i = 0; i < IOAPIC_NUM_PINS; i++)
         s->ioredtbl[i] = 1 << 16; /* mask LVT */
 }
@@ -237,7 +240,7 @@ qemu_irq *ioapic_init(void)
 
     io_memory = cpu_register_io_memory(ioapic_mem_read,
                                        ioapic_mem_write, s);
-    cpu_register_physical_memory(0xfec00000, 0x1000, io_memory);
+    cpu_register_physical_memory(IOAPIC_DEFAULT_BASE_ADDRESS, 0x1000, 
io_memory);
 
     vmstate_register(0, &vmstate_ioapic, s);
     qemu_register_reset(ioapic_reset, s);
-- 
1.6.2.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]