X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=bswap.h;h=82a79517db971137f72d6c160b5721af131e6721;hb=01825a8ddf2f269407905d67993d73abab6e2177;hp=20caae63ead5c32589f061423c1a7cbe077ba969;hpb=358c360feb346dff8f911e2d1dbcdd6319393f1d;p=qemu.git diff --git a/bswap.h b/bswap.h index 20caae63e..82a79517d 100644 --- a/bswap.h +++ b/bswap.h @@ -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