ia64/xen-unstable

changeset 7227:438f1b53682b

Send event-channel notification from console daemon
to guest console driver when the output ring is
emptied. This can be used to kick transmission of
more characters without needing to poll.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Oct 05 16:32:07 2005 +0100 (2005-10-05)
parents 072fb38810a6
children 89b1b67fc2c4
files tools/console/daemon/io.c
line diff
     1.1 --- a/tools/console/daemon/io.c	Wed Oct 05 15:15:50 2005 +0100
     1.2 +++ b/tools/console/daemon/io.c	Wed Oct 05 16:32:07 2005 +0100
     1.3 @@ -86,8 +86,11 @@ static void buffer_append(struct domain 
     1.4  	struct ring_head *ring = (struct ring_head *)dom->page;
     1.5  	size_t size;
     1.6  	u32 oldcons;
     1.7 +	int notify = 0;
     1.8  
     1.9  	while ((size = ring->prod - ring->cons) != 0) {
    1.10 +		notify = 1;
    1.11 +
    1.12  		if ((buffer->capacity - buffer->size) < size) {
    1.13  			buffer->capacity += (size + 1024);
    1.14  			buffer->data = realloc(buffer->data, buffer->capacity);
    1.15 @@ -115,6 +118,9 @@ static void buffer_append(struct domain 
    1.16  			buffer->capacity = buffer->max_capacity;
    1.17  		}
    1.18  	}
    1.19 +
    1.20 +	if (notify)
    1.21 +		xc_evtchn_send(xc, dom->local_port);
    1.22  }
    1.23  
    1.24  static bool buffer_empty(struct buffer *buffer)