[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen/arm: vpl011: Add a new buffer_available function in xenconsole



commit 46982db8c65e9a6a3da68c4e37da57c603564157
Author:     Bhupinder Thakur <bhupinder.thakur@xxxxxxxxxx>
AuthorDate: Wed Sep 27 11:43:21 2017 +0530
Commit:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
CommitDate: Tue Oct 3 15:23:37 2017 -0700

    xen/arm: vpl011: Add a new buffer_available function in xenconsole
    
    This patch introduces a new buffer_available function to check if
    more data is allowed to be buffered.
    
    Signed-off-by: Bhupinder Thakur <bhupinder.thakur@xxxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/console/daemon/io.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 1da08d7..0009bbe 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -163,6 +163,16 @@ static int write_with_timestamp(int fd, const char *data, 
size_t sz,
        return 0;
 }
 
+static inline bool buffer_available(struct console *con)
+{
+       if (discard_overflowed_data ||
+           !con->buffer.max_capacity ||
+           con->buffer.size < con->buffer.max_capacity)
+               return true;
+       else
+               return false;
+}
+
 static void buffer_append(struct console *con)
 {
        struct buffer *buffer = &con->buffer;
@@ -1120,9 +1130,7 @@ void handle_io(void)
                                    con->next_period < next_timeout)
                                        next_timeout = con->next_period;
                        } else if (con->xce_handle != NULL) {
-                               if (discard_overflowed_data ||
-                                   !con->buffer.max_capacity ||
-                                   con->buffer.size < 
con->buffer.max_capacity) {
+                               if (buffer_available(con)) {
                                        int evtchn_fd = 
xenevtchn_fd(con->xce_handle);
                                        con->xce_pollfd_idx = set_fds(evtchn_fd,
                                                                    
POLLIN|POLLPRI);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.