[PATCH] qemu-kvm: ia64 build fix.

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

 



>From 7ae1cc3ac39e920ecd553902a5f578af8cdb383c Mon Sep 17 00:00:00 2001
From: Xiantao Zhang <xiantao.zhang@xxxxxxxxx>
Date: Wed, 12 Aug 2009 10:48:18 +0800
Subject: [PATCH] qemu-kvm: ia64 build fix.
 
fixed missing part for ipf due to common changes.
 
Signed-off-by: Xiantao Zhang <xiantao.zhang@xxxxxxxxx>
---
 configure               |    7 ----
 hw/ipf.c                |   75 ++++++++++++++++++++++++++++------------------
 target-ia64/cpu.h       |    2 -
 target-ia64/translate.c |   13 +++++---
 4 files changed, 54 insertions(+), 43 deletions(-)
 
diff --git a/configure b/configure
index 84af8bd..719d26a 100755
--- a/configure
+++ b/configure
@@ -2383,13 +2383,6 @@ if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
     ;;
   esac
 fi
-if test "$target_softmmu" = "yes" ; then
-  case "$ARCH" in
-  ia64)
-    ldflags="-Wl,-G0 $linker_script -static $ldflags"
-    ;;
-  esac
-fi
 
 echo "LDFLAGS+=$ldflags" >> $config_mak
 echo "QEMU_CFLAGS+=$cflags" >> $config_mak
diff --git a/hw/ipf.c b/hw/ipf.c
index 04b7b2c..dbbee13 100644
--- a/hw/ipf.c
+++ b/hw/ipf.c
@@ -50,6 +50,8 @@
 
 #define MAX_IDE_BUS 2
 
+char bios_dir[]= "/usr/local/share/qemu";
+
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PCIDevice *i440fx_state;
@@ -372,12 +374,20 @@ static void pc_init_ne2k_isa(NICInfo *nd, qemu_irq *pic)
     nb_ne2k++;
 }
 
