* gdbtk.c (gdbtk_init): Change gdbtk_lib_tmp and gdbtk_file to be
[deliverable/binutils-gdb.git] / gdb / ser-ocd.c
CommitLineData
35ce4f08
GN
1/* Remote serial interface for Macraigor Systems implementation of
2 On-Chip Debugging using serial target box or serial wiggler
3
4 Copyright 1994, 1997 Free Software Foundation, Inc.
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21
22#include "defs.h"
23#include "serial.h"
24
25static int ser_ocd_open PARAMS ((serial_t scb, const char *name));
26static void ser_ocd_raw PARAMS ((serial_t scb));
27static int ser_ocd_readchar PARAMS ((serial_t scb, int timeout));
28static int ser_ocd_setbaudrate PARAMS ((serial_t scb, int rate));
29static int ser_ocd_write PARAMS ((serial_t scb, const char *str, int len));
30static void ser_ocd_close PARAMS ((serial_t scb));
31static serial_ttystate ser_ocd_get_tty_state PARAMS ((serial_t scb));
32static int ser_ocd_set_tty_state PARAMS ((serial_t scb, serial_ttystate state));
33
34static int
35ocd_open (scb, name)
36 serial_t scb;
37 const char *name;
38{
39 return 0;
40}
41
42static int
43ocd_noop (scb)
44 serial_t scb;
45{
46 return 0;
47}
48
49static void
50ocd_raw (scb)
51 serial_t scb;
52{
53 /* Always in raw mode */
54}
55
56/* We need a buffer to store responses from the Wigglers.dll */
9cf7f520
GN
57#define WIGGLER_BUFF_SIZE 512
58unsigned char from_wiggler_buffer[WIGGLER_BUFF_SIZE];
59unsigned char * wiggler_buffer_ptr; /* curr spot in buffer */
35ce4f08
GN
60
61static void
62ocd_readremote ()
63{
64}
65
66static int
67ocd_readchar (scb, timeout)
68 serial_t scb;
69 int timeout;
70{
9cf7f520 71 return (int) *wiggler_buffer_ptr++; /* return curr char and increment ptr */
35ce4f08
GN
72}
73
74struct ocd_ttystate {
75 int dummy;
76};
77
78/* ocd_{get set}_tty_state() are both dummys to fill out the function
79 vector. Someday, they may do something real... */
80
81static serial_ttystate
82ocd_get_tty_state (scb)
83 serial_t scb;
84{
85 struct ocd_ttystate *state;
86
87 state = (struct ocd_ttystate *) xmalloc (sizeof *state);
88
89 return (serial_ttystate) state;
90}
91
92static int
93ocd_set_tty_state (scb, ttystate)
94 serial_t scb;
95 serial_ttystate ttystate;
96{
97 return 0;
98}
99
100static int
101ocd_noflush_set_tty_state (scb, new_ttystate, old_ttystate)
102 serial_t scb;
103 serial_ttystate new_ttystate;
104 serial_ttystate old_ttystate;
105{
106 return 0;
107}
108
109static void
110ocd_print_tty_state (scb, ttystate)
111 serial_t scb;
112 serial_ttystate ttystate;
113{
114 /* Nothing to print. */
115 return;
116}
117
118static int
119ocd_setbaudrate (scb, rate)
120 serial_t scb;
121 int rate;
122{
123 return 0;
124}
125
126static int
127ocd_write (scb, str, len)
128 serial_t scb;
129 const char *str;
130 int len;
131{
132 char c;
133
35ce4f08
GN
134#ifdef __CYGWIN32__
135 /* send packet to Wigglers.dll and store response so we can give it to
136 remote-wiggler.c when get_packet is run */
9cf7f520
GN
137 do_command (str, from_wiggler_buffer);
138 wiggler_buffer_ptr = from_wiggler_buffer;
35ce4f08
GN
139#endif
140
141 return 0;
142}
143
144static void
145ocd_close (scb)
146 serial_t scb;
147{
35ce4f08
GN
148}
149
150static struct serial_ops ocd_ops =
151{
152 "ocd",
153 0,
154 ocd_open,
155 ocd_close,
156 ocd_readchar,
157 ocd_write,
158 ocd_noop, /* flush output */
159 ocd_noop, /* flush input */
160 ocd_noop, /* send break -- currently used only for nindy */
161 ocd_raw,
162 ocd_get_tty_state,
163 ocd_set_tty_state,
164 ocd_print_tty_state,
165 ocd_noflush_set_tty_state,
166 ocd_setbaudrate,
167};
168
169void
170_initialize_ser_ocd_bdm ()
171{
172 serial_add_interface (&ocd_ops);
173}
9cf7f520
GN
174
175
176
177
178
179
This page took 0.029369 seconds and 4 git commands to generate.