Commit | Line | Data |
---|---|---|
50e183a2 | 1 | /* Remote target glue for the WinBond ROM monitor running on the "Cougar" |
3da4297e | 2 | W89k eval board. |
50e183a2 | 3 | |
50e183a2 RS |
4 | Copyright 1988, 1991, 1992, 1993, 1994 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
21 | ||
e8b73ba7 RS |
22 | #include "defs.h" |
23 | #include "gdbcore.h" | |
24 | #include "target.h" | |
25 | #include "monitor.h" | |
3da4297e | 26 | #include "serial.h" |
e8b73ba7 | 27 | |
3da4297e | 28 | static void w89k_open PARAMS ((char *args, int from_tty)); |
27e889bf RS |
29 | |
30 | /* | |
31 | * this array of registers need to match the indexes used by GDB. The | |
32 | * whole reason this exists is cause the various ROM monitors use | |
33 | * different strings than GDB does, and doesn't support all the | |
34 | * registers either. So, typing "info reg sp" becomes a "r30". | |
35 | */ | |
3da4297e SG |
36 | static char *w89k_regnames[NUM_REGS] = |
37 | { | |
38 | "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", | |
39 | "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", | |
40 | "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", | |
41 | "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", | |
42 | "SAR", "PC", NULL, NULL, NULL, "EIEM", "IIR", "IVA", | |
43 | "IOR", "IPSW", NULL, NULL, NULL, NULL, NULL, | |
44 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
45 | "CCR", NULL, NULL, "TR0", "TR1", | |
27e889bf | 46 | }; |
e8b73ba7 RS |
47 | |
48 | /* | |
49 | * Define the monitor command strings. Since these are passed directly | |
50 | * through to a printf style function, we need can include formatting | |
51 | * strings. We also need a CR or LF on the end. | |
52 | */ | |
53 | ||
3da4297e SG |
54 | static struct target_ops w89k_ops; |
55 | ||
56 | static char *w89k_loadtypes[] = {"none", "srec", "default", NULL}; | |
57 | static char *w89k_loadprotos[] = {"none", "xmodem", NULL}; | |
e8b73ba7 | 58 | |
3da4297e | 59 | static char *w89k_inits[] = {"\r", NULL}; |
1265e2d8 SG |
60 | |
61 | static struct monitor_ops w89k_cmds = | |
62 | { | |
3da4297e SG |
63 | MO_GETMEM_NEEDS_RANGE, /* flags */ |
64 | w89k_inits, /* Init strings */ | |
65 | "g\r", /* continue command */ | |
66 | "t\r", /* single step */ | |
67 | NULL, /* Interrupt char */ | |
68 | "bp %x\r", /* set a breakpoint */ | |
69 | "bc %x\r", /* clear a breakpoint */ | |
70 | NULL, /* clear all breakpoints */ | |
71 | NULL, /* memory fill cmd */ | |
51d6a954 | 72 | { |
3da4297e SG |
73 | "eb %x %x\r", /* setmem.cmdb (addr, value) */ |
74 | "eh %x %x\r", /* setmem.cmdw (addr, value) */ | |
75 | "ew %x %x\r", /* setmem.cmdl (addr, value) */ | |
76 | NULL, /* setmem.cmdll (addr, value) */ | |
77 | NULL, /* setreg.resp_delim */ | |
78 | NULL, /* setreg.term */ | |
79 | NULL, /* setreg.term_cmd */ | |
51d6a954 RS |
80 | }, |
81 | { | |
3da4297e SG |
82 | "db %x %x\r", /* getmem.cmdb (startaddr, endaddr) */ |
83 | "dh %x %x\r", /* getmem.cmdw (startaddr, endaddr) */ | |
84 | "dw %x %x\r", /* getmem.cmdl (startaddr, endaddr) */ | |
85 | NULL, /* getmem.cmdll (startaddr, endaddr) */ | |
86 | " ", /* getmem.resp_delim */ | |
87 | NULL, /* getmem.term */ | |
88 | NULL, /* getmem.term_cmd */ | |
51d6a954 | 89 | }, |
e6fa5bd6 | 90 | { |
3da4297e SG |
91 | "r %s %x\r", /* setreg.cmd (name, value) */ |
92 | NULL, /* setreg.resp_delim */ | |
93 | NULL, /* setreg.term */ | |
94 | NULL, /* setreg.term_cmd */ | |
27e889bf RS |
95 | }, |
96 | { | |
3da4297e SG |
97 | "r %s\r", /* getreg.cmd (name) */ |
98 | "\r", /* getreg.resp_delim */ | |
99 | NULL, /* getreg.term */ | |
100 | NULL, /* getreg.term_cmd */ | |
27e889bf | 101 | }, |
3da4297e SG |
102 | NULL, /* dump_registers */ |
103 | NULL, /* register_pattern */ | |
104 | NULL, /* supply_register */ | |
105 | "u\r", /* download command */ | |
106 | NULL, /* load response */ | |
107 | "ROM>", /* monitor command prompt */ | |
108 | NULL, /* end-of-command delimitor */ | |
109 | NULL, /* optional command terminator */ | |
110 | &w89k_ops, /* target operations */ | |
1265e2d8 SG |
111 | w89k_loadtypes, /* loadtypes */ |
112 | w89k_loadprotos, /* loadprotos */ | |
3da4297e | 113 | "9600", /* supported baud rates */ |
1265e2d8 | 114 | SERIAL_1_STOPBITS, /* number of stop bits */ |
3da4297e SG |
115 | w89k_regnames, /* register names */ |
116 | MONITOR_OPS_MAGIC /* magic */ | |
117 | }; | |
e8b73ba7 RS |
118 | |
119 | void | |
120 | w89k_open(args, from_tty) | |
121 | char *args; | |
122 | int from_tty; | |
123 | { | |
1265e2d8 | 124 | monitor_open (args, &w89k_cmds, from_tty); |
e8b73ba7 RS |
125 | } |
126 | ||
127 | void | |
128 | _initialize_w89k () | |
129 | { | |
3da4297e | 130 | init_monitor_ops (&w89k_ops); |
27e889bf | 131 | |
3da4297e SG |
132 | w89k_ops.to_shortname = "w89k"; |
133 | w89k_ops.to_longname = "WinBond's debug monitor for the W89k Eval board"; | |
134 | w89k_ops.to_doc = "Debug on a WinBond W89K eval board.\n\ | |
135 | Specify the serial device it is connected to (e.g. /dev/ttya)."; | |
136 | w89k_ops.to_open = w89k_open; | |
137 | ||
138 | add_target (&w89k_ops); | |
e8b73ba7 | 139 | } |