diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-11-16 10:03:17 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-11-16 10:03:17 +0000 |
commit | aa90c5d4ef2112066d4c6cb49fc29fbf36891670 (patch) | |
tree | 7615d52c6241004faef5062b5bb4fc706af30d98 /sys | |
parent | 633b91f1c688c785303b6fcba45c234c0f650f1f (diff) |
Optimize the case of writing to /dev/zero like we do in for /dev/null
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc/sparc/mem.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/sparc/sparc/mem.c b/sys/arch/sparc/sparc/mem.c index c54ea77c0d7..5909a72595d 100644 --- a/sys/arch/sparc/sparc/mem.c +++ b/sys/arch/sparc/sparc/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.7 1999/09/03 18:01:59 art Exp $ */ +/* $OpenBSD: mem.c,v 1.8 1999/11/16 10:03:16 art Exp $ */ /* $NetBSD: mem.c,v 1.13 1996/03/30 21:12:16 christos Exp $ */ /* @@ -135,10 +135,12 @@ mmrw(dev, uio, flags) /* minor device 0 is physical memory */ case 0: pa = uio->uio_offset; +#if 0 if (!pmap_pa_exists(pa)) { error = EFAULT; goto unlock; } +#endif pmap_enter(pmap_kernel(), (vaddr_t)vmmap, trunc_page(pa), uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE, TRUE, 0); @@ -195,8 +197,8 @@ mmrw(dev, uio, flags) /* minor device 12 (/dev/zero) is source of nulls on read, rathole on write */ case 12: if (uio->uio_rw == UIO_WRITE) { - c = iov->iov_len; - break; + uio->uio_resid = 0; + return 0; } if (zeropage == NULL) { zeropage = (caddr_t) @@ -218,7 +220,9 @@ mmrw(dev, uio, flags) uio->uio_resid -= c; } if (minor(dev) == 0) { +#if 0 unlock: +#endif if (physlock > 1) wakeup((caddr_t)&physlock); physlock = 0; |