summaryrefslogtreecommitdiff
path: root/core/cortex-m0/switch.S
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-06-16 09:37:31 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-19 15:33:10 -0700
commit8a16e6483ab80a85af44e8ba164e5e91a51ec43a (patch)
treef466b3e4ba712c0b6a0d5510d4aaff0a937e5005 /core/cortex-m0/switch.S
parent90167c1764ab7c532b121bd08990b81631a3c896 (diff)
downloadchrome-ec-8a16e6483ab80a85af44e8ba164e5e91a51ec43a.tar.gz
task: Wait for HOOK_INIT completion before scheduling tasks
Until HOOK_INIT has completed, do not allow any tasks other than HOOKS or IDLE to be scheduled. Programmers often make the assumption that a HOOK_INIT function is guaranteed to be run before task code that depends on it, so let's make it so. BUG=chromium:649398 BRANCH=None TEST=Manual on kevin, compare boot without patch: ... [0.004 power state 0 = G3, in 0x0008] <-- from chipset task RTC: 0x00000000 (0.00 s) [0.004 power state 4 = G3->S5, in 0x0008] RTC: 0x00000000 (0.00 s) [0.005 clear MKBP fifo] [0.006 clear MKBP fifo] [0.006 KB init state: ... <-- from keyscan task [0.012 SW 0x05] [0.155 hash start 0x00020000 0x00019a38] [0.158 HOOK_INIT DONE!] ... to boot with patch: ... RTC: 0x58cc614c (1489789260.00 s) [0.004 clear MKBP fifo] [0.005 clear MKBP fifo] [0.010 SW 0x05] [0.155 hash start 0x00020000 0x000198e0] [0.157 HOOK_INIT DONE!] ... Also, verify kevin boots to OS and is generally functional through sysjump and basic tasks, and verify elm (stm32f0 / cortex-m0) boots. Change-Id: If56fab05ce9b9650feb93c5cfc2d084aa281e622 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/456628 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'core/cortex-m0/switch.S')
-rw-r--r--core/cortex-m0/switch.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/cortex-m0/switch.S b/core/cortex-m0/switch.S
index 95ea29e765..4b5ae23838 100644
--- a/core/cortex-m0/switch.S
+++ b/core/cortex-m0/switch.S
@@ -67,7 +67,7 @@ __task_start:
adds r2, #17*4 @ put the pointer at the top of the stack
movs r1, #0 @ __Schedule parameter : re-schedule nothing
msr psp, r2 @ setup a thread stack up to the first context switch
- movs r2, #1
+ movs r2, #1 @ r2 = TASK_SCHEDULER_INIT
isb @ ensure the write is done
msr control, r3
movs r3, r0