summaryrefslogtreecommitdiff
path: root/include/os.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-11-10 17:27:03 (GMT)
committerSimon Glass <sjg@chromium.org>2014-01-09 00:25:03 (GMT)
commit5c2859cdc30287b3593d9df88f48c31eecb0bbed (patch)
tree3d6552f961488657bf74869027e7ad4daf66dd73 /include/os.h
parentc5a62d4a7b4a971a1fb17d595f7c1e98a936a974 (diff)
downloadu-boot-fsl-qoriq-5c2859cdc30287b3593d9df88f48c31eecb0bbed.tar.xz
sandbox: Allow reading/writing of RAM buffer
It is useful to be able to save and restore the RAM contents of sandbox U-Boot either for setting up tests, for later analysys, or for chaining together multiple tests which need to keep the same memory contents. Add a function to provide a memory file for U-Boot. This is read on start-up and written when shutting down. If the file does not exist on start-up, it will be created when shutting down. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/os.h')
-rw-r--r--include/os.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h
index d302b36..b65fba4 100644
--- a/include/os.h
+++ b/include/os.h
@@ -229,4 +229,20 @@ void os_putc(int ch);
*/
void os_puts(const char *str);
+/**
+ * Write the sandbox RAM buffer to a existing file
+ *
+ * @param fname Filename to write memory to (simple binary format)
+ * @return 0 if OK, -ve on error
+ */
+int os_write_ram_buf(const char *fname);
+
+/**
+ * Read the sandbox RAM buffer from an existing file
+ *
+ * @param fname Filename containing memory (simple binary format)
+ * @return 0 if OK, -ve on error
+ */
+int os_read_ram_buf(const char *fname);
+
#endif