Remove track mode argument from cpu_get_th_chan()

This commit is contained in:
Rodrigo Arias 2023-03-21 11:08:41 +01:00 committed by Rodrigo Arias Mallo
parent 9a4a4a0005
commit ad88e25278
3 changed files with 8 additions and 6 deletions

View File

@ -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];
}

View File

@ -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 */

View File

@ -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) {