Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1211 → Rev 1212

/kernel/trunk/generic/include/ddi/ddi.h
39,6 → 39,8
/*
* Interface to be implemented by all architectures.
*/
extern __native ddi_int_control_arch(__native enable, __native *flags);
extern __native ddi_int_control(__native enable, __native *flags);
extern int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size);
 
#endif
/kernel/trunk/generic/include/security/cap.h
57,6 → 57,11
*/
#define CAP_IO_MANAGER (1<<2)
 
/**
* CAP_INT_CONTROL allows its holder to disable interrupts
*/
#define CAP_INT_CONTROL (1<<3)
 
typedef __u32 cap_t;
 
extern void cap_set(task_t *t, cap_t caps);
/kernel/trunk/generic/include/syscall/syscall.h
32,6 → 32,7
typedef enum {
SYS_IO = 0,
SYS_TLS_SET = 1, /* Hardcoded in AMD64,IA32 uspace - psthread.S */
SYS_INT_CONTROL = 2, /* Hardcoded in all SYSCALL handlers */
SYS_THREAD_CREATE,
SYS_THREAD_EXIT,
SYS_FUTEX_SLEEP,
/kernel/trunk/generic/src/ddi/ddi.c
194,3 → 194,11
copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
return (__native) ddi_enable_iospace((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size);
}
 
__native ddi_int_control(__native enable, __native *flags)
{
if (! cap_get(TASK) & CAP_INT_CONTROL)
return EPERM;
return ddi_int_control_arch(enable, flags);
}
 
/kernel/trunk/generic/src/syscall/syscall.c
64,6 → 64,11
return as_remap(AS, (__address) address, size, 0);
}
 
static __native sys_int_control(int enable)
{
panic("Not implemented.");
}
 
/** Dispatch system call */
__native syscall_handler(__native a1, __native a2, __native a3,
__native a4, __native id)
77,6 → 82,7
syshandler_t syscall_table[SYSCALL_END] = {
sys_io,
sys_tls_set,
sys_int_control,
sys_thread_create,
sys_thread_exit,
sys_futex_sleep_timeout,