diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-09 22:12:27 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-07-09 22:12:27 +0300 |
| commit | e8a1df103cc28419dd7d4439c0b1d1739d110f78 (patch) | |
| tree | 2b4646f262a9008d80ca58fb2ecab2b5bf897873 /src/uapi/irq.c | |
| parent | 89d7cf197b2cae130565467bdfad5d5ef5fed2dd (diff) | |
| download | kmi-e8a1df103cc28419dd7d4439c0b1d1739d110f78.tar.gz kmi-e8a1df103cc28419dd7d4439c0b1d1739d110f78.zip | |
start working on tests
+ Current setup will likely not last long, just a stopgap until I figure
out how I want to build each testcase etc.
Probably dir based, but I'll probably add some scripts that generate
the build rules for each test case (or binary?). Also, should probably
put ouput files in a build directory and keep the source clean, but
again, good enough for now.
Will have to start implementing more extensive tests, and probably
come up with some way to compare textual output etc.
Diffstat (limited to 'src/uapi/irq.c')
| -rw-r--r-- | src/uapi/irq.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/uapi/irq.c b/src/uapi/irq.c index 9f3931c..69602af 100644 --- a/src/uapi/irq.c +++ b/src/uapi/irq.c @@ -28,16 +28,25 @@ SYSCALL_DEFINE1(irq_req)(struct tcb *t, sys_arg_t id) return_args1(t, register_irq(t, id)); } +SYSCALL_DEFINE1(free_irq)(struct tcb *t, sys_arg_t id) +{ + if (!has_cap(t->caps, CAP_IRQ)) + return_args1(t, ERR_PERM); + + return_args1(t, unregister_irq(t, id)); +} + /** * Actual notification handler setter. * * @param t Current tcb. - * @param tid Thread whose handler to set. + * @param tid Thread whose handler to set. Still not sure if this should just be + * the current thread, but I guess this might be a bit easier? * @param pid Process that is willing to handle notifications for the thread. * * @return OK on success, non-zero otherwise. */ -SYSCALL_DEFINE2(req_notification)(struct tcb *t, sys_arg_t tid, sys_arg_t pid) +SYSCALL_DEFINE2(set_handler)(struct tcb *t, sys_arg_t tid, sys_arg_t pid) { if (!has_cap(t->caps, CAP_SIGNAL)) return_args1(t, ERR_PERM); |
