]> xenbits.xensource.com Git - qemu-xen-4.6-testing.git/commitdiff
Post-merge compilation fixes and adjustments for pc initialisation (hw/pc.c)
authorIan Jackson <iwj@mariner.uk.xensource.com>
Mon, 2 Jun 2008 14:22:06 +0000 (15:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 2 Jun 2008 14:22:06 +0000 (15:22 +0100)
hw/pc.c
hw/xen_platform.h [new file with mode: 0644]
i386-dm/i8259.c

diff --git a/hw/pc.c b/hw/pc.c
index 3f04c106987e8c780e7a69261c817e6f8fd59ef1..c33c38d237870263120f2c301f4325fcc21d9aa7 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -33,6 +33,8 @@
 #include "boards.h"
 #include "console.h"
 
+#include "xen_platform.h"
+
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
 
@@ -54,7 +56,8 @@ static IOAPICState *ioapic;
 static PCIDevice *i440fx_state;
 
 static void xen_relocator_hook(target_phys_addr_t prot_addr, uint16_t protocol,
-                              uint8_t header[], int kernel_size);
+                              uint8_t header[], int kernel_size,
+                              target_phys_addr_t real_addr, int real_size);
 #define smbus_eeprom_device_init (void)
 
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
@@ -133,6 +136,8 @@ static void pic_irq_request(void *opaque, int irq, int level)
         env = env->next_cpu;
     }
 }
+#else
+#define pic_irq_request 0  /* see i386-dm/i8259.c:i8259_init */
 #endif /* !CONFIG_DM */
 
 /* PC cmos mappings */
@@ -655,7 +660,8 @@ static void load_linux(const char *kernel_filename,
     setup_size = (setup_size+1)*512;
     kernel_size -= setup_size; /* Size of protected-mode code */
 
-    xen_relocator_hook(prot_addr, protocol, header, kernel_size);
+    xen_relocator_hook(prot_addr, protocol, header, kernel_size,
+                      real_addr, setup_size-1024);
 
     if (!fread_targphys_ok(real_addr+1024, setup_size-1024, f) ||
        !fread_targphys_ok(prot_addr, kernel_size, f)) {
@@ -1232,7 +1238,8 @@ static void setup_relocator(target_phys_addr_t addr, target_phys_addr_t src, tar
 
 
 static void xen_relocator_hook(target_phys_addr_t prot_addr, uint16_t protocol,
-                              uint8_t header[], int kernel_size)
+                              uint8_t header[], int kernel_size,
+                              target_phys_addr_t real_addr, int real_size)
 {
 
     /* Urgh, Xen's HVM firmware lives at 0x100000, but that's also the
@@ -1259,17 +1266,16 @@ static void xen_relocator_hook(target_phys_addr_t prot_addr, uint16_t protocol,
            stl_p(header+0x214, reloc_prot_addr + kernel_size);
            setup_relocator(reloc_prot_addr + kernel_size, reloc_prot_addr, prot_addr, kernel_size);
        }
+       fprintf(stderr, "qemu: loading kernel protected mode (%x bytes) at %#zx\n",
+               kernel_size, (size_t)reloc_prot_addr);
+       fprintf(stderr, "qemu: loading kernel real mode (%x bytes) at %#zx\n",
+               real_size, (size_t)real_addr);
     }
-
-    fprintf(stderr, "qemu: loading kernel real mode (%#x bytes) at %#zx\n",
-           setup_size-1024, real_addr);
-    fprintf(stderr, "qemu: loading kernel protected mode (%#x bytes) at %#zx\n",
-           kernel_size, reloc_prot_addr);
 }
 
 #ifdef CONFIG_DM
 
-void vmport_init(CPUX86State *env) { }
-void apic_init(CPUX86State *env) { }
+void vmport_init(void) { }
+int apic_init(CPUX86State *env) { return 0; }
 
 #endif /* CONFIG_DM */
diff --git a/hw/xen_platform.h b/hw/xen_platform.h
new file mode 100644 (file)
index 0000000..5bf16f8
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef XEN_PLATFORM_H
+#define XEN_PLATFORM_H
+
+#include "pci.h"
+
+void pci_xen_platform_init(PCIBus *bus);
+
+#endif
index af889ce9f88125d25d2521bc8abb8698d696b707..40bbee0bbe795a3aa4645b1333f9fb0f3ed69da3 100644 (file)
@@ -34,6 +34,9 @@ static void i8259_set_irq(void *opaque, int irq, int level) {
 }
 
 qemu_irq *i8259_init(qemu_irq parent_irq)
+     /* We ignore the parent irq entirely.  The parent irq is attached to
+      * hw/pc.c:pic_irq_request
+      */
 {
     return qemu_allocate_irqs(i8259_set_irq, 0, 16);
 }