]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
pc: split out cpu initialization from pc_init1() into pc_cpus_init().
authorIsaku Yamahata <yamahata@valinux.co.jp>
Fri, 14 May 2010 07:29:10 +0000 (16:29 +0900)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 15 May 2010 15:45:17 +0000 (15:45 +0000)
split out cpu initialization which is piix independent from pc_init1()
into pc_cpus_init(). Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/pc.c

diff --git a/hw/pc.c b/hw/pc.c
index 18c025bbb8309d0b7632f896e181ac7abe073f25..9f720df2ba00b3458174e6642dc3d632e46635ea 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -811,6 +811,24 @@ static CPUState *pc_new_cpu(const char *cpu_model)
     return env;
 }
 
+static void pc_cpus_init(const char *cpu_model)
+{
+    int i;
+
+    /* init CPUs */
+    if (cpu_model == NULL) {
+#ifdef TARGET_X86_64
+        cpu_model = "qemu64";
+#else
+        cpu_model = "qemu32";
+#endif
+    }
+
+    for(i = 0; i < smp_cpus; i++) {
+        pc_new_cpu(cpu_model);
+    }
+}
+
 static qemu_irq *pc_allocate_cpu_irq(void)
 {
     return qemu_allocate_irqs(pic_irq_request, NULL, 1);
@@ -855,18 +873,7 @@ static void pc_init1(ram_addr_t ram_size,
 
     linux_boot = (kernel_filename != NULL);
 
-    /* init CPUs */
-    if (cpu_model == NULL) {
-#ifdef TARGET_X86_64
-        cpu_model = "qemu64";
-#else
-        cpu_model = "qemu32";
-#endif
-    }
-
-    for (i = 0; i < smp_cpus; i++) {
-        pc_new_cpu(cpu_model);
-    }
+    pc_cpus_init(cpu_model);
 
     vmport_init();