diff options
author | Sean Anderson <sean.anderson@seco.com> | 2022-03-22 16:59:18 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-01 15:03:13 -0400 |
commit | 12a05b3bcd85ff4aa930e7a1fb8795d5a6bfdf81 (patch) | |
tree | 67802bdeb3c1ff1d0957eae1693972e045f86480 /include | |
parent | 79f6ad6a7b9c30bacb135b91a268fd9767bca79d (diff) | |
download | u-boot-12a05b3bcd85ff4aa930e7a1fb8795d5a6bfdf81.zip u-boot-12a05b3bcd85ff4aa930e7a1fb8795d5a6bfdf81.tar.gz u-boot-12a05b3bcd85ff4aa930e7a1fb8795d5a6bfdf81.tar.bz2 |
arm: smh: Add some file manipulation commands
In order to add filesystem support, we will need to be able to seek and
write files. Add the appropriate helper functions.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/semihosting.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/semihosting.h b/include/semihosting.h index d8337b6..b53c650 100644 --- a/include/semihosting.h +++ b/include/semihosting.h @@ -51,6 +51,17 @@ long smh_open(const char *fname, enum smh_open_mode mode); long smh_read(long fd, void *memp, size_t len); /** + * smh_write() - Write data to a file + * @fd: A file descriptor returned from smh_open() + * @memp: Pointer to a buffer of memory of at least @len bytes + * @len: The number of bytes to read + * @written: Pointer which will be updated with the actual bytes written + * + * Return: 0 on success or negative error on failure + */ +long smh_write(long fd, const void *memp, size_t len, ulong *written); + +/** * smh_close() - Close an open file * @fd: A file descriptor returned from smh_open() * @@ -66,4 +77,13 @@ long smh_close(long fd); */ long smh_flen(long fd); +/** + * smh_seek() - Seek to a position in a file + * @fd: A file descriptor returned from smh_open() + * @pos: The offset (in bytes) to seek to + * + * Return: 0 on success or negative error on failure + */ +long smh_seek(long fd, long pos); + #endif /* _SEMIHOSTING_H */ |