diff options
Diffstat (limited to 'arch/sandbox/cpu')
-rw-r--r-- | arch/sandbox/cpu/start.c | 9 | ||||
-rw-r--r-- | arch/sandbox/cpu/state.c | 18 |
2 files changed, 27 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 777db4e952..a74f5ec7ba 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -400,6 +400,15 @@ static int sandbox_cmdline_cb_signals(struct sandbox_state *state, SANDBOX_CMDLINE_OPT_SHORT(signals, 'S', 0, "Handle signals (such as SIGSEGV) in sandbox"); +static int sandbox_cmdline_cb_autoboot_keyed(struct sandbox_state *state, + const char *arg) +{ + state->autoboot_keyed = true; + + return 0; +} +SANDBOX_CMDLINE_OPT(autoboot_keyed, 0, "Allow keyed autoboot"); + static void setup_ram_buf(struct sandbox_state *state) { /* Zero the RAM buffer if we didn't read it, to keep valgrind happy */ diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index a4d99bade4..4e822538ba 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <autoboot.h> #include <bloblist.h> #include <errno.h> #include <fdtdec.h> @@ -378,6 +379,23 @@ void state_reset_for_test(struct sandbox_state *state) state->next_tag = state->ram_size; } +bool autoboot_keyed(void) +{ + struct sandbox_state *state = state_get_current(); + + return IS_ENABLED(CONFIG_AUTOBOOT_KEYED) && state->autoboot_keyed; +} + +bool autoboot_set_keyed(bool autoboot_keyed) +{ + struct sandbox_state *state = state_get_current(); + bool old_val = state->autoboot_keyed; + + state->autoboot_keyed = autoboot_keyed; + + return old_val; +} + int state_init(void) { state = &main_state; |