patch-2.4.0-test10 linux/include/linux/byteorder/swabb.h
Next file: linux/include/linux/coda_linux.h
Previous file: linux/include/linux/byteorder/swab.h
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
Mon Oct 16 13:36:08 2000
- Orig file:
v2.4.0-test9/linux/include/linux/byteorder/swabb.h
- Orig date:
Tue Sep 1 10:50:11 1998
diff -u --recursive --new-file v2.4.0-test9/linux/include/linux/byteorder/swabb.h linux/include/linux/byteorder/swabb.h
@@ -25,12 +25,26 @@
*
*/
-
#define ___swahw32(x) \
+({ \
+ __u32 __x = (x); \
+ ((__u32)( \
+ (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \
+ (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); \
+})
+#define ___swahb32(x) \
+({ \
+ __u32 __x = (x); \
+ ((__u32)( \
+ (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \
+ (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )) \
+})
+
+#define ___constant_swahw32(x) \
((__u32)( \
(((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
(((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
-#define ___swahb32(x) \
+#define ___constant_swahb32(x) \
((__u32)( \
(((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
(((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)