summaryrefslogtreecommitdiff
path: root/core/nds32/task.c
diff options
context:
space:
mode:
authorDino Li <dino.li@ite.com.tw>2015-12-16 18:31:07 +0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-16 21:49:34 -0800
commit11c2c9223688c9d8d5833ab1d0d9dd7dfdca635d (patch)
treea6dda955821162e0847b116866468e472577cf7d /core/nds32/task.c
parent51811325d248b216c1d079c61a971ecead447d8c (diff)
downloadchrome-ec-11c2c9223688c9d8d5833ab1d0d9dd7dfdca635d.tar.gz
nds32: start_irq_handler() use system stack
[symptom] The 'vboot_hash_start()' always return busy error and variable 'in_progress' got a strange value(should be 0 or 1). 'start_irq_handler()' causes scratchpad overflow in first context switch. It must be called after SP switch to system stack in ISR. NOTE: The scratchpad is still also need more size even if 'start_irq_handler()' is using system stack. following is detail: 1. uint32_t scratchpad[19] 0x81d34 ~ 0x81d7f [__task_start:] 2. /* put the dummy stack pointer at the top of the stack in scratchpad */ addi $sp, $r3, 4 * 18 -> SP 0x81d7c 3. syscall push return address (-4) -> SP 0x81d78 [ISR:] 4. push r15, fp, lp, and sp (-0x10) -> SP 0x81d68 5. push r0 ~ r5 (-0x18) -> SP 0x81d50 [__switch_task:] 6. /* save ipsw, ipc, r6, r7, r8, r9, r10 on the current process stack */ (-0x1C) -> SP 0x81d34 Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=1. hash done. 2. console command 'taskinfo'. 3. the scratchpad does not overflow after first context switch. Change-Id: If5d89ff5c945a777010492fcfb54bf41f434ed69 Reviewed-on: https://chromium-review.googlesource.com/317468 Commit-Ready: Dino Li <dino.li@ite.com.tw> Tested-by: Dino Li <dino.li@ite.com.tw> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'core/nds32/task.c')
-rw-r--r--core/nds32/task.c4
1 files changed, 2 insertions, 2 deletions
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;