diff options
author | David 'Digit' Turner <digit@android.com> | 2011-05-10 17:35:03 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-06-01 17:08:18 +0200 |
commit | e1c094842f6a6f2452196084e7828da15f18bf67 (patch) | |
tree | 1d22a1513880e3158da2beb5b3fa8c6cf686f346 /bswap.h | |
parent | 6b9236d20fe87536ebc763e7503655bf7de1b19b (diff) | |
download | external_qemu-e1c094842f6a6f2452196084e7828da15f18bf67.zip external_qemu-e1c094842f6a6f2452196084e7828da15f18bf67.tar.gz external_qemu-e1c094842f6a6f2452196084e7828da15f18bf67.tar.bz2 |
bswap.h + others: minor integrate
Change-Id: I8706d2e3f2d722bae368e70d3adf6bd335dd8e58
Diffstat (limited to 'bswap.h')
-rw-r--r-- | bswap.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -144,6 +144,7 @@ CPU_CONVERT(le, 64, uint64_t) #define cpu_to_be16wu(p, v) cpu_to_be16w(p, v) #define cpu_to_be32wu(p, v) cpu_to_be32w(p, v) +#define cpu_to_be64wu(p, v) cpu_to_be64w(p, v) #else @@ -201,6 +202,20 @@ static inline void cpu_to_be32wu(uint32_t *p, uint32_t v) p1[3] = v & 0xff; } +static inline void cpu_to_be64wu(uint64_t *p, uint64_t v) +{ + uint8_t *p1 = (uint8_t *)p; + + p1[0] = v >> 56; + p1[1] = v >> 48; + p1[2] = v >> 40; + p1[3] = v >> 32; + p1[4] = v >> 24; + p1[5] = v >> 16; + p1[6] = v >> 8; + p1[7] = v & 0xff; +} + #endif #ifdef HOST_WORDS_BIGENDIAN |