sh4: shix: use generic cpu_model parsing
default cpu model 'any' resolves to type TYPE_SH7750R_CPU in superh_cpu_class_by_name(), so use it directly. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <1507211474-188400-21-git-send-email-imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
		
							parent
							
								
									78f60b829a
								
							
						
					
					
						commit
						b0224788e7
					
				| 
						 | 
					@ -45,7 +45,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void shix_init(MachineState *machine)
 | 
					static void shix_init(MachineState *machine)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const char *cpu_model = machine->cpu_model;
 | 
					 | 
				
			||||||
    int ret;
 | 
					    int ret;
 | 
				
			||||||
    SuperHCPU *cpu;
 | 
					    SuperHCPU *cpu;
 | 
				
			||||||
    struct SH7750State *s;
 | 
					    struct SH7750State *s;
 | 
				
			||||||
| 
						 | 
					@ -53,10 +52,7 @@ static void shix_init(MachineState *machine)
 | 
				
			||||||
    MemoryRegion *rom = g_new(MemoryRegion, 1);
 | 
					    MemoryRegion *rom = g_new(MemoryRegion, 1);
 | 
				
			||||||
    MemoryRegion *sdram = g_new(MemoryRegion, 2);
 | 
					    MemoryRegion *sdram = g_new(MemoryRegion, 2);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!cpu_model)
 | 
					    cpu = SUPERH_CPU(cpu_create(machine->cpu_type));
 | 
				
			||||||
        cpu_model = "any";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    cpu = SUPERH_CPU(cpu_generic_init(TYPE_SUPERH_CPU, cpu_model));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Allocate memory space */
 | 
					    /* Allocate memory space */
 | 
				
			||||||
    memory_region_init_ram(rom, NULL, "shix.rom", 0x4000, &error_fatal);
 | 
					    memory_region_init_ram(rom, NULL, "shix.rom", 0x4000, &error_fatal);
 | 
				
			||||||
| 
						 | 
					@ -89,6 +85,7 @@ static void shix_machine_init(MachineClass *mc)
 | 
				
			||||||
    mc->desc = "shix card";
 | 
					    mc->desc = "shix card";
 | 
				
			||||||
    mc->init = shix_init;
 | 
					    mc->init = shix_init;
 | 
				
			||||||
    mc->is_default = 1;
 | 
					    mc->is_default = 1;
 | 
				
			||||||
 | 
					    mc->default_cpu_type = TYPE_SH7750R_CPU;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DEFINE_MACHINE("shix", shix_machine_init)
 | 
					DEFINE_MACHINE("shix", shix_machine_init)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue