drop from segments physcopy/vircopy invocations

. 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
This commit is contained in:
Ben Gras
2012-06-16 17:29:37 +00:00
parent 0e35eb0c6b
commit 0fb2f83da9
17 changed files with 62 additions and 64 deletions

View File

@@ -2,10 +2,8 @@
* m_type: SYS_VIRCOPY, SYS_PHYSCOPY
*
* The parameters for this kernel call are:
* m5_s1: CP_SRC_SPACE source virtual segment
* m5_l1: CP_SRC_ADDR source offset within segment
* m5_i1: CP_SRC_ENDPT source process number
* m5_s2: CP_DST_SPACE destination virtual segment
* m5_l2: CP_DST_ADDR destination offset within segment
* m5_i2: CP_DST_ENDPT destination process number
* m5_l3: CP_NR_BYTES number of bytes to copy
@@ -28,6 +26,7 @@ int do_copy(struct proc * caller, message * m_ptr)
struct vir_addr vir_addr[2]; /* virtual source and destination address */
phys_bytes bytes; /* number of bytes to copy */
int i;
endpoint_t pe;
#if 0
if (caller->p_endpoint != PM_PROC_NR && caller->p_endpoint != VFS_PROC_NR &&
@@ -39,22 +38,20 @@ int do_copy(struct proc * caller, message * m_ptr)
{
first= 0;
printf(
"do_copy: got request from %d (source %d, seg %d, destination %d, seg %d)\n",
"do_copy: got request from %d (source %d, destination %d)\n",
caller->p_endpoint,
m_ptr->CP_SRC_ENDPT,
m_ptr->CP_SRC_SPACE,
m_ptr->CP_DST_ENDPT,
m_ptr->CP_DST_SPACE);
m_ptr->CP_DST_ENDPT);
}
}
#endif
/* Dismember the command message. */
vir_addr[_SRC_].proc_nr_e = m_ptr->CP_SRC_ENDPT;
vir_addr[_SRC_].segment = m_ptr->CP_SRC_SPACE;
pe = vir_addr[_SRC_].proc_nr_e = m_ptr->CP_SRC_ENDPT;
vir_addr[_SRC_].segment = (pe == NONE ? PHYS_SEG : D);
vir_addr[_SRC_].offset = (vir_bytes) m_ptr->CP_SRC_ADDR;
vir_addr[_DST_].proc_nr_e = m_ptr->CP_DST_ENDPT;
vir_addr[_DST_].segment = m_ptr->CP_DST_SPACE;
pe = vir_addr[_DST_].proc_nr_e = m_ptr->CP_DST_ENDPT;
vir_addr[_DST_].segment = (pe == NONE ? PHYS_SEG : D);
vir_addr[_DST_].offset = (vir_bytes) m_ptr->CP_DST_ADDR;
bytes = (phys_bytes) m_ptr->CP_NR_BYTES;

View File

@@ -3,7 +3,7 @@
*
* The parameters for this kernel call are:
* m5_i1: CP_SRC_PROC_NR (process number)
* m5_s1: CP_SRC_SPACE (segment where address is: T, D, or S)
* m5_s1: UMAP_SEG (segment where address is: T, D, or S)
* m5_l1: CP_SRC_ADDR (virtual address)
* m5_l2: CP_DST_ADDR (returns physical address)
* m5_l3: CP_NR_BYTES (size of datastructure)
@@ -24,7 +24,7 @@
*==========================================================================*/
int do_umap(struct proc * caller, message * m_ptr)
{
int seg_index = m_ptr->CP_SRC_SPACE & SEGMENT_INDEX;
int seg_index = m_ptr->UMAP_SEG & SEGMENT_INDEX;
int endpt = (int) m_ptr->CP_SRC_ENDPT;
/* This call is a subset of umap_remote, it allows mapping virtual addresses

View File

@@ -3,7 +3,7 @@
*
* The parameters for this kernel call are:
* m5_i1: CP_SRC_PROC_NR (process number)
* m5_s1: CP_SRC_SPACE (segment where address is: T, D, or S)
* m5_s1: UMAP_SEG (segment where address is: T, D, or S)
* m5_l1: CP_SRC_ADDR (virtual address)
* m5_i2: CP_DST_ENDPT (process number of grantee to check access for)
* m5_l2: CP_DST_ADDR (returns physical address)
@@ -26,8 +26,8 @@
int do_umap_remote(struct proc * caller, message * m_ptr)
{
/* Map virtual address to physical, for non-kernel processes. */
int seg_type = m_ptr->CP_SRC_SPACE & SEGMENT_TYPE;
int seg_index = m_ptr->CP_SRC_SPACE & SEGMENT_INDEX;
int seg_type = m_ptr->UMAP_SEG & SEGMENT_TYPE;
int seg_index = m_ptr->UMAP_SEG & SEGMENT_INDEX;
vir_bytes offset = m_ptr->CP_SRC_ADDR;
int count = m_ptr->CP_NR_BYTES;
int endpt = (int) m_ptr->CP_SRC_ENDPT;