summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@pefoley.com>2014-09-25 14:23:32 -0400
committerJiri Kosina <jkosina@suse.cz>2014-09-26 05:02:58 -0400
commit8c2b0dc83d9840da4d993a5dbb15c5974ad5a188 (patch)
treed1750009baa6051f3aec12087baad8700af7e3b5
parent19f94f97003a70a5241efff035f6c181c290a799 (diff)
Documentation: support glibc versions without htole macros
glibc 2.9 introduced the htole<16/32/64> macros, add them to tools/include to support older versions of glibc. Reported-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Peter Foley <pefoley2@pefoley.com> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--Documentation/arm/SH-Mobile/Makefile2
-rw-r--r--Documentation/arm/SH-Mobile/vrl4.c1
-rw-r--r--Documentation/mic/mpssd/Makefile2
-rw-r--r--Documentation/mic/mpssd/mpssd.c1
-rw-r--r--tools/include/tools/endian.h32
5 files changed, 36 insertions, 2 deletions
diff --git a/Documentation/arm/SH-Mobile/Makefile b/Documentation/arm/SH-Mobile/Makefile
index ac8075dcfddc..bca8a7ef6bbe 100644
--- a/Documentation/arm/SH-Mobile/Makefile
+++ b/Documentation/arm/SH-Mobile/Makefile
@@ -4,4 +4,4 @@ hostprogs-y := vrl4
4# Tell kbuild to always build the programs 4# Tell kbuild to always build the programs
5always := $(hostprogs-y) 5always := $(hostprogs-y)
6 6
7HOSTCFLAGS_vrl4.o += -I$(objtree)/usr/include 7HOSTCFLAGS_vrl4.o += -I$(objtree)/usr/include -I$(srctree)/tools/include
diff --git a/Documentation/arm/SH-Mobile/vrl4.c b/Documentation/arm/SH-Mobile/vrl4.c
index 4cbbba58f3d2..f4cd8ad4e720 100644
--- a/Documentation/arm/SH-Mobile/vrl4.c
+++ b/Documentation/arm/SH-Mobile/vrl4.c
@@ -34,6 +34,7 @@
34#include <stdint.h> 34#include <stdint.h>
35#include <stdio.h> 35#include <stdio.h>
36#include <errno.h> 36#include <errno.h>
37#include <tools/endian.h>
37 38
38struct hdr { 39struct hdr {
39 uint32_t magic1; 40 uint32_t magic1;
diff --git a/Documentation/mic/mpssd/Makefile b/Documentation/mic/mpssd/Makefile
index aaa89d137c1a..505d84f1825d 100644
--- a/Documentation/mic/mpssd/Makefile
+++ b/Documentation/mic/mpssd/Makefile
@@ -6,7 +6,7 @@ mpssd-objs := mpssd.o sysfs.o
6# Tell kbuild to always build the programs 6# Tell kbuild to always build the programs
7always := $(hostprogs-y) 7always := $(hostprogs-y)
8 8
9HOSTCFLAGS_mpssd.o += -I$(objtree)/usr/include 9HOSTCFLAGS_mpssd.o += -I$(objtree)/usr/include -I$(srctree)/tools/include
10 10
11ifdef DEBUG 11ifdef DEBUG
12HOSTCFLAGS += -DDEBUG=$(DEBUG) 12HOSTCFLAGS += -DDEBUG=$(DEBUG)
diff --git a/Documentation/mic/mpssd/mpssd.c b/Documentation/mic/mpssd/mpssd.c
index 24203ddba924..3c5c379fc29d 100644
--- a/Documentation/mic/mpssd/mpssd.c
+++ b/Documentation/mic/mpssd/mpssd.c
@@ -41,6 +41,7 @@
41#include "mpssd.h" 41#include "mpssd.h"
42#include <linux/mic_ioctl.h> 42#include <linux/mic_ioctl.h>
43#include <linux/mic_common.h> 43#include <linux/mic_common.h>
44#include <tools/endian.h>
44 45
45static void init_mic(struct mic_info *mic); 46static void init_mic(struct mic_info *mic);
46 47
diff --git a/tools/include/tools/endian.h b/tools/include/tools/endian.h
new file mode 100644
index 000000000000..5d42e20ab83d
--- /dev/null
+++ b/tools/include/tools/endian.h
@@ -0,0 +1,32 @@
1#ifndef _TOOLS_ENDIAN_H
2#define _TOOLS_ENDIAN_H
3
4#include <byteswap.h>
5
6#if __BYTE_ORDER == __LITTLE_ENDIAN
7
8#ifndef htole16
9#define htole16(x) (x)
10#endif
11#ifndef htole32
12#define htole32(x) (x)
13#endif
14#ifndef htole64
15#define htole64(x) (x)
16#endif
17
18#else /* __BYTE_ORDER */
19
20#ifndef htole16
21#define htole16(x) __bswap_16(x)
22#endif
23#ifndef htole32
24#define htole32(x) __bswap_32(x)
25#endif
26#ifndef htole64
27#define htole64(x) __bswap_64(x)
28#endif
29
30#endif
31
32#endif /* _TOOLS_ENDIAN_H */