};
-/* Access dv-sockser state */
-extern char* sockser_addr;
-#define USE_SOCKSER_P (sockser_addr != NULL)
-
-
#define NR_SERIAL_DEVS 3
#define SIO_STAT_RRDY 0x0010
do_polling_event (struct hw *me,
void *data)
{
+ SIM_DESC sd = hw_system (me);
struct mn103ser *serial = hw_data(me);
long serial_reg = (long) data;
char c;
- int count;
+ int count, status;
- if(USE_SOCKSER_P)
+ status = dv_sockser_status (sd);
+ if (!(status & DV_SOCKSER_DISCONNECTED))
{
int rd;
- rd = dv_sockser_read (hw_system (me));
+ rd = dv_sockser_read (sd);
if(rd != -1)
{
c = (char) rd;
if ( (serial->device[serial_reg].status & SIO_STAT_RRDY) == 0 )
{
+ SIM_DESC sd = hw_system (me);
+ int status;
+
/* FIFO is empty */
/* Kill current poll event */
if ( NULL != serial->device[serial_reg].event )
serial->device[serial_reg].event = NULL;
}
- if(USE_SOCKSER_P)
+ status = dv_sockser_status (sd);
+ if (!(status & DV_SOCKSER_DISCONNECTED))
{
int rd;
- rd = dv_sockser_read (hw_system (me));
+ rd = dv_sockser_read (sd);
if(rd != -1)
{
c = (char) rd;
{
if ( nr_bytes == 1 )
{
+ SIM_DESC sd = hw_system (me);
+ int status;
+
serial->device[serial_reg].txb = *(unsigned8 *)source;
- if(USE_SOCKSER_P)
+ status = dv_sockser_status (sd);
+ if (!(status & DV_SOCKSER_DISCONNECTED))
{
- dv_sockser_write(hw_system (me), * (char*) source);
+ dv_sockser_write(sd, * (char*) source);
}
else
{
- sim_io_write_stdout(hw_system (me), (char *)source, 1);
- sim_io_flush_stdout(hw_system (me));
+ sim_io_write_stdout(sd, (char *)source, 1);
+ sim_io_flush_stdout(sd);
}
hw_port_event (me, serial_reg+SERIAL0_SEND, 1);