Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys Pull up mmap paddr_t/off_t changes from trunk.



details:   https://anonhg.NetBSD.org/src/rev/7fff1af25953
branches:  netbsd-1-5
changeset: 488341:7fff1af25953
user:      simonb <simonb%NetBSD.org@localhost>
date:      Fri Jun 30 16:27:37 2000 +0000

description:
Pull up mmap paddr_t/off_t changes from trunk.

diffstat:

 sys/arch/sh3/sh3/mem.c             |  37 +++++++++++++++++--------------------
 sys/arch/sparc/dev/bwtwo.c         |  11 ++++++-----
 sys/arch/sparc/dev/cgeight.c       |  11 ++++++-----
 sys/arch/sparc/dev/cgfour.c        |  11 ++++++-----
 sys/arch/sparc/dev/cgfourteen.c    |  13 +++++++------
 sys/arch/sparc/dev/cgsix.c         |   9 +++++----
 sys/arch/sparc/dev/cgthree.c       |  11 ++++++-----
 sys/arch/sparc/dev/cgtwo.c         |  11 ++++++-----
 sys/arch/sparc/dev/fb.c            |   9 +++++----
 sys/arch/sparc/dev/p9100.c         |  14 +++++++-------
 sys/arch/sparc/dev/tcx.c           |   9 +++++----
 sys/arch/sparc/dev/vme_machdep.c   |   6 +++---
 sys/arch/sparc/include/bus.h       |  10 +++++-----
 sys/arch/sparc/include/fbvar.h     |   4 ++--
 sys/arch/sparc/sparc/iommu.c       |  12 +++++++-----
 sys/arch/sparc/sparc/machdep.c     |   8 +++++---
 sys/arch/sparc/sparc/mem.c         |   9 +++++----
 sys/arch/sparc64/dev/bwtwo.c       |   9 +++++----
 sys/arch/sparc64/dev/cgeight.c     |  11 ++++++-----
 sys/arch/sparc64/dev/cgfour.c      |   9 +++++----
 sys/arch/sparc64/dev/cgfourteen.c  |   9 +++++----
 sys/arch/sparc64/dev/cgsix.c       |   9 +++++----
 sys/arch/sparc64/dev/cgthree.c     |   9 +++++----
 sys/arch/sparc64/dev/cgtwo.c       |   9 +++++----
 sys/arch/sparc64/dev/fb.c          |   9 +++++----
 sys/arch/sparc64/dev/psycho.c      |   4 ++--
 sys/arch/sparc64/dev/tcx.c         |   7 ++++---
 sys/arch/sparc64/include/bus.h     |  10 +++++-----
 sys/arch/sparc64/include/fbvar.h   |   4 ++--
 sys/arch/sparc64/sparc64/machdep.c |   8 +++++---
 sys/arch/sparc64/sparc64/mem.c     |   7 ++++---
 sys/arch/sun3/dev/bw2.c            |   7 ++++---
 sys/arch/sun3/dev/cg2.c            |   9 +++++----
 sys/arch/sun3/dev/cg4.c            |   6 +++---
 sys/arch/sun3/dev/fb.c             |   7 ++++---
 sys/arch/sun3/dev/fbvar.h          |   4 ++--
 sys/arch/sun3/sun3/mem.c           |  35 +++++++++++++++++------------------
 sys/arch/sun3/sun3x/mem.c          |  35 +++++++++++++++++------------------
 sys/arch/vax/include/bus.h         |  10 +++++-----
 sys/arch/vax/vax/bus_dma.c         |   8 +++++---
 sys/arch/vax/vax/mem.c             |  36 +++++++++++-------------------------
 sys/arch/vax/vsa/smg.c             |   6 +++---
 sys/arch/x68k/dev/grf.c            |  13 +++++++------
 sys/arch/x68k/include/bus.h        |  10 +++++-----
 sys/arch/x68k/x68k/bus.c           |   8 +++++---
 sys/arch/x68k/x68k/mem.c           |   7 ++++---
 sys/dev/audio.c                    |  18 ++++++++++--------
 sys/dev/audio_if.h                 |   4 ++--
 sys/dev/ic/ad1848var.h             |   4 ++--
 sys/dev/ic/interwave.c             |   6 +++---
 sys/dev/ic/interwavevar.h          |   4 ++--
 sys/dev/ic/rrunner.c               |   4 ++--
 sys/dev/ic/vga.c                   |  10 +++++-----
 sys/dev/isa/ad1848_isa.c           |   6 +++---
 sys/dev/isa/ad1848var.h            |   4 ++--
 sys/dev/isa/ega.c                  |   6 +++---
 sys/dev/isa/ess.c                  |   8 ++++----
 sys/dev/isa/isadma.c               |  11 ++++++-----
 sys/dev/isa/isadmavar.h            |   8 ++++----
 sys/dev/isa/pcdisplay.c            |   6 +++---
 sys/dev/isa/sbdsp.c                |   6 +++---
 sys/dev/isa/sbdspvar.h             |   4 ++--
 sys/dev/pci/auvia.c                |   8 ++++----
 sys/dev/pci/bktr/bktr_os.c         |  13 +++----------
 sys/dev/pci/cmpci.c                |  10 +++++-----
 sys/dev/pci/cs4280.c               |   8 ++++----
 sys/dev/pci/eap.c                  |   8 ++++----
 sys/dev/pci/eso.c                  |   8 ++++----
 sys/dev/pci/fms.c                  |   8 ++++----
 sys/dev/pci/sv.c                   |   8 ++++----
 sys/dev/pci/tga.c                  |   6 +++---
 sys/dev/tc/bba.c                   |   8 ++++----
 sys/dev/tc/cfb.c                   |  18 +++++++++---------
 sys/dev/tc/mfb.c                   |  18 +++++++++---------
 sys/dev/tc/sfb.c                   |  18 +++++++++---------
 sys/dev/tc/sfbplus.c               |  18 +++++++++---------
 sys/dev/tc/tfb.c                   |  18 +++++++++---------
 sys/dev/tc/xcfb.c                  |  20 ++++++++++----------
 sys/dev/wscons/wsdisplay.c         |   8 ++++----
 sys/dev/wscons/wsdisplayvar.h      |   4 ++--
 sys/sys/conf.h                     |   6 +++---
 sys/uvm/uvm_device.c               |  31 ++++++++++++++-----------------
 82 files changed, 436 insertions(+), 427 deletions(-)

