/* Field names for SYS_INT86 */
#define INT86_REG86 m1_p1 /* pointer to registers */
-/* Field names for SYS_SAFECOPY* */
-#define SCP_FROM_TO m2_i1 /* from/to whom? */
-#define SCP_GID m2_i3 /* grant id */
-#define SCP_OFFSET m2_l1 /* offset within grant */
-#define SCP_ADDRESS m2_p1 /* my own address */
-#define SCP_BYTES m2_l2 /* bytes from offset */
-
/* SYS_SAFEMEMSET */
#define SMS_DST m2_i1 /* dst endpoint */
#define SMS_GID m2_i3 /* grant id */
#define SMS_BYTES m2_l2 /* bytes from offset */
#define SMS_PATTERN m2_i2 /* memset() pattern */
-/* Field names for SYS_VSAFECOPY* */
-#define VSCP_VEC_ADDR m2_p1 /* start of vector */
-#define VSCP_VEC_SIZE m2_l2 /* elements in vector */
-
/* Field names for SYS_SPROF, _CPROF, _PROFBUF. */
#define PROF_ACTION m7_i1 /* start/stop/reset/get */
#define PROF_MEM_SIZE m7_i2 /* available memory for data */
} mess_lsys_vm_unmap_phys;
_ASSERT_MSG_SIZE(mess_lsys_vm_unmap_phys);
+typedef struct {
+ endpoint_t from_to;
+ cp_grant_id_t gid;
+ size_t offset;
+ void *address;
+ size_t bytes;
+ uint8_t padding[36];
+} mess_lsys_kern_safecopy;
+_ASSERT_MSG_SIZE(mess_lsys_kern_safecopy);
+
+typedef struct {
+ void *vec_addr;
+ int vec_size;
+ uint8_t padding[48];
+} mess_lsys_kern_vsafecopy;
+_ASSERT_MSG_SIZE(mess_lsys_kern_vsafecopy);
+
typedef struct {
endpoint_t m_source; /* who sent the message */
int m_type; /* what kind of message is it */
mess_lc_vm_brk m_lc_vm_brk;
mess_lsys_vm_map_phys m_lsys_vm_map_phys;
mess_lsys_vm_unmap_phys m_lsys_vm_unmap_phys;
+ mess_lsys_kern_safecopy m_lsys_kern_safecopy;
+ mess_lsys_kern_vsafecopy m_lsys_kern_vsafecopy;
mess_vfs_lchardriver_cancel m_vfs_lchardriver_cancel;
mess_vfs_lchardriver_openclose m_vfs_lchardriver_openclose;
* m_type: SYS_SAFECOPYFROM or SYS_SAFECOPYTO or SYS_VSAFECOPY
*
* The parameters for this kernel call are:
- * SCP_FROM_TO other endpoint
- * SCP_GID grant id
- * SCP_OFFSET offset within granted space
- * SCP_ADDRESS address in own address space
- * SCP_BYTES bytes to be copied
+ * m_lsys_kern_safecopy.from_to other endpoint
+ * m_lsys_kern_safecopy.gid grant id
+ * m_lsys_kern_safecopy.offset offset within granted space
+ * m_lsys_kern_safecopy.address address in own address space
+ * m_lsys_kern_safecopy.bytes bytes to be copied
*
* For the vectored variant (do_vsafecopy):
- * VSCP_VEC_ADDR address of vector
- * VSCP_VEC_SIZE number of significant elements in vector
+ * m_lsys_kern_vsafecopy.vec_addr address of vector
+ * m_lsys_kern_vsafecopy.vec_size number of significant elements in vector
*/
#include <assert.h>
*===========================================================================*/
int do_safecopy_to(struct proc * caller, message * m_ptr)
{
- return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint,
- (cp_grant_id_t) m_ptr->SCP_GID,
- m_ptr->SCP_BYTES, m_ptr->SCP_OFFSET,
- (vir_bytes) m_ptr->SCP_ADDRESS, CPF_WRITE);
+ return safecopy(caller, m_ptr->m_lsys_kern_safecopy.from_to, caller->p_endpoint,
+ (cp_grant_id_t) m_ptr->m_lsys_kern_safecopy.gid,
+ m_ptr->m_lsys_kern_safecopy.bytes, m_ptr->m_lsys_kern_safecopy.offset,
+ (vir_bytes) m_ptr->m_lsys_kern_safecopy.address, CPF_WRITE);
}
/*===========================================================================*
*===========================================================================*/
int do_safecopy_from(struct proc * caller, message * m_ptr)
{
- return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint,
- (cp_grant_id_t) m_ptr->SCP_GID,
- m_ptr->SCP_BYTES, m_ptr->SCP_OFFSET,
- (vir_bytes) m_ptr->SCP_ADDRESS, CPF_READ);
+ return safecopy(caller, m_ptr->m_lsys_kern_safecopy.from_to, caller->p_endpoint,
+ (cp_grant_id_t) m_ptr->m_lsys_kern_safecopy.gid,
+ m_ptr->m_lsys_kern_safecopy.bytes, m_ptr->m_lsys_kern_safecopy.offset,
+ (vir_bytes) m_ptr->m_lsys_kern_safecopy.address, CPF_READ);
}
/*===========================================================================*
/* Set vector copy parameters. */
src.proc_nr_e = caller->p_endpoint;
assert(src.proc_nr_e != NONE);
- src.offset = (vir_bytes) m_ptr->VSCP_VEC_ADDR;
+ src.offset = (vir_bytes) m_ptr->m_lsys_kern_vsafecopy.vec_addr;
dst.proc_nr_e = KERNEL;
dst.offset = (vir_bytes) vec;
/* No. of vector elements. */
- els = m_ptr->VSCP_VEC_SIZE;
+ els = m_ptr->m_lsys_kern_vsafecopy.vec_size;
bytes = els * sizeof(struct vscp_vec);
/* Obtain vector of copies. */
message copy_mess;
- copy_mess.SCP_FROM_TO = src_e;
- copy_mess.SCP_GID = gr_id;
- copy_mess.SCP_OFFSET = (long) offset;
- copy_mess.SCP_ADDRESS = (char *) address;
- copy_mess.SCP_BYTES = (long) bytes;
+ copy_mess.m_lsys_kern_safecopy.from_to = src_e;
+ copy_mess.m_lsys_kern_safecopy.gid = gr_id;
+ copy_mess.m_lsys_kern_safecopy.offset = offset;
+ copy_mess.m_lsys_kern_safecopy.address = address;
+ copy_mess.m_lsys_kern_safecopy.bytes = bytes;
return(_kernel_call(SYS_SAFECOPYFROM, ©_mess));
message copy_mess;
- copy_mess.SCP_FROM_TO = dst_e;
- copy_mess.SCP_GID = gr_id;
- copy_mess.SCP_OFFSET = (long) offset;
- copy_mess.SCP_ADDRESS = (char *) address;
- copy_mess.SCP_BYTES = (long) bytes;
+ copy_mess.m_lsys_kern_safecopy.from_to = dst_e;
+ copy_mess.m_lsys_kern_safecopy.gid = gr_id;
+ copy_mess.m_lsys_kern_safecopy.offset = offset;
+ copy_mess.m_lsys_kern_safecopy.address = address;
+ copy_mess.m_lsys_kern_safecopy.bytes = bytes;
return(_kernel_call(SYS_SAFECOPYTO, ©_mess));