1 From ce71c62289d17a6e7d809759f6b10297bb066d11 Mon Sep 17 00:00:00 2001
2 From: Andreas Larsson <andreas@gaisler.com>
3 Date: Wed, 20 Sep 2017 09:10:46 +0200
4 Subject: [PATCH 10/32] sparc32,leon: Handle self clearing FSR.ftt when saving
7 GRFPU self clears the ftt field after a STFSR. Make sure that the ftt
8 field is not for cases with multiple STFSRs.
10 Signed-off-by: Andreas Larsson <andreas@gaisler.com>
12 arch/sparc/kernel/entry.S | 8 +++++++-
13 1 file changed, 7 insertions(+), 1 deletion(-)
15 diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
16 index b56f489e38bb..87c68aeeb794 100644
17 --- a/arch/sparc/kernel/entry.S
18 +++ b/arch/sparc/kernel/entry.S
19 @@ -1062,6 +1062,7 @@ fpsave:
20 st %fsr, [%o1] ! this can trap on us if fpu is in bogon state
27 @@ -1072,6 +1073,10 @@ fpsave:
31 + andn %g3, %g5, %g3 /* ftt gets cleared on stfsr for GRFPU... */
34 + st %g3, [%o1] /* ... so set ftt field from first fsr read */
38 @@ -1108,8 +1113,9 @@ fpsave_catch:
42 + st %fsr, [%o1] /* In this case, this is the first successful fsr read */
45 + ld [%o1], %g1 /* so take care of it for GRFPU ftt field handling */
47 /* void fpload(unsigned long *fpregs, unsigned long *fsr); */