Lots of changes from David Mosberger-Tang; see ChangeLog and NOTES for details:
[deliverable/binutils-gdb.git] / gdb / array-rom.c
1 /* Remote target code for the Array Tech LSI33k based RAID disk controller board.
2
3 Copyright 1988, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
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 2 of the License, or
10 (at your option) any later version.
11
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.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 #include "defs.h"
22 #include "gdbcore.h"
23 #include "target.h"
24 #include "monitor.h"
25 #include "serial.h"
26
27 extern int baud_rate;
28
29 void array_open();
30 void monitor_open();
31
32 /*
33 * this array of registers need to match the indexes used by GDB. The
34 * whole reason this exists is cause the various ROM monitors use
35 * different strings than GDB does, and doesn't support all the
36 * registers either. So, typing "info reg sp" becomes a "r30".
37 */
38 static char *array_regnames[] = REGISTER_NAMES;
39 extern char *tmp_mips_processor_type;
40 extern int mips_set_processor_type();
41
42 /*
43 * Define the monitor command strings. Since these are passed directly
44 * through to a printf style function, we need can include formatting
45 * strings. We also need a CR or LF on the end.
46 */
47
48 struct target_ops array_ops = {
49 "array",
50 "Debug using the standard GDB remote protocol for the Array Tech target.",
51 "Debug using the standard GDB remote protocol for the Array Tech target.\n\
52 Specify the serial device it is connected to (e.g. /dev/ttya).",
53 array_open,
54 monitor_close,
55 monitor_attach,
56 monitor_detach,
57 monitor_resume,
58 monitor_wait,
59 monitor_fetch_registers,
60 monitor_store_registers,
61 monitor_prepare_to_store,
62 monitor_xfer_inferior_memory,
63 monitor_files_info,
64 monitor_insert_breakpoint,
65 monitor_remove_breakpoint, /* Breakpoints */
66 0,
67 0,
68 0,
69 0,
70 0, /* Terminal handling */
71 monitor_kill,
72 monitor_load, /* load */
73 0, /* lookup_symbol */
74 monitor_create_inferior,
75 monitor_mourn_inferior,
76
77 0, /* can_run */
78 0, /* notice_signals */
79 0, /* to_stop */
80 process_stratum,
81 0, /* next */
82 1,
83 1,
84 1,
85 1,
86 1, /* all mem, mem, stack, regs, exec */
87 0,
88 0, /* Section pointers */
89 OPS_MAGIC, /* Always the last thing */
90 };
91
92 struct monitor_ops array_cmds = {
93 0, /* 1 for ASCII, 0 for binary */
94 "$?#b8+\n", /* monitor init string */
95 "go %x\n", /* execute or usually GO command */
96 "c\n", /* continue command */
97 "s\n", /* single step */
98 "brk 0x%x\n", /* set a breakpoint */
99 "unbrk %x\n", /* clear a breakpoint */
100 0, /* 0 for number, 1 for address */
101 {
102 "M%8x,%4x:%8x", /* set memory */
103 "", /* delimiter */
104 "", /* the result */
105 },
106 {
107 "m%8x,%4x", /* get memory */
108 "", /* delimiter */
109 "", /* the result */
110 },
111 {
112 "G%8x", /* set registers */
113 "", /* delimiter between registers */
114 "", /* the result */
115 },
116 {
117 "g", /* get registers */
118 "", /* delimiter between registers */
119 "", /* the result */
120 },
121 "sload -a tty(0)\r\n", /* download command */
122 ">> ", /* monitor command prompt */
123 "", /* end-of-command delimitor */
124 "", /* optional command terminator */
125 &array_ops, /* target operations */
126 "none,srec,default", /* load types */
127 "none", /* load protocols */
128 "4800", /* supported baud rates */
129 2, /* number of stop bits */
130 array_regnames /* registers names */
131 };
132
133 /*
134 * array_open -- open the Array Tech LSI33k based RAID disk controller.
135 */
136 void
137 array_open(args, from_tty)
138 char *args;
139 int from_tty;
140 {
141 tmp_mips_processor_type = "lsi33k"; /* change the default from r3051 */
142 mips_set_processor_type_command ("lsi33k", 0);
143
144 baud_rate = 4800; /* this is the only supported baud rate */
145
146 target_preopen(from_tty);
147 push_target (&array_ops);
148 push_monitor (&array_cmds);
149 monitor_open (args, "array", from_tty);
150 }
151
152 /*
153 * _initialize_array -- do any special init stuff for the target.
154 */
155 void
156 _initialize_array ()
157 {
158 add_target (&array_ops);
159 }
160
161
162
163
This page took 0.033749 seconds and 4 git commands to generate.