aboutsummaryrefslogtreecommitdiff
path: root/src/uapi/irq.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-01 23:34:57 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-01 23:34:57 +0300
commit7ad9c01dad7b1b46eced8290b8b991383d648188 (patch)
treecd528648af552974b90117efef431659ef5f0cc6 /src/uapi/irq.c
parent9ff67d879b4695e0c9910b7276f3959c005c7b19 (diff)
downloadkmi-7ad9c01dad7b1b46eced8290b8b991383d648188.tar.gz
kmi-7ad9c01dad7b1b46eced8290b8b991383d648188.zip
expand notifications into interrupt handlers
+ Terminology is still a bit poor, and will still have to write documentation + implement ipis properly
Diffstat (limited to 'src/uapi/irq.c')
-rw-r--r--src/uapi/irq.c14
1 files changed, 13 insertions, 1 deletions
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);
+}