From 1fe8249bbc782d28185e0e893504e8ac3a1fcaec Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Mon, 23 Jan 2023 22:24:55 +0100 Subject: Move kvm to guest process and add ipc for synchronization --- test/util.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/util.h') diff --git a/test/util.h b/test/util.h index dbeb4a8..8ad09b8 100644 --- a/test/util.h +++ b/test/util.h @@ -7,6 +7,15 @@ #define ARRLEN(x) (sizeof(x) / sizeof((x)[0])) #define MIN(a,b) ((a) > (b) ? (b) : (a)) +struct ipc { + pthread_mutex_t lock; + pthread_cond_t sig_parent; + bool has_sig_parent; + pthread_cond_t sig_child; + bool has_sig_child; + bool init; +}; + void hexdump(void *data, int len); bool pin_process(pid_t pid, int cpu, bool assert); @@ -15,3 +24,10 @@ int read_stat_core(pid_t pid); void print_counts(uint8_t *counts); void print_counts_raw(uint8_t *counts); + +struct ipc *ipc_alloc(void); +void ipc_free(struct ipc *ipc); +void ipc_signal_child(struct ipc *ipc); +void ipc_wait_child(struct ipc *ipc); +void ipc_signal_parent(struct ipc *ipc); +void ipc_wait_parent(struct ipc *ipc); -- cgit v1.2.3-71-gd317