diff options
author | Aaron Durbin <adurbin@chromium.org> | 2013-05-06 12:20:52 -0500 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2013-05-14 05:18:47 +0200 |
commit | 4409a5eef6d1d669caad1bfe3fbefee87ea7734e (patch) | |
tree | a586c21f4def3f0ac3e318e2925facd85f23fff1 /src/lib/hardwaremain.c | |
parent | 8c8af592ca20e6c2dc48bea2c3ae66aa92c9dca7 (diff) |
coreboot: add thread cooperative multitasking
The cooperative multitasking support allows the boot state machine
to be ran cooperatively with other threads of work. The main thread
still continues to run the boot state machine
(src/lib/hardwaremain.c). All callbacks from the state machine are
still ran synchronously from within the main thread's context.
Without any other code added the only change to the boot sequence
when cooperative multitasking is enabled is the queueing of an idlle
thread. The idle thread is responsible for ensuring progress is made
by calling timer callbacks.
The main thread can yield to any other threads in the system. That
means that anyone that spins up a thread must ensure no shared
resources are used from 2 or more execution contexts. The support
is originally intentioned to allow for long work itesm with busy
loops to occur in parallel during a boot.
Note that the intention on when to yield a thread will be on
calls to udelay().
Change-Id: Ia4d67a38665b12ce2643474843a93babd8a40c77
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/3206
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/lib/hardwaremain.c')
-rw-r--r-- | src/lib/hardwaremain.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index 99b4a069b4..14b3fff9ba 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -39,6 +39,7 @@ #endif #include <timer.h> #include <timestamp.h> +#include <thread.h> #if BOOT_STATE_DEBUG #define BS_DEBUG_LVL BIOS_DEBUG @@ -459,6 +460,8 @@ void hardwaremain(void) post_code(POST_CONSOLE_BOOT_MSG); + threads_initialize(); + /* Schedule the static boot state entries. */ boot_state_schedule_static_entries(); |