Set the loom in the CPU

This commit is contained in:
Rodrigo Arias 2021-10-14 09:08:07 +02:00
parent 151f5a2b77
commit b9f9ae1a59
2 changed files with 5 additions and 0 deletions

2
emu.c
View File

@ -369,6 +369,7 @@ add_new_cpu(struct ovni_emu *emu, struct ovni_loom *loom, int i, int phyid)
cpu->i = i;
cpu->phyid = phyid;
cpu->gindex = emu->total_ncpus++;
cpu->loom = loom;
dbg("new cpu %d at phyid=%d\n", cpu->gindex, phyid);
@ -414,6 +415,7 @@ proc_load_cpus(struct ovni_emu *emu, struct ovni_loom *loom, struct ovni_eproc *
vcpu->i = -1;
vcpu->phyid = -1;
vcpu->gindex = emu->total_ncpus++;
vcpu->loom = loom;
dbg("new vcpu %d\n", vcpu->gindex);
}

3
emu.h
View File

@ -283,6 +283,9 @@ struct ovni_cpu {
enum ovni_cpu_state state;
/* The loom of the CPU */
struct ovni_loom *loom;
/* CPU channels */
struct ovni_chan chan[CHAN_MAX];