minix/kernel/arch/i386/do_iopenable.c
Lionel Sambuc 05f155c0a9 Message type for SYS_IOPENABLE
Change-Id: I8b089c30c7f9ae75e404f63495bbb199d583f1cd
2014-07-28 17:05:47 +02:00

36 lines
952 B
C

/* The system call implemented in this file:
* m_type: SYS_IOPENABLE
*
* The parameters for this system call are:
* m_lsys_krn_sys_iopenable.endpt (process to give I/O Protection Level bits)
*
* Author:
* Jorrit N. Herder <jnherder@cs.vu.nl>
*/
#include "kernel/system.h"
#include "kernel/kernel.h"
#include <minix/endpoint.h>
#include "arch_proto.h"
/*===========================================================================*
* do_iopenable *
*===========================================================================*/
int do_iopenable(struct proc * caller, message * m_ptr)
{
int proc_nr;
#if 1 /* ENABLE_USERPRIV && ENABLE_USERIOPL */
if (m_ptr->m_lsys_krn_sys_iopenable.endpt == SELF) {
okendpt(caller->p_endpoint, &proc_nr);
} else if(!isokendpt(m_ptr->m_lsys_krn_sys_iopenable.endpt, &proc_nr))
return(EINVAL);
enable_iop(proc_addr(proc_nr));
return(OK);
#else
return(EPERM);
#endif
}