svn commit: r201223 - in head/sys: amd64/amd64 arm/arm dev/adlink dev/agp dev/bktr dev/drm dev/fb dev/firewire dev/hifn dev/ksyms dev/sound/pcm dev/syscons dev/tdfx i386/i386 i386/xbox ia64/ia64 is...

Robert Noland rnoland at FreeBSD.org
Tue Dec 29 21:51:29 UTC 2009


Author: rnoland
Date: Tue Dec 29 21:51:28 2009
New Revision: 201223
URL: http://svn.freebsd.org/changeset/base/201223

Log:
  Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.
  
  This replaces d_mmap() with the d_mmap2() implementation and also
  changes the type of offset to vm_ooffset_t.
  
  Purge d_mmap2().
  
  All driver modules will need to be rebuilt since D_VERSION is also
  bumped.
  
  Reviewed by:	jhb@
  MFC after:	Not in this lifetime...

Modified:
  head/sys/amd64/amd64/mem.c
  head/sys/arm/arm/mem.c
  head/sys/dev/adlink/adlink.c
  head/sys/dev/agp/agp.c
  head/sys/dev/bktr/bktr_os.c
  head/sys/dev/drm/drm_vm.c
  head/sys/dev/fb/creator.c
  head/sys/dev/fb/fb.c
  head/sys/dev/fb/fbreg.h
  head/sys/dev/fb/machfb.c
  head/sys/dev/fb/s3_pci.c
  head/sys/dev/fb/vesa.c
  head/sys/dev/fb/vga.c
  head/sys/dev/fb/vgareg.h
  head/sys/dev/firewire/fwdev.c
  head/sys/dev/firewire/fwmem.c
  head/sys/dev/hifn/hifn7751.c
  head/sys/dev/ksyms/ksyms.c
  head/sys/dev/sound/pcm/dsp.c
  head/sys/dev/syscons/syscons.c
  head/sys/dev/tdfx/tdfx_pci.c
  head/sys/i386/i386/elan-mmcr.c
  head/sys/i386/i386/mem.c
  head/sys/i386/xbox/xboxfb.c
  head/sys/ia64/ia64/mem.c
  head/sys/isa/vga_isa.c
  head/sys/kern/kern_conf.c
  head/sys/kern/subr_devstat.c
  head/sys/kern/tty.c
  head/sys/mips/mips/mem.c
  head/sys/pc98/cbus/gdc.c
  head/sys/powerpc/ofw/ofw_syscons.c
  head/sys/powerpc/powerpc/mem.c
  head/sys/sys/conf.h
  head/sys/sys/ttydevsw.h
  head/sys/vm/device_pager.c

Modified: head/sys/amd64/amd64/mem.c
==============================================================================
--- head/sys/amd64/amd64/mem.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/amd64/amd64/mem.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -144,8 +144,8 @@ kmemphys:
  */
 /* ARGSUSED */
 int
-memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot __unused)
+memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot __unused, vm_memattr_t *memattr __unused)
 {
 	if (dev2unit(dev) == CDEV_MINOR_MEM)
 		*paddr = offset;

Modified: head/sys/arm/arm/mem.c
==============================================================================
--- head/sys/arm/arm/mem.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/arm/arm/mem.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -153,8 +153,8 @@ memrw(struct cdev *dev, struct uio *uio,
 /* ARGSUSED */
 
 int
-memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot __unused)
+memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot __unused, vm_memattr_t *memattr __unused)
 {
 	if (dev2unit(dev) == CDEV_MINOR_MEM)
 		*paddr = offset;

Modified: head/sys/dev/adlink/adlink.c
==============================================================================
--- head/sys/dev/adlink/adlink.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/adlink/adlink.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -161,7 +161,8 @@ adlink_intr(void *arg)
 }
 
 static int
-adlink_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+adlink_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 	struct softc *sc;
 	vm_offset_t o;

Modified: head/sys/dev/agp/agp.c
==============================================================================
--- head/sys/dev/agp/agp.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/agp/agp.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -868,7 +868,8 @@ agp_ioctl(struct cdev *kdev, u_long cmd,
 }
 
 static int
