From b9f9ae1a597c36178e852ec9414ebf20e79090e9 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 14 Oct 2021 09:08:07 +0200 Subject: [PATCH] Set the loom in the CPU --- emu.c | 2 ++ emu.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/emu.c b/emu.c index 09a8843..6908812 100644 --- a/emu.c +++ b/emu.c @@ -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); } diff --git a/emu.h b/emu.h index 654951b..a17e100 100644 --- a/emu.h +++ b/emu.h @@ -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];