summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/nds32/init.S4
-rw-r--r--core/nds32/switch.S2
-rw-r--r--core/nds32/task.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/core/nds32/init.S b/core/nds32/init.S
index 1f0b5c28e6..1f9c71b3c6 100644
--- a/core/nds32/init.S
+++ b/core/nds32/init.S
@@ -20,13 +20,13 @@ __entry_\()\name:
smw.adm $r15, [$sp], $r15, 0xb
/* r0-r5 are caller saved */
smw.adm $r0, [$sp], $r5, 0
- /* isr entry */
- jal start_irq_handler
/* switch to system stack if we are called from process stack */
la $r3, stack_end
mov55 $fp, $sp
slt45 $r3, $sp /* if sp > end of system stack, then r15 = 1 and */
cmovn $sp, $r3, $r15 /* point sp to the top of the system stack */
+ /* isr entry */
+ jal start_irq_handler
/* C routine handler */
jal \name\()_handler
/* check whether we need to change the scheduled task */
diff --git a/core/nds32/switch.S b/core/nds32/switch.S
index 81c0770dea..a9633782b3 100644
--- a/core/nds32/switch.S
+++ b/core/nds32/switch.S
@@ -89,7 +89,7 @@ __task_start:
movi55 $r0, 0 /* syscall 1st parameter : de-schedule nothing */
/* put the dummy stack pointer at the top of the stack in scratchpad */
- addi $sp, $r3, 4 * 16
+ addi $sp, $r3, 4 * 18
/* we are ready to re-schedule */
swi.gp $r4, [ + need_resched]
diff --git a/core/nds32/task.c b/core/nds32/task.c
index 3075fe05c6..b34e9e9f50 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -145,9 +145,9 @@ uint8_t task_stacks[0
/* Reserve space to discard context on first context switch. */
#ifdef CONFIG_FPU
-uint32_t scratchpad[17+18];
+uint32_t scratchpad[19+18];
#else
-uint32_t scratchpad[17];
+uint32_t scratchpad[19];
#endif
task_ *current_task = (task_ *)scratchpad;