diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-10 22:44:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-10 22:44:36 +0000 |
commit | 3bf91c62c3df54ef58426bd4c994316237fffba7 (patch) | |
tree | bb08e4f164322012ebeb120c3016c537be8d2fe9 /sys/arch/amd64 | |
parent | cedcb61c4089e42a856b6469ce521e060becebc7 (diff) |
Convert to uiomove().
ok guenther@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/mem.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/mem.c b/sys/arch/amd64/amd64/mem.c index 12169e65a87..9836cfc3554 100644 --- a/sys/arch/amd64/amd64/mem.c +++ b/sys/arch/amd64/amd64/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.21 2015/02/10 21:56:08 miod Exp $ */ +/* $OpenBSD: mem.c,v 1.22 2015/02/10 22:44:35 miod Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990, 1993 @@ -123,7 +123,7 @@ mmrw(dev_t dev, struct uio *uio, int flags) { extern vaddr_t kern_end; vaddr_t v; - int c; + size_t c; struct iovec *iov; int error = 0; @@ -141,13 +141,13 @@ 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 = uiomovei((caddr_t)v, uio->uio_resid, uio); + error = uiomove((caddr_t)v, uio->uio_resid, uio); continue; /* minor device 1 is kernel memory */ case 1: v = uio->uio_offset; - c = min(iov->iov_len, MAXPHYS); + c = ulmin(iov->iov_len, MAXPHYS); if (v >= (vaddr_t)&start && v < kern_end) { if (v < (vaddr_t)&etext && uio->uio_rw == UIO_WRITE) @@ -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 = uiomovei((caddr_t)v, c, uio); + error = uiomove((caddr_t)v, c, uio); continue; /* minor device 2 is EOF/RATHOLE */ @@ -174,8 +174,8 @@ mmrw(dev_t dev, struct uio *uio, int flags) if (zeropage == NULL) zeropage = (caddr_t) malloc(PAGE_SIZE, M_TEMP, M_WAITOK|M_ZERO); - c = min(iov->iov_len, PAGE_SIZE); - error = uiomovei(zeropage, c, uio); + c = ulmin(iov->iov_len, PAGE_SIZE); + error = uiomove(zeropage, c, uio); continue; default: |