vm_phys.c (195033) | vm_phys.c (195649) |
---|---|
1/*- 2 * Copyright (c) 2002-2006 Rice University 3 * Copyright (c) 2007 Alan L. Cox <alc@cs.rice.edu> 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Alan L. Cox, 7 * Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro. 8 * --- 16 unchanged lines hidden (view full) --- 25 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 28 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2006 Rice University 3 * Copyright (c) 2007 Alan L. Cox <alc@cs.rice.edu> 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Alan L. Cox, 7 * Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro. 8 * --- 16 unchanged lines hidden (view full) --- 25 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 28 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/vm/vm_phys.c 195033 2009-06-26 04:47:43Z alc $"); | 33__FBSDID("$FreeBSD: head/sys/vm/vm_phys.c 195649 2009-07-12 23:31:20Z alc $"); |
34 35#include "opt_ddb.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/lock.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> --- 541 unchanged lines hidden (view full) --- 583 * physical address "high". The given value "alignment" determines the 584 * alignment of the first physical page in the set. If the given value 585 * "boundary" is non-zero, then the set of physical pages cannot cross 586 * any physical address boundary that is a multiple of that value. Both 587 * "alignment" and "boundary" must be a power of two. 588 */ 589vm_page_t 590vm_phys_alloc_contig(unsigned long npages, vm_paddr_t low, vm_paddr_t high, | 34 35#include "opt_ddb.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/lock.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> --- 541 unchanged lines hidden (view full) --- 583 * physical address "high". The given value "alignment" determines the 584 * alignment of the first physical page in the set. If the given value 585 * "boundary" is non-zero, then the set of physical pages cannot cross 586 * any physical address boundary that is a multiple of that value. Both 587 * "alignment" and "boundary" must be a power of two. 588 */ 589vm_page_t 590vm_phys_alloc_contig(unsigned long npages, vm_paddr_t low, vm_paddr_t high, |
591 unsigned long alignment, unsigned long boundary, vm_cache_mode_t mode) | 591 unsigned long alignment, unsigned long boundary) |
592{ 593 struct vm_freelist *fl; 594 struct vm_phys_seg *seg; 595 vm_object_t m_object; 596 vm_paddr_t pa, pa_last, size; 597 vm_page_t deferred_vdrop_list, m, m_ret; 598 int flind, i, oind, order, pind; 599 --- 93 unchanged lines hidden (view full) --- 693 KASSERT(m->wire_count == 0, 694 ("vm_phys_alloc_contig: page %p is wired", m)); 695 KASSERT(m->hold_count == 0, 696 ("vm_phys_alloc_contig: page %p is held", m)); 697 KASSERT(m->busy == 0, 698 ("vm_phys_alloc_contig: page %p is busy", m)); 699 KASSERT(m->dirty == 0, 700 ("vm_phys_alloc_contig: page %p is dirty", m)); | 592{ 593 struct vm_freelist *fl; 594 struct vm_phys_seg *seg; 595 vm_object_t m_object; 596 vm_paddr_t pa, pa_last, size; 597 vm_page_t deferred_vdrop_list, m, m_ret; 598 int flind, i, oind, order, pind; 599 --- 93 unchanged lines hidden (view full) --- 693 KASSERT(m->wire_count == 0, 694 ("vm_phys_alloc_contig: page %p is wired", m)); 695 KASSERT(m->hold_count == 0, 696 ("vm_phys_alloc_contig: page %p is held", m)); 697 KASSERT(m->busy == 0, 698 ("vm_phys_alloc_contig: page %p is busy", m)); 699 KASSERT(m->dirty == 0, 700 ("vm_phys_alloc_contig: page %p is dirty", m)); |
701 KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, 702 ("vm_phys_alloc_contig: page %p has unexpected memattr %d", 703 m, pmap_page_get_memattr(m))); |
|
701 if ((m->flags & PG_CACHED) != 0) { 702 m->valid = 0; 703 m_object = m->object; 704 vm_page_cache_remove(m); 705 if (m_object->type == OBJT_VNODE && 706 m_object->cache == NULL) { 707 /* 708 * Enqueue the vnode for deferred vdrop(). --- 70 unchanged lines hidden --- | 704 if ((m->flags & PG_CACHED) != 0) { 705 m->valid = 0; 706 m_object = m->object; 707 vm_page_cache_remove(m); 708 if (m_object->type == OBJT_VNODE && 709 m_object->cache == NULL) { 710 /* 711 * Enqueue the vnode for deferred vdrop(). --- 70 unchanged lines hidden --- |