Index: alpha/alpha/mem.c
===================================================================
RCS file: /space2/ncvs/src/sys/alpha/alpha/mem.c,v
retrieving revision 1.41
diff -u -p -r1.41 mem.c
--- alpha/alpha/mem.c	11 Oct 2002 14:58:27 -0000	1.41
+++ alpha/alpha/mem.c	24 Feb 2003 00:28:29 -0000
@@ -222,7 +222,7 @@ kmemphys:
 * instead of going through read/write			*
 \*******************************************************/
 static int
-memmmap(dev_t dev, vm_offset_t offset, int prot)
+memmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
 	/*
 	 * /dev/mem is the only one that makes sense through this
@@ -238,7 +238,8 @@ memmmap(dev_t dev, vm_offset_t offset, i
 	 */
 	if ((prot & alpha_pa_access(atop((vm_offset_t)offset))) != prot)
 		return (-1);
-	return (alpha_btop(ALPHA_PHYS_TO_K0SEG(offset)));
+	*paddr = ALPHA_PHYS_TO_K0SEG(offset);
+	return (0);
 }
 
 static int
Index: alpha/alpha/pmap.c
===================================================================
RCS file: /space2/ncvs/src/sys/alpha/alpha/pmap.c,v
retrieving revision 1.120
diff -u -p -r1.120 pmap.c
--- alpha/alpha/pmap.c	13 Feb 2003 07:03:43 -0000	1.120
+++ alpha/alpha/pmap.c	22 Feb 2003 00:42:22 -0000
@@ -2807,13 +2807,6 @@ pmap_page_protect(vm_page_t m, vm_prot_t
 	}
 }
 
-vm_offset_t
-pmap_phys_address(ppn)
-	int ppn;
-{
-	return (alpha_ptob(ppn));
-}
-
 /*
  *	pmap_ts_referenced:
  *
Index: dev/bktr/bktr_os.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/bktr/bktr_os.c,v
retrieving revision 1.31
diff -u -p -r1.31 bktr_os.c
--- dev/bktr/bktr_os.c	9 Dec 2002 09:04:09 -0000	1.31
+++ dev/bktr/bktr_os.c	24 Feb 2003 00:30:02 -0000
@@ -753,7 +753,7 @@ bktr_ioctl( dev_t dev, ioctl_cmd_t cmd, 
  * 
  */
 static int
-bktr_mmap( dev_t dev, vm_offset_t offset, int nprot )
+bktr_mmap( dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot )
 {
 	int		unit;
 	bktr_ptr_t	bktr;
@@ -779,7 +779,8 @@ bktr_mmap( dev_t dev, vm_offset_t offset
 	if (offset >= bktr->alloc_pages * PAGE_SIZE)
 		return( -1 );
 
-	return( atop(vtophys(bktr->bigbuf) + offset) );
+	*paddr = vtophys(bktr->bigbuf) + offset;
+	return( 0 );
 }
 
 static int
Index: dev/drm/drm_vm.h
===================================================================
RCS file: /space2/ncvs/src/sys/dev/drm/drm_vm.h,v
retrieving revision 1.2
diff -u -p -r1.2 drm_vm.h
--- dev/drm/drm_vm.h	29 Apr 2002 00:25:10 -0000	1.2
+++ dev/drm/drm_vm.h	24 Feb 2003 01:42:05 -0000
@@ -5,7 +5,8 @@
 #include <vm/vm.h>
 #include <vm/pmap.h>
 
-static int DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, int prot)
+static int DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr,
+    int prot)
 {
 	drm_device_t	 *dev	 = kdev->si_drv1;
 	drm_device_dma_t *dma	 = dev->dma;
@@ -19,10 +20,11 @@ static int DRM(dma_mmap)(dev_t kdev, vm_
 	physical = dma->pagelist[page];
 
 	DRM_DEBUG("0x%08x (page %lu) => 0x%08lx\n", offset, page, physical);
-	return atop(physical);
+	*paddr = physical;
+	return 0;
 }
 
-int DRM(mmap)(dev_t kdev, vm_offset_t offset, int prot)
+int DRM(mmap)(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
 	drm_device_t	*dev	= kdev->si_drv1;
 	drm_map_t	*map	= NULL;
@@ -43,7 +45,7 @@ int DRM(mmap)(dev_t kdev, vm_offset_t of
 	if (dev->dma
 	    && offset >= 0
 	    && offset < ptoa(dev->dma->page_count))
-		return DRM(dma_mmap)(kdev, offset, prot);
+		return DRM(dma_mmap)(kdev, offset, paddr, prot);
 
 				/* A sequential search of a linked list is
 				   fine here because: 1) there will only be
@@ -72,9 +74,11 @@ int DRM(mmap)(dev_t kdev, vm_offset_t of
 	case _DRM_FRAME_BUFFER:
 	case _DRM_REGISTERS:
 	case _DRM_AGP:
-		return atop(offset);
+		*paddr = offset;
+		return 0;
 	case _DRM_SHM:
-		return atop(vtophys(offset));
+		*paddr = vtophys(offset);
+		return 0;
 	default:
 		return -1;	/* This should never happen. */
 	}
Index: dev/fb/fb.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/fb/fb.c,v
retrieving revision 1.22
diff -u -p -r1.22 fb.c
--- dev/fb/fb.c	19 Feb 2003 05:47:04 -0000	1.22
+++ dev/fb/fb.c	24 Feb 2003 00:25:54 -0000
@@ -501,7 +501,7 @@ fbioctl(dev_t dev, u_long cmd, caddr_t a
 }
 
 static int
-fbmmap(dev_t dev, vm_offset_t offset, int nprot)
+fbmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 	int unit;
 
@@ -509,7 +509,7 @@ fbmmap(dev_t dev, vm_offset_t offset, in
 	if (vidcdevsw[unit] == NULL)
 		return ENXIO;
 	return (*vidcdevsw[unit]->d_mmap)(makedev(0, adapter[unit]->va_minor),
-					  offset, nprot);
+					  offset, paddr, nprot);
 }
 
 #if experimental
@@ -591,9 +591,9 @@ int genfbioctl(genfb_softc_t *sc, video_
 }
 
 int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_offset_t offset,
-	      int prot)
+	      vm_offset_t *paddr, int prot)
 {
-	return (*vidsw[adp->va_index]->mmap)(adp, offset, prot);
+	return (*vidsw[adp->va_index]->mmap)(adp, offset, paddr, prot);
 }
 
 #endif /* FB_INSTALL_CDEV */