-agp_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+agp_mmap(struct cdev *kdev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	device_t dev = kdev->si_drv1;
 	struct agp_softc *sc = device_get_softc(dev);

Modified: head/sys/dev/bktr/bktr_os.c
==============================================================================
--- head/sys/dev/bktr/bktr_os.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/bktr/bktr_os.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -794,7 +794,8 @@ bktr_ioctl( struct cdev *dev, ioctl_cmd_
  * 
  */
 static int
-bktr_mmap( struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot )
+bktr_mmap( struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr )
 {
 	int		unit;
 	bktr_ptr_t	bktr;

Modified: head/sys/dev/drm/drm_vm.c
==============================================================================
--- head/sys/dev/drm/drm_vm.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/drm/drm_vm.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$");
 #include "dev/drm/drmP.h"
 #include "dev/drm/drm.h"
 
-int drm_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot)
+int drm_mmap(struct cdev *kdev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	struct drm_device *dev = drm_get_device_from_kdev(kdev);
 	struct drm_file *file_priv = NULL;

Modified: head/sys/dev/fb/creator.c
==============================================================================
--- head/sys/dev/fb/creator.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/creator.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -692,8 +692,8 @@ creator_blank_display(video_adapter_t *a
 }
 
 static int
-creator_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot)
+creator_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 
 	return (EINVAL);
@@ -1048,8 +1048,8 @@ creator_fb_ioctl(struct cdev *dev, u_lon
 }
 
 static int
-creator_fb_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot)
+creator_fb_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	struct creator_softc *sc;
 	int i;

Modified: head/sys/dev/fb/fb.c
==============================================================================
--- head/sys/dev/fb/fb.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/fb.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -511,10 +511,10 @@ int genfbioctl(genfb_softc_t *sc, video_
 	return error;
 }
 
-int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_offset_t offset,
-	      vm_offset_t *paddr, int prot)
+int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_ooffset_t offset,
+	      vm_offset_t *paddr, int prot, vm_memattr_t *memattr)
 {
-	return vidd_mmap(adp, offset, paddr, prot);
+	return vidd_mmap(adp, offset, paddr, prot, memattr);
 }
 
 #endif /* FB_INSTALL_CDEV */

Modified: head/sys/dev/fb/fbreg.h
==============================================================================
--- head/sys/dev/fb/fbreg.h	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/fbreg.h	Tue Dec 29 21:51:28 2009	(r201223)
@@ -131,8 +131,8 @@ typedef int vi_blank_display_t(video_ada
 #define V_DISPLAY_STAND_BY	2
 #define V_DISPLAY_SUSPEND	3
 */
-typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset,
-		      vm_paddr_t *paddr, int prot);
+typedef int vi_mmap_t(video_adapter_t *adp, vm_ooffset_t offset,
+		      vm_paddr_t *paddr, int prot, vm_memattr_t *memattr);
 typedef int vi_ioctl_t(video_adapter_t *adp, u_long cmd, caddr_t data);
 typedef int vi_clear_t(video_adapter_t *adp);
 typedef int vi_fill_rect_t(video_adapter_t *adp, int val, int x, int y,
@@ -228,8 +228,9 @@ typedef struct video_switch {
 	    (height), (celsize), (blink))
 #define vidd_blank_display(adp, mode)					\
 	(*vidsw[(adp)->va_index]->blank_display)((adp), (mode))
-#define vidd_mmap(adp, offset, paddr, prot)				\
-	(*vidsw[(adp)->va_index]->mmap)((adp), (offset), (paddr), (prot))
+#define vidd_mmap(adp, offset, paddr, prot, memattr)			\
+	(*vidsw[(adp)->va_index]->mmap)((adp), (offset), (paddr),	\
+	    (prot), (memattr))
 #define vidd_ioctl(adp, cmd, data)					\
 	(*vidsw[(adp)->va_index]->ioctl)((adp), (cmd), (data))
 #define vidd_clear(adp)							\
@@ -317,7 +318,8 @@ int		genfbwrite(genfb_softc_t *sc, video
 int		genfbioctl(genfb_softc_t *sc, video_adapter_t *adp,
 			   u_long cmd, caddr_t arg, int flag, struct thread *td);
 int		genfbmmap(genfb_softc_t *sc, video_adapter_t *adp,
-			  vm_offset_t offset, vm_offset_t *paddr, int prot);
+			  vm_ooffset_t offset, vm_offset_t *paddr,
+			  int prot, vm_memattr_t *memattr);
 
 #endif /* FB_INSTALL_CDEV */
 

Modified: head/sys/dev/fb/machfb.c
==============================================================================
--- head/sys/dev/fb/machfb.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/machfb.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -837,8 +837,8 @@ machfb_blank_display(video_adapter_t *ad
 }
 
 static int
-machfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot)
+machfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	struct machfb_softc *sc;
 	video_info_t *vi;

