@@ -60,6 +60,18 @@
# define __bpf_cpu_to_be64(x) __builtin_bswap64(x)
# define __bpf_constant_be64_to_cpu(x) ___bpf_swab64(x)
# define __bpf_constant_cpu_to_be64(x) ___bpf_swab64(x)
+# define __bpf_le16_to_cpu(x) (x)
+# define __bpf_cpu_to_le16(x) (x)
+# define __bpf_constant_le16_to_cpu(x) (x)
+# define __bpf_constant_cpu_to_le16(x) (x)
+# define __bpf_le32_to_cpu(x) (x)
+# define __bpf_cpu_to_le32(x) (x)
+# define __bpf_constant_le32_to_cpu(x) (x)
+# define __bpf_constant_cpu_to_le32(x) (x)
+# define __bpf_le64_to_cpu(x) (x)
+# define __bpf_cpu_to_le64(x) (x)
+# define __bpf_constant_le64_to_cpu(x) (x)
+# define __bpf_constant_cpu_to_le64(x) (x)
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define __bpf_ntohs(x) (x)
# define __bpf_htons(x) (x)
@@ -73,6 +85,18 @@
# define __bpf_cpu_to_be64(x) (x)
# define __bpf_constant_be64_to_cpu(x) (x)
# define __bpf_constant_cpu_to_be64(x) (x)
+# define __bpf_le16_to_cpu(x) __builtin_bswap16(x)
+# define __bpf_cpu_to_le16(x) __builtin_bswap16(x)
+# define __bpf_constant_le16_to_cpu(x) ___bpf_swab16(x)
+# define __bpf_constant_cpu_to_le16(x) ___bpf_swab16(x)
+# define __bpf_le32_to_cpu(x) __builtin_bswap32(x)
+# define __bpf_cpu_to_le32(x) __builtin_bswap32(x)
+# define __bpf_constant_le32_to_cpu(x) ___bpf_swab32(x)
+# define __bpf_constant_cpu_to_le32(x) ___bpf_swab32(x)
+# define __bpf_le64_to_cpu(x) __builtin_bswap64(x)
+# define __bpf_cpu_to_le64(x) __builtin_bswap64(x)
+# define __bpf_constant_le64_to_cpu(x) ___bpf_swab64(x)
+# define __bpf_constant_cpu_to_le64(x) ___bpf_swab64(x)
#else
# error "Fix your compiler's __BYTE_ORDER__?!"
#endif
@@ -87,5 +111,11 @@
#define bpf_ntohl(x) __bpf_endop(ntohl, x)
#define bpf_cpu_to_be64(x) __bpf_endop(cpu_to_be64, x)
#define bpf_be64_to_cpu(x) __bpf_endop(be64_to_cpu, x)
+#define bpf_cpu_to_le16(x) __bpf_endop(cpu_to_le16, x)
+#define bpf_le16_to_cpu(x) __bpf_endop(le16_to_cpu, x)
+#define bpf_cpu_to_le32(x) __bpf_endop(cpu_to_le32, x)
+#define bpf_le32_to_cpu(x) __bpf_endop(le32_to_cpu, x)
+#define bpf_cpu_to_le64(x) __bpf_endop(cpu_to_le64, x)
+#define bpf_le64_to_cpu(x) __bpf_endop(le64_to_cpu, x)
#endif /* __BPF_ENDIAN__ */