device_pager.c (79224) | device_pager.c (92654) |
---|---|
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 * $FreeBSD: head/sys/vm/device_pager.c 79224 2001-07-04 16:20:28Z dillon $ | 39 * $FreeBSD: head/sys/vm/device_pager.c 92654 2002-03-19 09:11:49Z jeff $ |
40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/conf.h> 45#include <sys/lock.h> 46#include <sys/proc.h> 47#include <sys/mutex.h> --- 20 unchanged lines hidden (view full) --- 68static struct pagerlst dev_pager_object_list; 69/* protect against object creation */ 70static struct sx dev_pager_sx; 71/* protect list manipulation */ 72static struct mtx dev_pager_mtx; 73 74 75static vm_zone_t fakepg_zone; | 40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/conf.h> 45#include <sys/lock.h> 46#include <sys/proc.h> 47#include <sys/mutex.h> --- 20 unchanged lines hidden (view full) --- 68static struct pagerlst dev_pager_object_list; 69/* protect against object creation */ 70static struct sx dev_pager_sx; 71/* protect list manipulation */ 72static struct mtx dev_pager_mtx; 73 74 75static vm_zone_t fakepg_zone; |
76#if 0 |
|
76static struct vm_zone fakepg_zone_store; | 77static struct vm_zone fakepg_zone_store; |
78#endif |
|
77 78static vm_page_t dev_pager_getfake __P((vm_offset_t)); 79static void dev_pager_putfake __P((vm_page_t)); 80 81struct pagerops devicepagerops = { 82 dev_pager_init, 83 dev_pager_alloc, 84 dev_pager_dealloc, --- 4 unchanged lines hidden (view full) --- 89}; 90 91static void 92dev_pager_init() 93{ 94 TAILQ_INIT(&dev_pager_object_list); 95 sx_init(&dev_pager_sx, "dev_pager create"); 96 mtx_init(&dev_pager_mtx, "dev_pager list", MTX_DEF); | 79 80static vm_page_t dev_pager_getfake __P((vm_offset_t)); 81static void dev_pager_putfake __P((vm_page_t)); 82 83struct pagerops devicepagerops = { 84 dev_pager_init, 85 dev_pager_alloc, 86 dev_pager_dealloc, --- 4 unchanged lines hidden (view full) --- 91}; 92 93static void 94dev_pager_init() 95{ 96 TAILQ_INIT(&dev_pager_object_list); 97 sx_init(&dev_pager_sx, "dev_pager create"); 98 mtx_init(&dev_pager_mtx, "dev_pager list", MTX_DEF); |
99#if 0 |
|
97 fakepg_zone = &fakepg_zone_store; 98 zinitna(fakepg_zone, NULL, "DP fakepg", sizeof(struct vm_page), 0, 0, 2); | 100 fakepg_zone = &fakepg_zone_store; 101 zinitna(fakepg_zone, NULL, "DP fakepg", sizeof(struct vm_page), 0, 0, 2); |
102#endif 103 fakepg_zone = zinit("DP fakepg", sizeof(struct vm_page), 0, 0, 0); |
|
99} 100 101static vm_object_t 102dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff) 103{ 104 dev_t dev; 105 d_mmap_t *mapfunc; 106 vm_object_t object; --- 180 unchanged lines hidden --- | 104} 105 106static vm_object_t 107dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff) 108{ 109 dev_t dev; 110 d_mmap_t *mapfunc; 111 vm_object_t object; --- 180 unchanged lines hidden --- |