summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-01-31 22:39:46 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-01-31 22:39:46 +0000
commita38d8533b3aa82f6262c91f32abc928a5f07c4aa (patch)
tree41a4e0e6536bc62976871cd488d78d7096f55a0d /sys
parent90ee86a428707f4f1f502ddab8da4100aa71e976 (diff)
based on art's sparc patch:
mmap should return -1 on failure, not EOPNOTSUPP. As it was now, an mmap of /dev/mem always returned page 45.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amiga/amiga/mem.c4
-rw-r--r--sys/arch/atari/atari/mem.c3
-rw-r--r--sys/arch/hp300/dev/grf.c6
-rw-r--r--sys/arch/hppa/gsc/gscbus.c4
-rw-r--r--sys/arch/kbus/kbus/mem.c3
-rw-r--r--sys/arch/mips/mips/mem.c5
-rw-r--r--sys/arch/mvme88k/mvme88k/mem.c5
-rw-r--r--sys/arch/pc532/pc532/mem.c3
-rw-r--r--sys/arch/pmax/pmax/mem.c5
-rw-r--r--sys/arch/powerpc/powerpc/mem.c5
-rw-r--r--sys/arch/wgrisc/wgrisc/mem.c5
-rw-r--r--sys/dev/pci/brooktree848.c4
12 files changed, 23 insertions, 29 deletions
diff --git a/sys/arch/amiga/amiga/mem.c b/sys/arch/amiga/amiga/mem.c
index 990281a87d1..cacf33b9795 100644
--- a/sys/arch/amiga/amiga/mem.c
+++ b/sys/arch/amiga/amiga/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.10 2000/05/27 20:46:51 art Exp $ */
+/* $OpenBSD: mem.c,v 1.11 2001/01/31 22:39:39 jason Exp $ */
/* $NetBSD: mem.c,v 1.18 1997/02/02 07:17:14 thorpej Exp $ */
/*
@@ -253,7 +253,7 @@ mmmmap(dev, off, prot)
int off;
int prot;
{
- return (EOPNOTSUPP);
+ return (-1);
}
int
diff --git a/sys/arch/atari/atari/mem.c b/sys/arch/atari/atari/mem.c
index b83e269abfa..8159d371664 100644
--- a/sys/arch/atari/atari/mem.c
+++ b/sys/arch/atari/atari/mem.c
@@ -199,8 +199,7 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
-
- return (EOPNOTSUPP);
+ return (-1);
}
int
diff --git a/sys/arch/hp300/dev/grf.c b/sys/arch/hp300/dev/grf.c
index ce31812cbd1..81559ec8aff 100644
--- a/sys/arch/hp300/dev/grf.c
+++ b/sys/arch/hp300/dev/grf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grf.c,v 1.7 1998/03/06 17:24:11 millert Exp $ */
+/* $OpenBSD: grf.c,v 1.8 2001/01/31 22:39:41 jason Exp $ */
/* $NetBSD: grf.c,v 1.25 1997/04/02 22:37:30 scottr Exp $ */
/*
@@ -680,7 +680,7 @@ iommap(dev, addrp)
if (grfdebug & (GDB_MMAP|GDB_IOMAP))
printf("iommap(%d): addr %p\n", curproc->p_pid, *addrp);
#endif
- return(EINVAL);
+ return(-1);
}
int
@@ -785,7 +785,7 @@ grflckmmap(dev, addrp)
printf("grflckmmap(%d): addr %p\n",
p->p_pid, *addrp);
#endif
- return(EINVAL);
+ return(-1);
}
int
diff --git a/sys/arch/hppa/gsc/gscbus.c b/sys/arch/hppa/gsc/gscbus.c
index f324c12d334..d7e482d3565 100644
--- a/sys/arch/hppa/gsc/gscbus.c
+++ b/sys/arch/hppa/gsc/gscbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gscbus.c,v 1.9 2000/02/09 05:04:22 mickey Exp $ */
+/* $OpenBSD: gscbus.c,v 1.10 2001/01/31 22:39:41 jason Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -407,5 +407,5 @@ gsc_dmamem_mmap(v, segs, nsegs, off, prot, flags)
int prot;
int flags;
{
- return 0;
+ return (-1);
}
diff --git a/sys/arch/kbus/kbus/mem.c b/sys/arch/kbus/kbus/mem.c
index 8e57ec7f82a..83a5c075ed6 100644
--- a/sys/arch/kbus/kbus/mem.c
+++ b/sys/arch/kbus/kbus/mem.c
@@ -222,8 +222,7 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
-
- return (EOPNOTSUPP);
+ return (-1);
}
int
diff --git a/sys/arch/mips/mips/mem.c b/sys/arch/mips/mips/mem.c
index 73e5a40f57c..4f58f8d6920 100644
--- a/sys/arch/mips/mips/mem.c
+++ b/sys/arch/mips/mips/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 2000/01/30 18:12:55 imp Exp $ */
+/* $OpenBSD: mem.c,v 1.5 2001/01/31 22:39:42 jason Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -185,8 +185,7 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
-
- return (EOPNOTSUPP);
+ return (-1);
}
/*ARGSUSED*/
diff --git a/sys/arch/mvme88k/mvme88k/mem.c b/sys/arch/mvme88k/mvme88k/mem.c
index c33772cc6d0..ce3a74820f0 100644
--- a/sys/arch/mvme88k/mvme88k/mem.c
+++ b/sys/arch/mvme88k/mvme88k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.6 2001/01/13 05:18:59 smurph Exp $ */
+/* $OpenBSD: mem.c,v 1.7 2001/01/31 22:39:42 jason Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -224,8 +224,7 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
-
- return (EOPNOTSUPP);
+ return (-1);
}
/*ARGSUSED*/
diff --git a/sys/arch/pc532/pc532/mem.c b/sys/arch/pc532/pc532/mem.c
index efc7bbe0c62..f89da31cdde 100644
--- a/sys/arch/pc532/pc532/mem.c
+++ b/sys/arch/pc532/pc532/mem.c
@@ -278,8 +278,7 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
-
- return (EOPNOTSUPP);
+ return (-1);
}
/*ARGSUSED*/
diff --git a/sys/arch/pmax/pmax/mem.c b/sys/arch/pmax/pmax/mem.c
index d74e153a40d..9bcf627a429 100644
--- a/sys/arch/pmax/pmax/mem.c
+++ b/sys/arch/pmax/pmax/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.9 2000/07/04 05:46:23 maja Exp $ */
+/* $OpenBSD: mem.c,v 1.10 2001/01/31 22:39:43 jason Exp $ */
/* $NetBSD: mem.c,v 1.7 1995/09/29 21:53:29 jonathan Exp $ */
/*
@@ -179,8 +179,7 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
-
- return (EOPNOTSUPP);
+ return (-1);
}
/*ARGSUSED*/
diff --git a/sys/arch/powerpc/powerpc/mem.c b/sys/arch/powerpc/powerpc/mem.c
index fc4a3021866..a443c06f9a5 100644
--- a/sys/arch/powerpc/powerpc/mem.c
+++ b/sys/arch/powerpc/powerpc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.5 2000/01/14 05:42:17 rahnds Exp $ */
+/* $OpenBSD: mem.c,v 1.6 2001/01/31 22:39:43 jason Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -160,8 +160,9 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
- return EOPNOTSUPP;
+ return (-1);
}
+
/*ARGSUSED*/
int
mmioctl(dev, cmd, data, flags, p)
diff --git a/sys/arch/wgrisc/wgrisc/mem.c b/sys/arch/wgrisc/wgrisc/mem.c
index f45279a487b..e1da82b1857 100644
--- a/sys/arch/wgrisc/wgrisc/mem.c
+++ b/sys/arch/wgrisc/wgrisc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.4 1999/11/22 19:22:03 matthieu Exp $ */
+/* $OpenBSD: mem.c,v 1.5 2001/01/31 22:39:44 jason Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -181,8 +181,7 @@ mmmmap(dev, off, prot)
dev_t dev;
int off, prot;
{
-
- return (EOPNOTSUPP);
+ return (-1);
}
/*ARGSUSED*/
diff --git a/sys/dev/pci/brooktree848.c b/sys/dev/pci/brooktree848.c
index d6463808791..bfb0e1d65a0 100644
--- a/sys/dev/pci/brooktree848.c
+++ b/sys/dev/pci/brooktree848.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brooktree848.c,v 1.17 2000/11/13 22:16:21 aaron Exp $ */
+/* $OpenBSD: brooktree848.c,v 1.18 2001/01/31 22:39:45 jason Exp $ */
/* $Roger: brooktree848.c,v 1.85 1999/06/12 14:54:54 roger Exp $ */
/* BT848 Driver for Brooktree's Bt848, Bt848A, Bt849A, Bt878, Bt879 based cards.
@@ -7354,7 +7354,7 @@ bktr_mmap( dev_t dev, vm_offset_t offset, int nprot )
bktr = (struct bktr_softc*)devclass_get_softc(bktr_devclass, unit);
if (bktr == NULL) {
/* the device is no longer valid/functioning */
- return (ENXIO);
+ return ( -1 );
}
if (nprot & PROT_EXEC)