Index: dev/fb/fbreg.h
===================================================================
RCS file: /space2/ncvs/src/sys/dev/fb/fbreg.h,v
retrieving revision 1.11
diff -u -p -r1.11 fbreg.h
--- dev/fb/fbreg.h	13 Apr 2002 22:34:15 -0000	1.11
+++ dev/fb/fbreg.h	24 Feb 2003 12:33:46 -0000
@@ -81,7 +81,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, int prot);
+typedef int vi_mmap_t(video_adapter_t *adp, vm_offset_t offset,
+		      vm_offset_t *paddr, int prot);
 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,
@@ -212,7 +213,7 @@ 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, int prot);
+			  vm_offset_t offset, vm_offset_t *paddr, int prot);
 
 #endif /* FB_INSTALL_CDEV */
 
Index: dev/fb/gfb.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/fb/gfb.c,v
retrieving revision 1.2
diff -u -p -r1.2 gfb.c
--- dev/fb/gfb.c	13 Apr 2002 22:34:15 -0000	1.2
+++ dev/fb/gfb.c	24 Feb 2003 13:10:43 -0000
@@ -451,20 +451,14 @@ gfb_set_hw_cursor_shape(video_adapter_t 
 }
 
 int
-gfb_mmap(video_adapter_t *adp, vm_offset_t offset, int prot)
+gfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
-	int error;
 
+	/* XXX */
 	if(offset > adp->va_window_size - PAGE_SIZE)
-		error = ENXIO;
-#ifdef __i386__
-	error = i386_btop(adp->va_info.vi_window + offset);
-#elsif defined(__alpha__)
-	error = alpha_btop(adp->va_info.vi_window + offset);
-#else
-	error = ENXIO;
-#endif
-	return(error);
+		return(ENXIO);
+	*paddr = adp->va_info.vi_window + offset;
+	return(0);
 }
 
 int
Index: dev/fb/s3_pci.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/fb/s3_pci.c,v
retrieving revision 1.3
diff -u -p -r1.3 s3_pci.c
--- dev/fb/s3_pci.c	10 Dec 2001 08:09:41 -0000	1.3
+++ dev/fb/s3_pci.c	24 Feb 2003 00:23:54 -0000
@@ -389,9 +389,10 @@ s3lfb_blank_display(video_adapter_t *adp
 }
 
 static int
-s3lfb_mmap(video_adapter_t *adp, vm_offset_t offset, int prot)
+s3lfb_mmap(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr,
+	  int prot)
 {
-	return (*prevvidsw->mmap)(adp, offset, prot);
+	return (*prevvidsw->mmap)(adp, offset, paddr, prot);
 }
 
 static int
Index: dev/fb/vga.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/fb/vga.c,v
retrieving revision 1.21
diff -u -p -r1.21 vga.c
--- dev/fb/vga.c	19 Feb 2003 05:47:04 -0000	1.21
+++ dev/fb/vga.c	24 Feb 2003 00:21:50 -0000
@@ -133,9 +133,10 @@ vga_ioctl(dev_t dev, vga_softc_t *sc, u_
 }
 
 int
-vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, int prot)
+vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr,
+	 int prot)
 {
-	return genfbmmap(&sc->gensc, sc->adp, offset, prot);
+	return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot);
 }
 
 #endif /* FB_INSTALL_CDEV */
