diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/compressed/head.S | 2 | ||||
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 5 | ||||
-rw-r--r-- | arch/arm/kernel/signal.c | 29 | ||||
-rw-r--r-- | arch/arm/kernel/signal.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 3 | ||||
-rw-r--r-- | arch/sparc/mm/iommu.c | 13 | ||||
-rw-r--r-- | arch/sparc64/kernel/time.c | 22 |
7 files changed, 43 insertions, 33 deletions
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index aaa47400eb9c..db3389d8e027 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -334,7 +334,7 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size | |||
334 | mov r1, #0x12 | 334 | mov r1, #0x12 |
335 | orr r1, r1, #3 << 10 | 335 | orr r1, r1, #3 << 10 |
336 | add r2, r3, #16384 | 336 | add r2, r3, #16384 |
337 | 1: cmp r1, r8 @ if virt > start of RAM | 337 | 1: cmp r1, r9 @ if virt > start of RAM |
338 | orrhs r1, r1, #0x0c @ set cacheable, bufferable | 338 | orrhs r1, r1, #0x0c @ set cacheable, bufferable |
339 | cmp r1, r10 @ if virt > end of RAM | 339 | cmp r1, r10 @ if virt > end of RAM |
340 | bichs r1, r1, #0x0c @ clear cacheable, bufferable | 340 | bichs r1, r1, #0x0c @ clear cacheable, bufferable |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 874e6bb79405..d401d908c463 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -735,8 +735,11 @@ __kuser_cmpxchg: @ 0xffff0fc0 | |||
735 | * The kernel itself must perform the operation. | 735 | * The kernel itself must perform the operation. |
736 | * A special ghost syscall is used for that (see traps.c). | 736 | * A special ghost syscall is used for that (see traps.c). |
737 | */ | 737 | */ |
738 | stmfd sp!, {r7, lr} | ||
739 | mov r7, #0xff00 @ 0xfff0 into r7 for EABI | ||
740 | orr r7, r7, #0xf0 | ||
738 | swi #0x9ffff0 | 741 | swi #0x9ffff0 |
739 | mov pc, lr | 742 | ldmfd sp!, {r7, pc} |
740 | 743 | ||
741 | #elif __LINUX_ARM_ARCH__ < 6 | 744 | #elif __LINUX_ARM_ARCH__ < 6 |
742 | 745 | ||
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 765922bcf9e7..a0cd0a90a10d 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -30,15 +30,21 @@ | |||
30 | #define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn)) | 30 | #define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn)) |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * With EABI, the syscall number has to be loaded into r7. | ||
34 | */ | ||
35 | #define MOV_R7_NR_SIGRETURN (0xe3a07000 | (__NR_sigreturn - __NR_SYSCALL_BASE)) | ||
36 | #define MOV_R7_NR_RT_SIGRETURN (0xe3a07000 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) | ||
37 | |||
38 | /* | ||
33 | * For Thumb syscalls, we pass the syscall number via r7. We therefore | 39 | * For Thumb syscalls, we pass the syscall number via r7. We therefore |
34 | * need two 16-bit instructions. | 40 | * need two 16-bit instructions. |
35 | */ | 41 | */ |
36 | #define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE)) | 42 | #define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE)) |
37 | #define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) | 43 | #define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) |
38 | 44 | ||
39 | const unsigned long sigreturn_codes[4] = { | 45 | const unsigned long sigreturn_codes[7] = { |
40 | SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN, | 46 | MOV_R7_NR_SIGRETURN, SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN, |
41 | SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN | 47 | MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, |
42 | }; | 48 | }; |
43 | 49 | ||
44 | static int do_signal(sigset_t *oldset, struct pt_regs * regs, int syscall); | 50 | static int do_signal(sigset_t *oldset, struct pt_regs * regs, int syscall); |
@@ -189,7 +195,7 @@ struct aux_sigframe { | |||
189 | struct sigframe { | 195 | struct sigframe { |
190 | struct sigcontext sc; | 196 | struct sigcontext sc; |
191 | unsigned long extramask[_NSIG_WORDS-1]; | 197 | unsigned long extramask[_NSIG_WORDS-1]; |
192 | unsigned long retcode; | 198 | unsigned long retcode[2]; |
193 | struct aux_sigframe aux __attribute__((aligned(8))); | 199 | struct aux_sigframe aux __attribute__((aligned(8))); |
194 | }; | 200 | }; |
195 | 201 | ||
@@ -198,7 +204,7 @@ struct rt_sigframe { | |||
198 | void __user *puc; | 204 | void __user *puc; |
199 | struct siginfo info; | 205 | struct siginfo info; |
200 | struct ucontext uc; | 206 | struct ucontext uc; |
201 | unsigned long retcode; | 207 | unsigned long retcode[2]; |
202 | struct aux_sigframe aux __attribute__((aligned(8))); | 208 | struct aux_sigframe aux __attribute__((aligned(8))); |
203 | }; | 209 | }; |
204 | 210 | ||
@@ -436,12 +442,13 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka, | |||
436 | if (ka->sa.sa_flags & SA_RESTORER) { | 442 | if (ka->sa.sa_flags & SA_RESTORER) { |
437 | retcode = (unsigned long)ka->sa.sa_restorer; | 443 | retcode = (unsigned long)ka->sa.sa_restorer; |
438 | } else { | 444 | } else { |
439 | unsigned int idx = thumb; | 445 | unsigned int idx = thumb << 1; |
440 | 446 | ||
441 | if (ka->sa.sa_flags & SA_SIGINFO) | 447 | if (ka->sa.sa_flags & SA_SIGINFO) |
442 | idx += 2; | 448 | idx += 3; |
443 | 449 | ||
444 | if (__put_user(sigreturn_codes[idx], rc)) | 450 | if (__put_user(sigreturn_codes[idx], rc) || |
451 | __put_user(sigreturn_codes[idx+1], rc+1)) | ||
445 | return 1; | 452 | return 1; |
446 | 453 | ||
447 | if (cpsr & MODE32_BIT) { | 454 | if (cpsr & MODE32_BIT) { |
@@ -456,7 +463,7 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka, | |||
456 | * the return code written onto the stack. | 463 | * the return code written onto the stack. |
457 | */ | 464 | */ |
458 | flush_icache_range((unsigned long)rc, | 465 | flush_icache_range((unsigned long)rc, |
459 | (unsigned long)(rc + 1)); | 466 | (unsigned long)(rc + 2)); |
460 | 467 | ||
461 | retcode = ((unsigned long)rc) + thumb; | 468 | retcode = ((unsigned long)rc) + thumb; |
462 | } | 469 | } |
@@ -488,7 +495,7 @@ setup_frame(int usig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *reg | |||
488 | } | 495 | } |
489 | 496 | ||
490 | if (err == 0) | 497 | if (err == 0) |
491 | err = setup_return(regs, ka, &frame->retcode, frame, usig); | 498 | err = setup_return(regs, ka, frame->retcode, frame, usig); |
492 | 499 | ||
493 | return err; | 500 | return err; |
494 | } | 501 | } |
@@ -522,7 +529,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
522 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 529 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
523 | 530 | ||
524 | if (err == 0) | 531 | if (err == 0) |
525 | err = setup_return(regs, ka, &frame->retcode, frame, usig); | 532 | err = setup_return(regs, ka, frame->retcode, frame, usig); |
526 | 533 | ||
527 | if (err == 0) { | 534 | if (err == 0) { |
528 | /* | 535 | /* |
diff --git a/arch/arm/kernel/signal.h b/arch/arm/kernel/signal.h index 91d26faca62b..9991049c522d 100644 --- a/arch/arm/kernel/signal.h +++ b/arch/arm/kernel/signal.h | |||
@@ -9,4 +9,4 @@ | |||
9 | */ | 9 | */ |
10 | #define KERN_SIGRETURN_CODE 0xffff0500 | 10 | #define KERN_SIGRETURN_CODE 0xffff0500 |
11 | 11 | ||
12 | extern const unsigned long sigreturn_codes[4]; | 12 | extern const unsigned long sigreturn_codes[7]; |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 6b393691d0e8..4bdc9d4526cd 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -333,6 +333,7 @@ static struct platform_device *ixp46x_devices[] __initdata = { | |||
333 | }; | 333 | }; |
334 | 334 | ||
335 | unsigned long ixp4xx_exp_bus_size; | 335 | unsigned long ixp4xx_exp_bus_size; |
336 | EXPORT_SYMBOL(ixp4xx_exp_bus_size); | ||
336 | 337 | ||
337 | void __init ixp4xx_sys_init(void) | 338 | void __init ixp4xx_sys_init(void) |
338 | { | 339 | { |
@@ -352,7 +353,7 @@ void __init ixp4xx_sys_init(void) | |||
352 | } | 353 | } |
353 | } | 354 | } |
354 | 355 | ||
355 | printk("IXP4xx: Using %uMiB expansion bus window size\n", | 356 | printk("IXP4xx: Using %luMiB expansion bus window size\n", |
356 | ixp4xx_exp_bus_size >> 20); | 357 | ixp4xx_exp_bus_size >> 20); |
357 | } | 358 | } |
358 | 359 | ||
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index 489bf68d5f05..77840c804786 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c | |||
@@ -295,8 +295,7 @@ static void iommu_release_one(u32 busa, int npages, struct sbus_bus *sbus) | |||
295 | int ioptex; | 295 | int ioptex; |
296 | int i; | 296 | int i; |
297 | 297 | ||
298 | if (busa < iommu->start) | 298 | BUG_ON(busa < iommu->start); |
299 | BUG(); | ||
300 | ioptex = (busa - iommu->start) >> PAGE_SHIFT; | 299 | ioptex = (busa - iommu->start) >> PAGE_SHIFT; |
301 | for (i = 0; i < npages; i++) { | 300 | for (i = 0; i < npages; i++) { |
302 | iopte_val(iommu->page_table[ioptex + i]) = 0; | 301 | iopte_val(iommu->page_table[ioptex + i]) = 0; |
@@ -340,9 +339,9 @@ static int iommu_map_dma_area(dma_addr_t *pba, unsigned long va, | |||
340 | iopte_t *first; | 339 | iopte_t *first; |
341 | int ioptex; | 340 | int ioptex; |
342 | 341 | ||
343 | if ((va & ~PAGE_MASK) != 0) BUG(); | 342 | BUG_ON((va & ~PAGE_MASK) != 0); |
344 | if ((addr & ~PAGE_MASK) != 0) BUG(); | 343 | BUG_ON((addr & ~PAGE_MASK) != 0); |
345 | if ((len & ~PAGE_MASK) != 0) BUG(); | 344 | BUG_ON((len & ~PAGE_MASK) != 0); |
346 | 345 | ||
347 | /* page color = physical address */ | 346 | /* page color = physical address */ |
348 | ioptex = bit_map_string_get(&iommu->usemap, len >> PAGE_SHIFT, | 347 | ioptex = bit_map_string_get(&iommu->usemap, len >> PAGE_SHIFT, |
@@ -405,8 +404,8 @@ static void iommu_unmap_dma_area(unsigned long busa, int len) | |||
405 | unsigned long end; | 404 | unsigned long end; |
406 | int ioptex = (busa - iommu->start) >> PAGE_SHIFT; | 405 | int ioptex = (busa - iommu->start) >> PAGE_SHIFT; |
407 | 406 | ||
408 | if ((busa & ~PAGE_MASK) != 0) BUG(); | 407 | BUG_ON((busa & ~PAGE_MASK) != 0); |
409 | if ((len & ~PAGE_MASK) != 0) BUG(); | 408 | BUG_ON((len & ~PAGE_MASK) != 0); |
410 | 409 | ||
411 | iopte += ioptex; | 410 | iopte += ioptex; |
412 | end = busa + len; | 411 | end = busa + len; |
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 459c8fbe02b4..a22930d62adf 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c | |||
@@ -280,9 +280,9 @@ static struct sparc64_tick_ops stick_operations __read_mostly = { | |||
280 | * Since STICK is constantly updating, we have to access it carefully. | 280 | * Since STICK is constantly updating, we have to access it carefully. |
281 | * | 281 | * |
282 | * The sequence we use to read is: | 282 | * The sequence we use to read is: |
283 | * 1) read low | 283 | * 1) read high |
284 | * 2) read high | 284 | * 2) read low |
285 | * 3) read low again, if it rolled over increment high by 1 | 285 | * 3) read high again, if it rolled re-read both low and high again. |
286 | * | 286 | * |
287 | * Writing STICK safely is also tricky: | 287 | * Writing STICK safely is also tricky: |
288 | * 1) write low to zero | 288 | * 1) write low to zero |
@@ -295,18 +295,18 @@ static struct sparc64_tick_ops stick_operations __read_mostly = { | |||
295 | static unsigned long __hbird_read_stick(void) | 295 | static unsigned long __hbird_read_stick(void) |
296 | { | 296 | { |
297 | unsigned long ret, tmp1, tmp2, tmp3; | 297 | unsigned long ret, tmp1, tmp2, tmp3; |
298 | unsigned long addr = HBIRD_STICK_ADDR; | 298 | unsigned long addr = HBIRD_STICK_ADDR+8; |
299 | 299 | ||
300 | __asm__ __volatile__("ldxa [%1] %5, %2\n\t" | 300 | __asm__ __volatile__("ldxa [%1] %5, %2\n" |
301 | "add %1, 0x8, %1\n\t" | 301 | "1:\n\t" |
302 | "ldxa [%1] %5, %3\n\t" | ||
303 | "sub %1, 0x8, %1\n\t" | 302 | "sub %1, 0x8, %1\n\t" |
303 | "ldxa [%1] %5, %3\n\t" | ||
304 | "add %1, 0x8, %1\n\t" | ||
304 | "ldxa [%1] %5, %4\n\t" | 305 | "ldxa [%1] %5, %4\n\t" |
305 | "cmp %4, %2\n\t" | 306 | "cmp %4, %2\n\t" |
306 | "blu,a,pn %%xcc, 1f\n\t" | 307 | "bne,a,pn %%xcc, 1b\n\t" |
307 | " add %3, 1, %3\n" | 308 | " mov %4, %2\n\t" |
308 | "1:\n\t" | 309 | "sllx %4, 32, %4\n\t" |
309 | "sllx %3, 32, %3\n\t" | ||
310 | "or %3, %4, %0\n\t" | 310 | "or %3, %4, %0\n\t" |
311 | : "=&r" (ret), "=&r" (addr), | 311 | : "=&r" (ret), "=&r" (addr), |
312 | "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3) | 312 | "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3) |