summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorJerome Forissier <[email protected]>2025-04-18 16:09:29 +0200
committerTom Rini <[email protected]>2025-04-23 13:19:44 -0600
commit1c8e166fb5eb5c58b79a09e80660a7ebfc7c94fa (patch)
tree22c18eec2d0c0aa446185dd3c9b4de172127d728 /doc/api
parent278be62c052f3a5749c3c7a57bcd307b82dcdc2d (diff)
arch: introduce initjmp() and Kconfig symbol HAVE_INITJMP
Add the HAVE_INIJMP symbol to be set by architectures that support initjmp(), 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. Add the initjmp() prototype to <include/setjmp.h> since it is common to all architectures. Add an entry to the API documentation: doc/api/setjmp.rst. Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/index.rst1
-rw-r--r--doc/api/setjmp.rst10
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/api/index.rst b/doc/api/index.rst
index a108718ea99..0dc9ad45d41 100644
--- a/doc/api/index.rst
+++ b/doc/api/index.rst
@@ -25,6 +25,7 @@ U-Boot API documentation
rng
sandbox
serial
+ setjmp
sysreset
timer
unicode
diff --git a/doc/api/setjmp.rst b/doc/api/setjmp.rst
new file mode 100644
index 00000000000..7718047085c
--- /dev/null
+++ b/doc/api/setjmp.rst
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+Long jump API
+=============
+
+.. kernel-doc:: include/setjmp.h
+ :doc: Overview
+
+.. kernel-doc:: include/setjmp.h
+ :internal: