diff options
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/assembler.h | 35 | ||||
-rw-r--r-- | arch/arm/include/asm/cache.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/clkdev.h | 22 | ||||
-rw-r--r-- | arch/arm/include/asm/dma-mapping.h | 93 | ||||
-rw-r--r-- | arch/arm/include/asm/domain.h | 31 | ||||
-rw-r--r-- | arch/arm/include/asm/entry-macro-multi.S | 44 | ||||
-rw-r--r-- | arch/arm/include/asm/futex.h | 9 | ||||
-rw-r--r-- | arch/arm/include/asm/hardirq.h | 18 | ||||
-rw-r--r-- | arch/arm/include/asm/localtimer.h | 12 | ||||
-rw-r--r-- | arch/arm/include/asm/mach/arch.h | 9 | ||||
-rw-r--r-- | arch/arm/include/asm/mach/irq.h | 8 | ||||
-rw-r--r-- | arch/arm/include/asm/mach/time.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/smp.h | 17 | ||||
-rw-r--r-- | arch/arm/include/asm/smp_mpidr.h | 17 | ||||
-rw-r--r-- | arch/arm/include/asm/smp_twd.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/system.h | 7 | ||||
-rw-r--r-- | arch/arm/include/asm/traps.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/uaccess.h | 16 |
18 files changed, 239 insertions, 105 deletions
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 749bb6622404..bc2d2d75f706 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
21 | #include <asm/domain.h> | ||
21 | 22 | ||
22 | /* | 23 | /* |
23 | * Endian independent macros for shifting bytes within registers. | 24 | * Endian independent macros for shifting bytes within registers. |
@@ -157,16 +158,24 @@ | |||
157 | #ifdef CONFIG_SMP | 158 | #ifdef CONFIG_SMP |
158 | #define ALT_SMP(instr...) \ | 159 | #define ALT_SMP(instr...) \ |
159 | 9998: instr | 160 | 9998: instr |
161 | /* | ||
162 | * Note: if you get assembler errors from ALT_UP() when building with | ||
163 | * CONFIG_THUMB2_KERNEL, you almost certainly need to use | ||
164 | * ALT_SMP( W(instr) ... ) | ||
165 | */ | ||
160 | #define ALT_UP(instr...) \ | 166 | #define ALT_UP(instr...) \ |
161 | .pushsection ".alt.smp.init", "a" ;\ | 167 | .pushsection ".alt.smp.init", "a" ;\ |
162 | .long 9998b ;\ | 168 | .long 9998b ;\ |
163 | instr ;\ | 169 | 9997: instr ;\ |
170 | .if . - 9997b != 4 ;\ | ||
171 | .error "ALT_UP() content must assemble to exactly 4 bytes";\ | ||
172 | .endif ;\ | ||
164 | .popsection | 173 | .popsection |
165 | #define ALT_UP_B(label) \ | 174 | #define ALT_UP_B(label) \ |
166 | .equ up_b_offset, label - 9998b ;\ | 175 | .equ up_b_offset, label - 9998b ;\ |
167 | .pushsection ".alt.smp.init", "a" ;\ | 176 | .pushsection ".alt.smp.init", "a" ;\ |
168 | .long 9998b ;\ | 177 | .long 9998b ;\ |
169 | b . + up_b_offset ;\ | 178 | W(b) . + up_b_offset ;\ |
170 | .popsection | 179 | .popsection |
171 | #else | 180 | #else |
172 | #define ALT_SMP(instr...) | 181 | #define ALT_SMP(instr...) |
@@ -177,16 +186,24 @@ | |||
177 | /* | 186 | /* |
178 | * SMP data memory barrier | 187 | * SMP data memory barrier |
179 | */ | 188 | */ |
180 | .macro smp_dmb | 189 | .macro smp_dmb mode |
181 | #ifdef CONFIG_SMP | 190 | #ifdef CONFIG_SMP |
182 | #if __LINUX_ARM_ARCH__ >= 7 | 191 | #if __LINUX_ARM_ARCH__ >= 7 |
192 | .ifeqs "\mode","arm" | ||
183 | ALT_SMP(dmb) | 193 | ALT_SMP(dmb) |
194 | .else | ||
195 | ALT_SMP(W(dmb)) | ||
196 | .endif | ||
184 | #elif __LINUX_ARM_ARCH__ == 6 | 197 | #elif __LINUX_ARM_ARCH__ == 6 |
185 | ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb | 198 | ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb |
186 | #else | 199 | #else |
187 | #error Incompatible SMP platform | 200 | #error Incompatible SMP platform |
188 | #endif | 201 | #endif |
202 | .ifeqs "\mode","arm" | ||
189 | ALT_UP(nop) | 203 | ALT_UP(nop) |
204 | .else | ||
205 | ALT_UP(W(nop)) | ||
206 | .endif | ||
190 | #endif | 207 | #endif |
191 | .endm | 208 | .endm |
192 | 209 | ||
@@ -206,12 +223,12 @@ | |||
206 | */ | 223 | */ |
207 | #ifdef CONFIG_THUMB2_KERNEL | 224 | #ifdef CONFIG_THUMB2_KERNEL |
208 | 225 | ||
209 | .macro usraccoff, instr, reg, ptr, inc, off, cond, abort | 226 | .macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T() |
210 | 9999: | 227 | 9999: |
211 | .if \inc == 1 | 228 | .if \inc == 1 |
212 | \instr\cond\()bt \reg, [\ptr, #\off] | 229 | \instr\cond\()b\()\t\().w \reg, [\ptr, #\off] |
213 | .elseif \inc == 4 | 230 | .elseif \inc == 4 |
214 | \instr\cond\()t \reg, [\ptr, #\off] | 231 | \instr\cond\()\t\().w \reg, [\ptr, #\off] |
215 | .else | 232 | .else |
216 | .error "Unsupported inc macro argument" | 233 | .error "Unsupported inc macro argument" |
217 | .endif | 234 | .endif |
@@ -246,13 +263,13 @@ | |||
246 | 263 | ||
247 | #else /* !CONFIG_THUMB2_KERNEL */ | 264 | #else /* !CONFIG_THUMB2_KERNEL */ |
248 | 265 | ||
249 | .macro usracc, instr, reg, ptr, inc, cond, rept, abort | 266 | .macro usracc, instr, reg, ptr, inc, cond, rept, abort, t=T() |
250 | .rept \rept | 267 | .rept \rept |
251 | 9999: | 268 | 9999: |
252 | .if \inc == 1 | 269 | .if \inc == 1 |
253 | \instr\cond\()bt \reg, [\ptr], #\inc | 270 | \instr\cond\()b\()\t \reg, [\ptr], #\inc |
254 | .elseif \inc == 4 | 271 | .elseif \inc == 4 |
255 | \instr\cond\()t \reg, [\ptr], #\inc | 272 | \instr\cond\()\t \reg, [\ptr], #\inc |
256 | .else | 273 | .else |
257 | .error "Unsupported inc macro argument" | 274 | .error "Unsupported inc macro argument" |
258 | .endif | 275 | .endif |
diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h index 9d6122096fbe..75fe66bc02b4 100644 --- a/arch/arm/include/asm/cache.h +++ b/arch/arm/include/asm/cache.h | |||
@@ -23,4 +23,6 @@ | |||
23 | #define ARCH_SLAB_MINALIGN 8 | 23 | #define ARCH_SLAB_MINALIGN 8 |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) | ||
27 | |||
26 | #endif | 28 | #endif |
diff --git a/arch/arm/include/asm/clkdev.h b/arch/arm/include/asm/clkdev.h index b56c1389b6fa..765d33222369 100644 --- a/arch/arm/include/asm/clkdev.h +++ b/arch/arm/include/asm/clkdev.h | |||
@@ -12,23 +12,13 @@ | |||
12 | #ifndef __ASM_CLKDEV_H | 12 | #ifndef __ASM_CLKDEV_H |
13 | #define __ASM_CLKDEV_H | 13 | #define __ASM_CLKDEV_H |
14 | 14 | ||
15 | struct clk; | 15 | #include <linux/slab.h> |
16 | struct device; | ||
17 | 16 | ||
18 | struct clk_lookup { | 17 | #include <mach/clkdev.h> |
19 | struct list_head node; | ||
20 | const char *dev_id; | ||
21 | const char *con_id; | ||
22 | struct clk *clk; | ||
23 | }; | ||
24 | 18 | ||
25 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | 19 | static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size) |
26 | const char *dev_fmt, ...); | 20 | { |
27 | 21 | return kzalloc(size, GFP_KERNEL); | |
28 | void clkdev_add(struct clk_lookup *cl); | 22 | } |
29 | void clkdev_drop(struct clk_lookup *cl); | ||
30 | |||
31 | void clkdev_add_table(struct clk_lookup *, size_t); | ||
32 | int clk_add_alias(const char *, const char *, char *, struct device *); | ||
33 | 23 | ||
34 | #endif | 24 | #endif |
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index c568da7dcae4..4fff837363ed 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -5,24 +5,29 @@ | |||
5 | 5 | ||
6 | #include <linux/mm_types.h> | 6 | #include <linux/mm_types.h> |
7 | #include <linux/scatterlist.h> | 7 | #include <linux/scatterlist.h> |
8 | #include <linux/dma-debug.h> | ||
8 | 9 | ||
9 | #include <asm-generic/dma-coherent.h> | 10 | #include <asm-generic/dma-coherent.h> |
10 | #include <asm/memory.h> | 11 | #include <asm/memory.h> |
11 | 12 | ||
13 | #ifdef __arch_page_to_dma | ||
14 | #error Please update to __arch_pfn_to_dma | ||
15 | #endif | ||
16 | |||
12 | /* | 17 | /* |
13 | * page_to_dma/dma_to_virt/virt_to_dma are architecture private functions | 18 | * dma_to_pfn/pfn_to_dma/dma_to_virt/virt_to_dma are architecture private |
14 | * used internally by the DMA-mapping API to provide DMA addresses. They | 19 | * functions used internally by the DMA-mapping API to provide DMA |
15 | * must not be used by drivers. | 20 | * addresses. They must not be used by drivers. |
16 | */ | 21 | */ |
17 | #ifndef __arch_page_to_dma | 22 | #ifndef __arch_pfn_to_dma |
18 | static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) | 23 | static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn) |
19 | { | 24 | { |
20 | return (dma_addr_t)__pfn_to_bus(page_to_pfn(page)); | 25 | return (dma_addr_t)__pfn_to_bus(pfn); |
21 | } | 26 | } |
22 | 27 | ||
23 | static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr) | 28 | static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr) |
24 | { | 29 | { |
25 | return pfn_to_page(__bus_to_pfn(addr)); | 30 | return __bus_to_pfn(addr); |
26 | } | 31 | } |
27 | 32 | ||
28 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) | 33 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) |
@@ -35,14 +40,14 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr) | |||
35 | return (dma_addr_t)__virt_to_bus((unsigned long)(addr)); | 40 | return (dma_addr_t)__virt_to_bus((unsigned long)(addr)); |
36 | } | 41 | } |
37 | #else | 42 | #else |
38 | static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) | 43 | static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn) |
39 | { | 44 | { |
40 | return __arch_page_to_dma(dev, page); | 45 | return __arch_pfn_to_dma(dev, pfn); |
41 | } | 46 | } |
42 | 47 | ||
43 | static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr) | 48 | static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr) |
44 | { | 49 | { |
45 | return __arch_dma_to_page(dev, addr); | 50 | return __arch_dma_to_pfn(dev, addr); |
46 | } | 51 | } |
47 | 52 | ||
48 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) | 53 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) |
@@ -293,13 +298,13 @@ extern int dma_needs_bounce(struct device*, dma_addr_t, size_t); | |||
293 | /* | 298 | /* |
294 | * The DMA API, implemented by dmabounce.c. See below for descriptions. | 299 | * The DMA API, implemented by dmabounce.c. See below for descriptions. |
295 | */ | 300 | */ |
296 | extern dma_addr_t dma_map_single(struct device *, void *, size_t, | 301 | extern dma_addr_t __dma_map_single(struct device *, void *, size_t, |
297 | enum dma_data_direction); | 302 | enum dma_data_direction); |
298 | extern void dma_unmap_single(struct device *, dma_addr_t, size_t, | 303 | extern void __dma_unmap_single(struct device *, dma_addr_t, size_t, |
299 | enum dma_data_direction); | 304 | enum dma_data_direction); |
300 | extern dma_addr_t dma_map_page(struct device *, struct page *, | 305 | extern dma_addr_t __dma_map_page(struct device *, struct page *, |
301 | unsigned long, size_t, enum dma_data_direction); | 306 | unsigned long, size_t, enum dma_data_direction); |
302 | extern void dma_unmap_page(struct device *, dma_addr_t, size_t, | 307 | extern void __dma_unmap_page(struct device *, dma_addr_t, size_t, |
303 | enum dma_data_direction); | 308 | enum dma_data_direction); |
304 | 309 | ||
305 | /* | 310 | /* |
@@ -323,6 +328,34 @@ static inline int dmabounce_sync_for_device(struct device *d, dma_addr_t addr, | |||
323 | } | 328 | } |
324 | 329 | ||
325 | 330 | ||
331 | static inline dma_addr_t __dma_map_single(struct device *dev, void *cpu_addr, | ||
332 | size_t size, enum dma_data_direction dir) | ||
333 | { | ||
334 | __dma_single_cpu_to_dev(cpu_addr, size, dir); | ||
335 | return virt_to_dma(dev, cpu_addr); | ||
336 | } | ||
337 | |||
338 | static inline dma_addr_t __dma_map_page(struct device *dev, struct page *page, | ||
339 | unsigned long offset, size_t size, enum dma_data_direction dir) | ||
340 | { | ||
341 | __dma_page_cpu_to_dev(page, offset, size, dir); | ||
342 | return pfn_to_dma(dev, page_to_pfn(page)) + offset; | ||
343 | } | ||
344 | |||
345 | static inline void __dma_unmap_single(struct device *dev, dma_addr_t handle, | ||
346 | size_t size, enum dma_data_direction dir) | ||
347 | { | ||
348 | __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir); | ||
349 | } | ||
350 | |||
351 | static inline void __dma_unmap_page(struct device *dev, dma_addr_t handle, | ||
352 | size_t size, enum dma_data_direction dir) | ||
353 | { | ||
354 | __dma_page_dev_to_cpu(pfn_to_page(dma_to_pfn(dev, handle)), | ||
355 | handle & ~PAGE_MASK, size, dir); | ||
356 | } | ||
357 | #endif /* CONFIG_DMABOUNCE */ | ||
358 | |||
326 | /** | 359 | /** |
327 | * dma_map_single - map a single buffer for streaming DMA | 360 | * dma_map_single - map a single buffer for streaming DMA |
328 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices | 361 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices |
@@ -340,11 +373,16 @@ static inline int dmabounce_sync_for_device(struct device *d, dma_addr_t addr, | |||
340 | static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, | 373 | static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, |
341 | size_t size, enum dma_data_direction dir) | 374 | size_t size, enum dma_data_direction dir) |
342 | { | 375 | { |
376 | dma_addr_t addr; | ||
377 | |||
343 | BUG_ON(!valid_dma_direction(dir)); | 378 | BUG_ON(!valid_dma_direction(dir)); |
344 | 379 | ||
345 | __dma_single_cpu_to_dev(cpu_addr, size, dir); | 380 | addr = __dma_map_single(dev, cpu_addr, size, dir); |
381 | debug_dma_map_page(dev, virt_to_page(cpu_addr), | ||
382 | (unsigned long)cpu_addr & ~PAGE_MASK, size, | ||
383 | dir, addr, true); | ||
346 | 384 | ||
347 | return virt_to_dma(dev, cpu_addr); | 385 | return addr; |
348 | } | 386 | } |
349 | 387 | ||
350 | /** | 388 | /** |
@@ -364,11 +402,14 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, | |||
364 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | 402 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, |
365 | unsigned long offset, size_t size, enum dma_data_direction dir) | 403 | unsigned long offset, size_t size, enum dma_data_direction dir) |
366 | { | 404 | { |
405 | dma_addr_t addr; | ||
406 | |||
367 | BUG_ON(!valid_dma_direction(dir)); | 407 | BUG_ON(!valid_dma_direction(dir)); |
368 | 408 | ||
369 | __dma_page_cpu_to_dev(page, offset, size, dir); | 409 | addr = __dma_map_page(dev, page, offset, size, dir); |
410 | debug_dma_map_page(dev, page, offset, size, dir, addr, false); | ||
370 | 411 | ||
371 | return page_to_dma(dev, page) + offset; | 412 | return addr; |
372 | } | 413 | } |
373 | 414 | ||
374 | /** | 415 | /** |
@@ -388,7 +429,8 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
388 | static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, | 429 | static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, |
389 | size_t size, enum dma_data_direction dir) | 430 | size_t size, enum dma_data_direction dir) |
390 | { | 431 | { |
391 | __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir); | 432 | debug_dma_unmap_page(dev, handle, size, dir, true); |
433 | __dma_unmap_single(dev, handle, size, dir); | ||
392 | } | 434 | } |
393 | 435 | ||
394 | /** | 436 | /** |
@@ -408,10 +450,9 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, | |||
408 | static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, | 450 | static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, |
409 | size_t size, enum dma_data_direction dir) | 451 | size_t size, enum dma_data_direction dir) |
410 | { | 452 | { |
411 | __dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK, | 453 | debug_dma_unmap_page(dev, handle, size, dir, false); |
412 | size, dir); | 454 | __dma_unmap_page(dev, handle, size, dir); |
413 | } | 455 | } |
414 | #endif /* CONFIG_DMABOUNCE */ | ||
415 | 456 | ||
416 | /** | 457 | /** |
417 | * dma_sync_single_range_for_cpu | 458 | * dma_sync_single_range_for_cpu |
@@ -437,6 +478,8 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, | |||
437 | { | 478 | { |
438 | BUG_ON(!valid_dma_direction(dir)); | 479 | BUG_ON(!valid_dma_direction(dir)); |
439 | 480 | ||
481 | debug_dma_sync_single_for_cpu(dev, handle + offset, size, dir); | ||
482 | |||
440 | if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir)) | 483 | if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir)) |
441 | return; | 484 | return; |
442 | 485 | ||
@@ -449,6 +492,8 @@ static inline void dma_sync_single_range_for_device(struct device *dev, | |||
449 | { | 492 | { |
450 | BUG_ON(!valid_dma_direction(dir)); | 493 | BUG_ON(!valid_dma_direction(dir)); |
451 | 494 | ||
495 | debug_dma_sync_single_for_device(dev, handle + offset, size, dir); | ||
496 | |||
452 | if (!dmabounce_sync_for_device(dev, handle, offset, size, dir)) | 497 | if (!dmabounce_sync_for_device(dev, handle, offset, size, dir)) |
453 | return; | 498 | return; |
454 | 499 | ||
diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h index cc7ef4080711..af18ceaacf5d 100644 --- a/arch/arm/include/asm/domain.h +++ b/arch/arm/include/asm/domain.h | |||
@@ -45,13 +45,17 @@ | |||
45 | */ | 45 | */ |
46 | #define DOMAIN_NOACCESS 0 | 46 | #define DOMAIN_NOACCESS 0 |
47 | #define DOMAIN_CLIENT 1 | 47 | #define DOMAIN_CLIENT 1 |
48 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
48 | #define DOMAIN_MANAGER 3 | 49 | #define DOMAIN_MANAGER 3 |
50 | #else | ||
51 | #define DOMAIN_MANAGER 1 | ||
52 | #endif | ||
49 | 53 | ||
50 | #define domain_val(dom,type) ((type) << (2*(dom))) | 54 | #define domain_val(dom,type) ((type) << (2*(dom))) |
51 | 55 | ||
52 | #ifndef __ASSEMBLY__ | 56 | #ifndef __ASSEMBLY__ |
53 | 57 | ||
54 | #ifdef CONFIG_MMU | 58 | #ifdef CONFIG_CPU_USE_DOMAINS |
55 | #define set_domain(x) \ | 59 | #define set_domain(x) \ |
56 | do { \ | 60 | do { \ |
57 | __asm__ __volatile__( \ | 61 | __asm__ __volatile__( \ |
@@ -74,5 +78,28 @@ | |||
74 | #define modify_domain(dom,type) do { } while (0) | 78 | #define modify_domain(dom,type) do { } while (0) |
75 | #endif | 79 | #endif |
76 | 80 | ||
81 | /* | ||
82 | * Generate the T (user) versions of the LDR/STR and related | ||
83 | * instructions (inline assembly) | ||
84 | */ | ||
85 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
86 | #define T(instr) #instr "t" | ||
87 | #else | ||
88 | #define T(instr) #instr | ||
77 | #endif | 89 | #endif |
78 | #endif /* !__ASSEMBLY__ */ | 90 | |
91 | #else /* __ASSEMBLY__ */ | ||
92 | |||
93 | /* | ||
94 | * Generate the T (user) versions of the LDR/STR and related | ||
95 | * instructions | ||
96 | */ | ||
97 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
98 | #define T(instr) instr ## t | ||
99 | #else | ||
100 | #define T(instr) instr | ||
101 | #endif | ||
102 | |||
103 | #endif /* __ASSEMBLY__ */ | ||
104 | |||
105 | #endif /* !__ASM_PROC_DOMAIN_H */ | ||
diff --git a/arch/arm/include/asm/entry-macro-multi.S b/arch/arm/include/asm/entry-macro-multi.S new file mode 100644 index 000000000000..ec0bbf79c71f --- /dev/null +++ b/arch/arm/include/asm/entry-macro-multi.S | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Interrupt handling. Preserves r7, r8, r9 | ||
3 | */ | ||
4 | .macro arch_irq_handler_default | ||
5 | get_irqnr_preamble r5, lr | ||
6 | 1: get_irqnr_and_base r0, r6, r5, lr | ||
7 | movne r1, sp | ||
8 | @ | ||
9 | @ routine called with r0 = irq number, r1 = struct pt_regs * | ||
10 | @ | ||
11 | adrne lr, BSYM(1b) | ||
12 | bne asm_do_IRQ | ||
13 | |||
14 | #ifdef CONFIG_SMP | ||
15 | /* | ||
16 | * XXX | ||
17 | * | ||
18 | * this macro assumes that irqstat (r6) and base (r5) are | ||
19 | * preserved from get_irqnr_and_base above | ||
20 | */ | ||
21 | ALT_SMP(test_for_ipi r0, r6, r5, lr) | ||
22 | ALT_UP_B(9997f) | ||
23 | movne r1, sp | ||
24 | adrne lr, BSYM(1b) | ||
25 | bne do_IPI | ||
26 | |||
27 | #ifdef CONFIG_LOCAL_TIMERS | ||
28 | test_for_ltirq r0, r6, r5, lr | ||
29 | movne r0, sp | ||
30 | adrne lr, BSYM(1b) | ||
31 | bne do_local_timer | ||
32 | #endif | ||
33 | #endif | ||
34 | 9997: | ||
35 | .endm | ||
36 | |||
37 | .macro arch_irq_handler, symbol_name | ||
38 | .align 5 | ||
39 | .global \symbol_name | ||
40 | \symbol_name: | ||
41 | mov r4, lr | ||
42 | arch_irq_handler_default | ||
43 | mov pc, r4 | ||
44 | .endm | ||
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h index 540a044153a5..b33fe7065b38 100644 --- a/arch/arm/include/asm/futex.h +++ b/arch/arm/include/asm/futex.h | |||
@@ -13,12 +13,13 @@ | |||
13 | #include <linux/preempt.h> | 13 | #include <linux/preempt.h> |
14 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
15 | #include <asm/errno.h> | 15 | #include <asm/errno.h> |
16 | #include <asm/domain.h> | ||
16 | 17 | ||
17 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 18 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ |
18 | __asm__ __volatile__( \ | 19 | __asm__ __volatile__( \ |
19 | "1: ldrt %1, [%2]\n" \ | 20 | "1: " T(ldr) " %1, [%2]\n" \ |
20 | " " insn "\n" \ | 21 | " " insn "\n" \ |
21 | "2: strt %0, [%2]\n" \ | 22 | "2: " T(str) " %0, [%2]\n" \ |
22 | " mov %0, #0\n" \ | 23 | " mov %0, #0\n" \ |
23 | "3:\n" \ | 24 | "3:\n" \ |
24 | " .pushsection __ex_table,\"a\"\n" \ | 25 | " .pushsection __ex_table,\"a\"\n" \ |
@@ -97,10 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | |||
97 | pagefault_disable(); /* implies preempt_disable() */ | 98 | pagefault_disable(); /* implies preempt_disable() */ |
98 | 99 | ||
99 | __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" | 100 | __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" |
100 | "1: ldrt %0, [%3]\n" | 101 | "1: " T(ldr) " %0, [%3]\n" |
101 | " teq %0, %1\n" | 102 | " teq %0, %1\n" |
102 | " it eq @ explicit IT needed for the 2b label\n" | 103 | " it eq @ explicit IT needed for the 2b label\n" |
103 | "2: streqt %2, [%3]\n" | 104 | "2: " T(streq) " %2, [%3]\n" |
104 | "3:\n" | 105 | "3:\n" |
105 | " .pushsection __ex_table,\"a\"\n" | 106 | " .pushsection __ex_table,\"a\"\n" |
106 | " .align 3\n" | 107 | " .align 3\n" |
diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index 6d7485aff955..89ad1805e579 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h | |||
@@ -5,13 +5,31 @@ | |||
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <asm/irq.h> | 6 | #include <asm/irq.h> |
7 | 7 | ||
8 | #define NR_IPI 5 | ||
9 | |||
8 | typedef struct { | 10 | typedef struct { |
9 | unsigned int __softirq_pending; | 11 | unsigned int __softirq_pending; |
12 | #ifdef CONFIG_LOCAL_TIMERS | ||
10 | unsigned int local_timer_irqs; | 13 | unsigned int local_timer_irqs; |
14 | #endif | ||
15 | #ifdef CONFIG_SMP | ||
16 | unsigned int ipi_irqs[NR_IPI]; | ||
17 | #endif | ||
11 | } ____cacheline_aligned irq_cpustat_t; | 18 | } ____cacheline_aligned irq_cpustat_t; |
12 | 19 | ||
13 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 20 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
14 | 21 | ||
22 | #define __inc_irq_stat(cpu, member) __IRQ_STAT(cpu, member)++ | ||
23 | #define __get_irq_stat(cpu, member) __IRQ_STAT(cpu, member) | ||
24 | |||
25 | #ifdef CONFIG_SMP | ||
26 | u64 smp_irq_stat_cpu(unsigned int cpu); | ||
27 | #else | ||
28 | #define smp_irq_stat_cpu(cpu) 0 | ||
29 | #endif | ||
30 | |||
31 | #define arch_irq_stat_cpu smp_irq_stat_cpu | ||
32 | |||
15 | #if NR_IRQS > 512 | 33 | #if NR_IRQS > 512 |
16 | #define HARDIRQ_BITS 10 | 34 | #define HARDIRQ_BITS 10 |
17 | #elif NR_IRQS > 256 | 35 | #elif NR_IRQS > 256 |
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h index 50c7e7cfd670..6bc63ab498ce 100644 --- a/arch/arm/include/asm/localtimer.h +++ b/arch/arm/include/asm/localtimer.h | |||
@@ -30,7 +30,6 @@ asmlinkage void do_local_timer(struct pt_regs *); | |||
30 | #include "smp_twd.h" | 30 | #include "smp_twd.h" |
31 | 31 | ||
32 | #define local_timer_ack() twd_timer_ack() | 32 | #define local_timer_ack() twd_timer_ack() |
33 | #define local_timer_stop() twd_timer_stop() | ||
34 | 33 | ||
35 | #else | 34 | #else |
36 | 35 | ||
@@ -40,11 +39,6 @@ asmlinkage void do_local_timer(struct pt_regs *); | |||
40 | */ | 39 | */ |
41 | int local_timer_ack(void); | 40 | int local_timer_ack(void); |
42 | 41 | ||
43 | /* | ||
44 | * Stop a local timer interrupt. | ||
45 | */ | ||
46 | void local_timer_stop(void); | ||
47 | |||
48 | #endif | 42 | #endif |
49 | 43 | ||
50 | /* | 44 | /* |
@@ -52,12 +46,6 @@ void local_timer_stop(void); | |||
52 | */ | 46 | */ |
53 | void local_timer_setup(struct clock_event_device *); | 47 | void local_timer_setup(struct clock_event_device *); |
54 | 48 | ||
55 | #else | ||
56 | |||
57 | static inline void local_timer_stop(void) | ||
58 | { | ||
59 | } | ||
60 | |||
61 | #endif | 49 | #endif |
62 | 50 | ||
63 | #endif | 51 | #endif |
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index d97a964207fa..3a0893a76a3b 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h | |||
@@ -37,12 +37,21 @@ struct machine_desc { | |||
37 | struct meminfo *); | 37 | struct meminfo *); |
38 | void (*reserve)(void);/* reserve mem blocks */ | 38 | void (*reserve)(void);/* reserve mem blocks */ |
39 | void (*map_io)(void);/* IO mapping function */ | 39 | void (*map_io)(void);/* IO mapping function */ |
40 | void (*init_early)(void); | ||
40 | void (*init_irq)(void); | 41 | void (*init_irq)(void); |
41 | struct sys_timer *timer; /* system tick timer */ | 42 | struct sys_timer *timer; /* system tick timer */ |
42 | void (*init_machine)(void); | 43 | void (*init_machine)(void); |
44 | #ifdef CONFIG_MULTI_IRQ_HANDLER | ||
45 | void (*handle_irq)(struct pt_regs *); | ||
46 | #endif | ||
43 | }; | 47 | }; |
44 | 48 | ||
45 | /* | 49 | /* |
50 | * Current machine - only accessible during boot. | ||
51 | */ | ||
52 | extern struct machine_desc *machine_desc; | ||
53 | |||
54 | /* | ||
46 | * Set of macros to define architecture features. This is built into | 55 | * Set of macros to define architecture features. This is built into |
47 | * a table by the linker. | 56 | * a table by the linker. |
48 | */ | 57 | */ |
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h index ce3eee9fe26c..22ac140edd9e 100644 --- a/arch/arm/include/asm/mach/irq.h +++ b/arch/arm/include/asm/mach/irq.h | |||
@@ -17,10 +17,12 @@ struct seq_file; | |||
17 | /* | 17 | /* |
18 | * This is internal. Do not use it. | 18 | * This is internal. Do not use it. |
19 | */ | 19 | */ |
20 | extern unsigned int arch_nr_irqs; | ||
21 | extern void (*init_arch_irq)(void); | ||
22 | extern void init_FIQ(void); | 20 | extern void init_FIQ(void); |
23 | extern int show_fiq_list(struct seq_file *, void *); | 21 | extern int show_fiq_list(struct seq_file *, int); |
22 | |||
23 | #ifdef CONFIG_MULTI_IRQ_HANDLER | ||
24 | extern void (*handle_arch_irq)(struct pt_regs *); | ||
25 | #endif | ||
24 | 26 | ||
25 | /* | 27 | /* |
26 | * This is for easy migration, but should be changed in the source | 28 | * This is for easy migration, but should be changed in the source |
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 35d408f6dccf..883f6be5117a 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h | |||
@@ -43,7 +43,6 @@ struct sys_timer { | |||
43 | #endif | 43 | #endif |
44 | }; | 44 | }; |
45 | 45 | ||
46 | extern struct sys_timer *system_timer; | ||
47 | extern void timer_tick(void); | 46 | extern void timer_tick(void); |
48 | 47 | ||
49 | #endif | 48 | #endif |
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 3d05190797cb..96ed521f2408 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
@@ -33,27 +33,23 @@ struct seq_file; | |||
33 | /* | 33 | /* |
34 | * generate IPI list text | 34 | * generate IPI list text |
35 | */ | 35 | */ |
36 | extern void show_ipi_list(struct seq_file *p); | 36 | extern void show_ipi_list(struct seq_file *, int); |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * Called from assembly code, this handles an IPI. | 39 | * Called from assembly code, this handles an IPI. |
40 | */ | 40 | */ |
41 | asmlinkage void do_IPI(struct pt_regs *regs); | 41 | asmlinkage void do_IPI(int ipinr, struct pt_regs *regs); |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * Setup the set of possible CPUs (via set_cpu_possible) | 44 | * Setup the set of possible CPUs (via set_cpu_possible) |
45 | */ | 45 | */ |
46 | extern void smp_init_cpus(void); | 46 | extern void smp_init_cpus(void); |
47 | 47 | ||
48 | /* | ||
49 | * Move global data into per-processor storage. | ||
50 | */ | ||
51 | extern void smp_store_cpu_info(unsigned int cpuid); | ||
52 | 48 | ||
53 | /* | 49 | /* |
54 | * Raise an IPI cross call on CPUs in callmap. | 50 | * Raise an IPI cross call on CPUs in callmap. |
55 | */ | 51 | */ |
56 | extern void smp_cross_call(const struct cpumask *mask); | 52 | extern void smp_cross_call(const struct cpumask *mask, int ipi); |
57 | 53 | ||
58 | /* | 54 | /* |
59 | * Boot a secondary CPU, and assign it the specified idle task. | 55 | * Boot a secondary CPU, and assign it the specified idle task. |
@@ -73,6 +69,11 @@ asmlinkage void secondary_start_kernel(void); | |||
73 | extern void platform_secondary_init(unsigned int cpu); | 69 | extern void platform_secondary_init(unsigned int cpu); |
74 | 70 | ||
75 | /* | 71 | /* |
72 | * Initialize cpu_possible map, and enable coherency | ||
73 | */ | ||
74 | extern void platform_smp_prepare_cpus(unsigned int); | ||
75 | |||
76 | /* | ||
76 | * Initial data for bringing up a secondary CPU. | 77 | * Initial data for bringing up a secondary CPU. |
77 | */ | 78 | */ |
78 | struct secondary_data { | 79 | struct secondary_data { |
@@ -97,6 +98,6 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | |||
97 | /* | 98 | /* |
98 | * show local interrupt info | 99 | * show local interrupt info |
99 | */ | 100 | */ |
100 | extern void show_local_irqs(struct seq_file *); | 101 | extern void show_local_irqs(struct seq_file *, int); |
101 | 102 | ||
102 | #endif /* ifndef __ASM_ARM_SMP_H */ | 103 | #endif /* ifndef __ASM_ARM_SMP_H */ |
diff --git a/arch/arm/include/asm/smp_mpidr.h b/arch/arm/include/asm/smp_mpidr.h deleted file mode 100644 index 6a9307d64900..000000000000 --- a/arch/arm/include/asm/smp_mpidr.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef ASMARM_SMP_MIDR_H | ||
2 | #define ASMARM_SMP_MIDR_H | ||
3 | |||
4 | #define hard_smp_processor_id() \ | ||
5 | ({ \ | ||
6 | unsigned int cpunum; \ | ||
7 | __asm__("\n" \ | ||
8 | "1: mrc p15, 0, %0, c0, c0, 5\n" \ | ||
9 | " .pushsection \".alt.smp.init\", \"a\"\n"\ | ||
10 | " .long 1b\n" \ | ||
11 | " mov %0, #0\n" \ | ||
12 | " .popsection" \ | ||
13 | : "=r" (cpunum)); \ | ||
14 | cpunum &= 0x0F; \ | ||
15 | }) | ||
16 | |||
17 | #endif | ||
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h index 634f357be6bb..fed9981fba08 100644 --- a/arch/arm/include/asm/smp_twd.h +++ b/arch/arm/include/asm/smp_twd.h | |||
@@ -22,7 +22,6 @@ struct clock_event_device; | |||
22 | 22 | ||
23 | extern void __iomem *twd_base; | 23 | extern void __iomem *twd_base; |
24 | 24 | ||
25 | void twd_timer_stop(void); | ||
26 | int twd_timer_ack(void); | 25 | int twd_timer_ack(void); |
27 | void twd_timer_setup(struct clock_event_device *); | 26 | void twd_timer_setup(struct clock_event_device *); |
28 | 27 | ||
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 3222ab8b3447..97f6d60297d5 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
@@ -124,6 +124,13 @@ extern unsigned int user_debug; | |||
124 | #define vectors_high() (0) | 124 | #define vectors_high() (0) |
125 | #endif | 125 | #endif |
126 | 126 | ||
127 | #if __LINUX_ARM_ARCH__ >= 7 || \ | ||
128 | (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K)) | ||
129 | #define sev() __asm__ __volatile__ ("sev" : : : "memory") | ||
130 | #define wfe() __asm__ __volatile__ ("wfe" : : : "memory") | ||
131 | #define wfi() __asm__ __volatile__ ("wfi" : : : "memory") | ||
132 | #endif | ||
133 | |||
127 | #if __LINUX_ARM_ARCH__ >= 7 | 134 | #if __LINUX_ARM_ARCH__ >= 7 |
128 | #define isb() __asm__ __volatile__ ("isb" : : : "memory") | 135 | #define isb() __asm__ __volatile__ ("isb" : : : "memory") |
129 | #define dsb() __asm__ __volatile__ ("dsb" : : : "memory") | 136 | #define dsb() __asm__ __volatile__ ("dsb" : : : "memory") |
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h index 124475afb007..1b960d5ef6a5 100644 --- a/arch/arm/include/asm/traps.h +++ b/arch/arm/include/asm/traps.h | |||
@@ -46,4 +46,6 @@ static inline int in_exception_text(unsigned long ptr) | |||
46 | extern void __init early_trap_init(void); | 46 | extern void __init early_trap_init(void); |
47 | extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); | 47 | extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); |
48 | 48 | ||
49 | extern void *vectors_page; | ||
50 | |||
49 | #endif | 51 | #endif |
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 33e4a48fe103..b293616a1a1a 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h | |||
@@ -227,7 +227,7 @@ do { \ | |||
227 | 227 | ||
228 | #define __get_user_asm_byte(x,addr,err) \ | 228 | #define __get_user_asm_byte(x,addr,err) \ |
229 | __asm__ __volatile__( \ | 229 | __asm__ __volatile__( \ |
230 | "1: ldrbt %1,[%2]\n" \ | 230 | "1: " T(ldrb) " %1,[%2],#0\n" \ |
231 | "2:\n" \ | 231 | "2:\n" \ |
232 | " .pushsection .fixup,\"ax\"\n" \ | 232 | " .pushsection .fixup,\"ax\"\n" \ |
233 | " .align 2\n" \ | 233 | " .align 2\n" \ |
@@ -263,7 +263,7 @@ do { \ | |||
263 | 263 | ||
264 | #define __get_user_asm_word(x,addr,err) \ | 264 | #define __get_user_asm_word(x,addr,err) \ |
265 | __asm__ __volatile__( \ | 265 | __asm__ __volatile__( \ |
266 | "1: ldrt %1,[%2]\n" \ | 266 | "1: " T(ldr) " %1,[%2],#0\n" \ |
267 | "2:\n" \ | 267 | "2:\n" \ |
268 | " .pushsection .fixup,\"ax\"\n" \ | 268 | " .pushsection .fixup,\"ax\"\n" \ |
269 | " .align 2\n" \ | 269 | " .align 2\n" \ |
@@ -308,7 +308,7 @@ do { \ | |||
308 | 308 | ||
309 | #define __put_user_asm_byte(x,__pu_addr,err) \ | 309 | #define __put_user_asm_byte(x,__pu_addr,err) \ |
310 | __asm__ __volatile__( \ | 310 | __asm__ __volatile__( \ |
311 | "1: strbt %1,[%2]\n" \ | 311 | "1: " T(strb) " %1,[%2],#0\n" \ |
312 | "2:\n" \ | 312 | "2:\n" \ |
313 | " .pushsection .fixup,\"ax\"\n" \ | 313 | " .pushsection .fixup,\"ax\"\n" \ |
314 | " .align 2\n" \ | 314 | " .align 2\n" \ |
@@ -341,7 +341,7 @@ do { \ | |||
341 | 341 | ||
342 | #define __put_user_asm_word(x,__pu_addr,err) \ | 342 | #define __put_user_asm_word(x,__pu_addr,err) \ |
343 | __asm__ __volatile__( \ | 343 | __asm__ __volatile__( \ |
344 | "1: strt %1,[%2]\n" \ | 344 | "1: " T(str) " %1,[%2],#0\n" \ |
345 | "2:\n" \ | 345 | "2:\n" \ |
346 | " .pushsection .fixup,\"ax\"\n" \ | 346 | " .pushsection .fixup,\"ax\"\n" \ |
347 | " .align 2\n" \ | 347 | " .align 2\n" \ |
@@ -366,10 +366,10 @@ do { \ | |||
366 | 366 | ||
367 | #define __put_user_asm_dword(x,__pu_addr,err) \ | 367 | #define __put_user_asm_dword(x,__pu_addr,err) \ |
368 | __asm__ __volatile__( \ | 368 | __asm__ __volatile__( \ |
369 | ARM( "1: strt " __reg_oper1 ", [%1], #4\n" ) \ | 369 | ARM( "1: " T(str) " " __reg_oper1 ", [%1], #4\n" ) \ |
370 | ARM( "2: strt " __reg_oper0 ", [%1]\n" ) \ | 370 | ARM( "2: " T(str) " " __reg_oper0 ", [%1]\n" ) \ |
371 | THUMB( "1: strt " __reg_oper1 ", [%1]\n" ) \ | 371 | THUMB( "1: " T(str) " " __reg_oper1 ", [%1]\n" ) \ |
372 | THUMB( "2: strt " __reg_oper0 ", [%1, #4]\n" ) \ | 372 | THUMB( "2: " T(str) " " __reg_oper0 ", [%1, #4]\n" ) \ |
373 | "3:\n" \ | 373 | "3:\n" \ |
374 | " .pushsection .fixup,\"ax\"\n" \ | 374 | " .pushsection .fixup,\"ax\"\n" \ |
375 | " .align 2\n" \ | 375 | " .align 2\n" \ |