aboutsummaryrefslogtreecommitdiff
path: root/include/os.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-10-27 20:29:25 +0100
committerSimon Glass <sjg@chromium.org>2020-11-05 09:11:30 -0700
commit329dccc0675b97d8a1ab9debfb610165262f35c6 (patch)
tree6f7b32ab18a4807d7967853ff137aa009cb59f73 /include/os.h
parentc0b19f25a1a2ba935333899e5dcbe4429851cb18 (diff)
downloadu-boot-329dccc0675b97d8a1ab9debfb610165262f35c6.zip
u-boot-329dccc0675b97d8a1ab9debfb610165262f35c6.tar.gz
u-boot-329dccc0675b97d8a1ab9debfb610165262f35c6.tar.bz2
sandbox: implement reset
Up to now the sandbox would shutdown upon a cold reset request. Instead it should be reset. In our coding we use static variables like LIST_HEAD(efi_obj_list). A reset can occur at any time, e.g. via an UEFI binary calling the reset service. The only safe way to return to an initial state is to relaunch the U-Boot binary. The reset implementation uses execv() to relaunch U-Boot. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/os.h')
-rw-r--r--include/os.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h
index 1874ae6..88dfb71 100644
--- a/include/os.h
+++ b/include/os.h
@@ -355,4 +355,19 @@ int os_read_file(const char *name, void **bufp, int *sizep);
*/
void *os_find_text_base(void);
+/**
+ * os_relaunch() - restart the sandbox
+ *
+ * This functions is used to implement the cold reboot of the sand box.
+ * @argv[0] specifies the binary that is started while the calling process
+ * stops immediately. If the new binary cannot be started, the process is
+ * terminated and 1 is set as shell return code.
+ *
+ * The PID of the process stays the same. All file descriptors that have not
+ * been opened with O_CLOEXEC stay open including stdin, stdout, stderr.
+ *
+ * @argv: NULL terminated list of command line parameters
+ */
+void os_relaunch(char *argv[]);
+
#endif