All of lore.kernel.org
 help / color / mirror / Atom feed
* trivial question regarding byte ordering
@ 2007-02-23 15:18 Allexio Ju
  2007-02-23 15:23 ` Robert P. J. Day
  2007-02-23 15:24 ` Frederik Deweerdt
  0 siblings, 2 replies; 5+ messages in thread
From: Allexio Ju @ 2007-02-23 15:18 UTC (permalink / raw)
  To: linux-kernel

Hi,

Is there a API (or macro) that checks CPU endianness and does byte
ordering conversion on given data (32-bit) if endianness is
big-endian?

Thank you in advance for your comment.

Regards,

Allexio

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trivial question regarding byte ordering
  2007-02-23 15:18 trivial question regarding byte ordering Allexio Ju
@ 2007-02-23 15:23 ` Robert P. J. Day
  2007-02-23 18:00   ` Allexio Ju
  2007-02-23 15:24 ` Frederik Deweerdt
  1 sibling, 1 reply; 5+ messages in thread
From: Robert P. J. Day @ 2007-02-23 15:23 UTC (permalink / raw)
  To: Allexio Ju; +Cc: linux-kernel

On Fri, 23 Feb 2007, Allexio Ju wrote:

> Hi,
>
> Is there a API (or macro) that checks CPU endianness and does byte
> ordering conversion on given data (32-bit) if endianness is
> big-endian?

#include <asm/byteorder.h>

each architecture is responsible for including the appropriate header
file for either big or little endianness.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trivial question regarding byte ordering
  2007-02-23 15:18 trivial question regarding byte ordering Allexio Ju
  2007-02-23 15:23 ` Robert P. J. Day
@ 2007-02-23 15:24 ` Frederik Deweerdt
  2007-02-23 18:01   ` Allexio Ju
  1 sibling, 1 reply; 5+ messages in thread
From: Frederik Deweerdt @ 2007-02-23 15:24 UTC (permalink / raw)
  To: Allexio Ju; +Cc: linux-kernel

On Fri, Feb 23, 2007 at 07:18:13AM -0800, Allexio Ju wrote:
> Is there a API (or macro) that checks CPU endianness and does byte
> ordering conversion on given data (32-bit) if endianness is
> big-endian?
including include/asm/byteorder.h will define the needed
cpu_to_{b,l}e{16,32,64} and {b,l}e{16,32,64}_to_cpu macros.

Regards,
Frederik

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trivial question regarding byte ordering
  2007-02-23 15:23 ` Robert P. J. Day
@ 2007-02-23 18:00   ` Allexio Ju
  0 siblings, 0 replies; 5+ messages in thread
From: Allexio Ju @ 2007-02-23 18:00 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: linux-kernel

On 2/23/07, Robert P. J. Day <rpjday@mindspring.com> wrote:
> #include <asm/byteorder.h>
>
> each architecture is responsible for including the appropriate header
> file for either big or little endianness.
Thank you for answer, Robert.

Allexio

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: trivial question regarding byte ordering
  2007-02-23 15:24 ` Frederik Deweerdt
@ 2007-02-23 18:01   ` Allexio Ju
  0 siblings, 0 replies; 5+ messages in thread
From: Allexio Ju @ 2007-02-23 18:01 UTC (permalink / raw)
  To: Frederik Deweerdt; +Cc: linux-kernel

On 2/23/07, Frederik Deweerdt <deweerdt@free.fr> wrote:
> including include/asm/byteorder.h will define the needed
> cpu_to_{b,l}e{16,32,64} and {b,l}e{16,32,64}_to_cpu macros.
Great, Thank you for your answer.

Regards,

Allexio

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-23 18:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23 15:18 trivial question regarding byte ordering Allexio Ju
2007-02-23 15:23 ` Robert P. J. Day
2007-02-23 18:00   ` Allexio Ju
2007-02-23 15:24 ` Frederik Deweerdt
2007-02-23 18:01   ` Allexio Ju

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.