diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-04-19 19:03:28 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-04-19 19:03:28 +0000 |
commit | 952ad68fec3a85501955832c5d12cb9c310e63b2 (patch) | |
tree | 56d417e32e6e5080b15d62494270b081e5ff92af /sim/mn10300 | |
parent | bd0bd5081ff6b78ec710a6395a1a1292765ca8e5 (diff) | |
download | gdb-952ad68fec3a85501955832c5d12cb9c310e63b2.zip gdb-952ad68fec3a85501955832c5d12cb9c310e63b2.tar.gz gdb-952ad68fec3a85501955832c5d12cb9c310e63b2.tar.bz2 |
sim: mn10300: convert to new sockser status code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/mn10300')
-rw-r--r-- | sim/mn10300/ChangeLog | 7 | ||||
-rw-r--r-- | sim/mn10300/dv-mn103ser.c | 33 |
2 files changed, 26 insertions, 14 deletions
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index 73e3af7..0717a71 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,10 @@ +2010-04-19 Mike Frysinger <vapier@gentoo.org> + + * dv-mn103ser.c (sockser_addr, USE_SOCKSER_P): Delete + (do_polling_event): Change USE_SOCKSER_P to dv_sockser_status. + (read_status_reg): Likewise. + (write_txb): Likewise. + 2010-01-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * configure: Regenerate. diff --git a/sim/mn10300/dv-mn103ser.c b/sim/mn10300/dv-mn103ser.c index 6ec8d27..b3e844d 100644 --- a/sim/mn10300/dv-mn103ser.c +++ b/sim/mn10300/dv-mn103ser.c @@ -74,11 +74,6 @@ enum serial_register_types { }; -/* 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 @@ -238,15 +233,17 @@ static void 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; @@ -375,6 +372,9 @@ read_status_reg (struct hw *me, 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 ) @@ -383,10 +383,11 @@ read_status_reg (struct hw *me, 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; @@ -597,16 +598,20 @@ write_txb (struct hw *me, { 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); |