diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-07-31 22:24:29 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-07-31 22:24:29 +0300 |
| commit | 6ad1b899ed93f8bc110cdec7a722c8740f9f8d66 (patch) | |
| tree | 99fe36028ffc4583c59e77d03bea2ade7a6c5ace /common/uapi/irq.c | |
| parent | 3212707a9ab549119ad0ad6441a07fe774c99f3b (diff) | |
| download | kmi-6ad1b899ed93f8bc110cdec7a722c8740f9f8d66.tar.gz kmi-6ad1b899ed93f8bc110cdec7a722c8740f9f8d66.zip | |
start working on irqs
Diffstat (limited to 'common/uapi/irq.c')
| -rw-r--r-- | common/uapi/irq.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/common/uapi/irq.c b/common/uapi/irq.c new file mode 100644 index 0000000..3aa040e --- /dev/null +++ b/common/uapi/irq.c @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: copyleft-next-0.3.1 */ + +/** + * @file irq.c + * IRQ request syscall handling implementation. + */ + +#include <kmi/uapi.h> +#include <kmi/irq.h> + +/** + * 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. + */ +SYSCALL_DEFINE1(irq_req)(struct tcb *t, sys_arg_t id) +{ + if (!has_cap(t->caps, CAP_IRQ)) + return_args1(t, ERR_PERM); + + if (!t->callback) + return_args1(t, ERR_NF); + + return_args1(t, register_irq(t, id)); +} |