@@ -2449,7 +2450,8 @@ vga_blank_display(video_adapter_t *adp, 
  * all adapters
  */
 static int
-vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, int prot)
+vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr,
+   	     int prot)
 {
     if (adp->va_info.vi_flags & V_INFO_LINEAR)
 	return -1;
@@ -2463,15 +2465,8 @@ vga_mmap_buf(video_adapter_t *adp, vm_of
     if (offset > adp->va_window_size - PAGE_SIZE)
 	return -1;
 
-#ifdef __i386__
-    return i386_btop(adp->va_info.vi_window + offset);
-#endif
-#ifdef __alpha__
-    return alpha_btop(adp->va_info.vi_window + offset);
-#endif
-#ifdef __ia64__
-    return ia64_btop(adp->va_info.vi_window + offset);
-#endif
+    *paddr = adp->va_info.vi_window + offset;
+    return 0;
 }
 
 #ifndef VGA_NO_MODE_CHANGE
Index: dev/fb/vgareg.h
===================================================================
RCS file: /space2/ncvs/src/sys/dev/fb/vgareg.h,v
retrieving revision 1.5
diff -u -p -r1.5 vgareg.h
--- dev/fb/vgareg.h	12 Sep 2001 08:37:05 -0000	1.5
+++ dev/fb/vgareg.h	24 Feb 2003 12:31:43 -0000
@@ -87,7 +87,7 @@ int		vga_write(dev_t dev, vga_softc_t *s
 int		vga_ioctl(dev_t dev, vga_softc_t *sc, u_long cmd, caddr_t arg,
 			  int flag, struct thread *td);
 int		vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset,
-			 int prot);
+			 vm_offset_t *paddr, int prot);
 #endif
 
 extern int	(*vga_sub_configure)(int flags);
Index: dev/firewire/fwdev.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/firewire/fwdev.c,v
retrieving revision 1.19
diff -u -p -r1.19 fwdev.c
--- dev/firewire/fwdev.c	9 Feb 2003 10:14:22 -0000	1.19
+++ dev/firewire/fwdev.c	24 Feb 2003 00:31:51 -0000
@@ -921,13 +921,13 @@ fw_poll(dev_t dev, int events, fw_proc *
 }
 
 static int
-fw_mmap (dev_t dev, vm_offset_t offset, int nproto)
+fw_mmap (dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nproto)
 {  
 	struct firewire_softc *fc;
 	int unit = DEV2UNIT(dev);
 
 	if (DEV_FWMEM(dev))
-		return fwmem_mmap(dev, offset, nproto);
+		return fwmem_mmap(dev, offset, paddr, nproto);
 
 	fc = devclass_get_softc(firewire_devclass, unit);
 
Index: dev/firewire/fwmem.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/firewire/fwmem.c,v
retrieving revision 1.13
diff -u -p -r1.13 fwmem.c
--- dev/firewire/fwmem.c	9 Feb 2003 10:14:22 -0000	1.13
+++ dev/firewire/fwmem.c	24 Feb 2003 00:32:24 -0000
@@ -419,7 +419,7 @@ fwmem_poll (dev_t dev, int events, fw_pr
 	return EINVAL;
 }
 int
-fwmem_mmap (dev_t dev, vm_offset_t offset, int nproto)
+fwmem_mmap (dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nproto)
 {  
 	return EINVAL;
 }
Index: dev/gfb/gfb_pci.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/gfb/gfb_pci.c,v
retrieving revision 1.4
diff -u -p -r1.4 gfb_pci.c
--- dev/gfb/gfb_pci.c	8 Nov 2002 21:04:44 -0000	1.4
+++ dev/gfb/gfb_pci.c	24 Feb 2003 00:43:59 -0000
@@ -313,12 +313,12 @@ pcigfb_ioctl(dev_t dev, u_long cmd, cadd
 }
 
 int
-pcigfb_mmap(dev_t dev, vm_offset_t offset, int prot)
+pcigfb_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
 	struct gfb_softc *sc;
 
 	sc = (struct gfb_softc *)devclass_get_softc(gfb_devclass, minor(dev));
-	return genfbmmap(&sc->gensc, sc->adp, offset, prot);
+	return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot);
 }
 
 #endif /*FB_INSTALL_CDEV*/
Index: dev/sound/pcm/dsp.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/sound/pcm/dsp.c,v
retrieving revision 1.59
diff -u -p -r1.59 dsp.c
--- dev/sound/pcm/dsp.c	11 Feb 2003 16:58:54 -0000	1.59
+++ dev/sound/pcm/dsp.c	24 Feb 2003 00:01:00 -0000
@@ -990,11 +990,10 @@ dsp_poll(dev_t i_dev, int events, struct
 }
 
 static int