Modified: head/sys/dev/fb/s3_pci.c
==============================================================================
--- head/sys/dev/fb/s3_pci.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/s3_pci.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -388,10 +388,10 @@ s3lfb_blank_display(video_adapter_t *adp
 }
 
 static int
-s3lfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr,
-	  int prot)
+s3lfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
+	  int prot, vm_memattr_t *memattr)
 {
-	return (*prevvidsw->mmap)(adp, offset, paddr, prot);
+	return (*prevvidsw->mmap)(adp, offset, paddr, prot, memattr);
 }
 
 static int

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/vesa.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -1528,12 +1528,12 @@ vesa_blank_display(video_adapter_t *adp,
 }
 
 static int
-vesa_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr,
-	  int prot)
+vesa_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
+	  int prot, vm_memattr_t *memattr)
 {
 
 #if VESA_DEBUG > 0
-	printf("vesa_mmap(): window:0x%tx, buffer:0x%tx, offset:0x%tx\n", 
+	printf("vesa_mmap(): window:0x%tx, buffer:0x%tx, offset:0x%jx\n", 
 	       adp->va_info.vi_window, adp->va_info.vi_buffer, offset);
 #endif
 
@@ -1546,7 +1546,7 @@ vesa_mmap(video_adapter_t *adp, vm_offse
 		*paddr = adp->va_info.vi_buffer + offset;
 		return (0);
 	}
-	return ((*prevvidsw->mmap)(adp, offset, paddr, prot));
+	return ((*prevvidsw->mmap)(adp, offset, paddr, prot, memattr));
 }
 
 static int

Modified: head/sys/dev/fb/vga.c
==============================================================================
--- head/sys/dev/fb/vga.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/vga.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -144,10 +144,10 @@ vga_ioctl(struct cdev *dev, vga_softc_t 
 }
 
 int
-vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr,
-	 int prot)
+vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset,
+    vm_offset_t *paddr, int prot, vm_memattr_t *memattr)
 {
-	return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot);
+	return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot, memattr);
 }
 
 #endif /* FB_INSTALL_CDEV */
@@ -2465,8 +2465,8 @@ vga_blank_display(video_adapter_t *adp, 
  * all adapters
  */
 static int
-vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr,
-   	     int prot)
+vga_mmap_buf(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
+   	     int prot, vm_memattr_t *memattr)
 {
     if (adp->va_info.vi_flags & V_INFO_LINEAR)
 	return -1;

Modified: head/sys/dev/fb/vgareg.h
==============================================================================
--- head/sys/dev/fb/vgareg.h	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/fb/vgareg.h	Tue Dec 29 21:51:28 2009	(r201223)
@@ -88,8 +88,8 @@ int		vga_read(struct cdev *dev, vga_soft
 int		vga_write(struct cdev *dev, vga_softc_t *sc, struct uio *uio, int flag);
 int		vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cmd, caddr_t arg,
 			  int flag, struct thread *td);
-int		vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_offset_t offset,
-			 vm_offset_t *paddr, int prot);
+int		vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset,
+			 vm_offset_t *paddr, int prot, vm_memattr_t *memattr);
 #endif
 
 extern int	(*vga_sub_configure)(int flags);

