Changes in uspace/lib/c/generic/cap.c [63f8966:6b10dab] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/cap.c
r63f8966 r6b10dab 31 31 */ 32 32 /** 33 * @file 34 * @brief 33 * @file cap.c 34 * @brief Functions to grant/revoke capabilities to/from a task. 35 35 */ 36 36 … … 38 38 #include <task.h> 39 39 #include <libc.h> 40 #include <kernel/syscall/sysarg64.h>41 40 42 41 /** Grant capabilities to a task. 43 42 * 44 * @param id Destination task ID.43 * @param id Destination task ID. 45 44 * @param caps Capabilities to grant. 46 45 * 47 46 * @return Zero on success or a value from @ref errno.h on failure. 47 * 48 48 */ 49 49 int cap_grant(task_id_t id, unsigned int caps) 50 50 { 51 sysarg64_t arg; 51 #ifdef __32_BITS__ 52 sysarg64_t arg = (sysarg64_t) id; 53 return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps); 54 #endif 52 55 53 arg.value = (unsigned long long) id; 54 55 return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps); 56 #ifdef __64_BITS__ 57 return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) id, (sysarg_t) caps); 58 #endif 56 59 } 57 60 58 61 /** Revoke capabilities from a task. 59 62 * 60 * @param id Destination task ID.63 * @param id Destination task ID. 61 64 * @param caps Capabilities to revoke. 62 65 * 63 66 * @return Zero on success or a value from @ref errno.h on failure. 67 * 64 68 */ 65 69 int cap_revoke(task_id_t id, unsigned int caps) 66 70 { 67 sysarg64_t arg; 71 #ifdef __32_BITS__ 72 sysarg64_t arg = (sysarg64_t) id; 73 return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps); 74 #endif 68 75 69 arg.value = (unsigned long long) id; 70 71 return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps); 76 #ifdef __64_BITS__ 77 return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) id, (sysarg_t) caps); 78 #endif 72 79 } 73 80
Note:
See TracChangeset
for help on using the changeset viewer.