summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/nds32/init.S11
-rw-r--r--core/nds32/task.c4
2 files changed, 11 insertions, 4 deletions
diff --git a/core/nds32/init.S b/core/nds32/init.S
index 28dd1a5ca1..d278d4a899 100644
--- a/core/nds32/init.S
+++ b/core/nds32/init.S
@@ -192,6 +192,17 @@ excep_handler:
la $r0, saved_regs + 4
smw.bim $r1, [$r0], $r10, 0
smw.bim $r15,[$r0], $r15, 0xF
+#ifdef CONFIG_FPU
+ /*
+ * We have to restore ALU so that we can continue the next
+ * sequence if arithmetic instructions are used.
+ * (Apply to floating point division by zero)
+ */
+ sethi $r4, 0x80
+ ori $r4, $r4,0x9
+ mtsr $r4, $dlmb
+ dsb
+#endif
/* put a sane stack pointer */
la $sp, stack_end
/* add IPC, IPSW to the context */
diff --git a/core/nds32/task.c b/core/nds32/task.c
index 88bd731051..9310223989 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -134,11 +134,7 @@ uint8_t task_stacks[0
#undef TASK
/* Reserve space to discard context on first context switch. */
-#ifdef CONFIG_FPU
-uint32_t scratchpad[19+18];
-#else
uint32_t scratchpad[19];
-#endif
task_ *current_task = (task_ *)scratchpad;