Lines Matching defs:in
6 * in the Software without restriction, including without limitation the rights
11 * The above copyright notice and this permission notice shall be included in
27 * These prototypes exist to catch bugs in the code generating macros below.
30 static inline uint64_t i_bswap_64(uint64_t in);
31 static inline uint32_t i_bswap_32(uint32_t in);
32 static inline uint16_t i_bswap_16(uint16_t in);
33 static inline uint8_t i_bswap_8(uint8_t in);
36 static inline uint64_t cpu64_to_cpu_unaligned(const void *in);
37 static inline uint32_t cpu32_to_cpu_unaligned(const void *in);
38 static inline uint16_t cpu16_to_cpu_unaligned(const void *in);
39 static inline uint8_t cpu8_to_cpu_unaligned(const void *in);
42 static inline uint64_t be64_to_cpu_unaligned(const void *in);
43 static inline uint32_t be32_to_cpu_unaligned(const void *in);
44 static inline uint16_t be16_to_cpu_unaligned(const void *in);
45 static inline uint8_t be8_to_cpu_unaligned(const void *in);
48 static inline uint64_t le64_to_cpu_unaligned(const void *in);
49 static inline uint32_t le32_to_cpu_unaligned(const void *in);
50 static inline uint16_t le16_to_cpu_unaligned(const void *in);
51 static inline uint8_t le8_to_cpu_unaligned(const void *in);
54 static inline void cpu64_to_be_unaligned(uint64_t in, void *out);
55 static inline void cpu32_to_be_unaligned(uint32_t in, void *out);
56 static inline void cpu16_to_be_unaligned(uint16_t in, void *out);
57 static inline void cpu8_to_be_unaligned(uint8_t in, void *out);
60 static inline void cpu64_to_le_unaligned(uint64_t in, void *out);
61 static inline void cpu32_to_le_unaligned(uint32_t in, void *out);
62 static inline void cpu16_to_le_unaligned(uint16_t in, void *out);
63 static inline void cpu8_to_le_unaligned(uint8_t in, void *out);
66 static inline uint64_t be64_to_cpu(uint64_t in);
67 static inline uint32_t be32_to_cpu(uint32_t in);
68 static inline uint16_t be16_to_cpu(uint16_t in);
69 static inline uint8_t be8_to_cpu(uint8_t in);
72 static inline uint64_t cpu64_to_be(uint64_t in);
73 static inline uint32_t cpu32_to_be(uint32_t in);
74 static inline uint16_t cpu16_to_be(uint16_t in);
75 static inline uint8_t cpu8_to_be(uint8_t in);
78 static inline uint64_t le64_to_cpu(uint64_t in);
79 static inline uint32_t le32_to_cpu(uint32_t in);
80 static inline uint16_t le16_to_cpu(uint16_t in);
81 static inline uint8_t le8_to_cpu(uint8_t in);
84 static inline uint64_t cpu64_to_le(uint64_t in);
85 static inline uint32_t cpu32_to_le(uint32_t in);
86 static inline uint16_t cpu16_to_le(uint16_t in);
87 static inline uint8_t cpu8_to_le(uint8_t in);
92 static inline uint64_t i_bswap_64(uint64_t in)
94 return ((in & 0xff00000000000000ULL) >> 56) |
95 ((in & 0x00ff000000000000ULL) >> 40) |
96 ((in & 0x0000ff0000000000ULL) >> 24) |
97 ((in & 0x000000ff00000000ULL) >> 8) |
98 ((in & 0x00000000ff000000ULL) << 8) |
99 ((in & 0x0000000000ff0000ULL) << 24) |
100 ((in & 0x000000000000ff00ULL) << 40) |
101 ((in & 0x00000000000000ffULL) << 56);
104 static inline uint32_t i_bswap_32(uint32_t in)
106 return ((in & 0xff000000) >> 24) |
107 ((in & 0x00ff0000) >> 8) |
108 ((in & 0x0000ff00) << 8) |
109 ((in & 0x000000ff) << 24);
112 static inline uint16_t i_bswap_16(uint16_t in)
114 return ((in & 0xff00) >> 8) |
115 ((in & 0x00ff) << 8);
118 static inline uint8_t i_bswap_8(uint8_t in)
120 return (in & 0xff);
126 static inline uint64_t be64_to_cpu_unaligned(const void *in)
128 const uint8_t *p = (const uint8_t *) in;
140 static inline void cpu64_to_be_unaligned(uint64_t in, void *out)
144 p[0] = (in >> 56) & 0xff;
145 p[1] = (in >> 48) & 0xff;
146 p[2] = (in >> 40) & 0xff;
147 p[3] = (in >> 32) & 0xff;
148 p[4] = (in >> 24) & 0xff;
149 p[5] = (in >> 16) & 0xff;
150 p[6] = (in >> 8) & 0xff;
151 p[7] = in & 0xff;
154 static inline uint32_t be32_to_cpu_unaligned(const void *in)
156 const uint8_t *p = (const uint8_t *) in;
164 static inline void cpu32_to_be_unaligned(uint32_t in, void *out)
168 p[0] = (in >> 24) & 0xff;
169 p[1] = (in >> 16) & 0xff;
170 p[2] = (in >> 8) & 0xff;
171 p[3] = in & 0xff;
174 static inline uint16_t be16_to_cpu_unaligned(const void *in)
176 const uint8_t *p = (const uint8_t *) in;
182 static inline void cpu16_to_be_unaligned(uint16_t in, void *out)
186 p[0] = (in >> 8) & 0xff;
187 p[1] = in & 0xff;
190 static inline uint8_t be8_to_cpu_unaligned(const void *in)
192 return *((const uint8_t *) in);
195 static inline void cpu8_to_be_unaligned(uint8_t in, void *out)
199 *p = in;
206 static inline uint##size##_t le##size##_to_cpu_unaligned(const void *in)\
208 uint##size##_t x = be##size##_to_cpu_unaligned(in); \
212 static inline void cpu##size##_to_le_unaligned(uint##size##_t in, \
215 /* we'll be writing in BE, so we always have to byte swap */ \
216 cpu##size##_to_be_unaligned(i_bswap_##size(in), out); \
218 static inline uint##size##_t cpu##size##_to_cpu_unaligned(const void *in)\
220 uint##size##_t x = be##size##_to_cpu_unaligned(in); \