Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/pmap.c
Show All 12 Lines | |||||
#define DMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> L0_SHIFT) | #define DMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> L0_SHIFT) | ||||
extern pt_entry_t pagetable_dmap[]; | extern pt_entry_t pagetable_dmap[]; | ||||
#define PHYSMAP_SIZE (2 * (VM_PHYSSEG_MAX - 1)) | #define PHYSMAP_SIZE (2 * (VM_PHYSSEG_MAX - 1)) | ||||
static vm_paddr_t physmap[PHYSMAP_SIZE]; | static vm_paddr_t physmap[PHYSMAP_SIZE]; | ||||
static u_int physmap_idx; | static u_int physmap_idx; | ||||
static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); | static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"VM/pmap parameters"); | |||||
/* | /* | ||||
* This ASID allocator uses a bit vector ("asid_set") to remember which ASIDs | * This ASID allocator uses a bit vector ("asid_set") to remember which ASIDs | ||||
* that it has currently allocated to a pmap, a cursor ("asid_next") to | * that it has currently allocated to a pmap, a cursor ("asid_next") to | ||||
* optimize its search for a free ASID in the bit vector, and an epoch number | * optimize its search for a free ASID in the bit vector, and an epoch number | ||||
* ("asid_epoch") to indicate when it has reclaimed all previously allocated | * ("asid_epoch") to indicate when it has reclaimed all previously allocated | ||||
* ASIDs that are not currently active on a processor. | * ASIDs that are not currently active on a processor. | ||||
* | * | ||||
* The current epoch number is always in the range [0, INT_MAX). Negative | * The current epoch number is always in the range [0, INT_MAX). Negative | ||||
* numbers and INT_MAX are reserved for special cases that are described | * numbers and INT_MAX are reserved for special cases that are described | ||||
* below. | * below. | ||||
*/ | */ | ||||
static SYSCTL_NODE(_vm_pmap, OID_AUTO, asid, CTLFLAG_RD, 0, "ASID allocator"); | static SYSCTL_NODE(_vm_pmap, OID_AUTO, asid, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"ASID allocator"); | |||||
static int asid_bits; | static int asid_bits; | ||||
SYSCTL_INT(_vm_pmap_asid, OID_AUTO, bits, CTLFLAG_RD, &asid_bits, 0, | SYSCTL_INT(_vm_pmap_asid, OID_AUTO, bits, CTLFLAG_RD, &asid_bits, 0, | ||||
"The number of bits in an ASID"); | "The number of bits in an ASID"); | ||||
static bitstr_t *asid_set; | static bitstr_t *asid_set; | ||||
static int asid_set_size; | static int asid_set_size; | ||||
static int asid_next; | static int asid_next; | ||||
SYSCTL_INT(_vm_pmap_asid, OID_AUTO, next, CTLFLAG_RD, &asid_next, 0, | SYSCTL_INT(_vm_pmap_asid, OID_AUTO, next, CTLFLAG_RD, &asid_next, 0, | ||||
"The last allocated ASID plus one"); | "The last allocated ASID plus one"); | ||||
Show All 24 Lines | |||||
pv_table = (struct md_page *)kmem_malloc(s, M_WAITOK | M_ZERO); | pv_table = (struct md_page *)kmem_malloc(s, M_WAITOK | M_ZERO); | ||||
for (i = 0; i < pv_npg; i++) | for (i = 0; i < pv_npg; i++) | ||||
TAILQ_INIT(&pv_table[i].pv_list); | TAILQ_INIT(&pv_table[i].pv_list); | ||||
TAILQ_INIT(&pv_dummy.pv_list); | TAILQ_INIT(&pv_dummy.pv_list); | ||||
vm_initialized = 1; | vm_initialized = 1; | ||||
} | } | ||||
static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, | static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"2MB page mapping counters"); | "2MB page mapping counters"); | ||||
static u_long pmap_l2_demotions; | static u_long pmap_l2_demotions; | ||||
SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, demotions, CTLFLAG_RD, | SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, demotions, CTLFLAG_RD, | ||||
&pmap_l2_demotions, 0, "2MB page demotions"); | &pmap_l2_demotions, 0, "2MB page demotions"); | ||||
static u_long pmap_l2_mappings; | static u_long pmap_l2_mappings; | ||||
SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, mappings, CTLFLAG_RD, | SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, mappings, CTLFLAG_RD, | ||||
Show All 12 Lines |