[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: [linux-audio-dev] help with bigendian unsigned long long
From: Paul Davis (pbd_AT_op.net)
Date: Thu May 09 2002 - 02:24:55 EEST


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? current code looks like:

static inline unsigned long long hdsp_read64 (hdsp_t *hdsp, int reg)
{
        unsigned long long val;
#ifdef SNDRV_BIG_ENDIAN
#error i have not figured out how to byte swap 64 bits on a bigendian system
#else
        val = hdsp_read(hdsp, reg);
        val = (val<<32);
        return val|hdsp_read(hdsp, reg + 4);
#endif
}


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

This archive was generated by hypermail 2b28 : Thu May 09 2002 - 14:01:13 EEST