aboutsummaryrefslogtreecommitdiff
path: root/gdb/a29k-tdep.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-09-16 23:45:46 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-09-16 23:45:46 +0000
commitca0622e7e0e42f223eb2ca79d634c91bf514502b (patch)
treec14890437eaca1e694a8796eb07f72df736ba9b5 /gdb/a29k-tdep.c
parentde8c35cfdb6f8dd8eaa87ef4da72d77fae1b9049 (diff)
downloadgdb-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/a29k-tdep.c')
-rw-r--r--gdb/a29k-tdep.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/gdb/a29k-tdep.c b/gdb/a29k-tdep.c
index 4b5fa93..f5843b4 100644
--- a/gdb/a29k-tdep.c
+++ b/gdb/a29k-tdep.c
@@ -817,6 +817,50 @@ push_dummy_frame ()
write_register (lrnum, read_register (NPC_REGNUM));
}
+enum a29k_processor_types processor_type = a29k_unknown;
+
+void
+a29k_get_processor_type ()
+{
+ unsigned int cfg_reg = (unsigned int) read_register (CFG_REGNUM);
+
+ /* Most of these don't have freeze mode. */
+ processor_type = a29k_no_freeze_mode;
+
+ switch ((cfg_reg >> 28) & 0xf)
+ {
+ case 0:
+ fprintf_filtered (stderr, "Remote debugging an Am29000");
+ break;
+ case 1:
+ fprintf_filtered (stderr, "Remote debugging an Am29005");
+ break;
+ case 2:
+ fprintf_filtered (stderr, "Remote debugging an Am29050");
+ processor_type = a29k_freeze_mode;
+ break;
+ case 3:
+ fprintf_filtered (stderr, "Remote debugging an Am29035");
+ break;
+ case 4:
+ fprintf_filtered (stderr, "Remote debugging an Am29030");
+ break;
+ case 5:
+ fprintf_filtered (stderr, "Remote debugging an Am2920*");
+ break;
+ case 6:
+ fprintf_filtered (stderr, "Remote debugging an Am2924*");
+ break;
+ case 7:
+ fprintf_filtered (stderr, "Remote debugging an Am29040");
+ break;
+ default:
+ fprintf_filtered (stderr, "Remote debugging an unknown Am29k\n");
+ /* Don't bother to print the revision. */
+ return;
+ }
+ fprintf_filtered (stderr, " revision %c\n", 'A' + ((cfg_reg >> 24) & 0x0f));
+}
void
_initialize_29k()