summaryrefslogtreecommitdiff
path: root/hw/ppc_prep.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-03 01:06:57 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-03 01:06:57 +0000
commitfe33cc710327455a55bd4f44bc7aa69661cc7878 (patch)
tree5161385f847ff660c479eac5dfbbce8e6a6d0eca /hw/ppc_prep.c
parent00af685fc974e4941ef2d309a2e8818d311a370c (diff)
downloadqemu-fe33cc710327455a55bd4f44bc7aa69661cc7878.tar.gz
Fix PowerPC initialisation and first reset:
reset must occur after we defined the CPU features. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3317 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppc_prep.c')
-rw-r--r--hw/ppc_prep.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 504ca33a9c..9e2a4403a5 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -26,6 +26,9 @@
//#define HARD_DEBUG_PPC_IO
//#define DEBUG_PPC_IO
+/* SMP is not enabled, for now */
+#define MAX_CPUS 1
+
#define BIOS_FILENAME "ppc_rom.bin"
#define KERNEL_LOAD_ADDR 0x01000000
#define INITRD_LOAD_ADDR 0x01800000
@@ -521,7 +524,7 @@ static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device,
const char *initrd_filename,
const char *cpu_model)
{
- CPUState *env;
+ CPUState *env, *envs[MAX_CPUS];
char buf[1024];
m48t59_t *nvram;
int PPC_io_memory;
@@ -539,20 +542,22 @@ static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device,
linux_boot = (kernel_filename != NULL);
/* init CPUs */
-
env = cpu_init();
- qemu_register_reset(&cpu_ppc_reset, env);
- register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
-
if (cpu_model == NULL)
cpu_model = "default";
ppc_find_by_name(cpu_model, &def);
if (def == NULL) {
cpu_abort(env, "Unable to find PowerPC CPU definition\n");
}
- cpu_ppc_register(env, def);
- /* Set time-base frequency to 100 Mhz */
- cpu_ppc_tb_init(env, 100UL * 1000UL * 1000UL);
+ for (i = 0; i < smp_cpus; i++) {
+ cpu_ppc_register(env, def);
+ cpu_ppc_reset(env);
+ /* Set time-base frequency to 100 Mhz */
+ cpu_ppc_tb_init(env, 100UL * 1000UL * 1000UL);
+ qemu_register_reset(&cpu_ppc_reset, env);
+ register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
+ envs[i] = env;
+ }
/* allocate RAM */
cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);