1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-08-31 16:22:36 +02:00

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>
This commit is contained in:
Simon Glass
2013-11-10 10:27:03 -07:00
parent c5a62d4a7b
commit 5c2859cdc3
8 changed files with 118 additions and 6 deletions

View File

@@ -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