vm_phys.c (256281) | vm_phys.c (265435) |
---|---|
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 * --- 23 unchanged lines hidden (view full) --- 32/* 33 * Physical memory system implementation 34 * 35 * Any external functions defined by this module are only to be used by the 36 * virtual memory system. 37 */ 38 39#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 * --- 23 unchanged lines hidden (view full) --- 32/* 33 * Physical memory system implementation 34 * 35 * Any external functions defined by this module are only to be used by the 36 * virtual memory system. 37 */ 38 39#include <sys/cdefs.h> |
40__FBSDID("$FreeBSD: stable/10/sys/vm/vm_phys.c 256275 2013-10-10 16:11:45Z alc $"); | 40__FBSDID("$FreeBSD: stable/10/sys/vm/vm_phys.c 265435 2014-05-06 12:20:07Z kib $"); |
41 42#include "opt_ddb.h" 43#include "opt_vm.h" 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/lock.h> 48#include <sys/kernel.h> --- 498 unchanged lines hidden (view full) --- 547 long pi; 548 boolean_t malloced; 549#endif 550 551 page_count = (end - start) / PAGE_SIZE; 552 553#ifdef VM_PHYSSEG_DENSE 554 pi = atop(start); | 41 42#include "opt_ddb.h" 43#include "opt_vm.h" 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/lock.h> 48#include <sys/kernel.h> --- 498 unchanged lines hidden (view full) --- 547 long pi; 548 boolean_t malloced; 549#endif 550 551 page_count = (end - start) / PAGE_SIZE; 552 553#ifdef VM_PHYSSEG_DENSE 554 pi = atop(start); |
555 if (pi >= first_page && atop(end) < vm_page_array_size) { | 555 if (pi >= first_page && pi < vm_page_array_size + first_page) { 556 if (atop(end) >= vm_page_array_size + first_page) 557 return (EINVAL); |
556 fp = &vm_page_array[pi - first_page]; 557 malloced = FALSE; 558 } else 559#endif 560 { 561 fp = malloc(page_count * sizeof(struct vm_page), M_FICT_PAGES, 562 M_WAITOK | M_ZERO); 563#ifdef VM_PHYSSEG_DENSE --- 434 unchanged lines hidden --- | 558 fp = &vm_page_array[pi - first_page]; 559 malloced = FALSE; 560 } else 561#endif 562 { 563 fp = malloc(page_count * sizeof(struct vm_page), M_FICT_PAGES, 564 M_WAITOK | M_ZERO); 565#ifdef VM_PHYSSEG_DENSE --- 434 unchanged lines hidden --- |