Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56352 )
Change subject: lib/thread: Move thread_run and thread_run_until outside of #if guard ......................................................................
lib/thread: Move thread_run and thread_run_until outside of #if guard
This will cause a linker error if these methods are used outside ramstage.
BUG=b:179699789 TEST=compile guybrush w/ and w/o COOP_MULTITASKING
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: If9983fca939c8a15fa570481bfe016a388458830 --- M src/include/thread.h 1 file changed, 12 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/56352/1
diff --git a/src/include/thread.h b/src/include/thread.h index aa1531d..5333da6 100644 --- a/src/include/thread.h +++ b/src/include/thread.h @@ -23,6 +23,18 @@ enum cb_err error; };
+/* Run func(arrg) on a new thread. Return 0 on successful start of thread, < 0 + * when thread could not be started. The thread handle if populated, will + * reflect the state and return code of the thread. + */ +int thread_run(struct thread_handle *handle, enum cb_err (*func)(void *), void *arg); + +/* thread_run_until is the same as thread_run() except that it blocks state + * transitions from occurring in the (state, seq) pair of the boot state + * machine. */ +int thread_run_until(struct thread_handle *handle, enum cb_err (*func)(void *), void *arg, + boot_state_t state, boot_state_sequence_t seq); + /* Waits until the thread has terminated and returns the error code */ enum cb_err thread_join(struct thread_handle *handle);
@@ -45,16 +57,6 @@ * aligned to CONFIG_STACK_SIZE, or NULL. */ void *arch_get_thread_stackbase(void); -/* Run func(arrg) on a new thread. Return 0 on successful start of thread, < 0 - * when thread could not be started. The thread handle if populated, will - * reflect the state and return code of the thread. - */ -int thread_run(struct thread_handle *handle, enum cb_err (*func)(void *), void *arg); -/* thread_run_until is the same as thread_run() except that it blocks state - * transitions from occurring in the (state, seq) pair of the boot state - * machine. */ -int thread_run_until(struct thread_handle *handle, enum cb_err (*func)(void *), void *arg, - boot_state_t state, boot_state_sequence_t seq);
/* Return 0 on successful yield, < 0 when thread did not yield. */ int thread_yield(void); @@ -92,16 +94,6 @@ asmlinkage void (*thread_entry)(void *), void *arg); #else static inline void threads_initialize(void) {} -static inline int thread_run(struct thread_handle *handle, enum cb_err (*func)(void *), - void *arg) -{ - return -1; -} -static inline int thread_run_until(struct thread_handle *handle, enum cb_err (*func)(void *), - void *arg, boot_state_t state, boot_state_sequence_t seq) -{ - return -1; -} static inline int thread_yield(void) { return -1;