pmap.h (239152) | pmap.h (239236) |
---|---|
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 * --- 26 unchanged lines hidden (view full) --- 35 * map the page tables using the pagetables themselves. This is done to 36 * reduce the impact on kernel virtual memory for lots of sparse address 37 * space, and to reduce the cost of memory to each process. 38 * 39 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 40 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 41 * from: src/sys/i386/include/pmap.h,v 1.65.2.2 2000/11/30 01:54:42 peter 42 * JNPR: pmap.h,v 1.7.2.1 2007/09/10 07:44:12 girish | 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 * --- 26 unchanged lines hidden (view full) --- 35 * map the page tables using the pagetables themselves. This is done to 36 * reduce the impact on kernel virtual memory for lots of sparse address 37 * space, and to reduce the cost of memory to each process. 38 * 39 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 40 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 41 * from: src/sys/i386/include/pmap.h,v 1.65.2.2 2000/11/30 01:54:42 peter 42 * JNPR: pmap.h,v 1.7.2.1 2007/09/10 07:44:12 girish |
43 * $FreeBSD: head/sys/mips/include/pmap.h 239152 2012-08-09 16:38:17Z alc $ | 43 * $FreeBSD: head/sys/mips/include/pmap.h 239236 2012-08-13 17:38:38Z alc $ |
44 */ 45 46#ifndef _MACHINE_PMAP_H_ 47#define _MACHINE_PMAP_H_ 48 49#include <machine/vmparam.h> 50#include <machine/pte.h> 51 --- 9 unchanged lines hidden (view full) --- 61#include <sys/_cpuset.h> 62#include <sys/_lock.h> 63#include <sys/_mutex.h> 64 65/* 66 * Pmap stuff 67 */ 68struct pv_entry; | 44 */ 45 46#ifndef _MACHINE_PMAP_H_ 47#define _MACHINE_PMAP_H_ 48 49#include <machine/vmparam.h> 50#include <machine/pte.h> 51 --- 9 unchanged lines hidden (view full) --- 61#include <sys/_cpuset.h> 62#include <sys/_lock.h> 63#include <sys/_mutex.h> 64 65/* 66 * Pmap stuff 67 */ 68struct pv_entry; |
69struct pv_chunk; |
|
69 70struct md_page { | 70 71struct md_page { |
71 int pv_list_count; | |
72 int pv_flags; 73 TAILQ_HEAD(, pv_entry) pv_list; 74}; 75 76#define PV_TABLE_MOD 0x01 /* modified */ 77#define PV_TABLE_REF 0x02 /* referenced */ 78 79#define ASID_BITS 8 80#define ASIDGEN_BITS (32 - ASID_BITS) 81#define ASIDGEN_MASK ((1 << ASIDGEN_BITS) - 1) 82 83struct pmap { 84 pd_entry_t *pm_segtab; /* KVA of segment table */ | 72 int pv_flags; 73 TAILQ_HEAD(, pv_entry) pv_list; 74}; 75 76#define PV_TABLE_MOD 0x01 /* modified */ 77#define PV_TABLE_REF 0x02 /* referenced */ 78 79#define ASID_BITS 8 80#define ASIDGEN_BITS (32 - ASID_BITS) 81#define ASIDGEN_MASK ((1 << ASIDGEN_BITS) - 1) 82 83struct pmap { 84 pd_entry_t *pm_segtab; /* KVA of segment table */ |
85 TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in 86 * pmap */ | 85 TAILQ_HEAD(, pv_chunk) pm_pvchunk; /* list of mappings in pmap */ |
87 cpuset_t pm_active; /* active on cpus */ 88 struct { 89 u_int32_t asid:ASID_BITS; /* TLB address space tag */ 90 u_int32_t gen:ASIDGEN_BITS; /* its generation number */ 91 } pm_asid[MAXSMPCPU]; 92 struct pmap_statistics pm_stats; /* pmap statistics */ 93 struct mtx pm_mtx; 94}; --- 21 unchanged lines hidden (view full) --- 116#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) 117#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) 118 119/* 120 * For each vm_page_t, there is a list of all currently valid virtual 121 * mappings of that page. An entry is a pv_entry_t, the list is pv_table. 122 */ 123typedef struct pv_entry { | 86 cpuset_t pm_active; /* active on cpus */ 87 struct { 88 u_int32_t asid:ASID_BITS; /* TLB address space tag */ 89 u_int32_t gen:ASIDGEN_BITS; /* its generation number */ 90 } pm_asid[MAXSMPCPU]; 91 struct pmap_statistics pm_stats; /* pmap statistics */ 92 struct mtx pm_mtx; 93}; --- 21 unchanged lines hidden (view full) --- 115#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) 116#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) 117 118/* 119 * For each vm_page_t, there is a list of all currently valid virtual 120 * mappings of that page. An entry is a pv_entry_t, the list is pv_table. 121 */ 122typedef struct pv_entry { |
124 pmap_t pv_pmap; /* pmap where mapping lies */ | |
125 vm_offset_t pv_va; /* virtual address for mapping */ 126 TAILQ_ENTRY(pv_entry) pv_list; | 123 vm_offset_t pv_va; /* virtual address for mapping */ 124 TAILQ_ENTRY(pv_entry) pv_list; |
127 TAILQ_ENTRY(pv_entry) pv_plist; | |
128} *pv_entry_t; 129 130/* | 125} *pv_entry_t; 126 127/* |
128 * pv_entries are allocated in chunks per-process. This avoids the 129 * need to track per-pmap assignments. 130 */ 131#ifdef __mips_n64 132#define _NPCM 3 133#define _NPCPV 168 134#else 135#define _NPCM 11 136#define _NPCPV 336 137#endif 138struct pv_chunk { 139 pmap_t pc_pmap; 140 TAILQ_ENTRY(pv_chunk) pc_list; 141 u_long pc_map[_NPCM]; /* bitmap; 1 = free */ 142 TAILQ_ENTRY(pv_chunk) pc_lru; 143 struct pv_entry pc_pventry[_NPCPV]; 144}; 145 146/* |
|
131 * physmem_desc[] is a superset of phys_avail[] and describes all the 132 * memory present in the system. 133 * 134 * phys_avail[] is similar but does not include the memory stolen by 135 * pmap_steal_memory(). 136 * 137 * Each memory region is described by a pair of elements in the array 138 * so we can describe up to (PHYS_AVAIL_ENTRIES / 2) distinct memory --- 36 unchanged lines hidden --- | 147 * physmem_desc[] is a superset of phys_avail[] and describes all the 148 * memory present in the system. 149 * 150 * phys_avail[] is similar but does not include the memory stolen by 151 * pmap_steal_memory(). 152 * 153 * Each memory region is described by a pair of elements in the array 154 * so we can describe up to (PHYS_AVAIL_ENTRIES / 2) distinct memory --- 36 unchanged lines hidden --- |