Commit 165c6fc8 authored by bellard's avatar bellard
Browse files

more endianness macros


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@759 c046a42c-6fe2-441c-8c8c-71466251a162
parent 2e12669a
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment