From 6be4e656cbf575dbcba95de4e99183586aa88ffe Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 22 Oct 2022 18:39:57 +0300 Subject: create impl and CAP_PROC checking --- include/apos/caps.h | 3 --- include/apos/tcb.h | 9 ++++++++- include/apos/uapi.h | 22 ++++++++++++++++++---- 3 files changed, 26 insertions(+), 8 deletions(-) (limited to 'include/apos') diff --git a/include/apos/caps.h b/include/apos/caps.h index b64b05a..e8ef76b 100644 --- a/include/apos/caps.h +++ b/include/apos/caps.h @@ -22,9 +22,6 @@ enum { /** Thread is allowed to force interrupt to callback in other thread. */ CAP_CALL = (1 << 2), - - /** Thread is allowed to assign threads to processors. */ - CAP_ASSIGN = (1 << 3), }; /** diff --git a/include/apos/tcb.h b/include/apos/tcb.h index a31e308..b92cd10 100644 --- a/include/apos/tcb.h +++ b/include/apos/tcb.h @@ -268,10 +268,17 @@ struct tcb *cur_tcb(); /** * Get currently executing process. * - * @return Current process \ref tcb. + * @return Effective process \ref tcb. */ struct tcb *cur_proc(); +/** + * Get currently executing process. + * + * @return Effective process \ref tcb. + */ +struct tcb *eff_proc(); + /** * Set \c t as current \ref tcb. * diff --git a/include/apos/uapi.h b/include/apos/uapi.h index 7d612b6..084c1fa 100644 --- a/include/apos/uapi.h +++ b/include/apos/uapi.h @@ -51,12 +51,25 @@ struct sys_ret { sys_arg_t ar4; }; +/** Helper for returning sys_ret with 0 arguments. */ #define SYS_RET0() (struct sys_ret){0, 0, 0, 0, 0, 0} + +/** Helper for returning sys_ret with 1 arguments. */ #define SYS_RET1(a) (struct sys_ret){a, 0, 0, 0, 0, 0} + +/** Helper for returning sys_ret with 2 arguments. */ #define SYS_RET2(a, b) (struct sys_ret){a, b, 0, 0, 0, 0} + +/** Helper for returning sys_ret with 3 arguments. */ #define SYS_RET3(a, b, c) (struct sys_ret){a, b, c, 0, 0, 0} + +/** Helper for returning sys_ret with 4 arguments. */ #define SYS_RET4(a, b, c, d) (struct sys_ret){a, b, c, d, 0, 0} + +/** Helper for returning sys_ret with 5 arguments. */ #define SYS_RET5(a, b, c, d, e) (struct sys_ret){a, b, c, d, e, 0} + +/** Helper for returning sys_ret with 6 arguments. */ #define SYS_RET6(a, b, c, d, e, f) (struct sys_ret){a, b, c, d, e, f} /** @@ -504,10 +517,11 @@ SYSCALL_DECLARE2(ipc_notify, tid, swap); * Creates thread in current effective process context. * * @param func Function to call on startup. - * @param arg Argument to pass to function. - * @param c Unused. - * @param d Unused. - * @param e Unused. + * @param d0 Argument 0. + * @param d1 Argument 1. + * @param d2 Argument 2. + * @param d3 Argument 3. + * * @return \ref OK and 0. * \todo Should this take stack size etc? */ -- cgit v1.3