xref: /minix3/minix/lib/libsys/sys_vircopy.c (revision 685aa79304a3b43efa0194233b5d70cfb6df335e)
1433d6423SLionel Sambuc #include "syslib.h"
2*685aa793SDavid van Moolenbroek #include <string.h>
3433d6423SLionel Sambuc 
sys_vircopy(src_proc,src_vir,dst_proc,dst_vir,bytes,flags)4433d6423SLionel Sambuc int sys_vircopy(src_proc, src_vir,
5433d6423SLionel Sambuc 	dst_proc, dst_vir, bytes, flags)
6433d6423SLionel Sambuc endpoint_t src_proc;		/* source process */
7433d6423SLionel Sambuc vir_bytes src_vir;		/* source virtual address */
8433d6423SLionel Sambuc endpoint_t dst_proc;		/* destination process */
9433d6423SLionel Sambuc vir_bytes dst_vir;		/* destination virtual address */
10433d6423SLionel Sambuc phys_bytes bytes;		/* how many bytes */
11433d6423SLionel Sambuc int flags;			/* copy flags */
12433d6423SLionel Sambuc {
13433d6423SLionel Sambuc /* Transfer a block of data.  The source and destination can each either be a
14433d6423SLionel Sambuc  * process number or SELF (to indicate own process number).
15433d6423SLionel Sambuc  */
16433d6423SLionel Sambuc 
17433d6423SLionel Sambuc   message copy_mess;
18433d6423SLionel Sambuc 
19433d6423SLionel Sambuc   if (bytes == 0L) return(OK);
20433d6423SLionel Sambuc   memset(&copy_mess, 0, sizeof(copy_mess));
21433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.src_endpt = src_proc;
22433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.src_addr = src_vir;
23433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.dst_endpt = dst_proc;
24433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.dst_addr = dst_vir;
25433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.nr_bytes = bytes;
26433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.flags = flags;
27433d6423SLionel Sambuc 
28433d6423SLionel Sambuc   return(_kernel_call(SYS_VIRCOPY, &copy_mess));
29433d6423SLionel Sambuc }
30