summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-02-10 21:56:08 +0000
committermiod <miod@openbsd.org>2015-02-10 21:56:08 +0000
commit081bf72016fd7473d333d95c915b1e43ca17cbc2 (patch)
treeb73603c37a30960dcf8c02fec717a11e3621e769
parentIn iwm(4), don't reinvent the standard rate set tables. (diff)
downloadwireguard-openbsd-081bf72016fd7473d333d95c915b1e43ca17cbc2.tar.xz
wireguard-openbsd-081bf72016fd7473d333d95c915b1e43ca17cbc2.zip
First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
-rw-r--r--share/man/man9/Makefile4
-rw-r--r--share/man/man9/uiomove.919
-rw-r--r--sys/arch/alpha/alpha/mem.c8
-rw-r--r--sys/arch/amd64/amd64/mem.c8
-rw-r--r--sys/arch/amd64/amd64/nvram.c4
-rw-r--r--sys/arch/arm/arm/mem.c8
-rw-r--r--sys/arch/aviion/dev/nvram.c4
-rw-r--r--sys/arch/aviion/dev/vme.c4
-rw-r--r--sys/arch/hppa/dev/mem.c8
-rw-r--r--sys/arch/hppa64/dev/mem.c8
-rw-r--r--sys/arch/i386/i386/mem.c8
-rw-r--r--sys/arch/i386/i386/nvram.c4
-rw-r--r--sys/arch/i386/isa/joy.c4
-rw-r--r--sys/arch/luna88k/dev/lcd.c4
-rw-r--r--sys/arch/m88k/m88k/mem.c8
-rw-r--r--sys/arch/macppc/macppc/mem.c8
-rw-r--r--sys/arch/mips64/mips64/mem.c8
-rw-r--r--sys/arch/sh/sh/mem.c10
-rw-r--r--sys/arch/socppc/socppc/mem.c8
-rw-r--r--sys/arch/solbourne/solbourne/mem.c8
-rw-r--r--sys/arch/sparc/dev/bpp.c4
-rw-r--r--sys/arch/sparc/dev/flash.c4
-rw-r--r--sys/arch/sparc/dev/magma.c6
-rw-r--r--sys/arch/sparc/sparc/clock.c4
-rw-r--r--sys/arch/sparc/sparc/mem.c8
-rw-r--r--sys/arch/sparc64/dev/vldcp.c6
-rw-r--r--sys/arch/sparc64/sparc64/mem.c8
-rw-r--r--sys/arch/sparc64/sparc64/openprom.c4
-rw-r--r--sys/arch/vax/vax/mem.c8
-rw-r--r--sys/dev/audio.c8
-rw-r--r--sys/dev/hotplug.c4
-rw-r--r--sys/dev/ic/lpt.c4
-rw-r--r--sys/dev/isa/spkr.c4
-rw-r--r--sys/dev/ksyms.c4
-rw-r--r--sys/dev/midi.c6
-rw-r--r--sys/dev/pci/bktr/bktr_core.c10
-rw-r--r--sys/dev/pci/drm/drm_drv.c4
-rw-r--r--sys/dev/rnd.c6
-rw-r--r--sys/dev/sbus/bpp.c4
-rw-r--r--sys/dev/sbus/magma.c6
-rw-r--r--sys/dev/systrace.c4
-rw-r--r--sys/dev/usb/ugen.c18
-rw-r--r--sys/dev/usb/uhid.c8
-rw-r--r--sys/dev/usb/ulpt.c4
-rw-r--r--sys/dev/usb/usb.c8
-rw-r--r--sys/dev/video.c4
-rw-r--r--sys/dev/wscons/wsevent.c6
-rw-r--r--sys/isofs/cd9660/cd9660_vnops.c8
-rw-r--r--sys/isofs/udf/udf_vnops.c6
-rw-r--r--sys/kern/kern_subr.c13
-rw-r--r--sys/kern/spec_vnops.c6
-rw-r--r--sys/kern/subr_log.c4
-rw-r--r--sys/kern/sys_pipe.c8
-rw-r--r--sys/kern/tty.c4
-rw-r--r--sys/kern/tty_pty.c10
-rw-r--r--sys/kern/uipc_socket.c8
-rw-r--r--sys/miscfs/fuse/fuse_device.c8
-rw-r--r--sys/miscfs/fuse/fuse_vnops.c10
-rw-r--r--sys/msdosfs/msdosfs_vnops.c10
-rw-r--r--sys/net/bpf.c6
-rw-r--r--sys/net/if_pppx.c6
-rw-r--r--sys/net/if_tun.c6
-rw-r--r--sys/net/ppp_tty.c6
-rw-r--r--sys/nfs/nfs_bio.c6
-rw-r--r--sys/nfs/nfs_subs.c4
-rw-r--r--sys/nfs/nfs_vnops.c4
-rw-r--r--sys/ntfs/ntfs_subr.c16
-rw-r--r--sys/ntfs/ntfs_vnops.c8
-rw-r--r--sys/sys/systm.h5
-rw-r--r--sys/tmpfs/tmpfs_subr.c10
-rw-r--r--sys/tmpfs/tmpfs_vnops.c4
-rw-r--r--sys/ufs/ext2fs/ext2fs_lookup.c4
-rw-r--r--sys/ufs/ext2fs/ext2fs_readwrite.c8
-rw-r--r--sys/ufs/ext2fs/ext2fs_vnops.c4
-rw-r--r--sys/ufs/ffs/ffs_vnops.c6
-rw-r--r--sys/ufs/ufs/ufs_vnops.c6
-rw-r--r--sys/uvm/uvm_io.c4
77 files changed, 269 insertions, 248 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 906f4cf57f4..74d7cdd5a2a 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.229 2015/02/07 23:54:24 dlg Exp $
+# $OpenBSD: Makefile,v 1.230 2015/02/10 21:56:08 miod Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -392,7 +392,7 @@ MLINKS+=timeout.9 timeout_add.9 timeout.9 timeout_set.9 \
MLINKS+=tsleep.9 wakeup.9 tsleep.9 wakeup_n.9 tsleep.9 wakeup_one.9 \
tsleep.9 msleep.9
MLINKS+=tvtohz.9 tstohz.9
-MLINKS+=uiomove.9 uio.9
+MLINKS+=uiomove.9 uio.9 uiomove.9 uiomovei.9
MLINKS+=usbd_transfer.9 usbd_setup_xfer.9
MLINKS+=uvm.9 uvm_init.9 uvm.9 uvm_init_limits.9 uvm.9 uvm_setpagesize.9 \
uvm.9 uvm_swap_init.9 uvm.9 uvm_map.9 uvm.9 uvm_map_pageable.9 \
diff --git a/share/man/man9/uiomove.9 b/share/man/man9/uiomove.9
index 58514105cad..8c257d6b7d7 100644
--- a/share/man/man9/uiomove.9
+++ b/share/man/man9/uiomove.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: uiomove.9,v 1.14 2014/01/21 03:15:46 schwarze Exp $
+.\" $OpenBSD: uiomove.9,v 1.15 2015/02/10 21:56:08 miod Exp $
.\" $NetBSD: uiomove.9,v 1.6 2001/12/26 00:16:30 wiz Exp $
.\"
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: January 21 2014 $
+.Dd $Mdocdate: February 10 2015 $
.Dt UIOMOVE 9
.Os
.Sh NAME
@@ -34,7 +34,9 @@
.Sh SYNOPSIS
.In sys/systm.h
.Ft int
-.Fn uiomove "void *buf" "int n" "struct uio *uio"
+.Fn uiomove "void *buf" "size_t n" "struct uio *uio"
+.Ft int
+.Fn uiomovei "void *buf" "int n" "struct uio *uio"
.Sh DESCRIPTION
The
.Nm
@@ -130,8 +132,17 @@ to point that much farther into the region described.
This allows multiple calls to
.Nm
to easily be used to fill or drain the region of data.
+.Pp
+The
+.Nm uiomovei
+function is a similar to
+.Nm uiomove ,
+but uses a signed integer as the byte count.
+It is a temporary legacy interface and should not be used in new code.
.Sh RETURN VALUES
.Nm
-returns 0 on success or EFAULT if a bad address is encountered.
+and
+.Nm uiomovei
+return 0 on success or EFAULT if a bad address is encountered.
.Sh SEE ALSO
.Xr copy 9
diff --git a/sys/arch/alpha/alpha/mem.c b/sys/arch/alpha/alpha/mem.c
index c701e98f652..fee7d80a976 100644
--- a/sys/arch/alpha/alpha/mem.c
+++ b/sys/arch/alpha/alpha/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.25 2010/12/26 15:40:58 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.26 2015/02/10 21:56:08 miod Exp $ */
/* $NetBSD: mem.c,v 1.26 2000/03/29 03:48:20 simonb Exp $ */
/*
@@ -163,7 +163,7 @@ kmemphys:
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(PAGE_SIZE - o));
error =
- uiomove((caddr_t)ALPHA_PHYS_TO_K0SEG(v), c, uio);
+ uiomovei((caddr_t)ALPHA_PHYS_TO_K0SEG(v), c, uio);
break;
/* minor device 1 is kernel memory */
@@ -179,7 +179,7 @@ kmemphys:
if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
break;
/* minor device 2 is EOF/rathole */
@@ -202,7 +202,7 @@ kmemphys:
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
break;
default:
diff --git a/sys/arch/amd64/amd64/mem.c b/sys/arch/amd64/amd64/mem.c
index dbe092847c1..12169e65a87 100644
--- a/sys/arch/amd64/amd64/mem.c
+++ b/sys/arch/amd64/amd64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.20 2014/12/15 01:53:45 tedu Exp $ */
+/* $OpenBSD: mem.c,v 1.21 2015/02/10 21:56:08 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -141,7 +141,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
/* minor device 0 is physical memory */
case 0:
v = PMAP_DIRECT_MAP(uio->uio_offset);
- error = uiomove((caddr_t)v, uio->uio_resid, uio);
+ error = uiomovei((caddr_t)v, uio->uio_resid, uio);
continue;
/* minor device 1 is kernel memory */
@@ -156,7 +156,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) &&
(v < PMAP_DIRECT_BASE && v > PMAP_DIRECT_END))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -175,7 +175,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
zeropage = (caddr_t)
malloc(PAGE_SIZE, M_TEMP, M_WAITOK|M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/arch/amd64/amd64/nvram.c b/sys/arch/amd64/amd64/nvram.c
index 4fba49dde93..9795fa0a1b7 100644
--- a/sys/arch/amd64/amd64/nvram.c
+++ b/sys/arch/amd64/amd64/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.1 2007/08/02 16:40:27 deraadt Exp $ */
+/* $OpenBSD: nvram.c,v 1.2 2015/02/10 21:56:08 miod Exp $ */
/*
* Copyright (c) 2004 Joshua Stein <jcs@openbsd.org>
@@ -115,7 +115,7 @@ nvramread(dev_t dev, struct uio *uio, int flags)
printf("nvramread read %d bytes (%s)\n", (tmp - buf), tmp);
#endif
- ret = uiomove((caddr_t)buf, (tmp - buf), uio);
+ ret = uiomovei((caddr_t)buf, (tmp - buf), uio);
uio->uio_offset += uio->uio_resid;
diff --git a/sys/arch/arm/arm/mem.c b/sys/arch/arm/arm/mem.c
index 56c6b25e153..4b2d73aba7a 100644
--- a/sys/arch/arm/arm/mem.c
+++ b/sys/arch/arm/arm/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.11 2014/11/16 12:30:56 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.12 2015/02/10 21:56:08 miod Exp $ */
/* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */
/*
@@ -190,7 +190,7 @@ mmrw(dev, uio, flags)
pmap_update(pmap_kernel());
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(PAGE_SIZE - o));
- error = uiomove((caddr_t)memhook + o, c, uio);
+ error = uiomovei((caddr_t)memhook + o, c, uio);
pmap_remove(pmap_kernel(), (vaddr_t)memhook,
(vaddr_t)memhook + PAGE_SIZE);
pmap_update(pmap_kernel());
@@ -202,7 +202,7 @@ mmrw(dev, uio, flags)
if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
break;
case DEV_NULL:
@@ -219,7 +219,7 @@ mmrw(dev, uio, flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
break;
default:
diff --git a/sys/arch/aviion/dev/nvram.c b/sys/arch/aviion/dev/nvram.c
index 7a09b00805e..d98c6806f8c 100644
--- a/sys/arch/aviion/dev/nvram.c
+++ b/sys/arch/aviion/dev/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.9 2014/05/08 22:17:33 miod Exp $ */
+/* $OpenBSD: nvram.c,v 1.10 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -473,7 +473,7 @@ nvramrw(caddr_t base, int len, struct uio *uio, int flags)
c = len - v; /* till end of dev */
if (c == 0)
return (0);
- error = uiomove(base + v, c, uio);
+ error = uiomovei(base + v, c, uio);
}
return (error);
}
diff --git a/sys/arch/aviion/dev/vme.c b/sys/arch/aviion/dev/vme.c
index 8384063675d..2f9b0f1f6b9 100644
--- a/sys/arch/aviion/dev/vme.c
+++ b/sys/arch/aviion/dev/vme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.c,v 1.16 2014/12/24 22:48:27 miod Exp $ */
+/* $OpenBSD: vme.c,v 1.17 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2006, 2007, 2010 Miodrag Vallat.
*
@@ -954,7 +954,7 @@ vmerw(struct vme_softc *sc, int awidth, int dwidth, struct uio *uio, int flags)
break;
/* XXX wrap this because of dwidth */
- rc = uiomove((caddr_t)vmepg + delta, len, uio);
+ rc = uiomovei((caddr_t)vmepg + delta, len, uio);
/* inline vme_unmap */
pmap_kremove(vmepg, PAGE_SIZE);
diff --git a/sys/arch/hppa/dev/mem.c b/sys/arch/hppa/dev/mem.c
index 282b31cd505..fb15c42ea2f 100644
--- a/sys/arch/hppa/dev/mem.c
+++ b/sys/arch/hppa/dev/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.34 2014/04/08 09:34:22 mpi Exp $ */
+/* $OpenBSD: mem.c,v 1.35 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -359,7 +359,7 @@ mmrw(dev, uio, flags)
}
c = ptoa(physmem) - v;
c = min(c, uio->uio_resid);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
break;
case 1: /* /dev/kmem */
@@ -372,7 +372,7 @@ mmrw(dev, uio, flags)
/* this will break us out of the loop */
continue;
}
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
break;
case 2: /* /dev/null */
@@ -394,7 +394,7 @@ mmrw(dev, uio, flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
break;
default:
diff --git a/sys/arch/hppa64/dev/mem.c b/sys/arch/hppa64/dev/mem.c
index 930fb6b3af6..03a9d300537 100644
--- a/sys/arch/hppa64/dev/mem.c
+++ b/sys/arch/hppa64/dev/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.7 2014/04/08 09:34:23 mpi Exp $ */
+/* $OpenBSD: mem.c,v 1.8 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -193,7 +193,7 @@ mmrw(dev, uio, flags)
}
c = ptoa(physmem) - v;
c = min(c, uio->uio_resid);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
break;
case 1: /* /dev/kmem */
@@ -206,7 +206,7 @@ mmrw(dev, uio, flags)
/* this will break us out of the loop */
continue;
}
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
break;
case 2: /* /dev/null */
@@ -228,7 +228,7 @@ mmrw(dev, uio, flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
break;
default:
diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c
index 6ad77648966..d56003743c0 100644
--- a/sys/arch/i386/i386/mem.c
+++ b/sys/arch/i386/i386/mem.c
@@ -1,5 +1,5 @@
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.41 2014/11/16 12:30:57 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.42 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -151,7 +151,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
pmap_update(pmap_kernel());
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
- error = uiomove((caddr_t)vmmap + o, c, uio);
+ error = uiomovei((caddr_t)vmmap + o, c, uio);
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
(vaddr_t)vmmap + NBPG);
pmap_update(pmap_kernel());
@@ -164,7 +164,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -184,7 +184,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
M_WAITOK|M_ZERO);
}
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/arch/i386/i386/nvram.c b/sys/arch/i386/i386/nvram.c
index d943a2c7d16..1061e50ecd3 100644
--- a/sys/arch/i386/i386/nvram.c
+++ b/sys/arch/i386/i386/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.3 2004/11/11 08:28:28 jcs Exp $ */
+/* $OpenBSD: nvram.c,v 1.4 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2004 Joshua Stein <jcs@openbsd.org>
@@ -115,7 +115,7 @@ nvramread(dev_t dev, struct uio *uio, int flags)
printf("nvramread read %d bytes (%s)\n", (tmp - buf), tmp);
#endif
- ret = uiomove((caddr_t)buf, (tmp - buf), uio);
+ ret = uiomovei((caddr_t)buf, (tmp - buf), uio);
uio->uio_offset += uio->uio_resid;
diff --git a/sys/arch/i386/isa/joy.c b/sys/arch/i386/isa/joy.c
index cd1f8b97911..91bbf514cde 100644
--- a/sys/arch/i386/isa/joy.c
+++ b/sys/arch/i386/isa/joy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: joy.c,v 1.13 2007/08/01 13:18:18 martin Exp $ */
+/* $OpenBSD: joy.c,v 1.14 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: joy.c,v 1.3 1996/05/05 19:46:15 christos Exp $ */
/*-
@@ -123,7 +123,7 @@ joyread(dev_t dev, struct uio *uio, int flag)
state >>= 4;
c.b1 = ~state & 1;
c.b2 = ~(state >> 1) & 1;
- return uiomove((caddr_t) & c, sizeof(struct joystick), uio);
+ return uiomovei((caddr_t) & c, sizeof(struct joystick), uio);
}
int
diff --git a/sys/arch/luna88k/dev/lcd.c b/sys/arch/luna88k/dev/lcd.c
index 5beb5aea07f..3fd535a7a44 100644
--- a/sys/arch/luna88k/dev/lcd.c
+++ b/sys/arch/luna88k/dev/lcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcd.c,v 1.5 2014/06/07 11:55:35 aoyama Exp $ */
+/* $OpenBSD: lcd.c,v 1.6 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: lcd.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $ */
/*-
@@ -172,7 +172,7 @@ lcdwrite(dev_t dev, struct uio *uio, int flag)
return EIO;
while (n > 0) {
- error = uiomove(buf, n, uio);
+ error = uiomovei(buf, n, uio);
if (error)
return EIO;
n = uio->uio_resid;
diff --git a/sys/arch/m88k/m88k/mem.c b/sys/arch/m88k/m88k/mem.c
index b7996efda73..10f608b0c8d 100644
--- a/sys/arch/m88k/m88k/mem.c
+++ b/sys/arch/m88k/m88k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.1 2010/12/31 21:38:08 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.2 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -111,7 +111,7 @@ mmrw(dev, uio, flags)
/* minor device 0 is physical memory */
case 0:
v = uio->uio_offset;
- error = uiomove((caddr_t)v, uio->uio_resid, uio);
+ error = uiomovei((caddr_t)v, uio->uio_resid, uio);
continue;
/* minor device 1 is kernel memory */
@@ -126,7 +126,7 @@ mmrw(dev, uio, flags)
} else if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -145,7 +145,7 @@ mmrw(dev, uio, flags)
zpage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zpage, c, uio);
+ error = uiomovei(zpage, c, uio);
continue;
default:
diff --git a/sys/arch/macppc/macppc/mem.c b/sys/arch/macppc/macppc/mem.c
index f9a80edba21..9edbb3982a9 100644
--- a/sys/arch/macppc/macppc/mem.c
+++ b/sys/arch/macppc/macppc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.18 2014/07/12 18:44:42 tedu Exp $ */
+/* $OpenBSD: mem.c,v 1.19 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -254,14 +254,14 @@ mmrw(dev_t dev, struct uio *uio, int flags)
c = uio->uio_resid;
/* This doesn't allow device mapping! XXX */
pmap_real_memory(&v, &c);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 1 is kernel memory */
case 1:
v = uio->uio_offset;
c = min(iov->iov_len, MAXPHYS);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -282,7 +282,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/arch/mips64/mips64/mem.c b/sys/arch/mips64/mips64/mem.c
index 885f392c626..d342d43ad6b 100644
--- a/sys/arch/mips64/mips64/mem.c
+++ b/sys/arch/mips64/mips64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.18 2013/05/09 19:45:19 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.19 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -119,7 +119,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
if (v + c < v || v + c > ptoa((psize_t)physmem))
return (EFAULT);
v = (vaddr_t)PHYS_TO_XKPHYS(v, CCA_NONCOHERENT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 1 is kernel memory */
@@ -147,7 +147,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
uio->uio_rw == UIO_READ ? B_READ : B_WRITE);
if (allowed) {
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
} else {
return (EFAULT);
@@ -169,7 +169,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = ulmin(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/arch/sh/sh/mem.c b/sys/arch/sh/sh/mem.c
index 85a4e37e673..7aa2fea8bc7 100644
--- a/sys/arch/sh/sh/mem.c
+++ b/sys/arch/sh/sh/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 2010/12/26 15:41:00 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.5 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: mem.c,v 1.21 2006/07/23 22:06:07 ad Exp $ */
/*
@@ -153,7 +153,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
if (__mm_mem_addr(v)) {
o = v & PGOFSET;
c = min(uio->uio_resid, (int)(PAGE_SIZE - o));
- error = uiomove((caddr_t)SH3_PHYS_TO_P1SEG(v),
+ error = uiomovei((caddr_t)SH3_PHYS_TO_P1SEG(v),
c, uio);
} else {
return (EFAULT);
@@ -171,7 +171,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
return (EFAULT);
*/
c = min(iov->iov_len, MAXPHYS);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
} else if (v < SH3_P3SEG_BASE) /* P2 */
return (EFAULT);
else { /* P3 */
@@ -179,7 +179,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
if (!uvm_kernacc((void *)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
}
break;
@@ -197,7 +197,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
break;
default:
diff --git a/sys/arch/socppc/socppc/mem.c b/sys/arch/socppc/socppc/mem.c
index a99549460d4..f82a8f55cae 100644
--- a/sys/arch/socppc/socppc/mem.c
+++ b/sys/arch/socppc/socppc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.2 2008/11/05 06:32:47 matthieu Exp $ */
+/* $OpenBSD: mem.c,v 1.3 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -121,14 +121,14 @@ mmrw(dev_t dev, struct uio *uio, int flags)
c = uio->uio_resid;
/* This doesn't allow device mapping! XXX */
pmap_real_memory(&v, &c);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 1 is kernel memory */
case 1:
v = uio->uio_offset;
c = min(iov->iov_len, MAXPHYS);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -149,7 +149,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/arch/solbourne/solbourne/mem.c b/sys/arch/solbourne/solbourne/mem.c
index cda1296247b..ebf518a5463 100644
--- a/sys/arch/solbourne/solbourne/mem.c
+++ b/sys/arch/solbourne/solbourne/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.3 2014/11/16 12:30:58 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.4 2015/02/10 21:56:09 miod Exp $ */
/* OpenBSD: mem.c,v 1.21 2003/06/02 23:27:55 millert Exp */
/*
@@ -144,7 +144,7 @@ mmrw(dev, uio, flags)
pmap_update(pmap_kernel());
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
- error = uiomove((caddr_t)mem_page + o, c, uio);
+ error = uiomovei((caddr_t)mem_page + o, c, uio);
pmap_remove(pmap_kernel(), mem_page, mem_page + NBPG);
pmap_update(pmap_kernel());
continue;
@@ -166,7 +166,7 @@ mmrw(dev, uio, flags)
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
}
- error = uiomove((caddr_t)va, c, uio);
+ error = uiomovei((caddr_t)va, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -187,7 +187,7 @@ mmrw(dev, uio, flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/arch/sparc/dev/bpp.c b/sys/arch/sparc/dev/bpp.c
index 242f4bd1292..f4648d1d721 100644
--- a/sys/arch/sparc/dev/bpp.c
+++ b/sys/arch/sparc/dev/bpp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpp.c,v 1.5 2010/08/06 00:00:38 miod Exp $ */
+/* $OpenBSD: bpp.c,v 1.6 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 1997, Jason Downs. All rights reserved.
@@ -273,7 +273,7 @@ bppwrite(dev, uio, flags)
int error = 0;
while ((n = min(BPP_BSIZE, uio->uio_resid)) != 0) {
- error = uiomove(bpp->sc_cp = bpp->sc_inbuf->b_data, n, uio);
+ error = uiomovei(bpp->sc_cp = bpp->sc_inbuf->b_data, n, uio);
if (error != 0)
return error;
bpp->sc_count = n;
diff --git a/sys/arch/sparc/dev/flash.c b/sys/arch/sparc/dev/flash.c
index 769d21450a9..7fafa69ad92 100644
--- a/sys/arch/sparc/dev/flash.c
+++ b/sys/arch/sparc/dev/flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flash.c,v 1.5 2006/03/15 20:03:06 miod Exp $ */
+/* $OpenBSD: flash.c,v 1.6 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -181,7 +181,7 @@ flashrw(dev, uio, flags)
if (cnt > (FLASH_REGS_SIZE - off))
cnt = FLASH_REGS_SIZE - off;
- return (uiomove(&sc->sc_regs->regs[0] + off, cnt, uio));
+ return (uiomovei(&sc->sc_regs->regs[0] + off, cnt, uio));
}
int
diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c
index dd09f1b8a0e..d512402fd7b 100644
--- a/sys/arch/sparc/dev/magma.c
+++ b/sys/arch/sparc/dev/magma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magma.c,v 1.28 2014/07/12 18:44:43 tedu Exp $ */
+/* $OpenBSD: magma.c,v 1.29 2015/02/10 21:56:09 miod Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
@@ -1675,7 +1675,7 @@ mbpp_rw(dev, uio)
ptr = buffer;
if (uio->uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, uio);
+ error = uiomovei(ptr, len, uio);
if (error)
break;
}
@@ -1695,7 +1695,7 @@ again: /* goto bad */
if (uio->uio_rw == UIO_READ) {
if (cnt) {
- error = uiomove(ptr, cnt, uio);
+ error = uiomovei(ptr, cnt, uio);
if (error)
break;
gotdata++;
diff --git a/sys/arch/sparc/sparc/clock.c b/sys/arch/sparc/sparc/clock.c
index d958101459f..2eb2703e002 100644
--- a/sys/arch/sparc/sparc/clock.c
+++ b/sys/arch/sparc/sparc/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.30 2014/11/16 12:30:58 deraadt Exp $ */
+/* $OpenBSD: clock.c,v 1.31 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: clock.c,v 1.52 1997/05/24 20:16:05 pk Exp $ */
/*
@@ -1118,7 +1118,7 @@ eeprom_uio(uio)
for (bcnt = 0; bcnt < EEPROM_SIZE; ++bcnt)
*(char *)(buf + bcnt) = *(char *)(eeprom_va + bcnt);
- if ((error = uiomove(buf + off, (int)cnt, uio)) != 0)
+ if ((error = uiomovei(buf + off, (int)cnt, uio)) != 0)
goto out;
if (uio->uio_rw != UIO_READ)
diff --git a/sys/arch/sparc/sparc/mem.c b/sys/arch/sparc/sparc/mem.c
index a2b3b0c2b14..2a11bfa3ac9 100644
--- a/sys/arch/sparc/sparc/mem.c
+++ b/sys/arch/sparc/sparc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.23 2014/11/16 12:30:58 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.24 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: mem.c,v 1.13 1996/03/30 21:12:16 christos Exp $ */
/*
@@ -145,7 +145,7 @@ mmrw(dev, uio, flags)
pmap_update(pmap_kernel());
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
- error = uiomove((caddr_t)mem_page + o, c, uio);
+ error = uiomovei((caddr_t)mem_page + o, c, uio);
pmap_remove(pmap_kernel(), mem_page, mem_page + NBPG);
pmap_update(pmap_kernel());
continue;
@@ -165,7 +165,7 @@ mmrw(dev, uio, flags)
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
}
- error = uiomove((caddr_t)va, c, uio);
+ error = uiomovei((caddr_t)va, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -197,7 +197,7 @@ mmrw(dev, uio, flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/arch/sparc64/dev/vldcp.c b/sys/arch/sparc64/dev/vldcp.c
index ef63a813dcc..617dad20ea4 100644
--- a/sys/arch/sparc64/dev/vldcp.c
+++ b/sys/arch/sparc64/dev/vldcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vldcp.c,v 1.10 2015/01/25 21:42:13 kettenis Exp $ */
+/* $OpenBSD: vldcp.c,v 1.11 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2009, 2012 Mark Kettenis
*
@@ -391,7 +391,7 @@ retry:
}
splx(s);
- ret = uiomove(lc->lc_rxq->lq_va + rx_head, 64, uio);
+ ret = uiomovei(lc->lc_rxq->lq_va + rx_head, 64, uio);
rx_head += 64;
rx_head &= ((lc->lc_rxq->lq_nentries * 64) - 1);
@@ -457,7 +457,7 @@ retry:
}
splx(s);
- ret = uiomove(lc->lc_txq->lq_va + tx_tail, 64, uio);
+ ret = uiomovei(lc->lc_txq->lq_va + tx_tail, 64, uio);
err = hv_ldc_tx_set_qtail(lc->lc_id, next_tx_tail);
if (err != H_EOK) {
diff --git a/sys/arch/sparc64/sparc64/mem.c b/sys/arch/sparc64/sparc64/mem.c
index d85f651f6a2..2871361a7b7 100644
--- a/sys/arch/sparc64/sparc64/mem.c
+++ b/sys/arch/sparc64/sparc64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.12 2014/11/16 12:30:59 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.13 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: mem.c,v 1.18 2001/04/24 04:31:12 thorpej Exp $ */
/*
@@ -136,7 +136,7 @@ mmrw(dev, uio, flags)
pmap_update(pmap_kernel());
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
- error = uiomove((caddr_t)vmmap + o, c, uio);
+ error = uiomovei((caddr_t)vmmap + o, c, uio);
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
(vaddr_t)vmmap + NBPG);
pmap_update(pmap_kernel());
@@ -149,7 +149,7 @@ mmrw(dev, uio, flags)
if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
break;
/* minor device 2 is EOF/RATHOLE */
@@ -173,7 +173,7 @@ mmrw(dev, uio, flags)
zeropage = malloc(NBPG, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, NBPG);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
break;
default:
diff --git a/sys/arch/sparc64/sparc64/openprom.c b/sys/arch/sparc64/sparc64/openprom.c
index d1897970239..cecd008897c 100644
--- a/sys/arch/sparc64/sparc64/openprom.c
+++ b/sys/arch/sparc64/sparc64/openprom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openprom.c,v 1.18 2014/07/12 18:44:43 tedu Exp $ */
+/* $OpenBSD: openprom.c,v 1.19 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: openprom.c,v 1.4 2002/01/10 06:21:53 briggs Exp $ */
/*
@@ -108,7 +108,7 @@ openpromread(dev_t dev, struct uio *uio, int flags)
if (len > uio->uio_resid)
len = uio->uio_resid;
- error = uiomove(v, len, uio);
+ error = uiomovei(v, len, uio);
if (error)
return (error);
}
diff --git a/sys/arch/vax/vax/mem.c b/sys/arch/vax/vax/mem.c
index 858182c57ea..b371904e181 100644
--- a/sys/arch/vax/vax/mem.c
+++ b/sys/arch/vax/vax/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.16 2010/11/20 20:33:24 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.17 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: mem.c,v 1.15 1999/03/24 05:51:17 mrg Exp $ */
/*
@@ -121,7 +121,7 @@ mmrw(dev, uio, flags)
}
c = min(iov->iov_len, MAXPHYS);
- error = uiomove((caddr_t)v + KERNBASE, c, uio);
+ error = uiomovei((caddr_t)v + KERNBASE, c, uio);
continue;
/* minor device 1 is kernel memory */
case 1:
@@ -130,7 +130,7 @@ mmrw(dev, uio, flags)
if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
- error = uiomove((caddr_t)v, c, uio);
+ error = uiomovei((caddr_t)v, c, uio);
continue;
/* minor device 2 is EOF/RATHOLE */
@@ -149,7 +149,7 @@ mmrw(dev, uio, flags)
zeropage = malloc(PAGE_SIZE, M_TEMP,
M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
- error = uiomove(zeropage, c, uio);
+ error = uiomovei(zeropage, c, uio);
continue;
default:
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index d20542f87ea..8fac359ed8f 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.128 2015/02/07 01:49:05 kettenis Exp $ */
+/* $OpenBSD: audio.c,v 1.129 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */
/*
@@ -1496,7 +1496,7 @@ audio_read(dev_t dev, struct uio *uio, int ioflag)
DPRINTFN(1,("audio_read: outp=%p, cc=%d\n", outp, cc));
if (sc->sc_rparams.sw_code)
sc->sc_rparams.sw_code(sc->hw_hdl, outp, cc);
- error = uiomove(outp, cc / sc->sc_rparams.factor, uio);
+ error = uiomovei(outp, cc / sc->sc_rparams.factor, uio);
if (error)
return error;
}
@@ -1635,7 +1635,7 @@ audio_silence_copyout(struct audio_softc *sc, int n, struct uio *uio)
error = 0;
while (n > 0 && uio->uio_resid > 0 && !error) {
k = min(n, min(uio->uio_resid, sizeof zerobuf));
- error = uiomove(zerobuf, k, uio);
+ error = uiomovei(zerobuf, k, uio);
n -= k;
}
return (error);
@@ -1739,7 +1739,7 @@ audio_write(dev_t dev, struct uio *uio, int ioflag)
cc /= sc->sc_pparams.factor;
DPRINTFN(1, ("audio_write: uiomove cc=%d inp=%p, left=%zd\n",
cc, inp, uio->uio_resid));
- error = uiomove(inp, cc, uio);
+ error = uiomovei(inp, cc, uio);
if (error)
return 0;
if (sc->sc_pparams.sw_code) {
diff --git a/sys/dev/hotplug.c b/sys/dev/hotplug.c
index 2936751b04b..ccbb0dcfd7e 100644
--- a/sys/dev/hotplug.c
+++ b/sys/dev/hotplug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hotplug.c,v 1.12 2011/07/02 22:20:07 nicm Exp $ */
+/* $OpenBSD: hotplug.c,v 1.13 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -151,7 +151,7 @@ hotplugread(dev_t dev, struct uio *uio, int flags)
again:
if (hotplug_get_event(&he) == 0)
- return (uiomove(&he, sizeof(he), uio));
+ return (uiomovei(&he, sizeof(he), uio));
if (flags & IO_NDELAY)
return (EAGAIN);
diff --git a/sys/dev/ic/lpt.c b/sys/dev/ic/lpt.c
index 9d6eebe1c2d..abe25e8d072 100644
--- a/sys/dev/ic/lpt.c
+++ b/sys/dev/ic/lpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpt.c,v 1.12 2014/09/14 14:17:24 jsg Exp $ */
+/* $OpenBSD: lpt.c,v 1.13 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: lpt.c,v 1.42 1996/10/21 22:41:14 thorpej Exp $ */
/*
@@ -368,7 +368,7 @@ lptwrite(dev_t dev, struct uio *uio, int flags)
int error = 0;
while ((n = min(LPT_BSIZE, uio->uio_resid)) != 0) {
- error = uiomove(sc->sc_cp = sc->sc_inbuf->b_data, n, uio);
+ error = uiomovei(sc->sc_cp = sc->sc_inbuf->b_data, n, uio);
if (error != 0)
return error;
sc->sc_count = n;
diff --git a/sys/dev/isa/spkr.c b/sys/dev/isa/spkr.c
index 7802d71324d..6135afac7bd 100644
--- a/sys/dev/isa/spkr.c
+++ b/sys/dev/isa/spkr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spkr.c,v 1.17 2014/09/14 14:17:25 jsg Exp $ */
+/* $OpenBSD: spkr.c,v 1.18 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: spkr.c,v 1.1 1998/04/15 20:26:18 drochner Exp $ */
/*
@@ -433,7 +433,7 @@ spkrwrite(dev_t dev, struct uio *uio, int flags)
return (ENXIO);
else {
n = min(DEV_BSIZE, uio->uio_resid);
- error = uiomove(spkr_inbuf, n, uio);
+ error = uiomovei(spkr_inbuf, n, uio);
if (!error)
playstring((char *)spkr_inbuf, n);
return (error);
diff --git a/sys/dev/ksyms.c b/sys/dev/ksyms.c
index 5f877a17252..d608564f803 100644
--- a/sys/dev/ksyms.c
+++ b/sys/dev/ksyms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ksyms.c,v 1.26 2014/12/22 02:55:48 deraadt Exp $ */
+/* $OpenBSD: ksyms.c,v 1.27 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>
@@ -171,7 +171,7 @@ ksymsread(dev_t dev, struct uio *uio, int flags)
if (len > uio->uio_resid)
len = uio->uio_resid;
- if ((error = uiomove(v, len, uio)) != 0)
+ if ((error = uiomovei(v, len, uio)) != 0)
return (error);
}
diff --git a/sys/dev/midi.c b/sys/dev/midi.c
index b3682f147aa..a76f006f206 100644
--- a/sys/dev/midi.c
+++ b/sys/dev/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.32 2014/10/09 04:04:46 tedu Exp $ */
+/* $OpenBSD: midi.c,v 1.33 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2003, 2004 Alexandre Ratchov
@@ -142,7 +142,7 @@ midiread(dev_t dev, struct uio *uio, int ioflag)
count = mb->used;
if (count > uio->uio_resid)
count = uio->uio_resid;
- error = uiomove(mb->data + mb->start, count, uio);
+ error = uiomovei(mb->data + mb->start, count, uio);
if (error) {
mtx_leave(&audio_lock);
return error;
@@ -280,7 +280,7 @@ midiwrite(dev_t dev, struct uio *uio, int ioflag)
count = MIDIBUF_AVAIL(mb);
if (count > uio->uio_resid)
count = uio->uio_resid;
- error = uiomove(mb->data + MIDIBUF_END(mb), count, uio);
+ error = uiomovei(mb->data + MIDIBUF_END(mb), count, uio);
if (error) {
mtx_leave(&audio_lock);
return error;
diff --git a/sys/dev/pci/bktr/bktr_core.c b/sys/dev/pci/bktr/bktr_core.c
index 852da283855..156de997e91 100644
--- a/sys/dev/pci/bktr/bktr_core.c
+++ b/sys/dev/pci/bktr/bktr_core.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bktr_core.c,v 1.34 2014/12/16 18:30:03 tedu Exp $ */
+/* $OpenBSD: bktr_core.c,v 1.35 2015/02/10 21:56:09 miod Exp $ */
/* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp $ */
/*
@@ -1028,7 +1028,7 @@ video_read(bktr_ptr_t bktr, int unit, dev_t dev, struct uio *uio)
status = tsleep(BKTR_SLEEP, BKTRPRI, "captur", 0);
if (!status) /* successful capture */
- status = uiomove((caddr_t)bktr->bigbuf, count, uio);
+ status = uiomovei((caddr_t)bktr->bigbuf, count, uio);
else
printf ("%s: read: tsleep error %d\n",
bktr_name(bktr), status);
@@ -1078,12 +1078,12 @@ vbi_read(bktr_ptr_t bktr, struct uio *uio, int ioflag)
/* We need to wrap around */
readsize2 = VBI_BUFFER_SIZE - bktr->vbistart;
- status = uiomove((caddr_t)bktr->vbibuffer + bktr->vbistart, readsize2, uio);
+ status = uiomovei((caddr_t)bktr->vbibuffer + bktr->vbistart, readsize2, uio);
if (status == 0)
- status = uiomove((caddr_t)bktr->vbibuffer, (readsize - readsize2), uio);
+ status = uiomovei((caddr_t)bktr->vbibuffer, (readsize - readsize2), uio);
} else {
/* We do not need to wrap around */
- status = uiomove((caddr_t)bktr->vbibuffer + bktr->vbistart, readsize, uio);
+ status = uiomovei((caddr_t)bktr->vbibuffer + bktr->vbistart, readsize, uio);
}
/* Update the number of bytes left to read */
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index 03cca82e83d..860ac29650c 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_drv.c,v 1.132 2015/02/10 01:39:32 jsg Exp $ */
+/* $OpenBSD: drm_drv.c,v 1.133 2015/02/10 21:56:09 miod Exp $ */
/*-
* Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org>
* Copyright © 2008 Intel Corporation
@@ -823,7 +823,7 @@ drmread(dev_t kdev, struct uio *uio, int ioflag)
while (drm_dequeue_event(dev, file_priv, uio->uio_resid, &ev)) {
MUTEX_ASSERT_UNLOCKED(&dev->event_lock);
/* XXX we always destroy the event on error. */
- error = uiomove(ev->event, ev->event->length, uio);
+ error = uiomovei(ev->event, ev->event->length, uio);
ev->destroy(ev);
if (error)
break;
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index a01e491ad28..cd5c6991a04 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rnd.c,v 1.170 2015/02/07 01:19:40 deraadt Exp $ */
+/* $OpenBSD: rnd.c,v 1.171 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2011 Theo de Raadt.
@@ -863,7 +863,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag)
chacha_encrypt_bytes(&lctx, buf, buf, n);
} else
arc4random_buf(buf, n);
- ret = uiomove(buf, n, uio);
+ ret = uiomovei(buf, n, uio);
if (ret == 0 && uio->uio_resid > 0)
yield();
}
@@ -888,7 +888,7 @@ randomwrite(dev_t dev, struct uio *uio, int flags)
while (ret == 0 && uio->uio_resid > 0) {
int n = min(POOLBYTES, uio->uio_resid);
- ret = uiomove(buf, n, uio);
+ ret = uiomovei(buf, n, uio);
if (ret != 0)
break;
while (n % sizeof(u_int32_t))
diff --git a/sys/dev/sbus/bpp.c b/sys/dev/sbus/bpp.c
index 88f3b21f796..f03f25ca8ba 100644
--- a/sys/dev/sbus/bpp.c
+++ b/sys/dev/sbus/bpp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpp.c,v 1.3 2011/09/18 14:07:45 miod Exp $ */
+/* $OpenBSD: bpp.c,v 1.4 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: bpp.c,v 1.25 2005/12/11 12:23:44 christos Exp $ */
/*-
@@ -305,7 +305,7 @@ bppwrite(dev_t dev, struct uio *uio, int flags)
caddr_t bp = sc->sc_buf;
size_t len = min(sc->sc_bufsz, uio->uio_resid);
- if ((error = uiomove(bp, len, uio)) != 0)
+ if ((error = uiomovei(bp, len, uio)) != 0)
break;
while (len > 0) {
diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c
index 41de56dfee2..502d433f2aa 100644
--- a/sys/dev/sbus/magma.c
+++ b/sys/dev/sbus/magma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magma.c,v 1.24 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: magma.c,v 1.25 2015/02/10 21:56:09 miod Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
@@ -1549,7 +1549,7 @@ mbpp_rw(dev_t dev, struct uio *uio)
ptr = buffer;
if (uio->uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, uio);
+ error = uiomovei(ptr, len, uio);
if (error)
break;
}
@@ -1569,7 +1569,7 @@ mbpp_rw(dev_t dev, struct uio *uio)
if (uio->uio_rw == UIO_READ) {
if (cnt) {
- error = uiomove(ptr, cnt, uio);
+ error = uiomovei(ptr, cnt, uio);
if (error)
break;
gotdata++;
diff --git a/sys/dev/systrace.c b/sys/dev/systrace.c
index 4336292fc7a..8ade505d8b5 100644
--- a/sys/dev/systrace.c
+++ b/sys/dev/systrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: systrace.c,v 1.72 2015/01/19 18:37:19 deraadt Exp $ */
+/* $OpenBSD: systrace.c,v 1.73 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -211,7 +211,7 @@ systracef_read(struct file *fp, off_t *poff, struct uio *uio,
rw_enter_write(&fst->lock);
systrace_unlock();
if ((process = TAILQ_FIRST(&fst->messages)) != NULL) {
- error = uiomove((caddr_t)&process->msg,
+ error = uiomovei((caddr_t)&process->msg,
sizeof(struct str_message), uio);
if (!error) {
TAILQ_REMOVE(&fst->messages, process, msg_next);
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 29a9b22c242..afb0b62eb8e 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.80 2015/01/11 03:07:44 deraadt Exp $ */
+/* $OpenBSD: ugen.c,v 1.81 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -527,7 +527,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
DPRINTFN(5, ("ugenread: got %d chars\n", n));
/* Copy the data to the user process. */
- error = uiomove(buffer, n, uio);
+ error = uiomovei(buffer, n, uio);
if (error)
break;
}
@@ -558,7 +558,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
}
usbd_get_xfer_status(xfer, NULL, NULL, &tn, NULL);
DPRINTFN(1, ("ugenread: got %d bytes\n", tn));
- error = uiomove(buf, tn, uio);
+ error = uiomovei(buf, tn, uio);
if (error || tn < n)
break;
}
@@ -596,7 +596,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
DPRINTFN(5, ("ugenread: isoc got %d chars\n", n));
/* Copy the data to the user process. */
- error = uiomove(sce->cur, n, uio);
+ error = uiomovei(sce->cur, n, uio);
if (error)
break;
sce->cur += n;
@@ -667,7 +667,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
if (xfer == 0)
return (EIO);
while ((n = min(UGEN_BBSIZE, uio->uio_resid)) != 0) {
- error = uiomove(buf, n, uio);
+ error = uiomovei(buf, n, uio);
if (error)
break;
DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n));
@@ -693,7 +693,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
return (EIO);
while ((n = min(UGETW(sce->edesc->wMaxPacketSize),
uio->uio_resid)) != 0) {
- error = uiomove(buf, n, uio);
+ error = uiomovei(buf, n, uio);
if (error)
break;
DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n));
@@ -1127,7 +1127,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
uio.uio_segflg = UIO_USERSPACE;
uio.uio_rw = UIO_READ;
uio.uio_procp = p;
- error = uiomove((void *)cdesc, len, &uio);
+ error = uiomovei((void *)cdesc, len, &uio);
free(cdesc, M_TEMP, 0);
return (error);
}
@@ -1177,7 +1177,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
uio.uio_procp = p;
ptr = malloc(len, M_TEMP, M_WAITOK);
if (uio.uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, &uio);
+ error = uiomovei(ptr, len, &uio);
if (error)
goto ret;
}
@@ -1194,7 +1194,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
len = ur->ucr_actlen;
if (len != 0) {
if (uio.uio_rw == UIO_READ) {
- error = uiomove(ptr, len, &uio);
+ error = uiomovei(ptr, len, &uio);
if (error)
goto ret;
}
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index d0f53a50425..c24b9e5aac3 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.59 2014/12/11 18:39:27 mpi Exp $ */
+/* $OpenBSD: uhid.c,v 1.60 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -269,7 +269,7 @@ uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag)
UHID_INPUT_REPORT, sc->sc_hdev.sc_report_id, buffer,
sc->sc_hdev.sc_isize) != sc->sc_hdev.sc_isize)
return (EIO);
- return (uiomove(buffer, sc->sc_hdev.sc_isize, uio));
+ return (uiomovei(buffer, sc->sc_hdev.sc_isize, uio));
}
s = splusb();
@@ -302,7 +302,7 @@ uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag)
DPRINTFN(5, ("uhidread: got %lu chars\n", (u_long)length));
/* Copy the data to the user process. */
- if ((error = uiomove(buffer, length, uio)) != 0)
+ if ((error = uiomovei(buffer, length, uio)) != 0)
break;
}
@@ -339,7 +339,7 @@ uhid_do_write(struct uhid_softc *sc, struct uio *uio, int flag)
error = 0;
if (uio->uio_resid != size)
return (EINVAL);
- error = uiomove(sc->sc_obuf, size, uio);
+ error = uiomovei(sc->sc_obuf, size, uio);
if (!error) {
if (uhidev_set_report(sc->sc_hdev.sc_parent,
UHID_OUTPUT_REPORT, sc->sc_hdev.sc_report_id, sc->sc_obuf,
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index adbf23d2453..2d313749459 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ulpt.c,v 1.48 2014/10/19 16:35:53 stsp Exp $ */
+/* $OpenBSD: ulpt.c,v 1.49 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
@@ -624,7 +624,7 @@ ulpt_do_write(struct ulpt_softc *sc, struct uio *uio, int flags)
}
while ((n = min(ULPT_BSIZE, uio->uio_resid)) != 0) {
ulpt_statusmsg(ulpt_status(sc), sc);
- error = uiomove(bufp, n, uio);
+ error = uiomovei(bufp, n, uio);
if (error)
break;
DPRINTFN(1, ("ulptwrite: transfer %d bytes\n", n));
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 5dcf89099eb..fc175c0c84b 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.105 2015/02/09 12:45:12 uebayasi Exp $ */
+/* $OpenBSD: usb.c,v 1.106 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -643,7 +643,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p)
uio.uio_procp = p;
ptr = malloc(len, M_TEMP, M_WAITOK);
if (uio.uio_rw == UIO_WRITE) {
- error = uiomove(ptr, len, &uio);
+ error = uiomovei(ptr, len, &uio);
if (error)
goto ret;
}
@@ -660,7 +660,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p)
len = ur->ucr_actlen;
if (len != 0) {
if (uio.uio_rw == UIO_READ) {
- error = uiomove(ptr, len, &uio);
+ error = uiomovei(ptr, len, &uio);
if (error)
goto ret;
}
@@ -788,7 +788,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p)
uio.uio_segflg = UIO_USERSPACE;
uio.uio_rw = UIO_READ;
uio.uio_procp = p;
- error = uiomove((void *)cdesc, len, &uio);
+ error = uiomovei((void *)cdesc, len, &uio);
free(cdesc, M_TEMP, 0);
return (error);
}
diff --git a/sys/dev/video.c b/sys/dev/video.c
index 0668398b25f..bb210af2d89 100644
--- a/sys/dev/video.c
+++ b/sys/dev/video.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: video.c,v 1.34 2014/12/16 18:30:03 tedu Exp $ */
+/* $OpenBSD: video.c,v 1.35 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -173,7 +173,7 @@ videoread(dev_t dev, struct uio *uio, int ioflag)
size = sc->sc_fsize;
else
size = uio->uio_resid;
- error = uiomove(sc->sc_fbuffer, size, uio);
+ error = uiomovei(sc->sc_fbuffer, size, uio);
sc->sc_frames_ready--;
if (error)
return (error);
diff --git a/sys/dev/wscons/wsevent.c b/sys/dev/wscons/wsevent.c
index 6b8d37a33ac..acb0fa45b54 100644
--- a/sys/dev/wscons/wsevent.c
+++ b/sys/dev/wscons/wsevent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsevent.c,v 1.11 2015/01/11 02:57:09 deraadt Exp $ */
+/* $OpenBSD: wsevent.c,v 1.12 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: wsevent.c,v 1.16 2003/08/07 16:31:29 agc Exp $ */
/*
@@ -160,7 +160,7 @@ wsevent_read(struct wseventvar *ev, struct uio *uio, int flags)
n = howmany(uio->uio_resid, sizeof(struct wscons_event));
if (cnt > n)
cnt = n;
- error = uiomove((caddr_t)&ev->q[ev->get],
+ error = uiomovei((caddr_t)&ev->q[ev->get],
cnt * sizeof(struct wscons_event), uio);
n -= cnt;
/*
@@ -173,7 +173,7 @@ wsevent_read(struct wseventvar *ev, struct uio *uio, int flags)
return (error);
if (cnt > n)
cnt = n;
- error = uiomove((caddr_t)&ev->q[0],
+ error = uiomovei((caddr_t)&ev->q[0],
cnt * sizeof(struct wscons_event), uio);
ev->get = cnt;
return (error);
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c
index a13c2776920..00c0b30c987 100644
--- a/sys/isofs/cd9660/cd9660_vnops.c
+++ b/sys/isofs/cd9660/cd9660_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vnops.c,v 1.69 2014/12/16 18:30:03 tedu Exp $ */
+/* $OpenBSD: cd9660_vnops.c,v 1.70 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
@@ -273,7 +273,7 @@ cd9660_read(void *v)
return (error);
}
- error = uiomove(bp->b_data + on, (int)n, uio);
+ error = uiomovei(bp->b_data + on, (int)n, uio);
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
@@ -341,7 +341,7 @@ iso_uiodir(idp,dp,off)
}
dp->d_off = off;
- if ((error = uiomove((caddr_t)dp, dp->d_reclen, idp->uio)) != 0)
+ if ((error = uiomovei((caddr_t)dp, dp->d_reclen, idp->uio)) != 0)
return (error);
idp->uio_off = off;
return (0);
@@ -654,7 +654,7 @@ cd9660_readlink(void *v)
*/
if (uio->uio_segflg != UIO_SYSSPACE ||
uio->uio_iov->iov_len < MAXPATHLEN) {
- error = uiomove(symname, symlen, uio);
+ error = uiomovei(symname, symlen, uio);
pool_put(&namei_pool, symname);
return (error);
}
diff --git a/sys/isofs/udf/udf_vnops.c b/sys/isofs/udf/udf_vnops.c
index 260f925c35e..f838f18d255 100644
--- a/sys/isofs/udf/udf_vnops.c
+++ b/sys/isofs/udf/udf_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vnops.c,v 1.58 2014/12/16 18:30:03 tedu Exp $ */
+/* $OpenBSD: udf_vnops.c,v 1.59 2015/02/10 21:56:09 miod Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -452,7 +452,7 @@ udf_read(void *v)
size = fsize - offset;
error = udf_readatoffset(up, &size, offset, &bp, &data);
if (error == 0)
- error = uiomove(data, size, uio);
+ error = uiomovei(data, size, uio);
if (bp != NULL) {
brelse(bp);
bp = NULL;
@@ -553,7 +553,7 @@ udf_uiodir(struct udf_uiodir *uiodir, struct uio *uio, long off)
uiodir->dirent->d_off = off;
uiodir->dirent->d_reclen = de_size;
- return (uiomove(uiodir->dirent, de_size, uio));
+ return (uiomovei(uiodir->dirent, de_size, uio));
}
static struct udf_dirstream *
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index 3c4e44f2b14..71ec338632c 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_subr.c,v 1.42 2014/12/10 15:29:53 mikeb Exp $ */
+/* $OpenBSD: kern_subr.c,v 1.43 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */
/*
@@ -47,7 +47,7 @@
#include <sys/resourcevar.h>
int
-uiomove(void *cp, int n, struct uio *uio)
+uiomove(void *cp, size_t n, struct uio *uio)
{
struct iovec *iov;
size_t cnt;
@@ -104,6 +104,15 @@ uiomove(void *cp, int n, struct uio *uio)
return (error);
}
+int
+uiomovei(void *cp, int n, struct uio *uio)
+{
+ if (n < 0)
+ return 0;
+
+ return uiomove(cp, (size_t)n, uio);
+}
+
/*
* Give next character to user as result of read.
*/
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c
index 0b9106dd7fc..6f161465f1d 100644
--- a/sys/kern/spec_vnops.c
+++ b/sys/kern/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.82 2014/12/29 05:29:27 miod Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.83 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -256,7 +256,7 @@ spec_read(void *v)
brelse(bp);
return (error);
}
- error = uiomove((char *)bp->b_data + on, n, uio);
+ error = uiomovei((char *)bp->b_data + on, n, uio);
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
return (error);
@@ -338,7 +338,7 @@ spec_write(void *v)
brelse(bp);
return (error);
}
- error = uiomove((char *)bp->b_data + on, n, uio);
+ error = uiomovei((char *)bp->b_data + on, n, uio);
if (n + on == bsize)
bawrite(bp);
else
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 8a4746fd93a..dbae2898ac7 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_log.c,v 1.27 2015/01/13 18:51:27 kettenis Exp $ */
+/* $OpenBSD: subr_log.c,v 1.28 2015/02/10 21:56:09 miod Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
@@ -207,7 +207,7 @@ logread(dev_t dev, struct uio *uio, int flag)
l = min(l, uio->uio_resid);
if (l == 0)
break;
- error = uiomove(&mbp->msg_bufc[mbp->msg_bufr], (int)l, uio);
+ error = uiomovei(&mbp->msg_bufc[mbp->msg_bufr], (int)l, uio);
if (error)
break;
mbp->msg_bufr += l;
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 0f505c2cb2d..5947ed501b5 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_pipe.c,v 1.68 2014/12/19 05:59:21 tedu Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.69 2015/02/10 21:56:10 miod Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
@@ -317,7 +317,7 @@ pipe_read(struct file *fp, off_t *poff, struct uio *uio, struct ucred *cred)
size = rpipe->pipe_buffer.cnt;
if (size > uio->uio_resid)
size = uio->uio_resid;
- error = uiomove(&rpipe->pipe_buffer.buffer[rpipe->pipe_buffer.out],
+ error = uiomovei(&rpipe->pipe_buffer.buffer[rpipe->pipe_buffer.out],
size, uio);
if (error) {
break;
@@ -516,7 +516,7 @@ retrywrite:
/* Transfer first segment */
- error = uiomove(&wpipe->pipe_buffer.buffer[wpipe->pipe_buffer.in],
+ error = uiomovei(&wpipe->pipe_buffer.buffer[wpipe->pipe_buffer.in],
segsize, uio);
if (error == 0 && segsize < size) {
@@ -531,7 +531,7 @@ retrywrite:
panic("Expected pipe buffer wraparound disappeared");
#endif
- error = uiomove(&wpipe->pipe_buffer.buffer[0],
+ error = uiomovei(&wpipe->pipe_buffer.buffer[0],
size - segsize, uio);
}
if (error == 0) {
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 419f6e65d90..c0ec4f0e259 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.120 2015/01/13 10:07:58 mpf Exp $ */
+/* $OpenBSD: tty.c,v 1.121 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -1781,7 +1781,7 @@ loop:
if (cc == 0) {
cc = MIN(uio->uio_resid, OBUFSIZ);
cp = obuf;
- error = uiomove(cp, cc, uio);
+ error = uiomovei(cp, cc, uio);
if (error) {
cc = 0;
break;
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 2c64ccf885c..d54d455bc79 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.69 2014/11/18 23:55:01 krw Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.70 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -463,7 +463,7 @@ ptcread(dev_t dev, struct uio *uio, int flag)
if (pti->pt_send & TIOCPKT_IOCTL) {
cc = MIN(uio->uio_resid,
sizeof(tp->t_termios));
- error = uiomove(&tp->t_termios, cc, uio);
+ error = uiomovei(&tp->t_termios, cc, uio);
if (error)
return (error);
}
@@ -498,7 +498,7 @@ ptcread(dev_t dev, struct uio *uio, int flag)
bufcc = cc;
if (cc <= 0)
break;
- error = uiomove(buf, cc, uio);
+ error = uiomovei(buf, cc, uio);
}
ttwakeupwr(tp);
if (bufcc)
@@ -531,7 +531,7 @@ again:
if (cc > bufcc)
bufcc = cc;
cp = buf;
- error = uiomove(cp, cc, uio);
+ error = uiomovei(cp, cc, uio);
if (error)
goto done;
/* check again for safety */
@@ -555,7 +555,7 @@ again:
if (cc > bufcc)
bufcc = cc;
cp = buf;
- error = uiomove(cp, cc, uio);
+ error = uiomovei(cp, cc, uio);
if (error)
goto done;
/* check again for safety */
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 17149a97281..e7a1f94addb 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.135 2014/12/11 19:21:57 tedu Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.136 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -514,7 +514,7 @@ nopages:
if (atomic && top == 0 && len < mlen)
MH_ALIGN(m, len);
}
- error = uiomove(mtod(m, caddr_t), (int)len,
+ error = uiomovei(mtod(m, caddr_t), (int)len,
uio);
resid = uio->uio_resid;
m->m_len = len;
@@ -640,7 +640,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio,
if (error)
goto bad;
do {
- error = uiomove(mtod(m, caddr_t),
+ error = uiomovei(mtod(m, caddr_t),
(int) min(uio->uio_resid, m->m_len), uio);
m = m_free(m);
} while (uio->uio_resid && error == 0 && m);
@@ -852,7 +852,7 @@ dontblock:
SBLASTMBUFCHK(&so->so_rcv, "soreceive uiomove");
resid = uio->uio_resid;
splx(s);
- uio_error = uiomove(mtod(m, caddr_t) + moff, len, uio);
+ uio_error = uiomovei(mtod(m, caddr_t) + moff, len, uio);
s = splsoftnet();
if (uio_error)
uio->uio_resid = resid - len;
diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c
index 567985f6777..ab67740e80d 100644
--- a/sys/miscfs/fuse/fuse_device.c
+++ b/sys/miscfs/fuse/fuse_device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_device.c,v 1.15 2014/07/12 18:43:52 tedu Exp $ */
+/* $OpenBSD: fuse_device.c,v 1.16 2015/02/10 21:56:10 miod Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -429,7 +429,7 @@ fuseread(dev_t dev, struct uio *uio, int ioflag)
bzero(&fbuf->fb_next, sizeof(fbuf->fb_next));
tmpaddr = fbuf->fb_dat;
fbuf->fb_dat = NULL;
- error = uiomove(fbuf, FUSEBUFSIZE, uio);
+ error = uiomovei(fbuf, FUSEBUFSIZE, uio);
if (error)
goto end;
@@ -469,7 +469,7 @@ fusewrite(dev_t dev, struct uio *uio, int ioflag)
if (uio->uio_resid != FUSEBUFSIZE)
return (EINVAL);
- if ((error = uiomove(&hdr, sizeof(hdr), uio)) != 0)
+ if ((error = uiomovei(&hdr, sizeof(hdr), uio)) != 0)
return (error);
/* looking for uuid in fd_fbufs_wait */
@@ -496,7 +496,7 @@ fusewrite(dev_t dev, struct uio *uio, int ioflag)
}
/* Get the missing datas from the fbuf */
- error = uiomove(&fbuf->FD, uio->uio_resid, uio);
+ error = uiomovei(&fbuf->FD, uio->uio_resid, uio);
if (error)
return error;
fbuf->fb_dat = NULL;
diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c
index b1b87c7f19f..43db6e28f96 100644
--- a/sys/miscfs/fuse/fuse_vnops.c
+++ b/sys/miscfs/fuse/fuse_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_vnops.c,v 1.21 2014/12/16 18:30:04 tedu Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.22 2015/02/10 21:56:10 miod Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -726,7 +726,7 @@ fusefs_readdir(void *v)
break;
}
- if ((error = uiomove(fbuf->fb_dat, fbuf->fb_len, uio))) {
+ if ((error = uiomovei(fbuf->fb_dat, fbuf->fb_len, uio))) {
fb_delete(fbuf);
break;
}
@@ -805,7 +805,7 @@ fusefs_readlink(void *v)
return (error);
}
- error = uiomove(fbuf->fb_dat, fbuf->fb_len, uio);
+ error = uiomovei(fbuf->fb_dat, fbuf->fb_len, uio);
fb_delete(fbuf);
return (error);
@@ -1054,7 +1054,7 @@ fusefs_read(void *v)
if (error)
break;
- error = uiomove(fbuf->fb_dat, MIN(size, fbuf->fb_len), uio);
+ error = uiomovei(fbuf->fb_dat, MIN(size, fbuf->fb_len), uio);
if (error)
break;
@@ -1108,7 +1108,7 @@ fusefs_write(void *v)
fbuf->fb_io_off = uio->uio_offset;
fbuf->fb_io_len = len;
- if ((error = uiomove(fbuf->fb_dat, len, uio))) {
+ if ((error = uiomovei(fbuf->fb_dat, len, uio))) {
printf("fusefs: uio error %i\n", error);
break;
}
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index 3df7e5fdc68..6555398ffe3 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vnops.c,v 1.97 2014/12/16 18:30:04 tedu Exp $ */
+/* $OpenBSD: msdosfs_vnops.c,v 1.98 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */
/*-
@@ -577,7 +577,7 @@ msdosfs_read(void *v)
brelse(bp);
return (error);
}
- error = uiomove(bp->b_data + on, (int) n, uio);
+ error = uiomovei(bp->b_data + on, (int) n, uio);
brelse(bp);
} while (error == 0 && uio->uio_resid > 0 && n != 0);
if (!isadir && !(vp->v_mount->mnt_flag & MNT_NOATIME))
@@ -735,7 +735,7 @@ msdosfs_write(void *v)
/*
* Copy the data from user space into the buf header.
*/
- error = uiomove(bp->b_data + croffset, n, uio);
+ error = uiomovei(bp->b_data + croffset, n, uio);
/*
* If they want this synchronous then write it and wait for
@@ -1558,7 +1558,7 @@ msdosfs_readdir(void *v)
sizeof(struct direntry);
if (uio->uio_resid < dirbuf.d_reclen)
goto out;
- error = uiomove(&dirbuf, dirbuf.d_reclen, uio);
+ error = uiomovei(&dirbuf, dirbuf.d_reclen, uio);
if (error)
goto out;
offset = dirbuf.d_off;
@@ -1686,7 +1686,7 @@ msdosfs_readdir(void *v)
goto out;
}
wlast = -1;
- error = uiomove(&dirbuf, dirbuf.d_reclen, uio);
+ error = uiomovei(&dirbuf, dirbuf.d_reclen, uio);
if (error) {
brelse(bp);
goto out;
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index a9d1821a46f..f76c855a8e1 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.117 2015/02/10 00:53:55 pelikan Exp $ */
+/* $OpenBSD: bpf.c,v 1.118 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -193,7 +193,7 @@ bpf_movein(struct uio *uio, u_int linktype, struct mbuf **mp,
m->m_len = len;
*mp = m;
- error = uiomove(mtod(m, caddr_t), len, uio);
+ error = uiomovei(mtod(m, caddr_t), len, uio);
if (error)
goto bad;
@@ -475,7 +475,7 @@ bpfread(dev_t dev, struct uio *uio, int ioflag)
* We know the entire buffer is transferred since
* we checked above that the read buffer is bpf_bufsize bytes.
*/
- error = uiomove(d->bd_hbuf, d->bd_hlen, uio);
+ error = uiomovei(d->bd_hbuf, d->bd_hlen, uio);
s = splnet();
d->bd_fbuf = d->bd_hbuf;
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c
index 085507e2f71..c2ed2f72206 100644
--- a/sys/net/if_pppx.c
+++ b/sys/net/if_pppx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppx.c,v 1.35 2014/12/19 17:14:39 tedu Exp $ */
+/* $OpenBSD: if_pppx.c,v 1.36 2015/02/10 21:56:10 miod Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
@@ -300,7 +300,7 @@ pppxread(dev_t dev, struct uio *uio, int ioflag)
while (m0 != NULL && uio->uio_resid > 0 && error == 0) {
len = min(uio->uio_resid, m0->m_len);
if (len != 0)
- error = uiomove(mtod(m0, caddr_t), len, uio);
+ error = uiomovei(mtod(m0, caddr_t), len, uio);
MFREE(m0, m);
m0 = m;
}
@@ -344,7 +344,7 @@ pppxwrite(dev_t dev, struct uio *uio, int ioflag)
while (error == 0 && uio->uio_resid > 0) {
m->m_len = min(mlen, uio->uio_resid);
- error = uiomove(mtod (m, caddr_t), m->m_len, uio);
+ error = uiomovei(mtod (m, caddr_t), m->m_len, uio);
*mp = m;
mp = &m->m_next;
if (error == 0 && uio->uio_resid > 0) {
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 045e282e7cf..7700b6edc49 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.131 2015/01/21 02:23:14 guenther Exp $ */
+/* $OpenBSD: if_tun.c,v 1.132 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -758,7 +758,7 @@ tunread(dev_t dev, struct uio *uio, int ioflag)
while (m0 != NULL && uio->uio_resid > 0 && error == 0) {
len = min(uio->uio_resid, m0->m_len);
if (len != 0)
- error = uiomove(mtod(m0, caddr_t), len, uio);
+ error = uiomovei(mtod(m0, caddr_t), len, uio);
MFREE(m0, m);
m0 = m;
}
@@ -826,7 +826,7 @@ tunwrite(dev_t dev, struct uio *uio, int ioflag)
}
while (error == 0 && uio->uio_resid > 0) {
m->m_len = min(mlen, uio->uio_resid);
- error = uiomove(mtod (m, caddr_t), m->m_len, uio);
+ error = uiomovei(mtod (m, caddr_t), m->m_len, uio);
*mp = m;
mp = &m->m_next;
if (error == 0 && uio->uio_resid > 0) {
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index 673448da819..6b104298023 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ppp_tty.c,v 1.30 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ppp_tty.c,v 1.31 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ppp_tty.c,v 1.12 1997/03/24 21:23:10 christos Exp $ */
/*
@@ -329,7 +329,7 @@ pppread(struct tty *tp, struct uio *uio, int flag)
splx(s);
for (m = m0; m && uio->uio_resid; m = m->m_next)
- if ((error = uiomove(mtod(m, u_char *), m->m_len, uio)) != 0)
+ if ((error = uiomovei(mtod(m, u_char *), m->m_len, uio)) != 0)
break;
m_freem(m0);
return (error);
@@ -369,7 +369,7 @@ pppwrite(struct tty *tp, struct uio *uio, int flag)
len = M_TRAILINGSPACE(m);
if (len > uio->uio_resid)
len = uio->uio_resid;
- if ((error = uiomove(mtod(m, u_char *), len, uio)) != 0) {
+ if ((error = uiomovei(mtod(m, u_char *), len, uio)) != 0) {
m_freem(m0);
return (error);
}
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 0b17b91972d..458e0d17c30 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.78 2014/12/18 20:59:21 tedu Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.79 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -224,7 +224,7 @@ again:
if (n > 0) {
if (!baddr)
baddr = bp->b_data;
- error = uiomove(baddr + on, (int)n, uio);
+ error = uiomovei(baddr + on, (int)n, uio);
}
if (vp->v_type == VLNK)
@@ -350,7 +350,7 @@ again:
goto again;
}
- error = uiomove((char *)bp->b_data + on, n, uio);
+ error = uiomovei((char *)bp->b_data + on, n, uio);
if (error) {
bp->b_flags |= B_ERROR;
brelse(bp);
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index ddcd98b253e..447c7e8f5ae 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.124 2015/01/17 17:49:27 deraadt Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.125 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -714,7 +714,7 @@ nfsm_uiotombuf(struct mbuf **mp, struct uio *uiop, size_t len)
while (len) {
xfer = min(len, M_TRAILINGSPACE(mb));
- uiomove(mb_offset(mb), xfer, uiop);
+ uiomovei(mb_offset(mb), xfer, uiop);
mb->m_len += xfer;
len -= xfer;
if (len > 0) {
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 9d66be0c56d..a16dca17d85 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.160 2014/12/29 05:29:28 miod Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.161 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -2030,7 +2030,7 @@ nfs_readdir(void *v)
break;
}
- if ((error = uiomove(dp, dp->d_reclen, uio)))
+ if ((error = uiomovei(dp, dp->d_reclen, uio)))
break;
newoff = fxdr_hyper(&ndp->cookie[0]);
diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c
index e1af21be4ea..2e08425954c 100644
--- a/sys/ntfs/ntfs_subr.c
+++ b/sys/ntfs/ntfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_subr.c,v 1.41 2014/12/16 19:56:33 tedu Exp $ */
+/* $OpenBSD: ntfs_subr.c,v 1.42 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */
/*-
@@ -1457,7 +1457,7 @@ ntfs_writentvattr_plain(struct ntfsmount *ntmp, struct ntnode *ip,
}
}
if (uio) {
- error = uiomove(bp->b_data + off, tocopy, uio);
+ error = uiomovei(bp->b_data + off, tocopy, uio);
if (error != 0)
break;
} else
@@ -1555,7 +1555,7 @@ ntfs_readntvattr_plain(struct ntfsmount *ntmp, struct ntnode *ip,
return (error);
}
if (uio) {
- error = uiomove(bp->b_data + off,
+ error = uiomovei(bp->b_data + off,
tocopy, uio);
if (error != 0)
break;
@@ -1582,7 +1582,7 @@ ntfs_readntvattr_plain(struct ntfsmount *ntmp, struct ntnode *ip,
if (uio) {
size_t remains = tocopy;
for(; remains; remains--) {
- error = uiomove("", 1, uio);
+ error = uiomovei("", 1, uio);
if (error != 0)
break;
}
@@ -1601,7 +1601,7 @@ ntfs_readntvattr_plain(struct ntfsmount *ntmp, struct ntnode *ip,
} else {
DDPRINTF("ntfs_readnvattr_plain: data is in mft record\n");
if (uio)
- error = uiomove(vap->va_datap + roff, rsize, uio);
+ error = uiomovei(vap->va_datap + roff, rsize, uio);
else
memcpy(rdata, vap->va_datap + roff, rsize);
*initp += rsize;
@@ -1712,14 +1712,14 @@ ntfs_readattr(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t attrnum,
if (init == ntfs_cntob(NTFS_COMPUNIT_CL)) {
if (uio)
- error = uiomove(cup + off, tocopy, uio);
+ error = uiomovei(cup + off, tocopy, uio);
else
memcpy(data, cup + off, tocopy);
} else if (init == 0) {
if (uio) {
size_t remains = tocopy;
for(; remains; remains--) {
- error = uiomove("", 1, uio);
+ error = uiomovei("", 1, uio);
if (error != 0)
break;
}
@@ -1731,7 +1731,7 @@ ntfs_readattr(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t attrnum,
if (error)
break;
if (uio)
- error = uiomove(uup + off, tocopy, uio);
+ error = uiomovei(uup + off, tocopy, uio);
else
memcpy(data, uup + off, tocopy);
}
diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c
index 0da88f8b448..642ff256709 100644
--- a/sys/ntfs/ntfs_vnops.c
+++ b/sys/ntfs/ntfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vnops.c,v 1.37 2014/12/16 19:56:33 tedu Exp $ */
+/* $OpenBSD: ntfs_vnops.c,v 1.38 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */
/*
@@ -498,7 +498,7 @@ ntfs_readdir(void *v)
cde.d_off = sizeof(struct dirent);
cde.d_name[0] = '.';
cde.d_name[1] = '\0';
- error = uiomove(&cde, sizeof(struct dirent), uio);
+ error = uiomovei(&cde, sizeof(struct dirent), uio);
if (error)
goto out;
}
@@ -513,7 +513,7 @@ ntfs_readdir(void *v)
cde.d_name[0] = '.';
cde.d_name[1] = '.';
cde.d_name[2] = '\0';
- error = uiomove(&cde, sizeof(struct dirent), uio);
+ error = uiomovei(&cde, sizeof(struct dirent), uio);
if (error)
goto out;
}
@@ -559,7 +559,7 @@ ntfs_readdir(void *v)
cde.d_off = uio->uio_offset + sizeof(struct dirent);
DPRINTF("%s\n", cde.d_type == DT_DIR ? "dir" : "reg");
- error = uiomove(&cde, sizeof(struct dirent), uio);
+ error = uiomovei(&cde, sizeof(struct dirent), uio);
if (error)
goto out;
num++;
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 8c4805c49c0..26f1f575bae 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systm.h,v 1.106 2014/12/10 15:29:53 mikeb Exp $ */
+/* $OpenBSD: systm.h,v 1.107 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
@@ -296,7 +296,8 @@ void dohooks(struct hook_desc_head *, int);
#define domountroothooks() dohooks(&mountroothook_list, HOOK_REMOVE|HOOK_FREE)
struct uio;
-int uiomove(void *, int, struct uio *);
+int uiomove(void *, size_t, struct uio *);
+int uiomovei(void *, int, struct uio *);
#if defined(_KERNEL)
__returns_twice int setjmp(label_t *);
diff --git a/sys/tmpfs/tmpfs_subr.c b/sys/tmpfs/tmpfs_subr.c
index 01d253add02..a36eb21abba 100644
--- a/sys/tmpfs/tmpfs_subr.c
+++ b/sys/tmpfs/tmpfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmpfs_subr.c,v 1.12 2015/01/21 22:26:52 deraadt Exp $ */
+/* $OpenBSD: tmpfs_subr.c,v 1.13 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: tmpfs_subr.c,v 1.79 2012/03/13 18:40:50 elad Exp $ */
/*
@@ -740,7 +740,7 @@ tmpfs_dir_getdotents(tmpfs_node_t *node, struct dirent *dp, struct uio *uio)
return EJUSTRETURN;
}
- if ((error = uiomove(dp, dp->d_reclen, uio)) != 0) {
+ if ((error = uiomovei(dp, dp->d_reclen, uio)) != 0) {
return error;
}
@@ -837,7 +837,7 @@ tmpfs_dir_getdents(tmpfs_node_t *node, struct uio *uio)
}
/* Copy out the directory entry and continue. */
- error = uiomove(&dent, dent.d_reclen, uio);
+ error = uiomovei(&dent, dent.d_reclen, uio);
if (error) {
break;
}
@@ -1220,7 +1220,7 @@ tmpfs_uiomove(tmpfs_node_t *node, struct uio *uio, vsize_t len)
if (pgoff + len < PAGE_SIZE) {
va = tmpfs_uio_lookup(node, pgnum);
if (va != (vaddr_t)NULL)
- return uiomove((void *)va + pgoff, len, uio);
+ return uiomovei((void *)va + pgoff, len, uio);
}
if (len >= TMPFS_UIO_MAXBYTES) {
@@ -1244,7 +1244,7 @@ tmpfs_uiomove(tmpfs_node_t *node, struct uio *uio, vsize_t len)
return error;
}
- error = uiomove((void *)va + pgoff, sz, uio);
+ error = uiomovei((void *)va + pgoff, sz, uio);
if (error == 0 && pgoff + sz < PAGE_SIZE)
tmpfs_uio_cache(node, pgnum, va);
else
diff --git a/sys/tmpfs/tmpfs_vnops.c b/sys/tmpfs/tmpfs_vnops.c
index ab1384b1d78..becafc07915 100644
--- a/sys/tmpfs/tmpfs_vnops.c
+++ b/sys/tmpfs/tmpfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmpfs_vnops.c,v 1.19 2015/01/21 22:26:52 deraadt Exp $ */
+/* $OpenBSD: tmpfs_vnops.c,v 1.20 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: tmpfs_vnops.c,v 1.100 2012/11/05 17:27:39 dholland Exp $ */
/*
@@ -1019,7 +1019,7 @@ tmpfs_readlink(void *v)
KASSERT(vp->v_type == VLNK);
node = VP_TO_TMPFS_NODE(vp);
- error = uiomove(node->tn_spec.tn_lnk.tn_link,
+ error = uiomovei(node->tn_spec.tn_lnk.tn_link,
MIN(node->tn_size, uio->uio_resid), uio);
tmpfs_update(node, TMPFS_NODE_ACCESSED);
diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c
index df080241f85..8fe010f7f91 100644
--- a/sys/ufs/ext2fs/ext2fs_lookup.c
+++ b/sys/ufs/ext2fs/ext2fs_lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_lookup.c,v 1.37 2014/07/13 16:59:35 pelikan Exp $ */
+/* $OpenBSD: ext2fs_lookup.c,v 1.38 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */
/*
@@ -178,7 +178,7 @@ ext2fs_readdir(void *v)
break;
}
dstd.d_off = off + e2d_reclen;
- if ((error = uiomove((caddr_t)&dstd, dstd.d_reclen, uio)) != 0) {
+ if ((error = uiomovei((caddr_t)&dstd, dstd.d_reclen, uio)) != 0) {
break;
}
off = off + e2d_reclen;
diff --git a/sys/ufs/ext2fs/ext2fs_readwrite.c b/sys/ufs/ext2fs/ext2fs_readwrite.c
index 007aca48423..598fbc753d5 100644
--- a/sys/ufs/ext2fs/ext2fs_readwrite.c
+++ b/sys/ufs/ext2fs/ext2fs_readwrite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_readwrite.c,v 1.33 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: ext2fs_readwrite.c,v 1.34 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ext2fs_readwrite.c,v 1.16 2001/02/27 04:37:47 chs Exp $ */
/*-
@@ -149,7 +149,7 @@ ext2_ind_read(struct vnode *vp, struct inode *ip, struct m_ext2fs *fs,
break;
xfersize = size;
}
- error = uiomove((char *)bp->b_data + blkoffset, xfersize, uio);
+ error = uiomovei((char *)bp->b_data + blkoffset, xfersize, uio);
if (error)
break;
brelse(bp);
@@ -229,7 +229,7 @@ ext4_ext_read(struct vnode *vp, struct inode *ip, struct m_ext2fs *fs, struct ui
}
xfersize = size;
}
- error = uiomove(bp->b_data + blkoffset, xfersize, uio);
+ error = uiomovei(bp->b_data + blkoffset, xfersize, uio);
brelse(bp);
if (error)
return (error);
@@ -329,7 +329,7 @@ ext2fs_write(void *v)
xfersize = size;
error =
- uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio);
+ uiomovei((char *)bp->b_data + blkoffset, (int)xfersize, uio);
#if 0
if (ioflag & IO_NOCACHE)
bp->b_flags |= B_NOCACHE;
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c
index 974a68fe7ff..90750350230 100644
--- a/sys/ufs/ext2fs/ext2fs_vnops.c
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vnops.c,v 1.70 2015/01/11 03:05:03 guenther Exp $ */
+/* $OpenBSD: ext2fs_vnops.c,v 1.71 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */
/*
@@ -1118,7 +1118,7 @@ ext2fs_readlink(void *v)
isize = ext2fs_size(ip);
if (isize < vp->v_mount->mnt_maxsymlinklen ||
(vp->v_mount->mnt_maxsymlinklen == 0 && ip->i_e2fs_nblock == 0)) {
- return (uiomove((char *)ip->i_e2din->e2di_shortlink, isize,
+ return (uiomovei((char *)ip->i_e2din->e2di_shortlink, isize,
ap->a_uio));
}
return (VOP_READ(vp, ap->a_uio, 0, ap->a_cred));
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 556760c19bb..8c50deba547 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vnops.c,v 1.78 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: ffs_vnops.c,v 1.79 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */
/*
@@ -265,7 +265,7 @@ ffs_read(void *v)
break;
xfersize = size;
}
- error = uiomove(bp->b_data + blkoffset, (int)xfersize, uio);
+ error = uiomovei(bp->b_data + blkoffset, (int)xfersize, uio);
if (error)
break;
brelse(bp);
@@ -370,7 +370,7 @@ ffs_write(void *v)
xfersize = size;
error =
- uiomove(bp->b_data + blkoffset, xfersize, uio);
+ uiomovei(bp->b_data + blkoffset, xfersize, uio);
if (error != 0)
memset(bp->b_data + blkoffset, 0, xfersize);
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 27594979963..ecd91351eeb 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_vnops.c,v 1.118 2015/01/11 03:05:03 guenther Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.119 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
@@ -1506,7 +1506,7 @@ ufs_readdir(void *v)
memset(u.dn.d_name + u.dn.d_namlen, 0, u.dn.d_reclen
- u.dn.d_namlen - offsetof(struct dirent, d_name));
- error = uiomove(&u.dn, u.dn.d_reclen, uio);
+ error = uiomovei(&u.dn, u.dn.d_reclen, uio);
dp = (struct direct *)((char *)dp + dp->d_reclen);
}
@@ -1539,7 +1539,7 @@ ufs_readlink(void *v)
isize = DIP(ip, size);
if (isize < vp->v_mount->mnt_maxsymlinklen ||
(vp->v_mount->mnt_maxsymlinklen == 0 && DIP(ip, blocks) == 0)) {
- return (uiomove((char *)SHORTLINK(ip), isize, ap->a_uio));
+ return (uiomovei((char *)SHORTLINK(ip), isize, ap->a_uio));
}
return (VOP_READ(vp, ap->a_uio, 0, ap->a_cred));
}
diff --git a/sys/uvm/uvm_io.c b/sys/uvm/uvm_io.c
index 1a64b547b90..b93a04ff211 100644
--- a/sys/uvm/uvm_io.c
+++ b/sys/uvm/uvm_io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_io.c,v 1.23 2014/09/14 14:17:27 jsg Exp $ */
+/* $OpenBSD: uvm_io.c,v 1.24 2015/02/10 21:56:10 miod Exp $ */
/* $NetBSD: uvm_io.c,v 1.12 2000/06/27 17:29:23 mrg Exp $ */
/*
@@ -110,7 +110,7 @@ uvm_io(vm_map_t map, struct uio *uio, int flags)
sz = chunksz - pageoffset;
if (sz > togo)
sz = togo;
- error = uiomove((caddr_t) (kva + pageoffset), sz, uio);
+ error = uiomovei((caddr_t) (kva + pageoffset), sz, uio);
togo -= sz;
baseva += chunksz;