summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTaylor Hutt <thutt@chromium.org>2013-02-24 17:33:13 +0000
committerSimon Glass <sjg@chromium.org>2013-02-28 19:09:21 -0800
commite101550a9a8b956434cf2a73f66afbb42f4654bd (patch)
tree9b3779554981488f9fead9eab91eadfbdc0a1d2d /include
parentbda32ffcf712806c7880ded25a012fbeede35e80 (diff)
downloadu-boot-imx-e101550a9a8b956434cf2a73f66afbb42f4654bd.zip
u-boot-imx-e101550a9a8b956434cf2a73f66afbb42f4654bd.tar.gz
u-boot-imx-e101550a9a8b956434cf2a73f66afbb42f4654bd.tar.bz2
sandbox: Improve sandbox serial port keyboard interface
Implements the tstc() interface for the serial driver. Multiplexing the console between the serial port and a keyboard uses a polling method of checking if characters are available; this means that the serial console must be non-blocking when attempting to read characters. Signed-off-by: Taylor Hutt <thutt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/os.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h
index 699682a..c452d1b 100644
--- a/include/os.h
+++ b/include/os.h
@@ -40,6 +40,16 @@ struct sandbox_state;
ssize_t os_read(int fd, void *buf, size_t count);
/**
+ * Access to the OS read() system call with non-blocking access
+ *
+ * \param fd File descriptor as returned by os_open()
+ * \param buf Buffer to place data
+ * \param count Number of bytes to read
+ * \return number of bytes read, or -1 on error
+ */
+ssize_t os_read_no_block(int fd, void *buf, size_t count);
+
+/**
* Access to the OS write() system call
*
* \param fd File descriptor as returned by os_open()