lib/thread: Guard thread_run_until with ENV_RAMSTAGE

thread_run_until is a ramstage specific API. This change guards the API
by checking ENV_RAMSTAGE.

BUG=b:179699789
TEST=Boot guybrush to the OS

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I4784942070fd352a48c349f3b65f5a299abf2800
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56529
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Raul E Rangel 2021-07-22 12:40:26 -06:00 committed by Werner Zeh
parent 2f04e03e06
commit 8c892070e9
1 changed files with 4 additions and 0 deletions

View File

@ -313,6 +313,10 @@ int thread_run_until(struct thread_handle *handle, enum cb_err (*func)(void *),
struct thread *t;
struct block_boot_state *bbs;
/* This is a ramstage specific API */
if (!ENV_RAMSTAGE)
dead_code();
current = current_thread();
if (!thread_can_yield(current)) {