From: Lei Xia Date: Thu, 18 Aug 2011 02:53:46 +0000 (-0500) Subject: Fix virtual serial to use stream backend access X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=b96b5ff47cb29053f8d5b9618b54d335c7a7b22e;p=palacios.releases.git Fix virtual serial to use stream backend access --- diff --git a/linux_usr/Makefile b/linux_usr/Makefile index 64b4672..3f4aedd 100644 --- a/linux_usr/Makefile +++ b/linux_usr/Makefile @@ -1,4 +1,4 @@ -all: v3_ctrl v3_stop v3_cons v3_mem v3_monitor v3_stream v3_net v3_user_host_dev_example v3_os_debug v3_user_keyed_stream_example v3_user_keyed_stream_file +all: v3_ctrl v3_stop v3_cons v3_mem v3_monitor v3_stream v3_user_host_dev_example v3_os_debug v3_user_keyed_stream_example v3_user_keyed_stream_file diff --git a/palacios/src/devices/serial.c b/palacios/src/devices/serial.c index f0d405d..52c3202 100644 --- a/palacios/src/devices/serial.c +++ b/palacios/src/devices/serial.c @@ -393,6 +393,8 @@ static int queue_data(struct v3_vm_info * vm, struct serial_port * com, com->lsr.oe = 1; //overrun error bit set } + updateIRQ(vm, com); + return 0; } @@ -411,9 +413,7 @@ static int queue_data(struct v3_vm_info * vm, struct serial_port * com, com->lsr.thre = 0; //reset thre and temt bits. com->lsr.temt = 0; } - - updateIRQ(vm, com); - + return 0; } @@ -486,9 +486,10 @@ static int write_data_port(struct guest_info * core, uint16_t port, /* JRL: Some buffering would probably be a good idea here.... */ if (com_port->ops) { - com_port->ops->write(val, 1, com_port->backend_data); + com_port->ops->output(val, 1, com_port->backend_data); } else { queue_data(core->vm_info, com_port, &(com_port->tx_buffer), *val); + updateIRQ(core->vm_info, com_port); } } @@ -896,7 +897,7 @@ static int init_serial_port(struct serial_port * com) { return 0; } -static int serial_input(struct v3_vm_info * vm, uint8_t * buf, uint64_t len, void * priv_data){ +static uint64_t serial_input(struct v3_vm_info * vm, uint8_t * buf, uint64_t len, void * priv_data){ struct serial_port * com_port = (struct serial_port *)priv_data; int i; @@ -904,6 +905,8 @@ static int serial_input(struct v3_vm_info * vm, uint8_t * buf, uint64_t len, voi queue_data(vm, com_port, &(com_port->rx_buffer), buf[i]); } + updateIRQ(vm, com_port); + return len; } @@ -937,7 +940,7 @@ static int connect_fn(struct v3_vm_info * vm, com->ops = ops; com->backend_data = private_data; - com->ops->push = serial_input; + com->ops->input = serial_input; *push_fn_arg = com; return 0;