Changeset 2fa10f6 in mainline
- Timestamp:
- 2010-09-11T22:28:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5203efb1
- Parents:
- 7431b665
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ddi/ddi.h
r7431b665 r2fa10f6 54 54 extern unative_t sys_physmem_map(unative_t, unative_t, unative_t, unative_t); 55 55 extern unative_t sys_iospace_enable(ddi_ioarg_t *); 56 extern unative_t sys_preempt_control(int);57 56 58 57 /* -
kernel/generic/include/security/cap.h
r7431b665 r2fa10f6 70 70 71 71 /** 72 * CAP_PREEMPT_CONTROL allows its holder to disable/enable preemption.73 */74 #define CAP_PREEMPT_CONTROL (1<<3)75 76 /**77 72 * CAP_IRQ_REG entitles its holder to register IRQ handlers. 78 73 */ 79 #define CAP_IRQ_REG (1<< 4)74 #define CAP_IRQ_REG (1<<3) 80 75 81 76 typedef uint32_t cap_t; -
kernel/generic/include/syscall/syscall.h
r7431b665 r2fa10f6 80 80 SYS_PHYSMEM_MAP, 81 81 SYS_IOSPACE_ENABLE, 82 SYS_PREEMPT_CONTROL,83 82 84 83 SYS_SYSINFO_GET_TAG, -
kernel/generic/src/ddi/ddi.c
r7431b665 r2fa10f6 258 258 } 259 259 260 /** Disable or enable preemption.261 *262 * @param enable If non-zero, the preemption counter will be decremented,263 * leading to potential enabling of preemption. Otherwise264 * the preemption counter will be incremented, preventing265 * preemption from occurring.266 *267 * @return Zero on success or EPERM if callers capabilities are not sufficient.268 *269 */270 unative_t sys_preempt_control(int enable)271 {272 if (!(cap_get(TASK) & CAP_PREEMPT_CONTROL))273 return EPERM;274 275 if (enable)276 preemption_enable();277 else278 preemption_disable();279 280 return 0;281 }282 283 260 /** @} 284 261 */ -
kernel/generic/src/main/kinit.c
r7431b665 r2fa10f6 208 208 */ 209 209 cap_set(programs[i].task, CAP_CAP | CAP_MEM_MANAGER | 210 CAP_IO_MANAGER | CAP_ PREEMPT_CONTROL | CAP_IRQ_REG);210 CAP_IO_MANAGER | CAP_IRQ_REG); 211 211 212 212 if (!ipc_phone_0) -
kernel/generic/src/syscall/syscall.c
r7431b665 r2fa10f6 159 159 (syshandler_t) sys_physmem_map, 160 160 (syshandler_t) sys_iospace_enable, 161 (syshandler_t) sys_preempt_control,162 161 163 162 /* Sysinfo syscalls */ -
uspace/app/trace/syscalls.c
r7431b665 r2fa10f6 73 73 [SYS_PHYSMEM_MAP] = { "physmem_map", 4, V_ERRNO }, 74 74 [SYS_IOSPACE_ENABLE] = { "iospace_enable", 1, V_ERRNO }, 75 [SYS_PREEMPT_CONTROL] = { "preempt_control", 1, V_ERRNO },76 75 77 76 [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag", 2, V_INTEGER }, -
uspace/lib/c/generic/ddi.c
r7431b665 r2fa10f6 96 96 } 97 97 98 /** Interrupt control99 *100 * @param enable 1 - enable interrupts, 0 - disable interrupts101 */102 int preemption_control(int enable)103 {104 return __SYSCALL1(SYS_PREEMPT_CONTROL, (sysarg_t) enable);105 }106 107 98 /** Enable PIO for specified I/O range. 108 99 * -
uspace/lib/c/include/ddi.h
r7431b665 r2fa10f6 41 41 extern int physmem_map(void *, void *, unsigned long, int); 42 42 extern int iospace_enable(task_id_t, void *, unsigned long); 43 extern int preemption_control(int);44 43 extern int pio_enable(void *, size_t, void **); 45 44
Note:
See TracChangeset
for help on using the changeset viewer.