This patch removes the global variables who_p and who_e from the
[minix.git] / kernel / arch / i386 / do_iopenable.c
blobfdc762e5a4357bfff7f39949ed9a0e72a9223160
1 /* The system call implemented in this file:
2 * m_type: SYS_IOPENABLE
4 * The parameters for this system call are:
5 * m2_i2: IO_ENDPT (process to give I/O Protection Level bits)
7 * Author:
8 * Jorrit N. Herder <jnherder@cs.vu.nl>
9 */
11 #include "../../system.h"
12 #include "../../kernel.h"
13 #include <minix/endpoint.h>
15 #include "proto.h"
17 /*===========================================================================*
18 * do_iopenable *
19 *===========================================================================*/
20 PUBLIC int do_iopenable(struct proc * caller, message * m_ptr)
22 int proc_nr;
24 #if 1 /* ENABLE_USERPRIV && ENABLE_USERIOPL */
25 if (m_ptr->IO_ENDPT == SELF) {
26 proc_nr = _ENDPOINT_P(caller->p_endpoint);
27 } else if(!isokendpt(m_ptr->IO_ENDPT, &proc_nr))
28 return(EINVAL);
29 enable_iop(proc_addr(proc_nr));
30 return(OK);
31 #else
32 return(EPERM);
33 #endif