0fb2f83da9
. sys_vircopy always uses D for both src and dst . sys_physcopy uses PHYS_SEG if and only if corresponding endpoint is NONE, so we can derive the mode (PHYS_SEG or D) from the endpoint arg in the kernel, dropping the seg args . fields in msg still filled in for backwards compatability, using same NONE-logic in the library
30 lines
970 B
C
30 lines
970 B
C
#include "syslib.h"
|
|
|
|
int sys_vircopy(src_proc, src_vir,
|
|
dst_proc, dst_vir, bytes)
|
|
endpoint_t src_proc; /* source process */
|
|
vir_bytes src_vir; /* source virtual address */
|
|
endpoint_t dst_proc; /* destination process */
|
|
vir_bytes dst_vir; /* destination virtual address */
|
|
phys_bytes bytes; /* how many bytes */
|
|
{
|
|
/* 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
|
|
* are offsets within LOCAL_SEG (text, stack, data), or BIOS_SEG.
|
|
*/
|
|
|
|
message copy_mess;
|
|
|
|
if (bytes == 0L) return(OK);
|
|
copy_mess.CP_SRC_ENDPT = src_proc;
|
|
copy_mess.CP_SRC_ADDR = (long) src_vir;
|
|
copy_mess.CP_DST_ENDPT = dst_proc;
|
|
copy_mess.CP_DST_ADDR = (long) dst_vir;
|
|
copy_mess.CP_NR_BYTES = (long) bytes;
|
|
|
|
/* backwards compatability D segs */
|
|
copy_mess.CP_DST_SPACE_OBSOLETE = D;
|
|
copy_mess.CP_SRC_SPACE_OBSOLETE = D;
|
|
|
|
return(_kernel_call(SYS_VIRCOPY, ©_mess));
|
|
}
|