Changeset 953bc1ef in mainline
- Timestamp:
- 2010-04-29T08:34:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cfe7716
- Parents:
- 5af21c5
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ddi/ddi.h
r5af21c5 r953bc1ef 56 56 extern unative_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg); 57 57 extern unative_t sys_preempt_control(int enable); 58 extern unative_t sys_interrupt_enable(int irq, int enable); 58 59 59 60 /* … … 62 63 extern int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size); 63 64 65 64 66 #endif 65 67 -
kernel/generic/include/syscall/syscall.h
r5af21c5 r953bc1ef 81 81 SYS_IOSPACE_ENABLE, 82 82 SYS_PREEMPT_CONTROL, 83 SYS_INTERRUPT_ENABLE, 83 84 84 85 SYS_SYSINFO_VALID, -
kernel/generic/src/ddi/ddi.c
r5af21c5 r953bc1ef 287 287 } 288 288 289 /** Disable or enable specified interrupts. 290 * 291 * @param irq the interrupt to be enabled/disabled. 292 * @param enable if true enable the interrupt, disable otherwise. 293 * 294 * @retutn Zero on success, error code otherwise. 295 */ 296 unative_t sys_interrupt_enable(int irq, int enable) 297 { 298 cap_t task_cap = cap_get(TASK); 299 if (!(task_cap & CAP_PREEMPT_CONTROL) || !(task_cap & CAP_IRQ_REG)) 300 return EPERM; 301 302 if (irq < 0 || irq > 16) { 303 return EINVAL; 304 } 305 306 uint16_t irq_mask = (uint16_t)(1 << irq); 307 if (enable) { 308 trap_virtual_enable_irqs(irq_mask); 309 } else { 310 trap_virtual_disable_irqs(irq_mask); 311 } 312 313 return 0; 314 } 315 289 316 /** @} 290 317 */ -
kernel/generic/src/syscall/syscall.c
r5af21c5 r953bc1ef 151 151 (syshandler_t) sys_iospace_enable, 152 152 (syshandler_t) sys_preempt_control, 153 (syshandler_t) sys_interrupt_enable, 153 154 154 155 /* Sysinfo syscalls */ -
uspace/app/trace/syscalls.c
r5af21c5 r953bc1ef 74 74 [SYS_IOSPACE_ENABLE] = { "iospace_enable", 1, V_ERRNO }, 75 75 [SYS_PREEMPT_CONTROL] = { "preempt_control", 1, V_ERRNO }, 76 [SYS_INTERRUPT_ENABLE] = { "interrupt_enable", 2, V_ERRNO }, 76 77 77 78 [SYS_SYSINFO_VALID] = { "sysinfo_valid", 2, V_HASH }, -
uspace/lib/libc/generic/ddi.c
r5af21c5 r953bc1ef 105 105 } 106 106 107 /** Enable/disable interrupt. 108 * 109 * @param irq the interrupt. 110 * @param enable 1 - enable interrupt, 0 - disable interrupt. 111 * 112 * @return Zero on success, negative error code otherwise. 113 */ 114 int interrupt_enable(int irq, int enable) 115 { 116 return __SYSCALL2(SYS_INTERRUPT_ENABLE, (sysarg_t) irq, (sysarg_t) enable); 117 } 118 107 119 /** Enable PIO for specified I/O range. 108 120 * -
uspace/lib/libc/include/ddi.h
r5af21c5 r953bc1ef 43 43 extern int preemption_control(int); 44 44 extern int pio_enable(void *, size_t, void **); 45 extern int interrupt_enable(int, int); 45 46 46 47 #endif
Note:
See TracChangeset
for help on using the changeset viewer.