From 38c326d041218e65d156ce3dd3bfee39e73ceffa Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Mon, 6 May 2013 12:22:23 -0500 Subject: 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 Reviewed-on: http://review.coreboot.org/3207 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/cpu/x86/tsc/delay_tsc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cpu/x86/tsc/delay_tsc.c') diff --git a/src/cpu/x86/tsc/delay_tsc.c b/src/cpu/x86/tsc/delay_tsc.c index 0e2a9c0faf..b8f250394f 100644 --- a/src/cpu/x86/tsc/delay_tsc.c +++ b/src/cpu/x86/tsc/delay_tsc.c @@ -4,6 +4,7 @@ #include #include #include +#include #if !defined(__PRE_RAM__) @@ -176,6 +177,9 @@ void udelay(unsigned us) unsigned long long current; unsigned long long clocks; + if (!thread_yield_microseconds(us)) + return; + start = rdtscll(); clocks = us; clocks *= get_clocks_per_usec(); -- cgit v1.2.3