diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-09-16 23:45:46 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-09-16 23:45:46 +0000 |
commit | ca0622e7e0e42f223eb2ca79d634c91bf514502b (patch) | |
tree | c14890437eaca1e694a8796eb07f72df736ba9b5 /gdb/remote-udi.c | |
parent | de8c35cfdb6f8dd8eaa87ef4da72d77fae1b9049 (diff) | |
download | gdb-ca0622e7e0e42f223eb2ca79d634c91bf514502b.zip gdb-ca0622e7e0e42f223eb2ca79d634c91bf514502b.tar.gz gdb-ca0622e7e0e42f223eb2ca79d634c91bf514502b.tar.bz2 |
* remote-udi.c, remote-adapt.c, remote-mm.c: Move processor_type
to tm-a29k.h and a29k-tdep.c and make it an enum.
* a29k-tdep.c (a29k_get_processor_type): New function. Fix many
aspects of how we detected the processor type.
* remote-udi.c, remote-adapt.c, remote-mm.c (*_open): Call it
rather than figuring out the type ourselves.
Diffstat (limited to 'gdb/remote-udi.c')
-rw-r--r-- | gdb/remote-udi.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c index f74569b..e04225a 100644 --- a/gdb/remote-udi.c +++ b/gdb/remote-udi.c @@ -68,18 +68,11 @@ static int udi_read_inferior_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len)); static void download PARAMS ((char *load_arg_string, int from_tty)); char CoffFileName[100] = ""; -/* - * Processor types. - */ -#define TYPE_UNKNOWN 0 -#define TYPE_A29000 1 -#define TYPE_A29030 2 -#define TYPE_A29050 3 -static char *processor_name[] = { "Unknown", "Am29000", "Am29030", "Am29050" }; -static int processor_type=TYPE_UNKNOWN; + #define FREEZE_MODE (read_register(CPS_REGNUM) & 0x400) -#define USE_SHADOW_PC ((processor_type == TYPE_A29050) && FREEZE_MODE) +#define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE) +/* FIXME: Replace with `set remotedebug'. Also, seems not to be used. */ #define LLOG_FILE "udi.log" #if defined (LOG_FILE) FILE *log_file; @@ -273,31 +266,8 @@ udi_open (name, from_tty) } } - /* Determine the processor revision level */ - prl = (unsigned int)read_register (CFG_REGNUM) >> 24; - if ((prl&0xe0) == 0) - { - fprintf_filtered (stderr, - "Remote debugging Am29000 rev %c\n",'A'+(prl&0x1f)); - processor_type = TYPE_A29000; - } - else if ((prl&0xe0) == 0x40) /* 29030 = 0x4* */ - { - fprintf_filtered (stderr, - "Remote debugging Am2903* rev %c\n",'A'+(prl&0x1f)); - processor_type = TYPE_A29030; - } - else if ((prl&0xe0) == 0x20) /* 29050 = 0x2* */ - { - fprintf_filtered (stderr, - "Remote debugging Am29050 rev %c\n",'A'+(prl&0x1f)); - processor_type = TYPE_A29050; - } - else - { - processor_type = TYPE_UNKNOWN; - fprintf_filtered (stderr,"WARNING: processor type unknown.\n"); - } + a29k_get_processor_type (); + if (UDICreateProcess (&PId)) fprintf(stderr, "UDICreateProcess() failed\n"); @@ -307,9 +277,8 @@ udi_open (name, from_tty) error ("UDICapabilities() failed"); if (from_tty) { - printf_filtered ("Remote debugging an %s connected via UDI socket,\n\ + printf_filtered ("Connected via UDI socket,\n\ DFE-IPC version %x.%x.%x TIP-IPC version %x.%x.%x TIP version %x.%x.%x\n %s\n", - processor_name[processor_type], (DFEIPCId>>8)&0xf, (DFEIPCId>>4)&0xf, DFEIPCId&0xf, (TIPIPCId>>8)&0xf, (TIPIPCId>>4)&0xf, TIPIPCId&0xf, (TargetId>>8)&0xf, (TargetId>>4)&0xf, TargetId&0xf, |