[zbin] Fix check for existence of most recent output byte
[ipxe.git] / src / include / little_bswap.h
1 #ifndef ETHERBOOT_LITTLE_BSWAP_H
2 #define ETHERBOOT_LITTLE_BSWAP_H
3
4 FILE_LICENCE ( GPL2_OR_LATER );
5
6 #define htonll(x) __bswap_64(x)
7 #define ntohll(x) __bswap_64(x)
8 #define ntohl(x) __bswap_32(x)
9 #define htonl(x) __bswap_32(x)
10 #define ntohs(x) __bswap_16(x)
11 #define htons(x) __bswap_16(x)
12 #define cpu_to_le64(x) (x)
13 #define cpu_to_le32(x) (x)
14 #define cpu_to_le16(x) (x)
15 #define cpu_to_be64(x) __bswap_64(x)
16 #define cpu_to_be32(x) __bswap_32(x)
17 #define cpu_to_be16(x) __bswap_16(x)
18 #define le64_to_cpu(x) (x)
19 #define le32_to_cpu(x) (x)
20 #define le16_to_cpu(x) (x)
21 #define be64_to_cpu(x) __bswap_64(x)
22 #define be32_to_cpu(x) __bswap_32(x)
23 #define be16_to_cpu(x) __bswap_16(x)
24 #define cpu_to_le64s(x) do {} while (0)
25 #define cpu_to_le32s(x) do {} while (0)
26 #define cpu_to_le16s(x) do {} while (0)
27 #define cpu_to_be64s(x) __bswap_64s(x)
28 #define cpu_to_be32s(x) __bswap_32s(x)
29 #define cpu_to_be16s(x) __bswap_16s(x)
30 #define le64_to_cpus(x) do {} while (0)
31 #define le32_to_cpus(x) do {} while (0)
32 #define le16_to_cpus(x) do {} while (0)
33 #define be64_to_cpus(x) __bswap_64s(x)
34 #define be32_to_cpus(x) __bswap_32s(x)
35 #define be16_to_cpus(x) __bswap_16s(x)
36
37 #endif /* ETHERBOOT_LITTLE_BSWAP_H */