X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fserial.c;h=d6bdc2d7309fb3da9422ea05392a017f87fa5cf7;hb=64cc3bfb45f88a1880331093e87035a38c8f2bdb;hp=0efb5cc4706bb7df030bd67044dce07ebc832b5e;hpb=4002d7a3ba2e3d25122dc9c43928b15d49ede6de;p=palacios.git diff --git a/palacios/src/devices/serial.c b/palacios/src/devices/serial.c index 0efb5cc..d6bdc2d 100644 --- a/palacios/src/devices/serial.c +++ b/palacios/src/devices/serial.c @@ -31,7 +31,7 @@ #include -#ifndef CONFIG_DEBUG_SERIAL +#ifndef V3_CONFIG_DEBUG_SERIAL #undef PrintDebug #define PrintDebug(fmt, args...) #endif @@ -258,7 +258,7 @@ struct dll_register { struct dlm_register { uint8_t data; }; -#define SERIAL_BUF_LEN 16 +#define SERIAL_BUF_LEN 128 struct serial_buffer { int head; // most recent data @@ -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;