summaryrefslogtreecommitdiff
path: root/include/semihosting.h
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2022-03-22 16:59:23 -0400
committerTom Rini <trini@konsulko.com>2022-04-01 15:03:13 -0400
commit3ea744e87359f95251ae7ec3c7a92f8b3293593b (patch)
treecc8bd663a055e8bcd83b391f56e8de70dbe3503f /include/semihosting.h
parentdcc4f9623e27b92a1e0b97326631b0d5841c49cb (diff)
arm: smh: Add some functions for working with the host console
This adds three wrappers around the semihosting commands for reading and writing to the host console. We use the more standard getc/putc/puts names instead of readc/writec/write0 for familiarity. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Diffstat (limited to 'include/semihosting.h')
-rw-r--r--include/semihosting.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/semihosting.h b/include/semihosting.h
index b53c650444..6f3c29786c 100644
--- a/include/semihosting.h
+++ b/include/semihosting.h
@@ -86,4 +86,23 @@ long smh_flen(long fd);
*/
long smh_seek(long fd, long pos);
+/**
+ * smh_getc() - Read a character from stdin
+ *
+ * Return: The character read, or a negative error on failure
+ */
+int smh_getc(void);
+
+/**
+ * smh_putc() - Print a character on stdout
+ * @ch: The character to print
+ */
+void smh_putc(char ch);
+
+/**
+ * smh_write0() - Print a nul-terminated string on stdout
+ * @s: The string to print
+ */
+void smh_puts(const char *s);
+
#endif /* _SEMIHOSTING_H */