if (memaddr >= rstack_high_address)
{
/* a bogus value */
- char val[] = {~0, ~0, ~0, ~0};
+ static char val[] = {~0, ~0, ~0, ~0};
/* It's in a local register, but off the end of the stack. */
int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
if (myaddr != NULL)
CORE_ADDR memaddr;
int len;
{
- long buf;
- read_register_stack (memaddr, &buf, NULL, NULL);
- SWAP_TARGET_AND_HOST (&buf, 4);
- return buf;
+ char buf[4];
+ read_register_stack (memaddr, buf, NULL, NULL);
+ return extract_signed_integer (buf, 4);
}
/* Copy 4 bytes from GDB memory at MYADDR into inferior memory
{
if (raw_buffer != NULL)
{
- *(CORE_ADDR *)raw_buffer = fi->frame;
- /* Put it back in target byte order. */
- SWAP_TARGET_AND_HOST (raw_buffer, sizeof (CORE_ADDR));
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), fi->frame);
}
if (lvalp != NULL)
*lvalp = not_lval;
{
if (raw_buffer != NULL)
{
- *(CORE_ADDR *)raw_buffer = fi->pc;
- /* Put it back in target byte order. */
- SWAP_TARGET_AND_HOST (raw_buffer, sizeof (CORE_ADDR));
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), fi->pc);
}
/* Not sure we have to do this. */
{
if (fi->next != NULL)
{
- *(CORE_ADDR *)raw_buffer = fi->next->saved_msp;
- /* Put it back in target byte order. */
- SWAP_TARGET_AND_HOST (raw_buffer, sizeof (CORE_ADDR));
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ fi->next->saved_msp);
}
else
read_register_gen (MSP_REGNUM, raw_buffer);
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()