diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/sparc64/locore.s | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index fb8af0d2f98..e8840660791 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.56 2006/05/31 02:43:05 kettenis Exp $ */ +/* $OpenBSD: locore.s,v 1.57 2006/05/31 06:51:25 kettenis Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -4680,6 +4680,25 @@ _C_LABEL(tlb_flush_pte): .text 2: #endif /* DEBUG */ +#ifdef HORRID_III_HACK + rdpr %pstate, %o5 + andn %o5, PSTATE_IE, %o4 + wrpr %o4, %pstate ! disable interrupts + + rdpr %tl, %o3 + brnz %o3, 1f + add %o3, 1, %g2 + wrpr %g0, %g2, %tl ! Switch to traplevel > 0 +1: + mov CTX_PRIMARY, %o2 + andn %o0, 0xfff, %g2 ! drop unused va bits + ldxa [%o2] ASI_DMMU, %g1 ! Save primary context + sethi %hi(KERNBASE), %o4 + membar #LoadStore + stxa %o1, [%o2] ASI_DMMU ! Insert context to demap + membar #Sync + or %g2, DEMAP_PAGE_PRIMARY, %g2 ! Demap page from primary context only +#else mov CTX_SECONDARY, %o2 andn %o0, 0xfff, %g2 ! drop unused va bits ldxa [%o2] ASI_DMMU, %g1 ! Save secondary context @@ -4688,6 +4707,7 @@ _C_LABEL(tlb_flush_pte): stxa %o1, [%o2] ASI_DMMU ! Insert context to demap membar #Sync or %g2, DEMAP_PAGE_SECONDARY, %g2 ! Demap page from secondary context only +#endif stxa %g2, [%g2] ASI_DMMU_DEMAP ! Do the demap membar #Sync stxa %g2, [%g2] ASI_IMMU_DEMAP ! to both TLBs @@ -4699,9 +4719,13 @@ _C_LABEL(tlb_flush_pte): stxa %g2, [%g2] ASI_IMMU_DEMAP ! Do the demap membar #Sync ! No real reason for this XXXX flush %o4 - stxa %g1, [%o2] ASI_DMMU ! Restore secondary asi + stxa %g1, [%o2] ASI_DMMU ! Restore asi membar #Sync ! No real reason for this XXXX flush %o4 +#ifdef HORRID_III_HACK + wrpr %g0, %o3, %tl ! Restore traplevel + wrpr %o5, %pstate ! Restore interrupts +#endif retl nop |