--- trunk/src/cpu.c 2007/10/08 16:20:18 27 +++ trunk/src/cpu.c 2007/10/08 16:20:26 28 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: cpu.c,v 1.344 2006/06/24 21:47:22 debug Exp $ + * $Id: cpu.c,v 1.348 2006/07/20 21:52:59 debug Exp $ * * Common routines for CPU emulation. (Not specific to any CPU type.) */ @@ -42,8 +42,6 @@ #include "misc.h" -extern int quiet_mode; - static struct cpu_family *first_cpu_family = NULL; @@ -389,9 +387,11 @@ int te; /* - * Two last ticks of every hardware device. This will allow - * framebuffers to draw the last updates to the screen before - * halting. + * Two last ticks of every hardware device. This will allow e.g. + * framebuffers to draw the last updates to the screen before halting. + * + * TODO: This should be refactored when redesigning the mainbus + * concepts! */ for (te=0; ten_tick_entries; te++) { machine->tick_func[te](machine->cpus[0], @@ -400,9 +400,7 @@ machine->tick_extra[te]); } - debug("cpu_run_deinit(): All CPUs halted.\n"); - - if (machine->show_nr_of_instructions || !quiet_mode) + if (machine->show_nr_of_instructions) cpu_show_cycles(machine, 1); fflush(stdout); @@ -440,7 +438,7 @@ if (mseconds - mseconds_last == 0) mseconds ++; - ninstrs = machine->ncycles_since_gettimeofday; + ninstrs = machine->ninstrs_since_gettimeofday; if (machine->automatic_clock_adjustment) { static int first_adjustment = 1; @@ -472,13 +470,13 @@ if (!machine->show_nr_of_instructions && !forced) goto do_return; - printf("[ %"PRIi64" instrs", (int64_t)machine->ncycles); + printf("[ %"PRIi64" instrs", (int64_t)machine->ninstrs); if (!machine->automatic_clock_adjustment) { d = machine->emulated_hz / 1000; if (d < 1) d = 1; - ms = machine->ncycles / d; + ms = machine->ninstrs / d; h = ms / 3600000; ms -= 3600000 * h; m = ms / 60000; @@ -525,38 +523,13 @@ */ void cpu_run_init(struct machine *machine) { - int ncpus = machine->ncpus; - int te; - - machine->a_few_cycles = 1048576; - machine->ncycles_flush = 0; - machine->ncycles = 0; - machine->ncycles_show = 0; - - /* - * Instead of doing { one cycle, check hardware ticks }, we - * can do { n cycles, check hardware ticks }, as long as - * n is at most as much as the lowest number of cycles/tick - * for any hardware device. - */ - for (te=0; ten_tick_entries; te++) { - if (machine->ticks_reset_value[te] < machine->a_few_cycles) - machine->a_few_cycles = machine->ticks_reset_value[te]; - } - - machine->a_few_cycles >>= 1; - if (machine->a_few_cycles < 1) - machine->a_few_cycles = 1; - - if (ncpus > 1) - machine->a_few_cycles = 1; - - /* debug("cpu_run_init(): a_few_cycles = %i\n", - machine->a_few_cycles); */ + machine->ninstrs_flush = 0; + machine->ninstrs = 0; + machine->ninstrs_show = 0; /* For performance measurement: */ gettimeofday(&machine->starttime, NULL); - machine->ncycles_since_gettimeofday = 0; + machine->ninstrs_since_gettimeofday = 0; } @@ -678,6 +651,10 @@ add_cpu_family(sparc_cpu_family_init, ARCH_SPARC); #endif +#ifdef ENABLE_TRANSPUTER + add_cpu_family(transputer_cpu_family_init, ARCH_TRANSPUTER); +#endif + #ifdef ENABLE_X86 add_cpu_family(x86_cpu_family_init, ARCH_X86); #endif