提交 165c6fc8 编写于 作者: B bellard

more endianness macros


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@759 c046a42c-6fe2-441c-8c8c-71466251a162
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册