aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox/include/asm/u-boot-sandbox.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 /arch/sandbox/include/asm/u-boot-sandbox.h
parentc0b19f25a1a2ba935333899e5dcbe4429851cb18 (diff)
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 'arch/sandbox/include/asm/u-boot-sandbox.h')
-rw-r--r--arch/sandbox/include/asm/u-boot-sandbox.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h b/arch/sandbox/include/asm/u-boot-sandbox.h
index 798d003077..73b1897191 100644
--- a/arch/sandbox/include/asm/u-boot-sandbox.h
+++ b/arch/sandbox/include/asm/u-boot-sandbox.h
@@ -84,6 +84,16 @@ void sandbox_set_enable_pci_map(int enable);
*/
int sandbox_read_fdt_from_file(void);
+/**
+ * sandbox_reset() - reset sandbox
+ *
+ * This functions implements the cold reboot of the sandbox. It relaunches the
+ * U-Boot binary with the same command line parameters as the original call.
+ * 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.
+ */
+void sandbox_reset(void);
+
/* Exit sandbox (quit U-Boot) */
void sandbox_exit(void);