From 8c892070e94ca3131e0fe120544634877b8b133b Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Thu, 22 Jul 2021 12:40:26 -0600 Subject: [PATCH] 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 Change-Id: I4784942070fd352a48c349f3b65f5a299abf2800 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56529 Reviewed-by: Arthur Heymans Reviewed-by: Furquan Shaikh Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- src/lib/thread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/thread.c b/src/lib/thread.c index 4d06021ea8..3be2e92f5c 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -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)) {