Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56356 )
Change subject: lib/thread: Clean up initialization sequence ......................................................................
lib/thread: Clean up initialization sequence
idle_thread_init was actually configuring the BSP thread at the end. We can instead do this in threads_initialize. This now lets us set initialized after the idle thread has been setup.
BUG=b:179699789 TEST=Boot guybrush to OS
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I7f1d6afac3b0622612565b37c61fbd2cd2481552 --- M src/lib/thread.c 1 file changed, 3 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/56356/1
diff --git a/src/lib/thread.c b/src/lib/thread.c index a8c0772c..d44c218 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -213,8 +213,6 @@ /* Queue idle thread to run once all other threads have yielded. */ prepare_thread(t, idle_thread, NULL, call_wrapper, NULL); push_runnable(t); - /* Mark the currently executing thread to cooperate. */ - thread_cooperate(); }
/* Don't inline this function so the timeout_callback won't have its storage @@ -260,6 +258,7 @@ ci->thread = t; t->stack_orig = (uintptr_t)ci; t->id = 0; + t->can_yield = 1;
stack_top = &thread_stacks[CONFIG_STACK_SIZE] - sizeof(struct cpu_info); for (i = 1; i < TOTAL_NUM_THREADS; i++) { @@ -270,9 +269,9 @@ free_thread(t); }
- initialized = 1; - idle_thread_init(); + + initialized = 1; }
int thread_run(void (*func)(void *), void *arg)