summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/Kconfig
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2020-09-14 15:37:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-15 14:24:28 +0200
commit242d9e7531fbc394214d2a54d3ff56a5690f397a (patch)
tree07ebc3ab16aa0525a29f9cbabfc29d79f88c4f7b /arch/sandbox/Kconfig
parent65ca0db25b6aca3df1ff0adf1a9469e83983614f (diff)
downloadbarebox-242d9e7531fbc394214d2a54d3ff56a5690f397a.tar.gz
barebox-242d9e7531fbc394214d2a54d3ff56a5690f397a.tar.xz
sandbox: implement actual sandbox reset via exec(2)
On Linux, /proc/self/exe is a symlink to the originally exec(2)d executable. We can exec that with the original argv to simulate a reset. This is useful for shorter development cycles on sandbox and in future, could be used to test barebox behavior around resets (e.g. reset reason can be passed through via libc environment). We leave the original hanging reset in place though, because: - Many boards have multiple reset providers and incoming patches will allow users to select a specific one. Having this on sandbox as well makes testing easier. - /proc/self/exe is Linux-specific and wouldn't work when being run on e.g. BSDs or macOS Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/Kconfig')
-rw-r--r--arch/sandbox/Kconfig7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index c4d0ab4dbc..b5213c662b 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -24,6 +24,13 @@ config SANDBOX_UNWIND
select ARCH_HAS_STACK_DUMP
depends on KASAN
+config SANDBOX_REEXEC
+ prompt "exec(2) reset handler"
+ def_bool y
+ help
+ The normal reset handler hangs barebox. On Linux, barebox
+ instead can exec itself to simulate a reset.
+
config PHYS_ADDR_T_64BIT
bool