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
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56352
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Raul E Rangel 2021-07-15 13:26:52 -06:00 committed by Raul Rangel
parent dfa8229d03
commit 5dd7602d20
1 changed files with 12 additions and 20 deletions

View File

@ -23,6 +23,18 @@ struct thread_handle {
enum cb_err error;
};
/* Run func(arg) 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 @@ void threads_initialize(void);
* 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 @@ void arch_prepare_thread(struct thread *t,
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;