From c7c03c1e6ee0af81f8eac7fc54080f3a9600c783 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 30 Aug 2016 20:39:37 +0100 Subject: [PATCH] cpu-68000: add missing endian code --- Kernel/cpu-68000/cpu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Kernel/cpu-68000/cpu.h b/Kernel/cpu-68000/cpu.h index 6453530f..fd074549 100644 --- a/Kernel/cpu-68000/cpu.h +++ b/Kernel/cpu-68000/cpu.h @@ -50,6 +50,17 @@ typedef union { /* this structure is endian dependent */ } h; } ticks_t; +extern uint16_t swab(uint16_t); + +#define ntohs(x) (x) +#define ntohl(x) (x) + +#define cpu_to_le16(x) swab(x) +#define le16_to_cpu(x) swab(x) +#define cpu_to_le32(x) ((((uint32_t)cpu_to_le16((x) & 0xFFFF)) << 16) | \ + (uint32_t)cpu_to_le16((x) >> 16)) +#define le32_to_cpu(x) cpu_to_le32(x) + /* We don't need any banking bits really */ #define CODE1 #define CODE2 -- 2.34.1