diff --git a/src/emu/cpu.c b/src/emu/cpu.c index 9ba2d40..def6ad2 100644 --- a/src/emu/cpu.c +++ b/src/emu/cpu.c @@ -331,10 +331,7 @@ cpu_migrate_thread(struct cpu *cpu, struct thread *thread, struct cpu *newcpu) } struct chan * -cpu_get_th_chan(struct cpu *cpu, enum track_th trackmode) +cpu_get_th_chan(struct cpu *cpu) { - if (trackmode != TRACK_TH_RUN) - die("cpu tracking must be running"); - return &cpu->chan[CPU_CHAN_THRUN]; } diff --git a/src/emu/cpu.h b/src/emu/cpu.h index 7bf5aec..e7abb85 100644 --- a/src/emu/cpu.h +++ b/src/emu/cpu.h @@ -78,7 +78,7 @@ USE_RET int cpu_add_thread(struct cpu *cpu, struct thread *thread); USE_RET int cpu_remove_thread(struct cpu *cpu, struct thread *thread); USE_RET int cpu_migrate_thread(struct cpu *cpu, struct thread *thread, struct cpu *newcpu); -USE_RET struct chan *cpu_get_th_chan(struct cpu *cpu, enum track_th mode); +USE_RET struct chan *cpu_get_th_chan(struct cpu *cpu); USE_RET struct pcf_value *cpu_add_to_pcf_type(struct cpu *cpu, struct pcf_type *type); #endif /* CPU_H */ diff --git a/src/emu/model_cpu.c b/src/emu/model_cpu.c index 22a5d2d..cda75c4 100644 --- a/src/emu/model_cpu.c +++ b/src/emu/model_cpu.c @@ -87,7 +87,12 @@ connect_cpu(struct emu *emu, struct cpu *scpu, int id) /* Choose select CPU channel based on tracking mode (only * TRACK_TH_RUN allowed, as active may cause collisions) */ int mode = chan_spec->track[i]; - struct chan *sel = cpu_get_th_chan(scpu, mode); + if (mode != TRACK_TH_RUN) { + err("only TRACK_TH_RUN allowed"); + return -1; + } + + struct chan *sel = cpu_get_th_chan(scpu); int64_t nthreads = emu->system.nthreads; if (track_set_select(track, sel, NULL, nthreads) != 0) {