Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/pmap.c
Show First 20 Lines • Show All 1,671 Lines • ▼ Show 20 Lines | pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) | ||||
oldpte = 0; | oldpte = 0; | ||||
pte = vtopte(sva); | pte = vtopte(sva); | ||||
endpte = pte + count; | endpte = pte + count; | ||||
while (pte < endpte) { | while (pte < endpte) { | ||||
m = *ma++; | m = *ma++; | ||||
pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); | pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); | ||||
if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { | if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { | ||||
oldpte |= *pte; | oldpte |= *pte; | ||||
pte_store(pte, pa | pgeflag | PG_RW | PG_V); | pte_store(pte, pa | pgeflag | pg_nx | PG_RW | PG_V); | ||||
} | } | ||||
pte++; | pte++; | ||||
} | } | ||||
if (__predict_false((oldpte & PG_V) != 0)) | if (__predict_false((oldpte & PG_V) != 0)) | ||||
pmap_invalidate_range(kernel_pmap, sva, sva + count * | pmap_invalidate_range(kernel_pmap, sva, sva + count * | ||||
PAGE_SIZE); | PAGE_SIZE); | ||||
} | } | ||||
/* | /* | ||||
* This routine tears out page mappings from the | * This routine tears out page mappings from the | ||||
* kernel -- it is meant only for temporary mappings. | * kernel -- it is meant only for temporary mappings. | ||||
* Note: SMP coherent. Uses a ranged shootdown IPI. | * Note: SMP coherent. Uses a ranged shootdown IPI. | ||||
cem: It's unclear to me why these flags were lifted out. It doesn't make sense to `qenter` without… | |||||
*/ | */ | ||||
void | void | ||||
pmap_qremove(vm_offset_t sva, int count) | pmap_qremove(vm_offset_t sva, int count) | ||||
{ | { | ||||
vm_offset_t va; | vm_offset_t va; | ||||
va = sva; | va = sva; | ||||
while (count-- > 0) { | while (count-- > 0) { | ||||
▲ Show 20 Lines • Show All 3,986 Lines • Show Last 20 Lines |
It's unclear to me why these flags were lifted out. It doesn't make sense to qenter without V (valid) or RW (readable), IMO. (I don't know what pgeflag does, but I'd just leave it in place.)