summaryrefslogtreecommitdiff
path: root/src/arch/x86/lib/c_start.S
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-05-06 12:22:23 -0500
committerRonald G. Minnich <rminnich@gmail.com>2013-05-14 05:24:18 +0200
commit38c326d041218e65d156ce3dd3bfee39e73ceffa (patch)
treec48354cbb88efd809a37bb1d397ee76108ab68ec /src/arch/x86/lib/c_start.S
parent4409a5eef6d1d669caad1bfe3fbefee87ea7734e (diff)
downloadcoreboot-38c326d041218e65d156ce3dd3bfee39e73ceffa.tar.xz
x86: add thread support
Thread support is added for the x86 architecture. Both the local apic and the tsc udelay() functions have a call to thread_yield_microseconds() so as to provide an opportunity to run pending threads. Change-Id: Ie39b9eb565eb189676c06645bdf2a8720fe0636a Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/3207 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch/x86/lib/c_start.S')
-rw-r--r--src/arch/x86/lib/c_start.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/arch/x86/lib/c_start.S b/src/arch/x86/lib/c_start.S
index 1e38acaf02..c725f82670 100644
--- a/src/arch/x86/lib/c_start.S
+++ b/src/arch/x86/lib/c_start.S
@@ -10,6 +10,11 @@
_stack:
.space CONFIG_MAX_CPUS*CONFIG_STACK_SIZE
_estack:
+#if CONFIG_COOP_MULTITASKING
+.global thread_stacks
+thread_stacks:
+.space CONFIG_STACK_SIZE*CONFIG_NUM_THREADS
+#endif
.section ".textfirst", "ax", @progbits
.code32
@@ -45,6 +50,10 @@ _start:
/* set new stack */
movl $_estack, %esp
+#if CONFIG_COOP_MULTITASKING
+ /* Push the thread pointer. */
+ pushl $0
+#endif
/* Push the cpu index and struct cpu */
pushl $0
pushl $0