Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F3155667
linux_endian.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
linux_endian.h
View Options
#ifndef __LINUX_ENDIAN_DOT_H__
#define __LINUX_ENDIAN_DOT_H__
#include <endian.h>
#include <byteswap.h>
/* I'm not sure which versions of alpha glibc/gcc are broken,
so fix all of them. */
#ifdef __alpha__
#undef bswap_64
static __inline__ unsigned long bswap_64(unsigned long x)
{
unsigned int h = x >> 32;
unsigned int l = x;
h = bswap_32(h);
l = bswap_32(l);
return ((unsigned long)l << 32) | h;
}
#endif /* __alpha__ */
#if __BYTE_ORDER == __BIG_ENDIAN
#define be16_to_cpu(x) (x)
#define be32_to_cpu(x) (x)
#define be64_to_cpu(x) (x)
#define cpu_to_be16(x) (x)
#define cpu_to_be32(x) (x)
#define cpu_to_be64(x) (x)
#define le16_to_cpu(x) (bswap_16((x)))
#define le32_to_cpu(x) (bswap_32((x)))
#define le64_to_cpu(x) (bswap_64((x)))
#define cpu_to_le16(x) (bswap_16((x)))
#define cpu_to_le32(x) (bswap_32((x)))
#define cpu_to_le64(x) (bswap_64((x)))
#endif /* __BYTE_ORDER == __BIG_ENDIAN */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define be16_to_cpu(x) (bswap_16((x)))
#define be32_to_cpu(x) (bswap_32((x)))
#define be64_to_cpu(x) (bswap_64((x)))
#define cpu_to_be16(x) (bswap_16((x)))
#define cpu_to_be32(x) (bswap_32((x)))
#define cpu_to_be64(x) (bswap_64((x)))
#define le16_to_cpu(x) (x)
#define le32_to_cpu(x) (x)
#define le64_to_cpu(x) (x)
#define cpu_to_le16(x) (x)
#define cpu_to_le32(x) (x)
#define cpu_to_le64(x) (x)
#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */
#endif /* __LINUX_ENDIAN_DOT_H__ */
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Thu, Feb 27, 12:23 AM (17 h, 47 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1465941
Default Alt Text
linux_endian.h (1 KB)
Attached To
Mode
rF Fence Agents
Attached
Detach File
Event Timeline
Log In to Comment