VM: full munmap
[minix.git] / lib / libsys / sys_physcopy.c
blob3698332df4b5e8091011e6e19c151d2e1ef4f4ac
1 #include "syslib.h"
3 int sys_physcopy(src_proc, src_vir, dst_proc, dst_vir, bytes)
4 endpoint_t src_proc; /* source process */
5 vir_bytes src_vir; /* source virtual address */
6 endpoint_t dst_proc; /* destination process */
7 vir_bytes dst_vir; /* destination virtual address */
8 phys_bytes bytes; /* how many bytes */
10 /* Transfer a block of data. The source and destination can each either be a
11 * process number or SELF (to indicate own process number). Virtual addresses
12 * are offsets within LOCAL_SEG (text, stack, data), or BIOS_SEG.
13 * Physicall addressing is also possible with PHYS_SEG.
16 message copy_mess;
18 if (bytes == 0L) return(OK);
19 copy_mess.CP_SRC_ENDPT = src_proc;
20 copy_mess.CP_SRC_ADDR = (long) src_vir;
21 copy_mess.CP_DST_ENDPT = dst_proc;
22 copy_mess.CP_DST_ADDR = (long) dst_vir;
23 copy_mess.CP_NR_BYTES = (long) bytes;
25 /* provide backwards compatability arguments to old
26 * kernels based on process id's; NONE <=> physical
28 copy_mess.CP_DST_SPACE_OBSOLETE = (dst_proc == NONE ? PHYS_SEG : D_OBSOLETE);
29 copy_mess.CP_SRC_SPACE_OBSOLETE = (src_proc == NONE ? PHYS_SEG : D_OBSOLETE);
31 return(_kernel_call(SYS_PHYSCOPY, &copy_mess));