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