diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2012-05-12 18:53:34 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-05-12 18:53:34 -0400 |
commit | 163ec0369be4c26e68385f6cec88d0ee38c8d8e5 (patch) | |
tree | f3e441866f8bc1b0548e7d8eddd9548b6aedef5e /arch/x86/include/asm | |
parent | 199642bfe107c411f25fbfc16c9fd49cfef9785d (diff) | |
parent | 99dbdd98f271899e023d52b3f4c2bf67cdd7eb56 (diff) |
Merge branch 'next/cleanup-plat-s3c24xx' into next/cleanup-plat-s3c24xx-s5p
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/cmpxchg.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/dma-mapping.h | 26 | ||||
-rw-r--r-- | arch/x86/include/asm/posix_types.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/processor.h | 10 | ||||
-rw-r--r-- | arch/x86/include/asm/sigcontext.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/siginfo.h | 8 | ||||
-rw-r--r-- | arch/x86/include/asm/uaccess.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/uaccess_32.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/uaccess_64.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/unistd.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/word-at-a-time.h | 79 | ||||
-rw-r--r-- | arch/x86/include/asm/x86_init.h | 1 |
12 files changed, 113 insertions, 40 deletions
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h index b3b733262909..99480e55973d 100644 --- a/arch/x86/include/asm/cmpxchg.h +++ b/arch/x86/include/asm/cmpxchg.h | |||
@@ -43,7 +43,7 @@ extern void __add_wrong_size(void) | |||
43 | switch (sizeof(*(ptr))) { \ | 43 | switch (sizeof(*(ptr))) { \ |
44 | case __X86_CASE_B: \ | 44 | case __X86_CASE_B: \ |
45 | asm volatile (lock #op "b %b0, %1\n" \ | 45 | asm volatile (lock #op "b %b0, %1\n" \ |
46 | : "+r" (__ret), "+m" (*(ptr)) \ | 46 | : "+q" (__ret), "+m" (*(ptr)) \ |
47 | : : "memory", "cc"); \ | 47 | : : "memory", "cc"); \ |
48 | break; \ | 48 | break; \ |
49 | case __X86_CASE_W: \ | 49 | case __X86_CASE_W: \ |
@@ -173,7 +173,7 @@ extern void __add_wrong_size(void) | |||
173 | switch (sizeof(*(ptr))) { \ | 173 | switch (sizeof(*(ptr))) { \ |
174 | case __X86_CASE_B: \ | 174 | case __X86_CASE_B: \ |
175 | asm volatile (lock "addb %b1, %0\n" \ | 175 | asm volatile (lock "addb %b1, %0\n" \ |
176 | : "+m" (*(ptr)) : "ri" (inc) \ | 176 | : "+m" (*(ptr)) : "qi" (inc) \ |
177 | : "memory", "cc"); \ | 177 | : "memory", "cc"); \ |
178 | break; \ | 178 | break; \ |
179 | case __X86_CASE_W: \ | 179 | case __X86_CASE_W: \ |
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index ed3065fd6314..4b4331d71935 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h | |||
@@ -59,7 +59,8 @@ extern int dma_supported(struct device *hwdev, u64 mask); | |||
59 | extern int dma_set_mask(struct device *dev, u64 mask); | 59 | extern int dma_set_mask(struct device *dev, u64 mask); |
60 | 60 | ||
61 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 61 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
62 | dma_addr_t *dma_addr, gfp_t flag); | 62 | dma_addr_t *dma_addr, gfp_t flag, |
63 | struct dma_attrs *attrs); | ||
63 | 64 | ||
64 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | 65 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
65 | { | 66 | { |
@@ -111,9 +112,11 @@ static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp) | |||
111 | return gfp; | 112 | return gfp; |
112 | } | 113 | } |
113 | 114 | ||
115 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) | ||
116 | |||
114 | static inline void * | 117 | static inline void * |
115 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 118 | dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle, |
116 | gfp_t gfp) | 119 | gfp_t gfp, struct dma_attrs *attrs) |
117 | { | 120 | { |
118 | struct dma_map_ops *ops = get_dma_ops(dev); | 121 | struct dma_map_ops *ops = get_dma_ops(dev); |
119 | void *memory; | 122 | void *memory; |
@@ -129,18 +132,21 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | |||
129 | if (!is_device_dma_capable(dev)) | 132 | if (!is_device_dma_capable(dev)) |
130 | return NULL; | 133 | return NULL; |
131 | 134 | ||
132 | if (!ops->alloc_coherent) | 135 | if (!ops->alloc) |
133 | return NULL; | 136 | return NULL; |
134 | 137 | ||
135 | memory = ops->alloc_coherent(dev, size, dma_handle, | 138 | memory = ops->alloc(dev, size, dma_handle, |
136 | dma_alloc_coherent_gfp_flags(dev, gfp)); | 139 | dma_alloc_coherent_gfp_flags(dev, gfp), attrs); |
137 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); | 140 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); |
138 | 141 | ||
139 | return memory; | 142 | return memory; |
140 | } | 143 | } |
141 | 144 | ||
142 | static inline void dma_free_coherent(struct device *dev, size_t size, | 145 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
143 | void *vaddr, dma_addr_t bus) | 146 | |
147 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
148 | void *vaddr, dma_addr_t bus, | ||
149 | struct dma_attrs *attrs) | ||
144 | { | 150 | { |
145 | struct dma_map_ops *ops = get_dma_ops(dev); | 151 | struct dma_map_ops *ops = get_dma_ops(dev); |
146 | 152 | ||
@@ -150,8 +156,8 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
150 | return; | 156 | return; |
151 | 157 | ||
152 | debug_dma_free_coherent(dev, size, vaddr, bus); | 158 | debug_dma_free_coherent(dev, size, vaddr, bus); |
153 | if (ops->free_coherent) | 159 | if (ops->free) |
154 | ops->free_coherent(dev, size, vaddr, bus); | 160 | ops->free(dev, size, vaddr, bus, attrs); |
155 | } | 161 | } |
156 | 162 | ||
157 | #endif | 163 | #endif |
diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h index 3427b7798dbc..7ef7c3020e5c 100644 --- a/arch/x86/include/asm/posix_types.h +++ b/arch/x86/include/asm/posix_types.h | |||
@@ -7,9 +7,9 @@ | |||
7 | #else | 7 | #else |
8 | # ifdef __i386__ | 8 | # ifdef __i386__ |
9 | # include "posix_types_32.h" | 9 | # include "posix_types_32.h" |
10 | # elif defined(__LP64__) | 10 | # elif defined(__ILP32__) |
11 | # include "posix_types_64.h" | ||
12 | # else | ||
13 | # include "posix_types_x32.h" | 11 | # include "posix_types_x32.h" |
12 | # else | ||
13 | # include "posix_types_64.h" | ||
14 | # endif | 14 | # endif |
15 | #endif | 15 | #endif |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 7284c9a6a0b5..4fa7dcceb6c0 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -974,16 +974,6 @@ extern bool cpu_has_amd_erratum(const int *); | |||
974 | #define cpu_has_amd_erratum(x) (false) | 974 | #define cpu_has_amd_erratum(x) (false) |
975 | #endif /* CONFIG_CPU_SUP_AMD */ | 975 | #endif /* CONFIG_CPU_SUP_AMD */ |
976 | 976 | ||
977 | #ifdef CONFIG_X86_32 | ||
978 | /* | ||
979 | * disable hlt during certain critical i/o operations | ||
980 | */ | ||
981 | #define HAVE_DISABLE_HLT | ||
982 | #endif | ||
983 | |||
984 | void disable_hlt(void); | ||
985 | void enable_hlt(void); | ||
986 | |||
987 | void cpu_idle_wait(void); | 977 | void cpu_idle_wait(void); |
988 | 978 | ||
989 | extern unsigned long arch_align_stack(unsigned long sp); | 979 | extern unsigned long arch_align_stack(unsigned long sp); |
diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h index 4a085383af27..5ca71c065eef 100644 --- a/arch/x86/include/asm/sigcontext.h +++ b/arch/x86/include/asm/sigcontext.h | |||
@@ -257,7 +257,7 @@ struct sigcontext { | |||
257 | __u64 oldmask; | 257 | __u64 oldmask; |
258 | __u64 cr2; | 258 | __u64 cr2; |
259 | struct _fpstate __user *fpstate; /* zero when no FPU context */ | 259 | struct _fpstate __user *fpstate; /* zero when no FPU context */ |
260 | #ifndef __LP64__ | 260 | #ifdef __ILP32__ |
261 | __u32 __fpstate_pad; | 261 | __u32 __fpstate_pad; |
262 | #endif | 262 | #endif |
263 | __u64 reserved1[8]; | 263 | __u64 reserved1[8]; |
diff --git a/arch/x86/include/asm/siginfo.h b/arch/x86/include/asm/siginfo.h index fc1aa5535646..34c47b3341c0 100644 --- a/arch/x86/include/asm/siginfo.h +++ b/arch/x86/include/asm/siginfo.h | |||
@@ -2,7 +2,13 @@ | |||
2 | #define _ASM_X86_SIGINFO_H | 2 | #define _ASM_X86_SIGINFO_H |
3 | 3 | ||
4 | #ifdef __x86_64__ | 4 | #ifdef __x86_64__ |
5 | # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | 5 | # ifdef __ILP32__ /* x32 */ |
6 | typedef long long __kernel_si_clock_t __attribute__((aligned(4))); | ||
7 | # define __ARCH_SI_CLOCK_T __kernel_si_clock_t | ||
8 | # define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8))) | ||
9 | # else /* x86-64 */ | ||
10 | # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | ||
11 | # endif | ||
6 | #endif | 12 | #endif |
7 | 13 | ||
8 | #include <asm-generic/siginfo.h> | 14 | #include <asm-generic/siginfo.h> |
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index 8be5f54d9360..e0544597cfe7 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h | |||
@@ -557,6 +557,8 @@ struct __large_struct { unsigned long buf[100]; }; | |||
557 | 557 | ||
558 | extern unsigned long | 558 | extern unsigned long |
559 | copy_from_user_nmi(void *to, const void __user *from, unsigned long n); | 559 | copy_from_user_nmi(void *to, const void __user *from, unsigned long n); |
560 | extern __must_check long | ||
561 | strncpy_from_user(char *dst, const char __user *src, long count); | ||
560 | 562 | ||
561 | /* | 563 | /* |
562 | * movsl can be slow when source and dest are not both 8-byte aligned | 564 | * movsl can be slow when source and dest are not both 8-byte aligned |
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h index 566e803cc602..8084bc73b18c 100644 --- a/arch/x86/include/asm/uaccess_32.h +++ b/arch/x86/include/asm/uaccess_32.h | |||
@@ -213,11 +213,6 @@ static inline unsigned long __must_check copy_from_user(void *to, | |||
213 | return n; | 213 | return n; |
214 | } | 214 | } |
215 | 215 | ||
216 | long __must_check strncpy_from_user(char *dst, const char __user *src, | ||
217 | long count); | ||
218 | long __must_check __strncpy_from_user(char *dst, | ||
219 | const char __user *src, long count); | ||
220 | |||
221 | /** | 216 | /** |
222 | * strlen_user: - Get the size of a string in user space. | 217 | * strlen_user: - Get the size of a string in user space. |
223 | * @str: The string to measure. | 218 | * @str: The string to measure. |
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h index 1c66d30971ad..fcd4b6f3ef02 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h | |||
@@ -208,10 +208,6 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size) | |||
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | __must_check long | ||
212 | strncpy_from_user(char *dst, const char __user *src, long count); | ||
213 | __must_check long | ||
214 | __strncpy_from_user(char *dst, const char __user *src, long count); | ||
215 | __must_check long strnlen_user(const char __user *str, long n); | 211 | __must_check long strnlen_user(const char __user *str, long n); |
216 | __must_check long __strnlen_user(const char __user *str, long n); | 212 | __must_check long __strnlen_user(const char __user *str, long n); |
217 | __must_check long strlen_user(const char __user *str); | 213 | __must_check long strlen_user(const char __user *str); |
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index 37cdc9d99bb1..4437001d8e3d 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h | |||
@@ -63,10 +63,10 @@ | |||
63 | #else | 63 | #else |
64 | # ifdef __i386__ | 64 | # ifdef __i386__ |
65 | # include <asm/unistd_32.h> | 65 | # include <asm/unistd_32.h> |
66 | # elif defined(__LP64__) | 66 | # elif defined(__ILP32__) |
67 | # include <asm/unistd_64.h> | ||
68 | # else | ||
69 | # include <asm/unistd_x32.h> | 67 | # include <asm/unistd_x32.h> |
68 | # else | ||
69 | # include <asm/unistd_64.h> | ||
70 | # endif | 70 | # endif |
71 | #endif | 71 | #endif |
72 | 72 | ||
diff --git a/arch/x86/include/asm/word-at-a-time.h b/arch/x86/include/asm/word-at-a-time.h new file mode 100644 index 000000000000..e58f03b206c3 --- /dev/null +++ b/arch/x86/include/asm/word-at-a-time.h | |||
@@ -0,0 +1,79 @@ | |||
1 | #ifndef _ASM_WORD_AT_A_TIME_H | ||
2 | #define _ASM_WORD_AT_A_TIME_H | ||
3 | |||
4 | /* | ||
5 | * This is largely generic for little-endian machines, but the | ||
6 | * optimal byte mask counting is probably going to be something | ||
7 | * that is architecture-specific. If you have a reliably fast | ||
8 | * bit count instruction, that might be better than the multiply | ||
9 | * and shift, for example. | ||
10 | */ | ||
11 | |||
12 | #ifdef CONFIG_64BIT | ||
13 | |||
14 | /* | ||
15 | * Jan Achrenius on G+: microoptimized version of | ||
16 | * the simpler "(mask & ONEBYTES) * ONEBYTES >> 56" | ||
17 | * that works for the bytemasks without having to | ||
18 | * mask them first. | ||
19 | */ | ||
20 | static inline long count_masked_bytes(unsigned long mask) | ||
21 | { | ||
22 | return mask*0x0001020304050608ul >> 56; | ||
23 | } | ||
24 | |||
25 | #else /* 32-bit case */ | ||
26 | |||
27 | /* Carl Chatfield / Jan Achrenius G+ version for 32-bit */ | ||
28 | static inline long count_masked_bytes(long mask) | ||
29 | { | ||
30 | /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */ | ||
31 | long a = (0x0ff0001+mask) >> 23; | ||
32 | /* Fix the 1 for 00 case */ | ||
33 | return a & mask; | ||
34 | } | ||
35 | |||
36 | #endif | ||
37 | |||
38 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) | ||
39 | |||
40 | /* Return the high bit set in the first byte that is a zero */ | ||
41 | static inline unsigned long has_zero(unsigned long a) | ||
42 | { | ||
43 | return ((a - REPEAT_BYTE(0x01)) & ~a) & REPEAT_BYTE(0x80); | ||
44 | } | ||
45 | |||
46 | /* | ||
47 | * Load an unaligned word from kernel space. | ||
48 | * | ||
49 | * In the (very unlikely) case of the word being a page-crosser | ||
50 | * and the next page not being mapped, take the exception and | ||
51 | * return zeroes in the non-existing part. | ||
52 | */ | ||
53 | static inline unsigned long load_unaligned_zeropad(const void *addr) | ||
54 | { | ||
55 | unsigned long ret, dummy; | ||
56 | |||
57 | asm( | ||
58 | "1:\tmov %2,%0\n" | ||
59 | "2:\n" | ||
60 | ".section .fixup,\"ax\"\n" | ||
61 | "3:\t" | ||
62 | "lea %2,%1\n\t" | ||
63 | "and %3,%1\n\t" | ||
64 | "mov (%1),%0\n\t" | ||
65 | "leal %2,%%ecx\n\t" | ||
66 | "andl %4,%%ecx\n\t" | ||
67 | "shll $3,%%ecx\n\t" | ||
68 | "shr %%cl,%0\n\t" | ||
69 | "jmp 2b\n" | ||
70 | ".previous\n" | ||
71 | _ASM_EXTABLE(1b, 3b) | ||
72 | :"=&r" (ret),"=&c" (dummy) | ||
73 | :"m" (*(unsigned long *)addr), | ||
74 | "i" (-sizeof(unsigned long)), | ||
75 | "i" (sizeof(unsigned long)-1)); | ||
76 | return ret; | ||
77 | } | ||
78 | |||
79 | #endif /* _ASM_WORD_AT_A_TIME_H */ | ||
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index baaca8defec8..764b66a4cf89 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h | |||
@@ -195,6 +195,5 @@ extern struct x86_msi_ops x86_msi; | |||
195 | 195 | ||
196 | extern void x86_init_noop(void); | 196 | extern void x86_init_noop(void); |
197 | extern void x86_init_uint_noop(unsigned int unused); | 197 | extern void x86_init_uint_noop(unsigned int unused); |
198 | extern void x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node); | ||
199 | 198 | ||
200 | #endif | 199 | #endif |