summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-06-17 15:49:37 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-06-17 15:49:37 +0000
commit13f4502ba326ef9a5298fea607a1270b786bded6 (patch)
tree33b1501393a224a3dac518a59dba343ef08d55be
parentc38168b9e48518f8546543cf297638fb57f0b910 (diff)
downloadqemu-13f4502ba326ef9a5298fea607a1270b786bded6.tar.gz
qemu-13f4502ba326ef9a5298fea607a1270b786bded6.tar.bz2
qemu-13f4502ba326ef9a5298fea607a1270b786bded6.zip
Allow user to specify CPU model
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--hw/ppc440.c13
-rw-r--r--hw/ppc440.h3
-rw-r--r--hw/ppc440_bamboo.c2
3 files changed, 8 insertions, 10 deletions
diff --git a/hw/ppc440.c b/hw/ppc440.c
index 00d82e4bed..5171988b63 100644
--- a/hw/ppc440.c
+++ b/hw/ppc440.c
@@ -34,7 +34,8 @@ static const unsigned int ppc440ep_sdram_bank_sizes[] = {
};
CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip,
- const unsigned int pci_irq_nrs[4], int do_init)
+ const unsigned int pci_irq_nrs[4], int do_init,
+ const char *cpu_model)
{
target_phys_addr_t ram_bases[PPC440EP_SDRAM_NR_BANKS];
target_phys_addr_t ram_sizes[PPC440EP_SDRAM_NR_BANKS];
@@ -44,13 +45,9 @@ CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip,
qemu_irq *irqs;
qemu_irq *pci_irqs;
- env = cpu_ppc_init("440EP");
- if (!env && kvm_enabled()) {
- /* XXX Since qemu doesn't yet emulate 440, we just say it's a 405.
- * Since KVM doesn't use qemu's CPU emulation it seems to be working
- * OK. */
- env = cpu_ppc_init("405");
- }
+ if (cpu_model == NULL)
+ cpu_model = "405"; // XXX: should be 440EP
+ env = cpu_init(cpu_model);
if (!env) {
fprintf(stderr, "Unable to initialize CPU!\n");
exit(1);
diff --git a/hw/ppc440.h b/hw/ppc440.h
index b6843eb858..a40f9176db 100644
--- a/hw/ppc440.h
+++ b/hw/ppc440.h
@@ -15,6 +15,7 @@
#include "hw.h"
CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip,
- const unsigned int pci_irq_nrs[4], int do_init);
+ const unsigned int pci_irq_nrs[4], int do_init,
+ const char *cpu_model);
#endif
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
index 00aa2c72a2..9882ea5230 100644
--- a/hw/ppc440_bamboo.c
+++ b/hw/ppc440_bamboo.c
@@ -103,7 +103,7 @@ static void bamboo_init(ram_addr_t ram_size,
int i;
/* Setup CPU. */
- env = ppc440ep_init(&ram_size, &pcibus, pci_irq_nrs, 1);
+ env = ppc440ep_init(&ram_size, &pcibus, pci_irq_nrs, 1, cpu_model);
if (pcibus) {
int unit_id = 0;