-dsp_mmap(dev_t i_dev, vm_offset_t offset, int nprot)
+dsp_mmap(dev_t i_dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 	struct pcm_channel *wrch = NULL, *rdch = NULL, *c;
 	intrmask_t s;
-	int ret;
 
 	if (nprot & PROT_EXEC)
 		return -1;
@@ -1034,11 +1033,11 @@ dsp_mmap(dev_t i_dev, vm_offset_t offset
 	if (!(c->flags & CHN_F_MAPPED))
 		c->flags |= CHN_F_MAPPED;
 
-	ret = atop(vtophys(sndbuf_getbufofs(c->bufsoft, offset)));
+	*paddr = vtophys(sndbuf_getbufofs(c->bufsoft, offset));
 	relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR);
 
 	splx(s);
-	return ret;
+	return 0;
 }
 
 int
Index: dev/syscons/syscons.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/syscons/syscons.c,v
retrieving revision 1.394
diff -u -p -r1.394 syscons.c
--- dev/syscons/syscons.c	20 Feb 2003 20:54:44 -0000	1.394
+++ dev/syscons/syscons.c	24 Feb 2003 01:10:18 -0000
@@ -3364,14 +3368,14 @@ next_code:
 }
 
 static int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
+scmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
     scr_stat *scp;
 
     scp = SC_STAT(dev);
     if (scp != scp->sc->cur_scp)
 	return -1;
-    return (*vidsw[scp->sc->adapter]->mmap)(scp->sc->adp, offset, nprot);
+    return (*vidsw[scp->sc->adapter]->mmap)(scp->sc->adp, offset, paddr, nprot);
 }
 
 static int
Index: dev/tdfx/tdfx_pci.c
===================================================================
RCS file: /space2/ncvs/src/sys/dev/tdfx/tdfx_pci.c,v
retrieving revision 1.22
diff -u -p -r1.22 tdfx_pci.c
--- dev/tdfx/tdfx_pci.c	27 Dec 2002 16:40:54 -0000	1.22
+++ dev/tdfx/tdfx_pci.c	24 Feb 2003 01:45:33 -0000
@@ -441,7 +441,7 @@ tdfx_close(dev_t dev, int fflag, int dev
 }
 
 static int
-tdfx_mmap(dev_t dev, vm_offset_t offset, int nprot)
+tdfx_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 	/* 
 	 * mmap(2) is called by a user process to request that an area of memory
@@ -472,14 +472,17 @@ tdfx_mmap(dev_t dev, vm_offset_t offset,
 	/* We must stay within the bound of our address space */
 	if((offset & 0xff000000) == tdfx_info[0]->addr0) {
 		offset &= 0xffffff;
-		return atop(rman_get_start(tdfx_info[0]->memrange) + offset);
+		*paddr = rman_get_start(tdfx_info[0]->memrange) + offset;
+		return 0;
 	}
 	
 	if(tdfx_count > 1) {
 		tdfx_info[1] = (struct tdfx_softc*)devclass_get_softc(tdfx_devclass, 1);
 		if((offset & 0xff000000) == tdfx_info[1]->addr0) {
 			offset &= 0xffffff;
-			return atop(rman_get_start(tdfx_info[1]->memrange) + offset);
+			*paddr = rman_get_start(tdfx_info[1]->memrange) +
+			    offset;
+			return 0;
 		}
 	}
 
Index: geom/geom_stats.c
===================================================================
RCS file: /space2/ncvs/src/sys/geom/geom_stats.c,v
retrieving revision 1.4
diff -u -p -r1.4 geom_stats.c
--- geom/geom_stats.c	19 Feb 2003 22:51:33 -0000	1.4
+++ geom/geom_stats.c	24 Feb 2003 00:03:10 -0000
@@ -122,15 +122,17 @@ static struct cdevsw geom_stats_cdevsw =
 };
 
 static int
-g_stat_mmap(dev_t dev, vm_offset_t offset, int nprot)
+g_stat_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 	struct statspage *spp;
 
 	if (nprot != VM_PROT_READ)
 		return (-1);
 	TAILQ_FOREACH(spp, &pagelist, list) {
-		if (offset == 0)
-			return (vtophys(spp->stat) >> PAGE_SHIFT);
+		if (offset == 0) {
+			*paddr = vtophys(spp->stat);
+			return (0);
+		}
 		offset -= PAGE_SIZE;
 	}
 	return (-1);
Index: i386/i386/elan-mmcr.c
===================================================================
RCS file: /space2/ncvs/src/sys/i386/i386/elan-mmcr.c,v
retrieving revision 1.10
diff -u -p -r1.10 elan-mmcr.c
--- i386/i386/elan-mmcr.c	19 Feb 2003 20:50:02 -0000	1.10
+++ i386/i386/elan-mmcr.c	24 Feb 2003 00:34:45 -0000
@@ -309,14 +309,15 @@ elan_write(dev_t dev, struct uio *uio, i
 }
 
 static int
