u-boot/arch/sandbox/cpu
Jerome Forissier a27844cc94 sandbox: add initjmp()
Add initjm[() to sandbox, a non-standard extension to setjmp()/
longjmp() allowing to initialize a jump buffer with a function pointer
and a stack pointer. This will be useful to later introduce threads.
With this new function it becomes possible to longjmp() to a particular
function pointer (rather than to a point previously reached during
program execution as is the case with setjmp()), and with a custom stack.
Both things are needed to spin off a new thread. Then the usual
setjmp()/longjmp() pair is enough to save and restore a context, i.e.,
switch thread. The implementation is taken verbatim from barebox [1] with
the exception of the additional stack_sz argument. It is quite complex
because contrary to U-Boot platform code we don't know how the system's
C library implements the jump buffer, so we can't just write the function
and stack pointers into it.

[1] https://github.com/barebox/barebox/blob/b2a15c383ddc/arch/sandbox/os/setjmp.c

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-04-23 13:19:44 -06:00
..
cache.c sandbox: efi_loader: Correct use of addresses as pointers 2024-12-02 16:34:30 -06:00
cpu.c common: clean up setjmp.h 2025-03-10 07:41:16 +01:00
eth-raw-os.c sandbox: missing return value checks in eth-raw-os 2024-04-12 08:53:31 -06:00
initjmp.c sandbox: add initjmp() 2025-04-23 13:19:44 -06:00
Makefile sandbox: add initjmp() 2025-04-23 13:19:44 -06:00
os.c sandbox: Return error code from read/write/seek 2024-08-09 16:03:19 -06:00
sdl.c sandbox: Audit config.h and common.h usage 2023-12-21 08:54:37 -05:00
spl.c test: Move stat-printing into its own function 2025-01-24 14:34:41 -06:00
start.c sandbox: Add a -N flag to control on-host behaviour 2024-11-09 10:00:15 +01:00
state.c sandbox: Change the range used for memory-mapping tags 2024-09-18 13:01:00 -06:00
u-boot-spl.lds test: spl: Add functions to create images 2023-10-17 20:50:52 -04:00
u-boot.lds sandbox: cleanup linker scripts and sections 2024-07-03 07:36:33 +01:00