Make VM fix up memory for kernel that crosses region boundaries
[minix.git] / servers / vm / rs.c
blob5c1a74538c577aba6a36daaf826e6f589128da0a
2 #define _SYSTEM 1
4 #define VERBOSE 0
6 #include <minix/callnr.h>
7 #include <minix/com.h>
8 #include <minix/config.h>
9 #include <minix/const.h>
10 #include <minix/ds.h>
11 #include <minix/endpoint.h>
12 #include <minix/keymap.h>
13 #include <minix/minlib.h>
14 #include <minix/type.h>
15 #include <minix/ipc.h>
16 #include <minix/sysutil.h>
17 #include <minix/syslib.h>
18 #include <minix/safecopies.h>
19 #include <minix/bitmap.h>
21 #include <errno.h>
22 #include <string.h>
23 #include <env.h>
24 #include <stdio.h>
26 #include "glo.h"
27 #include "proto.h"
28 #include "util.h"
30 /*===========================================================================*
31 * do_rs_set_priv *
32 *===========================================================================*/
33 PUBLIC int do_rs_set_priv(message *m)
35 int r, n, nr;
36 struct vmproc *vmp;
38 nr = m->VM_RS_NR;
40 if ((r = vm_isokendpt(nr, &n)) != OK) {
41 printf("do_rs_set_priv: message from strange source %d\n", nr);
42 return EINVAL;
45 vmp = &vmproc[n];
47 if (m->VM_RS_BUF) {
48 r = sys_datacopy(m->m_source, (vir_bytes) m->VM_RS_BUF,
49 SELF, (vir_bytes) vmp->vm_call_priv_mask,
50 sizeof(vmp->vm_call_priv_mask));
51 if (r != OK)
52 return r;
55 return OK;