aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/uapi/ipc.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/common/uapi/ipc.c b/common/uapi/ipc.c
index 141b494..826fd57 100644
--- a/common/uapi/ipc.c
+++ b/common/uapi/ipc.c
@@ -95,5 +95,24 @@ SYSCALL_DEFINE2(ipc_notify)(sys_arg_t tid, sys_arg_t swap){
* Arguably slower than directly telling the client which operation was
* finished, but this would require the kernel to keep track of a notify
* stack. While not impossible, probably too complex. */
- return (struct sys_ret){ OK, 0, 0 /* type */, 0 /* from */, 0, 0 };
+
+ /* Something like
+ *
+ * struct tcb *t = get_tcb(tid);
+ * if (t->notify_state == NOTIFY_QUEUED)
+ * return;
+ *
+ * if (t->notify_state == NOTIFY_RUNNING) {
+ * t->notify = NOTIFY_QUEUED;
+ * return;
+ * }
+ *
+ * t->notify_state = NOTIFY_QUEUED;
+ * if (swap)
+ * do_swap(); // clears t->notify when swapped to
+ * // if already running in base state, interrupt,
+ * otherwise wait for return from rpc. If not running,
+ * just queue the interrupt.
+ */
+ return (struct sys_ret){ OK, 0, 0 /* type */, 0, 0, 0 };
}