Revision aaed909a hw/ppc_oldworld.c
b/hw/ppc_oldworld.c | ||
---|---|---|
100 | 100 |
const char *initrd_filename, |
101 | 101 |
const char *cpu_model) |
102 | 102 |
{ |
103 |
CPUState *env, *envs[MAX_CPUS]; |
|
103 |
CPUState *env = NULL, *envs[MAX_CPUS];
|
|
104 | 104 |
char buf[1024]; |
105 | 105 |
qemu_irq *pic, **heathrow_irqs; |
106 | 106 |
nvram_t nvram; |
... | ... | |
108 | 108 |
int linux_boot, i; |
109 | 109 |
unsigned long bios_offset, vga_bios_offset; |
110 | 110 |
uint32_t kernel_base, kernel_size, initrd_base, initrd_size; |
111 |
ppc_def_t *def; |
|
112 | 111 |
PCIBus *pci_bus; |
113 | 112 |
MacIONVRAMState *nvr; |
114 | 113 |
int vga_bios_size, bios_size; |
... | ... | |
119 | 118 |
linux_boot = (kernel_filename != NULL); |
120 | 119 |
|
121 | 120 |
/* init CPUs */ |
122 |
env = cpu_init(); |
|
123 | 121 |
if (cpu_model == NULL) |
124 | 122 |
cpu_model = "default"; |
125 |
ppc_find_by_name(cpu_model, &def); |
|
126 |
if (def == NULL) { |
|
127 |
cpu_abort(env, "Unable to find PowerPC CPU definition\n"); |
|
128 |
} |
|
129 | 123 |
for (i = 0; i < smp_cpus; i++) { |
130 |
cpu_ppc_register(env, def); |
|
131 |
cpu_ppc_reset(env); |
|
124 |
env = cpu_init(cpu_model); |
|
125 |
if (!env) { |
|
126 |
fprintf(stderr, "Unable to find PowerPC CPU definition\n"); |
|
127 |
exit(1); |
|
128 |
} |
|
132 | 129 |
/* Set time-base frequency to 100 Mhz */ |
133 | 130 |
cpu_ppc_tb_init(env, 100UL * 1000UL * 1000UL); |
134 | 131 |
env->osi_call = vga_osi_call; |
Also available in: Unified diff