-elan_mmap(dev_t dev, vm_offset_t offset, int nprot)
+elan_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 
 	if (minor(dev) != ELAN_MMCR)
 		return (EOPNOTSUPP);
 	if (offset >= 0x1000) 
 		return (-1);
-	return (i386_btop(0xfffef000));
+	*paddr = 0xfffef000;
+	return (0);
 }
 
 static int
Index: i386/i386/mem.c
===================================================================
RCS file: /space2/ncvs/src/sys/i386/i386/mem.c,v
retrieving revision 1.102
diff -u -p -r1.102 mem.c
--- i386/i386/mem.c	19 Feb 2003 05:47:20 -0000	1.102
+++ i386/i386/mem.c	24 Feb 2003 00:08:37 -0000
@@ -215,22 +215,25 @@ mmrw(dev_t dev, struct uio *uio, int fla
 * instead of going through read/write			*
 \*******************************************************/
 static int
-memmmap(dev_t dev, vm_offset_t offset, int prot)
+memmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
 	switch (minor(dev))
 	{
 
 	/* minor device 0 is physical memory */
 	case 0:
-        	return (i386_btop(offset));
+		*paddr = offset;
+		break;
 
 	/* minor device 1 is kernel memory */
 	case 1:
-        	return (i386_btop(vtophys(offset)));
+        	*paddr = vtophys(offset);
+		break;
 
 	default:
 		return (-1);
 	}
+	return (0);
 }
 
 /*
Index: i386/i386/pmap.c
===================================================================
RCS file: /space2/ncvs/src/sys/i386/i386/pmap.c,v
retrieving revision 1.391
diff -u -p -r1.391 pmap.c
--- i386/i386/pmap.c	23 Feb 2003 09:45:50 -0000	1.391
+++ i386/i386/pmap.c	23 Feb 2003 16:46:20 -0000
@@ -3129,13 +3129,6 @@ pmap_page_protect(vm_page_t m, vm_prot_t
 	}
 }
 
-vm_offset_t
-pmap_phys_address(ppn)
-	int ppn;
-{
-	return (i386_ptob(ppn));
-}
-
 /*
  *	pmap_ts_referenced:
  *
Index: i386/isa/spigot.c
===================================================================
RCS file: /space2/ncvs/src/sys/i386/isa/spigot.c,v
retrieving revision 1.55
diff -u -p -r1.55 spigot.c
--- i386/isa/spigot.c	1 Apr 2002 21:30:42 -0000	1.55
+++ i386/isa/spigot.c	24 Feb 2003 00:35:46 -0000
@@ -273,7 +273,7 @@ struct	spigot_softc	*ss = (struct spigot
 }
 
 static	int
-spigot_mmap(dev_t dev, vm_offset_t offset, int nprot)
+spigot_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 struct	spigot_softc	*ss = (struct spigot_softc *)&spigot_softc[0];
 
@@ -285,5 +285,6 @@ struct	spigot_softc	*ss = (struct spigot
 	if(nprot & PROT_EXEC)
 		return -1;
 
-	return i386_btop(ss->maddr);
+	*paddr = ss->maddr;
+	return 0;
 }
Index: i386/isa/vesa.c
===================================================================
RCS file: /space2/ncvs/src/sys/i386/isa/vesa.c,v
retrieving revision 1.40
diff -u -p -r1.40 vesa.c
--- i386/isa/vesa.c	19 Feb 2003 05:47:22 -0000	1.40
+++ i386/isa/vesa.c	24 Feb 2003 01:17:21 -0000
@@ -1278,7 +1278,8 @@ vesa_blank_display(video_adapter_t *adp,
 }
 
 static int
-vesa_mmap(video_adapter_t *adp, vm_offset_t offset, int prot)
+vesa_mmap(video_adapter_t *adp, vm_offset_t offset, vm_offset_t *paddr,
+	  int prot)
 {
 #if VESA_DEBUG > 0
 	printf("vesa_mmap(): window:0x%x, buffer:0x%x, offset:0x%x\n", 
@@ -1290,14 +1291,10 @@ vesa_mmap(video_adapter_t *adp, vm_offse
 		/* XXX: is this correct? */
 		if (offset > adp->va_window_size - PAGE_SIZE)
 			return -1;
-#ifdef __i386__
-		return i386_btop(adp->va_info.vi_buffer + offset);
-#endif
-#ifdef __alpha__ /* XXX */
-		return alpha_btop(adp->va_info.vi_buffer + offset);
-#endif
+		*paddr = adp->va_info.vi_buffer + offset;
+		return 0;
 	} else {
-		return (*prevvidsw->mmap)(adp, offset, prot);
+		return (*prevvidsw->mmap)(adp, offset, paddr, prot);
 	}
 }
 
Index: i386/isa/pcvt/pcvt_drv.c
===================================================================
RCS file: /space2/ncvs/src/sys/i386/isa/pcvt/pcvt_drv.c,v
retrieving revision 1.73
diff -u -p -r1.73 pcvt_drv.c
--- i386/isa/pcvt/pcvt_drv.c	20 Feb 2003 20:54:44 -0000	1.73
+++ i386/isa/pcvt/pcvt_drv.c	24 Feb 2003 00:36:44 -0000
@@ -420,11 +420,12 @@ pcvt_ioctl(dev_t dev, u_long cmd, caddr_
  *	driver mmap
  *---------------------------------------------------------------------------*/
 static int
-pcvt_mmap(dev_t dev, vm_offset_t offset, int nprot)
+pcvt_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 	if (offset > 0x20000 - PAGE_SIZE)
 		return -1;
-	return i386_btop((0xa0000 + offset));
+	*paddr = 0xa0000 + offset;
+	return 0;
 }
 
 /*---------------------------------------------------------------------------*
Index: ia64/ia64/mem.c
===================================================================
RCS file: /space2/ncvs/src/sys/ia64/ia64/mem.c,v
retrieving revision 1.10
diff -u -p -r1.10 mem.c
--- ia64/ia64/mem.c	11 Oct 2002 14:58:29 -0000	1.10
+++ ia64/ia64/mem.c	24 Feb 2003 00:37:24 -0000
@@ -221,7 +221,7 @@ kmemphys:
 * instead of going through read/write			*
 \*******************************************************/
 static int
-memmmap(dev_t dev, vm_offset_t offset, int prot)
+memmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
 	/*
 	 * /dev/mem is the only one that makes sense through this
@@ -237,7 +237,8 @@ memmmap(dev_t dev, vm_offset_t offset, i
 	 */
 	if ((prot & ia64_pa_access(atop((vm_offset_t)offset))) != prot)
 		return (-1);
-	return (ia64_btop(IA64_PHYS_TO_RR7(offset)));
+	*paddr = IA64_PHYS_TO_RR7(offset);
+	return (0);
 }
 
 static int
Index: ia64/ia64/pmap.c
===================================================================
RCS file: /space2/ncvs/src/sys/ia64/ia64/pmap.c,v
retrieving revision 1.94
diff -u -p -r1.94 pmap.c
--- ia64/ia64/pmap.c	19 Feb 2003 05:47:24 -0000	1.94
+++ ia64/ia64/pmap.c	22 Feb 2003 23:21:51 -0000
@@ -2236,12 +2236,6 @@ pmap_page_protect(vm_page_t m, vm_prot_t
 	}
 }
 
-vm_offset_t
-pmap_phys_address(int ppn)
-{
-	return (ia64_ptob(ppn));
-}
-
 /*
  *	pmap_ts_referenced:
  *
Index: isa/vga_isa.c
===================================================================
RCS file: /space2/ncvs/src/sys/isa/vga_isa.c,v
retrieving revision 1.20
diff -u -p -r1.20 vga_isa.c
--- isa/vga_isa.c	12 Sep 2001 08:37:42 -0000	1.20
+++ isa/vga_isa.c	24 Feb 2003 00:09:42 -0000
@@ -196,9 +196,9 @@ isavga_ioctl(dev_t dev, u_long cmd, cadd
 }
 
 static int
-isavga_mmap(dev_t dev, vm_offset_t offset, int prot)
+isavga_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
-	return vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, prot);
+	return vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, paddr, prot);
 }
 
 #endif /* FB_INSTALL_CDEV */
Index: kern/subr_xxx.c
===================================================================
RCS file: /space2/ncvs/src/sys/kern/subr_xxx.c,v
retrieving revision 1.20
diff -u -p -r1.20 subr_xxx.c
--- kern/subr_xxx.c	21 Feb 2003 19:00:48 -0000	1.20
+++ kern/subr_xxx.c	24 Feb 2003 00:04:07 -0000
@@ -132,9 +132,10 @@ nokqfilter(dev, kn)
 }
 
 int
-nommap(dev, offset, nprot)
+nommap(dev, offset, paddr, nprot)
 	dev_t dev;
 	vm_offset_t offset;
+	vm_offset_t *paddr;
 	int nprot;
 {
 
Index: pc98/pc98/pc98gdc.c
===================================================================
RCS file: /space2/ncvs/src/sys/pc98/pc98/pc98gdc.c,v
retrieving revision 1.32
diff -u -p -r1.32 pc98gdc.c
--- pc98/pc98/pc98gdc.c	23 Feb 2003 13:28:44 -0000	1.32
+++ pc98/pc98/pc98gdc.c	24 Feb 2003 00:38:23 -0000
@@ -397,12 +397,12 @@ gdcioctl(dev_t dev, u_long cmd, caddr_t 
 }
 
 static int
-gdcmmap(dev_t dev, vm_offset_t offset, int prot)
+gdcmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
     gdc_softc_t *sc;
 
     sc = GDC_SOFTC(GDC_UNIT(dev));
-    return genfbmmap(&sc->gensc, sc->adp, offset, prot);
+    return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot);
 }
 
 #endif /* FB_INSTALL_CDEV */
