xref: /minix3/minix/lib/libsys/sys_physcopy.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include "syslib.h"
2*433d6423SLionel Sambuc 
sys_physcopy(src_proc,src_vir,dst_proc,dst_vir,bytes,flags)3*433d6423SLionel Sambuc int sys_physcopy(src_proc, src_vir, dst_proc, dst_vir, bytes, flags)
4*433d6423SLionel Sambuc endpoint_t src_proc;		/* source process */
5*433d6423SLionel Sambuc vir_bytes src_vir;		/* source virtual address */
6*433d6423SLionel Sambuc endpoint_t dst_proc;		/* destination process */
7*433d6423SLionel Sambuc vir_bytes dst_vir;		/* destination virtual address */
8*433d6423SLionel Sambuc phys_bytes bytes;		/* how many bytes */
9*433d6423SLionel Sambuc int flags;			/* copy flags */
10*433d6423SLionel Sambuc {
11*433d6423SLionel Sambuc /* Transfer a block of data.  The source and destination can each either be a
12*433d6423SLionel Sambuc  * process number or SELF (to indicate own process number). Virtual addresses
13*433d6423SLionel Sambuc  * are offsets within LOCAL_SEG (text, stack, data), or BIOS_SEG.
14*433d6423SLionel Sambuc  * Physicall addressing is also possible with PHYS_SEG.
15*433d6423SLionel Sambuc  */
16*433d6423SLionel Sambuc 
17*433d6423SLionel Sambuc   message copy_mess;
18*433d6423SLionel Sambuc 
19*433d6423SLionel Sambuc   if (bytes == 0L) return(OK);
20*433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.src_endpt = src_proc;
21*433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.src_addr = src_vir;
22*433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.dst_endpt = dst_proc;
23*433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.dst_addr = dst_vir;
24*433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.nr_bytes = bytes;
25*433d6423SLionel Sambuc   copy_mess.m_lsys_krn_sys_copy.flags = flags;
26*433d6423SLionel Sambuc 
27*433d6423SLionel Sambuc   return(_kernel_call(SYS_PHYSCOPY, &copy_mess));
28*433d6423SLionel Sambuc }
29