summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/cpu/os.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-02-27 13:26:23 -0700
committerSimon Glass <sjg@chromium.org>2014-03-17 20:05:49 -0600
commitab839dc3e6c1d07bc926199f3eebace0804f2ecf (patch)
tree831168b1d78c5ba25177e8baa78fad1c285b4a2e /arch/sandbox/cpu/os.c
parentffb87905cb3883c84598b87ca05384c17d59dee1 (diff)
downloadtalos-obmc-uboot-ab839dc3e6c1d07bc926199f3eebace0804f2ecf.tar.gz
talos-obmc-uboot-ab839dc3e6c1d07bc926199f3eebace0804f2ecf.zip
sandbox: Add options to clean up temporary files
When jumping from one sandbox U-Boot to another in sandbox, the RAM buffer is preserved in the jump by using a temporary file. Add an option to tell the receiving U-Boot to remove this file when it is no longer needed. Similarly the old U-Boot image is left behind in this case. We cannot delete it immediately since gdb cannot then find its debug symbols. Delete it just before exiting. Together these changes ensure that temporary files are removed both for memory and U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu/os.c')
-rw-r--r--arch/sandbox/cpu/os.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 9de71bb2b4..57d04a45b2 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -488,7 +488,7 @@ int os_jump_to_image(const void *dest, int size)
struct sandbox_state *state = state_get_current();
char fname[30], mem_fname[30];
int fd, err;
- const char *extra_args[4];
+ const char *extra_args[5];
char **argv = state->argv;
#ifdef DEBUG
int argc, i;
@@ -513,6 +513,7 @@ int os_jump_to_image(const void *dest, int size)
extra_args[1] = fname;
extra_args[2] = "-m";
extra_args[3] = mem_fname;
+ extra_args[4] = "--rm_memory";
err = add_args(&argv, extra_args,
sizeof(extra_args) / sizeof(extra_args[0]));
if (err)
OpenPOWER on IntegriCloud