diff options
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_glue.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_mmap.c | 14 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 54 | ||||
-rw-r--r-- | sys/vm/vm_user.c | 7 |
4 files changed, 17 insertions, 60 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 2707f96ea0a..2ffdb24990e 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_glue.c,v 1.12 1996/04/19 06:45:31 niklas Exp $ */ +/* $OpenBSD: vm_glue.c,v 1.13 1996/04/19 16:10:47 niklas Exp $ */ /* $NetBSD: vm_glue.c,v 1.53 1996/02/18 22:53:43 mycroft Exp $ */ /* diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 294d2ce84a4..cfc76ee5d22 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1,5 +1,5 @@ -/* $OpenBSD: vm_mmap.c,v 1.4 1996/03/03 17:45:32 niklas Exp $ */ -/* $NetBSD: vm_mmap.c,v 1.45 1996/02/10 00:08:10 christos Exp $ */ +/* $OpenBSD: vm_mmap.c,v 1.5 1996/04/19 16:10:48 niklas Exp $ */ +/* $NetBSD: vm_mmap.c,v 1.46 1996/02/28 22:39:13 gwr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -820,13 +820,15 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) addr) == 1) { rv = KERN_NO_SPACE; } else { - vm_object_prefer(object, foff, addr); +#ifdef PMAP_PREFER + PMAP_PREFER(foff, addr); +#endif rv = vm_map_insert(map, NULL, (vm_offset_t)0, *addr, *addr+size); /* * vm_map_insert() may fail if - * vm_object_prefer() has altered + * PMAP_PREFER() has altered * the initial address. * If so, we start again. */ @@ -846,7 +848,9 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) if (rv == KERN_SUCCESS && (mmapdebug & MDB_MAPIT)) { vm_offset_t paddr = *addr; - vm_object_prefer(object, foff, &paddr); +#ifdef PMAP_PREFER + PMAP_PREFER(foff, &paddr); +#endif if (paddr != *addr) printf( "vm_mmap: pmap botch! " diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 6fd2c08da60..70c666027c2 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1,5 +1,5 @@ -/* $OpenBSD: vm_object.c,v 1.3 1996/03/03 17:45:34 niklas Exp $ */ -/* $NetBSD: vm_object.c,v 1.33 1996/02/10 00:08:11 christos Exp $ */ +/* $OpenBSD: vm_object.c,v 1.4 1996/04/19 16:10:51 niklas Exp $ */ +/* $NetBSD: vm_object.c,v 1.34 1996/02/28 22:35:35 gwr Exp $ */ /* * Copyright (c) 1991, 1993 @@ -1404,56 +1404,6 @@ vm_object_coalesce(prev_object, next_object, } /* - * vm_object_prefer: - * - * Return optimal virtual address for new mapping of this object. - * - * The object must *not* be locked. - */ -void -vm_object_prefer(object, offset, addr) - register vm_object_t object; - register vm_offset_t offset; - register vm_offset_t *addr; -{ - register vm_page_t p; - register vm_offset_t paddr; - -#ifdef PMAP_PREFER - if (object == NULL) - goto first_map; - - /* - * Look for the first page that the pmap layer has something - * to say about. Since an object maps a contiguous range of - * virutal addresses, this will determine the preferred origin - * of the proposed mapping. - */ - vm_object_lock(object); - for (p = object->memq.tqh_first; p != NULL; p = p->listq.tqe_next) { - if (p->flags & (PG_FAKE | PG_FICTITIOUS)) - continue; - paddr = PMAP_PREFER(VM_PAGE_TO_PHYS(p), *addr+p->offset-offset); - if (paddr == (vm_offset_t)-1) - continue; - *addr = paddr - (p->offset - offset); - vm_object_unlock(object); - return; - } - vm_object_unlock(object); - -first_map: - /* - * No physical page attached; ask for a preferred address based - * only on the given virtual address. - */ - paddr = PMAP_PREFER((vm_offset_t)-1, *addr); - if (paddr != (vm_offset_t)-1) - *addr = paddr; - -#endif -} -/* * vm_object_print: [ debug ] */ void diff --git a/sys/vm/vm_user.c b/sys/vm/vm_user.c index e0569fe2eff..d717f6204c8 100644 --- a/sys/vm/vm_user.c +++ b/sys/vm/vm_user.c @@ -1,4 +1,5 @@ -/* $NetBSD: vm_user.c,v 1.12 1995/12/05 22:54:39 pk Exp $ */ +/* $OpenBSD: vm_user.c,v 1.3 1996/04/19 16:10:52 niklas Exp $ */ +/* $NetBSD: vm_user.c,v 1.13 1996/02/28 22:39:16 gwr Exp $ */ /* * Copyright (c) 1991, 1993 @@ -317,7 +318,9 @@ vm_allocate_with_pager(map, addr, size, anywhere, pager, poffset, internal) if (vm_map_findspace(map, start, size, addr)) result = KERN_NO_SPACE; else { - vm_object_prefer(object, poffset, addr); +#ifdef PMAP_PREFER + PMAP_PREFER(poffset, addr); +#endif start = *addr; result = vm_map_insert(map, object, poffset, start, start + size); |