case DIOCOPENCT:
return sys_safecopyto(endpt, grant, 0,
- (vir_bytes) &ps->open_count, sizeof(ps->open_count), D);
+ (vir_bytes) &ps->open_count, sizeof(ps->open_count));
case DIOCFLUSH:
if (ps->state != STATE_GOOD_DEV || (ps->flags & FLAG_BARRIER))
return EIO;
if ((r = sys_safecopyfrom(endpt, grant, 0, (vir_bytes) &val,
- sizeof(val), D)) != OK)
+ sizeof(val))) != OK)
return r;
return gen_set_wcache(ps, val);
return r;
return sys_safecopyto(endpt, grant, 0, (vir_bytes) &val,
- sizeof(val), D);
+ sizeof(val));
}
return EINVAL;
switch (request) {
case DIOCTIMEOUT:
r= sys_safecopyfrom(endpt, grant, 0, (vir_bytes)&timeout,
- sizeof(timeout), D);
+ sizeof(timeout));
if(r != OK)
return r;
}
r= sys_safecopyto(endpt, grant, 0, (vir_bytes)&prev,
- sizeof(prev), D);
+ sizeof(prev));
if(r != OK)
return r;
if (w_prepare(minor) == NULL) return ENXIO;
count = w_wn->open_ct;
r= sys_safecopyto(endpt, grant, 0, (vir_bytes)&count,
- sizeof(count), D);
+ sizeof(count));
if(r != OK)
return r;
batch = MIN(m->DL_COUNT - i, NR_IOREQS);
r = sys_safecopyfrom(m->m_source, m->DL_GRANT, off,
- (vir_bytes) iovec, batch * sizeof(iovec[0]), D);
+ (vir_bytes) iovec, batch * sizeof(iovec[0]));
if (r != OK)
panic("vector copy failed: %d", r);
size = MIN(iovp->iov_size, left);
r = sys_safecopyto(m->m_source, iovp->iov_grant, 0,
- (vir_bytes) pos, size, D);
+ (vir_bytes) pos, size);
if (r != OK)
panic("safe copy failed: %d", r);
batch = MIN(m->DL_COUNT - i, NR_IOREQS);
r = sys_safecopyfrom(m->m_source, m->DL_GRANT, off,
- (vir_bytes) iovec, batch * sizeof(iovec[0]), D);
+ (vir_bytes) iovec, batch * sizeof(iovec[0]));
if (r != OK)
panic("vector copy failed: %d", r);
r = sys_safecopyfrom(m->m_source,
iovp->iov_grant, 0,
(vir_bytes) (state.txd_base + pos),
- skip, D);
+ skip);
if (r != OK)
panic("safe copy failed: %d", r);
pos = 0;
r = sys_safecopyfrom(m->m_source, iovp->iov_grant,
skip, (vir_bytes) (state.txd_base + pos),
- size - skip, D);
+ size - skip);
if (r != OK)
panic("safe copy failed: %d", r);
int r;
sys_safecopyto(m->m_source, m->DL_GRANT, 0,
- (vir_bytes) &state.stat, sizeof(state.stat), D);
+ (vir_bytes) &state.stat, sizeof(state.stat));
m->m_type = DL_STAT_REPLY;
if ((rc = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0UL,
(vir_bytes)&dep->de_stat,
- sizeof(dep->de_stat), 0)) != OK)
+ sizeof(dep->de_stat))) != OK)
panic(str_CopyErrMsg, rc);
mp->m_type = DL_STAT_REPLY;
bytes = size;
r= sys_safecopyto(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant, 0,
- (vir_bytes)buffer, bytes, D);
+ (vir_bytes)buffer, bytes);
if (r != OK)
panic(str_CopyErrMsg, r);
buffer += bytes;
vir_bytes len;
len = (count > IOVEC_NR ? IOVEC_NR : count) * sizeof(iovec_t);
- rc = sys_safecopyfrom(user_proc, grant, 0, (vir_bytes)loc_addr, len, D);
+ rc = sys_safecopyfrom(user_proc, grant, 0, (vir_bytes)loc_addr, len);
if (rc != OK)
panic(str_CopyErrMsg, rc);
return;
bytes = size;
r= sys_safecopyfrom(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant,
- 0, (vir_bytes)buffer, bytes, D);
+ 0, (vir_bytes)buffer, bytes);
if (r != OK)
panic(str_CopyErrMsg, r);
buffer += bytes;
r= sys_safecopyfrom(iovp->iod_proc_nr,
iovp->iod_iovec[i].iov_grant, offset,
- vir_hw, bytes, D);
+ vir_hw, bytes);
if (r != OK) {
panic("dp_user2nic_s: sys_safecopyfrom failed: %d", r);
}
if (odd_byte)
{
r= sys_safecopyfrom(user_proc, gid, offset,
- (vir_bytes)&two_bytes[1], 1, D);
+ (vir_bytes)&two_bytes[1], 1);
if (r != OK) {
panic("dp_pio16_user2nic: sys_safecopyfrom failed: %d", r);
}
{
assert(bytes == 1);
r= sys_safecopyfrom(user_proc, gid, offset,
- (vir_bytes)&two_bytes[0], 1, D);
+ (vir_bytes)&two_bytes[0], 1);
if (r != OK) {
panic("dp_pio16_user2nic: sys_safecopyfrom failed: %d", r);
}
r= sys_safecopyto(iovp->iod_proc_nr,
iovp->iod_iovec[i].iov_grant, offset,
- vir_hw, bytes, D);
+ vir_hw, bytes);
if (r != OK)
panic("dp_nic2user_s: sys_safecopyto failed: %d", r);
if (odd_byte)
{
r= sys_safecopyto(user_proc, gid, offset,
- (vir_bytes)&two_bytes[1], 1, D);
+ (vir_bytes)&two_bytes[1], 1);
if (r != OK) {
panic("dp_pio16_nic2user: sys_safecopyto failed: %d", r);
}
assert(bytes == 1);
*(u16_t *)two_bytes= inw(dep->de_data_port);
r= sys_safecopyto(user_proc, gid, offset,
- (vir_bytes)&two_bytes[0], 1, D);
+ (vir_bytes)&two_bytes[0], 1);
if (r != OK)
{
panic("dp_pio16_nic2user: sys_safecopyto failed: %d",
int r;
r= sys_safecopyfrom(user_proc, grant, offset,
- (vir_bytes)loc_addr, count, D);
+ (vir_bytes)loc_addr, count);
if (r != OK)
panic("get_userdata: sys_safecopyfrom failed: %d", r);
}
int r;
r= sys_safecopyto(user_proc, grant, 0, (vir_bytes)loc_addr,
- count, D);
+ count);
if (r != OK)
panic("put_userdata: sys_safecopyto failed: %d", r);
}
vir_bytes len;
len = (count > IOVEC_NR ? IOVEC_NR : count) * sizeof(iovec_t);
- if ((rc = sys_safecopyfrom(user_proc, grant, 0, (vir_bytes)loc_addr, len, D)) != OK)
+ if ((rc = sys_safecopyfrom(user_proc, grant, 0, (vir_bytes)loc_addr, len)) != OK)
panic(CopyErrMsg, rc);
return;
}
if (dep->de_mode == DEM_ENABLED) (*dep->de_getstatsf) (dep);
if ((rc = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes)&dep->de_stat,
- (vir_bytes) sizeof(dep->de_stat), 0)) != OK)
+ (vir_bytes) sizeof(dep->de_stat))) != OK)
panic(CopyErrMsg, rc);
reply_mess.m_type = DL_STAT_REPLY;
/* Reads from Rx buffer to user area */
r= sys_safecopyto(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant, 0,
- (vir_bytes)buffer, bytes, D);
+ (vir_bytes)buffer, bytes);
if (r != OK)
panic("mem2user: sys_safecopyto failed: %d", r);
buffer += bytes;
bytes = iovp->iod_iovec[ix].iov_size; /* Size of buffer */
if (bytes > pktsize) bytes = pktsize;
r= sys_safecopyfrom(iovp->iod_proc_nr, iovp->iod_iovec[ix].iov_grant,
- 0, (vir_bytes)buffer, bytes, D);
+ 0, (vir_bytes)buffer, bytes);
if (r != OK)
panic("user2mem: sys_safecopyfrom failed: %d", r);
buffer += bytes;
if ((r = sys_safecopyfrom(e->tx_message.m_source,
e->tx_message.DL_GRANT, 0,
(vir_bytes) iovec, e->tx_message.DL_COUNT *
- sizeof(iovec_s_t), D)) != OK)
+ sizeof(iovec_s_t))) != OK)
{
panic("sys_safecopyfrom() failed: %d", r);
}
iovec[i].iov_grant, 0,
(vir_bytes) e->tx_buffer +
(tail * E1000_IOBUF_SIZE),
- size, D)) != OK)
+ size)) != OK)
{
panic("sys_safecopyfrom() failed: %d", r);
}
if ((r = sys_safecopyfrom(e->rx_message.m_source,
e->rx_message.DL_GRANT, 0,
(vir_bytes) iovec, e->rx_message.DL_COUNT *
- sizeof(iovec_s_t), D)) != OK)
+ sizeof(iovec_s_t))) != OK)
{
panic("sys_safecopyfrom() failed: %d", r);
}
if ((r = sys_safecopyto(e->rx_message.m_source, iovec[i].iov_grant,
0, (vir_bytes) e->rx_buffer + bytes +
(cur * E1000_IOBUF_SIZE),
- size, D)) != OK)
+ size)) != OK)
{
panic("sys_safecopyto() failed: %d", r);
}
stats.ets_OWC = 0;
sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats,
- sizeof(stats), D);
+ sizeof(stats));
mp->m_type = DL_STAT_REPLY;
if((r=send(mp->m_source, mp)) != OK)
panic("e1000_getstat: send() failed: %d", r);
/* Copy in the rule. */
if ((r = sys_safecopyfrom(endpt, grant, 0,
- (vir_bytes) &rules[i-1], sizeof(rules[0]),
- D)) != OK)
+ (vir_bytes) &rules[i-1], sizeof(rules[0]))) != OK)
return r;
/* Mark the rule as active, and return its number. */
case FBDCDELRULE:
/* Copy in the given rule number. */
if ((r = sys_safecopyfrom(endpt, grant, 0, (vir_bytes) &i,
- sizeof(i), D)) != OK)
+ sizeof(i))) != OK)
return r;
/* Fail if the given rule number is not valid or in use.
/* Copy in just the rule number from the given structure. */
if ((r = sys_safecopyfrom(endpt, grant,
offsetof(struct fbd_rule, num), (vir_bytes) &i,
- sizeof(i), D)) != OK)
+ sizeof(i))) != OK)
return r;
/* Fail if the given rule number is not valid or in use.
/* Copy out the entire rule as is. */
return sys_safecopyto(endpt, grant, 0, (vir_bytes) &rules[i-1],
- sizeof(rules[0]), D);
+ sizeof(rules[0]));
default:
return EINVAL;
if (flag_rw == FLT_WRITE)
return sys_safecopyfrom(who_e, grant_id, 0,
- (vir_bytes) buffer, size, D);
+ (vir_bytes) buffer, size);
else
return sys_safecopyto(who_e, grant_id, 0,
- (vir_bytes) buffer, size, D);
+ (vir_bytes) buffer, size);
}
/*===========================================================================*
if (flag_rw == FLT_WRITE)
r = sys_safecopyfrom(who_e,
(vir_bytes) iov[i].iov_addr, 0,
- (vir_bytes) bufp, bytes, D);
+ (vir_bytes) bufp, bytes);
else
r = sys_safecopyto(who_e,
(vir_bytes) iov[i].iov_addr, 0,
- (vir_bytes) bufp, bytes, D);
+ (vir_bytes) bufp, bytes);
if(r != OK)
return r;
/* Extract informations. */
grants = m_in.BDEV_COUNT;
if((r = sys_safecopyfrom(who_e, grant_id, 0, (vir_bytes) iov_proc,
- grants * sizeof(iovec_t), D)) != OK) {
+ grants * sizeof(iovec_t))) != OK) {
panic("copying in grant vector failed: %d", r);
}
if(sys_safecopyto(who_e, (vir_bytes) grant_id, 0,
(vir_bytes) &sizepart,
- sizeof(struct partition), D) != OK) {
+ sizeof(struct partition)) != OK) {
printf("Filter: DIOCGETP safecopyto failed\n");
return EIO;
}
if(proc_nr != SELF) {
s=sys_safecopyfrom(proc_nr, iov->iov_addr,
SECTOR_SIZE + iov_offset, (vir_bytes) &fmt_param,
- (phys_bytes) sizeof(fmt_param), D);
+ (phys_bytes) sizeof(fmt_param));
if(s != OK)
panic("sys_safecopyfrom failed: %d", s);
} else {
if(proc_nr != SELF) {
s=sys_safecopyfrom(proc_nr, *ug, *up,
(vir_bytes) floppy_buf,
- (phys_bytes) SECTOR_SIZE, D);
+ (phys_bytes) SECTOR_SIZE);
if(s != OK)
panic("sys_safecopyfrom failed: %d", s);
} else {
if(proc_nr != SELF) {
s=sys_safecopyto(proc_nr, *ug, *up,
(vir_bytes) floppy_buf,
- (phys_bytes) SECTOR_SIZE, D);
+ (phys_bytes) SECTOR_SIZE);
if(s != OK)
panic("sys_safecopyto failed: %d", s);
} else {
n= count-i;
r= sys_safecopyfrom(iov_endpt, iov_grant, iov_offset,
(vir_bytes)fp->fxp_iovec_s,
- n * sizeof(fp->fxp_iovec_s[0]), D);
+ n * sizeof(fp->fxp_iovec_s[0]));
if (r != OK)
panic("fxp_writev: sys_safecopyfrom failed: %d", r);
}
r= sys_safecopyfrom(iov_endpt, iovp->iov_grant,
- 0, (vir_bytes)(txp->tx_buf+o), s, D);
+ 0, (vir_bytes)(txp->tx_buf+o), s);
if (r != OK) {
panic("fxp_writev_s: sys_safecopyfrom failed: %d", r);
}
n= count-i;
r= sys_safecopyfrom(iov_endpt, iov_grant, iov_offset,
(vir_bytes)fp->fxp_iovec_s,
- n * sizeof(fp->fxp_iovec_s[0]), D);
+ n * sizeof(fp->fxp_iovec_s[0]));
if (r != OK)
panic("fxp_readv_s: sys_safecopyfrom failed: %d", r);
}
r= sys_safecopyto(iov_endpt, iovp->iov_grant,
- 0, (vir_bytes)(rfdp->rfd_buf+o), s, D);
+ 0, (vir_bytes)(rfdp->rfd_buf+o), s);
if (r != OK)
{
panic("fxp_readv: sys_safecopyto failed: %d", r);
stats.ets_OWC= fp->fxp_stat.sc_tx_latecol;
r= sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats,
- sizeof(stats), D);
+ sizeof(stats));
if (r != OK)
panic("fxp_getstat_s: sys_safecopyto failed: %d", r);
case DEV_GATHER_S:
ret = sys_safecopyto(endpt, (cp_grant_id_t) iov->iov_addr, 0,
(vir_bytes) (HELLO_MESSAGE + ex64lo(position)),
- bytes, D);
+ bytes);
iov->iov_size -= bytes;
break;
r = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes)ec->read_iovec.iod_iovec,
(count > IOVEC_NR ? IOVEC_NR : count) *
- sizeof(iovec_s_t), D);
+ sizeof(iovec_s_t));
if (r != OK)
panic("do_vread_s: sys_safecopyfrom failed: %d", r);
ec->read_iovec.iod_iovec_s = count;
r = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes)ec->write_iovec.iod_iovec,
(count > IOVEC_NR ? IOVEC_NR : count) *
- sizeof(iovec_s_t), D);
+ sizeof(iovec_s_t));
if (r != OK)
panic("do_vwrite_s: sys_safecopyfrom failed: %d", r);
ec->write_iovec.iod_iovec_s = count;
if ( (r=sys_safecopyfrom(iovp->iod_proc_nr,
iovp->iod_iovec[i].iov_grant, offset,
- nic_addr, bytes, D )) != OK )
+ nic_addr, bytes )) != OK )
panic("ec_user2nic: sys_safecopyfrom failed: %d", r);
count -= bytes;
if (bytes > count)
bytes = count;
if ( (r=sys_safecopyto( iovp->iod_proc_nr, iovp->iod_iovec[i].iov_grant,
- offset, nic_addr, bytes, D )) != OK )
+ offset, nic_addr, bytes )) != OK )
panic("ec_nic2user: sys_safecopyto failed: %d", r);
count -= bytes;
(vir_bytes)iovp->iod_iovec,
(iovp->iod_iovec_s > IOVEC_NR ?
IOVEC_NR : iovp->iod_iovec_s) *
- sizeof(iovec_s_t), D);
+ sizeof(iovec_s_t));
if (r != OK)
panic("ec_next_iovec: sys_safecopyfrom failed: %d", r);
}
ec= &ec_state;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
- (vir_bytes)&ec->eth_stat, sizeof(ec->eth_stat), D);
+ (vir_bytes)&ec->eth_stat, sizeof(ec->eth_stat));
if (r != OK)
panic("do_getstat_s: sys_safecopyto failed: %d", r);
}
else {
if((r=sys_safecopyfrom(endpt, grant, offset,
- (vir_bytes)buf, count, D)) != OK)
+ (vir_bytes)buf, count)) != OK)
return r;
}
buf = log->log_buffer + log->log_read;
if((r=sys_safecopyto(endpt, grant, offset,
- (vir_bytes)buf, count, D)) != OK)
+ (vir_bytes)buf, count)) != OK)
return r;
LOGINC(log->log_read, count);
if (position + count > dv_size) count = dv_size - position;
if (opcode == DEV_GATHER_S) { /* copy actual data */
r=sys_safecopyto(endpt, grant, vir_offset,
- dev_vaddr + position, count, D);
+ dev_vaddr + position, count);
} else {
r=sys_safecopyfrom(endpt, grant, vir_offset,
- dev_vaddr + position, count, D);
+ dev_vaddr + position, count);
}
if(r != OK) {
panic("I/O copy failed: %d", r);
if (opcode == DEV_GATHER_S) { /* copy data */
s=sys_safecopyto(endpt, grant,
- vir_offset, (vir_bytes) vaddr+page_off, subcount, D);
+ vir_offset, (vir_bytes) vaddr+page_off, subcount);
} else {
s=sys_safecopyfrom(endpt, grant,
- vir_offset, (vir_bytes) vaddr+page_off, subcount, D);
+ vir_offset, (vir_bytes) vaddr+page_off, subcount);
}
if(s != OK)
return s;
while (left > 0) {
chunk = (left > ZERO_BUF_SIZE) ? ZERO_BUF_SIZE : left;
s=sys_safecopyto(endpt, grant,
- vir_offset+suboffset, (vir_bytes) dev_zero, chunk, D);
+ vir_offset+suboffset, (vir_bytes) dev_zero, chunk);
if(s != OK)
return s;
left -= chunk;
if (position + count > dv_size) count = dv_size - position;
if (!do_write) { /* copy actual data */
r=sys_safecopyto(endpt, grant, vir_offset,
- dev_vaddr + position, count, D);
+ dev_vaddr + position, count);
} else {
r=sys_safecopyfrom(endpt, grant, vir_offset,
- dev_vaddr + position, count, D);
+ dev_vaddr + position, count);
}
if(r != OK) {
panic("I/O copy failed: %d", r);
/* Get request structure */
s= sys_safecopyfrom(endpt, grant, 0, (vir_bytes)&ramdev_size,
- sizeof(ramdev_size), D);
+ sizeof(ramdev_size));
if (s != OK)
return s;
if(m_vaddrs[minor] && !cmp64(dv->dv_size, cvul64(ramdev_size))) {
cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) orp->or_iovec_s,
- n * sizeof(orp->or_iovec_s[0]), D);
+ n * sizeof(orp->or_iovec_s[0]));
if (cps != OK)
printf("orinoco: sys_safecopyfrom failed: %d\n", cps);
}
cps = sys_safecopyfrom(mp->m_source, iovp->iov_grant,
- 0, (vir_bytes) databuf + o, s, D);
+ 0, (vir_bytes) databuf + o, s);
if (cps != OK)
printf("orinoco: sys_safecopyfrom failed:%d\n",
cps);
cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes)orp->or_iovec_s,
- n * sizeof(orp->or_iovec_s[0]), D);
+ n * sizeof(orp->or_iovec_s[0]));
if (cps != OK)
panic("orinoco: warning: sys_safecopytp failed: %d", cps);
s = length - size;
}
cps = sys_safecopyto(mp->m_source, iovp->iov_grant, 0,
- (vir_bytes) databuf + o, s, D);
+ (vir_bytes) databuf + o, s);
if (cps != OK)
panic("orinoco: warning: sys_safecopy failed: %d", cps);
stats = orp->or_stat;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
- (vir_bytes) &stats, sizeof(stats), D);
+ (vir_bytes) &stats, sizeof(stats));
if(r != OK) {
panic("or_getstat_s: sys_safecopyto failed: %d", r);
}
if (len > name_len)
len= name_len;
r= sys_safecopyto(mp->m_source, name_gid, 0, (vir_bytes)name,
- len, D);
+ len);
}
mp->m_type= r;
if (len > name_len)
len= name_len;
r= sys_safecopyto(mp->m_source, gid, 0,
- (vir_bytes)name, len, D);
+ (vir_bytes)name, len);
}
mp->m_type= r;
gid= mp->m1_i1;
r= sys_safecopyfrom(mp->m_source, gid, 0, (vir_bytes)&pci_acl[i].acl,
- sizeof(pci_acl[i].acl), D);
+ sizeof(pci_acl[i].acl));
if (r != OK)
{
printf("PCI: do_set_acl: safecopyfrom failed\n");
/* Map all the services in the boot image. */
if((r = sys_safecopyfrom(RS_PROC_NR, info->rproctab_gid, 0,
- (vir_bytes) rprocpub, sizeof(rprocpub), S)) != OK) {
+ (vir_bytes) rprocpub, sizeof(rprocpub))) != OK) {
panic("sys_safecopyfrom failed: %d", r);
}
for(i=0;i < NR_BOOT_PROCS;i++) {
if ( (chunk = user_left) > sizeof obuf) chunk = sizeof obuf;
s=sys_safecopyfrom(caller, grant_nr, user_vir_d, (vir_bytes) obuf,
- chunk, D);
+ chunk);
if(s != OK) {
done_status = EFAULT;
if (opcode == DEV_GATHER_S) {
random_getbytes(random_buf, chunk);
r= sys_safecopyto(endpt, grant, vir_offset,
- (vir_bytes) random_buf, chunk, D);
+ (vir_bytes) random_buf, chunk);
if (r != OK)
{
printf("random: sys_safecopyto failed for proc %d, "
}
} else if (opcode == DEV_SCATTER_S) {
r= sys_safecopyfrom(endpt, grant, vir_offset,
- (vir_bytes) random_buf, chunk, D);
+ (vir_bytes) random_buf, chunk);
if (r != OK)
{
printf("random: sys_safecopyfrom failed for proc %d, "
cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
- n * sizeof(rep->re_iovec_s[0]), D);
+ n * sizeof(rep->re_iovec_s[0]));
if (cps != OK) {
panic("rl_readv_s: sys_safecopyfrom failed: %d",
cps);
cps = sys_safecopyto(mp->m_source,
iovp->iov_grant, 0,
- (vir_bytes) rep->v_re_rx_buf+o, s1, D);
+ (vir_bytes) rep->v_re_rx_buf+o, s1);
if (cps != OK) {
panic("rl_readv_s: sys_safecopyto failed: %d",
cps);
}
cps = sys_safecopyto(mp->m_source,
iovp->iov_grant, s1,
- (vir_bytes) rep->v_re_rx_buf, s-s1, S);
+ (vir_bytes) rep->v_re_rx_buf, s-s1);
if (cps != OK) {
panic("rl_readv_s: sys_safecopyto failed: %d", cps);
}
{
cps = sys_safecopyto(mp->m_source,
iovp->iov_grant, 0,
- (vir_bytes) rep->v_re_rx_buf+o, s, D);
+ (vir_bytes) rep->v_re_rx_buf+o, s);
if (cps != OK)
panic("rl_readv_s: sys_safecopyto failed: %d", cps);
}
n= count-i;
cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
- n * sizeof(rep->re_iovec_s[0]), D);
+ n * sizeof(rep->re_iovec_s[0]));
if (cps != OK) {
panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
}
panic("invalid packet size");
}
cps = sys_safecopyfrom(mp->m_source, iovp->iov_grant,
- 0, (vir_bytes) ret, s, D);
+ 0, (vir_bytes) ret, s);
if (cps != OK) {
panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
}
stats= rep->re_stat;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
- (vir_bytes) &stats, sizeof(stats), D);
+ (vir_bytes) &stats, sizeof(stats));
if (r != OK)
panic("rl_getstat_s: sys_safecopyto failed: %d", r);
n = count-i;
cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
- n * sizeof(rep->re_iovec_s[0]), D);
+ n * sizeof(rep->re_iovec_s[0]));
if (cps != OK) {
panic("rl_readv_s: sys_safecopyfrom failed: %d", cps);
}
}
cps = sys_safecopyto(mp->m_source, iovp->iov_grant, 0,
- (vir_bytes) rep->re_rx[index].v_ret_buf + size, s, D);
+ (vir_bytes) rep->re_rx[index].v_ret_buf + size, s);
if (cps != OK)
panic("rl_readv_s: sys_safecopyto failed: %d", cps);
n = count - i;
cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
- n * sizeof(rep->re_iovec_s[0]), D);
+ n * sizeof(rep->re_iovec_s[0]));
if (cps != OK) {
panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
}
panic("invalid packet size");
cps = sys_safecopyfrom(mp->m_source, iovp->iov_grant,
- 0, (vir_bytes) ret, s, D);
+ 0, (vir_bytes) ret, s);
if (cps != OK) {
panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
}
stats = rep->re_stat;
r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
- (vir_bytes) &stats, sizeof(stats), D);
+ (vir_bytes) &stats, sizeof(stats));
if (r != OK)
panic("rl_getstat_s: sys_safecopyto failed: %d", r);
do {
if (count > sizeof(buf)) count = sizeof(buf);
if ((result = sys_safecopyfrom(tp->tty_outcaller, tp->tty_outgrant,
- tp->tty_outoffset, (vir_bytes) buf, count, D)) != OK)
+ tp->tty_outoffset, (vir_bytes) buf, count)) != OK)
break;
tp->tty_outoffset += count;
tbuf = buf;
r = sys_safecopyfrom(m->m_source,
(cp_grant_id_t) m->IO_GRANT, 0,
- (vir_bytes) &mapreqvm, sizeof(mapreqvm), D);
+ (vir_bytes) &mapreqvm, sizeof(mapreqvm));
if (r != OK)
{
if((r = sys_safecopyto(m->m_source,
(cp_grant_id_t) m->IO_GRANT, 0,
(vir_bytes) &mapreqvm,
- sizeof(mapreqvm), D)) != OK) {
+ sizeof(mapreqvm))) != OK) {
printf("tty: sys_safecopyto failed\n");
}
} else {
result = ga_program(seq1); /* bring font memory into view */
if(sys_safecopyfrom(m->m_source, (cp_grant_id_t) m->IO_GRANT, 0,
- (vir_bytes) font_memory, GA_FONT_SIZE, D) != OK) {
+ (vir_bytes) font_memory, GA_FONT_SIZE) != OK) {
printf("tty: copying from %d failed\n", m->m_source);
return EFAULT;
}
if (n <= 0)
panic("do_kbd(READ): bad n: %d", n);
r= sys_safecopyto(m->m_source, (cp_grant_id_t) m->IO_GRANT, 0,
- (vir_bytes) &kbdp->buf[kbdp->offset], n, D);
+ (vir_bytes) &kbdp->buf[kbdp->offset], n);
if (r == OK)
{
kbdp->offset= (kbdp->offset+n) % KBD_BUFSZ;
for (i= 0; i<m->COUNT; i++)
{
r= sys_safecopyfrom(m->m_source, (cp_grant_id_t)
- m->IO_GRANT, i, (vir_bytes) &c, 1, D);
+ m->IO_GRANT, i, (vir_bytes) &c, 1);
if (r != OK)
break;
kbc_cmd1(KBC_WRITE_AUX, c);
r= sys_safecopyfrom(m->m_source, (cp_grant_id_t)
m->IO_GRANT, 0, (vir_bytes) &leds,
- sizeof(leds), D);
+ sizeof(leds));
if (r != OK)
break;
b= 0;
r = sys_safecopyfrom(m->m_source, (cp_grant_id_t)
m->IO_GRANT, 0, (vir_bytes) &bell,
- sizeof(bell), D);
+ sizeof(bell));
if (r != OK)
break;
panic("kbd_status: bad n: %d", n);
kbdp->req_size= 0;
r= sys_safecopyto(kbdp->incaller, kbdp->req_grant, 0,
- (vir_bytes)&kbdp->buf[kbdp->offset], n, D);
+ (vir_bytes)&kbdp->buf[kbdp->offset], n);
if (r == OK)
{
kbdp->offset= (kbdp->offset+n) % KBD_BUFSZ;
{
/* Load a new keymap. */
return sys_safecopyfrom(m->m_source, (cp_grant_id_t) m->IO_GRANT,
- 0, (vir_bytes) keymap, (vir_bytes) sizeof(keymap), D);
+ 0, (vir_bytes) keymap, (vir_bytes) sizeof(keymap));
}
/*===========================================================================*
/* Copy from user space to the PTY output buffer. */
if ((s = sys_safecopyfrom(tp->tty_outcaller, tp->tty_outgrant,
- tp->tty_outoffset, (vir_bytes) pp->ohead, count, D))!=OK) {
+ tp->tty_outoffset, (vir_bytes) pp->ohead, count))!=OK) {
break;
}
/* Copy from the output buffer to the readers address space. */
if((s = sys_safecopyto(pp->rdcaller, pp->rdgrant,
- pp->rdoffset, (vir_bytes) pp->otail, count, D)) != OK) {
+ pp->rdoffset, (vir_bytes) pp->otail, count)) != OK) {
break;
}
pp->rdoffset += count;
/* Transfer one character to 'c'. */
if ((s = sys_safecopyfrom(pp->wrcaller, pp->wrgrant, pp->wroffset,
- (vir_bytes) &c, 1, D)) != OK) {
+ (vir_bytes) &c, 1)) != OK) {
printf("pty: safecopy failed (error %d)\n", s);
break;
}
/* Copy from user space to the RS232 output buffer. */
sys_safecopyfrom(tp->tty_outcaller, tp->tty_outgrant,
- tp->tty_outoffset, (vir_bytes) rs->ohead, count, D);
+ tp->tty_outoffset, (vir_bytes) rs->ohead, count);
/* Perform output processing on the output buffer. */
out_process(tp, rs->obuf, rs->ohead, bufend(rs->obuf), &count, &ocount);
case TCGETS:
/* Get the termios attributes. */
r = sys_safecopyto(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT, 0,
- (vir_bytes) &tp->tty_termios, (vir_bytes) size, D);
+ (vir_bytes) &tp->tty_termios, (vir_bytes) size);
break;
case TCSETSW:
case TCSETS:
/* Set the termios attributes. */
r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
- 0, (vir_bytes) &tp->tty_termios, (vir_bytes) size, D);
+ 0, (vir_bytes) &tp->tty_termios, (vir_bytes) size);
if (r != OK) break;
setattr(tp);
break;
case TCFLSH:
r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
- 0, (vir_bytes) ¶m.i, (vir_bytes) size, D);
+ 0, (vir_bytes) ¶m.i, (vir_bytes) size);
if (r != OK) break;
switch (param.i) {
case TCIFLUSH: tty_icancel(tp); break;
case TCFLOW:
r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
- 0, (vir_bytes) ¶m.i, (vir_bytes) size, D);
+ 0, (vir_bytes) ¶m.i, (vir_bytes) size);
if (r != OK) break;
switch (param.i) {
case TCOOFF:
case TIOCGWINSZ:
r = sys_safecopyto(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT, 0,
- (vir_bytes) &tp->tty_winsize, (vir_bytes) size, D);
+ (vir_bytes) &tp->tty_winsize, (vir_bytes) size);
break;
case TIOCSWINSZ:
r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
- 0, (vir_bytes) &tp->tty_winsize, (vir_bytes) size, D);
+ 0, (vir_bytes) &tp->tty_winsize, (vir_bytes) size);
sigchar(tp, SIGWINCH, 0);
break;
sys_safecopyto(tp->tty_incaller,
tp->tty_ingrant, tp->tty_inoffset,
(vir_bytes) buf,
- (vir_bytes) buflen(buf), D);
+ (vir_bytes) buflen(buf));
tp->tty_inoffset += buflen(buf);
tp->tty_incum += buflen(buf);
bp = buf;
count = bp - buf;
sys_safecopyto(tp->tty_incaller,
tp->tty_ingrant, tp->tty_inoffset,
- (vir_bytes) buf, (vir_bytes) count, D);
+ (vir_bytes) buf, (vir_bytes) count);
tp->tty_inoffset += count;
tp->tty_incum += count;
}
if (tp->tty_ioreq == TCSETSF) tty_icancel(tp);
result = sys_safecopyfrom(tp->tty_iocaller, tp->tty_iogrant, 0,
(vir_bytes) &tp->tty_termios,
- (vir_bytes) sizeof(tp->tty_termios), D);
+ (vir_bytes) sizeof(tp->tty_termios));
if (result == OK) setattr(tp);
}
tp->tty_ioreq = 0;
hgcm_conn[conn].req[req].grant, 0,
(vir_bytes)
hgcm_conn[conn].req[req].param,
- count * sizeof(vbox_param_t), D);
+ count * sizeof(vbox_param_t));
}
}
connreq = (struct VMMDevHGCMConnect *) hgcm_conn[conn].req[0].ptr;
connreq->type = VMMDEV_HGCM_SVCLOC_LOCALHOST_EXISTING;
if ((r = sys_safecopyfrom(m_ptr->m_source, m_ptr->VBOX_GRANT, 0,
- (vir_bytes) connreq->name, m_ptr->VBOX_COUNT, D)) !=
+ (vir_bytes) connreq->name, m_ptr->VBOX_COUNT)) !=
OK) {
free_conn(conn);
if (count > 0) {
if ((r = sys_safecopyfrom(m_ptr->m_source, m_ptr->VBOX_GRANT,
0, (vir_bytes) hgcm_conn[conn].req[req].param,
- count * sizeof(vbox_param_t), D)) != OK)
+ count * sizeof(vbox_param_t))) != OK)
return r;
}
/* Field names for SYS_SAFECOPY* */
#define SCP_FROM_TO m2_i1 /* from/to whom? */
-#define SCP_SEG m2_i2 /* my own segment */
+#define SCP_SEG_OBSOLETE m2_i2 /* my own segment */
#define SCP_GID m2_i3 /* grant id */
#define SCP_OFFSET m2_l1 /* offset within grant */
#define SCP_ADDRESS m2_p1 /* my own address */
/* Grant-based copy functions. */
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);
+ grant_offset, vir_bytes my_address, size_t bytes);
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);
+ grant_offset, vir_bytes my_address, size_t bytes);
int sys_vsafecopy(struct vscp_vec *copyvec, int elements);
int sys_memset(endpoint_t who, unsigned long pattern,
*
* The parameters for this kernel call are:
* SCP_FROM_TO other endpoint
- * SCP_SEG segment in own address space
* SCP_GID grant id
* SCP_OFFSET offset within granted space
* SCP_ADDRESS address in own address space
#define MEM_TOP 0xFFFFFFFFUL
static int safecopy(struct proc *, endpoint_t, endpoint_t,
- cp_grant_id_t, int, int, size_t, vir_bytes, vir_bytes, int);
+ cp_grant_id_t, size_t, vir_bytes, vir_bytes, int);
#define HASGRANTTABLE(gr) \
(priv(gr) && priv(gr)->s_grant_table)
/*===========================================================================*
* safecopy *
*===========================================================================*/
-static int safecopy(caller, granter, grantee, grantid, src_seg, dst_seg, bytes,
+static int safecopy(caller, granter, grantee, grantid, bytes,
g_offset, addr, access)
struct proc * caller;
endpoint_t granter, grantee;
cp_grant_id_t grantid;
-int src_seg, dst_seg;
size_t bytes;
vir_bytes g_offset, addr;
int access; /* CPF_READ for a copy from granter to grantee, CPF_WRITE
granter = new_granter;
/* Now it's a regular copy. */
- v_src.segment = src_seg;
- v_dst.segment = dst_seg;
+ v_src.segment = D;
+ v_dst.segment = D;
v_src.proc_nr_e = *src;
v_dst.proc_nr_e = *dst;
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_SEG, D,
+ (cp_grant_id_t) m_ptr->SCP_GID,
m_ptr->SCP_BYTES, m_ptr->SCP_OFFSET,
(vir_bytes) m_ptr->SCP_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, D, m_ptr->SCP_SEG,
+ (cp_grant_id_t) m_ptr->SCP_GID,
m_ptr->SCP_BYTES, m_ptr->SCP_OFFSET,
(vir_bytes) m_ptr->SCP_ADDRESS, CPF_READ);
}
/* Do safecopy for this element. */
if((r=safecopy(caller, granter, caller->p_endpoint,
- vec[i].v_gid, D, D,
+ vec[i].v_gid,
vec[i].v_bytes, vec[i].v_offset,
vec[i].v_addr, access)) != OK) {
return r;
if(sys_safecopyfrom(m_ptr->m_source,
(vir_bytes)m_ptr->ADDRESS, 0,
- (vir_bytes)io_ctl_buf, len, D) != OK) {
+ (vir_bytes)io_ctl_buf, len) != OK) {
printf("%s:%d: safecopyfrom failed\n", __FILE__, __LINE__);
}
}
/* copy result back to user */
if(sys_safecopyto(m_ptr->m_source, (vir_bytes)m_ptr->ADDRESS, 0,
- (vir_bytes)io_ctl_buf, len, D) != OK) {
+ (vir_bytes)io_ctl_buf, len) != OK) {
printf("%s:%d: safecopyto failed\n", __FILE__, __LINE__);
}
(vir_bytes)subdev->ReviveGrant, 0,
(vir_bytes)subdev->DmaPtr +
subdev->DmaFillNext * subdev->FragSize,
- (phys_bytes)subdev->FragSize, D);
+ (phys_bytes)subdev->FragSize);
subdev->DmaLength += 1;
(vir_bytes)subdev->ReviveGrant, 0,
(vir_bytes)subdev->ExtraBuf +
subdev->BufFillNext * subdev->FragSize,
- (phys_bytes)subdev->FragSize, D);
+ (phys_bytes)subdev->FragSize);
subdev->BufLength += 1;
(vir_bytes)sub_dev_ptr->ReviveGrant,
0, (vir_bytes)sub_dev_ptr->ExtraBuf +
sub_dev_ptr->BufReadNext * sub_dev_ptr->FragSize,
- (phys_bytes)sub_dev_ptr->FragSize, D);
+ (phys_bytes)sub_dev_ptr->FragSize);
/* adjust the buffer status variables */
sub_dev_ptr->BufReadNext =
(vir_bytes)sub_dev_ptr->ReviveGrant, 0,
(vir_bytes)sub_dev_ptr->DmaPtr +
sub_dev_ptr->DmaReadNext * sub_dev_ptr->FragSize,
- (phys_bytes)sub_dev_ptr->FragSize, D);
+ (phys_bytes)sub_dev_ptr->FragSize);
/* adjust the buffer status variables */
sub_dev_ptr->DmaReadNext =
if (nr_req > NR_IOREQS) nr_req = NR_IOREQS;
if (OK != sys_safecopyfrom(mp->m_source, (vir_bytes) mp->BDEV_GRANT,
- 0, (vir_bytes) iovec, nr_req * sizeof(iovec[0]), D)) {
+ 0, (vir_bytes) iovec, nr_req * sizeof(iovec[0]))) {
printf("blockdriver: bad I/O vector by: %d\n", mp->m_source);
return EINVAL;
}
case DIOCSETP:
/* Copy just this one partition table entry. */
r = sys_safecopyfrom(endpt, grant, 0, (vir_bytes) &entry,
- sizeof(entry), D);
+ sizeof(entry));
if (r != OK)
return r;
entry.sectors = 32;
}
- r = sys_safecopyto(endpt, grant, 0, (vir_bytes) &entry, sizeof(entry),
- D);
+ r = sys_safecopyto(endpt, grant, 0, (vir_bytes) &entry, sizeof(entry));
break;
}
/* Copy in the requested size. */
if ((r = sys_safecopyfrom(endpt, grant, 0, (vir_bytes) &size,
- sizeof(size), D)) != OK)
+ sizeof(size))) != OK)
return r;
if (size >= INT_MAX / sizeof(btrace_entry)) return EINVAL;
/* Copy in the request code. */
if ((r = sys_safecopyfrom(endpt, grant, 0, (vir_bytes) &ctl,
- sizeof(ctl), D)) != OK)
+ sizeof(ctl))) != OK)
return r;
/* Start or stop tracing. */
if ((r = sys_safecopyto(endpt, grant, 0,
(vir_bytes) &trace_buf[trace_next],
- entries * sizeof(btrace_entry), D)) != OK)
+ entries * sizeof(btrace_entry))) != OK)
return r;
trace_next += entries;
iovec_size = (phys_bytes) (nr_req * sizeof(iovec[0]));
if (OK != sys_safecopyfrom(mp->m_source, (vir_bytes) mp->IO_GRANT,
- 0, (vir_bytes) iovec, iovec_size, D)) {
+ 0, (vir_bytes) iovec, iovec_size)) {
printf("bad I/O vector by: %d\n", mp->m_source);
return(EINVAL);
}
/* Copy the I/O vector back to the caller. */
if (OK != sys_safecopyto(mp->m_source, (vir_bytes) mp->IO_GRANT,
- 0, (vir_bytes) iovec, iovec_size, D)) {
+ 0, (vir_bytes) iovec, iovec_size)) {
printf("couldn't return I/O vector: %d\n", mp->m_source);
return(EINVAL);
}
/* copy in URB */
res = sys_safecopyfrom(ep, msg->USB_GRANT_ID, 0,
- (vir_bytes) &mx_urb->dev_id, msg->USB_GRANT_SIZE, D);
+ (vir_bytes) &mx_urb->dev_id, msg->USB_GRANT_SIZE);
if (res != 0) {
DEBUG_MSG("sys_safecopyfrom failed ");
/* copy out URB */
res = sys_safecopyto(drv->ep, ctx->gid, 0,
(vir_bytes) ((char*)mx_urb) + sizeof(void*),
- mx_urb->urb_size - sizeof(void*), D);
+ mx_urb->urb_size - sizeof(void*));
if (res != 0) {
DEBUG_MSG("Copy out failed: %d", res);
if(cred_size == sizeof(*credentials)) {
r = sys_safecopyfrom(VFS_PROC_NR, grant2, (vir_bytes) 0,
- (vir_bytes) credentials, cred_size, D);
+ (vir_bytes) credentials, cred_size);
if (r != OK) {
printf("FS: cred copy (regular) failed.\n");
return(r);
} else if(cred_size == sizeof(old_cred)) {
int g;
r = sys_safecopyfrom(VFS_PROC_NR, grant2, (vir_bytes) 0,
- (vir_bytes) &old_cred, sizeof(old_cred), D);
+ (vir_bytes) &old_cred, sizeof(old_cred));
if (r != OK) {
printf("FS: cred copy (fallback) failed.\n");
return(r);
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT, 0,
- (vir_bytes) string, (size_t) len, D);
+ (vir_bytes) string, (size_t) len);
if (r != OK) return(r);
NUL(string, len, sizeof(string));
}
r = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) path, (size_t) copylen, D);
+ (vir_bytes) 0, (vir_bytes) path, (size_t) copylen);
if (r == OK)
fs_m_out.RES_NBYTES = copylen;
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_OLD,
- (vir_bytes) 0, (vir_bytes) pcn_src.pcn_name, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) pcn_src.pcn_name, (size_t) len);
if (r != OK) return(r);
NUL(pcn_src.pcn_name, len, sizeof(pcn_src.pcn_name));
pcn_src.pcn_namelen = len - 1;
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_NEW,
- (vir_bytes) 0, (vir_bytes) pcn_targ.pcn_name, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) pcn_targ.pcn_name, (size_t) len);
if (r != OK) return(r);
NUL(pcn_targ.pcn_name, len, sizeof(pcn_targ.pcn_name));
pcn_targ.pcn_namelen = len - 1;
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) pcn.pcn_name,
- (size_t) len, D);
+ (size_t) len);
if (r != OK) return (r);
NUL(pcn.pcn_name, len, sizeof(pcn.pcn_name));
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) pcn.pcn_name,
- (size_t) len, D);
+ (size_t) len);
if (err_code != OK) return(err_code);
NUL(pcn.pcn_name, len, sizeof(pcn.pcn_name));
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) pcn.pcn_name,
- (size_t) len, D);
+ (size_t) len);
if (err_code != OK) return(err_code);
NUL(pcn.pcn_name, len, sizeof(pcn.pcn_name));
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) pcn.pcn_name,
- (phys_bytes) len, D);
+ (phys_bytes) len);
if (err_code != OK) return(err_code);
NUL(pcn.pcn_name, len, sizeof(pcn.pcn_name));
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) pcn.pcn_name,
- (size_t) len, D);
+ (size_t) len);
if (r != OK) return(r);
NUL(pcn.pcn_name, len, sizeof(pcn.pcn_name));
/* Copy the target path (note that it's not null terminated) */
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT3,
(vir_bytes) 0, (vir_bytes) target,
- (size_t) fs_m_in.REQ_MEM_SIZE, D);
+ (size_t) fs_m_in.REQ_MEM_SIZE);
if (r != OK) return(r);
target[fs_m_in.REQ_MEM_SIZE] = '\0';
/* Copy the pathname and set up caller's user and group id */
r = sys_safecopyfrom(VFS_PROC_NR, grant, /*offset*/ 0,
- (vir_bytes) user_path, (size_t) len, D);
+ (vir_bytes) user_path, (size_t) len);
if (r != OK) return(r);
/* Verify this is a null-terminated path. */
if (len > path_size) return(ENAMETOOLONG);
r1 = sys_safecopyto(VFS_PROC_NR, grant, (vir_bytes) 0,
- (vir_bytes) user_path, (size_t) len, D);
+ (vir_bytes) user_path, (size_t) len);
if (r1 != OK) return(r1);
}
bytes_done = nrbytes - bytes_left;
if (bytes_done) {
r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) 0,
- (vir_bytes) rw_buf, bytes_done, D);
+ (vir_bytes) rw_buf, bytes_done);
update_times(pn, ATIME, 0);
}
} else if (rw_flag == WRITING) {
if (r) return(EINVAL);
r = sys_safecopyfrom(VFS_PROC_NR, gid, (vir_bytes) 0,
- (vir_bytes) rw_buf, nrbytes, D);
+ (vir_bytes) rw_buf, nrbytes);
if (r != OK) return(EINVAL);
if (global_pu->pu_ops.puffs_node_write == NULL)
if (written) {
r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) 0,
- (vir_bytes) getdents_buf, written, D);
+ (vir_bytes) getdents_buf, written);
if (r != OK) return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) &st, (size_t) sizeof(st), D);
+ (vir_bytes) 0, (vir_bytes) &st, (size_t) sizeof(st));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) &statbuf,
- (size_t) sizeof(statbuf), D);
+ (size_t) sizeof(statbuf));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0, (vir_bytes) &st,
- (phys_bytes) sizeof(st), D);
+ (phys_bytes) sizeof(st));
return(r);
}
return EINVAL;
r = sys_safecopyfrom(m_in.m_source, m_in.REQ_GRANT, 0,
- (vir_bytes) buf, len, D);
+ (vir_bytes) buf, len);
if (r != OK)
return r;
}
r = sys_safecopyfrom(m_in.m_source, m_in.REQ_GRANT2, 0,
- (vir_bytes) &ucred, m_in.REQ_UCRED_SIZE, D);
+ (vir_bytes) &ucred, m_in.REQ_UCRED_SIZE);
if (r != OK)
return r;
statfs.f_bsize = BLOCK_SIZE; /* arbitrary block size constant */
return sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, 0,
- (vir_bytes) &statfs, sizeof(statfs), D);
+ (vir_bytes) &statfs, sizeof(statfs));
}
/*===========================================================================*
statvfs.f_namemax = NAME_MAX;
return sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, 0,
- (vir_bytes) &statvfs, sizeof(statvfs), D);
+ (vir_bytes) &statvfs, sizeof(statvfs));
}
chunk = r;
r = sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, off,
- (vir_bytes) ptr, chunk, D);
+ (vir_bytes) ptr, chunk);
if (r != OK)
break;
/* If our own buffer cannot contain the new record, copy out first. */
if (off + len > sizeof(buf)) {
r = sys_safecopyto(m_in.m_source, m_in.REQ_GRANT,
- user_off, (vir_bytes) buf, off, D);
+ user_off, (vir_bytes) buf, off);
if (r != OK) {
put_inode(child);
/* If there is anything left in our own buffer, copy that out now. */
if (off > 0) {
r = sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, user_off,
- (vir_bytes) buf, off, D);
+ (vir_bytes) buf, off);
if (r != OK)
return r;
}
return sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, 0,
- (vir_bytes) &stat, sizeof(stat), D);
+ (vir_bytes) &stat, sizeof(stat));
}
/*===========================================================================*
if (len <= 1) return EINVAL;
if (len > NAME_MAX+1) return ENAMETOOLONG;
- r = sys_safecopyfrom(m_in.m_source, grant, 0, (vir_bytes) name, len, D);
+ r = sys_safecopyfrom(m_in.m_source, grant, 0, (vir_bytes) name, len);
if (r != OK) return r;
if (grantp != NULL) {
r = sys_safecopyfrom(m_in.m_source, *grantp,
- off, (vir_bytes) ptr, chunk, D);
+ off, (vir_bytes) ptr, chunk);
if (r != OK)
break;
size = pos - gcov_buff_sz;
}
- r = sys_safecopyto(VFS_PROC_NR, grant, pos, (vir_bytes)ptr, size, D);
+ r = sys_safecopyto(VFS_PROC_NR, grant, pos, (vir_bytes)ptr, size);
if(r) {
printf("libsys: gcov: safecopy failed (%d)\n", r);
int sys_safecopyfrom(endpoint_t src_e,
cp_grant_id_t gr_id, vir_bytes offset,
- vir_bytes address, size_t bytes,
- int my_seg)
+ vir_bytes address, size_t bytes)
{
/* Transfer a block of data for which the other process has previously
* given permission.
message copy_mess;
copy_mess.SCP_FROM_TO = src_e;
- copy_mess.SCP_SEG = my_seg;
copy_mess.SCP_GID = gr_id;
copy_mess.SCP_OFFSET = (long) offset;
copy_mess.SCP_ADDRESS = (char *) address;
copy_mess.SCP_BYTES = (long) bytes;
+ /* for older kernels that still need the 'seg' field
+ * provide the right value.
+ */
+ copy_mess.SCP_SEG_OBSOLETE = D;
+
return(_kernel_call(SYS_SAFECOPYFROM, ©_mess));
}
int sys_safecopyto(endpoint_t dst_e,
cp_grant_id_t gr_id, vir_bytes offset,
- vir_bytes address, size_t bytes,
- int my_seg)
+ vir_bytes address, size_t bytes)
{
/* Transfer a block of data for which the other process has previously
* given permission.
message copy_mess;
copy_mess.SCP_FROM_TO = dst_e;
- copy_mess.SCP_SEG = my_seg;
copy_mess.SCP_GID = gr_id;
copy_mess.SCP_OFFSET = (long) offset;
copy_mess.SCP_ADDRESS = (char *) address;
copy_mess.SCP_BYTES = (long) bytes;
+ /* for older kernels that still need the 'seg' field
+ * provide the right value.
+ */
+ copy_mess.SCP_SEG_OBSOLETE = D;
+
return(_kernel_call(SYS_SAFECOPYTO, ©_mess));
}
/* Copy out the result. */
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
- (vir_bytes) path, len, D);
+ (vir_bytes) path, len);
if (r != OK) return r;
fs_m_out.RES_NBYTES = len;
return EINVAL;
r = sys_safecopyfrom(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
- (vir_bytes) path, (phys_bytes) len, D);
+ (vir_bytes) path, (phys_bytes) len);
if (r != OK) return r;
if (path[len-1] != 0) return EINVAL;
assert(fs_m_in.REQ_UCRED_SIZE == sizeof(ucred));
r = sys_safecopyfrom(fs_m_in.m_source, fs_m_in.REQ_GRANT2, 0,
- (vir_bytes) &ucred, fs_m_in.REQ_UCRED_SIZE, D);
+ (vir_bytes) &ucred, fs_m_in.REQ_UCRED_SIZE);
if (r != OK)
return r;
if (symloop > 0 && (r == ELEAVEMOUNT || r == ESYMLINK)) {
r2 = sys_safecopyto(fs_m_in.m_source,
fs_m_in.REQ_GRANT, 0, (vir_bytes) path,
- strlen(path) + 1, D);
+ strlen(path) + 1);
if (r2 != OK)
r = r2;
/* Copy the resulting data to user space. */
if (r == OK && len > 0) {
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT,
- 0, (vir_bytes) ptr, len, D);
+ 0, (vir_bytes) ptr, len);
}
} else {
/* Feign an empty file. */
*/
if (off + len > sizeof(buf)) {
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT,
- user_off, (vir_bytes) buf, off, D);
+ user_off, (vir_bytes) buf, off);
if (r != OK) return r;
user_off += off;
/* If there is anything left in our own buffer, copy that out now. */
if (off > 0) {
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT,
- user_off, (vir_bytes) buf, off, D);
+ user_off, (vir_bytes) buf, off);
if (r != OK)
return r;
/* Copy the struct to user space. */
return sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
- (vir_bytes) &statbuf, (phys_bytes) sizeof(statbuf), D);
+ (vir_bytes) &statbuf, (phys_bytes) sizeof(statbuf));
}
/*===========================================================================*
/* Copy the struct to user space. */
return sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
- (vir_bytes) &statfs, (phys_bytes) sizeof(statfs), D);
+ (vir_bytes) &statfs, (phys_bytes) sizeof(statfs));
}
/*===========================================================================*
statvfs.f_namemax = PNAME_MAX;
return sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
- (vir_bytes) &statvfs, sizeof(statvfs), D);
+ (vir_bytes) &statvfs, sizeof(statvfs));
}
}
res = sys_safecopyfrom(ep, msg->DEVMAN_GRANT_ID,
- 0, (vir_bytes) devinf, msg->DEVMAN_GRANT_SIZE, D);
+ 0, (vir_bytes) devinf, msg->DEVMAN_GRANT_SIZE);
if (res != OK) {
res = EINVAL;
/* Copy name from caller. */
r = sys_safecopyfrom(m_ptr->m_source,
(cp_grant_id_t) m_ptr->DS_KEY_GRANT, 0,
- (vir_bytes) key_name, m_ptr->DS_KEY_LEN, D);
+ (vir_bytes) key_name, m_ptr->DS_KEY_LEN);
if(r != OK) {
printf("DS: publish: copy failed from %d: %d\n", m_ptr->m_source, r);
return r;
/* Map all the services in the boot image. */
if((r = sys_safecopyfrom(RS_PROC_NR, info->rproctab_gid, 0,
- (vir_bytes) rprocpub, sizeof(rprocpub), S)) != OK) {
+ (vir_bytes) rprocpub, sizeof(rprocpub))) != OK) {
panic("sys_safecopyfrom failed: %d", r);
}
for(i=0;i < NR_BOOT_PROCS;i++) {
/* Copy the memory range. */
r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->DS_VAL,
- 0, (vir_bytes) dsp->u.mem.data, length, D);
+ 0, (vir_bytes) dsp->u.mem.data, length);
if(r != OK) {
printf("DS: publish: memory map/copy failed from %d: %d\n",
m_ptr->m_source, r);
case DSF_TYPE_MEM:
length = MIN(m_ptr->DS_VAL_LEN, dsp->u.mem.length);
r = sys_safecopyto(m_ptr->m_source, (cp_grant_id_t) m_ptr->DS_VAL, 0,
- (vir_bytes) dsp->u.mem.data, length, D);
+ (vir_bytes) dsp->u.mem.data, length);
if(r != OK) {
printf("DS: retrieve: copy failed to %d: %d\n",
m_ptr->m_source, r);
length = MIN(m_ptr->DS_VAL_LEN, dsp->u.map.length);
r = sys_safecopyto(m_ptr->m_source,
(cp_grant_id_t) m_ptr->DS_VAL, (vir_bytes) 0,
- (vir_bytes) data, length, D);
+ (vir_bytes) data, length);
if(r != OK) {
printf("DS: retrieve: copy failed to %d: %d\n",
m_ptr->m_source, r);
/* Copy the key name. */
r = sys_safecopyto(m_ptr->m_source,
(cp_grant_id_t) m_ptr->DS_KEY_GRANT, (vir_bytes) 0,
- (vir_bytes) dsp->key, strlen(dsp->key) + 1, D);
+ (vir_bytes) dsp->key, strlen(dsp->key) + 1);
if(r != OK) {
printf("DS: copy failed from %d: %d\n", m_ptr->m_source, r);
return r;
/* Copy the key name. */
r = sys_safecopyto(m_ptr->m_source,
(cp_grant_id_t) m_ptr->DS_KEY_GRANT, (vir_bytes) 0,
- (vir_bytes) ds_store[i].key, strlen(ds_store[i].key) + 1, D);
+ (vir_bytes) ds_store[i].key, strlen(ds_store[i].key) + 1);
if(r != OK) {
printf("DS: check: copy failed from %d: %d\n", m_ptr->m_source, r);
return r;
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT, 0,
- (vir_bytes) string, (size_t) len, D);
+ (vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
copylen = min( copylen, (unsigned) rip->i_size);
r = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) link_text,
- (size_t) copylen, D);
+ (size_t) copylen);
put_block(bp, DIRECTORY_BLOCK);
if (r == OK)
fs_m_out.RES_NBYTES = copylen;
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_OLD,
- (vir_bytes) 0, (vir_bytes) old_name, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) old_name, (size_t) len);
if (r != OK) return r;
NUL(old_name, len, sizeof(old_name));
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_NEW,
- (vir_bytes) 0, (vir_bytes) new_name, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) new_name, (size_t) len);
if (r != OK) return r;
NUL(new_name, len, sizeof(new_name));
return(EINVAL);
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, (vir_bytes) 0,
- (vir_bytes) label, label_len, D);
+ (vir_bytes) label, label_len);
if (r != OK) {
printf("ext2: fs_new_driver safecopyfrom failed (%d)\n", r);
return(EINVAL);
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, 0,
- (vir_bytes)fs_dev_label, label_len, D);
+ (vir_bytes)fs_dev_label, label_len);
if (r != OK) {
printf("%s:%d fs_readsuper: safecopyfrom failed: %d\n",
__FILE__, __LINE__, r);
return(ENAMETOOLONG);
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) lastc, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) lastc, (size_t) len);
if (err_code != OK) return err_code;
NUL(lastc, len, sizeof(lastc));
return(ENAMETOOLONG);
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) lastc, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) lastc, (size_t) len);
if (err_code != OK) return err_code;
NUL(lastc, len, sizeof(lastc));
return(ENAMETOOLONG);
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) lastc, (phys_bytes) len, D);
+ (vir_bytes) 0, (vir_bytes) lastc, (phys_bytes) len);
if(err_code != OK) return(err_code);
NUL(lastc, len, sizeof(lastc));
return(ENAMETOOLONG);
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return(r);
NUL(string, len, sizeof(string));
r = sys_safecopyfrom(VFS_PROC_NR,
(cp_grant_id_t) fs_m_in.REQ_GRANT3,
(vir_bytes) 0, (vir_bytes) sip->i_block,
- (vir_bytes) fs_m_in.REQ_MEM_SIZE, D);
+ (vir_bytes) fs_m_in.REQ_MEM_SIZE);
sip->i_dirt = DIRTY;
link_target_buf = (char*) sip->i_block;
} else {
sys_safecopyfrom(VFS_PROC_NR,
(cp_grant_id_t) fs_m_in.REQ_GRANT3,
(vir_bytes) 0, (vir_bytes) bp->b_data,
- (vir_bytes) fs_m_in.REQ_MEM_SIZE, D);
+ (vir_bytes) fs_m_in.REQ_MEM_SIZE);
bp->b_dirt = DIRTY;
link_target_buf = bp->b_data;
} else {
/* Copy the pathname and set up caller's user and group id */
r = sys_safecopyfrom(VFS_PROC_NR, grant, /*offset*/ 0,
- (vir_bytes) user_path, (size_t) len, D);
+ (vir_bytes) user_path, (size_t) len);
if(r != OK) return(r);
/* Verify this is a null-terminated path. */
if(len > path_size) return(ENAMETOOLONG);
r1 = sys_safecopyto(VFS_PROC_NR, grant, (vir_bytes) 0,
- (vir_bytes) user_path, (size_t) len, D);
+ (vir_bytes) user_path, (size_t) len);
if (r1 != OK) return(r1);
}
if (rw_flag == READING) {
/* Copy a chunk from the block buffer to user space. */
r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) buf_off,
- (vir_bytes) (bp->b_data+off), (size_t) chunk, D);
+ (vir_bytes) (bp->b_data+off), (size_t) chunk);
} else {
/* Copy a chunk from user space to the block buffer. */
r = sys_safecopyfrom(VFS_PROC_NR, gid, (vir_bytes) buf_off,
- (vir_bytes) (bp->b_data+off), (size_t) chunk, D);
+ (vir_bytes) (bp->b_data+off), (size_t) chunk);
bp->b_dirt = DIRTY;
}
r = sys_safecopyto(VFS_PROC_NR, gid,
(vir_bytes) userbuf_off,
(vir_bytes) getdents_buf,
- (size_t) tmpbuf_off, D);
+ (size_t) tmpbuf_off);
if (r != OK) {
put_inode(rip);
return(r);
if (tmpbuf_off != 0) {
r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) userbuf_off,
- (vir_bytes) getdents_buf, (size_t) tmpbuf_off, D);
+ (vir_bytes) getdents_buf, (size_t) tmpbuf_off);
if (r != OK) {
put_inode(rip);
return(r);
/* Copy the struct to user space. */
r = sys_safecopyto(who_e, gid, (vir_bytes) 0, (vir_bytes) &statbuf,
- (size_t) sizeof(statbuf), D);
+ (size_t) sizeof(statbuf));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) &st, (size_t) sizeof(st), D);
+ (vir_bytes) 0, (vir_bytes) &st, (size_t) sizeof(st));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0, (vir_bytes) &st,
- (phys_bytes) sizeof(st), D);
+ (phys_bytes) sizeof(st));
return(r);
}
{
r= sys_safecopyfrom(s_cp_req[0].v_from,
s_cp_req[0].v_gid, s_cp_req[0].v_offset,
- s_cp_req[0].v_addr, s_cp_req[0].v_bytes, D);
+ s_cp_req[0].v_addr, s_cp_req[0].v_bytes);
if (r <0)
{
printf("sys_safecopyfrom failed: %d\n", r);
{
r= sys_safecopyto(s_cp_req[0].v_to,
s_cp_req[0].v_gid, s_cp_req[0].v_offset,
- s_cp_req[0].v_addr, s_cp_req[0].v_bytes, D);
+ s_cp_req[0].v_addr, s_cp_req[0].v_bytes);
if (r <0)
{
printf("sys_safecopyto failed: %d\n", r);
return(EINVAL);
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, (vir_bytes) 0,
- (vir_bytes) label, label_len, D);
+ (vir_bytes) label, label_len);
if (r != OK) {
printf("ISOFS: fs_new_driver safecopyfrom failed (%d)\n", r);
return(EINVAL);
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, 0, (vir_bytes)fs_dev_label,
- label_len, D);
+ label_len);
if (r != OK) {
printf("ISOFS %s:%d safecopyfrom failed: %d\n", __FILE__, __LINE__, r);
return(EINVAL);
/* Copy the pathname and set up caller's user and group id */
r = sys_safecopyfrom(VFS_PROC_NR, grant, 0, (vir_bytes) user_path,
- (phys_bytes) len, D);
+ (phys_bytes) len);
if (r != OK) {
printf("ISOFS %s:%d sys_safecopyfrom failed: %d\n",
__FILE__, __LINE__, r);
* and start from the beginning. */
if (tmpbuf_offset + reclen > GETDENTS_BUFSIZ) {
r = sys_safecopyto(VFS_PROC_NR, gid, userbuf_off,
- (vir_bytes)getdents_buf, tmpbuf_offset, D);
+ (vir_bytes)getdents_buf, tmpbuf_offset);
if (r != OK)
panic("fs_getdents: sys_safecopyto failed: %d", r);
if (tmpbuf_offset != 0) {
r = sys_safecopyto(VFS_PROC_NR, gid, userbuf_off,
- (vir_bytes) getdents_buf, tmpbuf_offset, D);
+ (vir_bytes) getdents_buf, tmpbuf_offset);
if (r != OK)
panic("fs_getdents: sys_safecopyto failed: %d", r);
}
r = sys_safecopyto(VFS_PROC_NR, gid, buf_off,
- (vir_bytes) (bp->b_data+off), (phys_bytes) chunk, D);
+ (vir_bytes) (bp->b_data+off), (phys_bytes) chunk);
put_block(bp);
/* Copy the struct to user space. */
r = sys_safecopyto(who_e, gid, 0, (vir_bytes) &statbuf,
- (phys_bytes) sizeof(statbuf), D);
+ (phys_bytes) sizeof(statbuf));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
- (vir_bytes) &st, (phys_bytes) sizeof(st), D);
+ (vir_bytes) &st, (phys_bytes) sizeof(st));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0, (vir_bytes) &st,
- (phys_bytes) sizeof(st), D);
+ (phys_bytes) sizeof(st));
return(r);
}
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
/* Copy the link name's last component */
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
/* Copy the last component */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
bp = get_block(rip->i_dev, b, NORMAL);
r = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
(vir_bytes) 0, (vir_bytes) bp->b_data,
- (size_t) copylen, D);
+ (size_t) copylen);
put_block(bp, DIRECTORY_BLOCK);
if (r == OK)
fs_m_out.RES_NBYTES = copylen;
/* Copy the last component of the old name */
len = min( (unsigned) fs_m_in.REQ_REN_LEN_OLD, sizeof(old_name));
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_OLD,
- (vir_bytes) 0, (vir_bytes) old_name, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) old_name, (size_t) len);
if (r != OK) return r;
NUL(old_name, len, sizeof(old_name));
/* Copy the last component of the new name */
len = min( (unsigned) fs_m_in.REQ_REN_LEN_NEW, sizeof(new_name));
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_REN_GRANT_NEW,
- (vir_bytes) 0, (vir_bytes) new_name, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) new_name, (size_t) len);
if (r != OK) return r;
NUL(new_name, len, sizeof(new_name));
return(EINVAL);
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, (vir_bytes) 0,
- (vir_bytes) label, label_len, D);
+ (vir_bytes) label, label_len);
if (r != OK) {
printf("MFS: fs_new_driver safecopyfrom failed (%d)\n", r);
return(EINVAL);
r = sys_safecopyfrom(fs_m_in.m_source, label_gid, (vir_bytes) 0,
- (vir_bytes) fs_dev_label, label_len, D);
+ (vir_bytes) fs_dev_label, label_len);
if (r != OK) {
printf("MFS %s:%d safecopyfrom failed: %d\n", __FILE__, __LINE__, r);
return(EINVAL);
/* Copy the last component (i.e., file name) */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(lastc));
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) lastc, len, D);
+ (vir_bytes) 0, (vir_bytes) lastc, len);
if (err_code != OK) return err_code;
NUL(lastc, len, sizeof(lastc));
/* Copy the last component and set up caller's user and group id */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(lastc));
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) lastc, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) lastc, (size_t) len);
if (err_code != OK) return err_code;
NUL(lastc, len, sizeof(lastc));
/* Copy the last component and set up caller's user and group id */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(lastc));
err_code = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) lastc, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) lastc, (size_t) len);
if(err_code != OK) return(err_code);
NUL(lastc, len, sizeof(lastc));
/* Copy the link name's last component */
len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) string, (size_t) len, D);
+ (vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return(r);
NUL(string, len, sizeof(string));
r = sys_safecopyfrom(VFS_PROC_NR,
(cp_grant_id_t) fs_m_in.REQ_GRANT3,
(vir_bytes) 0, (vir_bytes) bp->b_data,
- (size_t) fs_m_in.REQ_MEM_SIZE, D);
+ (size_t) fs_m_in.REQ_MEM_SIZE);
if(bp != NULL && r == OK) {
bp->b_data[_MIN_BLOCK_SIZE-1] = '\0';
/* Copy the pathname and set up caller's user and group id */
r = sys_safecopyfrom(VFS_PROC_NR, grant, /*offset*/ (vir_bytes) 0,
- (vir_bytes) user_path, (size_t) len, D);
+ (vir_bytes) user_path, (size_t) len);
if(r != OK) return(r);
/* Verify this is a null-terminated path. */
if(len > path_size) return(ENAMETOOLONG);
r1 = sys_safecopyto(VFS_PROC_NR, grant, (vir_bytes) 0,
- (vir_bytes) user_path, (size_t) len, D);
+ (vir_bytes) user_path, (size_t) len);
if(r1 != OK) return(r1);
}
if (rw_flag == READING) {
/* Copy a chunk from the block buffer to user space. */
r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) buf_off,
- (vir_bytes) (bp->b_data+off), (size_t) chunk, D);
+ (vir_bytes) (bp->b_data+off), (size_t) chunk);
} else if(!block_write_ok(bp)) {
/* Let cache layer veto writing to this block */
printf("MFS: block write not allowed\n");
} else {
/* Copy a chunk from user space to the block buffer. */
r = sys_safecopyfrom(VFS_PROC_NR, gid, (vir_bytes) buf_off,
- (vir_bytes) (bp->b_data+off), (size_t) chunk, D);
+ (vir_bytes) (bp->b_data+off), (size_t) chunk);
MARKDIRTY(bp);
}
r = sys_safecopyto(VFS_PROC_NR, gid,
(vir_bytes) userbuf_off,
(vir_bytes) getdents_buf,
- (size_t) tmpbuf_off, D);
+ (size_t) tmpbuf_off);
if (r != OK) {
put_inode(rip);
return(r);
if(tmpbuf_off != 0) {
r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) userbuf_off,
- (vir_bytes) getdents_buf, (size_t) tmpbuf_off, D);
+ (vir_bytes) getdents_buf, (size_t) tmpbuf_off);
if (r != OK) {
put_inode(rip);
return(r);
/* Copy the struct to user space. */
r = sys_safecopyto(who_e, gid, (vir_bytes) 0, (vir_bytes) &statbuf,
- (size_t) sizeof(statbuf), D);
+ (size_t) sizeof(statbuf));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT,
- (vir_bytes) 0, (vir_bytes) &st, (size_t) sizeof(st), D);
+ (vir_bytes) 0, (vir_bytes) &st, (size_t) sizeof(st));
return(r);
}
/* Copy the struct to user space. */
r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0, (vir_bytes) &st,
- (phys_bytes) sizeof(st), D);
+ (phys_bytes) sizeof(st));
return(r);
}
if (rw_flag == READING) {
/* Copy a chunk from the block buffer to user space. */
r = sys_safecopyto(VFS_PROC_NR, gid, (vir_bytes) 0,
- (vir_bytes) (bp->b_data+position), (size_t) nrbytes, D);
+ (vir_bytes) (bp->b_data+position), (size_t) nrbytes);
} else {
/* Copy a chunk from user space to the block buffer. */
r = sys_safecopyfrom(VFS_PROC_NR, gid, (vir_bytes) 0,
- (vir_bytes) (bp->b_data+position), (size_t) nrbytes, D);
+ (vir_bytes) (bp->b_data+position), (size_t) nrbytes);
}
if (r == OK) {
/* Copy the struct to user space. */
r = sys_safecopyto(who_e, gid, (vir_bytes) 0, (vir_bytes) &statbuf,
- (size_t) sizeof(statbuf), D);
+ (size_t) sizeof(statbuf));
return(r);
}
/* Get the server's address */
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &addr, sizeof(struct sockaddr_un),
- D);
+ (vir_bytes) 0, (vir_bytes) &addr, sizeof(struct sockaddr_un));
if (rc != OK) {
return EIO;
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &addr,
- sizeof(struct sockaddr_un), D);
+ sizeof(struct sockaddr_un));
if (rc != OK) {
return EIO;
* don't allow the backlog to shrink
*/
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &backlog_size, sizeof(int), D);
+ (vir_bytes) 0, (vir_bytes) &backlog_size, sizeof(int));
if (rc != OK) {
return EIO;
/* get the requested type */
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &(uds_fd_table[minor].type),
- sizeof(int), D);
+ sizeof(int));
if (rc != OK) {
}
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &addr, sizeof(struct sockaddr_un),
- D);
+ (vir_bytes) 0, (vir_bytes) &addr, sizeof(struct sockaddr_un));
if (rc != OK) {
return EIO;
*/
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &(uds_fd_table[minor].addr),
- sizeof(struct sockaddr_un), D);
+ sizeof(struct sockaddr_un));
return rc ? EIO : OK;
}
rc = sys_safecopyto(VFS_PROC_NR,
(cp_grant_id_t) dev_m_in->IO_GRANT, (vir_bytes) 0,
(vir_bytes) &(uds_fd_table[peer_minor].addr),
- sizeof(struct sockaddr_un), D);
+ sizeof(struct sockaddr_un));
return rc ? EIO : OK;
} else {
/* get the 'how' parameter from the process */
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &how, sizeof(int), D);
+ (vir_bytes) 0, (vir_bytes) &how, sizeof(int));
if (rc != OK) {
return EIO;
/* third ioctl param is the minor number of the second socket */
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &minorin, sizeof(short), D);
+ (vir_bytes) 0, (vir_bytes) &minorin, sizeof(short));
if (rc != OK) {
return EIO;
/* third ioctl param is the minor number of the second socket */
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &minorin, sizeof(dev_t), D);
+ (vir_bytes) 0, (vir_bytes) &minorin, sizeof(dev_t));
if (rc != OK) {
return EIO;
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &(uds_fd_table[minor].type),
- sizeof(int), D);
+ sizeof(int));
return rc ? EIO : OK;
}
}
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &cred, sizeof(struct ucred), D);
+ (vir_bytes) 0, (vir_bytes) &cred, sizeof(struct ucred));
return rc ? EIO : OK;
}
cred_old.gid = (char) cred.gid;
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &cred_old, sizeof(struct ucred_old),
- D);
+ (vir_bytes) 0, (vir_bytes) &cred_old, sizeof(struct ucred_old));
return rc ? EIO : OK;
}
minor = uds_minor(dev_m_in);
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &(sndbuf),
- sizeof(size_t), D);
+ (vir_bytes) 0, (vir_bytes) &(sndbuf), sizeof(size_t));
return rc ? EIO : OK;
}
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &sndbuf,
- sizeof(size_t), D);
+ sizeof(size_t));
if (rc != OK) {
return EIO;
minor = uds_minor(dev_m_in);
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &(rcvbuf),
- sizeof(size_t), D);
+ (vir_bytes) 0, (vir_bytes) &(rcvbuf), sizeof(size_t));
return rc ? EIO : OK;
}
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &rcvbuf,
- sizeof(size_t), D);
+ sizeof(size_t));
if (rc != OK) {
return EIO;
}
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
- (vir_bytes) 0, (vir_bytes) &addr, sizeof(struct sockaddr_un),
- D);
+ (vir_bytes) 0, (vir_bytes) &addr, sizeof(struct sockaddr_un));
if (rc != OK) {
return EIO;
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &(uds_fd_table[minor].source),
- sizeof(struct sockaddr_un), D);
+ sizeof(struct sockaddr_un));
return rc ? EIO : OK;
}
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &msg_ctrl,
- sizeof(struct msg_control), D);
+ sizeof(struct msg_control));
if (rc != OK) {
return EIO;
*/
rc = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &msg_ctrl,
- sizeof(struct msg_control), D);
+ sizeof(struct msg_control));
if (rc != OK) {
return EIO;
/* send the user the control data */
rc = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) dev_m_in->IO_GRANT,
(vir_bytes) 0, (vir_bytes) &msg_ctrl,
- sizeof(struct msg_control), D);
+ sizeof(struct msg_control));
return rc ? EIO : OK;
}
/* Map all the services in the boot image. */
if ((s = sys_safecopyfrom(RS_PROC_NR, info->rproctab_gid, 0,
- (vir_bytes) rprocpub, sizeof(rprocpub), S)) != OK){
+ (vir_bytes) rprocpub, sizeof(rprocpub))) != OK){
panic("sys_safecopyfrom failed: %d", s);
}
for (i = 0; i < NR_BOOT_PROCS; i++) {
rfp = &(fproc[slot]);
r = sys_safecopyfrom(PFS_PROC_NR, io_gr, (vir_bytes) 0,
- (vir_bytes) canon_path, pathlen, D);
+ (vir_bytes) canon_path, pathlen);
if (r != OK) return(r);
canon_path[pathlen] = '\0';
/* copy canon_path back to PFS */
r = sys_safecopyto(PFS_PROC_NR, (cp_grant_id_t) io_gr, (vir_bytes) 0,
- (vir_bytes) canon_path, pathlen, D);
+ (vir_bytes) canon_path, pathlen);
if (r != OK) return(r);
/* Now do permissions checking */
/* Map all the services in the boot image. */
if((s = sys_safecopyfrom(RS_PROC_NR, info->rproctab_gid, 0,
- (vir_bytes) rprocpub, sizeof(rprocpub), S)) != OK) {
+ (vir_bytes) rprocpub, sizeof(rprocpub))) != OK) {
panic("sys_safecopyfrom failed: %d", s);
}
for(i=0;i < NR_BOOT_PROCS;i++) {
access = m->VTR_ACCESS;
r2 = sys_safecopyfrom(m->m_source, m->VTR_VGRANT, 0, (vir_bytes) vvec,
- sizeof(vvec[0]) * vcount, D);
+ sizeof(vvec[0]) * vcount);
assert(r2 == OK);
r = sys_vumap(m->m_source, vvec, vcount, offset, access, pvec,
if (pcount >= 1 && pcount <= MAPVEC_NR + 3) {
r2 = sys_safecopyto(m->m_source, m->VTR_PGRANT, 0,
- (vir_bytes) pvec, sizeof(pvec[0]) * pcount, D);
+ (vir_bytes) pvec, sizeof(pvec[0]) * pcount);
assert(r2 == OK);
}
/* Timing. */
read_tsc(&high1, &low1);
- r = sys_safecopyfrom(ep_granter, gid, 0, (long)buf, size, D);
+ r = sys_safecopyfrom(ep_granter, gid, 0, (long)buf, size);
read_tsc(&high2, &low2);
if(r != OK) {
printf("REQUESTOR: error in safecopy: %d\n", r);
/* Test COW_SMAP2 (with COW safecopy). */
FIFO_WAIT(fid_get);
buf[0] = BUF_START_REQUESTOR;
- r = sys_safecopyto(ep_granter, gid, 0, (long)buf, size, D);
+ r = sys_safecopyto(ep_granter, gid, 0, (long)buf, size);
if(r != OK) {
printf("REQUESTOR: error in sys_safecopyto: %d\n", r);
return 1;
for(i=0;i<NR_TEST_ITERATIONS;i++) {
read_tsc_64(&start);
r = sys_safecopyfrom(ep_granter, gid, 0, (long)buf,
- nr_pages*CLICK_SIZE, D);
+ nr_pages*CLICK_SIZE);
if(r != OK) {
printf("REQUESTOR: safecopy error: %d\n", r);
return 1;