Replace PMAP_LARGEMAP_MAX_ADDRESS() with a more general predicate.

No functional change intended.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2019-09-02 21:54:08 +00:00
parent fe5dee73f7
commit 87044fca73

View File

@ -424,8 +424,8 @@ static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */
static vmem_t *large_vmem;
static u_int lm_ents;
#define PMAP_LARGEMAP_MAX_ADDRESS() \
(LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents)
#define PMAP_ADDRESS_IN_LARGEMAP(va) ((va) >= LARGEMAP_MIN_ADDRESS && \
(va) < LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents)
int pmap_pcid_enabled = 1;
SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
@ -3091,8 +3091,7 @@ pmap_kextract(vm_offset_t va)
if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) {
pa = DMAP_TO_PHYS(va);
} else if (LARGEMAP_MIN_ADDRESS <= va &&
va < PMAP_LARGEMAP_MAX_ADDRESS()) {
} else if (PMAP_ADDRESS_IN_LARGEMAP(va)) {
pa = pmap_large_map_kextract(va);
} else {
pde = *vtopde(va);
@ -9022,7 +9021,7 @@ pmap_large_map_kextract(vm_offset_t va)
pd_entry_t *pde, pd;
pt_entry_t *pte, pt;
KASSERT(LARGEMAP_MIN_ADDRESS <= va && va < PMAP_LARGEMAP_MAX_ADDRESS(),
KASSERT(PMAP_ADDRESS_IN_LARGEMAP(va),
("not largemap range %#lx", (u_long)va));
pdpe = pmap_large_map_pdpe(va);
pdp = *pdpe;
@ -9164,8 +9163,8 @@ pmap_large_unmap(void *svaa, vm_size_t len)
return;
SLIST_INIT(&spgf);
KASSERT(LARGEMAP_MIN_ADDRESS <= sva &&
sva + len <= PMAP_LARGEMAP_MAX_ADDRESS(),
KASSERT(PMAP_ADDRESS_IN_LARGEMAP(sva) &&
PMAP_ADDRESS_IN_LARGEMAP(sva + len - 1),
("not largemap range %#lx %#lx", (u_long)svaa, (u_long)svaa + len));
PMAP_LOCK(kernel_pmap);
for (va = sva; va < sva + len; va += inc) {