1/* From: $NetBSD: pmap.c,v 1.148 2004/04/03 04:35:48 bsh Exp $ */
2/*-
3 * Copyright 2004 Olivier Houchard.
4 * Copyright 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Steve C. Woodford for Wasabi Systems, Inc.
8 *
--- 126 unchanged lines hidden (view full) ---
135 * Special compilation symbols
136 * PMAP_DEBUG - Build in pmap_debug_level code
137 */
138/* Include header files */
139
140#include "opt_vm.h"
141
142#include <sys/cdefs.h>
143__FBSDID("$FreeBSD: head/sys/arm/arm/pmap.c 247360 2013-02-26 23:35:27Z attilio $");
144#include <sys/param.h>
145#include <sys/systm.h>
146#include <sys/kernel.h>
147#include <sys/ktr.h>
148#include <sys/lock.h>
149#include <sys/proc.h>
150#include <sys/malloc.h>
151#include <sys/msgbuf.h>
--- 240 unchanged lines hidden (view full) ---
392#define pmap_is_current(pm) ((pm) == pmap_kernel() || \
393 curproc->p_vmspace->vm_map.pmap == (pm))
394static uma_zone_t pvzone = NULL;
395uma_zone_t l2zone;
396static uma_zone_t l2table_zone;
397static vm_offset_t pmap_kernel_l2dtable_kva;
398static vm_offset_t pmap_kernel_l2ptp_kva;
399static vm_paddr_t pmap_kernel_l2ptp_phys;
400static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0;
401static struct rwlock pvh_global_lock;
402
403/*
404 * This list exists for the benefit of pmap_map_chunk(). It keeps track
405 * of the kernel L2 tables during bootstrap, so that pmap_map_chunk() can
406 * find them as necessary.
407 *
--- 1414 unchanged lines hidden (view full) ---
1822
1823 /*
1824 * Initialize the PV entry allocator.
1825 */
1826 pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL,
1827 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
1828 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
1829 pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
1830 uma_zone_reserve_kva(pvzone, pv_entry_max);
1831 pv_entry_high_water = 9 * (pv_entry_max / 10);
1832
1833 /*
1834 * Now it is safe to enable pv_table recording.
1835 */
1836 PDEBUG(1, printf("pmap_init: done!\n"));
1837}
1838
--- 3123 unchanged lines hidden ---
2/*-
3 * Copyright 2004 Olivier Houchard.
4 * Copyright 2003 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Steve C. Woodford for Wasabi Systems, Inc.
8 *
--- 126 unchanged lines hidden (view full) ---
135 * Special compilation symbols
136 * PMAP_DEBUG - Build in pmap_debug_level code
137 */
138/* Include header files */
139
140#include "opt_vm.h"
141
142#include <sys/cdefs.h>
143__FBSDID("$FreeBSD: head/sys/arm/arm/pmap.c 247360 2013-02-26 23:35:27Z attilio $");
144#include <sys/param.h>
145#include <sys/systm.h>
146#include <sys/kernel.h>
147#include <sys/ktr.h>
148#include <sys/lock.h>
149#include <sys/proc.h>
150#include <sys/malloc.h>
151#include <sys/msgbuf.h>
--- 240 unchanged lines hidden (view full) ---
392#define pmap_is_current(pm) ((pm) == pmap_kernel() || \
393 curproc->p_vmspace->vm_map.pmap == (pm))
394static uma_zone_t pvzone = NULL;
395uma_zone_t l2zone;
396static uma_zone_t l2table_zone;
397static vm_offset_t pmap_kernel_l2dtable_kva;
398static vm_offset_t pmap_kernel_l2ptp_kva;
399static vm_paddr_t pmap_kernel_l2ptp_phys;
400static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0;
401static struct rwlock pvh_global_lock;
402
403/*
404 * This list exists for the benefit of pmap_map_chunk(). It keeps track
405 * of the kernel L2 tables during bootstrap, so that pmap_map_chunk() can
406 * find them as necessary.
407 *
--- 1414 unchanged lines hidden (view full) ---
1822
1823 /*
1824 * Initialize the PV entry allocator.
1825 */
1826 pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL,
1827 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
1828 TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
1829 pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
1830 uma_zone_reserve_kva(pvzone, pv_entry_max);
1831 pv_entry_high_water = 9 * (pv_entry_max / 10);
1832
1833 /*
1834 * Now it is safe to enable pv_table recording.
1835 */
1836 PDEBUG(1, printf("pmap_init: done!\n"));
1837}
1838
--- 3123 unchanged lines hidden ---