pbl_thread_create() takes a struct pbl_thread_attr: entry, priority,
privileged flag, a caller-owned stack and up to two struct pbl_mpu_regions that are
switched in with the thread, on top of the stack guards the kernel adds. With CONFIG_USERSPACE it also takes the
memory the thread’s syscalls may use and the stack they run on
(Syscalls).
debug.h covers what core dumps, fault handling, stack checks and telemetry
need: a thread walk, where a blocked thread is (its saved PC and return address,
and whether it ran unprivileged), stack bounds and high-water marks, and a
run-time stats snapshot. The registers of each thread in a core dump come from
the architecture’s core dump support, in the layout of the dump format.
Kernel: Threads creates threads above and below main()’s
priority, and Kernel: Message queues passes messages between two.
Generated from PebbleOS 7416f78a1. This page is maintained in the pebbleos repository: docs/kernel/threads.md.