Added vectored variant of sys_safecopy*.
This commit is contained in:
@@ -288,8 +288,9 @@
|
||||
# define SYS_VM_MAP (KERNEL_CALL + 30) /* sys_vm_map() */
|
||||
# define SYS_SAFECOPYFROM (KERNEL_CALL + 31) /* sys_safecopyfrom() */
|
||||
# define SYS_SAFECOPYTO (KERNEL_CALL + 32) /* sys_safecopyto() */
|
||||
# define SYS_VSAFECOPY (KERNEL_CALL + 33) /* sys_vsafecopy() */
|
||||
|
||||
#define NR_SYS_CALLS 33 /* number of system calls */
|
||||
#define NR_SYS_CALLS 34 /* number of system calls */
|
||||
|
||||
/* Pseudo call for use in kernel/table.c. */
|
||||
#define SYS_ALL_CALLS (NR_SYS_CALLS)
|
||||
@@ -472,7 +473,7 @@
|
||||
/* Field names for SYS_INT86 */
|
||||
#define INT86_REG86 m1_p1 /* pointer to registers */
|
||||
|
||||
/* Field names for SYS_SAFECOPY */
|
||||
/* Field names for SYS_SAFECOPY* */
|
||||
#define SCP_FROM_TO m2_i1 /* from/to whom? */
|
||||
#define SCP_INFO m2_i2 /* byte: DDDDSSSS Dest and Src seg */
|
||||
#define SCP_GID m2_i3 /* grant id */
|
||||
@@ -480,6 +481,10 @@
|
||||
#define SCP_ADDRESS m2_p1 /* my own address */
|
||||
#define SCP_BYTES m2_l2 /* bytes from offset */
|
||||
|
||||
/* Field names for SYS_VSAFECOPY* */
|
||||
#define VSCP_VEC_ADDR m2_p1 /* start of vector */
|
||||
#define VSCP_VEC_SIZE m2_l2 /* elements in vector */
|
||||
|
||||
/* For the SCP_INFO field: encoding and decoding. */
|
||||
#define SCP_MAKEINFO(seg) ((seg) & 0xffff)
|
||||
#define SCP_INFO2SEG(info) ((info) & 0xffff)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define NULL ((void *)0) /* null pointer */
|
||||
#define CPVEC_NR 16 /* max # of entries in a SYS_VCOPY request */
|
||||
#define CPVVEC_NR 64 /* max # of entries in a SYS_VCOPY request */
|
||||
#define SCPVEC_NR 64 /* max # of entries in a SYS_VSAFECOPY* request */
|
||||
#define NR_IOREQS MIN(NR_BUFS, 64)
|
||||
/* maximum number of entries in an iorequest */
|
||||
|
||||
|
||||
@@ -37,6 +37,18 @@ typedef struct {
|
||||
char cp_reserved[8]; /* future use */
|
||||
} cp_grant_t;
|
||||
|
||||
/* Vectored safecopy. */
|
||||
struct vscp_vec {
|
||||
/* Exactly one of the following must be SELF. */
|
||||
endpoint_t v_from; /* source */
|
||||
endpoint_t v_to; /* destination */
|
||||
|
||||
cp_grant_id_t v_gid; /* grant id of other process */
|
||||
size_t v_offset; /* offset in other grant */
|
||||
vir_bytes v_addr; /* address in copier's space */
|
||||
size_t v_bytes; /* no. of bytes */
|
||||
};
|
||||
|
||||
/* Invalid grant number. */
|
||||
#define GRANT_INVALID -1
|
||||
#define GRANT_VALID(g) ((g) > GRANT_INVALID)
|
||||
|
||||
@@ -97,10 +97,12 @@ _PROTOTYPE(int sys_physcopy, (endpoint_t src_proc, int src_seg, vir_bytes src_vi
|
||||
endpoint_t dst_proc, int dst_seg, vir_bytes dst_vir, phys_bytes bytes));
|
||||
|
||||
|
||||
_PROTOTYPE(int sys_safecopyfrom, (endpoint_t, cp_grant_id_t,
|
||||
vir_bytes, vir_bytes, size_t, int));
|
||||
_PROTOTYPE(int sys_safecopyto, (endpoint_t, cp_grant_id_t,
|
||||
vir_bytes, vir_bytes, size_t, int));
|
||||
/* Grant-based copy functions. */
|
||||
_PROTOTYPE(int sys_safecopyfrom, (endpoint_t source, cp_grant_id_t grant,
|
||||
vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
|
||||
_PROTOTYPE(int sys_safecopyto, (endpoint_t dest, cp_grant_id_t grant,
|
||||
vir_bytes grant_offset, vir_bytes my_address, size_t bytes, int my_seg));
|
||||
_PROTOTYPE(int sys_vsafecopy, (struct vscp_vec *copyvec, int elements));
|
||||
|
||||
_PROTOTYPE(int sys_memset, (unsigned long pattern,
|
||||
phys_bytes base, phys_bytes bytes));
|
||||
|
||||
Reference in New Issue
Block a user