From: Tom Musta <tommusta@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: fix xmon disassembler for little-endian
Date: Mon, 02 Dec 2013 08:05:11 -0600 [thread overview]
Message-ID: <529C9397.9050704@gmail.com> (raw)
In-Reply-To: <1385975412-25869-1-git-send-email-felix@linux.vnet.ibm.com>
On 12/2/2013 3:10 AM, Philippe Bergheaud wrote:
> This patch fixes the disassembler of the powerpc kernel debugger xmon,
> for little-endian.
>
> Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
> ---
> arch/powerpc/xmon/xmon.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index af9d346..6c27804 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -171,7 +171,11 @@ extern void xmon_leave(void);
> #define REG "%.8lx"
> #endif
>
> +#ifdef __LITTLE_ENDIAN__
> +#define GETWORD(v) (((v)[3] << 24) + ((v)[2] << 16) + ((v)[1] << 8) + (v)[0])
> +#else
> #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
> +#endif
>
> #define isxdigit(c) (('0' <= (c) && (c) <= '9') \
> || ('a' <= (c) && (c) <= 'f') \
>
Philippe: Wouldn't it be better to just do a 32-bit load and let the endianness be worked out
by the hardware? i.e.
#define GETWORD(v) (*(u32 *)v)
Tom
next prev parent reply other threads:[~2013-12-02 14:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 9:10 [PATCH] powerpc: fix xmon disassembler for little-endian Philippe Bergheaud
2013-12-02 14:05 ` Tom Musta [this message]
2013-12-04 13:45 ` Philippe Bergheaud
2013-12-05 4:39 ` Benjamin Herrenschmidt
2013-12-05 8:50 ` Philippe Bergheaud
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=529C9397.9050704@gmail.com \
--to=tommusta@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/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).