source: trunk/minix/lib/syslib/sys_physcopy.c@ 22

Last change on this file since 22 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.1 KB
Line 
1#include "syslib.h"
2
3PUBLIC int sys_physcopy(src_proc, src_seg, src_vir,
4 dst_proc, dst_seg, dst_vir, bytes)
5int src_proc; /* source process */
6int src_seg; /* source memory segment */
7vir_bytes src_vir; /* source virtual address */
8int dst_proc; /* destination process */
9int dst_seg; /* destination memory segment */
10vir_bytes dst_vir; /* destination virtual address */
11phys_bytes bytes; /* how many bytes */
12{
13/* Transfer a block of data. The source and destination can each either be a
14 * process number or SELF (to indicate own process number). Virtual addresses
15 * are offsets within LOCAL_SEG (text, stack, data), REMOTE_SEG, or BIOS_SEG.
16 * Physicall addressing is also possible with PHYS_SEG.
17 */
18
19 message copy_mess;
20
21 if (bytes == 0L) return(OK);
22 copy_mess.CP_SRC_ENDPT = src_proc;
23 copy_mess.CP_SRC_SPACE = src_seg;
24 copy_mess.CP_SRC_ADDR = (long) src_vir;
25 copy_mess.CP_DST_ENDPT = dst_proc;
26 copy_mess.CP_DST_SPACE = dst_seg;
27 copy_mess.CP_DST_ADDR = (long) dst_vir;
28 copy_mess.CP_NR_BYTES = (long) bytes;
29 return(_taskcall(SYSTASK, SYS_PHYSCOPY, &copy_mess));
30}
Note: See TracBrowser for help on using the repository browser.