diffs (truncated from 2727 to 300 lines):

diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sh3/sh3/mem.c
--- a/sys/arch/sh3/sh3/mem.c    Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sh3/sh3/mem.c    Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mem.c,v 1.3 1999/12/04 21:21:25 ragge Exp $    */
+/*     $NetBSD: mem.c,v 1.3.4.1 2000/06/30 16:27:37 simonb Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -187,29 +187,26 @@
        return (error);
 }
 
-int
+paddr_t
 mmmmap(dev, off, prot)
        dev_t dev;
-       int off, prot;
+       off_t off;
+       int prot;
 {
        struct proc *p = curproc;       /* XXX */
 
-       switch (minor(dev)) {
-/* minor device 0 is physical memory */
-       case 0:
-               if ((u_int)off > ctob(physmem) &&
-                   suser(p->p_ucred, &p->p_acflag) != 0)
-                       return -1;
-               return sh3_btop((u_int)off);
+       /*
+        * /dev/mem is the only one that makes sense through this
+        * interface.  For /dev/kmem any physaddr we return here
+        * could be transient and hence incorrect or invalid at
+        * a later time.  /dev/null just doesn't make any sense
+        * and /dev/zero is a hack that is handled via the default
+        * pager in mmap().
+        */
+       if (minor(dev) != 0)
+               return (-1);
 
-/* minor device 1 is kernel memory */
-       case 1:
-               /* XXX - writability, executability checks? */
-               if (!uvm_kernacc((caddr_t)off, NBPG, B_READ))
-                       return -1;
-               return sh3_btop(vtophys((u_int)off));
-
-       default:
-               return -1;
-       }
+       if ((u_int)off > ctob(physmem) && suser(p->p_ucred, &p->p_acflag) != 0)
+               return (-1);
+       return (sh3_btop((u_int)off));
 }
diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sparc/dev/bwtwo.c
--- a/sys/arch/sparc/dev/bwtwo.c        Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sparc/dev/bwtwo.c        Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwo.c,v 1.43 2000/03/19 15:38:45 pk Exp $ */
+/*     $NetBSD: bwtwo.c,v 1.43.4.1 2000/06/30 16:27:37 simonb Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -291,10 +291,11 @@
  * Return the address that would map the given device at the given
  * offset, allowing for the given protection, or return -1 for error.
  */
-int
+paddr_t
 bwtwommap(dev, off, prot)
        dev_t dev;
-       int off, prot;
+       off_t off;
+       int prot;
 {
        struct bwtwo_softc *sc = bwtwo_cd.cd_devs[minor(dev)];
        bus_space_handle_t bh;
@@ -302,7 +303,7 @@
        if (off & PGOFSET)
                panic("bwtwommap");
 
-       if ((unsigned)off >= sc->sc_fb.fb_type.fb_size)
+       if (off >= sc->sc_fb.fb_type.fb_size)
                return (-1);
 
        if (bus_space_mmap(sc->sc_bustag,
@@ -311,5 +312,5 @@
                           BUS_SPACE_MAP_LINEAR, &bh))
                return (-1);
 
-       return ((int)bh);
+       return ((paddr_t)bh);
 }
diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sparc/dev/cgeight.c
--- a/sys/arch/sparc/dev/cgeight.c      Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sparc/dev/cgeight.c      Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgeight.c,v 1.21 2000/04/04 21:47:17 pk Exp $  */
+/*     $NetBSD: cgeight.c,v 1.21.4.1 2000/06/30 16:27:37 simonb Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -417,14 +417,15 @@
  * goes. Starting at 8MB, it maps the ramdac for NBPG, then the p4
  * register for NBPG, then the bootrom for 0x40000.
  */
-int
+paddr_t
 cgeightmmap(dev, off, prot)
        dev_t dev;
-       int off, prot;
+       off_t off;
+       int prot;
 {
        struct cgeight_softc *sc = cgeight_cd.cd_devs[minor(dev)];
        bus_space_handle_t bh;
-       int poff;
+       off_t poff;
 
 #define START_ENABLE   (128*1024)
 #define START_COLOR    ((128*1024) + (128*1024))
@@ -497,7 +498,7 @@
                           BUS_SPACE_MAP_LINEAR, &bh))
                return (-1);
 
-       return ((int)bh);
+       return ((paddr_t)bh);
 }
 
 #if defined(SUN4)
diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sparc/dev/cgfour.c
--- a/sys/arch/sparc/dev/cgfour.c       Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sparc/dev/cgfour.c       Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgfour.c,v 1.21 2000/04/04 21:47:17 pk Exp $   */
+/*     $NetBSD: cgfour.c,v 1.21.4.1 2000/06/30 16:27:37 simonb Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -417,14 +417,15 @@
  * As well, mapping at an offset of 0x04000000 causes the cg4 to map
  * only it's colour plane, at 0.
  */
-int
+paddr_t
 cgfourmmap(dev, off, prot)
        dev_t dev;
-       int off, prot;
+       off_t off;
+       int prot;
 {
        struct cgfour_softc *sc = cgfour_cd.cd_devs[minor(dev)];
        bus_space_handle_t bh;
-       int poff;
+       off_t poff;
 
 #define START_ENABLE   (128*1024)
 #define START_COLOR    ((128*1024) + (128*1024))
@@ -474,7 +475,7 @@
                           BUS_SPACE_MAP_LINEAR, &bh))
                return (-1);
 
-       return ((int)bh);
+       return ((paddr_t)bh);
 }
 
 #if defined(SUN4)
diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sparc/dev/cgfourteen.c
--- a/sys/arch/sparc/dev/cgfourteen.c   Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sparc/dev/cgfourteen.c   Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgfourteen.c,v 1.16 2000/03/19 15:38:45 pk Exp $ */
+/*     $NetBSD: cgfourteen.c,v 1.16.4.1 2000/06/30 16:27:38 simonb Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -531,10 +531,11 @@
  * tell the chip to ignore the X channel. XXX where does it get the X value
  * to use?
  */