Modified: head/sys/dev/firewire/fwdev.c
==============================================================================
--- head/sys/dev/firewire/fwdev.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/firewire/fwdev.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -884,7 +884,8 @@ static int
 #if defined(__DragonFly__) || __FreeBSD_version < 500102
 fw_mmap (struct cdev *dev, vm_offset_t offset, int nproto)
 #else
-fw_mmap (struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto)
+fw_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nproto, vm_memattr_t *memattr)
 #endif
 {  
 
@@ -892,7 +893,7 @@ fw_mmap (struct cdev *dev, vm_offset_t o
 #if defined(__DragonFly__) || __FreeBSD_version < 500102
 		return fwmem_mmap(dev, offset, nproto);
 #else
-		return fwmem_mmap(dev, offset, paddr, nproto);
+		return fwmem_mmap(dev, offset, paddr, nproto, memattr);
 #endif
 
 	return EINVAL;

Modified: head/sys/dev/firewire/fwmem.c
==============================================================================
--- head/sys/dev/firewire/fwmem.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/firewire/fwmem.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -445,7 +445,8 @@ int
 #if defined(__DragonFly__) || __FreeBSD_version < 500102
 fwmem_mmap (struct cdev *dev, vm_offset_t offset, int nproto)
 #else
-fwmem_mmap (struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto)
+fwmem_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nproto, vm_memattr_t *memattr)
 #endif
 {  
 	return EINVAL;

Modified: head/sys/dev/hifn/hifn7751.c
==============================================================================
--- head/sys/dev/hifn/hifn7751.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/hifn/hifn7751.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -2929,8 +2929,8 @@ hifn_write_reg_1(struct hifn_softc *sc, 
  *
  */
 static int
-vulcanpk_mmap(struct cdev *dev, vm_offset_t offset,
-	      vm_paddr_t *paddr, int nprot)
+vulcanpk_mmap(struct cdev *dev, vm_ooffset_t offset,
+	      vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr)
 {
 	struct hifn_softc *sc;
 	vm_paddr_t pd;
@@ -2942,7 +2942,8 @@ vulcanpk_mmap(struct cdev *dev, vm_offse
 	b = rman_get_virtual(sc->sc_bar1res);
 
 #if 0
-	printf("vpk mmap: %p(%08x) offset=%d\n", b, pd, offset);
+	printf("vpk mmap: %p(%016llx) offset=%lld\n", b,
+	    (unsigned long long)pd, offset);
 	hexdump(b, HIFN_1_PUB_MEMEND, "vpk", 0);
 #endif
 

Modified: head/sys/dev/ksyms/ksyms.c
==============================================================================
--- head/sys/dev/ksyms/ksyms.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/ksyms/ksyms.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -589,8 +589,8 @@ ksyms_ioctl(struct cdev *dev, u_long cmd
 
 /* ARGUSED */
 static int
-ksyms_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
-		int prot __unused)
+ksyms_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+		int prot __unused, vm_memattr_t *memattr __unused)
 {
     	struct ksyms_softc *sc;
 	int error;

Modified: head/sys/dev/sound/pcm/dsp.c
==============================================================================
--- head/sys/dev/sound/pcm/dsp.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/sound/pcm/dsp.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -2179,7 +2179,8 @@ dsp_poll(struct cdev *i_dev, int events,
 }
 
 static int
-dsp_mmap(struct cdev *i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+dsp_mmap(struct cdev *i_dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 	struct snddev_info *d;
 	struct pcm_channel *wrch, *rdch, *c;

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/syscons/syscons.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -3431,14 +3431,15 @@ next_code:
 }
 
 static int
-sctty_mmap(struct tty *tp, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+sctty_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
     scr_stat *scp;
 
     scp = sc_get_stat(tp);
     if (scp != scp->sc->cur_scp)
 	return -1;
-    return vidd_mmap(scp->sc->adp, offset, paddr, nprot);
+    return vidd_mmap(scp->sc->adp, offset, paddr, nprot, memattr);
 }
 
 static int

Modified: head/sys/dev/tdfx/tdfx_pci.c
==============================================================================
--- head/sys/dev/tdfx/tdfx_pci.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/dev/tdfx/tdfx_pci.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -421,7 +421,8 @@ tdfx_close(struct cdev *dev, int fflag, 
 }
 
 static int
-tdfx_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+tdfx_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 	/* 
 	 * mmap(2) is called by a user process to request that an area of memory

Modified: head/sys/i386/i386/elan-mmcr.c
==============================================================================
--- head/sys/i386/i386/elan-mmcr.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/i386/i386/elan-mmcr.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -416,7 +416,8 @@ elan_watchdog(void *foo __unused, u_int 
 }
 
 static int
-elan_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+elan_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 
 	if (offset >= 0x1000) 

Modified: head/sys/i386/i386/mem.c
==============================================================================
--- head/sys/i386/i386/mem.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/i386/i386/mem.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -163,8 +163,8 @@ memrw(struct cdev *dev, struct uio *uio,
  */
 /* ARGSUSED */
 int
-memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot __unused)
+memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot __unused, vm_memattr_t *memattr __unused)
 {
 	if (dev2unit(dev) == CDEV_MINOR_MEM)
 		*paddr = offset;

Modified: head/sys/i386/xbox/xboxfb.c
==============================================================================
--- head/sys/i386/xbox/xboxfb.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/i386/xbox/xboxfb.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -521,8 +521,8 @@ xboxfb_blank_display(video_adapter_t *ad
 }
 
 static int
-xboxfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot)
+xboxfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	return (EINVAL);
 }

Modified: head/sys/ia64/ia64/mem.c
==============================================================================
--- head/sys/ia64/ia64/mem.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/ia64/ia64/mem.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -148,7 +148,8 @@ kmemphys:
  * instead of going through read/write
  */
 int
-memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	/*
 	 * /dev/mem is the only one that makes sense through this

Modified: head/sys/isa/vga_isa.c
==============================================================================
--- head/sys/isa/vga_isa.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/isa/vga_isa.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -278,9 +278,11 @@ isavga_ioctl(struct cdev *dev, u_long cm
 }
 
 static int
-isavga_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+isavga_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
-	return (vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, paddr, prot));
+	return (vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, paddr, prot,
+	    memattr));
 }
 
 #endif /* FB_INSTALL_CDEV */

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/kern/kern_conf.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -302,7 +302,7 @@ static struct cdevsw dead_cdevsw = {
 #define no_read		(d_read_t *)enodev
 #define no_write	(d_write_t *)enodev
 #define no_ioctl	(d_ioctl_t *)enodev
-#define no_mmap		(d_mmap2_t *)enodev
+#define no_mmap		(d_mmap_t *)enodev
 #define no_kqfilter	(d_kqfilter_t *)enodev
 #define no_mmap_single	(d_mmap_single_t *)enodev
 
@@ -469,7 +469,7 @@ giant_kqfilter(struct cdev *dev, struct 
 }
 
 static int
-giant_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot,
+giant_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot,
     vm_memattr_t *memattr)
 {
 	struct cdevsw *dsw;
@@ -479,11 +479,8 @@ giant_mmap(struct cdev *dev, vm_offset_t
 	if (dsw == NULL)
 		return (ENXIO);
 	mtx_lock(&Giant);
-	if (dsw->d_gianttrick->d_flags & D_MMAP2)
-		retval = dsw->d_gianttrick->d_mmap2(dev, offset, paddr, nprot,
-		    memattr);
-	else
-		retval = dsw->d_gianttrick->d_mmap(dev, offset, paddr, nprot);
+	retval = dsw->d_gianttrick->d_mmap(dev, offset, paddr, nprot,
+	    memattr);
 	mtx_unlock(&Giant);
 	dev_relthread(dev);
 	return (retval);
@@ -595,8 +592,7 @@ prep_cdevsw(struct cdevsw *devsw)
 		return;
 	}
 
-	if (devsw->d_version != D_VERSION_01 &&
-	    devsw->d_version != D_VERSION_02) {
+	if (devsw->d_version != D_VERSION_03) {
 		printf(
 		    "WARNING: Device driver \"%s\" has wrong version %s\n",
 		    devsw->d_name == NULL ? "???" : devsw->d_name,
@@ -608,18 +604,16 @@ prep_cdevsw(struct cdevsw *devsw)
 		devsw->d_ioctl = dead_ioctl;
 		devsw->d_poll = dead_poll;
 		devsw->d_mmap = dead_mmap;
+		devsw->d_mmap_single = dead_mmap_single;
 		devsw->d_strategy = dead_strategy;
 		devsw->d_dump = dead_dump;
 		devsw->d_kqfilter = dead_kqfilter;
 	}
-	if (devsw->d_version == D_VERSION_01)
-		devsw->d_mmap_single = NULL;
 	
 	if (devsw->d_flags & D_NEEDGIANT) {
 		if (devsw->d_gianttrick == NULL) {
 			memcpy(dsw2, devsw, sizeof *dsw2);
 			devsw->d_gianttrick = dsw2;
-			devsw->d_flags |= D_MMAP2;
 			dsw2 = NULL;
 		}
 	}
@@ -640,7 +634,7 @@ prep_cdevsw(struct cdevsw *devsw)
 	FIXUP(d_write,		no_write,	giant_write);
 	FIXUP(d_ioctl,		no_ioctl,	giant_ioctl);
 	FIXUP(d_poll,		no_poll,	giant_poll);
-	FIXUP(d_mmap2,		no_mmap,	giant_mmap);
+	FIXUP(d_mmap,		no_mmap,	giant_mmap);
 	FIXUP(d_strategy,	no_strategy,	giant_strategy);
 	FIXUP(d_kqfilter,	no_kqfilter,	giant_kqfilter);
 	FIXUP(d_mmap_single,	no_mmap_single,	giant_mmap_single);

Modified: head/sys/kern/subr_devstat.c
==============================================================================
--- head/sys/kern/subr_devstat.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/kern/subr_devstat.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -449,7 +449,8 @@ static TAILQ_HEAD(, statspage)	pagelist 
 static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics");
 
 static int
-devstat_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+devstat_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 	struct statspage *spp;
 

Modified: head/sys/kern/tty.c
==============================================================================
--- head/sys/kern/tty.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/kern/tty.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -603,7 +603,8 @@ ttydev_poll(struct cdev *dev, int events
 }
 
 static int
-ttydev_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+ttydev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 	struct tty *tp = dev->si_drv1;
 	int error;
@@ -613,7 +614,7 @@ ttydev_mmap(struct cdev *dev, vm_offset_
 	error = ttydev_enter(tp);
 	if (error)
 		return (-1);
-	error = ttydevsw_mmap(tp, offset, paddr, nprot);
+	error = ttydevsw_mmap(tp, offset, paddr, nprot, memattr);
 	tty_unlock(tp);
 
 	return (error);
@@ -905,8 +906,8 @@ ttydevsw_defmodem(struct tty *tp, int si
 }
 
 static int
-ttydevsw_defmmap(struct tty *tp, vm_offset_t offset, vm_paddr_t *paddr,
-    int nprot)
+ttydevsw_defmmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 
 	return (-1);

Modified: head/sys/mips/mips/mem.c
==============================================================================
--- head/sys/mips/mips/mem.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/mips/mips/mem.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -173,7 +173,8 @@ memrw(dev, uio, flags)
 
 /*ARGSUSED*/
 int
-memmmap(struct cdev *dev, vm_offset_t off, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_ooffset_t off, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 
 	return (EOPNOTSUPP);

Modified: head/sys/pc98/cbus/gdc.c
==============================================================================
--- head/sys/pc98/cbus/gdc.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/pc98/cbus/gdc.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -395,12 +395,13 @@ gdcioctl(struct cdev *dev, u_long cmd, c
 }
 
 static int
-gdcmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+gdcmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
     gdc_softc_t *sc;
 
     sc = GDC_SOFTC(GDC_UNIT(dev));
-    return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot);
+    return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot, memattr);
 }
 
 #endif /* FB_INSTALL_CDEV */
@@ -1337,8 +1338,8 @@ gdc_blank_display(video_adapter_t *adp, 
  * Mmap frame buffer.
  */
 static int
-gdc_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr,
-	     int prot)
+gdc_mmap_buf(video_adapter_t *adp, vm_ooffset_t offset, vm_offset_t *paddr,
+	     int prot, vm_memattr_t *memattr)
 {
     /* FIXME: is this correct? XXX */
     if (offset > VIDEO_BUF_SIZE - PAGE_SIZE)

Modified: head/sys/powerpc/ofw/ofw_syscons.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_syscons.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/powerpc/ofw/ofw_syscons.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -624,8 +624,8 @@ ofwfb_blank_display(video_adapter_t *adp
 }
 
 static int
-ofwfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_paddr_t *paddr,
-    int prot)
+ofwfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	struct ofwfb_softc *sc;
 	int i;

Modified: head/sys/powerpc/powerpc/mem.c
==============================================================================
--- head/sys/powerpc/powerpc/mem.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/powerpc/powerpc/mem.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -161,7 +161,8 @@ kmem_direct_mapped:	v = uio->uio_offset;
  * instead of going through read/write
  */
 int
-memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int prot, vm_memattr_t *memattr)
 {
 	/*
 	 * /dev/mem is the only one that makes sense through this

Modified: head/sys/sys/conf.h
==============================================================================
--- head/sys/sys/conf.h	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/sys/conf.h	Tue Dec 29 21:51:28 2009	(r201223)
@@ -135,9 +135,7 @@ typedef int d_read_t(struct cdev *dev, s
 typedef int d_write_t(struct cdev *dev, struct uio *uio, int ioflag);
 typedef int d_poll_t(struct cdev *dev, int events, struct thread *td);
 typedef int d_kqfilter_t(struct cdev *dev, struct knote *kn);
-typedef int d_mmap_t(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
-   		     int nprot);
-typedef int d_mmap2_t(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
+typedef int d_mmap_t(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
 		     int nprot, vm_memattr_t *memattr);
 typedef int d_mmap_single_t(struct cdev *cdev, vm_ooffset_t *offset,
     vm_size_t size, struct vm_object **object, int nprot);
@@ -172,7 +170,6 @@ typedef int dumper_t(
 #define D_PSEUDO	0x00200000	/* make_dev() can return NULL */
 #define D_NEEDGIANT	0x00400000	/* driver want Giant */
 #define	D_NEEDMINOR	0x00800000	/* driver uses clone_create() */
-#define	D_MMAP2		0x01000000	/* driver uses d_mmap2() */
 
 /*
  * Version numbers.
@@ -180,7 +177,8 @@ typedef int dumper_t(
 #define D_VERSION_00	0x20011966
 #define D_VERSION_01	0x17032005	/* Add d_uid,gid,mode & kind */
 #define D_VERSION_02	0x28042009	/* Add d_mmap_single */
-#define D_VERSION	D_VERSION_02
+#define D_VERSION_03	0x17122009	/* d_mmap takes memattr,vm_ooffset_t */
+#define D_VERSION	D_VERSION_03
 
 /*
  * Flags used for internal housekeeping
@@ -201,10 +199,7 @@ struct cdevsw {
 	d_write_t		*d_write;
 	d_ioctl_t		*d_ioctl;
 	d_poll_t		*d_poll;
-	union {
-		d_mmap_t		*old;
-		d_mmap2_t		*new;
-	} __d_mmap;
+	d_mmap_t		*d_mmap;
 	d_strategy_t		*d_strategy;
 	dumper_t		*d_dump;
 	d_kqfilter_t		*d_kqfilter;
@@ -222,8 +217,6 @@ struct cdevsw {
 		SLIST_ENTRY(cdevsw)	postfree_list;
 	} __d_giant;
 };
-#define	d_mmap			__d_mmap.old
-#define	d_mmap2			__d_mmap.new
 #define	d_gianttrick		__d_giant.gianttrick
 #define	d_postfree_list		__d_giant.postfree_list
 

Modified: head/sys/sys/ttydevsw.h
==============================================================================
--- head/sys/sys/ttydevsw.h	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/sys/ttydevsw.h	Tue Dec 29 21:51:28 2009	(r201223)
@@ -48,8 +48,8 @@ typedef int tsw_ioctl_t(struct tty *tp, 
     struct thread *td);
 typedef int tsw_param_t(struct tty *tp, struct termios *t);
 typedef int tsw_modem_t(struct tty *tp, int sigon, int sigoff);
-typedef int tsw_mmap_t(struct tty *tp, vm_offset_t offset,
-    vm_paddr_t * paddr, int nprot);
+typedef int tsw_mmap_t(struct tty *tp, vm_ooffset_t offset,
+    vm_paddr_t * paddr, int nprot, vm_memattr_t *memattr);
 typedef void tsw_pktnotify_t(struct tty *tp, char event);
 typedef void tsw_free_t(void *softc);
 
@@ -142,11 +142,12 @@ ttydevsw_modem(struct tty *tp, int sigon
 }
 
 static __inline int
-ttydevsw_mmap(struct tty *tp, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+ttydevsw_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr,
+    int nprot, vm_memattr_t *memattr)
 {
 	MPASS(!tty_gone(tp));
 
-	return tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot);
+	return tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr);
 }
 
 static __inline void

Modified: head/sys/vm/device_pager.c
==============================================================================
--- head/sys/vm/device_pager.c	Tue Dec 29 21:49:11 2009	(r201222)
+++ head/sys/vm/device_pager.c	Tue Dec 29 21:51:28 2009	(r201223)
@@ -93,17 +93,6 @@ dev_pager_init()
 	    UMA_ZONE_NOFREE|UMA_ZONE_VM); 
 }
 
-static __inline int
-dev_mmap(struct cdevsw *csw, struct cdev *dev, vm_offset_t offset,
-    vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr)
-{
-
-	if (csw->d_flags & D_MMAP2)
-		return (csw->d_mmap2(dev, offset, paddr, nprot, memattr));
-	else
-		return (csw->d_mmap(dev, offset, paddr, nprot));
-}
-
 /*
  * MPSAFE
  */
@@ -116,7 +105,7 @@ dev_pager_alloc(void *handle, vm_ooffset
 	vm_pindex_t pindex;
 	unsigned int npages;
 	vm_paddr_t paddr;
-	vm_offset_t off;
+	vm_ooffset_t off;
 	vm_memattr_t dummy;
 	struct cdevsw *csw;
 
@@ -145,7 +134,7 @@ dev_pager_alloc(void *handle, vm_ooffset
 	 */
 	npages = OFF_TO_IDX(size);
 	for (off = foff; npages--; off += PAGE_SIZE)
-		if (dev_mmap(csw, dev, off, &paddr, (int)prot, &dummy) != 0) {
+		if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) {
 			dev_relthread(dev);
 			return (NULL);
 		}
@@ -242,7 +231,7 @@ dev_pager_getpages(object, m, count, req
 	td = curthread;
 	fpop = td->td_fpop;
 	td->td_fpop = NULL;
-	ret = dev_mmap(csw, dev, (vm_offset_t)offset << PAGE_SHIFT, &paddr,
+	ret = csw->d_mmap(dev, (vm_ooffset_t)offset << PAGE_SHIFT, &paddr,
 	    PROT_READ, &memattr);
 	KASSERT(ret == 0, ("dev_pager_getpage: map function returns error"));
 	td->td_fpop = fpop;


More information about the svn-src-head mailing list