* Fix a couple of places in the device pager where an address was

truncated to 32 bits.
* Change the calling convention of the device mmap entry point to
  pass a vm_offset_t instead of an int for the offset allowing
  devices with a larger memory map than (1<<32) to be supported
  on the alpha (/dev/mem is one such).

These changes are required to allow the X server to mmap the various
I/O regions used for device port and memory access on the alpha.
This commit is contained in:
Doug Rabson 1998-11-08 12:39:07 +00:00
parent 370402654f
commit 7095ee912b
18 changed files with 34 additions and 33 deletions

View File

@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
* $Id: mem.c,v 1.1 1998/06/10 10:52:54 dfr Exp $
* $Id: mem.c,v 1.2 1998/07/29 18:36:29 dfr Exp $
*/
/*
@ -271,7 +271,7 @@ mmrw(dev, uio, flags)
* instead of going through read/write *
\*******************************************************/
static int
memmmap(dev_t dev, int offset, int prot)
memmmap(dev_t dev, vm_offset_t offset, int prot)
{
/*
* /dev/mem is the only one that makes sense through this

View File

@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
* $Id: mem.c,v 1.51 1998/06/07 17:10:02 dfr Exp $
* $Id: mem.c,v 1.52 1998/06/21 11:33:29 bde Exp $
*/
/*
@ -381,7 +381,7 @@ mmrw(dev, uio, flags)
* instead of going through read/write *
\*******************************************************/
static int
memmmap(dev_t dev, int offset, int nprot)
memmmap(dev_t dev, vm_offset_t offset, int nprot)
{
switch (minor(dev))
{

View File

@ -1,4 +1,4 @@
/* $Id: brooktree848.c,v 1.57 1998/10/31 11:26:38 nsouch Exp $ */
/* $Id: brooktree848.c,v 1.58 1998/11/07 14:30:48 nsouch Exp $ */
/* BT848 Driver for Brooktree's Bt848 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@ -3000,7 +3000,7 @@ common_ioctl( bktr_ptr_t bktr, bt848_ptr_t bt848, int cmd, caddr_t arg )
*
*/
int
bktr_mmap( dev_t dev, int offset, int nprot )
bktr_mmap( dev_t dev, vm_offset_t offset, int nprot )
{
int unit;
bktr_ptr_t bktr;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.285 1998/10/22 05:58:40 bde Exp $
* $Id: syscons.c,v 1.286 1998/11/03 02:37:46 yokota Exp $
*/
#include "sc.h"
@ -3855,7 +3855,7 @@ scgetc(u_int flags)
}
int
scmmap(dev_t dev, int offset, int nprot)
scmmap(dev_t dev, vm_offset_t offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;

View File

@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
* $Id: mem.c,v 1.51 1998/06/07 17:10:02 dfr Exp $
* $Id: mem.c,v 1.52 1998/06/21 11:33:29 bde Exp $
*/
/*
@ -381,7 +381,7 @@ mmrw(dev, uio, flags)
* instead of going through read/write *
\*******************************************************/
static int
memmmap(dev_t dev, int offset, int nprot)
memmmap(dev_t dev, vm_offset_t offset, int nprot)
{
switch (minor(dev))
{

View File

@ -770,7 +770,7 @@ pcioctl(Dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
}
int
pcmmap(Dev_t dev, int offset, int nprot)
pcmmap(Dev_t dev, vm_offset_t offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;

View File

@ -1226,7 +1226,7 @@ sndselect(dev_t i_dev, int rw, struct proc * p)
#include <vm/vm_extern.h>
static int
sndmmap(dev_t dev, int offset, int nprot)
sndmmap(dev_t dev, vm_offset_t offset, int nprot)
{
snddev_info *d = get_snddev_info(dev, NULL);

View File

@ -259,7 +259,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[unit];
}
static int
spigot_mmap(dev_t dev, int offset, int nprot)
spigot_mmap(dev_t dev, vm_offset_t offset, int nprot)
{
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[0];

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.285 1998/10/22 05:58:40 bde Exp $
* $Id: syscons.c,v 1.286 1998/11/03 02:37:46 yokota Exp $
*/
#include "sc.h"
@ -3855,7 +3855,7 @@ scgetc(u_int flags)
}
int
scmmap(dev_t dev, int offset, int nprot)
scmmap(dev_t dev, vm_offset_t offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.274 1998/09/17 09:38:35 dfr Exp $
* $Id: syscons.c,v 1.275 1998/10/31 10:35:23 dfr Exp $
* from: i386/isa syscons.c,v 1.278
*/
@ -3936,7 +3936,7 @@ scgetc(u_int flags)
}
int
scmmap(dev_t dev, int offset, int nprot)
scmmap(dev_t dev, vm_offset_t offset, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)subr_xxx.c 8.1 (Berkeley) 6/10/93
* $Id: subr_xxx.c,v 1.10 1998/06/07 17:11:38 dfr Exp $
* $Id: subr_xxx.c,v 1.11 1998/08/20 06:10:40 bde Exp $
*/
/*
@ -161,7 +161,7 @@ nodevtotty(dev)
int
nommap(dev, offset, nprot)
dev_t dev;
int offset;
vm_offset_t offset;
int nprot;
{

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.101 1998/09/14 11:37:58 kato Exp $
* $Id: syscons.c,v 1.102 1998/10/22 05:58:45 bde Exp $
*/
#include "sc.h"
@ -5232,7 +5232,7 @@ scgetc(u_int flags)
}
int
scmmap(dev_t dev, int offset, int nprot)
scmmap(dev_t dev, vm_offset_t offset, int nprot)
{
#ifdef PC98
if (offset > 0x48000 - PAGE_SIZE)

View File

@ -1,4 +1,4 @@
/* $Id: brooktree848.c,v 1.57 1998/10/31 11:26:38 nsouch Exp $ */
/* $Id: brooktree848.c,v 1.58 1998/11/07 14:30:48 nsouch Exp $ */
/* BT848 Driver for Brooktree's Bt848 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
Jim Lowe's driver for the Matrox Meteor PCI card . The
@ -3000,7 +3000,7 @@ common_ioctl( bktr_ptr_t bktr, bt848_ptr_t bt848, int cmd, caddr_t arg )
*
*/
int
bktr_mmap( dev_t dev, int offset, int nprot )
bktr_mmap( dev_t dev, vm_offset_t offset, int nprot )
{
int unit;
bktr_ptr_t bktr;

View File

@ -2054,7 +2054,7 @@ meteor_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
}
int
meteor_mmap(dev_t dev, int offset, int nprot)
meteor_mmap(dev_t dev, vm_offset_t offset, int nprot)
{
int unit;

View File

@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
* $Id: xrpu.c,v 1.2 1998/08/18 00:32:48 bde Exp $
* $Id: xrpu.c,v 1.3 1998/10/24 19:47:42 phk Exp $
*
* A very simple device driver for PCI cards based on Xilinx 6200 series
* FPGA/RPU devices. Current Functionality is to allow you to open and
@ -146,7 +146,7 @@ xrpu_close(dev_t dev, int flag, int mode, struct proc *p)
}
static int
xrpu_mmap(dev_t dev, int offset, int nprot)
xrpu_mmap(dev_t dev, vm_offset_t offset, int nprot)
{
struct softc *sc = softc[dev2unit(dev)];
if (offset >= 0x1000000)

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
* $Id: conf.h,v 1.44 1998/08/20 06:10:42 bde Exp $
* $Id: conf.h,v 1.45 1998/09/05 14:13:12 phk Exp $
*/
#ifndef _SYS_CONF_H_
@ -66,7 +66,7 @@ typedef void d_stop_t __P((struct tty *tp, int rw));
typedef int d_reset_t __P((dev_t dev));
typedef struct tty *d_devtotty_t __P((dev_t dev));
typedef int d_poll_t __P((dev_t dev, int events, struct proc *p));
typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
typedef int d_mmap_t __P((dev_t dev, vm_offset_t offset, int nprot));
typedef int l_open_t __P((dev_t dev, struct tty *tp));
typedef int l_close_t __P((struct tty *tp, int flag));

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.5 (Berkeley) 1/9/95
* $Id: conf.h,v 1.44 1998/08/20 06:10:42 bde Exp $
* $Id: conf.h,v 1.45 1998/09/05 14:13:12 phk Exp $
*/
#ifndef _SYS_CONF_H_
@ -66,7 +66,7 @@ typedef void d_stop_t __P((struct tty *tp, int rw));
typedef int d_reset_t __P((dev_t dev));
typedef struct tty *d_devtotty_t __P((dev_t dev));
typedef int d_poll_t __P((dev_t dev, int events, struct proc *p));
typedef int d_mmap_t __P((dev_t dev, int offset, int nprot));
typedef int d_mmap_t __P((dev_t dev, vm_offset_t offset, int nprot));
typedef int l_open_t __P((dev_t dev, struct tty *tp));
typedef int l_close_t __P((struct tty *tp, int flag));

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)device_pager.c 8.1 (Berkeley) 6/11/93
* $Id: device_pager.c,v 1.33 1998/10/21 23:06:50 dg Exp $
* $Id: device_pager.c,v 1.34 1998/10/22 01:45:29 dg Exp $
*/
#include <sys/param.h>
@ -97,7 +97,8 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo
dev_t dev;
d_mmap_t *mapfunc;
vm_object_t object;
unsigned int npages, off;
unsigned int npages;
vm_offset_t off;
/*
* Make sure this device can be mapped.
@ -206,7 +207,7 @@ dev_pager_getpages(object, m, count, reqpage)
if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop)
panic("dev_pager_getpage: no map function");
paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (int) offset << PAGE_SHIFT, prot));
paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (vm_offset_t) offset << PAGE_SHIFT, prot));
#ifdef DIAGNOSTIC
if (paddr == -1)
panic("dev_pager_getpage: map function returns error");