diff options
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/bitops.h | 3 | ||||
-rw-r--r-- | include/asm-generic/bitops/ext2-atomic.h | 4 | ||||
-rw-r--r-- | include/asm-generic/bitops/ext2-non-atomic.h | 20 | ||||
-rw-r--r-- | include/asm-generic/bitops/le.h | 89 | ||||
-rw-r--r-- | include/asm-generic/bitops/minix-le.h | 17 | ||||
-rw-r--r-- | include/asm-generic/bitops/minix.h | 15 | ||||
-rw-r--r-- | include/asm-generic/bug.h | 28 | ||||
-rw-r--r-- | include/asm-generic/cputime.h | 3 | ||||
-rw-r--r-- | include/asm-generic/errno.h | 2 | ||||
-rw-r--r-- | include/asm-generic/fcntl.h | 4 | ||||
-rw-r--r-- | include/asm-generic/ftrace.h | 16 | ||||
-rw-r--r-- | include/asm-generic/futex.h | 7 | ||||
-rw-r--r-- | include/asm-generic/io.h | 33 | ||||
-rw-r--r-- | include/asm-generic/ioctls.h | 1 | ||||
-rw-r--r-- | include/asm-generic/pgtable.h | 2 | ||||
-rw-r--r-- | include/asm-generic/sections.h | 1 | ||||
-rw-r--r-- | include/asm-generic/sizes.h | 47 | ||||
-rw-r--r-- | include/asm-generic/types.h | 27 | ||||
-rw-r--r-- | include/asm-generic/uaccess.h | 8 | ||||
-rw-r--r-- | include/asm-generic/unistd.h | 10 | ||||
-rw-r--r-- | include/asm-generic/user.h | 4 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 72 |
22 files changed, 248 insertions, 165 deletions
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h index a54f4421a24d..280ca7a96f75 100644 --- a/include/asm-generic/bitops.h +++ b/include/asm-generic/bitops.h | |||
@@ -38,8 +38,7 @@ | |||
38 | 38 | ||
39 | #include <asm-generic/bitops/atomic.h> | 39 | #include <asm-generic/bitops/atomic.h> |
40 | #include <asm-generic/bitops/non-atomic.h> | 40 | #include <asm-generic/bitops/non-atomic.h> |
41 | #include <asm-generic/bitops/ext2-non-atomic.h> | 41 | #include <asm-generic/bitops/le.h> |
42 | #include <asm-generic/bitops/ext2-atomic.h> | 42 | #include <asm-generic/bitops/ext2-atomic.h> |
43 | #include <asm-generic/bitops/minix.h> | ||
44 | 43 | ||
45 | #endif /* __ASM_GENERIC_BITOPS_H */ | 44 | #endif /* __ASM_GENERIC_BITOPS_H */ |
diff --git a/include/asm-generic/bitops/ext2-atomic.h b/include/asm-generic/bitops/ext2-atomic.h index ab1c875efb74..ecf1c9d8a7cc 100644 --- a/include/asm-generic/bitops/ext2-atomic.h +++ b/include/asm-generic/bitops/ext2-atomic.h | |||
@@ -5,7 +5,7 @@ | |||
5 | ({ \ | 5 | ({ \ |
6 | int ret; \ | 6 | int ret; \ |
7 | spin_lock(lock); \ | 7 | spin_lock(lock); \ |
8 | ret = ext2_set_bit((nr), (unsigned long *)(addr)); \ | 8 | ret = __test_and_set_bit_le(nr, addr); \ |
9 | spin_unlock(lock); \ | 9 | spin_unlock(lock); \ |
10 | ret; \ | 10 | ret; \ |
11 | }) | 11 | }) |
@@ -14,7 +14,7 @@ | |||
14 | ({ \ | 14 | ({ \ |
15 | int ret; \ | 15 | int ret; \ |
16 | spin_lock(lock); \ | 16 | spin_lock(lock); \ |
17 | ret = ext2_clear_bit((nr), (unsigned long *)(addr)); \ | 17 | ret = __test_and_clear_bit_le(nr, addr); \ |
18 | spin_unlock(lock); \ | 18 | spin_unlock(lock); \ |
19 | ret; \ | 19 | ret; \ |
20 | }) | 20 | }) |
diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h deleted file mode 100644 index 63cf822431a2..000000000000 --- a/include/asm-generic/bitops/ext2-non-atomic.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ | ||
2 | #define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ | ||
3 | |||
4 | #include <asm-generic/bitops/le.h> | ||
5 | |||
6 | #define ext2_set_bit(nr,addr) \ | ||
7 | generic___test_and_set_le_bit((nr),(unsigned long *)(addr)) | ||
8 | #define ext2_clear_bit(nr,addr) \ | ||
9 | generic___test_and_clear_le_bit((nr),(unsigned long *)(addr)) | ||
10 | |||
11 | #define ext2_test_bit(nr,addr) \ | ||
12 | generic_test_le_bit((nr),(unsigned long *)(addr)) | ||
13 | #define ext2_find_first_zero_bit(addr, size) \ | ||
14 | generic_find_first_zero_le_bit((unsigned long *)(addr), (size)) | ||
15 | #define ext2_find_next_zero_bit(addr, size, off) \ | ||
16 | generic_find_next_zero_le_bit((unsigned long *)(addr), (size), (off)) | ||
17 | #define ext2_find_next_bit(addr, size, off) \ | ||
18 | generic_find_next_le_bit((unsigned long *)(addr), (size), (off)) | ||
19 | |||
20 | #endif /* _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ */ | ||
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h index 80e3bf13b2b9..946a21b1b5dc 100644 --- a/include/asm-generic/bitops/le.h +++ b/include/asm-generic/bitops/le.h | |||
@@ -4,54 +4,77 @@ | |||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | #include <asm/byteorder.h> | 5 | #include <asm/byteorder.h> |
6 | 6 | ||
7 | #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) | ||
8 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) | ||
9 | |||
10 | #if defined(__LITTLE_ENDIAN) | 7 | #if defined(__LITTLE_ENDIAN) |
11 | 8 | ||
12 | #define generic_test_le_bit(nr, addr) test_bit(nr, addr) | 9 | #define BITOP_LE_SWIZZLE 0 |
13 | #define generic___set_le_bit(nr, addr) __set_bit(nr, addr) | ||
14 | #define generic___clear_le_bit(nr, addr) __clear_bit(nr, addr) | ||
15 | 10 | ||
16 | #define generic_test_and_set_le_bit(nr, addr) test_and_set_bit(nr, addr) | 11 | static inline unsigned long find_next_zero_bit_le(const void *addr, |
17 | #define generic_test_and_clear_le_bit(nr, addr) test_and_clear_bit(nr, addr) | 12 | unsigned long size, unsigned long offset) |
13 | { | ||
14 | return find_next_zero_bit(addr, size, offset); | ||
15 | } | ||
18 | 16 | ||
19 | #define generic___test_and_set_le_bit(nr, addr) __test_and_set_bit(nr, addr) | 17 | static inline unsigned long find_next_bit_le(const void *addr, |
20 | #define generic___test_and_clear_le_bit(nr, addr) __test_and_clear_bit(nr, addr) | 18 | unsigned long size, unsigned long offset) |
19 | { | ||
20 | return find_next_bit(addr, size, offset); | ||
21 | } | ||
21 | 22 | ||
22 | #define generic_find_next_zero_le_bit(addr, size, offset) find_next_zero_bit(addr, size, offset) | 23 | static inline unsigned long find_first_zero_bit_le(const void *addr, |
23 | #define generic_find_next_le_bit(addr, size, offset) \ | 24 | unsigned long size) |
24 | find_next_bit(addr, size, offset) | 25 | { |
26 | return find_first_zero_bit(addr, size); | ||
27 | } | ||
25 | 28 | ||
26 | #elif defined(__BIG_ENDIAN) | 29 | #elif defined(__BIG_ENDIAN) |
27 | 30 | ||
28 | #define generic_test_le_bit(nr, addr) \ | 31 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) |
29 | test_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | ||
30 | #define generic___set_le_bit(nr, addr) \ | ||
31 | __set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | ||
32 | #define generic___clear_le_bit(nr, addr) \ | ||
33 | __clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | ||
34 | |||
35 | #define generic_test_and_set_le_bit(nr, addr) \ | ||
36 | test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | ||
37 | #define generic_test_and_clear_le_bit(nr, addr) \ | ||
38 | test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | ||
39 | |||
40 | #define generic___test_and_set_le_bit(nr, addr) \ | ||
41 | __test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | ||
42 | #define generic___test_and_clear_le_bit(nr, addr) \ | ||
43 | __test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | ||
44 | 32 | ||
45 | extern unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, | 33 | extern unsigned long find_next_zero_bit_le(const void *addr, |
46 | unsigned long size, unsigned long offset); | 34 | unsigned long size, unsigned long offset); |
47 | extern unsigned long generic_find_next_le_bit(const unsigned long *addr, | 35 | extern unsigned long find_next_bit_le(const void *addr, |
48 | unsigned long size, unsigned long offset); | 36 | unsigned long size, unsigned long offset); |
49 | 37 | ||
38 | #define find_first_zero_bit_le(addr, size) \ | ||
39 | find_next_zero_bit_le((addr), (size), 0) | ||
40 | |||
50 | #else | 41 | #else |
51 | #error "Please fix <asm/byteorder.h>" | 42 | #error "Please fix <asm/byteorder.h>" |
52 | #endif | 43 | #endif |
53 | 44 | ||
54 | #define generic_find_first_zero_le_bit(addr, size) \ | 45 | static inline int test_bit_le(int nr, const void *addr) |
55 | generic_find_next_zero_le_bit((addr), (size), 0) | 46 | { |
47 | return test_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
48 | } | ||
49 | |||
50 | static inline void __set_bit_le(int nr, void *addr) | ||
51 | { | ||
52 | __set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
53 | } | ||
54 | |||
55 | static inline void __clear_bit_le(int nr, void *addr) | ||
56 | { | ||
57 | __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
58 | } | ||
59 | |||
60 | static inline int test_and_set_bit_le(int nr, void *addr) | ||
61 | { | ||
62 | return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
63 | } | ||
64 | |||
65 | static inline int test_and_clear_bit_le(int nr, void *addr) | ||
66 | { | ||
67 | return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
68 | } | ||
69 | |||
70 | static inline int __test_and_set_bit_le(int nr, void *addr) | ||
71 | { | ||
72 | return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
73 | } | ||
74 | |||
75 | static inline int __test_and_clear_bit_le(int nr, void *addr) | ||
76 | { | ||
77 | return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
78 | } | ||
56 | 79 | ||
57 | #endif /* _ASM_GENERIC_BITOPS_LE_H_ */ | 80 | #endif /* _ASM_GENERIC_BITOPS_LE_H_ */ |
diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h deleted file mode 100644 index 4a981c1bb1ae..000000000000 --- a/include/asm-generic/bitops/minix-le.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_MINIX_LE_H_ | ||
2 | #define _ASM_GENERIC_BITOPS_MINIX_LE_H_ | ||
3 | |||
4 | #include <asm-generic/bitops/le.h> | ||
5 | |||
6 | #define minix_test_and_set_bit(nr,addr) \ | ||
7 | generic___test_and_set_le_bit((nr),(unsigned long *)(addr)) | ||
8 | #define minix_set_bit(nr,addr) \ | ||
9 | generic___set_le_bit((nr),(unsigned long *)(addr)) | ||
10 | #define minix_test_and_clear_bit(nr,addr) \ | ||
11 | generic___test_and_clear_le_bit((nr),(unsigned long *)(addr)) | ||
12 | #define minix_test_bit(nr,addr) \ | ||
13 | generic_test_le_bit((nr),(unsigned long *)(addr)) | ||
14 | #define minix_find_first_zero_bit(addr,size) \ | ||
15 | generic_find_first_zero_le_bit((unsigned long *)(addr),(size)) | ||
16 | |||
17 | #endif /* _ASM_GENERIC_BITOPS_MINIX_LE_H_ */ | ||
diff --git a/include/asm-generic/bitops/minix.h b/include/asm-generic/bitops/minix.h deleted file mode 100644 index 91f42e87aa51..000000000000 --- a/include/asm-generic/bitops/minix.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_MINIX_H_ | ||
2 | #define _ASM_GENERIC_BITOPS_MINIX_H_ | ||
3 | |||
4 | #define minix_test_and_set_bit(nr,addr) \ | ||
5 | __test_and_set_bit((nr),(unsigned long *)(addr)) | ||
6 | #define minix_set_bit(nr,addr) \ | ||
7 | __set_bit((nr),(unsigned long *)(addr)) | ||
8 | #define minix_test_and_clear_bit(nr,addr) \ | ||
9 | __test_and_clear_bit((nr),(unsigned long *)(addr)) | ||
10 | #define minix_test_bit(nr,addr) \ | ||
11 | test_bit((nr),(unsigned long *)(addr)) | ||
12 | #define minix_find_first_zero_bit(addr,size) \ | ||
13 | find_first_zero_bit((unsigned long *)(addr),(size)) | ||
14 | |||
15 | #endif /* _ASM_GENERIC_BITOPS_MINIX_H_ */ | ||
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index c2c9ba032d46..f2d2faf4d9ae 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -165,10 +165,36 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
165 | #define WARN_ON_RATELIMIT(condition, state) \ | 165 | #define WARN_ON_RATELIMIT(condition, state) \ |
166 | WARN_ON((condition) && __ratelimit(state)) | 166 | WARN_ON((condition) && __ratelimit(state)) |
167 | 167 | ||
168 | /* | ||
169 | * WARN_ON_SMP() is for cases that the warning is either | ||
170 | * meaningless for !SMP or may even cause failures. | ||
171 | * This is usually used for cases that we have | ||
172 | * WARN_ON(!spin_is_locked(&lock)) checks, as spin_is_locked() | ||
173 | * returns 0 for uniprocessor settings. | ||
174 | * It can also be used with values that are only defined | ||
175 | * on SMP: | ||
176 | * | ||
177 | * struct foo { | ||
178 | * [...] | ||
179 | * #ifdef CONFIG_SMP | ||
180 | * int bar; | ||
181 | * #endif | ||
182 | * }; | ||
183 | * | ||
184 | * void func(struct foo *zoot) | ||
185 | * { | ||
186 | * WARN_ON_SMP(!zoot->bar); | ||
187 | * | ||
188 | * For CONFIG_SMP, WARN_ON_SMP() should act the same as WARN_ON(), | ||
189 | * and should be a nop and return false for uniprocessor. | ||
190 | * | ||
191 | * if (WARN_ON_SMP(x)) returns true only when CONFIG_SMP is set | ||
192 | * and x is true. | ||
193 | */ | ||
168 | #ifdef CONFIG_SMP | 194 | #ifdef CONFIG_SMP |
169 | # define WARN_ON_SMP(x) WARN_ON(x) | 195 | # define WARN_ON_SMP(x) WARN_ON(x) |
170 | #else | 196 | #else |
171 | # define WARN_ON_SMP(x) do { } while (0) | 197 | # define WARN_ON_SMP(x) ({0;}) |
172 | #endif | 198 | #endif |
173 | 199 | ||
174 | #endif | 200 | #endif |
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h index 2bcc5c7c22a6..61e03dd7939e 100644 --- a/include/asm-generic/cputime.h +++ b/include/asm-generic/cputime.h | |||
@@ -30,6 +30,9 @@ typedef u64 cputime64_t; | |||
30 | #define cputime64_to_jiffies64(__ct) (__ct) | 30 | #define cputime64_to_jiffies64(__ct) (__ct) |
31 | #define jiffies64_to_cputime64(__jif) (__jif) | 31 | #define jiffies64_to_cputime64(__jif) (__jif) |
32 | #define cputime_to_cputime64(__ct) ((u64) __ct) | 32 | #define cputime_to_cputime64(__ct) ((u64) __ct) |
33 | #define cputime64_gt(__a, __b) ((__a) > (__b)) | ||
34 | |||
35 | #define nsecs_to_cputime64(__ct) nsecs_to_jiffies64(__ct) | ||
33 | 36 | ||
34 | 37 | ||
35 | /* | 38 | /* |
diff --git a/include/asm-generic/errno.h b/include/asm-generic/errno.h index 28cc03bf19e6..a1331ce50445 100644 --- a/include/asm-generic/errno.h +++ b/include/asm-generic/errno.h | |||
@@ -108,4 +108,6 @@ | |||
108 | 108 | ||
109 | #define ERFKILL 132 /* Operation not possible due to RF-kill */ | 109 | #define ERFKILL 132 /* Operation not possible due to RF-kill */ |
110 | 110 | ||
111 | #define EHWPOISON 133 /* Memory page has hardware error */ | ||
112 | |||
111 | #endif | 113 | #endif |
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index 0fc16e3f0bfc..84793c7025e2 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h | |||
@@ -80,6 +80,10 @@ | |||
80 | #define O_SYNC (__O_SYNC|O_DSYNC) | 80 | #define O_SYNC (__O_SYNC|O_DSYNC) |
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #ifndef O_PATH | ||
84 | #define O_PATH 010000000 | ||
85 | #endif | ||
86 | |||
83 | #ifndef O_NDELAY | 87 | #ifndef O_NDELAY |
84 | #define O_NDELAY O_NONBLOCK | 88 | #define O_NDELAY O_NONBLOCK |
85 | #endif | 89 | #endif |
diff --git a/include/asm-generic/ftrace.h b/include/asm-generic/ftrace.h new file mode 100644 index 000000000000..51abba9ea7ad --- /dev/null +++ b/include/asm-generic/ftrace.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * linux/include/asm-generic/ftrace.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_GENERIC_FTRACE_H__ | ||
9 | #define __ASM_GENERIC_FTRACE_H__ | ||
10 | |||
11 | /* | ||
12 | * Not all architectures need their own ftrace.h, the most | ||
13 | * common definitions are already in linux/ftrace.h. | ||
14 | */ | ||
15 | |||
16 | #endif /* __ASM_GENERIC_FTRACE_H__ */ | ||
diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h index 3c2344f48136..01f227e14254 100644 --- a/include/asm-generic/futex.h +++ b/include/asm-generic/futex.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <asm/errno.h> | 6 | #include <asm/errno.h> |
7 | 7 | ||
8 | static inline int | 8 | static inline int |
9 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | 9 | futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) |
10 | { | 10 | { |
11 | int op = (encoded_op >> 28) & 7; | 11 | int op = (encoded_op >> 28) & 7; |
12 | int cmp = (encoded_op >> 24) & 15; | 12 | int cmp = (encoded_op >> 24) & 15; |
@@ -16,7 +16,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
16 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 16 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
17 | oparg = 1 << oparg; | 17 | oparg = 1 << oparg; |
18 | 18 | ||
19 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | 19 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(u32))) |
20 | return -EFAULT; | 20 | return -EFAULT; |
21 | 21 | ||
22 | pagefault_disable(); | 22 | pagefault_disable(); |
@@ -48,7 +48,8 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
48 | } | 48 | } |
49 | 49 | ||
50 | static inline int | 50 | static inline int |
51 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | 51 | futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
52 | u32 oldval, u32 newval) | ||
52 | { | 53 | { |
53 | return -ENOSYS; | 54 | return -ENOSYS; |
54 | } | 55 | } |
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 4644c9a7f724..e0ffa3ddb02a 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -94,6 +94,10 @@ static inline void __raw_writeq(u64 b, volatile void __iomem *addr) | |||
94 | #define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr) | 94 | #define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr) |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | #ifndef PCI_IOBASE | ||
98 | #define PCI_IOBASE ((void __iomem *) 0) | ||
99 | #endif | ||
100 | |||
97 | /*****************************************************************************/ | 101 | /*****************************************************************************/ |
98 | /* | 102 | /* |
99 | * traditional input/output functions | 103 | * traditional input/output functions |
@@ -101,32 +105,32 @@ static inline void __raw_writeq(u64 b, volatile void __iomem *addr) | |||
101 | 105 | ||
102 | static inline u8 inb(unsigned long addr) | 106 | static inline u8 inb(unsigned long addr) |
103 | { | 107 | { |
104 | return readb((volatile void __iomem *) addr); | 108 | return readb(addr + PCI_IOBASE); |
105 | } | 109 | } |
106 | 110 | ||
107 | static inline u16 inw(unsigned long addr) | 111 | static inline u16 inw(unsigned long addr) |
108 | { | 112 | { |
109 | return readw((volatile void __iomem *) addr); | 113 | return readw(addr + PCI_IOBASE); |
110 | } | 114 | } |
111 | 115 | ||
112 | static inline u32 inl(unsigned long addr) | 116 | static inline u32 inl(unsigned long addr) |
113 | { | 117 | { |
114 | return readl((volatile void __iomem *) addr); | 118 | return readl(addr + PCI_IOBASE); |
115 | } | 119 | } |
116 | 120 | ||
117 | static inline void outb(u8 b, unsigned long addr) | 121 | static inline void outb(u8 b, unsigned long addr) |
118 | { | 122 | { |
119 | writeb(b, (volatile void __iomem *) addr); | 123 | writeb(b, addr + PCI_IOBASE); |
120 | } | 124 | } |
121 | 125 | ||
122 | static inline void outw(u16 b, unsigned long addr) | 126 | static inline void outw(u16 b, unsigned long addr) |
123 | { | 127 | { |
124 | writew(b, (volatile void __iomem *) addr); | 128 | writew(b, addr + PCI_IOBASE); |
125 | } | 129 | } |
126 | 130 | ||
127 | static inline void outl(u32 b, unsigned long addr) | 131 | static inline void outl(u32 b, unsigned long addr) |
128 | { | 132 | { |
129 | writel(b, (volatile void __iomem *) addr); | 133 | writel(b, addr + PCI_IOBASE); |
130 | } | 134 | } |
131 | 135 | ||
132 | #define inb_p(addr) inb(addr) | 136 | #define inb_p(addr) inb(addr) |
@@ -213,32 +217,32 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
213 | 217 | ||
214 | static inline void readsl(const void __iomem *addr, void *buf, int len) | 218 | static inline void readsl(const void __iomem *addr, void *buf, int len) |
215 | { | 219 | { |
216 | insl((unsigned long)addr, buf, len); | 220 | insl(addr - PCI_IOBASE, buf, len); |
217 | } | 221 | } |
218 | 222 | ||
219 | static inline void readsw(const void __iomem *addr, void *buf, int len) | 223 | static inline void readsw(const void __iomem *addr, void *buf, int len) |
220 | { | 224 | { |
221 | insw((unsigned long)addr, buf, len); | 225 | insw(addr - PCI_IOBASE, buf, len); |
222 | } | 226 | } |
223 | 227 | ||
224 | static inline void readsb(const void __iomem *addr, void *buf, int len) | 228 | static inline void readsb(const void __iomem *addr, void *buf, int len) |
225 | { | 229 | { |
226 | insb((unsigned long)addr, buf, len); | 230 | insb(addr - PCI_IOBASE, buf, len); |
227 | } | 231 | } |
228 | 232 | ||
229 | static inline void writesl(const void __iomem *addr, const void *buf, int len) | 233 | static inline void writesl(const void __iomem *addr, const void *buf, int len) |
230 | { | 234 | { |
231 | outsl((unsigned long)addr, buf, len); | 235 | outsl(addr - PCI_IOBASE, buf, len); |
232 | } | 236 | } |
233 | 237 | ||
234 | static inline void writesw(const void __iomem *addr, const void *buf, int len) | 238 | static inline void writesw(const void __iomem *addr, const void *buf, int len) |
235 | { | 239 | { |
236 | outsw((unsigned long)addr, buf, len); | 240 | outsw(addr - PCI_IOBASE, buf, len); |
237 | } | 241 | } |
238 | 242 | ||
239 | static inline void writesb(const void __iomem *addr, const void *buf, int len) | 243 | static inline void writesb(const void __iomem *addr, const void *buf, int len) |
240 | { | 244 | { |
241 | outsb((unsigned long)addr, buf, len); | 245 | outsb(addr - PCI_IOBASE, buf, len); |
242 | } | 246 | } |
243 | 247 | ||
244 | #ifndef CONFIG_GENERIC_IOMAP | 248 | #ifndef CONFIG_GENERIC_IOMAP |
@@ -269,8 +273,9 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) | |||
269 | outsl((unsigned long) (p), (src), (count)) | 273 | outsl((unsigned long) (p), (src), (count)) |
270 | #endif /* CONFIG_GENERIC_IOMAP */ | 274 | #endif /* CONFIG_GENERIC_IOMAP */ |
271 | 275 | ||
272 | 276 | #ifndef IO_SPACE_LIMIT | |
273 | #define IO_SPACE_LIMIT 0xffffffff | 277 | #define IO_SPACE_LIMIT 0xffff |
278 | #endif | ||
274 | 279 | ||
275 | #ifdef __KERNEL__ | 280 | #ifdef __KERNEL__ |
276 | 281 | ||
diff --git a/include/asm-generic/ioctls.h b/include/asm-generic/ioctls.h index 3f3f2d189fb8..199975fac395 100644 --- a/include/asm-generic/ioctls.h +++ b/include/asm-generic/ioctls.h | |||
@@ -73,6 +73,7 @@ | |||
73 | #define TCSETXF 0x5434 | 73 | #define TCSETXF 0x5434 |
74 | #define TCSETXW 0x5435 | 74 | #define TCSETXW 0x5435 |
75 | #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ | 75 | #define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ |
76 | #define TIOCVHANGUP 0x5437 | ||
76 | 77 | ||
77 | #define FIONCLEX 0x5450 | 78 | #define FIONCLEX 0x5450 |
78 | #define FIOCLEX 0x5451 | 79 | #define FIOCLEX 0x5451 |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 31b6188df221..b4bfe338ea0e 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -4,6 +4,8 @@ | |||
4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
5 | #ifdef CONFIG_MMU | 5 | #ifdef CONFIG_MMU |
6 | 6 | ||
7 | #include <linux/mm_types.h> | ||
8 | |||
7 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 9 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
8 | extern int ptep_set_access_flags(struct vm_area_struct *vma, | 10 | extern int ptep_set_access_flags(struct vm_area_struct *vma, |
9 | unsigned long address, pte_t *ptep, | 11 | unsigned long address, pte_t *ptep, |
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index b3bfabc258f3..c1a1216e29ce 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -11,6 +11,7 @@ extern char _sinittext[], _einittext[]; | |||
11 | extern char _end[]; | 11 | extern char _end[]; |
12 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; | 12 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; |
13 | extern char __kprobes_text_start[], __kprobes_text_end[]; | 13 | extern char __kprobes_text_start[], __kprobes_text_end[]; |
14 | extern char __entry_text_start[], __entry_text_end[]; | ||
14 | extern char __initdata_begin[], __initdata_end[]; | 15 | extern char __initdata_begin[], __initdata_end[]; |
15 | extern char __start_rodata[], __end_rodata[]; | 16 | extern char __start_rodata[], __end_rodata[]; |
16 | 17 | ||
diff --git a/include/asm-generic/sizes.h b/include/asm-generic/sizes.h new file mode 100644 index 000000000000..ea5d4ef81061 --- /dev/null +++ b/include/asm-generic/sizes.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * linux/include/asm-generic/sizes.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_GENERIC_SIZES_H__ | ||
9 | #define __ASM_GENERIC_SIZES_H__ | ||
10 | |||
11 | #define SZ_1 0x00000001 | ||
12 | #define SZ_2 0x00000002 | ||
13 | #define SZ_4 0x00000004 | ||
14 | #define SZ_8 0x00000008 | ||
15 | #define SZ_16 0x00000010 | ||
16 | #define SZ_32 0x00000020 | ||
17 | #define SZ_64 0x00000040 | ||
18 | #define SZ_128 0x00000080 | ||
19 | #define SZ_256 0x00000100 | ||
20 | #define SZ_512 0x00000200 | ||
21 | |||
22 | #define SZ_1K 0x00000400 | ||
23 | #define SZ_2K 0x00000800 | ||
24 | #define SZ_4K 0x00001000 | ||
25 | #define SZ_8K 0x00002000 | ||
26 | #define SZ_16K 0x00004000 | ||
27 | #define SZ_32K 0x00008000 | ||
28 | #define SZ_64K 0x00010000 | ||
29 | #define SZ_128K 0x00020000 | ||
30 | #define SZ_256K 0x00040000 | ||
31 | #define SZ_512K 0x00080000 | ||
32 | |||
33 | #define SZ_1M 0x00100000 | ||
34 | #define SZ_2M 0x00200000 | ||
35 | #define SZ_4M 0x00400000 | ||
36 | #define SZ_8M 0x00800000 | ||
37 | #define SZ_16M 0x01000000 | ||
38 | #define SZ_32M 0x02000000 | ||
39 | #define SZ_64M 0x04000000 | ||
40 | #define SZ_128M 0x08000000 | ||
41 | #define SZ_256M 0x10000000 | ||
42 | #define SZ_512M 0x20000000 | ||
43 | |||
44 | #define SZ_1G 0x40000000 | ||
45 | #define SZ_2G 0x80000000 | ||
46 | |||
47 | #endif /* __ASM_GENERIC_SIZES_H__ */ | ||
diff --git a/include/asm-generic/types.h b/include/asm-generic/types.h index fba7d33ca3f2..7a0f69e6c618 100644 --- a/include/asm-generic/types.h +++ b/include/asm-generic/types.h | |||
@@ -12,31 +12,4 @@ typedef unsigned short umode_t; | |||
12 | 12 | ||
13 | #endif /* __ASSEMBLY__ */ | 13 | #endif /* __ASSEMBLY__ */ |
14 | 14 | ||
15 | /* | ||
16 | * These aren't exported outside the kernel to avoid name space clashes | ||
17 | */ | ||
18 | #ifdef __KERNEL__ | ||
19 | #ifndef __ASSEMBLY__ | ||
20 | /* | ||
21 | * DMA addresses may be very different from physical addresses | ||
22 | * and pointers. i386 and powerpc may have 64 bit DMA on 32 bit | ||
23 | * systems, while sparc64 uses 32 bit DMA addresses for 64 bit | ||
24 | * physical addresses. | ||
25 | * This default defines dma_addr_t to have the same size as | ||
26 | * phys_addr_t, which is the most common way. | ||
27 | * Do not define the dma64_addr_t type, which never really | ||
28 | * worked. | ||
29 | */ | ||
30 | #ifndef dma_addr_t | ||
31 | #ifdef CONFIG_PHYS_ADDR_T_64BIT | ||
32 | typedef u64 dma_addr_t; | ||
33 | #else | ||
34 | typedef u32 dma_addr_t; | ||
35 | #endif /* CONFIG_PHYS_ADDR_T_64BIT */ | ||
36 | #endif /* dma_addr_t */ | ||
37 | |||
38 | #endif /* __ASSEMBLY__ */ | ||
39 | |||
40 | #endif /* __KERNEL__ */ | ||
41 | |||
42 | #endif /* _ASM_GENERIC_TYPES_H */ | 15 | #endif /* _ASM_GENERIC_TYPES_H */ |
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index b218b8513d04..ac68c999b6c2 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h | |||
@@ -288,14 +288,16 @@ strncpy_from_user(char *dst, const char __user *src, long count) | |||
288 | * | 288 | * |
289 | * Return 0 on exception, a value greater than N if too long | 289 | * Return 0 on exception, a value greater than N if too long |
290 | */ | 290 | */ |
291 | #ifndef strnlen_user | 291 | #ifndef __strnlen_user |
292 | #define __strnlen_user strnlen | ||
293 | #endif | ||
294 | |||
292 | static inline long strnlen_user(const char __user *src, long n) | 295 | static inline long strnlen_user(const char __user *src, long n) |
293 | { | 296 | { |
294 | if (!access_ok(VERIFY_READ, src, 1)) | 297 | if (!access_ok(VERIFY_READ, src, 1)) |
295 | return 0; | 298 | return 0; |
296 | return strlen((void * __force)src) + 1; | 299 | return __strnlen_user(src, n); |
297 | } | 300 | } |
298 | #endif | ||
299 | 301 | ||
300 | static inline long strlen_user(const char __user *src) | 302 | static inline long strlen_user(const char __user *src) |
301 | { | 303 | { |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index b969770196c2..07c40d5149de 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -646,9 +646,17 @@ __SYSCALL(__NR_prlimit64, sys_prlimit64) | |||
646 | __SYSCALL(__NR_fanotify_init, sys_fanotify_init) | 646 | __SYSCALL(__NR_fanotify_init, sys_fanotify_init) |
647 | #define __NR_fanotify_mark 263 | 647 | #define __NR_fanotify_mark 263 |
648 | __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) | 648 | __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) |
649 | #define __NR_name_to_handle_at 264 | ||
650 | __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) | ||
651 | #define __NR_open_by_handle_at 265 | ||
652 | __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) | ||
653 | #define __NR_clock_adjtime 266 | ||
654 | __SYSCALL(__NR_clock_adjtime, sys_clock_adjtime) | ||
655 | #define __NR_syncfs 267 | ||
656 | __SYSCALL(__NR_syncfs, sys_syncfs) | ||
649 | 657 | ||
650 | #undef __NR_syscalls | 658 | #undef __NR_syscalls |
651 | #define __NR_syscalls 264 | 659 | #define __NR_syscalls 268 |
652 | 660 | ||
653 | /* | 661 | /* |
654 | * All syscalls below here should go away really, | 662 | * All syscalls below here should go away really, |
diff --git a/include/asm-generic/user.h b/include/asm-generic/user.h index 8b9c3c960aeb..35638c34700f 100644 --- a/include/asm-generic/user.h +++ b/include/asm-generic/user.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifndef __ASM_GENERIC_USER_H | 1 | #ifndef __ASM_GENERIC_USER_H |
2 | #define __ASM_GENERIC_USER_H | 2 | #define __ASM_GENERIC_USER_H |
3 | /* | 3 | /* |
4 | * This file may define a 'struct user' structure. However, it it only | 4 | * This file may define a 'struct user' structure. However, it is only |
5 | * used for a.out file, which are not supported on new architectures. | 5 | * used for a.out files, which are not supported on new architectures. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #endif /* __ASM_GENERIC_USER_H */ | 8 | #endif /* __ASM_GENERIC_USER_H */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 68649336c4ad..32c45e5fe0ab 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * HEAD_TEXT_SECTION | 15 | * HEAD_TEXT_SECTION |
16 | * INIT_TEXT_SECTION(PAGE_SIZE) | 16 | * INIT_TEXT_SECTION(PAGE_SIZE) |
17 | * INIT_DATA_SECTION(...) | 17 | * INIT_DATA_SECTION(...) |
18 | * PERCPU(PAGE_SIZE) | 18 | * PERCPU(CACHELINE_SIZE, PAGE_SIZE) |
19 | * __init_end = .; | 19 | * __init_end = .; |
20 | * | 20 | * |
21 | * _stext = .; | 21 | * _stext = .; |
@@ -124,7 +124,8 @@ | |||
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | #ifdef CONFIG_EVENT_TRACING | 126 | #ifdef CONFIG_EVENT_TRACING |
127 | #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | 127 | #define FTRACE_EVENTS() . = ALIGN(8); \ |
128 | VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | ||
128 | *(_ftrace_events) \ | 129 | *(_ftrace_events) \ |
129 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; | 130 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; |
130 | #else | 131 | #else |
@@ -140,7 +141,8 @@ | |||
140 | #endif | 141 | #endif |
141 | 142 | ||
142 | #ifdef CONFIG_FTRACE_SYSCALLS | 143 | #ifdef CONFIG_FTRACE_SYSCALLS |
143 | #define TRACE_SYSCALLS() VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ | 144 | #define TRACE_SYSCALLS() . = ALIGN(8); \ |
145 | VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ | ||
144 | *(__syscalls_metadata) \ | 146 | *(__syscalls_metadata) \ |
145 | VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; | 147 | VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; |
146 | #else | 148 | #else |
@@ -165,10 +167,8 @@ | |||
165 | CPU_KEEP(exit.data) \ | 167 | CPU_KEEP(exit.data) \ |
166 | MEM_KEEP(init.data) \ | 168 | MEM_KEEP(init.data) \ |
167 | MEM_KEEP(exit.data) \ | 169 | MEM_KEEP(exit.data) \ |
168 | . = ALIGN(32); \ | 170 | STRUCT_ALIGN(); \ |
169 | VMLINUX_SYMBOL(__start___tracepoints) = .; \ | ||
170 | *(__tracepoints) \ | 171 | *(__tracepoints) \ |
171 | VMLINUX_SYMBOL(__stop___tracepoints) = .; \ | ||
172 | /* implement dynamic printk debug */ \ | 172 | /* implement dynamic printk debug */ \ |
173 | . = ALIGN(8); \ | 173 | . = ALIGN(8); \ |
174 | VMLINUX_SYMBOL(__start___verbose) = .; \ | 174 | VMLINUX_SYMBOL(__start___verbose) = .; \ |
@@ -176,13 +176,7 @@ | |||
176 | VMLINUX_SYMBOL(__stop___verbose) = .; \ | 176 | VMLINUX_SYMBOL(__stop___verbose) = .; \ |
177 | LIKELY_PROFILE() \ | 177 | LIKELY_PROFILE() \ |
178 | BRANCH_PROFILE() \ | 178 | BRANCH_PROFILE() \ |
179 | TRACE_PRINTKS() \ | 179 | TRACE_PRINTKS() |
180 | \ | ||
181 | STRUCT_ALIGN(); \ | ||
182 | FTRACE_EVENTS() \ | ||
183 | \ | ||
184 | STRUCT_ALIGN(); \ | ||
185 | TRACE_SYSCALLS() | ||
186 | 180 | ||
187 | /* | 181 | /* |
188 | * Data section helpers | 182 | * Data section helpers |
@@ -220,6 +214,10 @@ | |||
220 | VMLINUX_SYMBOL(__start_rodata) = .; \ | 214 | VMLINUX_SYMBOL(__start_rodata) = .; \ |
221 | *(.rodata) *(.rodata.*) \ | 215 | *(.rodata) *(.rodata.*) \ |
222 | *(__vermagic) /* Kernel version magic */ \ | 216 | *(__vermagic) /* Kernel version magic */ \ |
217 | . = ALIGN(8); \ | ||
218 | VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ | ||
219 | *(__tracepoints_ptrs) /* Tracepoints: pointer array */\ | ||
220 | VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \ | ||
223 | *(__markers_strings) /* Markers: strings */ \ | 221 | *(__markers_strings) /* Markers: strings */ \ |
224 | *(__tracepoints_strings)/* Tracepoints: strings */ \ | 222 | *(__tracepoints_strings)/* Tracepoints: strings */ \ |
225 | } \ | 223 | } \ |
@@ -364,6 +362,13 @@ | |||
364 | VMLINUX_SYMBOL(__start___param) = .; \ | 362 | VMLINUX_SYMBOL(__start___param) = .; \ |
365 | *(__param) \ | 363 | *(__param) \ |
366 | VMLINUX_SYMBOL(__stop___param) = .; \ | 364 | VMLINUX_SYMBOL(__stop___param) = .; \ |
365 | } \ | ||
366 | \ | ||
367 | /* Built-in module versions. */ \ | ||
368 | __modver : AT(ADDR(__modver) - LOAD_OFFSET) { \ | ||
369 | VMLINUX_SYMBOL(__start___modver) = .; \ | ||
370 | *(__modver) \ | ||
371 | VMLINUX_SYMBOL(__stop___modver) = .; \ | ||
367 | . = ALIGN((align)); \ | 372 | . = ALIGN((align)); \ |
368 | VMLINUX_SYMBOL(__end_rodata) = .; \ | 373 | VMLINUX_SYMBOL(__end_rodata) = .; \ |
369 | } \ | 374 | } \ |
@@ -419,6 +424,12 @@ | |||
419 | *(.kprobes.text) \ | 424 | *(.kprobes.text) \ |
420 | VMLINUX_SYMBOL(__kprobes_text_end) = .; | 425 | VMLINUX_SYMBOL(__kprobes_text_end) = .; |
421 | 426 | ||
427 | #define ENTRY_TEXT \ | ||
428 | ALIGN_FUNCTION(); \ | ||
429 | VMLINUX_SYMBOL(__entry_text_start) = .; \ | ||
430 | *(.entry.text) \ | ||
431 | VMLINUX_SYMBOL(__entry_text_end) = .; | ||
432 | |||
422 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 433 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
423 | #define IRQENTRY_TEXT \ | 434 | #define IRQENTRY_TEXT \ |
424 | ALIGN_FUNCTION(); \ | 435 | ALIGN_FUNCTION(); \ |
@@ -475,6 +486,8 @@ | |||
475 | KERNEL_CTORS() \ | 486 | KERNEL_CTORS() \ |
476 | *(.init.rodata) \ | 487 | *(.init.rodata) \ |
477 | MCOUNT_REC() \ | 488 | MCOUNT_REC() \ |
489 | FTRACE_EVENTS() \ | ||
490 | TRACE_SYSCALLS() \ | ||
478 | DEV_DISCARD(init.rodata) \ | 491 | DEV_DISCARD(init.rodata) \ |
479 | CPU_DISCARD(init.rodata) \ | 492 | CPU_DISCARD(init.rodata) \ |
480 | MEM_DISCARD(init.rodata) \ | 493 | MEM_DISCARD(init.rodata) \ |
@@ -676,13 +689,18 @@ | |||
676 | 689 | ||
677 | /** | 690 | /** |
678 | * PERCPU_VADDR - define output section for percpu area | 691 | * PERCPU_VADDR - define output section for percpu area |
692 | * @cacheline: cacheline size | ||
679 | * @vaddr: explicit base address (optional) | 693 | * @vaddr: explicit base address (optional) |
680 | * @phdr: destination PHDR (optional) | 694 | * @phdr: destination PHDR (optional) |
681 | * | 695 | * |
682 | * Macro which expands to output section for percpu area. If @vaddr | 696 | * Macro which expands to output section for percpu area. |
683 | * is not blank, it specifies explicit base address and all percpu | 697 | * |
684 | * symbols will be offset from the given address. If blank, @vaddr | 698 | * @cacheline is used to align subsections to avoid false cacheline |
685 | * always equals @laddr + LOAD_OFFSET. | 699 | * sharing between subsections for different purposes. |
700 | * | ||
701 | * If @vaddr is not blank, it specifies explicit base address and all | ||
702 | * percpu symbols will be offset from the given address. If blank, | ||
703 | * @vaddr always equals @laddr + LOAD_OFFSET. | ||
686 | * | 704 | * |
687 | * @phdr defines the output PHDR to use if not blank. Be warned that | 705 | * @phdr defines the output PHDR to use if not blank. Be warned that |
688 | * output PHDR is sticky. If @phdr is specified, the next output | 706 | * output PHDR is sticky. If @phdr is specified, the next output |
@@ -693,7 +711,7 @@ | |||
693 | * If there is no need to put the percpu section at a predetermined | 711 | * If there is no need to put the percpu section at a predetermined |
694 | * address, use PERCPU(). | 712 | * address, use PERCPU(). |
695 | */ | 713 | */ |
696 | #define PERCPU_VADDR(vaddr, phdr) \ | 714 | #define PERCPU_VADDR(cacheline, vaddr, phdr) \ |
697 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 715 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
698 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ | 716 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ |
699 | - LOAD_OFFSET) { \ | 717 | - LOAD_OFFSET) { \ |
@@ -701,7 +719,9 @@ | |||
701 | *(.data..percpu..first) \ | 719 | *(.data..percpu..first) \ |
702 | . = ALIGN(PAGE_SIZE); \ | 720 | . = ALIGN(PAGE_SIZE); \ |
703 | *(.data..percpu..page_aligned) \ | 721 | *(.data..percpu..page_aligned) \ |
722 | . = ALIGN(cacheline); \ | ||
704 | *(.data..percpu..readmostly) \ | 723 | *(.data..percpu..readmostly) \ |
724 | . = ALIGN(cacheline); \ | ||
705 | *(.data..percpu) \ | 725 | *(.data..percpu) \ |
706 | *(.data..percpu..shared_aligned) \ | 726 | *(.data..percpu..shared_aligned) \ |
707 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | 727 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ |
@@ -710,18 +730,18 @@ | |||
710 | 730 | ||
711 | /** | 731 | /** |
712 | * PERCPU - define output section for percpu area, simple version | 732 | * PERCPU - define output section for percpu area, simple version |
733 | * @cacheline: cacheline size | ||
713 | * @align: required alignment | 734 | * @align: required alignment |
714 | * | 735 | * |
715 | * Align to @align and outputs output section for percpu area. This | 736 | * Align to @align and outputs output section for percpu area. This macro |
716 | * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and | 737 | * doesn't manipulate @vaddr or @phdr and __per_cpu_load and |
717 | * __per_cpu_start will be identical. | 738 | * __per_cpu_start will be identical. |
718 | * | 739 | * |
719 | * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except | 740 | * This macro is equivalent to ALIGN(@align); PERCPU_VADDR(@cacheline,,) |
720 | * that __per_cpu_load is defined as a relative symbol against | 741 | * except that __per_cpu_load is defined as a relative symbol against |
721 | * .data..percpu which is required for relocatable x86_32 | 742 | * .data..percpu which is required for relocatable x86_32 configuration. |
722 | * configuration. | ||
723 | */ | 743 | */ |
724 | #define PERCPU(align) \ | 744 | #define PERCPU(cacheline, align) \ |
725 | . = ALIGN(align); \ | 745 | . = ALIGN(align); \ |
726 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ | 746 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ |
727 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 747 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
@@ -729,7 +749,9 @@ | |||
729 | *(.data..percpu..first) \ | 749 | *(.data..percpu..first) \ |
730 | . = ALIGN(PAGE_SIZE); \ | 750 | . = ALIGN(PAGE_SIZE); \ |
731 | *(.data..percpu..page_aligned) \ | 751 | *(.data..percpu..page_aligned) \ |
752 | . = ALIGN(cacheline); \ | ||
732 | *(.data..percpu..readmostly) \ | 753 | *(.data..percpu..readmostly) \ |
754 | . = ALIGN(cacheline); \ | ||
733 | *(.data..percpu) \ | 755 | *(.data..percpu) \ |
734 | *(.data..percpu..shared_aligned) \ | 756 | *(.data..percpu..shared_aligned) \ |
735 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | 757 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ |