Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/ps3/mmu_ps3.c
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | |||||
static int64_t | static int64_t | ||||
mps3_pte_unset(mmu_t mmu, struct pvo_entry *pvo) | mps3_pte_unset(mmu_t mmu, struct pvo_entry *pvo) | ||||
{ | { | ||||
int64_t refchg; | int64_t refchg; | ||||
mtx_lock(&mps3_table_lock); | mtx_lock(&mps3_table_lock); | ||||
refchg = mps3_pte_synch_locked(pvo); | refchg = mps3_pte_synch_locked(pvo); | ||||
if (refchg < 0) { | if (refchg < 0) { | ||||
moea64_pte_overflow--; | STAT_MOEA64(moea64_pte_overflow--); | ||||
mtx_unlock(&mps3_table_lock); | mtx_unlock(&mps3_table_lock); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
/* XXX: race on RC bits between unset and sync. Anything to do? */ | /* XXX: race on RC bits between unset and sync. Anything to do? */ | ||||
lv1_write_htab_entry(mps3_vas_id, pvo->pvo_pte.slot, 0, 0); | lv1_write_htab_entry(mps3_vas_id, pvo->pvo_pte.slot, 0, 0); | ||||
mtx_unlock(&mps3_table_lock); | mtx_unlock(&mps3_table_lock); | ||||
moea64_pte_valid--; | STAT_MOEA64(moea64_pte_valid--); | ||||
return (refchg & (LPTE_REF | LPTE_CHG)); | return (refchg & (LPTE_REF | LPTE_CHG)); | ||||
} | } | ||||
static int | static int | ||||
mps3_pte_insert(mmu_t mmu, struct pvo_entry *pvo) | mps3_pte_insert(mmu_t mmu, struct pvo_entry *pvo) | ||||
{ | { | ||||
int result; | int result; | ||||
Show All 24 Lines | mps3_pte_insert(mmu_t mmu, struct pvo_entry *pvo) | ||||
/* | /* | ||||
* See where we ended up. | * See where we ended up. | ||||
*/ | */ | ||||
if ((index & ~7UL) != pvo->pvo_pte.slot) | if ((index & ~7UL) != pvo->pvo_pte.slot) | ||||
pvo->pvo_vaddr |= PVO_HID; | pvo->pvo_vaddr |= PVO_HID; | ||||
pvo->pvo_pte.slot = index; | pvo->pvo_pte.slot = index; | ||||
moea64_pte_valid++; | STAT_MOEA64(moea64_pte_valid++); | ||||
if (evicted.pte_hi) { | if (evicted.pte_hi) { | ||||
KASSERT((evicted.pte_hi & (LPTE_WIRED | LPTE_LOCKED)) == 0, | KASSERT((evicted.pte_hi & (LPTE_WIRED | LPTE_LOCKED)) == 0, | ||||
("Evicted a wired PTE")); | ("Evicted a wired PTE")); | ||||
moea64_pte_valid--; | STAT_MOEA64(moea64_pte_valid--); | ||||
moea64_pte_overflow++; | STAT_MOEA64(moea64_pte_overflow++); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||