Index: pc98/pc98/syscons.c
===================================================================
RCS file: /space2/ncvs/src/sys/pc98/pc98/syscons.c,v
retrieving revision 1.182
diff -u -p -r1.182 syscons.c
--- pc98/pc98/syscons.c	23 Feb 2003 13:29:59 -0000	1.182
+++ pc98/pc98/syscons.c	24 Feb 2003 00:48:55 -0000
@@ -3383,14 +3383,14 @@ next_code:
 }
 
 static int
-scmmap(dev_t dev, vm_offset_t offset, int nprot)
+scmmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
     scr_stat *scp;
 
     scp = SC_STAT(dev);
     if (scp != scp->sc->cur_scp)
 	return -1;
-    return (*vidsw[scp->sc->adapter]->mmap)(scp->sc->adp, offset, nprot);
+    return (*vidsw[scp->sc->adapter]->mmap)(scp->sc->adp, offset, paddr, nprot);
 }
 
 static int
Index: pci/agp.c
===================================================================
RCS file: /space2/ncvs/src/sys/pci/agp.c,v
retrieving revision 1.26
diff -u -p -r1.26 agp.c
--- pci/agp.c	19 Feb 2003 05:47:40 -0000	1.26
+++ pci/agp.c	24 Feb 2003 00:10:46 -0000
@@ -722,14 +722,15 @@ agp_ioctl(dev_t kdev, u_long cmd, caddr_
 }
 
 static int
-agp_mmap(dev_t kdev, vm_offset_t offset, int prot)
+agp_mmap(dev_t kdev, vm_offset_t offset, vm_offset_t *paddr, int prot)
 {
 	device_t dev = KDEV2DEV(kdev);
 	struct agp_softc *sc = device_get_softc(dev);
 
 	if (offset > AGP_GET_APERTURE(dev))
 		return -1;
-	return atop(rman_get_start(sc->as_aperture) + offset);
+	*paddr = rman_get_start(sc->as_aperture) + offset;
+	return 0;
 }
 
 /* Implementation of the kernel api */
Index: pci/meteor.c
===================================================================
RCS file: /space2/ncvs/src/sys/pci/meteor.c,v
retrieving revision 1.57
diff -u -p -r1.57 meteor.c
--- pci/meteor.c	20 Mar 2002 02:08:00 -0000	1.57
+++ pci/meteor.c	24 Feb 2003 00:39:07 -0000
@@ -2107,7 +2107,7 @@ meteor_ioctl(dev_t dev, u_long cmd, cadd
 }
 
 int
-meteor_mmap(dev_t dev, vm_offset_t offset, int nprot)
+meteor_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 
 	int	unit;
@@ -2126,6 +2126,7 @@ meteor_mmap(dev_t dev, vm_offset_t offse
 	if(offset >= mtr->alloc_pages * PAGE_SIZE)
 		return -1;
 
-	return i386_btop(vtophys(mtr->bigbuf) + offset);
+	*paddr = vtophys(mtr->bigbuf) + offset;
+	return 0;
 }
 #endif
Index: pci/xrpu.c
===================================================================
RCS file: /space2/ncvs/src/sys/pci/xrpu.c,v
retrieving revision 1.27
diff -u -p -r1.27 xrpu.c
--- pci/xrpu.c	19 Feb 2003 05:47:42 -0000	1.27
+++ pci/xrpu.c	24 Feb 2003 00:39:45 -0000
@@ -136,12 +136,13 @@ xrpu_close(dev_t dev, int flag, int mode
 }
 
 static int
-xrpu_mmap(dev_t dev, vm_offset_t offset, int nprot)
+xrpu_mmap(dev_t dev, vm_offset_t offset, vm_offset_t *paddr, int nprot)
 {
 	struct softc *sc = dev->si_drv1;
 	if (offset >= 0x1000000) 
 		return (-1);
-	return (i386_btop(sc->physbase + offset));
+	*paddr = sc->physbase + offset;
+	return (0);
 }
 
 static int
Index: powerpc/powerpc/pmap.c
===================================================================
RCS file: /space2/ncvs/src/sys/powerpc/powerpc/pmap.c,v
retrieving revision 1.53
diff -u -p -r1.53 pmap.c
--- powerpc/powerpc/pmap.c	1 Feb 2003 02:56:48 -0000	1.53
+++ powerpc/powerpc/pmap.c	22 Feb 2003 00:43:19 -0000
@@ -1452,13 +1452,6 @@ pmap_protect(pmap_t pm, vm_offset_t sva,
 	}
 }
 
