aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/bitops.h3
-rw-r--r--include/asm-generic/bitops/ext2-atomic.h4
-rw-r--r--include/asm-generic/bitops/ext2-non-atomic.h20
-rw-r--r--include/asm-generic/bitops/le.h89
-rw-r--r--include/asm-generic/bitops/minix-le.h17
-rw-r--r--include/asm-generic/bitops/minix.h15
-rw-r--r--include/asm-generic/bug.h35
-rw-r--r--include/asm-generic/siginfo.h2
-rw-r--r--include/asm-generic/types.h27
-rw-r--r--include/asm-generic/unistd.h6
-rw-r--r--include/asm-generic/vmlinux.lds.h2
11 files changed, 100 insertions, 120 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) 11static 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) 17static 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) 23static 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
45extern unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, 33extern unsigned long find_next_zero_bit_le(const void *addr,
46 unsigned long size, unsigned long offset); 34 unsigned long size, unsigned long offset);
47extern unsigned long generic_find_next_le_bit(const unsigned long *addr, 35extern 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) \ 45static 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
50static inline void __set_bit_le(int nr, void *addr)
51{
52 __set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
53}
54
55static inline void __clear_bit_le(int nr, void *addr)
56{
57 __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
58}
59
60static 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
65static 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
70static 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
75static 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..e5a3f5880001 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -165,10 +165,43 @@ 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/*
198 * Use of ({0;}) because WARN_ON_SMP(x) may be used either as
199 * a stand alone line statement or as a condition in an if ()
200 * statement.
201 * A simple "0" would cause gcc to give a "statement has no effect"
202 * warning.
203 */
204# define WARN_ON_SMP(x) ({0;})
172#endif 205#endif
173 206
174#endif 207#endif
diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
index 942d30b5aab1..0dd4e87f6fba 100644
--- a/include/asm-generic/siginfo.h
+++ b/include/asm-generic/siginfo.h
@@ -192,7 +192,7 @@ typedef struct siginfo {
192 * SIGBUS si_codes 192 * SIGBUS si_codes
193 */ 193 */
194#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */ 194#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
195#define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */ 195#define BUS_ADRERR (__SI_FAULT|2) /* non-existent physical address */
196#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */ 196#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
197/* hardware memory error consumed on a machine check: action required */ 197/* hardware memory error consumed on a machine check: action required */
198#define BUS_MCEERR_AR (__SI_FAULT|4) 198#define BUS_MCEERR_AR (__SI_FAULT|4)
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
32typedef u64 dma_addr_t;
33#else
34typedef 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/unistd.h b/include/asm-generic/unistd.h
index 57af0338d270..07c40d5149de 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -650,9 +650,13 @@ __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
650__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) 650__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
651#define __NR_open_by_handle_at 265 651#define __NR_open_by_handle_at 265
652__SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) 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)
653 657
654#undef __NR_syscalls 658#undef __NR_syscalls
655#define __NR_syscalls 266 659#define __NR_syscalls 268
656 660
657/* 661/*
658 * All syscalls below here should go away really, 662 * All syscalls below here should go away really,
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 32c45e5fe0ab..bd297a20ab98 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -773,7 +773,7 @@
773 * the sections that has this restriction (or similar) 773 * the sections that has this restriction (or similar)
774 * is located before the ones requiring PAGE_SIZE alignment. 774 * is located before the ones requiring PAGE_SIZE alignment.
775 * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which 775 * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which
776 * matches the requirment of PAGE_ALIGNED_DATA. 776 * matches the requirement of PAGE_ALIGNED_DATA.
777 * 777 *
778 * use 0 as page_align if page_aligned data is not used */ 778 * use 0 as page_align if page_aligned data is not used */
779#define RW_DATA_SECTION(cacheline, pagealigned, inittask) \ 779#define RW_DATA_SECTION(cacheline, pagealigned, inittask) \