kernel: add support for 3.9-rc2
[openwrt/openwrt.git] / target / linux / generic / patches-3.9 / 212-byteshift_portability.patch
1 --- a/tools/include/tools/be_byteshift.h
2 +++ b/tools/include/tools/be_byteshift.h
3 @@ -1,7 +1,11 @@
4 #ifndef _TOOLS_BE_BYTESHIFT_H
5 #define _TOOLS_BE_BYTESHIFT_H
6
7 +#ifdef __linux__
8 #include <linux/types.h>
9 +#else
10 +#include "linux_types.h"
11 +#endif
12
13 static inline __u16 __get_unaligned_be16(const __u8 *p)
14 {
15 --- a/tools/include/tools/le_byteshift.h
16 +++ b/tools/include/tools/le_byteshift.h
17 @@ -1,7 +1,11 @@
18 #ifndef _TOOLS_LE_BYTESHIFT_H
19 #define _TOOLS_LE_BYTESHIFT_H
20
21 +#ifdef __linux__
22 #include <linux/types.h>
23 +#else
24 +#include "linux_types.h"
25 +#endif
26
27 static inline __u16 __get_unaligned_le16(const __u8 *p)
28 {
29 --- /dev/null
30 +++ b/tools/include/tools/linux_types.h
31 @@ -0,0 +1,22 @@
32 +#ifndef __LINUX_TYPES_H
33 +#define __LINUX_TYPES_H
34 +
35 +#include <stdint.h>
36 +
37 +typedef uint8_t __u8;
38 +typedef uint8_t __be8;
39 +typedef uint8_t __le8;
40 +
41 +typedef uint16_t __u16;
42 +typedef uint16_t __be16;
43 +typedef uint16_t __le16;
44 +
45 +typedef uint32_t __u32;
46 +typedef uint32_t __be32;
47 +typedef uint32_t __le32;
48 +
49 +typedef uint64_t __u64;
50 +typedef uint64_t __be64;
51 +typedef uint64_t __le64;
52 +
53 +#endif