aboutsummaryrefslogtreecommitdiff
path: root/common/ipi.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/ipi.c')
-rw-r--r--common/ipi.c32
1 files changed, 32 insertions, 0 deletions
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 <apos/ipi.h>
+#include <arch/cpu.h>
+
+#include <arch/proc.h>
+
+/**
+ * @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);
+}