diff options
author | Andrew Cagney <cagney@redhat.com> | 1998-02-10 07:05:32 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1998-02-10 07:05:32 +0000 |
commit | f6826586c511a9033935dc15e2b5ae17819c1e86 (patch) | |
tree | b3f9fe61820e24909e52120d14824755870aef96 /gdb | |
parent | 55872088526cbfd42abd76bf72b119c37db9e585 (diff) | |
download | gdb-f6826586c511a9033935dc15e2b5ae17819c1e86.zip gdb-f6826586c511a9033935dc15e2b5ae17819c1e86.tar.gz gdb-f6826586c511a9033935dc15e2b5ae17819c1e86.tar.bz2 |
D10V memory map changed. Update.
Replace all references to [ID]MEM_ADDR with conversion macros.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/config/d10v/tm-d10v.h | 12 | ||||
-rw-r--r-- | gdb/d10v-tdep.c | 49 |
3 files changed, 37 insertions, 36 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5751f1f..bc889d9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +Mon Feb 9 11:10:06 1998 Andrew Cagney <cagney@b1.cygnus.com> + + * d10v-tdep.c: Replace references to IMEM_ADDR and DMEM_ADDR with + D10V_MAKE_[DI]ADDR and D10V_CONVERT_[ID]ADDR_TO_RAW macros. + + * config/d10v/tm-d10v.h (IMEM_START): Move to 0x01...... + (DMEM_START): Move to 0x00...... + (STACK_START): Move to 0x00..7ffe. + (D10V_MAKE_IADDR, D10V_MAKE_DADDR): Translate unconditionally. + + * d10v-tdep.c (d10v_xlate_addr): Delete function. + Mon Feb 9 15:10:21 1998 Fred Fish <fnf@cygnus.com> * symtab.c (fixup_psymbol_section): Move forward declaration to diff --git a/gdb/config/d10v/tm-d10v.h b/gdb/config/d10v/tm-d10v.h index 36eb1d4..67136c9 100644 --- a/gdb/config/d10v/tm-d10v.h +++ b/gdb/config/d10v/tm-d10v.h @@ -33,9 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* these are the addresses the D10V-EVA board maps data */ /* and instruction memory to. */ -#define DMEM_START 0x2000000 +#define DMEM_START 0x0000000 #define IMEM_START 0x1000000 -#define STACK_START 0x2007ffe +#define STACK_START 0x0007ffe #ifdef __STDC__ /* Forward decls for prototypes */ struct frame_info; @@ -140,14 +140,14 @@ extern CORE_ADDR d10v_skip_prologue (); store_unsigned_integer ((TO), 2, x); \ } -#define D10V_MAKE_DADDR(x) ( (x) & 0x3000000 ? (x) : ((x) | DMEM_START)) -#define D10V_MAKE_IADDR(x) ( (x) & 0x3000000 ? (x) : (((x) << 2) | IMEM_START)) +#define D10V_MAKE_DADDR(x) ((x) | DMEM_START) +#define D10V_MAKE_IADDR(x) (((x) << 2) | IMEM_START) #define D10V_DADDR_P(X) (((X) & 0x3000000) == DMEM_START) #define D10V_IADDR_P(X) (((X) & 0x3000000) == IMEM_START) -#define D10V_CONVERT_IADDR_TO_RAW(X) (((X) & ~0x3000000) >> 2) -#define D10V_CONVERT_DADDR_TO_RAW(X) (((X) & ~0x3000000)) +#define D10V_CONVERT_IADDR_TO_RAW(X) (((X) >> 2) & 0xffff) +#define D10V_CONVERT_DADDR_TO_RAW(X) ((X) & 0xffff) #define ARG1_REGNUM R0_REGNUM #define ARGN_REGNUM 3 diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 8579e7b..95b1ef5 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -206,7 +206,7 @@ d10v_frame_chain (frame) if (!read_memory_unsigned_integer(fsr.regs[FP_REGNUM], REGISTER_RAW_SIZE(FP_REGNUM))) return (CORE_ADDR)0; - return read_memory_unsigned_integer(fsr.regs[FP_REGNUM], REGISTER_RAW_SIZE(FP_REGNUM))| DMEM_START; + return D10V_MAKE_DADDR (read_memory_unsigned_integer (fsr.regs[FP_REGNUM], REGISTER_RAW_SIZE (FP_REGNUM))); } static int next_addr, uses_frame; @@ -353,7 +353,7 @@ d10v_frame_find_saved_regs (fi, fsr) fi->size = -next_addr; if (!(fp & 0xffff)) - fp = read_register(SP_REGNUM) | DMEM_START; + fp = D10V_MAKE_DADDR (read_register(SP_REGNUM)); for (i=0; i<NUM_REGS-1; i++) if (fsr->regs[i]) @@ -362,9 +362,14 @@ d10v_frame_find_saved_regs (fi, fsr) } if (fsr->regs[LR_REGNUM]) - fi->return_pc = (read_memory_unsigned_integer(fsr->regs[LR_REGNUM], REGISTER_RAW_SIZE(LR_REGNUM)) << 2) | IMEM_START; + { + CORE_ADDR return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], REGISTER_RAW_SIZE (LR_REGNUM)); + fi->return_pc = D10V_MAKE_IADDR (return_pc); + } else - fi->return_pc = (read_register(LR_REGNUM) << 2) | IMEM_START; + { + fi->return_pc = D10V_MAKE_IADDR (read_register(LR_REGNUM)); + } /* th SP is not normally (ever?) saved, but check anyway */ if (!fsr->regs[SP_REGNUM]) @@ -411,7 +416,7 @@ show_regs (args, from_tty) { LONGEST num1, num2; printf_filtered ("PC=%04x (0x%x) PSW=%04x RPT_S=%04x RPT_E=%04x RPT_C=%04x\n", - read_register (PC_REGNUM), (read_register (PC_REGNUM) << 2) + IMEM_START, + read_register (PC_REGNUM), D10V_MAKE_IADDR (read_register (PC_REGNUM)), read_register (PSW_REGNUM), read_register (24), read_register (25), @@ -443,35 +448,19 @@ show_regs (args, from_tty) printf_filtered ("A0-A1 %010llx %010llx\n",num1, num2); } -static CORE_ADDR -d10v_xlate_addr (addr) - int addr; -{ - int imap; - - if (addr < 0x20000) - imap = (int)read_register(IMAP0_REGNUM); - else - imap = (int)read_register(IMAP1_REGNUM); - - if (imap & 0x1000) - return (CORE_ADDR)(addr + 0x1000000); - return (CORE_ADDR)(addr + (imap & 0xff)*0x20000); -} - - CORE_ADDR d10v_read_pc (pid) int pid; { int save_pid; + CORE_ADDR pc; CORE_ADDR retval; save_pid = inferior_pid; inferior_pid = pid; - retval = (int)read_register (PC_REGNUM); + pc = (int) read_register (PC_REGNUM); inferior_pid = save_pid; - retval = d10v_xlate_addr(retval << 2); + retval = D10V_MAKE_IADDR (pc); return retval; } @@ -484,34 +473,34 @@ d10v_write_pc (val, pid) save_pid = inferior_pid; inferior_pid = pid; - write_register (PC_REGNUM, (val & 0x3ffff) >> 2); + write_register (PC_REGNUM, D10V_CONVERT_IADDR_TO_RAW (val)); inferior_pid = save_pid; } CORE_ADDR d10v_read_sp () { - return (read_register(SP_REGNUM) | DMEM_START); + return (D10V_MAKE_DADDR (read_register (SP_REGNUM))); } void d10v_write_sp (val) CORE_ADDR val; { - write_register (SP_REGNUM, (LONGEST)(val & 0xffff)); + write_register (SP_REGNUM, D10V_CONVERT_DADDR_TO_RAW (val)); } void d10v_write_fp (val) CORE_ADDR val; { - write_register (FP_REGNUM, (LONGEST)(val & 0xffff)); + write_register (FP_REGNUM, D10V_CONVERT_DADDR_TO_RAW (val)); } CORE_ADDR d10v_read_fp () { - return (read_register(FP_REGNUM) | DMEM_START); + return (D10V_MAKE_DADDR (read_register(FP_REGNUM))); } /* Function: push_return_address (pc) @@ -523,7 +512,7 @@ d10v_push_return_address (pc, sp) CORE_ADDR pc; CORE_ADDR sp; { - write_register (LR_REGNUM, (CALL_DUMMY_ADDRESS () & 0xffff) >> 2); + write_register (LR_REGNUM, D10V_CONVERT_IADDR_TO_RAW (CALL_DUMMY_ADDRESS ())); return sp; } |