aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc_prep.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-05 19:44:02 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-05 19:44:02 +0000
commit94fc95cdb2e91826bd6a4c98cea4f4d9fa0fffb1 (patch)
treec423a9cdeacbc5258ff8bb81764728d73fc0afc8 /hw/ppc_prep.c
parent7a2d6d9650ed16b2cdb0b4876fe9efce7ef8ea6d (diff)
downloadqemu-94fc95cdb2e91826bd6a4c98cea4f4d9fa0fffb1.zip
qemu-94fc95cdb2e91826bd6a4c98cea4f4d9fa0fffb1.tar.gz
qemu-94fc95cdb2e91826bd6a4c98cea4f4d9fa0fffb1.tar.bz2
New -cpu options: choose CPU model for emulated target.
Only relevant on PowerPC targets, for now. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2468 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppc_prep.c')
-rw-r--r--hw/ppc_prep.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index c4b7ff5..27d3d48 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -518,10 +518,12 @@ CPUReadMemoryFunc *PPC_prep_io_read[] = {
#define NVRAM_SIZE 0x2000
/* PowerPC PREP hardware initialisation */
-static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
- DisplayState *ds, const char **fd_filename, int snapshot,
- const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename)
+static void ppc_prep_init (int ram_size, int vga_ram_size, int boot_device,
+ DisplayState *ds, const char **fd_filename,
+ int snapshot, const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model)
{
CPUState *env;
char buf[1024];
@@ -543,12 +545,11 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
env = cpu_init();
register_savevm("cpu", 0, 3, cpu_save, cpu_load, env);
-
- /* Register CPU as a 604 */
- /* XXX: CPU model (or PVR) should be provided on command line */
- // ppc_find_by_name("604r", &def);
- // ppc_find_by_name("604e", &def);
- ppc_find_by_name("604", &def);
+
+ /* Default CPU is a 604 */
+ if (cpu_model == NULL)
+ cpu_model = "604";
+ ppc_find_by_name(cpu_model, &def);
if (def == NULL) {
cpu_abort(env, "Unable to find PowerPC CPU definition\n");
}