2005-04-21 16:53:53 +02:00
|
|
|
#include "syslib.h"
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_physcopy(src_proc, src_seg, src_vir,
|
2005-04-29 17:36:43 +02:00
|
|
|
dst_proc, dst_seg, dst_vir, bytes)
|
2009-09-22 23:42:02 +02:00
|
|
|
endpoint_t src_proc; /* source process */
|
2005-04-29 17:36:43 +02:00
|
|
|
int src_seg; /* source memory segment */
|
|
|
|
vir_bytes src_vir; /* source virtual address */
|
2009-09-22 23:42:02 +02:00
|
|
|
endpoint_t dst_proc; /* destination process */
|
2005-04-29 17:36:43 +02:00
|
|
|
int dst_seg; /* destination memory segment */
|
|
|
|
vir_bytes dst_vir; /* destination virtual address */
|
2005-04-21 16:53:53 +02:00
|
|
|
phys_bytes bytes; /* how many bytes */
|
|
|
|
{
|
2005-04-29 17:36:43 +02:00
|
|
|
/* Transfer a block of data. The source and destination can each either be a
|
|
|
|
* process number or SELF (to indicate own process number). Virtual addresses
|
2011-04-26 23:28:23 +02:00
|
|
|
* are offsets within LOCAL_SEG (text, stack, data), or BIOS_SEG.
|
2005-04-29 17:36:43 +02:00
|
|
|
* Physicall addressing is also possible with PHYS_SEG.
|
2005-04-21 16:53:53 +02:00
|
|
|
*/
|
2005-04-29 17:36:43 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
message copy_mess;
|
|
|
|
|
|
|
|
if (bytes == 0L) return(OK);
|
2006-03-03 10:44:55 +01:00
|
|
|
copy_mess.CP_SRC_ENDPT = src_proc;
|
2005-04-29 17:36:43 +02:00
|
|
|
copy_mess.CP_SRC_SPACE = src_seg;
|
|
|
|
copy_mess.CP_SRC_ADDR = (long) src_vir;
|
2006-03-03 10:44:55 +01:00
|
|
|
copy_mess.CP_DST_ENDPT = dst_proc;
|
2005-04-29 17:36:43 +02:00
|
|
|
copy_mess.CP_DST_SPACE = dst_seg;
|
|
|
|
copy_mess.CP_DST_ADDR = (long) dst_vir;
|
2005-04-21 16:53:53 +02:00
|
|
|
copy_mess.CP_NR_BYTES = (long) bytes;
|
2010-02-09 16:20:09 +01:00
|
|
|
return(_kernel_call(SYS_PHYSCOPY, ©_mess));
|
2005-04-21 16:53:53 +02:00
|
|
|
}
|