Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/vm_machdep.c
Show First 20 Lines • Show All 578 Lines • ▼ Show 20 Lines | sf_buf_map(struct sf_buf *sf, int flags) | ||||
* virtual address from the TLB. Since the reference count for | * virtual address from the TLB. Since the reference count for | ||||
* the sf_buf's old mapping was zero, that mapping is not | * the sf_buf's old mapping was zero, that mapping is not | ||||
* currently in use. Consequently, there is no need to exchange | * currently in use. Consequently, there is no need to exchange | ||||
* the old and new PTEs atomically, even under PAE. | * the old and new PTEs atomically, even under PAE. | ||||
*/ | */ | ||||
ptep = vtopte(sf->kva); | ptep = vtopte(sf->kva); | ||||
opte = *ptep; | opte = *ptep; | ||||
*ptep = VM_PAGE_TO_PHYS(sf->m) | PG_RW | PG_V | | *ptep = VM_PAGE_TO_PHYS(sf->m) | PG_RW | PG_V | | ||||
pmap_cache_bits(sf->m->md.pat_mode, 0); | pmap_cache_bits(kernel_pmap, sf->m->md.pat_mode, 0); | ||||
/* | /* | ||||
* Avoid unnecessary TLB invalidations: If the sf_buf's old | * Avoid unnecessary TLB invalidations: If the sf_buf's old | ||||
* virtual-to-physical mapping was not used, then any processor | * virtual-to-physical mapping was not used, then any processor | ||||
* that has invalidated the sf_buf's virtual address from its TLB | * that has invalidated the sf_buf's virtual address from its TLB | ||||
* since the last used mapping need not invalidate again. | * since the last used mapping need not invalidate again. | ||||
*/ | */ | ||||
#ifdef SMP | #ifdef SMP | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |