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
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
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
========================================================================
On 2/23/07, Robert P. J. Day <[email protected]> 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
On 2/23/07, Frederik Deweerdt <[email protected]> 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