PG_W
if ((*pte & PG_W) != 0)
if ((oldpde & PG_W) == 0) {
KASSERT((oldpde & PG_W) == 0,
if (oldpde & PG_W)
if (oldpte & PG_W)
if (tpte & PG_W)
if ((pten & PG_W) != 0 && (origpte & PG_W) == 0)
else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0)
newpte |= PG_W;
if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0)
else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0)
if ((newpte & PG_W) != 0)
if ((newpde & PG_W) != 0 && pmap != kernel_pmap) {
if ((newpde & PG_W) != 0)
atomic_clear_long(pdpe, PG_W);
if ((*pde & PG_W) == 0)
atomic_clear_long(pde, PG_W);
if ((*pte & PG_W) == 0)
atomic_clear_long(pte, PG_W);
*pdpe = srcptepaddr & ~PG_W;
srcptepaddr &= ~PG_W;
*dst_pte = ptetemp & ~(PG_W | PG_M | PG_A);
if ((*pte & PG_W) != 0)
if ((*pte & PG_W) != 0)
if (tpte & PG_W) {
(oldpde & PG_W) == 0) {
} else if ((*pte & PG_W) == 0) {
if ((oldpde & PG_W) == 0) {
(oldpde & PG_W) == 0) {
#define PG_PTE_PROMOTE (PG_NX | PG_MANAGED | PG_W | PG_G | PG_PTE_CACHE | \
#define pmap_pte_w(pte) ((*(int *)pte & PG_W) != 0)
#define pmap_pte_set_w(pte, v) ((v) ? atomic_set_int((u_int *)(pte), PG_W) : \
atomic_clear_int((u_int *)(pte), PG_W))
if ((tpte & PG_W) == 0)
if ((tpte & PG_W) != 0)
KASSERT((oldpde & PG_W) == 0,
if (oldpde & PG_W)
if (oldpte & PG_W)
if (tpte & PG_W)
newpte |= PG_W;
if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0)
else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0)
if ((newpte & PG_W) != 0)
if ((newpde & PG_W) != 0 && pmap != kernel_pmap) {
if ((newpde & PG_W) != 0)
if ((*pde & PG_W) == 0)
atomic_clear_int((u_int *)pde, PG_W);
if ((*pte & PG_W) == 0)
atomic_clear_int((u_int *)pte, PG_W);
~PG_W;
*dst_pte = ptetemp & ~(PG_W | PG_M |
if ((*pte & PG_W) != 0)
if (tpte & PG_W) {
(*pde & PG_W) == 0) {
if ((oldpde & PG_W) == 0) {
(oldpde & PG_W) == 0) {
#define PG_PTE_PROMOTE (PG_MANAGED | PG_W | PG_G | PG_PTE_PAT | \
if ((be64toh(*pte) & PG_W) != 0)
if ((oldl3e & PG_W) == 0) {
(oldl3e & PG_W) == 0) {
*l3e = htobe64(srcptepaddr & ~PG_W);
*dst_pte = htobe64(ptetemp & ~(PG_W | PG_M |
newpte |= PG_W;
if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0)
else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0)
if ((newpte & PG_W) != 0)
if ((newpde & PG_W) != 0 && pmap != kernel_pmap) {
if ((newpde & PG_W) != 0)
(oldl3e & PG_W) == 0) {
if ((be64toh(*pte) & PG_W) != 0)
if ((be64toh(*pte) & PG_W) != 0)
KASSERT((oldpde & PG_W) == 0,
if (oldpde & PG_W)
if (tpte & PG_W)
if (tpte & PG_W) {
if ((be64toh(*l3e) & PG_W) == 0)
atomic_clear_long(l3e, htobe64(PG_W));
if ((be64toh(*pte) & PG_W) == 0)
atomic_clear_long(pte, htobe64(PG_W));
#define PG_PTE_PROMOTE (PG_X | PG_MANAGED | PG_W | PG_PTE_CACHE | \