1 |
1181 |
sfurman |
// OBSOLETE /* fr30 device support
|
2 |
|
|
// OBSOLETE Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
3 |
|
|
// OBSOLETE Contributed by Cygnus Solutions.
|
4 |
|
|
// OBSOLETE
|
5 |
|
|
// OBSOLETE This file is part of the GNU simulators.
|
6 |
|
|
// OBSOLETE
|
7 |
|
|
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
8 |
|
|
// OBSOLETE it under the terms of the GNU General Public License as published by
|
9 |
|
|
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
10 |
|
|
// OBSOLETE any later version.
|
11 |
|
|
// OBSOLETE
|
12 |
|
|
// OBSOLETE This program is distributed in the hope that it will be useful,
|
13 |
|
|
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
// OBSOLETE GNU General Public License for more details.
|
16 |
|
|
// OBSOLETE
|
17 |
|
|
// OBSOLETE You should have received a copy of the GNU General Public License along
|
18 |
|
|
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
19 |
|
|
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
20 |
|
|
// OBSOLETE
|
21 |
|
|
// OBSOLETE /* ??? All of this is just to get something going. wip! */
|
22 |
|
|
// OBSOLETE
|
23 |
|
|
// OBSOLETE #include "sim-main.h"
|
24 |
|
|
// OBSOLETE
|
25 |
|
|
// OBSOLETE #ifdef HAVE_DV_SOCKSER
|
26 |
|
|
// OBSOLETE #include "dv-sockser.h"
|
27 |
|
|
// OBSOLETE #endif
|
28 |
|
|
// OBSOLETE
|
29 |
|
|
// OBSOLETE device fr30_devices;
|
30 |
|
|
// OBSOLETE
|
31 |
|
|
// OBSOLETE int
|
32 |
|
|
// OBSOLETE device_io_read_buffer (device *me, void *source, int space,
|
33 |
|
|
// OBSOLETE address_word addr, unsigned nr_bytes,
|
34 |
|
|
// OBSOLETE SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
|
35 |
|
|
// OBSOLETE {
|
36 |
|
|
// OBSOLETE if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
|
37 |
|
|
// OBSOLETE return nr_bytes;
|
38 |
|
|
// OBSOLETE
|
39 |
|
|
// OBSOLETE #ifdef HAVE_DV_SOCKSER
|
40 |
|
|
// OBSOLETE if (addr == UART_INCHAR_ADDR)
|
41 |
|
|
// OBSOLETE {
|
42 |
|
|
// OBSOLETE int c = dv_sockser_read (sd);
|
43 |
|
|
// OBSOLETE if (c == -1)
|
44 |
|
|
// OBSOLETE return 0;
|
45 |
|
|
// OBSOLETE *(char *) source = c;
|
46 |
|
|
// OBSOLETE return 1;
|
47 |
|
|
// OBSOLETE }
|
48 |
|
|
// OBSOLETE if (addr == UART_STATUS_ADDR)
|
49 |
|
|
// OBSOLETE {
|
50 |
|
|
// OBSOLETE int status = dv_sockser_status (sd);
|
51 |
|
|
// OBSOLETE unsigned char *p = source;
|
52 |
|
|
// OBSOLETE p[0] = 0;
|
53 |
|
|
// OBSOLETE p[1] = (((status & DV_SOCKSER_INPUT_EMPTY)
|
54 |
|
|
// OBSOLETE #ifdef UART_INPUT_READY0
|
55 |
|
|
// OBSOLETE ? UART_INPUT_READY : 0)
|
56 |
|
|
// OBSOLETE #else
|
57 |
|
|
// OBSOLETE ? 0 : UART_INPUT_READY)
|
58 |
|
|
// OBSOLETE #endif
|
59 |
|
|
// OBSOLETE + ((status & DV_SOCKSER_OUTPUT_EMPTY) ? UART_OUTPUT_READY : 0));
|
60 |
|
|
// OBSOLETE return 2;
|
61 |
|
|
// OBSOLETE }
|
62 |
|
|
// OBSOLETE #endif
|
63 |
|
|
// OBSOLETE
|
64 |
|
|
// OBSOLETE return nr_bytes;
|
65 |
|
|
// OBSOLETE }
|
66 |
|
|
// OBSOLETE
|
67 |
|
|
// OBSOLETE int
|
68 |
|
|
// OBSOLETE device_io_write_buffer (device *me, const void *source, int space,
|
69 |
|
|
// OBSOLETE address_word addr, unsigned nr_bytes,
|
70 |
|
|
// OBSOLETE SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
|
71 |
|
|
// OBSOLETE {
|
72 |
|
|
// OBSOLETE #if WITH_SCACHE
|
73 |
|
|
// OBSOLETE if (addr == MCCR_ADDR)
|
74 |
|
|
// OBSOLETE {
|
75 |
|
|
// OBSOLETE if ((*(const char *) source & MCCR_CP) != 0)
|
76 |
|
|
// OBSOLETE scache_flush (sd);
|
77 |
|
|
// OBSOLETE return nr_bytes;
|
78 |
|
|
// OBSOLETE }
|
79 |
|
|
// OBSOLETE #endif
|
80 |
|
|
// OBSOLETE
|
81 |
|
|
// OBSOLETE if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
|
82 |
|
|
// OBSOLETE return nr_bytes;
|
83 |
|
|
// OBSOLETE
|
84 |
|
|
// OBSOLETE #if HAVE_DV_SOCKSER
|
85 |
|
|
// OBSOLETE if (addr == UART_OUTCHAR_ADDR)
|
86 |
|
|
// OBSOLETE {
|
87 |
|
|
// OBSOLETE int rc = dv_sockser_write (sd, *(char *) source);
|
88 |
|
|
// OBSOLETE return rc == 1;
|
89 |
|
|
// OBSOLETE }
|
90 |
|
|
// OBSOLETE #endif
|
91 |
|
|
// OBSOLETE
|
92 |
|
|
// OBSOLETE return nr_bytes;
|
93 |
|
|
// OBSOLETE }
|
94 |
|
|
// OBSOLETE
|
95 |
|
|
// OBSOLETE void
|
96 |
|
|
// OBSOLETE device_error (device *me, char *message, ...)
|
97 |
|
|
// OBSOLETE {
|
98 |
|
|
// OBSOLETE }
|