diff options
author | Michael Snyder <msnyder@vmware.com> | 2002-04-12 22:50:42 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2002-04-12 22:50:42 +0000 |
commit | 169a7369fc9650d6a2e98829bdf5d9da1838dc9a (patch) | |
tree | d73816180dfc04ac3f8975aa7628139a11599cfc /gdb/d10v-tdep.c | |
parent | de74f71f00b20ea662706852565f3b2a3c7ef2a0 (diff) | |
download | gdb-169a7369fc9650d6a2e98829bdf5d9da1838dc9a.zip gdb-169a7369fc9650d6a2e98829bdf5d9da1838dc9a.tar.gz gdb-169a7369fc9650d6a2e98829bdf5d9da1838dc9a.tar.bz2 |
2002-04-12 Michael Snyder <msnyder@redhat.com>
* d10v-tdep.c (d10v_make_iaddr): Make it idempotent,
in case it gets applied to an address that is already
in the instruction space.
Diffstat (limited to 'gdb/d10v-tdep.c')
-rw-r--r-- | gdb/d10v-tdep.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index f2ee7d5..df35679 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -356,18 +356,6 @@ d10v_register_virtual_type (int reg_nr) return builtin_type_int16; } -static CORE_ADDR -d10v_make_daddr (CORE_ADDR x) -{ - return ((x) | DMEM_START); -} - -static CORE_ADDR -d10v_make_iaddr (CORE_ADDR x) -{ - return (((x) << 2) | IMEM_START); -} - static int d10v_daddr_p (CORE_ADDR x) { @@ -380,6 +368,20 @@ d10v_iaddr_p (CORE_ADDR x) return (((x) & 0x3000000) == IMEM_START); } +static CORE_ADDR +d10v_make_daddr (CORE_ADDR x) +{ + return ((x) | DMEM_START); +} + +static CORE_ADDR +d10v_make_iaddr (CORE_ADDR x) +{ + if (d10v_iaddr_p (x)) + return x; /* Idempotency -- x is already in the IMEM space. */ + else + return (((x) << 2) | IMEM_START); +} static CORE_ADDR d10v_convert_iaddr_to_raw (CORE_ADDR x) |