aboutsummaryrefslogtreecommitdiff
path: root/include/semihosting.h
diff options
context:
space:
mode:
authorSean Anderson2022-03-22 16:59:17 -0400
committerTom Rini2022-04-01 15:03:13 -0400
commit79f6ad6a7b9c30bacb135b91a268fd9767bca79d (patch)
tree4cf33c5f5f0aa175f3522d84b51bc3d1e6c7af48 /include/semihosting.h
parent80e62ccfa630b8a5dda479c8d9dc5f8872acb370 (diff)
arm: smh: Document functions in header
This adds some documentation for semihosting functions in the header. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Diffstat (limited to 'include/semihosting.h')
-rw-r--r--include/semihosting.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/semihosting.h b/include/semihosting.h
index cf54819192b..d8337b6269b 100644
--- a/include/semihosting.h
+++ b/include/semihosting.h
@@ -29,9 +29,41 @@ enum smh_open_mode {
MODE_APPEND = 0x8,
};
+/**
+ * smh_open() - Open a file on the host
+ * @fname: The name of the file to open
+ * @mode: The mode to use when opening the file
+ *
+ * Return: Either a file descriptor or a negative error on failure
+ */
long smh_open(const char *fname, enum smh_open_mode mode);
+
+/**
+ * smh_read() - Read data from 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
+ *
+ * Return:
+ * * The number of bytes read on success, with 0 indicating %EOF
+ * * A negative error on failure
+ */
long smh_read(long fd, void *memp, size_t len);
+
+/**
+ * smh_close() - Close an open file
+ * @fd: A file descriptor returned from smh_open()
+ *
+ * Return: 0 on success or negative error on failure
+ */
long smh_close(long fd);
+
+/**
+ * smh_flen() - Get the length of a file
+ * @fd: A file descriptor returned from smh_open()
+ *
+ * Return: The length of the file, in bytes, or a negative error on failure
+ */
long smh_flen(long fd);
#endif /* _SEMIHOSTING_H */