Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: gdb-patches@sources.redhat.com
Cc: jimb@redhat.com
Subject: [PATCH] d10v_make_iaddr: make it idempotent.
Date: Fri, 12 Apr 2002 15:51:00 -0000	[thread overview]
Message-ID: <200204122239.g3CMdVB13335@reddwarf.sfbay.redhat.com> (raw)

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.

Index: d10v-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/d10v-tdep.c,v
retrieving revision 2.88
diff -c -3 -p -r2.88 d10v-tdep.c
*** d10v-tdep.c	2002/04/09 03:00:45	2.88
--- d10v-tdep.c	2002/04/12 22:47:30
*************** d10v_register_virtual_type (int reg_nr)
*** 356,373 ****
      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)
  {
--- 356,361 ----
*************** d10v_iaddr_p (CORE_ADDR x)
*** 380,385 ****
--- 368,387 ----
    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)


             reply	other threads:[~2002-04-12 22:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-12 15:51 Michael Snyder [this message]
2002-04-12 16:27 ` Andrew Cagney
2002-04-12 17:34   ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200204122239.g3CMdVB13335@reddwarf.sfbay.redhat.com \
    --to=msnyder@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox