1 /* The system call implemented in this file: 2 * m_type: SYS_IOPENABLE 3 * 4 * The parameters for this system call are: 5 * m_lsys_krn_sys_iopenable.endpt (process to give I/O Protection Level bits) 6 * 7 * Author: 8 * Jorrit N. Herder <jnherder@cs.vu.nl> 9 */ 10 11 #include "kernel/system.h" 12 #include "kernel/kernel.h" 13 #include <minix/endpoint.h> 14 15 #include "arch_proto.h" 16 17 /*===========================================================================* 18 * do_iopenable * 19 *===========================================================================*/ 20 int do_iopenable(struct proc * caller, message * m_ptr) 21 { 22 int proc_nr; 23 24 #if 1 /* ENABLE_USERPRIV && ENABLE_USERIOPL */ 25 if (m_ptr->m_lsys_krn_sys_iopenable.endpt == SELF) { 26 okendpt(caller->p_endpoint, &proc_nr); 27 } else if(!isokendpt(m_ptr->m_lsys_krn_sys_iopenable.endpt, &proc_nr)) 28 return(EINVAL); 29 enable_iop(proc_addr(proc_nr)); 30 return(OK); 31 #else 32 return(EPERM); 33 #endif 34 } 35 36 37