2 Copyright (C) 1997-2015 Free Software Foundation, Inc.
3 Contributed by Cygnus Solutions.
5 This file is part of GDB, the GNU debugger.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 #ifdef HAVE_DV_SOCKSER
23 #include "dv-sockser.h"
26 /* Handling the MSPR register is done by creating a device in the core
27 mapping that winds up here. */
32 device_io_read_buffer (device *me, void *source, int space,
33 address_word addr, unsigned nr_bytes,
34 SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
36 if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
39 #ifdef HAVE_DV_SOCKSER
40 if (addr == UART_INCHAR_ADDR)
42 int c = dv_sockser_read (sd);
48 if (addr == UART_STATUS_ADDR)
50 int status = dv_sockser_status (sd);
51 unsigned char *p = source;
53 p[1] = (((status & DV_SOCKSER_INPUT_EMPTY)
54 #ifdef UART_INPUT_READY0
55 ? UART_INPUT_READY : 0)
57 ? 0 : UART_INPUT_READY)
59 + ((status & DV_SOCKSER_OUTPUT_EMPTY) ? UART_OUTPUT_READY : 0));
68 device_io_write_buffer (device *me, const void *source, int space,
69 address_word addr, unsigned nr_bytes,
70 SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
73 /* MSPR support is deprecated but is kept in for upward compatibility
74 with existing overlay support. */
75 if (addr == MSPR_ADDR)
77 if ((*(const char *) source & MSPR_PURGE) != 0)
81 if (addr == MCCR_ADDR)
83 if ((*(const char *) source & MCCR_CP) != 0)
89 if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
92 #ifdef HAVE_DV_SOCKSER
93 if (addr == UART_OUTCHAR_ADDR)
95 int rc = dv_sockser_write (sd, *(char *) source);
104 device_error (device *me, const char *message, ...)