Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/sparc64 sun4v: add missing implementation o...
details: https://anonhg.NetBSD.org/src/rev/b02b22dd1a5a
branches: trunk
changeset: 345233:b02b22dd1a5a
user: palle <palle%NetBSD.org@localhost>
date: Fri May 13 21:48:15 2016 +0000
description:
sun4v: add missing implementation of sun4v_datatrap_tl0 so data_access_fault() is called - mostly from OpenBSD
diffstat:
sys/arch/sparc64/sparc64/locore.s | 63 +++++++++++++++++++++++++++++++++++++-
1 files changed, 60 insertions(+), 3 deletions(-)
diffs (78 lines):
diff -r 9988e9db5e85 -r b02b22dd1a5a sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Fri May 13 21:24:11 2016 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Fri May 13 21:48:15 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.392 2016/05/13 21:21:25 nakayama Exp $ */
+/* $NetBSD: locore.s,v 1.393 2016/05/13 21:48:15 palle Exp $ */
/*
* Copyright (c) 2006-2010 Matthew R. Green
@@ -2829,9 +2829,66 @@
nop
ba sun4v_datatrap_tl1
nop
+
sun4v_datatrap_tl0:
- /* XXX missing implementaion */
- sir
+ GET_MMFSA %g3 ! MMU Fault status area
+ add %g3, 0x48, %g1
+ LDPTRA [%g1] ASI_PHYS_CACHED, %g1 ! Data fault address
+ add %g3, 0x50, %g2
+ LDPTRA [%g2] ASI_PHYS_CACHED, %g2 ! Data fault context
+
+ TRAP_SETUP(-CC64FSZ-TF_SIZE)
+ or %g1, %g2, %o3
+ mov %g1, %o4
+
+ rdpr %tt, %g4
+ rdpr %tstate, %g1
+ rdpr %tpc, %g2
+ rdpr %tnpc, %g3
+
+ stx %g1, [%sp + CC64FSZ + BIAS + TF_TSTATE]
+ mov %g4, %o1 ! (type)
+ stx %g2, [%sp + CC64FSZ + BIAS + TF_PC]
+ rd %y, %g5
+ stx %g3, [%sp + CC64FSZ + BIAS + TF_NPC]
+ st %g5, [%sp + CC64FSZ + BIAS + TF_Y]
+ mov %g2, %o2 ! (pc)
+ sth %o1, [%sp + CC64FSZ + BIAS + TF_TT]! debug
+
+ cmp %o1, T_FDMMU_PROT
+ bne,pn %icc, 1f
+ mov SFSR_FV, %o5
+ or %o5, SFSR_W, %o5
+
+1:
+ NORMAL_GLOBALS_SUN4V
+
+ stx %g1, [%sp + CC64FSZ + BIAS + TF_G + (1*8)]
+ stx %g2, [%sp + CC64FSZ + BIAS + TF_G + (2*8)]
+ add %sp, CC64FSZ + BIAS, %o0 ! (&tf)
+ stx %g3, [%sp + CC64FSZ + BIAS + TF_G + (3*8)]
+ stx %g4, [%sp + CC64FSZ + BIAS + TF_G + (4*8)]
+ stx %g5, [%sp + CC64FSZ + BIAS + TF_G + (5*8)]
+ rdpr %pil, %g5
+ stx %g6, [%sp + CC64FSZ + BIAS + TF_G + (6*8)]
+ stx %g7, [%sp + CC64FSZ + BIAS + TF_G + (7*8)]
+ stb %g5, [%sp + CC64FSZ + BIAS + TF_PIL]
+ stb %g5, [%sp + CC64FSZ + BIAS + TF_OLDPIL]
+
+ /*
+ * Phew, ready to enable traps and call C code.
+ */
+ wrpr %g0, 0, %tl
+
+ wr %g0, ASI_PRIMARY_NOFAULT, %asi ! Restore default ASI
+ wrpr %g0, PSTATE_INTR, %pstate ! traps on again
+ call _C_LABEL(data_access_fault) ! data_acces_fault(tf, type, ...)
+ nop
+
+ ba,a,pt %icc, return_from_trap
+ nop
+ NOTREACHED
+
sun4v_datatrap_tl1:
/* XXX missing implementaion */
sir
Home |
Main Index |
Thread Index |
Old Index