device_pager.c (12767) | device_pager.c (12813) |
---|---|
1/* 2 * Copyright (c) 1990 University of Utah. 3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)device_pager.c 8.1 (Berkeley) 6/11/93 | 1/* 2 * Copyright (c) 1990 University of Utah. 3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)device_pager.c 8.1 (Berkeley) 6/11/93 |
39 * $Id: device_pager.c,v 1.16 1995/12/07 12:48:01 davidg Exp $ | 39 * $Id: device_pager.c,v 1.17 1995/12/11 04:57:59 dyson Exp $ |
40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/conf.h> 45#include <sys/mman.h> 46#include <sys/malloc.h> 47#include <sys/proc.h> --- 44 unchanged lines hidden (view full) --- 92 d_mmap_t *mapfunc; 93 vm_object_t object; 94 unsigned int npages, off; 95 96 /* 97 * Make sure this device can be mapped. 98 */ 99 dev = (dev_t) (u_long) handle; | 40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/conf.h> 45#include <sys/mman.h> 46#include <sys/malloc.h> 47#include <sys/proc.h> --- 44 unchanged lines hidden (view full) --- 92 d_mmap_t *mapfunc; 93 vm_object_t object; 94 unsigned int npages, off; 95 96 /* 97 * Make sure this device can be mapped. 98 */ 99 dev = (dev_t) (u_long) handle; |
100 mapfunc = cdevsw[major(dev)].d_mmap; | 100 mapfunc = cdevsw[major(dev)]->d_mmap; |
101 if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop) { 102 printf("obsolete map function %p\n", (void *)mapfunc); 103 return (NULL); 104 } 105 106 /* 107 * Offset should be page aligned. 108 */ --- 79 unchanged lines hidden (view full) --- 188 dev_t dev; 189 int i, s; 190 d_mmap_t *mapfunc; 191 int prot; 192 193 dev = (dev_t) (u_long) object->handle; 194 offset = m[reqpage]->pindex + OFF_TO_IDX(object->paging_offset); 195 prot = PROT_READ; /* XXX should pass in? */ | 101 if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop) { 102 printf("obsolete map function %p\n", (void *)mapfunc); 103 return (NULL); 104 } 105 106 /* 107 * Offset should be page aligned. 108 */ --- 79 unchanged lines hidden (view full) --- 188 dev_t dev; 189 int i, s; 190 d_mmap_t *mapfunc; 191 int prot; 192 193 dev = (dev_t) (u_long) object->handle; 194 offset = m[reqpage]->pindex + OFF_TO_IDX(object->paging_offset); 195 prot = PROT_READ; /* XXX should pass in? */ |
196 mapfunc = cdevsw[major(dev)].d_mmap; | 196 mapfunc = cdevsw[major(dev)]->d_mmap; |
197 198 if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop) 199 panic("dev_pager_getpage: no map function"); 200 201 paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (int) offset << PAGE_SHIFT, prot)); 202#ifdef DIAGNOSTIC 203 if (paddr == -1) 204 panic("dev_pager_getpage: map function returns error"); --- 80 unchanged lines hidden --- | 197 198 if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop) 199 panic("dev_pager_getpage: no map function"); 200 201 paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (int) offset << PAGE_SHIFT, prot)); 202#ifdef DIAGNOSTIC 203 if (paddr == -1) 204 panic("dev_pager_getpage: map function returns error"); --- 80 unchanged lines hidden --- |