From 2bfeeed885c45eeccefc55e385dfccd321081ed5 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Sat, 16 Jun 2012 03:46:15 +0200 Subject: [PATCH] drop segment from safecopy invocations . all invocations were S or D, so can safely be dropped to prepare for the segmentless world . still assign D to the SCP_SEG field in the message to make previous kernels usable --- drivers/ahci/ahci.c | 6 ++-- drivers/at_wini/at_wini.c | 6 ++-- drivers/atl2/atl2.c | 12 +++---- drivers/dec21140A/dec21140A.c | 8 ++--- drivers/dp8390/dp8390.c | 16 +++++----- drivers/dpeth/dp.c | 4 +-- drivers/dpeth/netbuff.c | 4 +-- drivers/e1000/e1000.c | 10 +++--- drivers/fbd/rule.c | 9 +++--- drivers/filter/main.c | 12 +++---- drivers/floppy/floppy.c | 6 ++-- drivers/fxp/fxp.c | 10 +++--- drivers/hello/hello.c | 2 +- drivers/lance/lance.c | 12 +++---- drivers/log/log.c | 4 +-- drivers/memory/memory.c | 16 +++++----- drivers/orinoco/orinoco.c | 10 +++--- drivers/pci/main.c | 6 ++-- drivers/pci/pci.c | 2 +- drivers/printer/printer.c | 2 +- drivers/random/main.c | 4 +-- drivers/rtl8139/rtl8139.c | 14 ++++----- drivers/rtl8169/rtl8169.c | 10 +++--- drivers/tty/console.c | 8 ++--- drivers/tty/keyboard.c | 12 +++---- drivers/tty/pty.c | 6 ++-- drivers/tty/rs232.c | 2 +- drivers/tty/tty.c | 18 +++++------ drivers/vbox/hgcm.c | 6 ++-- include/minix/com.h | 2 +- include/minix/syslib.h | 4 +-- kernel/system/do_safecopy.c | 16 +++++----- lib/libaudiodriver/audio_fw.c | 12 +++---- lib/libblockdriver/driver.c | 7 ++--- lib/libblockdriver/trace.c | 6 ++-- lib/libchardriver/chardriver.c | 4 +-- lib/libddekit/src/usb_server.c | 4 +-- lib/libminixfs/fetch_credentials.c | 4 +-- lib/libpuffs/link.c | 10 +++--- lib/libpuffs/open.c | 10 +++--- lib/libpuffs/path.c | 4 +-- lib/libpuffs/read.c | 6 ++-- lib/libpuffs/stadir.c | 6 ++-- lib/libsffs/lookup.c | 4 +-- lib/libsffs/misc.c | 4 +-- lib/libsffs/read.c | 6 ++-- lib/libsffs/stat.c | 2 +- lib/libsffs/util.c | 2 +- lib/libsffs/write.c | 2 +- lib/libsys/gcov.c | 2 +- lib/libsys/sys_safecopy.c | 18 +++++++---- lib/libvtreefs/link.c | 2 +- lib/libvtreefs/path.c | 6 ++-- lib/libvtreefs/read.c | 6 ++-- lib/libvtreefs/stadir.c | 6 ++-- servers/devman/device.c | 2 +- servers/ds/store.c | 14 ++++----- servers/ext2/link.c | 10 +++--- servers/ext2/misc.c | 2 +- servers/ext2/mount.c | 2 +- servers/ext2/open.c | 12 +++---- servers/ext2/path.c | 4 +-- servers/ext2/read.c | 8 ++--- servers/ext2/stadir.c | 6 ++-- servers/inet/sr.c | 4 +-- servers/iso9660fs/misc.c | 2 +- servers/iso9660fs/mount.c | 2 +- servers/iso9660fs/path.c | 2 +- servers/iso9660fs/read.c | 6 ++-- servers/iso9660fs/stadir.c | 6 ++-- servers/mfs/link.c | 10 +++--- servers/mfs/misc.c | 2 +- servers/mfs/mount.c | 2 +- servers/mfs/open.c | 10 +++--- servers/mfs/path.c | 4 +-- servers/mfs/read.c | 8 ++--- servers/mfs/stadir.c | 6 ++-- servers/pfs/read.c | 4 +-- servers/pfs/stadir.c | 2 +- servers/pfs/uds.c | 50 +++++++++++++----------------- servers/vfs/main.c | 2 +- servers/vfs/path.c | 4 +-- servers/vm/main.c | 2 +- test/kernel/sys_vumap/vumaprelay.c | 4 +-- test/safecopy/requestor.c | 2 +- test/safemap/requestor.c | 2 +- test/safeperf/requestor.c | 2 +- 87 files changed, 293 insertions(+), 297 deletions(-) diff --git a/drivers/ahci/ahci.c b/drivers/ahci/ahci.c index 06d2e52cc..b5ef43010 100644 --- a/drivers/ahci/ahci.c +++ b/drivers/ahci/ahci.c @@ -2563,7 +2563,7 @@ static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, 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)) @@ -2576,7 +2576,7 @@ static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, 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); @@ -2589,7 +2589,7 @@ static int ahci_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, return r; return sys_safecopyto(endpt, grant, 0, (vir_bytes) &val, - sizeof(val), D); + sizeof(val)); } return EINVAL; diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index ff9917ffb..312d6a6f8 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -2213,7 +2213,7 @@ static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, switch (request) { case DIOCTIMEOUT: r= sys_safecopyfrom(endpt, grant, 0, (vir_bytes)&timeout, - sizeof(timeout), D); + sizeof(timeout)); if(r != OK) return r; @@ -2244,7 +2244,7 @@ static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, } r= sys_safecopyto(endpt, grant, 0, (vir_bytes)&prev, - sizeof(prev), D); + sizeof(prev)); if(r != OK) return r; @@ -2256,7 +2256,7 @@ static int w_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, 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; diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index c06da5c9b..157121bdc 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -777,7 +777,7 @@ static void atl2_readv(const message *m, int from_int) 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); @@ -786,7 +786,7 @@ static void atl2_readv(const message *m, int from_int) 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); @@ -874,7 +874,7 @@ static void atl2_writev(const message *m, int from_int) 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); @@ -890,7 +890,7 @@ static void atl2_writev(const message *m, int from_int) 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; @@ -898,7 +898,7 @@ static void atl2_writev(const message *m, int from_int) 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); @@ -1051,7 +1051,7 @@ static void atl2_getstat(message *m) 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; diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index 665752fd3..608b1742c 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -178,7 +178,7 @@ static void do_get_stat_s(message * mp) 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; @@ -511,7 +511,7 @@ static void do_vread_s(const message * mp, int from_int) 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; @@ -776,7 +776,7 @@ static void de_get_userdata_s(int user_proc, cp_grant_id_t grant, 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; @@ -840,7 +840,7 @@ static void do_vwrite_s(const message * mp, int from_int){ 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; diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index 80c971bce..6b9c4d8aa 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -1195,7 +1195,7 @@ vir_bytes count; 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); } @@ -1320,7 +1320,7 @@ vir_bytes count; 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); } @@ -1348,7 +1348,7 @@ vir_bytes count; { 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); } @@ -1411,7 +1411,7 @@ vir_bytes count; 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); @@ -1521,7 +1521,7 @@ vir_bytes count; 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); } @@ -1550,7 +1550,7 @@ vir_bytes count; 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", @@ -1774,7 +1774,7 @@ void *loc_addr; 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); } @@ -1791,7 +1791,7 @@ void *loc_addr; 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); } diff --git a/drivers/dpeth/dp.c b/drivers/dpeth/dp.c index 5b3bc0662..240bc0c4b 100644 --- a/drivers/dpeth/dp.c +++ b/drivers/dpeth/dp.c @@ -192,7 +192,7 @@ static void get_userdata_s(int user_proc, cp_grant_id_t grant, 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; } @@ -432,7 +432,7 @@ static void do_getstat_s(const message * mp) 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; diff --git a/drivers/dpeth/netbuff.c b/drivers/dpeth/netbuff.c index 92d67f1be..e190048d3 100644 --- a/drivers/dpeth/netbuff.c +++ b/drivers/dpeth/netbuff.c @@ -119,7 +119,7 @@ void mem2user(dpeth_t *dep, buff_t *rxbuff) /* 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; @@ -149,7 +149,7 @@ void user2mem(dpeth_t *dep, buff_t *txbuff) 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; diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 2220840bb..e0fe93db9 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -615,7 +615,7 @@ int from_int; 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); } @@ -640,7 +640,7 @@ int from_int; 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); } @@ -706,7 +706,7 @@ int from_int; 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); } @@ -741,7 +741,7 @@ int from_int; 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); } @@ -791,7 +791,7 @@ message *mp; 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); diff --git a/drivers/fbd/rule.c b/drivers/fbd/rule.c index 10a174dcc..81ebc6620 100644 --- a/drivers/fbd/rule.c +++ b/drivers/fbd/rule.c @@ -33,8 +33,7 @@ int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) /* 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. */ @@ -45,7 +44,7 @@ int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) 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. @@ -64,7 +63,7 @@ int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) /* 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. @@ -76,7 +75,7 @@ int rule_ctl(int request, endpoint_t endpt, cp_grant_id_t grant) /* 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; diff --git a/drivers/filter/main.c b/drivers/filter/main.c index 81db0f507..d2c966cd8 100644 --- a/drivers/filter/main.c +++ b/drivers/filter/main.c @@ -87,10 +87,10 @@ static int carry(size_t size, int flag_rw) 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); } /*===========================================================================* @@ -111,11 +111,11 @@ static int vcarry(int grants, iovec_t *iov, int flag_rw, size_t 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; @@ -190,7 +190,7 @@ static int do_vrdwt(int flag_rw) /* 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); } @@ -260,7 +260,7 @@ static int do_ioctl(message *m) 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; } diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index e0f9bd64e..51572e55d 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -513,7 +513,7 @@ static ssize_t f_transfer( 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 { @@ -618,7 +618,7 @@ static ssize_t f_transfer( 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 { @@ -644,7 +644,7 @@ static ssize_t f_transfer( 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 { diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 90cff2645..20030c013 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -1012,7 +1012,7 @@ static void fxp_writev_s(const message *mp, int from_int) 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); @@ -1024,7 +1024,7 @@ static void fxp_writev_s(const message *mp, int from_int) } 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); } @@ -1147,7 +1147,7 @@ int from_int; 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); @@ -1161,7 +1161,7 @@ int from_int; } 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); @@ -1447,7 +1447,7 @@ static void fxp_getstat_s(message *mp) 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); diff --git a/drivers/hello/hello.c b/drivers/hello/hello.c index 35700eacb..0dd6a27e4 100644 --- a/drivers/hello/hello.c +++ b/drivers/hello/hello.c @@ -87,7 +87,7 @@ static int hello_transfer(endpoint_t endpt, int opcode, u64_t position, 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; diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index b0531bf91..fc64b0650 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -1012,7 +1012,7 @@ static void do_vread_s(const message *mp) 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; @@ -1130,7 +1130,7 @@ int from_int; 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; @@ -1205,7 +1205,7 @@ vir_bytes 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; @@ -1245,7 +1245,7 @@ vir_bytes count; 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; @@ -1295,7 +1295,7 @@ iovec_dat_t *iovp; (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); } @@ -1313,7 +1313,7 @@ message *mp; 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); diff --git a/drivers/log/log.c b/drivers/log/log.c index 3dbc887b5..44f2d55cf 100644 --- a/drivers/log/log.c +++ b/drivers/log/log.c @@ -159,7 +159,7 @@ subwrite(struct logdevice *log, int count, endpoint_t endpt, } else { if((r=sys_safecopyfrom(endpt, grant, offset, - (vir_bytes)buf, count, D)) != OK) + (vir_bytes)buf, count)) != OK) return r; } @@ -263,7 +263,7 @@ subread(struct logdevice *log, int count, endpoint_t endpt, 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); diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index 5daa46ab4..ff76595ed 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -278,10 +278,10 @@ static int m_transfer( 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); @@ -339,10 +339,10 @@ static int m_transfer( 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; @@ -358,7 +358,7 @@ static int m_transfer( 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; @@ -480,10 +480,10 @@ static int m_block_transfer( 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); @@ -582,7 +582,7 @@ static int m_block_ioctl(dev_t minor, unsigned int request, endpoint_t endpt, /* 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))) { diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index 2df330bf0..06f260c29 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -1210,7 +1210,7 @@ static void or_writev_s (message * mp, int from_int) { 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); @@ -1221,7 +1221,7 @@ static void or_writev_s (message * mp, int from_int) { } 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); @@ -1601,7 +1601,7 @@ static void or_readv_s (message * mp, int from_int) 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); @@ -1612,7 +1612,7 @@ static void or_readv_s (message * mp, int from_int) 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); @@ -1779,7 +1779,7 @@ static void or_getstat_s (message * mp) { 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); } diff --git a/drivers/pci/main.c b/drivers/pci/main.c index d93ecb965..44fd49a59 100644 --- a/drivers/pci/main.c +++ b/drivers/pci/main.c @@ -247,7 +247,7 @@ message *mp; 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; @@ -283,7 +283,7 @@ message *mp; 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; @@ -322,7 +322,7 @@ message *mp; 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"); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 86a311dad..d753faf36 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -178,7 +178,7 @@ int sef_cb_init_fresh(int type, sef_init_info_t *info) /* 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++) { diff --git a/drivers/printer/printer.c b/drivers/printer/printer.c index 107cedd22..5ab2a9491 100644 --- a/drivers/printer/printer.c +++ b/drivers/printer/printer.c @@ -412,7 +412,7 @@ static void prepare_output() 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; diff --git a/drivers/random/main.c b/drivers/random/main.c index ff9c8649a..f2a65db8c 100644 --- a/drivers/random/main.c +++ b/drivers/random/main.c @@ -173,7 +173,7 @@ static int r_transfer( 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, " @@ -182,7 +182,7 @@ static int r_transfer( } } 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, " diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index 100312b01..aef58df33 100644 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -869,7 +869,7 @@ static void rl_readv_s(const message *mp, int from_int) 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); @@ -902,14 +902,14 @@ static void rl_readv_s(const message *mp, int from_int) 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); } @@ -918,7 +918,7 @@ static void rl_readv_s(const message *mp, int from_int) { 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); } @@ -1033,7 +1033,7 @@ static void rl_writev_s(const message *mp, int from_int) 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); } @@ -1045,7 +1045,7 @@ static void rl_writev_s(const message *mp, int from_int) 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); } @@ -1529,7 +1529,7 @@ message *mp; 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); diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index 20abcfbe6..5ef8ae419 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -1221,7 +1221,7 @@ readvs_loop: 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); } @@ -1234,7 +1234,7 @@ readvs_loop: } 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); @@ -1357,7 +1357,7 @@ static void rl_writev_s(const message *mp, int from_int) 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); } @@ -1368,7 +1368,7 @@ static void rl_writev_s(const message *mp, int from_int) 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); } @@ -1519,7 +1519,7 @@ message *mp; 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); diff --git a/drivers/tty/console.c b/drivers/tty/console.c index 5726d0a4c..05971f634 100644 --- a/drivers/tty/console.c +++ b/drivers/tty/console.c @@ -172,7 +172,7 @@ int try; 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; @@ -813,7 +813,7 @@ void do_video(message *m) 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) { @@ -834,7 +834,7 @@ void do_video(message *m) 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 { @@ -1204,7 +1204,7 @@ message *m; 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; } diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index 534f3e337..c66d244fd 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -265,7 +265,7 @@ message *m; 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; @@ -292,7 +292,7 @@ message *m; for (i= 0; iCOUNT; 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); @@ -330,7 +330,7 @@ message *m; 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; @@ -365,7 +365,7 @@ message *m; 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; @@ -412,7 +412,7 @@ message *m; 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; @@ -1060,7 +1060,7 @@ message *m; { /* 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)); } /*===========================================================================* diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 6adb2af8d..9d718214b 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -243,7 +243,7 @@ static int pty_write(tty_t *tp, int try) /* 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; } @@ -320,7 +320,7 @@ static void pty_start(pty_t *pp) /* 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; @@ -389,7 +389,7 @@ static int pty_read(tty_t *tp, int try) /* 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; } diff --git a/drivers/tty/rs232.c b/drivers/tty/rs232.c index 6ee1a65ea..f9b586301 100644 --- a/drivers/tty/rs232.c +++ b/drivers/tty/rs232.c @@ -249,7 +249,7 @@ static int rs_write(register tty_t *tp, int try) /* 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); diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index 67396b51c..d5f3696a1 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -607,7 +607,7 @@ message *m_ptr; /* pointer to message sent to task */ 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: @@ -628,14 +628,14 @@ message *m_ptr; /* pointer to message sent to task */ 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; @@ -647,7 +647,7 @@ message *m_ptr; /* pointer to message sent to task */ 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: @@ -672,12 +672,12 @@ message *m_ptr; /* pointer to message sent to task */ 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; @@ -928,7 +928,7 @@ register tty_t *tp; /* pointer to terminal to read from */ 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; @@ -951,7 +951,7 @@ register tty_t *tp; /* pointer to terminal to read from */ 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; } @@ -1393,7 +1393,7 @@ tty_t *tp; 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; diff --git a/drivers/vbox/hgcm.c b/drivers/vbox/hgcm.c index 19b0ab63a..2955fe5a3 100644 --- a/drivers/vbox/hgcm.c +++ b/drivers/vbox/hgcm.c @@ -288,7 +288,7 @@ static int finish_req(int conn, int req, int *code) 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)); } } @@ -372,7 +372,7 @@ static int do_open(message *m_ptr, int ipc_status, int *code) 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); @@ -576,7 +576,7 @@ static int do_call(message *m_ptr, int ipc_status, int *code) 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; } diff --git a/include/minix/com.h b/include/minix/com.h index 3170accb8..ef9ad8f27 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -559,7 +559,7 @@ /* 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 */ diff --git a/include/minix/syslib.h b/include/minix/syslib.h index b427cd8cc..4635669ee 100644 --- a/include/minix/syslib.h +++ b/include/minix/syslib.h @@ -148,9 +148,9 @@ int sys_physcopy(endpoint_t src_proc, int src_seg, vir_bytes src_vir, /* 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, diff --git a/kernel/system/do_safecopy.c b/kernel/system/do_safecopy.c index 59b1b5b4e..3812afc41 100644 --- a/kernel/system/do_safecopy.c +++ b/kernel/system/do_safecopy.c @@ -3,7 +3,6 @@ * * 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 @@ -24,7 +23,7 @@ #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) @@ -226,12 +225,11 @@ endpoint_t *e_granter; /* new granter (magic grants) */ /*===========================================================================* * 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 @@ -279,8 +277,8 @@ 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; @@ -347,7 +345,7 @@ int access; /* CPF_READ for a copy from granter to grantee, CPF_WRITE 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); } @@ -358,7 +356,7 @@ int do_safecopy_to(struct proc * caller, message * m_ptr) 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); } @@ -406,7 +404,7 @@ int do_vsafecopy(struct proc * caller, message * m_ptr) /* 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; diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index 499832693..88d248094 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -475,7 +475,7 @@ static int msg_ioctl(const message *m_ptr) 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__); } } @@ -488,7 +488,7 @@ static int msg_ioctl(const message *m_ptr) /* 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__); } @@ -794,7 +794,7 @@ static void data_from_user(sub_dev_t *subdev) (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; @@ -807,7 +807,7 @@ static void data_from_user(sub_dev_t *subdev) (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; @@ -861,7 +861,7 @@ static void data_to_user(sub_dev_t *sub_dev_ptr) (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 = @@ -874,7 +874,7 @@ static void data_to_user(sub_dev_t *sub_dev_ptr) (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 = diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index df32ad900..479c20dbf 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -230,7 +230,7 @@ static int do_vrdwt(struct blockdriver *bdp, message *mp, thread_id_t id) 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; } @@ -269,7 +269,7 @@ static int do_dioctl(struct blockdriver *bdp, dev_t minor, 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; @@ -295,8 +295,7 @@ static int do_dioctl(struct blockdriver *bdp, dev_t minor, 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; } diff --git a/lib/libblockdriver/trace.c b/lib/libblockdriver/trace.c index 036609c65..bf80cc836 100644 --- a/lib/libblockdriver/trace.c +++ b/lib/libblockdriver/trace.c @@ -63,7 +63,7 @@ int trace_ctl(dev_t minor, unsigned int request, endpoint_t endpt, /* 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; @@ -103,7 +103,7 @@ int trace_ctl(dev_t minor, unsigned int request, endpoint_t endpt, /* 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. */ @@ -150,7 +150,7 @@ int trace_ctl(dev_t minor, unsigned int request, endpoint_t endpt, 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; diff --git a/lib/libchardriver/chardriver.c b/lib/libchardriver/chardriver.c index 2669ec04a..a3db9a00b 100644 --- a/lib/libchardriver/chardriver.c +++ b/lib/libchardriver/chardriver.c @@ -280,7 +280,7 @@ static int do_vrdwt(struct chardriver *cdp, message *mp) 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); } @@ -296,7 +296,7 @@ static int do_vrdwt(struct chardriver *cdp, message *mp) /* 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); } diff --git a/lib/libddekit/src/usb_server.c b/lib/libddekit/src/usb_server.c index 67059587d..1a0389b5c 100644 --- a/lib/libddekit/src/usb_server.c +++ b/lib/libddekit/src/usb_server.c @@ -317,7 +317,7 @@ static void submit_urb(message *msg) /* 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 "); @@ -474,7 +474,7 @@ static void completion_callback(void *priv) /* 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); diff --git a/lib/libminixfs/fetch_credentials.c b/lib/libminixfs/fetch_credentials.c index a1247c78c..3c5a62d42 100644 --- a/lib/libminixfs/fetch_credentials.c +++ b/lib/libminixfs/fetch_credentials.c @@ -17,7 +17,7 @@ int fs_lookup_credentials(vfs_ucred_t *credentials, 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); @@ -25,7 +25,7 @@ int fs_lookup_credentials(vfs_ucred_t *credentials, } 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); diff --git a/lib/libpuffs/link.c b/lib/libpuffs/link.c index e63599fcc..e797f2102 100644 --- a/lib/libpuffs/link.c +++ b/lib/libpuffs/link.c @@ -90,7 +90,7 @@ int fs_link() 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)); @@ -182,7 +182,7 @@ int fs_rdlink() } 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; @@ -219,7 +219,7 @@ int fs_rename() 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; @@ -230,7 +230,7 @@ int fs_rename() 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; @@ -415,7 +415,7 @@ int fs_unlink() 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)); diff --git a/lib/libpuffs/open.c b/lib/libpuffs/open.c index c9a64bcca..d520ac973 100644 --- a/lib/libpuffs/open.c +++ b/lib/libpuffs/open.c @@ -48,7 +48,7 @@ int fs_create() 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)); @@ -140,7 +140,7 @@ int fs_mknod() 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)); @@ -223,7 +223,7 @@ int fs_mkdir() 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)); @@ -307,14 +307,14 @@ int fs_slink() 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'; diff --git a/lib/libpuffs/path.c b/lib/libpuffs/path.c index e4a2fd855..bac1a1d04 100644 --- a/lib/libpuffs/path.c +++ b/lib/libpuffs/path.c @@ -57,7 +57,7 @@ int fs_lookup() /* 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. */ @@ -85,7 +85,7 @@ int fs_lookup() 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); } diff --git a/lib/libpuffs/read.c b/lib/libpuffs/read.c index 6f39e3d2e..10d83f5f0 100644 --- a/lib/libpuffs/read.c +++ b/lib/libpuffs/read.c @@ -67,7 +67,7 @@ int fs_readwrite(void) 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) { @@ -85,7 +85,7 @@ int fs_readwrite(void) 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) @@ -165,7 +165,7 @@ int fs_getdents(void) 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); } diff --git a/lib/libpuffs/stadir.c b/lib/libpuffs/stadir.c index 2dbd4ce08..ddf9acf9b 100644 --- a/lib/libpuffs/stadir.c +++ b/lib/libpuffs/stadir.c @@ -30,7 +30,7 @@ int fs_fstatfs() /* 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); } @@ -88,7 +88,7 @@ int fs_stat() /* 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); } @@ -115,7 +115,7 @@ int fs_statvfs() /* 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); } diff --git a/lib/libsffs/lookup.c b/lib/libsffs/lookup.c index e964f2730..b94b6a0fd 100644 --- a/lib/libsffs/lookup.c +++ b/lib/libsffs/lookup.c @@ -215,7 +215,7 @@ int do_lookup() 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; @@ -237,7 +237,7 @@ int do_lookup() } 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; diff --git a/lib/libsffs/misc.c b/lib/libsffs/misc.c index 54e203b3b..fe48d84cf 100644 --- a/lib/libsffs/misc.c +++ b/lib/libsffs/misc.c @@ -25,7 +25,7 @@ int do_fstatfs() 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)); } /*===========================================================================* @@ -74,5 +74,5 @@ int do_statvfs() 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)); } diff --git a/lib/libsffs/read.c b/lib/libsffs/read.c index a8ddf0812..e34bd28d2 100644 --- a/lib/libsffs/read.c +++ b/lib/libsffs/read.c @@ -54,7 +54,7 @@ int do_read() 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; @@ -190,7 +190,7 @@ int do_getdents() /* 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); @@ -218,7 +218,7 @@ int do_getdents() /* 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; diff --git a/lib/libsffs/stat.c b/lib/libsffs/stat.c index a3351d71e..dbac80867 100644 --- a/lib/libsffs/stat.c +++ b/lib/libsffs/stat.c @@ -97,7 +97,7 @@ int do_stat() } return sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, 0, - (vir_bytes) &stat, sizeof(stat), D); + (vir_bytes) &stat, sizeof(stat)); } /*===========================================================================* diff --git a/lib/libsffs/util.c b/lib/libsffs/util.c index 3664dbc36..653741691 100644 --- a/lib/libsffs/util.c +++ b/lib/libsffs/util.c @@ -27,7 +27,7 @@ char name[NAME_MAX+1]; /* buffer in which store the result */ 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; diff --git a/lib/libsffs/write.c b/lib/libsffs/write.c index 91000d1fe..bf70038a7 100644 --- a/lib/libsffs/write.c +++ b/lib/libsffs/write.c @@ -50,7 +50,7 @@ cp_grant_id_t *grantp; 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; diff --git a/lib/libsys/gcov.c b/lib/libsys/gcov.c index ab5eb8cc4..bb9b4a8d5 100644 --- a/lib/libsys/gcov.c +++ b/lib/libsys/gcov.c @@ -31,7 +31,7 @@ static void add_buff(void *ptr, int size) 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); diff --git a/lib/libsys/sys_safecopy.c b/lib/libsys/sys_safecopy.c index 0f569f518..bc2b6f781 100644 --- a/lib/libsys/sys_safecopy.c +++ b/lib/libsys/sys_safecopy.c @@ -5,8 +5,7 @@ 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. @@ -15,20 +14,23 @@ int sys_safecopyfrom(endpoint_t src_e, 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. @@ -37,12 +39,16 @@ int sys_safecopyto(endpoint_t dst_e, 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)); } diff --git a/lib/libvtreefs/link.c b/lib/libvtreefs/link.c index 39aa2ed3e..5835eb0f9 100644 --- a/lib/libvtreefs/link.c +++ b/lib/libvtreefs/link.c @@ -33,7 +33,7 @@ int fs_rdlink(void) /* 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; diff --git a/lib/libvtreefs/path.c b/lib/libvtreefs/path.c index ef8f3a272..f2db11792 100644 --- a/lib/libvtreefs/path.c +++ b/lib/libvtreefs/path.c @@ -166,7 +166,7 @@ int fs_lookup(void) 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; @@ -176,7 +176,7 @@ int fs_lookup(void) 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; @@ -286,7 +286,7 @@ int fs_lookup(void) 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; diff --git a/lib/libvtreefs/read.c b/lib/libvtreefs/read.c index 5e264d83d..86512885d 100644 --- a/lib/libvtreefs/read.c +++ b/lib/libvtreefs/read.c @@ -50,7 +50,7 @@ int fs_read(void) /* 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. */ @@ -179,7 +179,7 @@ int fs_getdents(void) */ 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; @@ -200,7 +200,7 @@ int fs_getdents(void) /* 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; diff --git a/lib/libvtreefs/stadir.c b/lib/libvtreefs/stadir.c index 2317ff8ca..c2f9a1e50 100644 --- a/lib/libvtreefs/stadir.c +++ b/lib/libvtreefs/stadir.c @@ -52,7 +52,7 @@ int fs_stat(void) /* 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)); } /*===========================================================================* @@ -68,7 +68,7 @@ int fs_fstatfs(void) /* 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)); } /*===========================================================================* @@ -87,5 +87,5 @@ int fs_statvfs(void) 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)); } diff --git a/servers/devman/device.c b/servers/devman/device.c index 596d2c812..6f9b525ee 100644 --- a/servers/devman/device.c +++ b/servers/devman/device.c @@ -244,7 +244,7 @@ int do_add_device(message *msg) } 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; diff --git a/servers/ds/store.c b/servers/ds/store.c index 79c58c7f5..6e2de1974 100644 --- a/servers/ds/store.c +++ b/servers/ds/store.c @@ -155,7 +155,7 @@ static int get_key_name(const message *m_ptr, char *key_name) /* 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; @@ -268,7 +268,7 @@ int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) /* 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++) { @@ -353,7 +353,7 @@ int do_publish(message *m_ptr) /* 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); @@ -432,7 +432,7 @@ int do_retrieve(message *m_ptr) 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); @@ -471,7 +471,7 @@ int do_retrieve(message *m_ptr) 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); @@ -505,7 +505,7 @@ int do_retrieve_label(const message *m_ptr) /* 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; @@ -620,7 +620,7 @@ int do_check(message *m_ptr) /* 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; diff --git a/servers/ext2/link.c b/servers/ext2/link.c index 9f741aa1d..b593306b0 100644 --- a/servers/ext2/link.c +++ b/servers/ext2/link.c @@ -46,7 +46,7 @@ int fs_link() 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)); @@ -134,7 +134,7 @@ int fs_unlink() 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)); @@ -218,7 +218,7 @@ int fs_rdlink() 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; @@ -323,7 +323,7 @@ int fs_rename() 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)); @@ -333,7 +333,7 @@ int fs_rename() 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)); diff --git a/servers/ext2/misc.c b/servers/ext2/misc.c index be3dc0e37..ffc6341f7 100644 --- a/servers/ext2/misc.c +++ b/servers/ext2/misc.c @@ -84,7 +84,7 @@ int fs_new_driver(void) 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); diff --git a/servers/ext2/mount.c b/servers/ext2/mount.c index 2952d33f6..e5daa22c2 100644 --- a/servers/ext2/mount.c +++ b/servers/ext2/mount.c @@ -43,7 +43,7 @@ int fs_readsuper() 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); diff --git a/servers/ext2/open.c b/servers/ext2/open.c index 8c873973d..fc65e7595 100644 --- a/servers/ext2/open.c +++ b/servers/ext2/open.c @@ -40,7 +40,7 @@ int fs_create() 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)); @@ -90,7 +90,7 @@ int fs_mknod() 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)); @@ -128,7 +128,7 @@ int fs_mkdir() 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)); @@ -203,7 +203,7 @@ int fs_slink() 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)); @@ -225,7 +225,7 @@ int fs_slink() 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 { @@ -233,7 +233,7 @@ int fs_slink() 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 { diff --git a/servers/ext2/path.c b/servers/ext2/path.c index 5c8b167a8..5b063e247 100644 --- a/servers/ext2/path.c +++ b/servers/ext2/path.c @@ -56,7 +56,7 @@ int fs_lookup() /* 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. */ @@ -83,7 +83,7 @@ int fs_lookup() 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); } diff --git a/servers/ext2/read.c b/servers/ext2/read.c index 337f87fb5..587239008 100644 --- a/servers/ext2/read.c +++ b/servers/ext2/read.c @@ -272,11 +272,11 @@ int *completed; /* number of bytes copied */ 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; } @@ -624,7 +624,7 @@ int fs_getdents(void) 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); @@ -661,7 +661,7 @@ int fs_getdents(void) 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); diff --git a/servers/ext2/stadir.c b/servers/ext2/stadir.c index 85f727b14..135e06628 100644 --- a/servers/ext2/stadir.c +++ b/servers/ext2/stadir.c @@ -54,7 +54,7 @@ static int stat_inode( /* 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); } @@ -76,7 +76,7 @@ int fs_fstatfs() /* 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); } @@ -124,7 +124,7 @@ int fs_statvfs() /* 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); } diff --git a/servers/inet/sr.c b/servers/inet/sr.c index 2b16845bf..e6c6178d8 100644 --- a/servers/inet/sr.c +++ b/servers/inet/sr.c @@ -897,7 +897,7 @@ int size; { 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); @@ -961,7 +961,7 @@ vir_bytes offset; { 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); diff --git a/servers/iso9660fs/misc.c b/servers/iso9660fs/misc.c index dffef64c0..7c7c9eb91 100644 --- a/servers/iso9660fs/misc.c +++ b/servers/iso9660fs/misc.c @@ -34,7 +34,7 @@ int fs_new_driver(void) 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); diff --git a/servers/iso9660fs/mount.c b/servers/iso9660fs/mount.c index 911a9cc98..f1db6db75 100644 --- a/servers/iso9660fs/mount.c +++ b/servers/iso9660fs/mount.c @@ -24,7 +24,7 @@ int fs_readsuper() { 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); diff --git a/servers/iso9660fs/path.c b/servers/iso9660fs/path.c index 71df671f3..cd4c4c0b9 100644 --- a/servers/iso9660fs/path.c +++ b/servers/iso9660fs/path.c @@ -34,7 +34,7 @@ int fs_lookup() { /* 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); diff --git a/servers/iso9660fs/read.c b/servers/iso9660fs/read.c index 4d49cef9c..c0bf7fe6f 100644 --- a/servers/iso9660fs/read.c +++ b/servers/iso9660fs/read.c @@ -228,7 +228,7 @@ int fs_getdents(void) { * 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); @@ -262,7 +262,7 @@ int fs_getdents(void) { 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); @@ -326,7 +326,7 @@ int *completed; /* number of bytes copied */ } 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); diff --git a/servers/iso9660fs/stadir.c b/servers/iso9660fs/stadir.c index eb933ea26..b7903f544 100644 --- a/servers/iso9660fs/stadir.c +++ b/servers/iso9660fs/stadir.c @@ -69,7 +69,7 @@ static int stat_dir_record( /* 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); } @@ -105,7 +105,7 @@ int fs_fstatfs() /* 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); } @@ -134,7 +134,7 @@ int fs_statvfs() /* 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); } diff --git a/servers/mfs/link.c b/servers/mfs/link.c index 47f6325a4..707ccb03e 100644 --- a/servers/mfs/link.c +++ b/servers/mfs/link.c @@ -41,7 +41,7 @@ int fs_link() 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)); @@ -123,7 +123,7 @@ int fs_unlink() /* 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)); @@ -196,7 +196,7 @@ int fs_rdlink() 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; @@ -298,14 +298,14 @@ int fs_rename() /* 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)); diff --git a/servers/mfs/misc.c b/servers/mfs/misc.c index 12880dfd5..8bf355969 100644 --- a/servers/mfs/misc.c +++ b/servers/mfs/misc.c @@ -72,7 +72,7 @@ int fs_new_driver(void) 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); diff --git a/servers/mfs/mount.c b/servers/mfs/mount.c index 43916e394..2352660f7 100644 --- a/servers/mfs/mount.c +++ b/servers/mfs/mount.c @@ -34,7 +34,7 @@ int fs_readsuper() 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); diff --git a/servers/mfs/open.c b/servers/mfs/open.c index a3144dc61..d3a4084f5 100644 --- a/servers/mfs/open.c +++ b/servers/mfs/open.c @@ -32,7 +32,7 @@ int fs_create() /* 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)); @@ -79,7 +79,7 @@ int fs_mknod() /* 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)); @@ -114,7 +114,7 @@ int fs_mkdir() /* 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)); @@ -184,7 +184,7 @@ int fs_slink() /* 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)); @@ -206,7 +206,7 @@ int fs_slink() 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'; diff --git a/servers/mfs/path.c b/servers/mfs/path.c index f3e03fd5d..73a080aff 100644 --- a/servers/mfs/path.c +++ b/servers/mfs/path.c @@ -56,7 +56,7 @@ int fs_lookup() /* 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. */ @@ -83,7 +83,7 @@ int fs_lookup() 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); } diff --git a/servers/mfs/read.c b/servers/mfs/read.c index cbf70b804..dc2ebd2b2 100644 --- a/servers/mfs/read.c +++ b/servers/mfs/read.c @@ -280,7 +280,7 @@ int *completed; /* number of bytes copied */ 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"); @@ -288,7 +288,7 @@ int *completed; /* number of bytes copied */ } 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); } @@ -613,7 +613,7 @@ int fs_getdents(void) 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); @@ -651,7 +651,7 @@ int fs_getdents(void) 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); diff --git a/servers/mfs/stadir.c b/servers/mfs/stadir.c index 6d3d2371a..24ec94e2a 100644 --- a/servers/mfs/stadir.c +++ b/servers/mfs/stadir.c @@ -80,7 +80,7 @@ static int stat_inode( /* 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); } @@ -101,7 +101,7 @@ int fs_fstatfs() /* 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); } @@ -135,7 +135,7 @@ int fs_statvfs() /* 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); } diff --git a/servers/pfs/read.c b/servers/pfs/read.c index 3c12e291e..691c0fddc 100644 --- a/servers/pfs/read.c +++ b/servers/pfs/read.c @@ -52,11 +52,11 @@ int fs_readwrite(message *fs_m_in, message *fs_m_out) 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) { diff --git a/servers/pfs/stadir.c b/servers/pfs/stadir.c index e594c3f0d..6a9fa37db 100644 --- a/servers/pfs/stadir.c +++ b/servers/pfs/stadir.c @@ -48,7 +48,7 @@ static int stat_inode( /* 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); } diff --git a/servers/pfs/uds.c b/servers/pfs/uds.c index 42cc01563..a8a4fc46d 100644 --- a/servers/pfs/uds.c +++ b/servers/pfs/uds.c @@ -303,8 +303,7 @@ int do_accept(message *dev_m_in, message *dev_m_out) /* 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; @@ -424,7 +423,7 @@ int do_connect(message *dev_m_in, message *dev_m_out) 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; @@ -594,7 +593,7 @@ int do_listen(message *dev_m_in, message *dev_m_out) * 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; @@ -658,7 +657,7 @@ int do_socket(message *dev_m_in, message *dev_m_out) /* 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) { @@ -713,8 +712,7 @@ int do_bind(message *dev_m_in, message *dev_m_out) } 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; @@ -777,7 +775,7 @@ int do_getsockname(message *dev_m_in, message *dev_m_out) */ 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; } @@ -805,7 +803,7 @@ int do_getpeername(message *dev_m_in, message *dev_m_out) 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 { @@ -850,7 +848,7 @@ int do_shutdown(message *dev_m_in, message *dev_m_out) /* 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; @@ -900,7 +898,7 @@ int do_socketpair_old(message *dev_m_in, message *dev_m_out) /* 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; @@ -947,7 +945,7 @@ int do_socketpair(message *dev_m_in, message *dev_m_out) /* 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; @@ -999,7 +997,7 @@ int do_getsockopt_sotype(message *dev_m_in, message *dev_m_out) 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; } @@ -1040,7 +1038,7 @@ int do_getsockopt_peercred(message *dev_m_in, message *dev_m_out) } 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; } @@ -1087,8 +1085,7 @@ int do_getsockopt_peercred_old(message *dev_m_in, message *dev_m_out) 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; } @@ -1108,8 +1105,7 @@ int do_getsockopt_sndbuf(message *dev_m_in, message *dev_m_out) 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; } @@ -1131,7 +1127,7 @@ int do_setsockopt_sndbuf(message *dev_m_in, message *dev_m_out) 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; @@ -1163,8 +1159,7 @@ int do_getsockopt_rcvbuf(message *dev_m_in, message *dev_m_out) 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; } @@ -1186,7 +1181,7 @@ int do_setsockopt_rcvbuf(message *dev_m_in, message *dev_m_out) 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; @@ -1224,8 +1219,7 @@ int do_sendto(message *dev_m_in, message *dev_m_out) } 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; @@ -1263,7 +1257,7 @@ int do_recvfrom(message *dev_m_in, message *dev_m_out) 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; } @@ -1491,7 +1485,7 @@ int do_sendmsg(message *dev_m_in, message *dev_m_out) 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; @@ -1580,7 +1574,7 @@ int do_recvmsg(message *dev_m_in, message *dev_m_out) */ 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; @@ -1617,7 +1611,7 @@ int do_recvmsg(message *dev_m_in, message *dev_m_out) /* 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; } diff --git a/servers/vfs/main.c b/servers/vfs/main.c index 8a319176f..04858e8a3 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -539,7 +539,7 @@ static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) /* 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++) { diff --git a/servers/vfs/path.c b/servers/vfs/path.c index 6e8c2f8df..386fae80c 100644 --- a/servers/vfs/path.c +++ b/servers/vfs/path.c @@ -748,7 +748,7 @@ size_t pathlen; 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'; @@ -760,7 +760,7 @@ size_t pathlen; /* 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 */ diff --git a/servers/vm/main.c b/servers/vm/main.c index 487f1eb4e..9acc02b0c 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -381,7 +381,7 @@ static int sef_cb_init_fresh(int type, sef_init_info_t *info) /* 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++) { diff --git a/test/kernel/sys_vumap/vumaprelay.c b/test/kernel/sys_vumap/vumaprelay.c index a69cf9c92..9702dc1ce 100644 --- a/test/kernel/sys_vumap/vumaprelay.c +++ b/test/kernel/sys_vumap/vumaprelay.c @@ -19,7 +19,7 @@ static int do_request(message *m) 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, @@ -27,7 +27,7 @@ static int do_request(message *m) 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); } diff --git a/test/safecopy/requestor.c b/test/safecopy/requestor.c index 7f4750847..4c1ef9b68 100644 --- a/test/safecopy/requestor.c +++ b/test/safecopy/requestor.c @@ -17,7 +17,7 @@ int test(size_t size) /* 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); diff --git a/test/safemap/requestor.c b/test/safemap/requestor.c index a82300ed2..e4159bed7 100644 --- a/test/safemap/requestor.c +++ b/test/safemap/requestor.c @@ -126,7 +126,7 @@ int main(int argc, char **argv) /* 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; diff --git a/test/safeperf/requestor.c b/test/safeperf/requestor.c index 8b193ee5d..bbb9642c7 100644 --- a/test/safeperf/requestor.c +++ b/test/safeperf/requestor.c @@ -136,7 +136,7 @@ int main(int argc, char **argv) for(i=0;i