--- qemu-0.6.2cvs20050425.orig/vl.c 2005-04-08 00:20:28.000000000 +0200 +++ qemu-0.6.2cvs20050425/vl.c 2005-04-25 11:44:41.119819832 +0200 @@ -135,6 +135,10 @@ int prep_enabled = 0; int rtc_utc = 1; int cirrus_vga_enabled = 1; +#ifdef __i386__ +static int notsc = 0; +extern int64_t get_clock(void); +#endif #ifdef TARGET_SPARC int graphic_width = 1024; int graphic_height = 768; @@ -502,6 +506,9 @@ int64_t cpu_get_real_ticks(void) { int64_t val; + if (notsc) { + return get_clock(); + } asm volatile ("rdtsc" : "=A" (val)); return val; } @@ -2792,6 +2799,9 @@ #ifdef USE_CODE_COPY "-no-code-copy disable code copy acceleration\n" #endif +#ifdef __i386__ + "-no-tsc disable tsc as clock source\n" +#endif #ifdef TARGET_I386 "-isa simulate an ISA-only system (default is PCI system)\n" "-std-vga simulate a standard VGA card with VESA Bochs Extensions\n" @@ -2863,6 +2873,7 @@ QEMU_OPTION_hdachs, QEMU_OPTION_L, QEMU_OPTION_no_code_copy, + QEMU_OPTION_no_tsc, QEMU_OPTION_pci, QEMU_OPTION_isa, QEMU_OPTION_prep, @@ -2931,6 +2942,9 @@ #ifdef USE_KQEMU { "no-kqemu", 0, QEMU_OPTION_no_kqemu }, #endif +#ifdef __i386__ + { "no-tsc", 0, QEMU_OPTION_no_tsc }, +#endif #ifdef TARGET_PPC { "prep", 0, QEMU_OPTION_prep }, #endif @@ -3216,6 +3230,11 @@ case QEMU_OPTION_no_code_copy: code_copy_enabled = 0; break; +#ifdef __i386__ + case QEMU_OPTION_no_tsc: + notsc = 1; + break; +#endif case QEMU_OPTION_nics: nb_nics = atoi(optarg); if (nb_nics < 0 || nb_nics > MAX_NICS) {