From owner-p4-projects@FreeBSD.ORG Thu Sep 16 01:53:24 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C847416A4D0; Thu, 16 Sep 2004 01:53:23 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6388916A4CE for ; Thu, 16 Sep 2004 01:53:23 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4811A43D46 for ; Thu, 16 Sep 2004 01:53:23 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i8G1rN1k013297 for ; Thu, 16 Sep 2004 01:53:23 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i8G1rMHo013294 for perforce@freebsd.org; Thu, 16 Sep 2004 01:53:22 GMT (envelope-from marcel@freebsd.org) Date: Thu, 16 Sep 2004 01:53:22 GMT Message-Id: <200409160153.i8G1rMHo013294@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 61582 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2004 01:53:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=61582 Change 61582 by marcel@marcel_nfs on 2004/09/16 01:52:24 Revert the SPARSE_PHYSICAL_MEMORY changes. Affected files ... .. //depot/projects/ia64/sys/vm/vm_page.c#64 edit .. //depot/projects/ia64/sys/vm/vm_page.h#31 edit Differences ... ==== //depot/projects/ia64/sys/vm/vm_page.c#64 (text+ko) ==== @@ -97,7 +97,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.290 2004/07/29 18:56:31 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.291 2004/09/15 12:09:50 phk Exp $"); #include #include @@ -148,30 +148,7 @@ panic("vm_set_page_size: page size not a power of two"); } -#ifdef SPARSE_PHYSICAL_MEMORY /* - * vm_page_from_phys - * - * Given a physical address, return a pointer to the vm_page in the - * vm_page array. This function deals with sparse memory addresses. - */ -vm_page_t -vm_page_from_phys(vm_offset_t pa) -{ - vm_page_t p = vm_page_array; - int i; - - for (i = 0; phys_avail[i + 1]; i += 2) { - if (pa >= phys_avail[i] && pa < phys_avail[i + 1]) - return (p + (atop(pa) - phys_avail[i] / PAGE_SIZE)); - p += (phys_avail[i + 1] - phys_avail[i]) / PAGE_SIZE; - } - panic("vm_page_from_phys: unmanaged physical address."); - return (0); -} -#endif - -/* * vm_page_startup: * * Initializes the resident memory module. @@ -211,7 +188,6 @@ phys_avail[i + 1] = trunc_page(phys_avail[i + 1]); } - /* XXX: Based on assumptions that aren't valid on all architectures.*/ for (i = 0; phys_avail[i + 1]; i += 2) { vm_paddr_t size = phys_avail[i + 1] - phys_avail[i]; @@ -246,8 +222,8 @@ bootpages = UMA_BOOT_PAGES * UMA_SLAB_SIZE; new_end = end - bootpages; new_end = trunc_page(new_end); - /* XXX: Bounds check! */ - mapped = pmap_map(&vaddr, new_end, end, VM_PROT_READ | VM_PROT_WRITE); + mapped = pmap_map(&vaddr, new_end, end, + VM_PROT_READ | VM_PROT_WRITE); bzero((caddr_t) mapped, end - new_end); uma_startup((caddr_t)mapped); @@ -257,16 +233,7 @@ * page). */ first_page = phys_avail[0] / PAGE_SIZE; -#ifdef SPARSE_PHYSICAL_MEMORY - /* - * Don't use the pysical address range for the actual page range. - * On architectures with sparse memory addressing this is wrong. - * Instead, use the total memory obtained above. - */ - page_range = total / PAGE_SIZE; -#else - page_range = phys_avail[(nblocks-1) * 2 + 1] / PAGE_SIZE - first_page; -#endif + page_range = phys_avail[(nblocks - 1) * 2 + 1] / PAGE_SIZE - first_page; npages = (total - (page_range * sizeof(struct vm_page)) - (end - new_end)) / PAGE_SIZE; end = new_end; @@ -281,8 +248,8 @@ * queue. */ new_end = trunc_page(end - page_range * sizeof(struct vm_page)); - /* XXX: Bounds check! */ - mapped = pmap_map(&vaddr, new_end, end, VM_PROT_READ | VM_PROT_WRITE); + mapped = pmap_map(&vaddr, new_end, end, + VM_PROT_READ | VM_PROT_WRITE); vm_page_array = (vm_page_t) mapped; phys_avail[biggestone + 1] = new_end; @@ -296,7 +263,7 @@ * Construct the free queue(s) in descending order (by physical * address) so that the first 16MB of physical memory is allocated * last rather than first. On large-memory machines, this avoids - * the exhaustion of low physical memory before isa_dmainit has run. + * the exhaustion of low physical memory before isa_dma_init has run. */ cnt.v_page_count = 0; cnt.v_free_count = 0; ==== //depot/projects/ia64/sys/vm/vm_page.h#31 (text+ko) ==== @@ -290,11 +290,8 @@ #define VM_PAGE_TO_PHYS(entry) ((entry)->phys_addr) -#ifdef SPARSE_PHYSICAL_MEMORY -#define PHYS_TO_VM_PAGE(pa) vm_page_from_phys(pa) -#else -#define PHYS_TO_VM_PAGE(pa) (&vm_page_array[atop(pa) - first_page ]) -#endif +#define PHYS_TO_VM_PAGE(pa) \ + (&vm_page_array[atop(pa) - first_page ]) extern struct mtx vm_page_queue_mtx; #define vm_page_lock_queues() mtx_lock(&vm_page_queue_mtx) @@ -360,7 +357,6 @@ void vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); vm_page_t vm_page_select_cache(int); vm_page_t vm_page_splay(vm_pindex_t, vm_page_t); -vm_page_t vm_page_from_phys(vm_offset_t); vm_offset_t vm_page_startup(vm_offset_t vaddr); void vm_page_unmanage (vm_page_t); void vm_page_unwire (vm_page_t, int);