projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Decouple inferior_ptid/inferior_thread(); dup ptids in thread list (PR 25412)
[deliverable/binutils-gdb.git]
/
sim
/
mn10300
/
dv-mn103ser.c
diff --git
a/sim/mn10300/dv-mn103ser.c
b/sim/mn10300/dv-mn103ser.c
index 7f20ed1f6b2195f09f32f3bd4ecc0666522f3693..02d0aa54c766a3547586a9b260308fffba2bdc91 100644
(file)
--- a/
sim/mn10300/dv-mn103ser.c
+++ b/
sim/mn10300/dv-mn103ser.c
@@
-1,21
+1,20
@@
/* This file is part of the program GDB, the GNU debugger.
/* This file is part of the program GDB, the GNU debugger.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998
-2020
Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Contributed by Cygnus Solutions.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2
of the License, or
+ the Free Software Foundation; either version
3
of the License, or
(at your option) any later version.
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
@@
-75,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
#define NR_SERIAL_DEVS 3
#define SIO_STAT_RRDY 0x0010
@@
-239,15
+233,17
@@
static void
do_polling_event (struct hw *me,
void *data)
{
do_polling_event (struct hw *me,
void *data)
{
+ SIM_DESC sd = hw_system (me);
struct mn103ser *serial = hw_data(me);
struct mn103ser *serial = hw_data(me);
-
int serial_reg = (int
) data;
+
long serial_reg = (long
) data;
char c;
char c;
- int count;
+ int count
, status
;
- if(USE_SOCKSER_P)
+ status = dv_sockser_status (sd);
+ if (!(status & DV_SOCKSER_DISCONNECTED))
{
int rd;
{
int rd;
- rd = dv_sockser_read (
hw_system (me)
);
+ rd = dv_sockser_read (
sd
);
if(rd != -1)
{
c = (char) rd;
if(rd != -1)
{
c = (char) rd;
@@
-376,6
+372,9
@@
read_status_reg (struct hw *me,
if ( (serial->device[serial_reg].status & SIO_STAT_RRDY) == 0 )
{
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 )
/* FIFO is empty */
/* Kill current poll event */
if ( NULL != serial->device[serial_reg].event )
@@
-384,10
+383,11
@@
read_status_reg (struct hw *me,
serial->device[serial_reg].event = NULL;
}
serial->device[serial_reg].event = NULL;
}
- if(USE_SOCKSER_P)
+ status = dv_sockser_status (sd);
+ if (!(status & DV_SOCKSER_DISCONNECTED))
{
int rd;
{
int rd;
- rd = dv_sockser_read (
hw_system (me)
);
+ rd = dv_sockser_read (
sd
);
if(rd != -1)
{
c = (char) rd;
if(rd != -1)
{
c = (char) rd;
@@
-421,7
+421,7
@@
read_status_reg (struct hw *me,
serial->device[serial_reg].event
= hw_event_queue_schedule (me, 1000,
do_polling_event,
serial->device[serial_reg].event
= hw_event_queue_schedule (me, 1000,
do_polling_event,
- (void *)serial_reg);
+ (void *)
(long)
serial_reg);
}
if ( nr_bytes == 1 )
}
if ( nr_bytes == 1 )
@@
-598,16
+598,20
@@
write_txb (struct hw *me,
{
if ( nr_bytes == 1 )
{
{
if ( nr_bytes == 1 )
{
+ SIM_DESC sd = hw_system (me);
+ int status;
+
serial->device[serial_reg].txb = *(unsigned8 *)source;
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
{
}
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);
}
hw_port_event (me, serial_reg+SERIAL0_SEND, 1);
This page took
0.025014 seconds
and
4
git commands to generate.