linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Denis Kirjanov <kda@linux-powerpc.org>
To: Rashmica Gupta <rashmicy@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org, jwboyer@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc: Fix xmon ml command to work with 64 bit values.
Date: Wed, 25 Nov 2015 11:26:18 +0300	[thread overview]
Message-ID: <CAOJe8K2szgooZQEhY4wsQ5Zu=PZOfaGgHzaQO2EzWyqK8kkM4w@mail.gmail.com> (raw)
In-Reply-To: <1448406993-7888-1-git-send-email-rashmicy@gmail.com>

On 11/25/15, Rashmica Gupta <rashmicy@gmail.com> wrote:
> The ml command in xmon currently only works for 32-bit values and so fails
> to find 64-bit values on a ppc64 machine. So change to work for 64-bit
> values.
>
> This is based off a patch by Josh Boyer.
>
> Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
> ---

Please remove(update?) Josh Boyer from CC, the address bounces back.
>
> Based off this patch: http://patchwork.ozlabs.org/patch/90309/
>
>  arch/powerpc/xmon/xmon.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index 786bf01691c9..df05bd2fca07 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -184,6 +184,12 @@ extern void xmon_leave(void);
>  #define GETWORD(v)	(((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) +
> (v)[3])
>  #endif
>
> +#if BITS_PER_LONG == 64
> +#define GETLONG(v)	(((unsigned long) GETWORD(v)) << 32 | GETWORD(v+4))
> +#else
> +#define GETLONG(v)	GETWORD(v)
> +#endif
> +
>  static char *help_string = "\
>  Commands:\n\
>    b	show breakpoints\n\
> @@ -2447,14 +2453,15 @@ memdiffs(unsigned char *p1, unsigned char *p2,
> unsigned nb, unsigned maxpr)
>  		printf("Total of %d differences\n", prt);
>  }
>
> -static unsigned mend;
> -static unsigned mask;
> +static unsigned long mend;
> +static unsigned long mask;
>
>  static void
>  memlocate(void)
>  {
> -	unsigned a, n;
> -	unsigned char val[4];
> +	unsigned long a, n;
> +	int size = sizeof(unsigned long);
> +	unsigned char val[size];
>
>  	last_cmd = "ml";
>  	scanhex((void *)&mdest);
> @@ -2470,10 +2477,10 @@ memlocate(void)
>  		}
>  	}
>  	n = 0;
> -	for (a = mdest; a < mend; a += 4) {
> -		if (mread(a, val, 4) == 4
> -			&& ((GETWORD(val) ^ mval) & mask) == 0) {
> -			printf("%.16x:  %.16x\n", a, GETWORD(val));
> +	for (a = mdest; a < mend; a += size) {
> +		if (mread(a, val, size) == size
> +			&& ((GETLONG(val) ^ mval) & mask) == 0){
> +			printf("%.16lx:  %.16lx\n", a, GETLONG(val));
>  			if (++n >= 10)
>  				break;
>  		}
> --
> 2.5.0
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

  parent reply	other threads:[~2015-11-25  8:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 23:16 [PATCH] powerpc: Fix xmon ml command to work with 64 bit values Rashmica Gupta
2015-11-25  8:12 ` Denis Kirjanov
2015-11-25  8:26 ` Denis Kirjanov [this message]
2022-02-04  9:48 ` Christophe Leroy

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='CAOJe8K2szgooZQEhY4wsQ5Zu=PZOfaGgHzaQO2EzWyqK8kkM4w@mail.gmail.com' \
    --to=kda@linux-powerpc.org \
    --cc=jwboyer@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=rashmicy@gmail.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;
as well as URLs for NNTP newsgroup(s).