Comments
Patch
@@ -38,4 +38,15 @@
(( (in) & 0xFF0000) >> 8) | (( (in) & 0xFF000000) >> 24))
#define ntohll(in) (((u64) ntohl( (in) & 0xFFFFFFFF) << 32) | ((u64) ntohl( (in) >> 32)))
+
+#define cpu_to_le16(in) (in)
+#define cpu_to_le32(in) (in)
+#define cpu_to_be16(in) ntohw(in)
+#define cpu_to_be32(in) ntohl(in)
+
+#define le16_to_cpu(in) (in)
+#define le32_to_cpu(in) (in)
+#define be16_to_cpu(in) ntohw(in)
+#define be32_to_cpu(in) ntohl(in)
+
#endif
@@ -33,9 +33,19 @@
#include <arch/types.h>
#define ntohw(in) (in)
-
#define ntohl(in) (in)
-
#define ntohll(in) (in)
+#define cpu_to_le16(in) ((( (in) & 0xFF) << 8) | (( (in) & 0xFF00) >> 8))
+#define cpu_to_le32(in) ((( (in) & 0xFF) << 24) | (( (in) & 0xFF00) << 8) | \
+ (( (in) & 0xFF0000) >> 8) | (( (in) & 0xFF000000) >> 24))
+
+#define cpu_to_be16(in) (in)
+#define cpu_to_be32(in) (in)
+
+#define le16_to_cpu(in) cpu_to_le16(in)
+#define le32_to_cpu(in) cpu_to_le32(in)
+#define be16_to_cpu(in) (in)
+#define be32_to_cpu(in) (in)
+
#endif
Signed-off-by: Daniel Mack <daniel@caiaq.de> --- include/i386/arch/endian.h | 11 +++++++++++ include/powerpc/arch/endian.h | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-)