summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-09-22 16:21:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-09-22 16:21:33 +0000
commita64a0fba9e2c0404ddfd4287f37f5c0a1be565e2 (patch)
treef3d5836b8f295070afdf605e7148ff3afecad398 /sys
parentff4c44726bfd6e9c1fe5b09d86ca20e850023414 (diff)
M_ZERO -> bzero.
ok art@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/alpha/mem.c10
-rw-r--r--sys/arch/aviion/aviion/mem.c19
-rw-r--r--sys/arch/hppa/dev/mem.c9
-rw-r--r--sys/arch/hppa64/dev/mem.c9
-rw-r--r--sys/arch/luna88k/luna88k/mem.c19
-rw-r--r--sys/arch/mac68k/mac68k/mem.c10
-rw-r--r--sys/arch/macppc/macppc/mem.c10
-rw-r--r--sys/arch/mips64/mips64/mem.c10
-rw-r--r--sys/arch/mvme88k/mvme88k/mem.c19
-rw-r--r--sys/arch/mvmeppc/dev/mem.c9
-rw-r--r--sys/arch/solbourne/solbourne/mem.c10
-rw-r--r--sys/arch/sparc/sparc/mem.c10
-rw-r--r--sys/arch/sparc64/sparc64/mem.c10
-rw-r--r--sys/arch/vax/vax/mem.c10
14 files changed, 65 insertions, 99 deletions
diff --git a/sys/arch/alpha/alpha/mem.c b/sys/arch/alpha/alpha/mem.c
index d5d5bc9fc16..a1a6425ae42 100644
--- a/sys/arch/alpha/alpha/mem.c
+++ b/sys/arch/alpha/alpha/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.21 2006/04/13 14:41:08 brad Exp $ */
+/* $OpenBSD: mem.c,v 1.22 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.26 2000/03/29 03:48:20 simonb Exp $ */
/*
@@ -197,11 +197,9 @@ kmemphys:
* On the first call, allocate and zero a page
* of memory for use with /dev/zero.
*/
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
break;
diff --git a/sys/arch/aviion/aviion/mem.c b/sys/arch/aviion/aviion/mem.c
index 3440e06a780..d0181c9793a 100644
--- a/sys/arch/aviion/aviion/mem.c
+++ b/sys/arch/aviion/aviion/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.1 2006/04/18 12:42:03 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.2 2007/09/22 16:21:32 krw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -154,12 +154,9 @@ mmrw(dev, uio, flags)
* and EFAULT for writes.
*/
if (uio->uio_rw == UIO_READ) {
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP,
- M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE,
+ M_TEMP, M_WAITOK | M_ZERO);
c = min(c, NBPG - (int)v);
v = (vaddr_t)zeropage;
} else
@@ -183,11 +180,9 @@ mmrw(dev, uio, flags)
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/hppa/dev/mem.c b/sys/arch/hppa/dev/mem.c
index 1fc411dd313..83bfb147613 100644
--- a/sys/arch/hppa/dev/mem.c
+++ b/sys/arch/hppa/dev/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.29 2007/09/22 09:57:40 martin Exp $ */
+/* $OpenBSD: mem.c,v 1.30 2007/09/22 16:21:32 krw Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -383,10 +383,9 @@ mmrw(dev, uio, flags)
* On the first call, allocate and zero a page
* of memory for use with /dev/zero.
*/
- if (zeropage == NULL) {
- zeropage = malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
break;
diff --git a/sys/arch/hppa64/dev/mem.c b/sys/arch/hppa64/dev/mem.c
index d6c0eb17138..6f6d5f7dd95 100644
--- a/sys/arch/hppa64/dev/mem.c
+++ b/sys/arch/hppa64/dev/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.3 2005/11/28 20:13:08 martin Exp $ */
+/* $OpenBSD: mem.c,v 1.4 2007/09/22 16:21:32 krw Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -224,10 +224,9 @@ mmrw(dev, uio, flags)
* On the first call, allocate and zero a page
* of memory for use with /dev/zero.
*/
- if (zeropage == NULL) {
- zeropage = malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
break;
diff --git a/sys/arch/luna88k/luna88k/mem.c b/sys/arch/luna88k/luna88k/mem.c
index d9629edad9a..1be671fdc97 100644
--- a/sys/arch/luna88k/luna88k/mem.c
+++ b/sys/arch/luna88k/luna88k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.3 2004/05/07 15:30:02 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.4 2007/09/22 16:21:32 krw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -155,12 +155,9 @@ mmrw(dev, uio, flags)
* and EFAULT for writes.
*/
if (uio->uio_rw == UIO_READ) {
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP,
- M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE,
+ M_TEMP, M_WAITOK | M_ZERO);
c = min(c, NBPG - (int)v);
v = (vaddr_t)zeropage;
} else
@@ -184,11 +181,9 @@ mmrw(dev, uio, flags)
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/mac68k/mac68k/mem.c b/sys/arch/mac68k/mac68k/mem.c
index 1f297fcb3fb..6e5a8aecbe8 100644
--- a/sys/arch/mac68k/mac68k/mem.c
+++ b/sys/arch/mac68k/mac68k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.20 2005/10/23 19:00:26 martin Exp $ */
+/* $OpenBSD: mem.c,v 1.21 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.22 1999/03/27 00:30:07 mycroft Exp $ */
/*
@@ -179,11 +179,9 @@ mmrw(dev, uio, flags)
* On the first call, allocate and zero a page
* of memory for use with /dev/zero.
*/
- if (devzeropage == NULL) {
- devzeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(devzeropage, PAGE_SIZE);
- }
+ if (devzeropage == NULL)
+ devzeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(devzeropage, c, uio);
continue;
diff --git a/sys/arch/macppc/macppc/mem.c b/sys/arch/macppc/macppc/mem.c
index 8f421626a0c..bfb629b7cd9 100644
--- a/sys/arch/macppc/macppc/mem.c
+++ b/sys/arch/macppc/macppc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.13 2005/12/17 07:31:26 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.14 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -151,11 +151,9 @@ mmrw(dev_t dev, struct uio *uio, int flags)
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)malloc(PAGE_SIZE, M_TEMP,
- M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/mips64/mips64/mem.c b/sys/arch/mips64/mips64/mem.c
index 4b390ff764e..7e5c3684e01 100644
--- a/sys/arch/mips64/mips64/mem.c
+++ b/sys/arch/mips64/mips64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.7 2007/05/03 19:34:00 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.8 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -184,11 +184,9 @@ mmrw(dev_t dev, struct uio *uio, int flags)
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/mvme88k/mvme88k/mem.c b/sys/arch/mvme88k/mvme88k/mem.c
index bfb5e71f9b4..9141ffc37b1 100644
--- a/sys/arch/mvme88k/mvme88k/mem.c
+++ b/sys/arch/mvme88k/mvme88k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.22 2004/08/02 08:35:00 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.23 2007/09/22 16:21:32 krw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -154,12 +154,9 @@ mmrw(dev, uio, flags)
* and EFAULT for writes.
*/
if (uio->uio_rw == UIO_READ) {
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP,
- M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE,
+ M_TEMP, M_WAITOK | M_ZERO);
c = min(c, NBPG - (int)v);
v = (vaddr_t)zeropage;
} else
@@ -183,11 +180,9 @@ mmrw(dev, uio, flags)
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/mvmeppc/dev/mem.c b/sys/arch/mvmeppc/dev/mem.c
index 0f466ec6ab6..52630da8254 100644
--- a/sys/arch/mvmeppc/dev/mem.c
+++ b/sys/arch/mvmeppc/dev/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.8 2005/12/17 07:31:26 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.9 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -133,10 +133,9 @@ mmrw(dev, uio, flags)
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/solbourne/solbourne/mem.c b/sys/arch/solbourne/solbourne/mem.c
index af70d63729f..d8eb8658bfa 100644
--- a/sys/arch/solbourne/solbourne/mem.c
+++ b/sys/arch/solbourne/solbourne/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.1 2005/04/19 21:30:18 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.2 2007/09/22 16:21:32 krw Exp $ */
/* OpenBSD: mem.c,v 1.21 2003/06/02 23:27:55 millert Exp */
/*
@@ -183,11 +183,9 @@ mmrw(dev, uio, flags)
uio->uio_resid = 0;
return 0;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/sparc/sparc/mem.c b/sys/arch/sparc/sparc/mem.c
index b32429a73e8..1069bc191cb 100644
--- a/sys/arch/sparc/sparc/mem.c
+++ b/sys/arch/sparc/sparc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.21 2003/06/02 23:27:55 millert Exp $ */
+/* $OpenBSD: mem.c,v 1.22 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.13 1996/03/30 21:12:16 christos Exp $ */
/*
@@ -193,11 +193,9 @@ mmrw(dev, uio, flags)
uio->uio_resid = 0;
return 0;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;
diff --git a/sys/arch/sparc64/sparc64/mem.c b/sys/arch/sparc64/sparc64/mem.c
index 07739c3333f..7f301dd2bbf 100644
--- a/sys/arch/sparc64/sparc64/mem.c
+++ b/sys/arch/sparc64/sparc64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.9 2007/01/12 22:09:08 kettenis Exp $ */
+/* $OpenBSD: mem.c,v 1.10 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.18 2001/04/24 04:31:12 thorpej Exp $ */
/*
@@ -170,11 +170,9 @@ mmrw(dev, uio, flags)
uio->uio_resid = 0;
return(0);
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(NBPG, M_TEMP, M_WAITOK);
- bzero(zeropage, NBPG);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(NBPG, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, NBPG);
error = uiomove(zeropage, c, uio);
break;
diff --git a/sys/arch/vax/vax/mem.c b/sys/arch/vax/vax/mem.c
index f41ee6a3752..036fae831d6 100644
--- a/sys/arch/vax/vax/mem.c
+++ b/sys/arch/vax/vax/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.14 2005/11/06 22:21:33 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.15 2007/09/22 16:21:32 krw Exp $ */
/* $NetBSD: mem.c,v 1.15 1999/03/24 05:51:17 mrg Exp $ */
/*
@@ -146,11 +146,9 @@ mmrw(dev, uio, flags)
c = iov->iov_len;
break;
}
- if (zeropage == NULL) {
- zeropage = (caddr_t)
- malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
- bzero(zeropage, PAGE_SIZE);
- }
+ if (zeropage == NULL)
+ zeropage = malloc(PAGE_SIZE, M_TEMP,
+ M_WAITOK | M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(zeropage, c, uio);
continue;