pmap.h (211197) | pmap.h (216803) |
---|---|
1/*- 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * the Systems Programming Group of the University of Utah Computer 7 * Science Department and William Jolitz of UUNET Technologies Inc. 8 * --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 34 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 35 * from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30 | 1/*- 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * the Systems Programming Group of the University of Utah Computer 7 * Science Department and William Jolitz of UUNET Technologies Inc. 8 * --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 34 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 35 * from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30 |
36 * $FreeBSD: head/sys/sparc64/include/pmap.h 211197 2010-08-11 23:22:53Z jhb $ | 36 * $FreeBSD: head/sys/sparc64/include/pmap.h 216803 2010-12-29 16:59:33Z marius $ |
37 */ 38 39#ifndef _MACHINE_PMAP_H_ 40#define _MACHINE_PMAP_H_ 41 42#include <sys/queue.h> 43#include <sys/_lock.h> 44#include <sys/_mutex.h> --- 11 unchanged lines hidden (view full) --- 56 int32_t color; 57 uint32_t flags; 58}; 59 60struct pmap { 61 struct mtx pm_mtx; 62 struct tte *pm_tsb; 63 vm_object_t pm_tsb_obj; | 37 */ 38 39#ifndef _MACHINE_PMAP_H_ 40#define _MACHINE_PMAP_H_ 41 42#include <sys/queue.h> 43#include <sys/_lock.h> 44#include <sys/_mutex.h> --- 11 unchanged lines hidden (view full) --- 56 int32_t color; 57 uint32_t flags; 58}; 59 60struct pmap { 61 struct mtx pm_mtx; 62 struct tte *pm_tsb; 63 vm_object_t pm_tsb_obj; |
64 cpumask_t pm_active; 65 uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ 66 u_int pm_retries; | 64 cpumask_t pm_active; 65 uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ 66 u_int pm_retries; |
67 u_int pm_context[MAXCPU]; 68 struct pmap_statistics pm_stats; 69}; 70 71#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) | 67 u_int pm_context[MAXCPU]; 68 struct pmap_statistics pm_stats; 69}; 70 71#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) |
72#define PMAP_LOCK_ASSERT(pmap, type) \ | 72#define PMAP_LOCK_ASSERT(pmap, type) \ |
73 mtx_assert(&(pmap)->pm_mtx, (type)) 74#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx) | 73 mtx_assert(&(pmap)->pm_mtx, (type)) 74#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx) |
75#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \ | 75#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \ |
76 NULL, MTX_DEF | MTX_DUPOK) 77#define PMAP_LOCKED(pmap) mtx_owned(&(pmap)->pm_mtx) 78#define PMAP_MTX(pmap) (&(pmap)->pm_mtx) 79#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) 80#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) 81 82#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT 83#define pmap_page_set_memattr(m, ma) (void)0 --- 10 unchanged lines hidden (view full) --- 94void pmap_cache_remove(vm_page_t m, vm_offset_t va); 95 96int pmap_remove_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, 97 vm_offset_t va); 98int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, 99 vm_offset_t va); 100 101void pmap_map_tsb(void); | 76 NULL, MTX_DEF | MTX_DUPOK) 77#define PMAP_LOCKED(pmap) mtx_owned(&(pmap)->pm_mtx) 78#define PMAP_MTX(pmap) (&(pmap)->pm_mtx) 79#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) 80#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) 81 82#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT 83#define pmap_page_set_memattr(m, ma) (void)0 --- 10 unchanged lines hidden (view full) --- 94void pmap_cache_remove(vm_page_t m, vm_offset_t va); 95 96int pmap_remove_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, 97 vm_offset_t va); 98int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, 99 vm_offset_t va); 100 101void pmap_map_tsb(void); |
102void pmap_set_kctx(void); |
|
102 103#define vtophys(va) pmap_kextract((vm_offset_t)(va)) 104 105extern struct pmap kernel_pmap_store; 106#define kernel_pmap (&kernel_pmap_store) 107extern vm_paddr_t phys_avail[]; 108extern vm_offset_t virtual_avail; 109extern vm_offset_t virtual_end; 110 111#ifdef PMAP_STATS 112 113SYSCTL_DECL(_debug_pmap_stats); 114 115#define PMAP_STATS_VAR(name) \ 116 static long name; \ | 103 104#define vtophys(va) pmap_kextract((vm_offset_t)(va)) 105 106extern struct pmap kernel_pmap_store; 107#define kernel_pmap (&kernel_pmap_store) 108extern vm_paddr_t phys_avail[]; 109extern vm_offset_t virtual_avail; 110extern vm_offset_t virtual_end; 111 112#ifdef PMAP_STATS 113 114SYSCTL_DECL(_debug_pmap_stats); 115 116#define PMAP_STATS_VAR(name) \ 117 static long name; \ |
117 SYSCTL_LONG(_debug_pmap_stats, OID_AUTO, name, CTLFLAG_RW, \ | 118 SYSCTL_LONG(_debug_pmap_stats, OID_AUTO, name, CTLFLAG_RW, \ |
118 &name, 0, "") 119 120#define PMAP_STATS_INC(var) \ 121 atomic_add_long(&var, 1) 122 123#else 124 125#define PMAP_STATS_VAR(name) 126#define PMAP_STATS_INC(var) 127 128#endif 129 130#endif /* !_MACHINE_PMAP_H_ */ | 119 &name, 0, "") 120 121#define PMAP_STATS_INC(var) \ 122 atomic_add_long(&var, 1) 123 124#else 125 126#define PMAP_STATS_VAR(name) 127#define PMAP_STATS_INC(var) 128 129#endif 130 131#endif /* !_MACHINE_PMAP_H_ */ |