kernel: introduce single-threaded kernel

For very constrained systems, like bootloaders.

Only the main thread is available, so a main() function must be
provided. Kernel objects where pending is in play will not behave as
expected, since the main thread cannot pend, it being the only thread in
the system. Usage of objects should be limited to using K_NO_WAIT as the
timeout parameter, effectively polling on the object.

Change-Id: Iae0261daa98bff388dc482797cde69f94e2e95cc
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2016-12-14 15:24:12 -05:00 committed by Benjamin Walsh
commit b12a8e0914
7 changed files with 65 additions and 3 deletions

View file

@ -2963,8 +2963,13 @@ extern void k_cpu_atomic_idle(unsigned int key);
* private APIs that are utilized by one or more public APIs
*/
extern int _is_thread_essential(void);
#ifdef CONFIG_MULTITHREADING
extern void _init_static_threads(void);
#else
#define _init_static_threads() do { } while ((0))
#endif
extern int _is_thread_essential(void);
extern void _timer_expiration_handler(struct _timeout *t);
#ifdef __cplusplus