cpu-z80: add ntohl
authorAlan Cox <alan@linux.intel.com>
Wed, 13 Jan 2016 18:39:55 +0000 (18:39 +0000)
committerAlan Cox <alan@linux.intel.com>
Wed, 13 Jan 2016 18:39:55 +0000 (18:39 +0000)
Kernel/cpu-z80/cpu.h

index 9e5fe12..6c18da1 100644 (file)
@@ -82,3 +82,5 @@ typedef union {            /* this structure is endian dependent */
 #define COMMON_MEMORY   static void COMMONSEG(void)  __naked { __asm .area _COMMONMEM __endasm; }
 
 #define ntohs(x)       ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8))
+#define ntohl(x)       ((((x) & 0xFF) << 24) | (((x) & 0xFF00) << 8) | \
+                         (((x) & 0xFF0000) >> 8) | (((x >> 24) & 0xFF)))