PERFORCE change 41100 for review
Juli Mallett
jmallett at FreeBSD.org
Sun Nov 2 01:11:30 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=41100
Change 41100 by jmallett at jmallett_dalek on 2003/11/02 01:10:41
Random uselesss hackery and removal of critical section stuff
which blows up nicely before thread0 is initialised.
Affected files ...
.. //depot/projects/mips/sys/mips/mips/db_interface.c#8 edit
.. //depot/projects/mips/sys/mips/mips/tlb.c#6 edit
Differences ...
==== //depot/projects/mips/sys/mips/mips/db_interface.c#8 (text+ko) ====
==== //depot/projects/mips/sys/mips/mips/tlb.c#6 (text+ko) ====
@@ -46,6 +46,7 @@
#include <vm/vm_extern.h>
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
+#include <vm/pmap.h>
#include <vm/uma.h>
#include <vm/uma_int.h>
@@ -105,7 +106,7 @@
pte = tlb_pte_find(pmap->pm_lev1, va);
if (pte_valid(pte))
tlb_invalidate_page(va);
- *pte = MIPS_PA_TO_PFN(pa) | bits;
+ *pte = MIPS_PA_TO_PFN(pa) | bits | PG_G;
}
void
@@ -140,13 +141,11 @@
tlb_insert(vm_offset_t va, pt_entry_t pte0, pt_entry_t pte1)
{
va &= ~PAGE_MASK;
- critical_enter();
/* XXX assumes kernel region - region 3. */
mips_wr_entryhi(MIPS_HI_R_KERNEL | MIPS_HI_VA_TO_VPN2(va) /* XXX | ASID */);
mips_wr_entrylo0(pte0);
mips_wr_entrylo1(pte1);
mips_tlbwr();
- critical_exit();
}
void
@@ -174,7 +173,7 @@
void
tlb_modified(void *badvaddr)
{
- pt_entry_t *pte, entry;
+ pt_entry_t *pte;
vm_offset_t va;
va = (vm_offset_t) badvaddr;
@@ -183,6 +182,8 @@
/*
* Do we really want to dirty this page?
*/
+ if (!pte_valid(pte))
+ panic("write to invalid page");
if (pte_ro(pte))
panic("write to ro page");
if (pte_dirty(pte))
@@ -193,15 +194,9 @@
*/
*pte |= PG_D;
- /*
- * Make a PTE purely to insert into the TLB.
- */
- entry = *pte & MIPS_PFN_MASK;
- entry |= *pte & PG_HW;
-
if (va & PG_ODDPG) {
- tlb_update(va, pte[-1], entry);
+ tlb_update(va, pte[-1], pte[0]);
} else {
- tlb_update(va, entry, pte[1]);
+ tlb_update(va, pte[0], pte[1]);
}
}
More information about the p4-projects
mailing list