BACKPORT: coreboot: add thread cooperative multitasking
authorAaron Durbin <adurbin@chromium.org>
Mon, 6 May 2013 17:20:52 +0000 (12:20 -0500)
committerChromeBot <chrome-bot@google.com>
Wed, 15 May 2013 18:19:49 +0000 (11:19 -0700)
commitc45183496309fbff47f2c41f7faef0dbc3832bbd
treea6013d9260711da81ae6aec7840e85af0321c69d
parent645f47bdb48a0faf4ac0ebccf0ba47628b9addcf
BACKPORT: 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().

BUG=None
BRANCH=None
TEST=Built.

Change-Id: I980a6daf8ea3f0475124329253ace2695fc39aa7
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51162
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
src/Kconfig
src/arch/armv7/include/arch/cpu.h
src/arch/x86/include/arch/cpu.h
src/include/thread.h [new file with mode: 0644]
src/lib/Makefile.inc
src/lib/hardwaremain.c
src/lib/thread.c [new file with mode: 0644]