-int
+paddr_t
 cgfourteenmmap(dev, off, prot)
        dev_t dev;
-       int off, prot;
+       off_t off;
+       int prot;
 {
        struct cgfourteen_softc *sc = cgfourteen_cd.cd_devs[minor(dev)];
        bus_space_handle_t bh;
@@ -562,7 +563,7 @@
                                   BUS_SPACE_MAP_LINEAR, &bh))
                        return (-1);
 
-               return ((int)bh);
+               return ((off_t)bh);
        }
 #endif
        
@@ -579,7 +580,7 @@
        else
                off = 0;
 
-       if ((unsigned)off >= sc->sc_fb.fb_type.fb_size *
+       if (off >= sc->sc_fb.fb_type.fb_size *
                sc->sc_fb.fb_type.fb_depth/8) {
 #ifdef DEBUG
                printf("\nmmap request out of bounds: request 0x%x, "
@@ -595,7 +596,7 @@
                           BUS_SPACE_MAP_LINEAR, &bh))
                return (-1);
 
-       return ((int)bh);
+       return ((paddr_t)bh);
 }
 
 int
diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sparc/dev/cgsix.c
--- a/sys/arch/sparc/dev/cgsix.c        Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sparc/dev/cgsix.c        Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsix.c,v 1.50 2000/04/16 22:17:03 pk Exp $ */
+/*     $NetBSD: cgsix.c,v 1.50.4.1 2000/06/30 16:27:38 simonb Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -875,10 +875,11 @@
  *
  * XXX needs testing against `demanding' applications (e.g., aviator)
  */
-int
+paddr_t
 cgsixmmap(dev, off, prot)
        dev_t dev;
-       int off, prot;
+       off_t off;
+       int prot;
 {
        struct cgsix_softc *sc = cgsix_cd.cd_devs[minor(dev)];
        struct mmo *mo;
@@ -920,7 +921,7 @@
                                           BUS_SPACE_MAP_LINEAR, &bh))
                                return (-1);
 
-                       return ((int)bh);
+                       return ((paddr_t)bh);
                }
        }
 
diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sparc/dev/cgthree.c
--- a/sys/arch/sparc/dev/cgthree.c      Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sparc/dev/cgthree.c      Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgthree.c,v 1.45 2000/04/16 21:01:43 pk Exp $ */
+/*     $NetBSD: cgthree.c,v 1.45.4.1 2000/06/30 16:27:38 simonb Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -551,10 +551,11 @@
  * As well, mapping at an offset of 0x04000000 causes the cg3 to be
  * mapped in flat mode without the cg4 emulation.
  */
-int
+paddr_t
 cgthreemmap(dev, off, prot)
        dev_t dev;
-       int off, prot;
+       off_t off;
+       int prot;
 {
        struct cgthree_softc *sc = cgthree_cd.cd_devs[minor(dev)];
        bus_space_handle_t bh;
@@ -573,7 +574,7 @@
        else
                off = 0;
 
-       if ((unsigned)off >= sc->sc_fb.fb_type.fb_size)
+       if (off >= sc->sc_fb.fb_type.fb_size)
                return (-1);
 
        if (bus_space_mmap(sc->sc_bustag,
@@ -582,5 +583,5 @@
                           BUS_SPACE_MAP_LINEAR, &bh))
                return (-1);
 
-       return ((int)bh);
+       return ((paddr_t)bh);
 }
diff -r a8930b1e7335 -r 7fff1af25953 sys/arch/sparc/dev/cgtwo.c
--- a/sys/arch/sparc/dev/cgtwo.c        Fri Jun 30 16:27:36 2000 +0000
+++ b/sys/arch/sparc/dev/cgtwo.c        Fri Jun 30 16:27:37 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgtwo.c,v 1.31 2000/03/19 15:38:45 pk Exp $ */
+/*     $NetBSD: cgtwo.c,v 1.31.4.1 2000/06/30 16:27:38 simonb Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -403,10 +403,11 @@
  * Return the address that would map the given device at the given



Home | Main Index | Thread Index | Old Index