From 98db4a2fe093148201272c36f14efbc6596dc71f Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 19 Oct 2021 10:16:18 +0200 Subject: [PATCH] Remove virtual events --- emu.c | 47 ----------------------------------------------- emu.h | 12 ------------ 2 files changed, 59 deletions(-) diff --git a/emu.c b/emu.c index 3c95e66..9ffeb39 100644 --- a/emu.c +++ b/emu.c @@ -917,51 +917,6 @@ write_row_thread(struct ovni_emu *emu) fclose(f); } -static void -emu_virtual_init(struct ovni_emu *emu) -{ - struct ovni_trace *trace; - - trace = &emu->trace; - - trace->ivirtual = 0; - trace->nvirtual = 0; - - trace->virtual_events = calloc(MAX_VIRTUAL_EVENTS, - sizeof(struct ovni_ev)); - - if(trace->virtual_events == NULL) - { - perror("calloc"); - exit(EXIT_FAILURE); - } -} - -void -emu_virtual_ev(struct ovni_emu *emu, char *mcv) -{ - struct ovni_trace *trace; - struct ovni_ev *ev; - - trace = &emu->trace; - - if(trace->nvirtual >= MAX_VIRTUAL_EVENTS) - { - err("too many virtual events\n"); - exit(EXIT_FAILURE); - } - - ev = &trace->virtual_events[trace->nvirtual]; - - ev->header.flags = 0; - ev->header.model = mcv[0]; - ev->header.category = mcv[1]; - ev->header.value = mcv[2]; - ev->header.clock = emu->cur_ev->header.clock; - - trace->nvirtual++; -} - static void init_threads(struct ovni_emu *emu) { @@ -1073,8 +1028,6 @@ emu_init(struct ovni_emu *emu, int argc, char *argv[]) exit(EXIT_FAILURE); } - emu_virtual_init(emu); - if(ovni_load_streams(&emu->trace)) { err("error loading streams\n"); diff --git a/emu.h b/emu.h index 0c10c54..41f6b1b 100644 --- a/emu.h +++ b/emu.h @@ -353,15 +353,6 @@ struct ovni_trace { size_t nlooms; struct ovni_loom loom[OVNI_MAX_LOOM]; - /* Index of next virtual event */ - size_t ivirtual; - - /* Number of virtual events stored */ - size_t nvirtual; - - /* The virtual events are generated by the emulator */ - struct ovni_ev *virtual_events; - size_t nstreams; struct ovni_stream *stream; }; @@ -455,7 +446,4 @@ struct ovni_ethread *emu_get_thread(struct ovni_eproc *proc, int tid); void emu_cpu_update_chan(struct ovni_cpu *cpu, struct ovni_chan *cpu_chan); -void -emu_virtual_ev(struct ovni_emu *emu, char *mcv); - #endif /* OVNI_EMU_H */