Changeset 77429d3 in mainline
- Timestamp:
- 2011-01-11T16:27:50Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fe5a9fc
- Parents:
- fe8dfa6
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ddi/ddi.h
rfe8dfa6 r77429d3 54 54 extern sysarg_t sys_physmem_map(sysarg_t, sysarg_t, sysarg_t, sysarg_t); 55 55 extern sysarg_t sys_iospace_enable(ddi_ioarg_t *); 56 extern sysarg_t sys_interrupt_enable(int irq, int enable);57 56 58 57 /* -
kernel/generic/include/syscall/syscall.h
rfe8dfa6 r77429d3 82 82 SYS_PHYSMEM_MAP, 83 83 SYS_IOSPACE_ENABLE, 84 SYS_INTERRUPT_ENABLE,85 84 86 85 SYS_SYSINFO_GET_TAG, -
kernel/generic/src/ddi/ddi.c
rfe8dfa6 r77429d3 258 258 } 259 259 260 /** Disable or enable specified interrupts.261 *262 * @param irq the interrupt to be enabled/disabled.263 * @param enable if true enable the interrupt, disable otherwise.264 *265 * @retutn Zero on success, error code otherwise.266 */267 sysarg_t sys_interrupt_enable(int irq, int enable)268 {269 /* FIXME: this needs to be generic code, or better not be in kernel at all. */270 #if 0271 cap_t task_cap = cap_get(TASK);272 if (!(task_cap & CAP_IRQ_REG))273 return EPERM;274 275 if (irq < 0 || irq > 16) {276 return EINVAL;277 }278 279 uint16_t irq_mask = (uint16_t)(1 << irq);280 if (enable) {281 trap_virtual_enable_irqs(irq_mask);282 } else {283 trap_virtual_disable_irqs(irq_mask);284 }285 286 #endif287 return 0;288 }289 290 260 /** @} 291 261 */ -
kernel/generic/src/syscall/syscall.c
rfe8dfa6 r77429d3 171 171 (syshandler_t) sys_physmem_map, 172 172 (syshandler_t) sys_iospace_enable, 173 (syshandler_t) sys_interrupt_enable,174 173 175 174 /* Sysinfo syscalls */ -
uspace/app/trace/syscalls.c
rfe8dfa6 r77429d3 73 73 [SYS_PHYSMEM_MAP] = { "physmem_map", 4, V_ERRNO }, 74 74 [SYS_IOSPACE_ENABLE] = { "iospace_enable", 1, V_ERRNO }, 75 [SYS_INTERRUPT_ENABLE] = { "interrupt_enable", 2, V_ERRNO },76 75 77 76 [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag", 2, V_INTEGER }, -
uspace/drv/ns8250/ns8250.c
rfe8dfa6 r77429d3 431 431 { 432 432 ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data; 433 int res;434 435 /* Enable interrupt globally. */436 res = interrupt_enable(data->irq);437 if (res != EOK)438 return res;439 433 440 434 /* Enable interrupt on the serial port. */ -
uspace/lib/c/generic/ddi.c
rfe8dfa6 r77429d3 96 96 } 97 97 98 /** Enable an interrupt.99 *100 * @param irq the interrupt.101 *102 * @return Zero on success, negative error code otherwise.103 */104 int interrupt_enable(int irq)105 {106 return __SYSCALL2(SYS_INTERRUPT_ENABLE, (sysarg_t) irq, 1);107 }108 109 /** Disable an interrupt.110 *111 * @param irq the interrupt.112 *113 * @return Zero on success, negative error code otherwise.114 */115 int interrupt_disable(int irq)116 {117 return __SYSCALL2(SYS_INTERRUPT_ENABLE, (sysarg_t) irq, 0);118 }119 120 98 /** Enable PIO for specified I/O range. 121 99 * -
uspace/lib/c/include/ddi.h
rfe8dfa6 r77429d3 42 42 extern int iospace_enable(task_id_t, void *, unsigned long); 43 43 extern int pio_enable(void *, size_t, void **); 44 extern int interrupt_enable(int);45 extern int interrupt_disable(int);46 44 47 45 #endif
Note:
See TracChangeset
for help on using the changeset viewer.