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 --- include/apos/ipi.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 include/apos/ipi.h (limited to 'include/apos/ipi.h') diff --git a/include/apos/ipi.h b/include/apos/ipi.h new file mode 100644 index 0000000..c895d58 --- /dev/null +++ b/include/apos/ipi.h @@ -0,0 +1,37 @@ +#ifndef APOS_IPI_H +#define APOS_IPI_H + +/** + * @file ipi.h + * + * IPI function definitions. + */ + +#include +#include +#include + +/** + * Clear potential IPI in \p t, and return its value. + * + * @param t \ref tcb to clear possible IPI status of. + * @return \ref true if \p was interrupted by IPI, \ref false otherwise. + */ +bool clear_ipi(struct tcb *t); + +/** + * Send IPI to \p t. Assumes \c running(t). + * + * @param t \ref tcb to send IPI to. + */ +void send_ipi(struct tcb *t); + +/** + * Handle IPI. + * + * @param t Thread who was interrupted by IPI. + * @return Possible arguments to IPI. + */ +struct sys_ret handle_ipi(struct tcb *t); + +#endif /* APOS_IPI_H */ -- cgit v1.3