+enum {
+    COMPAT_DEFAULT = 0,
+    COMPAT_0_10, /* compatible with qemu 0.10.x */
+};
+
 /* Itanium hardware initialisation */
 static void ipf_init1(ram_addr_t ram_size,
-                      const char *boot_device, DisplayState *ds,
-                      const char *kernel_filename, const char *kernel_cmdline,
+                      const char *boot_device,
+                      const char *kernel_filename,
+                      const char *kernel_cmdline,
                       const char *initrd_filename,
-                      int pci_enabled, const char *cpu_model)
+                      const char *cpu_model,
+                      int pci_enabled,
+                      int compat_level)
 {
     char buf[1024];
     int i;
@@ -390,10 +400,11 @@ static void ipf_init1(ram_addr_t ram_size,
     qemu_irq *cpu_irq;
     qemu_irq *i8259;
     int page_size;
-    int index;
+    DriveInfo *dinfo;
     unsigned long ipf_legacy_io_base, ipf_legacy_io_mem;
     BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
     BlockDriverState *fd[MAX_FD];
+    const char *virtio_blk_name, *virtio_console_name;
 
     page_size = getpagesize();
     if (page_size != TARGET_PAGE_SIZE) {
@@ -422,7 +433,7 @@ static void ipf_init1(ram_addr_t ram_size,
         if (i != 0)
             env->hflags |= HF_HALTED_MASK;
         register_savevm("cpu", i, 4, cpu_save, cpu_load, env);
-        qemu_register_reset(main_cpu_reset, 0, env);
+        qemu_register_reset(main_cpu_reset, env);
     }
 
     /* allocate RAM */
@@ -491,7 +502,7 @@ static void ipf_init1(ram_addr_t ram_size,
 
     /*Register legacy io address space, size:64M*/
     ipf_legacy_io_base = 0xE0000000;
-    ipf_legacy_io_mem = cpu_register_io_memory(0, ipf_legacy_io_read,
+    ipf_legacy_io_mem = cpu_register_io_memory(ipf_legacy_io_read,
                                                ipf_legacy_io_write, NULL);
     cpu_register_physical_memory(ipf_legacy_io_base, 64*1024*1024,
                                  ipf_legacy_io_mem);
@@ -551,20 +562,15 @@ static void ipf_init1(ram_addr_t ram_size,
 #ifdef USE_HYPERCALL
     pci_hypercall_init(pci_bus);
 #endif
-
     if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) {
         fprintf(stderr, "qemu: too many IDE bus\n");
         exit(1);
     }
 
     for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
-        index = drive_get_index(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
- if (index != -1)
-     hd[i] = drives_table[index].bdrv;
- else
-     hd[i] = NULL;
+        dinfo = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
+        hd[i] = dinfo ? dinfo->bdrv : NULL;
     }
-
     if (pci_enabled) {
         pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1, i8259);
     } else {
@@ -581,11 +587,8 @@ static void ipf_init1(ram_addr_t ram_size,
 #endif
 
     for(i = 0; i < MAX_FD; i++) {
-        index = drive_get_index(IF_FLOPPY, 0, i);
- if (index != -1)
-     fd[i] = drives_table[index].bdrv;
- else
-     fd[i] = NULL;
+        dinfo = drive_get(IF_FLOPPY, 0, i);
+        fd[i] = dinfo ? dinfo->bdrv : NULL;
     }
     floppy_controller = fdctrl_init(i8259[6], 2, 0, 0x3f0, fd);
 
@@ -604,8 +607,8 @@ static void ipf_init1(ram_addr_t ram_size,
         for (i = 0; i < 8; i++) {
             DeviceState *eeprom;
             eeprom = qdev_create((BusState *)smbus, "smbus-eeprom");
-            qdev_set_prop_int(eeprom, "address", 0x50 + i);
-            qdev_set_prop_ptr(eeprom, "data", eeprom_buf + (i * 256));
+            qdev_prop_set_uint32(eeprom, "address", 0x50 + i);
+            qdev_prop_set_ptr(eeprom, "data", eeprom_buf + (i * 256));
             qdev_init(eeprom);
         }
     }
@@ -623,17 +626,30 @@ static void ipf_init1(ram_addr_t ram_size,
             pci_create_simple(pci_bus, -1, "lsi53c895a");
         }
     }
+
+    switch (compat_level) {
+    case COMPAT_DEFAULT:
+    default:
+        virtio_blk_name = "virtio-blk-pci";
+        virtio_console_name = "virtio-console-pci";
+        break;
+
+    case COMPAT_0_10:
+        virtio_blk_name = "virtio-blk-pci-0-10";
+        virtio_console_name = "virtio-console-pci-0-10";
+        break;
+    }
+
     /* Add virtio block devices */
     if (pci_enabled) {
- int index;
- int unit_id = 0;
+        int unit_id = 0;
 
- while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
-            pci_dev = pci_create("virtio-blk-pci",
-                                 drives_table[index].devaddr);
+        while ((dinfo = drive_get(IF_VIRTIO, 0, unit_id)) != NULL) {
+            pci_dev = pci_create(virtio_blk_name,
+                                 dinfo->devaddr);
             qdev_init(&pci_dev->qdev);
-     unit_id++;
- }
+            unit_id++;
+        }
     }
 
 #ifdef USE_KVM_DEVICE_ASSIGNMENT
@@ -650,8 +666,9 @@ static void ipf_init_pci(ram_addr_t ram_size,
                          const char *initrd_filename,
                          const char *cpu_model)
 {
-    ipf_init1(ram_size, boot_device, ds, kernel_filename,
-              kernel_cmdline, initrd_filename, 1, cpu_model);
+    ipf_init1(ram_size, boot_device, kernel_filename,
+              kernel_cmdline, initrd_filename, cpu_model,
+              1, COMPAT_DEFAULT);
 }
 
 QEMUMachine ipf_machine = {
diff --git a/target-ia64/cpu.h b/target-ia64/cpu.h
index fb51463..168ff9b 100644
--- a/target-ia64/cpu.h
+++ b/target-ia64/cpu.h
@@ -71,8 +71,6 @@ static inline int cpu_mmu_index (CPUState *env)
  * These ones really should go to the appropriate tcg header file, if/when
  * tcg support is added for ia64.
  */
-void tcg_dump_info(FILE *f,
-                   int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
 
 static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
                                         target_ulong *cs_base, int *flags)
diff --git a/target-ia64/translate.c b/target-ia64/translate.c
index 86f48f5..28ef7f2 100644
--- a/target-ia64/translate.c
+++ b/target-ia64/translate.c
@@ -27,13 +27,16 @@ static uint16_t *gen_opc_ptr;
 #include "cpu.h"
 #include "exec-all.h"
 #include "disas.h"
-#include "gen-op.h"
 
-int gen_intermediate_code(CPUState *env, TranslationBlock *tb)
+void gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
 {
-    return 0;
 }
-int gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
+
+void gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
+{
+}
+
+void gen_pc_load(CPUState *env, TranslationBlock *tb,
+                unsigned long searched_pc, int pc_pos, void *puc)
 {
-    return 0;
 }
-- 
1.6.0
 

Attachment: 0001-qemu-kvm-ia64-build-fix.patch
Description: 0001-qemu-kvm-ia64-build-fix.patch


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux