From 7ad9c01dad7b1b46eced8290b8b991383d648188 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 1 Jul 2024 23:34:57 +0300 Subject: expand notifications into interrupt handlers + Terminology is still a bit poor, and will still have to write documentation + implement ipis properly --- src/uapi/irq.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/uapi/irq.c') diff --git a/src/uapi/irq.c b/src/uapi/irq.c index 6687826..9bd8ec1 100644 --- a/src/uapi/irq.c +++ b/src/uapi/irq.c @@ -13,7 +13,6 @@ * Actual IRQ handling request syscall handler. * * @param t Current tcb. - * @param id IRQ id to request to handle. * * @return OK on success, non-zero otherwise. */ @@ -27,3 +26,16 @@ SYSCALL_DEFINE1(irq_req)(struct tcb *t, sys_arg_t id) return_args1(t, register_irq(t, id)); } + +SYSCALL_DEFINE2(req_notification)(struct tcb *t, sys_arg_t tid, sys_arg_t pid) +{ + if (!has_cap(t->caps, CAP_NOTIFICATION)) + return_args1(t, ERR_PERM); + + struct tcb *r = get_tcb(tid); + if (!r) + return_args1(t, ERR_INVAL); + + t->notify_id = pid; + return_args1(t, OK); +} -- cgit v1.3