diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-01 12:13:48 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-01 12:13:48 +0000 |
commit | d5cc9696a2b0e4aab5c615d0009f9ab5030bbcaa (patch) | |
tree | 9a94822b0c5101e2ea8729a3c2885a26f42e1493 /sys/uvm | |
parent | 9dcaf3656438ee022f80bec8c3b7b7d5d3765802 (diff) |
Change d_mmap in struct cdevsw from:
int (*d_mmap) __P((dev_t, int, int));
to:
paddr_t (*d_mmap) __P((dev_t, off_t, int));
This allows us to mmap devices past 4GB offsets.
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_device.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c index a08658f0cfc..2430fc5ef17 100644 --- a/sys/uvm/uvm_device.c +++ b/sys/uvm/uvm_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_device.c,v 1.12 2001/09/11 20:05:26 miod Exp $ */ +/* $OpenBSD: uvm_device.c,v 1.13 2001/11/01 12:13:47 art Exp $ */ /* $NetBSD: uvm_device.c,v 1.22 2000/05/28 10:21:55 drochner Exp $ */ /* @@ -134,7 +134,7 @@ udv_attach(arg, accessprot, off, size) { dev_t device = *((dev_t *) arg); struct uvm_device *udv, *lcv; - int (*mapfn) __P((dev_t, int, int)); + paddr_t (*mapfn) __P((dev_t, off_t, int)); UVMHIST_FUNC("udv_attach"); UVMHIST_CALLED(maphist); UVMHIST_LOG(maphist, "(device=0x%x)", device,0,0,0); @@ -145,20 +145,11 @@ udv_attach(arg, accessprot, off, size) mapfn = cdevsw[major(device)].d_mmap; if (mapfn == NULL || - mapfn == (int (*) __P((dev_t, int, int))) enodev || - mapfn == (int (*) __P((dev_t, int, int))) nullop) + mapfn == (paddr_t (*) __P((dev_t, off_t, int)))enodev || + mapfn == (paddr_t (*) __P((dev_t, off_t, int)))nullop) return(NULL); /* - * As long as the device d_mmap interface gets an "int" - * offset, we have to watch out not to overflow its - * numeric range. (assuming it will be interpreted as - * "unsigned") - */ - if (((off + size - 1) & (u_int)-1) != off + size - 1) - return (0); - - /* * Check that the specified range of the device allows the * desired protection. * @@ -420,7 +411,7 @@ udv_fault(ufi, vaddr, pps, npages, centeridx, fault_type, access_type, flags) paddr_t paddr; int lcv, retval, mdpgno; dev_t device; - int (*mapfn) __P((dev_t, int, int)); + paddr_t (*mapfn) __P((dev_t, off_t, int)); vm_prot_t mapprot; UVMHIST_FUNC("udv_fault"); UVMHIST_CALLED(maphist); UVMHIST_LOG(maphist," flags=%d", flags,0,0,0); |