From 04a8a9ba95fca3ca254eb5dc2fb9c3683b0d02ed Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Mon, 6 Aug 2001 02:29:13 +0000 Subject: [PATCH] Save the primary mmu context around calls to the prom, and install nucleus context. The prom runs at trap level 0, so there's no implicit nucleus context and we have to force it. --- sys/sparc64/sparc64/support.S | 20 ++++++++++++++------ sys/sparc64/sparc64/support.s | 20 ++++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/sys/sparc64/sparc64/support.S b/sys/sparc64/sparc64/support.S index 35a4a4406be..c2d7cf50eff 100644 --- a/sys/sparc64/sparc64/support.S +++ b/sys/sparc64/sparc64/support.S @@ -330,17 +330,25 @@ ENTRY(openfirmware) rdpr %pstate, %l0 rdpr %tl, %l1 rdpr %tba, %l2 + mov AA_DMMU_PCXR, %l3 + ldxa [%l3] ASI_DMMU, %l4 + stxa %g0, [%l3] ASI_DMMU + membar #Sync + flush %sp + setx ofw_tba, %l7, %l5 + ldx [%l5], %l5 + setx ofw_vec, %l7, %l6 + ldx [%l6], %l6 + wrpr %l5, 0, %tba wrpr %g0, 0, %tl - setx ofw_tba, %l4, %l3 - ldx [%l3], %l3 - setx ofw_vec, %l5, %l4 - ldx [%l4], %l4 - wrpr %l3, 0, %tba - call %l4 + call %l6 mov %i0, %o0 wrpr %l0, 0, %pstate wrpr %l1, 0, %tl wrpr %l2, 0, %tba + stxa %l4, [%l3] ASI_DMMU + membar #Sync + flush %sp ret restore END(openfirmware) diff --git a/sys/sparc64/sparc64/support.s b/sys/sparc64/sparc64/support.s index 35a4a4406be..c2d7cf50eff 100644 --- a/sys/sparc64/sparc64/support.s +++ b/sys/sparc64/sparc64/support.s @@ -330,17 +330,25 @@ ENTRY(openfirmware) rdpr %pstate, %l0 rdpr %tl, %l1 rdpr %tba, %l2 + mov AA_DMMU_PCXR, %l3 + ldxa [%l3] ASI_DMMU, %l4 + stxa %g0, [%l3] ASI_DMMU + membar #Sync + flush %sp + setx ofw_tba, %l7, %l5 + ldx [%l5], %l5 + setx ofw_vec, %l7, %l6 + ldx [%l6], %l6 + wrpr %l5, 0, %tba wrpr %g0, 0, %tl - setx ofw_tba, %l4, %l3 - ldx [%l3], %l3 - setx ofw_vec, %l5, %l4 - ldx [%l4], %l4 - wrpr %l3, 0, %tba - call %l4 + call %l6 mov %i0, %o0 wrpr %l0, 0, %pstate wrpr %l1, 0, %tl wrpr %l2, 0, %tba + stxa %l4, [%l3] ASI_DMMU + membar #Sync + flush %sp ret restore END(openfirmware)