[stgt] [PATCH 03/11] util.h BSD builds support
Boaz Harrosh
bharrosh at panasas.com
Thu Mar 12 12:00:57 CET 2009
include sys/syscall.h instead of syscall.h
Also define, used by code, __le32_to_cpu()
Signed-off-by: Boaz Harrosh <bharrosh at panasas.com>
---
usr/util.h | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/usr/util.h b/usr/util.h
index 794c70b..419f648 100644
--- a/usr/util.h
+++ b/usr/util.h
@@ -2,7 +2,7 @@
#define __UTIL_H__
#include <byteswap.h>
-#include <syscall.h>
+#include <sys/syscall.h>
#include <unistd.h>
#include <errno.h>
#include <endian.h>
@@ -13,22 +13,30 @@
#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
#if __BYTE_ORDER == __LITTLE_ENDIAN
+
#define __cpu_to_be16(x) bswap_16(x)
#define __cpu_to_be32(x) bswap_32(x)
#define __cpu_to_be64(x) bswap_64(x)
#define __be16_to_cpu(x) bswap_16(x)
#define __be32_to_cpu(x) bswap_32(x)
#define __be64_to_cpu(x) bswap_64(x)
+
#define __cpu_to_le32(x) (x)
-#else
+#define __le32_to_cpu(x) (x)
+
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
+
#define __cpu_to_be16(x) (x)
#define __cpu_to_be32(x) (x)
#define __cpu_to_be64(x) (x)
#define __be16_to_cpu(x) (x)
#define __be32_to_cpu(x) (x)
#define __be64_to_cpu(x) (x)
+
#define __cpu_to_le32(x) bswap_32(x)
-#endif
+#define __le32_to_cpu(x) bswap_32(x)
+
+#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */
#define DEFDMODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
#define DEFFMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
--
1.6.0.6
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list