Rename paramctl to setgrant.
This commit is contained in:
@@ -35,7 +35,7 @@ OBJECTS = \
|
||||
$(SYSTEM)(do_vcopy.o) \
|
||||
$(SYSTEM)(do_umap.o) \
|
||||
$(SYSTEM)(do_memset.o) \
|
||||
$(SYSTEM)(do_paramctl.o) \
|
||||
$(SYSTEM)(do_setgrant.o) \
|
||||
$(SYSTEM)(do_privctl.o) \
|
||||
$(SYSTEM)(do_segctl.o) \
|
||||
$(SYSTEM)(do_safecopy.o) \
|
||||
@@ -138,8 +138,8 @@ $(SYSTEM)(do_getinfo.o): do_getinfo.c
|
||||
$(SYSTEM)(do_abort.o): do_abort.c
|
||||
$(CC) do_abort.c
|
||||
|
||||
$(SYSTEM)(do_paramctl.o): do_paramctl.c
|
||||
$(CC) do_paramctl.c
|
||||
$(SYSTEM)(do_setgrant.o): do_setgrant.c
|
||||
$(CC) do_setgrant.c
|
||||
|
||||
$(SYSTEM)(do_privctl.o): do_privctl.c
|
||||
$(CC) do_privctl.c
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* The kernel call implemented in this file:
|
||||
* m_type: SYS_PARAMCTL
|
||||
*
|
||||
* The parameters for this kernel call are:
|
||||
* PCTL_REQ request code (SYS_PARAM_*)
|
||||
* PCTL_INT[12] integer parameters
|
||||
* PCTL_ADDR1 address parameter
|
||||
*/
|
||||
|
||||
#include "../system.h"
|
||||
#include <minix/safecopies.h>
|
||||
|
||||
/*===========================================================================*
|
||||
* do_paramctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_paramctl(m_ptr)
|
||||
message *m_ptr;
|
||||
{
|
||||
struct proc *rp;
|
||||
int r;
|
||||
|
||||
/* Who wants to set a parameter? */
|
||||
rp = proc_addr(who_p);
|
||||
|
||||
/* Which parameter is it? */
|
||||
switch(m_ptr->PCTL_REQ) {
|
||||
|
||||
case SYS_PARAM_SET_GRANT:
|
||||
/* Copy grant table set in priv. struct. */
|
||||
if ((rp->p_rts_flags & NO_PRIV) || !(priv(rp))) {
|
||||
r = EPERM;
|
||||
} else {
|
||||
_K_SET_GRANT_TABLE(rp,
|
||||
(vir_bytes) m_ptr->PCTL_ADDR1,
|
||||
m_ptr->PCTL_INT1);
|
||||
r = OK;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
r = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/* The kernel call implemented in this file:
|
||||
* m_type: SYS_SETGRANT
|
||||
*
|
||||
* The parameters for this kernel call are:
|
||||
* SG_ADDR address of grant table in own address space
|
||||
* SG_SIZE number of entries
|
||||
*/
|
||||
|
||||
#include "../system.h"
|
||||
#include <minix/safecopies.h>
|
||||
|
||||
/*===========================================================================*
|
||||
* do_setgrant *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_setgrant(m_ptr)
|
||||
message *m_ptr;
|
||||
{
|
||||
struct proc *rp;
|
||||
int r;
|
||||
|
||||
/* Who wants to set a parameter? */
|
||||
rp = proc_addr(who_p);
|
||||
|
||||
/* Copy grant table set in priv. struct. */
|
||||
if ((rp->p_rts_flags & NO_PRIV) || !(priv(rp))) {
|
||||
r = EPERM;
|
||||
} else {
|
||||
_K_SET_GRANT_TABLE(rp,
|
||||
(vir_bytes) m_ptr->SG_ADDR,
|
||||
m_ptr->SG_SIZE);
|
||||
r = OK;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
Reference in New Issue
Block a user