From a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 9 Nov 2022 16:27:23 +0200 Subject: add basic IPI structure --- common/ipi.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 common/ipi.c (limited to 'common/ipi.c') diff --git a/common/ipi.c b/common/ipi.c new file mode 100644 index 0000000..32f1432 --- /dev/null +++ b/common/ipi.c @@ -0,0 +1,32 @@ +#include +#include + +#include + +/** + * @file ipi.c + * + * IPI function implementations. + */ + +bool clear_ipi(struct tcb *t) +{ + bool r = t->ipi; + t->ipi = false; + return r; +} + +void send_ipi(struct tcb *t) +{ + t->ipi = true; + cpu_send_ipi(t->cpu_id); +} + +struct sys_ret handle_ipi(struct tcb *t) +{ + adjust_ipi(t); + + /** @todo use rpc stack */ + set_return(t, t->callback); + return get_args(t); +} -- cgit v1.3