LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Ray Lee" <ray-lk@madrabbit.org>
To: "Christoph Hellwig" <hch@infradead.org>
Cc: jason.wessel@windriver.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/8] kgdb: core API and gdb protocol handler
Date: Sat, 9 Feb 2008 13:51:00 -0800	[thread overview]
Message-ID: <2c0942db0802091351k6ceb2d28h9f9d5c0fb16e1484@mail.gmail.com> (raw)
In-Reply-To: <2c0942db0802091146v7b780b7dl4bd745caef900ae7@mail.gmail.com>

2008/2/9 Ray Lee <ray-lk@madrabbit.org>:
> On Feb 9, 2008 9:27 AM, Christoph Hellwig <hch@infradead.org> wrote:
> > On Sat, Feb 09, 2008 at 07:35:07AM -0600, jason.wessel@windriver.com wrote:
> > > +#ifdef __BIG_ENDIAN
> > > +             *buf++ = hexchars[(tmp_s >> 12) & 0xf];
> > > +             *buf++ = hexchars[(tmp_s >> 8) & 0xf];
> > > +             *buf++ = hexchars[(tmp_s >> 4) & 0xf];
> > > +             *buf++ = hexchars[tmp_s & 0xf];
> > > +#else
> > > +             *buf++ = hexchars[(tmp_s >> 4) & 0xf];
> > > +             *buf++ = hexchars[tmp_s & 0xf];
> > > +             *buf++ = hexchars[(tmp_s >> 12) & 0xf];
> > > +             *buf++ = hexchars[(tmp_s >> 8) & 0xf];
> > > +#endif
> >
> > This is really ugly, but I don't really know a good way around it
> > either.
>
> void u32_to_hex(u32 val, unsigned char *buf)
> {
>          int i;
>
>          for (i=7; i>=0; i--) {
>                   buf[i] = hexchars[ val & 0x0f ];
>                   val >>= 4;
>          }
> }
>
>          u32_to_hex(tmp_s, buf);
>          buf += 8;
>

Sorry, rewrote what I thought I read, not what was there. I guess
you'd want it more along the lines of

   void u32_to_hex(u32 x, unsigned char *buf)
   {
          int i;
          int val = cpu_to_be32( x );

          for (i=7; ...

  reply	other threads:[~2008-02-09 21:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 13:35 [PATCH 0/8] kgdb 2.6.25 version jason.wessel
2008-02-09 13:35 ` [PATCH 1/8] kgdb: core API and gdb protocol handler jason.wessel
2008-02-09 13:35   ` [PATCH 2/8] pid, kgdb: add pid_max prototype jason.wessel
2008-02-09 13:35     ` [PATCH 3/8] kgdb, modules: Always allow module sect info for KGDB jason.wessel
2008-02-09 13:35       ` [PATCH 4/8] kgdb: COPTIMIZE flag jason.wessel
2008-02-09 13:35         ` [PATCH 5/8] kgdb, x86: Add arch specfic kgdb support jason.wessel
2008-02-09 13:35           ` [PATCH 6/8] kgdb, sysrq_bugfix jason.wessel
2008-02-09 13:35             ` [PATCH][7/8] kgdb: exclusive use kgdb8250 uart I/O driver jason.wessel
2008-02-09 13:35               ` [PATCH 8/8] kgdb: kgdboc 8250 I/O module jason.wessel
2008-02-09 14:53               ` [PATCH][7/8] kgdb: exclusive use kgdb8250 uart I/O driver Jan Kiszka
2008-02-09 18:45                 ` Jason Wessel
2008-02-09 16:40               ` Jan Kiszka
2008-02-09 18:41                 ` Jason Wessel
2008-02-10 15:26               ` Pavel Machek
2008-02-09 14:33           ` [PATCH 5/8] kgdb, x86: Add arch specfic kgdb support Jan Kiszka
2008-02-09 17:16         ` [PATCH 4/8] kgdb: COPTIMIZE flag Christoph Hellwig
2008-02-09 17:15       ` [PATCH 3/8] kgdb, modules: Always allow module sect info for KGDB Christoph Hellwig
2008-02-09 17:10     ` [PATCH 2/8] pid, kgdb: add pid_max prototype Christoph Hellwig
2008-02-09 14:27   ` [PATCH 1/8] kgdb: core API and gdb protocol handler Jan Kiszka
2008-02-09 15:29   ` Sam Ravnborg
2008-02-09 17:27   ` Christoph Hellwig
2008-02-09 19:46     ` Ray Lee
2008-02-09 21:51       ` Ray Lee [this message]
2008-02-09 17:38 ` [PATCH 0/8] kgdb 2.6.25 version Christoph Hellwig

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=2c0942db0802091351k6ceb2d28h9f9d5c0fb16e1484@mail.gmail.com \
    --to=ray-lk@madrabbit.org \
    --cc=hch@infradead.org \
    --cc=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/8] kgdb: core API and gdb protocol handler' \
    /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

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).