aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2021-07-15 13:26:52 -0600
committerRaul Rangel <rrangel@chromium.org>2021-07-18 15:16:48 +0000
commit5dd7602d20a647cd30db4842820fdc9f211be009 (patch)
treebb336562a8b1ce7e055ae4766358b8f9498aec73
parentdfa8229d03241f0316e931cba4139e516485bda9 (diff)
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>
-rw-r--r--src/include/thread.h32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/include/thread.h b/src/include/thread.h
index 7969f575fe..fed0bfb964 100644
--- a/src/include/thread.h
+++ b/src/include/thread.h
@@ -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;