-vm_offset_t
-pmap_phys_address(int ppn)
-{
-	TODO;
-	return (0);
-}
-
 /*
  * Map a list of wired pages into kernel virtual address space.  This is
  * intended for temporary mappings which do not need page modification or
Index: sparc64/sparc64/pmap.c
===================================================================
RCS file: /space2/ncvs/src/sys/sparc64/sparc64/pmap.c,v
retrieving revision 1.100
diff -u -p -r1.100 pmap.c
--- sparc64/sparc64/pmap.c	5 Jan 2003 05:30:40 -0000	1.100
+++ sparc64/sparc64/pmap.c	22 Feb 2003 00:42:31 -0000
@@ -1778,13 +1778,6 @@ pmap_page_protect(vm_page_t m, vm_prot_t
 	}
 }
 
-vm_offset_t
-pmap_phys_address(int ppn)
-{
-
-	return (sparc64_ptob(ppn));
-}
-
 /*
  *	pmap_ts_referenced:
  *
Index: sys/conf.h
===================================================================
RCS file: /space2/ncvs/src/sys/sys/conf.h,v
retrieving revision 1.162
diff -u -p -r1.162 conf.h
--- sys/conf.h	21 Feb 2003 19:00:48 -0000	1.162
+++ sys/conf.h	23 Feb 2003 17:56:12 -0000
@@ -157,7 +157,8 @@ typedef int d_read_t(dev_t dev, struct u
 typedef int d_write_t(dev_t dev, struct uio *uio, int ioflag);
 typedef int d_poll_t(dev_t dev, int events, struct thread *td);
 typedef int d_kqfilter_t(dev_t dev, struct knote *kn);
-typedef int d_mmap_t(dev_t dev, vm_offset_t offset, int nprot);
+typedef int d_mmap_t(dev_t dev, vm_offset_t offset, vm_offset_t *paddr,
+   		     int nprot);
 
 typedef int l_open_t(dev_t dev, struct tty *tp);
 typedef int l_close_t(struct tty *tp, int flag);
Index: vm/device_pager.c
===================================================================
RCS file: /space2/ncvs/src/sys/vm/device_pager.c,v
retrieving revision 1.61
diff -u -p -r1.61 device_pager.c
--- vm/device_pager.c	19 Feb 2003 05:47:46 -0000	1.61
+++ vm/device_pager.c	24 Feb 2003 00:06:07 -0000
@@ -107,7 +107,7 @@ dev_pager_alloc(void *handle, vm_ooffset
 	d_mmap_t *mapfunc;
 	vm_object_t object;
 	unsigned int npages;
-	vm_offset_t off;
+	vm_offset_t off, paddr;
 
 	/*
 	 * Offset should be page aligned.
@@ -137,7 +137,7 @@ dev_pager_alloc(void *handle, vm_ooffset
 	 */
 	npages = OFF_TO_IDX(size);
 	for (off = foff; npages--; off += PAGE_SIZE)
-		if ((*mapfunc)(dev, off, (int) prot) == -1) {
+		if ((*mapfunc)(dev, off, &paddr, (int)prot) != 0) {
 			mtx_unlock(&Giant);
 			return (NULL);
 		}
@@ -205,7 +205,7 @@ dev_pager_getpages(object, m, count, req
 	vm_offset_t paddr;
 	vm_page_t page;
 	dev_t dev;
-	int i;
+	int i, ret;
 	d_mmap_t *mapfunc;
 	int prot;
 
@@ -218,11 +218,11 @@ dev_pager_getpages(object, m, count, req
 	if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop)
 		panic("dev_pager_getpage: no map function");
 
-	paddr = pmap_phys_address((*mapfunc) (dev, (vm_offset_t) offset << PAGE_SHIFT, prot));
-	KASSERT(paddr != -1,("dev_pager_getpage: map function returns error"));
+	ret = (*mapfunc)(dev, (vm_offset_t)offset << PAGE_SHIFT, &paddr, prot);
+	KASSERT(ret == 0, ("dev_pager_getpage: map function returns error"));
 	/*
-	 * Replace the passed in reqpage page with our own fake page and free up the
-	 * all of the original pages.
+	 * Replace the passed in reqpage page with our own fake page and
+	 * free up the all of the original pages.
 	 */
 	page = dev_pager_getfake(paddr);
 	TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist, page, pageq);
Index: vm/pmap.h
===================================================================
RCS file: /space2/ncvs/src/sys/vm/pmap.h,v
retrieving revision 1.53
diff -u -p -r1.53 pmap.h
--- vm/pmap.h	15 Feb 2003 19:38:23 -0000	1.53
+++ vm/pmap.h	22 Feb 2003 00:24:47 -0000
@@ -119,7 +119,6 @@ void		 pmap_object_init_pt(pmap_t pmap, 
 		    int pagelimit);
 boolean_t	 pmap_page_exists_quick(pmap_t pmap, vm_page_t m);
 void		 pmap_page_protect(vm_page_t m, vm_prot_t prot);
-vm_offset_t	 pmap_phys_address(int);
 void		 pmap_pinit(pmap_t);
 void		 pmap_pinit0(pmap_t);
 void		 pmap_pinit2(pmap_t);
