mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
added -cpu option for x86 (initial patch by Dan Kenigsberg)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3547 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
5fa0ab8fcb
commit
a049de6161
3 changed files with 323 additions and 65 deletions
18
hw/pc.c
18
hw/pc.c
|
@ -676,7 +676,7 @@ static void pc_init1(int ram_size, int vga_ram_size, const char *boot_device,
|
|||
DisplayState *ds, const char **fd_filename, int snapshot,
|
||||
const char *kernel_filename, const char *kernel_cmdline,
|
||||
const char *initrd_filename,
|
||||
int pci_enabled)
|
||||
int pci_enabled, const char *cpu_model)
|
||||
{
|
||||
char buf[1024];
|
||||
int ret, linux_boot, i;
|
||||
|
@ -692,6 +692,18 @@ static void pc_init1(int ram_size, int vga_ram_size, const char *boot_device,
|
|||
linux_boot = (kernel_filename != NULL);
|
||||
|
||||
/* init CPUs */
|
||||
if (cpu_model == NULL) {
|
||||
#ifdef TARGET_X86_64
|
||||
cpu_model = "qemu64";
|
||||
#else
|
||||
cpu_model = "qemu32";
|
||||
#endif
|
||||
}
|
||||
|
||||
if (x86_find_cpu_by_name(cpu_model)) {
|
||||
fprintf(stderr, "Unable to find x86 CPU definition\n");
|
||||
exit(1);
|
||||
}
|
||||
for(i = 0; i < smp_cpus; i++) {
|
||||
env = cpu_init();
|
||||
if (i != 0)
|
||||
|
@ -960,7 +972,7 @@ static void pc_init_pci(int ram_size, int vga_ram_size, const char *boot_device,
|
|||
pc_init1(ram_size, vga_ram_size, boot_device,
|
||||
ds, fd_filename, snapshot,
|
||||
kernel_filename, kernel_cmdline,
|
||||
initrd_filename, 1);
|
||||
initrd_filename, 1, cpu_model);
|
||||
}
|
||||
|
||||
static void pc_init_isa(int ram_size, int vga_ram_size, const char *boot_device,
|
||||
|
@ -974,7 +986,7 @@ static void pc_init_isa(int ram_size, int vga_ram_size, const char *boot_device,
|
|||
pc_init1(ram_size, vga_ram_size, boot_device,
|
||||
ds, fd_filename, snapshot,
|
||||
kernel_filename, kernel_cmdline,
|
||||
initrd_filename, 0);
|
||||
initrd_filename, 0, cpu_model);
|
||||
}
|
||||
|
||||
QEMUMachine pc_machine = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue