more endianness macros

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@759 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2004-04-25 22:08:49 +00:00
parent 2e12669a4c
commit 165c6fc8ce

41
vl.h
View File

@ -67,6 +67,16 @@ static inline uint16_t be16_to_cpu(uint16_t v)
return v;
}
static inline uint32_t cpu_to_be32(uint32_t v)
{
return v;
}
static inline uint16_t cpu_to_be16(uint16_t v)
{
return v;
}
static inline uint32_t le32_to_cpu(uint32_t v)
{
return bswap32(v);
@ -77,7 +87,18 @@ static inline uint16_t le16_to_cpu(uint16_t v)
return bswap16(v);
}
static inline uint32_t cpu_to_le32(uint32_t v)
{
return bswap32(v);
}
static inline uint16_t cpu_to_le16(uint16_t v)
{
return bswap16(v);
}
#else
static inline uint32_t be32_to_cpu(uint32_t v)
{
return bswap32(v);
@ -88,6 +109,16 @@ static inline uint16_t be16_to_cpu(uint16_t v)
return bswap16(v);
}
static inline uint32_t cpu_to_be32(uint32_t v)
{
return bswap32(v);
}
static inline uint16_t cpu_to_be16(uint16_t v)
{
return bswap16(v);
}
static inline uint32_t le32_to_cpu(uint32_t v)
{
return v;
@ -97,6 +128,16 @@ static inline uint16_t le16_to_cpu(uint16_t v)
{
return v;
}
static inline uint32_t cpu_to_le32(uint32_t v)
{
return v;
}
static inline uint16_t cpu_to_le16(uint16_t v)
{
return v;
}
#endif