diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-05-30 09:00:18 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-05-30 09:00:18 -0400 |
commit | 85d6943af50537d3aec58b967ffbd3fec88453e9 (patch) | |
tree | 2033d95a7a57f792856cc08e1bd77f01386c5ed6 /arch/arm/vfp/vfphw.S | |
parent | 26584853a44c58f3d6ac7360d697a2ddcd1a3efa (diff) |
Fix the VFP handling on the Feroceon CPU
This CPU generates synchronous VFP exceptions in a non-standard way -
the FPEXC.EX bit set but without the FPSCR.IXE bit being set like in the
VFP subarchitecture 1 or just the FPEXC.DEX bit like in VFP
subarchitecture 2. The main problem is that the faulty instruction
(which needs to be emulated in software) will be restarted several times
(normally until a context switch disables the VFP). This patch ensures
that the VFP exception is treated as synchronous.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Nicolas Pitre <nico@cam.org>
Diffstat (limited to 'arch/arm/vfp/vfphw.S')
-rw-r--r-- | arch/arm/vfp/vfphw.S | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index 83c4e384b16d..1aeae38725dd 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S | |||
@@ -100,6 +100,7 @@ ENTRY(vfp_support_entry) | |||
100 | beq no_old_VFP_process | 100 | beq no_old_VFP_process |
101 | VFPFSTMIA r4, r5 @ save the working registers | 101 | VFPFSTMIA r4, r5 @ save the working registers |
102 | VFPFMRX r5, FPSCR @ current status | 102 | VFPFMRX r5, FPSCR @ current status |
103 | #ifndef CONFIG_CPU_FEROCEON | ||
103 | tst r1, #FPEXC_EX @ is there additional state to save? | 104 | tst r1, #FPEXC_EX @ is there additional state to save? |
104 | beq 1f | 105 | beq 1f |
105 | VFPFMRX r6, FPINST @ FPINST (only if FPEXC.EX is set) | 106 | VFPFMRX r6, FPINST @ FPINST (only if FPEXC.EX is set) |
@@ -107,6 +108,7 @@ ENTRY(vfp_support_entry) | |||
107 | beq 1f | 108 | beq 1f |
108 | VFPFMRX r8, FPINST2 @ FPINST2 if needed (and present) | 109 | VFPFMRX r8, FPINST2 @ FPINST2 if needed (and present) |
109 | 1: | 110 | 1: |
111 | #endif | ||
110 | stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 | 112 | stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 |
111 | @ and point r4 at the word at the | 113 | @ and point r4 at the word at the |
112 | @ start of the register dump | 114 | @ start of the register dump |
@@ -119,6 +121,7 @@ no_old_VFP_process: | |||
119 | VFPFLDMIA r10, r5 @ reload the working registers while | 121 | VFPFLDMIA r10, r5 @ reload the working registers while |
120 | @ FPEXC is in a safe state | 122 | @ FPEXC is in a safe state |
121 | ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 | 123 | ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 |
124 | #ifndef CONFIG_CPU_FEROCEON | ||
122 | tst r1, #FPEXC_EX @ is there additional state to restore? | 125 | tst r1, #FPEXC_EX @ is there additional state to restore? |
123 | beq 1f | 126 | beq 1f |
124 | VFPFMXR FPINST, r6 @ restore FPINST (only if FPEXC.EX is set) | 127 | VFPFMXR FPINST, r6 @ restore FPINST (only if FPEXC.EX is set) |
@@ -126,6 +129,7 @@ no_old_VFP_process: | |||
126 | beq 1f | 129 | beq 1f |
127 | VFPFMXR FPINST2, r8 @ FPINST2 if needed (and present) | 130 | VFPFMXR FPINST2, r8 @ FPINST2 if needed (and present) |
128 | 1: | 131 | 1: |
132 | #endif | ||
129 | VFPFMXR FPSCR, r5 @ restore status | 133 | VFPFMXR FPSCR, r5 @ restore status |
130 | 134 | ||
131 | check_for_exception: | 135 | check_for_exception: |