Commit 165c6fc8ce3026eeeef2e8a1235b0bd08b51f03e

Authored by bellard
1 parent 2e12669a

more endianness macros


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@759 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 41 additions and 0 deletions
... ... @@ -67,6 +67,16 @@ static inline uint16_t be16_to_cpu(uint16_t v)
67 67 return v;
68 68 }
69 69  
  70 +static inline uint32_t cpu_to_be32(uint32_t v)
  71 +{
  72 + return v;
  73 +}
  74 +
  75 +static inline uint16_t cpu_to_be16(uint16_t v)
  76 +{
  77 + return v;
  78 +}
  79 +
70 80 static inline uint32_t le32_to_cpu(uint32_t v)
71 81 {
72 82 return bswap32(v);
... ... @@ -77,7 +87,18 @@ static inline uint16_t le16_to_cpu(uint16_t v)
77 87 return bswap16(v);
78 88 }
79 89  
  90 +static inline uint32_t cpu_to_le32(uint32_t v)
  91 +{
  92 + return bswap32(v);
  93 +}
  94 +
  95 +static inline uint16_t cpu_to_le16(uint16_t v)
  96 +{
  97 + return bswap16(v);
  98 +}
  99 +
80 100 #else
  101 +
81 102 static inline uint32_t be32_to_cpu(uint32_t v)
82 103 {
83 104 return bswap32(v);
... ... @@ -88,6 +109,16 @@ static inline uint16_t be16_to_cpu(uint16_t v)
88 109 return bswap16(v);
89 110 }
90 111  
  112 +static inline uint32_t cpu_to_be32(uint32_t v)
  113 +{
  114 + return bswap32(v);
  115 +}
  116 +
  117 +static inline uint16_t cpu_to_be16(uint16_t v)
  118 +{
  119 + return bswap16(v);
  120 +}
  121 +
91 122 static inline uint32_t le32_to_cpu(uint32_t v)
92 123 {
93 124 return v;
... ... @@ -97,6 +128,16 @@ static inline uint16_t le16_to_cpu(uint16_t v)
97 128 {
98 129 return v;
99 130 }
  131 +
  132 +static inline uint32_t cpu_to_le32(uint32_t v)
  133 +{
  134 + return v;
  135 +}
  136 +
  137 +static inline uint16_t cpu_to_le16(uint16_t v)
  138 +{
  139 + return v;
  140 +}
100 141 #endif
101 142  
102 143  
... ...