Diff for /qemu/bswap.h between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2018/04/24 16:47:32 version 1.1.1.3, 2018/04/24 16:50:52
Line 5 Line 5
   
 #include <inttypes.h>  #include <inttypes.h>
   
   #ifdef HAVE_MACHINE_BSWAP_H
   #include <sys/endian.h>
   #include <sys/types.h>
   #include <machine/bswap.h>
   #else
   
 #ifdef HAVE_BYTESWAP_H  #ifdef HAVE_BYTESWAP_H
 #include <byteswap.h>  #include <byteswap.h>
 #else  #else
Line 58  static inline uint64_t bswap64(uint64_t  Line 64  static inline uint64_t bswap64(uint64_t 
     return bswap_64(x);      return bswap_64(x);
 }  }
   
   #endif /* ! HAVE_MACHINE_BSWAP_H */
   
 static inline void bswap16s(uint16_t *s)  static inline void bswap16s(uint16_t *s)
 {  {
     *s = bswap16(*s);      *s = bswap16(*s);
Line 126  CPU_CONVERT(le, 64, uint64_t) Line 134  CPU_CONVERT(le, 64, uint64_t)
   
 /* unaligned versions (optimized for frequent unaligned accesses)*/  /* unaligned versions (optimized for frequent unaligned accesses)*/
   
 #if defined(__i386__) || defined(__powerpc__)  #if defined(__i386__) || defined(_ARCH_PPC)
   
 #define cpu_to_le16wu(p, v) cpu_to_le16w(p, v)  #define cpu_to_le16wu(p, v) cpu_to_le16w(p, v)
 #define cpu_to_le32wu(p, v) cpu_to_le32w(p, v)  #define cpu_to_le32wu(p, v) cpu_to_le32w(p, v)
 #define le16_to_cpupu(p) le16_to_cpup(p)  #define le16_to_cpupu(p) le16_to_cpup(p)
 #define le32_to_cpupu(p) le32_to_cpup(p)  #define le32_to_cpupu(p) le32_to_cpup(p)
   #define be32_to_cpupu(p) be32_to_cpup(p)
   
 #define cpu_to_be16wu(p, v) cpu_to_be16w(p, v)  #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_be32wu(p, v) cpu_to_be32w(p, v)
Line 168  static inline uint32_t le32_to_cpupu(con Line 177  static inline uint32_t le32_to_cpupu(con
     return p1[0] | (p1[1] << 8) | (p1[2] << 16) | (p1[3] << 24);      return p1[0] | (p1[1] << 8) | (p1[2] << 16) | (p1[3] << 24);
 }  }
   
   static inline uint32_t be32_to_cpupu(const uint32_t *p)
   {
       const uint8_t *p1 = (const uint8_t *)p;
       return p1[3] | (p1[2] << 8) | (p1[1] << 16) | (p1[0] << 24);
   }
   
 static inline void cpu_to_be16wu(uint16_t *p, uint16_t v)  static inline void cpu_to_be16wu(uint16_t *p, uint16_t v)
 {  {
     uint8_t *p1 = (uint8_t *)p;      uint8_t *p1 = (uint8_t *)p;

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


unix.superglobalmegacorp.com