#include "defs.h"
#include "gdbcore.h"
#include "target.h"
#include "monitor.h"
#include "serial.h"
static void op50n_open (char *args, int from_tty);
static char *op50n_regnames[NUM_REGS] =
{
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
"cr11", "p", NULL, NULL, NULL, "cr15", "cr19", "cr20",
"cr21", "cr22", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, "cr0", "cr8", "cr9", "cr10", "cr12",
"cr13", "cr24", "cr25", "cr26",
};
static struct target_ops op50n_ops;
static char *op50n_inits[] =
{".\r", NULL};
static struct monitor_ops op50n_cmds;
static void
init_op50n_cmds (void)
{
op50n_cmds.flags = MO_CLR_BREAK_USES_ADDR ;
op50n_cmds.init = op50n_inits;
op50n_cmds.cont = "g\r";
op50n_cmds.step = "t\r";
op50n_cmds.stop = "\003.\r";
op50n_cmds.set_break = "b %x\r";
op50n_cmds.clr_break = "b %x;0\r";
op50n_cmds.clr_all_break = "bx\r";
op50n_cmds.fill = "fx %x s%x %x\r";
op50n_cmds.setmem.cmdb = "sx %x %x\r";
op50n_cmds.setmem.cmdw = "sh %x %x\r";
op50n_cmds.setmem.cmdl = "s %x %x\r";
op50n_cmds.setmem.cmdll = NULL;
op50n_cmds.setmem.resp_delim = NULL;
op50n_cmds.setmem.term = NULL;
op50n_cmds.setmem.term_cmd = NULL;
#if 0
{
"sx %x\r",
"sh %x\r",
"s %x\r",
NULL,
" : ",
" ",
".\r",
};
#else
op50n_cmds.getmem.cmdb = "dx %x s%x\r";
op50n_cmds.getmem.cmdw = NULL;
op50n_cmds.getmem.cmdl = NULL;
op50n_cmds.getmem.cmdll = NULL;
op50n_cmds.getmem.resp_delim = " : ";
op50n_cmds.getmem.term = NULL;
op50n_cmds.getmem.term_cmd = NULL;
#endif
op50n_cmds.setreg.cmd = "x %s %x\r";
op50n_cmds.setreg.resp_delim = NULL;
op50n_cmds.setreg.term = NULL;
op50n_cmds.setreg.term_cmd = NULL;
op50n_cmds.getreg.cmd = "x %s\r";
op50n_cmds.getreg.resp_delim = "=";
op50n_cmds.getreg.term = " ";
op50n_cmds.getreg.term_cmd = ".\r";
op50n_cmds.dump_registers = NULL;
op50n_cmds.register_pattern = NULL;
op50n_cmds.supply_register = NULL;
op50n_cmds.load_routine = NULL;
op50n_cmds.load = "r 0\r";
op50n_cmds.loadresp = NULL;
op50n_cmds.prompt = "\n#";
op50n_cmds.line_term = "\r";
op50n_cmds.cmd_end = NULL;
op50n_cmds.target = &op50n_ops;
op50n_cmds.stopbits = SERIAL_1_STOPBITS;
op50n_cmds.regnames = op50n_regnames;
op50n_cmds.magic = MONITOR_OPS_MAGIC;
};
static void
op50n_open (char *args, int from_tty)
{
monitor_open (args, &op50n_cmds, from_tty);
}
void
_initialize_op50n (void)
{
init_op50n_cmds ();
init_monitor_ops (&op50n_ops);
op50n_ops.to_shortname = "op50n";
op50n_ops.to_longname = "Oki's debug monitor for the Op50n Eval board";
op50n_ops.to_doc = "Debug on a Oki OP50N eval board.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).";
op50n_ops.to_open = op50n_open;
add_target (&op50n_ops);
}