public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57f283f
)
cpu-68000: add missing endian code
author
Alan Cox
<alan@linux.intel.com>
Tue, 30 Aug 2016 19:39:37 +0000
(20:39 +0100)
committer
Alan Cox
<alan@linux.intel.com>
Tue, 30 Aug 2016 19:39:37 +0000
(20:39 +0100)
Kernel/cpu-68000/cpu.h
patch
|
blob
|
history
diff --git
a/Kernel/cpu-68000/cpu.h
b/Kernel/cpu-68000/cpu.h
index
6453530
..
fd07454
100644
(file)
--- 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