Re: [linux-audio-dev] help with bigendian unsigned long long

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] help with bigendian unsigned long long
From: Takashi Iwai (tiwai_AT_suse.de)
Date: Mon May 13 2002 - 12:57:28 EEST


At Thu, 09 May 2002 07:10:03 -0400,
Paul Davis wrote:
>
> >> i am reading a little endian unsigned long long (64 bit integer) as
> >> two LE 32 bit units. i know how to do this on a LE host. can someone
> >> tell me how to byte swap and OR them together to form the correct
> >> value if the host is bigendian?
> >
> >Working and tested (x86 Linux and Sparc Solaris) code:
>
> thanks. however, i found it simpler to do:
>
> #include <byteswap.h>
> ...
> bswap_64(val)
>
> i knew about byteswap.h, and was using bswap_32 - i just hadn't
> bothered to look to see if it included bswap_64, and it does.

additional notes:
for using swab thingies on the device driver, you'll need to include
<asm/byteorder.h> instead of <byteswap.h>. include standard header
files are prohibited.

Takashi


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon May 13 2002 - 12:49:51 EEST