diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 20:24:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 20:24:25 -0400 |
commit | bab2d8c6020e1d7521cb6c4939f72b061ce947bc (patch) | |
tree | 6854225ef6027c933bfc7647c55d28c4ad930f20 /arch | |
parent | 0e65ae099ca6a70a7a521e0358c57d43ec95dce5 (diff) | |
parent | fa8d9d74c360726fe743b08af00ee3d0e0eb8bc1 (diff) |
Merge tag 'for-3.4' of git://openrisc.net/jonas/linux
Pull OpenRISC changes for 3.4 from Jonas Bonn:
"This series for the OpenRISC architecture consists of mostly trivial
fixups. The most interesting bits of the series are:
* A fix to the timer code whereby the shortest trigger period is set
to 100 cycles; previously, it was possible to set this to 1 cycle,
but by the time the register was written, that time had already
passed and the timer interrupt would not go off until the cycle
counter had gone a full cycle.
* Allowing a device tree binary to be passed in to the kernel from
u-boot. The OpenRISC architecture has been recently merged into
upstream u-boot, so this change gets OpenRISC Linux into sync with
that project."
* tag 'for-3.4' of git://openrisc.net/jonas/linux:
OpenRISC: Remove memory_start/end prototypes
openrisc: remove semicolon from KSTK_ defs
openrisc: sanitize use of orig_gpr11
openrisc: fix virt_addr_valid
OpenRISC: Export dump_stack()
OpenRISC: Select GENERIC_ATOMIC64
openrisc: Set shortest clock event to 100 ticks
openrisc: included linux/thread_info.h twice
OpenRISC: Use set_current_blocked() and block_sigmask()
OpenRISC: Don't mask signals if we fail to setup signal stack
OpenRISC: No need to reset handler if SA_ONESHOT
OpenRISC: Don't reimplement force_sigsegv()
openrisc: enable passing of flattened device tree pointer
arch/openrisc/mm/init.c: trivial: use BUG_ON
Diffstat (limited to 'arch')
-rw-r--r-- | arch/openrisc/Kconfig | 1 | ||||
-rw-r--r-- | arch/openrisc/include/asm/page.h | 6 | ||||
-rw-r--r-- | arch/openrisc/include/asm/processor.h | 4 | ||||
-rw-r--r-- | arch/openrisc/include/asm/ptrace.h | 6 | ||||
-rw-r--r-- | arch/openrisc/include/asm/syscall.h | 7 | ||||
-rw-r--r-- | arch/openrisc/include/asm/uaccess.h | 1 | ||||
-rw-r--r-- | arch/openrisc/kernel/entry.S | 16 | ||||
-rw-r--r-- | arch/openrisc/kernel/head.S | 17 | ||||
-rw-r--r-- | arch/openrisc/kernel/ptrace.c | 4 | ||||
-rw-r--r-- | arch/openrisc/kernel/setup.c | 18 | ||||
-rw-r--r-- | arch/openrisc/kernel/signal.c | 47 | ||||
-rw-r--r-- | arch/openrisc/kernel/time.c | 13 | ||||
-rw-r--r-- | arch/openrisc/kernel/traps.c | 9 | ||||
-rw-r--r-- | arch/openrisc/mm/init.c | 3 |
14 files changed, 77 insertions, 75 deletions
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index bc428b5f126c..a4787197d8fe 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig | |||
@@ -16,6 +16,7 @@ config OPENRISC | |||
16 | select GENERIC_IRQ_SHOW | 16 | select GENERIC_IRQ_SHOW |
17 | select GENERIC_IOMAP | 17 | select GENERIC_IOMAP |
18 | select GENERIC_CPU_DEVICES | 18 | select GENERIC_CPU_DEVICES |
19 | select GENERIC_ATOMIC64 | ||
19 | 20 | ||
20 | config MMU | 21 | config MMU |
21 | def_bool y | 22 | def_bool y |
diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h index b041b344b229..108906f991d6 100644 --- a/arch/openrisc/include/asm/page.h +++ b/arch/openrisc/include/asm/page.h | |||
@@ -71,9 +71,6 @@ typedef struct page *pgtable_t; | |||
71 | #define __pgd(x) ((pgd_t) { (x) }) | 71 | #define __pgd(x) ((pgd_t) { (x) }) |
72 | #define __pgprot(x) ((pgprot_t) { (x) }) | 72 | #define __pgprot(x) ((pgprot_t) { (x) }) |
73 | 73 | ||
74 | extern unsigned long memory_start; | ||
75 | extern unsigned long memory_end; | ||
76 | |||
77 | #endif /* !__ASSEMBLY__ */ | 74 | #endif /* !__ASSEMBLY__ */ |
78 | 75 | ||
79 | 76 | ||
@@ -94,8 +91,7 @@ extern unsigned long memory_end; | |||
94 | 91 | ||
95 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 92 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
96 | 93 | ||
97 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ | 94 | #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) |
98 | ((void *)(kaddr) < (void *)memory_end)) | ||
99 | 95 | ||
100 | #endif /* __ASSEMBLY__ */ | 96 | #endif /* __ASSEMBLY__ */ |
101 | 97 | ||
diff --git a/arch/openrisc/include/asm/processor.h b/arch/openrisc/include/asm/processor.h index bb54c97b9783..f7516fa78b58 100644 --- a/arch/openrisc/include/asm/processor.h +++ b/arch/openrisc/include/asm/processor.h | |||
@@ -81,8 +81,8 @@ extern inline void prepare_to_copy(struct task_struct *tsk) | |||
81 | #define INIT_THREAD { } | 81 | #define INIT_THREAD { } |
82 | 82 | ||
83 | 83 | ||
84 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc); | 84 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) |
85 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->sp); | 85 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->sp) |
86 | 86 | ||
87 | 87 | ||
88 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | 88 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); |
diff --git a/arch/openrisc/include/asm/ptrace.h b/arch/openrisc/include/asm/ptrace.h index e612ce4512c7..4651a737591d 100644 --- a/arch/openrisc/include/asm/ptrace.h +++ b/arch/openrisc/include/asm/ptrace.h | |||
@@ -73,9 +73,13 @@ struct pt_regs { | |||
73 | }; | 73 | }; |
74 | }; | 74 | }; |
75 | long pc; | 75 | long pc; |
76 | /* For restarting system calls: | ||
77 | * Set to syscall number for syscall exceptions, | ||
78 | * -1 for all other exceptions. | ||
79 | */ | ||
76 | long orig_gpr11; /* For restarting system calls */ | 80 | long orig_gpr11; /* For restarting system calls */ |
77 | long syscallno; /* Syscall number (used by strace) */ | ||
78 | long dummy; /* Cheap alignment fix */ | 81 | long dummy; /* Cheap alignment fix */ |
82 | long dummy2; /* Cheap alignment fix */ | ||
79 | }; | 83 | }; |
80 | 84 | ||
81 | /* TODO: Rename this to REDZONE because that's what it is */ | 85 | /* TODO: Rename this to REDZONE because that's what it is */ |
diff --git a/arch/openrisc/include/asm/syscall.h b/arch/openrisc/include/asm/syscall.h index 9f0337055d26..b752bb67891d 100644 --- a/arch/openrisc/include/asm/syscall.h +++ b/arch/openrisc/include/asm/syscall.h | |||
@@ -25,7 +25,7 @@ | |||
25 | static inline int | 25 | static inline int |
26 | syscall_get_nr(struct task_struct *task, struct pt_regs *regs) | 26 | syscall_get_nr(struct task_struct *task, struct pt_regs *regs) |
27 | { | 27 | { |
28 | return regs->syscallno ? regs->syscallno : -1; | 28 | return regs->orig_gpr11; |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline void | 31 | static inline void |
@@ -50,10 +50,7 @@ static inline void | |||
50 | syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, | 50 | syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, |
51 | int error, long val) | 51 | int error, long val) |
52 | { | 52 | { |
53 | if (error) | 53 | regs->gpr[11] = (long) error ?: val; |
54 | regs->gpr[11] = -error; | ||
55 | else | ||
56 | regs->gpr[11] = val; | ||
57 | } | 54 | } |
58 | 55 | ||
59 | static inline void | 56 | static inline void |
diff --git a/arch/openrisc/include/asm/uaccess.h b/arch/openrisc/include/asm/uaccess.h index c310e45b538e..f5abaa0ffc38 100644 --- a/arch/openrisc/include/asm/uaccess.h +++ b/arch/openrisc/include/asm/uaccess.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/thread_info.h> | 26 | #include <linux/thread_info.h> |
27 | #include <linux/prefetch.h> | 27 | #include <linux/prefetch.h> |
28 | #include <linux/string.h> | 28 | #include <linux/string.h> |
29 | #include <linux/thread_info.h> | ||
30 | #include <asm/page.h> | 29 | #include <asm/page.h> |
31 | 30 | ||
32 | #define VERIFY_READ 0 | 31 | #define VERIFY_READ 0 |
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index d5f9c35a583f..6e61af8682b8 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S | |||
@@ -95,7 +95,6 @@ handler: ;\ | |||
95 | /* r1, EPCR, ESR a already saved */ ;\ | 95 | /* r1, EPCR, ESR a already saved */ ;\ |
96 | l.sw PT_GPR2(r1),r2 ;\ | 96 | l.sw PT_GPR2(r1),r2 ;\ |
97 | l.sw PT_GPR3(r1),r3 ;\ | 97 | l.sw PT_GPR3(r1),r3 ;\ |
98 | l.sw PT_ORIG_GPR11(r1),r11 ;\ | ||
99 | /* r4 already save */ ;\ | 98 | /* r4 already save */ ;\ |
100 | l.sw PT_GPR5(r1),r5 ;\ | 99 | l.sw PT_GPR5(r1),r5 ;\ |
101 | l.sw PT_GPR6(r1),r6 ;\ | 100 | l.sw PT_GPR6(r1),r6 ;\ |
@@ -125,7 +124,9 @@ handler: ;\ | |||
125 | /* r30 already save */ ;\ | 124 | /* r30 already save */ ;\ |
126 | /* l.sw PT_GPR30(r1),r30*/ ;\ | 125 | /* l.sw PT_GPR30(r1),r30*/ ;\ |
127 | l.sw PT_GPR31(r1),r31 ;\ | 126 | l.sw PT_GPR31(r1),r31 ;\ |
128 | l.sw PT_SYSCALLNO(r1),r0 | 127 | /* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\ |
128 | l.addi r30,r0,-1 ;\ | ||
129 | l.sw PT_ORIG_GPR11(r1),r30 | ||
129 | 130 | ||
130 | #define UNHANDLED_EXCEPTION(handler,vector) \ | 131 | #define UNHANDLED_EXCEPTION(handler,vector) \ |
131 | .global handler ;\ | 132 | .global handler ;\ |
@@ -133,7 +134,6 @@ handler: ;\ | |||
133 | /* r1, EPCR, ESR already saved */ ;\ | 134 | /* r1, EPCR, ESR already saved */ ;\ |
134 | l.sw PT_GPR2(r1),r2 ;\ | 135 | l.sw PT_GPR2(r1),r2 ;\ |
135 | l.sw PT_GPR3(r1),r3 ;\ | 136 | l.sw PT_GPR3(r1),r3 ;\ |
136 | l.sw PT_ORIG_GPR11(r1),r11 ;\ | ||
137 | l.sw PT_GPR5(r1),r5 ;\ | 137 | l.sw PT_GPR5(r1),r5 ;\ |
138 | l.sw PT_GPR6(r1),r6 ;\ | 138 | l.sw PT_GPR6(r1),r6 ;\ |
139 | l.sw PT_GPR7(r1),r7 ;\ | 139 | l.sw PT_GPR7(r1),r7 ;\ |
@@ -162,7 +162,9 @@ handler: ;\ | |||
162 | /* r31 already saved */ ;\ | 162 | /* r31 already saved */ ;\ |
163 | l.sw PT_GPR30(r1),r30 ;\ | 163 | l.sw PT_GPR30(r1),r30 ;\ |
164 | /* l.sw PT_GPR31(r1),r31 */ ;\ | 164 | /* l.sw PT_GPR31(r1),r31 */ ;\ |
165 | l.sw PT_SYSCALLNO(r1),r0 ;\ | 165 | /* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\ |
166 | l.addi r30,r0,-1 ;\ | ||
167 | l.sw PT_ORIG_GPR11(r1),r30 ;\ | ||
166 | l.addi r3,r1,0 ;\ | 168 | l.addi r3,r1,0 ;\ |
167 | /* r4 is exception EA */ ;\ | 169 | /* r4 is exception EA */ ;\ |
168 | l.addi r5,r0,vector ;\ | 170 | l.addi r5,r0,vector ;\ |
@@ -554,6 +556,7 @@ ENTRY(_sys_call_handler) | |||
554 | l.sw PT_GPR9(r1),r9 | 556 | l.sw PT_GPR9(r1),r9 |
555 | /* r10 already saved */ | 557 | /* r10 already saved */ |
556 | l.sw PT_GPR11(r1),r11 | 558 | l.sw PT_GPR11(r1),r11 |
559 | /* orig_gpr11 must be set for syscalls */ | ||
557 | l.sw PT_ORIG_GPR11(r1),r11 | 560 | l.sw PT_ORIG_GPR11(r1),r11 |
558 | /* r12,r13 already saved */ | 561 | /* r12,r13 already saved */ |
559 | 562 | ||
@@ -567,9 +570,6 @@ ENTRY(_sys_call_handler) | |||
567 | /* r30 is the only register we clobber in the fast path */ | 570 | /* r30 is the only register we clobber in the fast path */ |
568 | /* r30 already saved */ | 571 | /* r30 already saved */ |
569 | /* l.sw PT_GPR30(r1),r30 */ | 572 | /* l.sw PT_GPR30(r1),r30 */ |
570 | /* This is used by do_signal to determine whether to check for | ||
571 | * syscall restart or not */ | ||
572 | l.sw PT_SYSCALLNO(r1),r11 | ||
573 | 573 | ||
574 | _syscall_check_trace_enter: | 574 | _syscall_check_trace_enter: |
575 | /* If TIF_SYSCALL_TRACE is set, then we want to do syscall tracing */ | 575 | /* If TIF_SYSCALL_TRACE is set, then we want to do syscall tracing */ |
@@ -731,7 +731,7 @@ _syscall_trace_enter: | |||
731 | * so that we can do the syscall for real and return to the syscall | 731 | * so that we can do the syscall for real and return to the syscall |
732 | * hot path. | 732 | * hot path. |
733 | */ | 733 | */ |
734 | l.lwz r11,PT_SYSCALLNO(r1) | 734 | l.lwz r11,PT_GPR11(r1) |
735 | l.lwz r3,PT_GPR3(r1) | 735 | l.lwz r3,PT_GPR3(r1) |
736 | l.lwz r4,PT_GPR4(r1) | 736 | l.lwz r4,PT_GPR4(r1) |
737 | l.lwz r5,PT_GPR5(r1) | 737 | l.lwz r5,PT_GPR5(r1) |
diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S index c75018d22644..1088b5fca3bd 100644 --- a/arch/openrisc/kernel/head.S +++ b/arch/openrisc/kernel/head.S | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/cache.h> | 26 | #include <asm/cache.h> |
27 | #include <asm/spr_defs.h> | 27 | #include <asm/spr_defs.h> |
28 | #include <asm/asm-offsets.h> | 28 | #include <asm/asm-offsets.h> |
29 | #include <linux/of_fdt.h> | ||
29 | 30 | ||
30 | #define tophys(rd,rs) \ | 31 | #define tophys(rd,rs) \ |
31 | l.movhi rd,hi(-KERNELBASE) ;\ | 32 | l.movhi rd,hi(-KERNELBASE) ;\ |
@@ -440,6 +441,9 @@ _dispatch_do_ipage_fault: | |||
440 | __HEAD | 441 | __HEAD |
441 | .global _start | 442 | .global _start |
442 | _start: | 443 | _start: |
444 | /* save kernel parameters */ | ||
445 | l.or r25,r0,r3 /* pointer to fdt */ | ||
446 | |||
443 | /* | 447 | /* |
444 | * ensure a deterministic start | 448 | * ensure a deterministic start |
445 | */ | 449 | */ |
@@ -471,7 +475,6 @@ _start: | |||
471 | CLEAR_GPR(r22) | 475 | CLEAR_GPR(r22) |
472 | CLEAR_GPR(r23) | 476 | CLEAR_GPR(r23) |
473 | CLEAR_GPR(r24) | 477 | CLEAR_GPR(r24) |
474 | CLEAR_GPR(r25) | ||
475 | CLEAR_GPR(r26) | 478 | CLEAR_GPR(r26) |
476 | CLEAR_GPR(r27) | 479 | CLEAR_GPR(r27) |
477 | CLEAR_GPR(r28) | 480 | CLEAR_GPR(r28) |
@@ -565,6 +568,18 @@ enable_mmu: | |||
565 | // reset the simulation counters | 568 | // reset the simulation counters |
566 | l.nop 5 | 569 | l.nop 5 |
567 | 570 | ||
571 | /* check fdt header magic word */ | ||
572 | l.lwz r3,0(r25) /* load magic from fdt into r3 */ | ||
573 | l.movhi r4,hi(OF_DT_HEADER) | ||
574 | l.ori r4,r4,lo(OF_DT_HEADER) | ||
575 | l.sfeq r3,r4 | ||
576 | l.bf _fdt_found | ||
577 | l.nop | ||
578 | /* magic number mismatch, set fdt pointer to null */ | ||
579 | l.or r25,r0,r0 | ||
580 | _fdt_found: | ||
581 | /* pass fdt pointer to or32_early_setup in r3 */ | ||
582 | l.or r3,r0,r25 | ||
568 | LOAD_SYMBOL_2_GPR(r24, or32_early_setup) | 583 | LOAD_SYMBOL_2_GPR(r24, or32_early_setup) |
569 | l.jalr r24 | 584 | l.jalr r24 |
570 | l.nop | 585 | l.nop |
diff --git a/arch/openrisc/kernel/ptrace.c b/arch/openrisc/kernel/ptrace.c index 7259047d5f9d..6deacb6b95a4 100644 --- a/arch/openrisc/kernel/ptrace.c +++ b/arch/openrisc/kernel/ptrace.c | |||
@@ -188,11 +188,11 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | |||
188 | */ | 188 | */ |
189 | ret = -1L; | 189 | ret = -1L; |
190 | 190 | ||
191 | audit_syscall_entry(audit_arch(), regs->syscallno, | 191 | audit_syscall_entry(audit_arch(), regs->gpr[11], |
192 | regs->gpr[3], regs->gpr[4], | 192 | regs->gpr[3], regs->gpr[4], |
193 | regs->gpr[5], regs->gpr[6]); | 193 | regs->gpr[5], regs->gpr[6]); |
194 | 194 | ||
195 | return ret ? : regs->syscallno; | 195 | return ret ? : regs->gpr[11]; |
196 | } | 196 | } |
197 | 197 | ||
198 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) | 198 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) |
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 1422f747f52b..bf5eba22ce9e 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c | |||
@@ -207,18 +207,18 @@ void __init setup_cpuinfo(void) | |||
207 | * Handles the pointer to the device tree that this kernel is to use | 207 | * Handles the pointer to the device tree that this kernel is to use |
208 | * for establishing the available platform devices. | 208 | * for establishing the available platform devices. |
209 | * | 209 | * |
210 | * For now, this is limited to using the built-in device tree. In the future, | 210 | * Falls back on built-in device tree in case null pointer is passed. |
211 | * it is intended that this function will take a pointer to the device tree | ||
212 | * that is potentially built-in, but potentially also passed in by the | ||
213 | * bootloader, or discovered by some equally clever means... | ||
214 | */ | 211 | */ |
215 | 212 | ||
216 | void __init or32_early_setup(void) | 213 | void __init or32_early_setup(unsigned int fdt) |
217 | { | 214 | { |
218 | 215 | if (fdt) { | |
219 | early_init_devtree(__dtb_start); | 216 | early_init_devtree((void*) fdt); |
220 | 217 | printk(KERN_INFO "FDT at 0x%08x\n", fdt); | |
221 | printk(KERN_INFO "Compiled-in FDT at 0x%p\n", __dtb_start); | 218 | } else { |
219 | early_init_devtree(__dtb_start); | ||
220 | printk(KERN_INFO "Compiled-in FDT at %p\n", __dtb_start); | ||
221 | } | ||
222 | } | 222 | } |
223 | 223 | ||
224 | static int __init openrisc_device_probe(void) | 224 | static int __init openrisc_device_probe(void) |
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c index 95207ab0c99e..e970743251ae 100644 --- a/arch/openrisc/kernel/signal.c +++ b/arch/openrisc/kernel/signal.c | |||
@@ -102,10 +102,7 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs) | |||
102 | goto badframe; | 102 | goto badframe; |
103 | 103 | ||
104 | sigdelsetmask(&set, ~_BLOCKABLE); | 104 | sigdelsetmask(&set, ~_BLOCKABLE); |
105 | spin_lock_irq(¤t->sighand->siglock); | 105 | set_current_blocked(&set); |
106 | current->blocked = set; | ||
107 | recalc_sigpending(); | ||
108 | spin_unlock_irq(¤t->sighand->siglock); | ||
109 | 106 | ||
110 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 107 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
111 | goto badframe; | 108 | goto badframe; |
@@ -189,8 +186,8 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, | |||
189 | * trampoline which performs the syscall sigreturn, or a provided | 186 | * trampoline which performs the syscall sigreturn, or a provided |
190 | * user-mode trampoline. | 187 | * user-mode trampoline. |
191 | */ | 188 | */ |
192 | static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | 189 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, |
193 | sigset_t *set, struct pt_regs *regs) | 190 | sigset_t *set, struct pt_regs *regs) |
194 | { | 191 | { |
195 | struct rt_sigframe *frame; | 192 | struct rt_sigframe *frame; |
196 | unsigned long return_ip; | 193 | unsigned long return_ip; |
@@ -247,31 +244,27 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
247 | /* actually move the usp to reflect the stacked frame */ | 244 | /* actually move the usp to reflect the stacked frame */ |
248 | regs->sp = (unsigned long)frame; | 245 | regs->sp = (unsigned long)frame; |
249 | 246 | ||
250 | return; | 247 | return 0; |
251 | 248 | ||
252 | give_sigsegv: | 249 | give_sigsegv: |
253 | if (sig == SIGSEGV) | 250 | force_sigsegv(sig, current); |
254 | ka->sa.sa_handler = SIG_DFL; | 251 | return -EFAULT; |
255 | force_sig(SIGSEGV, current); | ||
256 | } | 252 | } |
257 | 253 | ||
258 | static inline void | 254 | static inline int |
259 | handle_signal(unsigned long sig, | 255 | handle_signal(unsigned long sig, |
260 | siginfo_t *info, struct k_sigaction *ka, | 256 | siginfo_t *info, struct k_sigaction *ka, |
261 | sigset_t *oldset, struct pt_regs *regs) | 257 | sigset_t *oldset, struct pt_regs *regs) |
262 | { | 258 | { |
263 | setup_rt_frame(sig, ka, info, oldset, regs); | 259 | int ret; |
264 | 260 | ||
265 | if (ka->sa.sa_flags & SA_ONESHOT) | 261 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
266 | ka->sa.sa_handler = SIG_DFL; | 262 | if (ret) |
263 | return ret; | ||
267 | 264 | ||
268 | spin_lock_irq(¤t->sighand->siglock); | 265 | block_sigmask(ka, sig); |
269 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); | ||
270 | if (!(ka->sa.sa_flags & SA_NODEFER)) | ||
271 | sigaddset(¤t->blocked, sig); | ||
272 | recalc_sigpending(); | ||
273 | 266 | ||
274 | spin_unlock_irq(¤t->sighand->siglock); | 267 | return 0; |
275 | } | 268 | } |
276 | 269 | ||
277 | /* | 270 | /* |
@@ -312,7 +305,7 @@ void do_signal(struct pt_regs *regs) | |||
312 | * below mean that the syscall executed to completion and no | 305 | * below mean that the syscall executed to completion and no |
313 | * restart is necessary. | 306 | * restart is necessary. |
314 | */ | 307 | */ |
315 | if (regs->syscallno) { | 308 | if (regs->orig_gpr11) { |
316 | int restart = 0; | 309 | int restart = 0; |
317 | 310 | ||
318 | switch (regs->gpr[11]) { | 311 | switch (regs->gpr[11]) { |
@@ -360,13 +353,13 @@ void do_signal(struct pt_regs *regs) | |||
360 | oldset = ¤t->blocked; | 353 | oldset = ¤t->blocked; |
361 | 354 | ||
362 | /* Whee! Actually deliver the signal. */ | 355 | /* Whee! Actually deliver the signal. */ |
363 | handle_signal(signr, &info, &ka, oldset, regs); | 356 | if (!handle_signal(signr, &info, &ka, oldset, regs)) { |
364 | /* a signal was successfully delivered; the saved | 357 | /* a signal was successfully delivered; the saved |
365 | * sigmask will have been stored in the signal frame, | 358 | * sigmask will have been stored in the signal frame, |
366 | * and will be restored by sigreturn, so we can simply | 359 | * and will be restored by sigreturn, so we can simply |
367 | * clear the TIF_RESTORE_SIGMASK flag */ | 360 | * clear the TIF_RESTORE_SIGMASK flag */ |
368 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
369 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 361 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
362 | } | ||
370 | 363 | ||
371 | tracehook_signal_handler(signr, &info, &ka, regs, | 364 | tracehook_signal_handler(signr, &info, &ka, regs, |
372 | test_thread_flag(TIF_SINGLESTEP)); | 365 | test_thread_flag(TIF_SINGLESTEP)); |
diff --git a/arch/openrisc/kernel/time.c b/arch/openrisc/kernel/time.c index bd946ef1623d..7c52e9494a8d 100644 --- a/arch/openrisc/kernel/time.c +++ b/arch/openrisc/kernel/time.c | |||
@@ -125,16 +125,13 @@ irqreturn_t __irq_entry timer_interrupt(struct pt_regs *regs) | |||
125 | 125 | ||
126 | static __init void openrisc_clockevent_init(void) | 126 | static __init void openrisc_clockevent_init(void) |
127 | { | 127 | { |
128 | clockevents_calc_mult_shift(&clockevent_openrisc_timer, | 128 | clockevent_openrisc_timer.cpumask = cpumask_of(0); |
129 | cpuinfo.clock_frequency, 4); | ||
130 | 129 | ||
131 | /* We only have 28 bits */ | 130 | /* We only have 28 bits */ |
132 | clockevent_openrisc_timer.max_delta_ns = | 131 | clockevents_config_and_register(&clockevent_openrisc_timer, |
133 | clockevent_delta2ns((u32) 0x0fffffff, &clockevent_openrisc_timer); | 132 | cpuinfo.clock_frequency, |
134 | clockevent_openrisc_timer.min_delta_ns = | 133 | 100, 0x0fffffff); |
135 | clockevent_delta2ns(1, &clockevent_openrisc_timer); | 134 | |
136 | clockevent_openrisc_timer.cpumask = cpumask_of(0); | ||
137 | clockevents_register_device(&clockevent_openrisc_timer); | ||
138 | } | 135 | } |
139 | 136 | ||
140 | /** | 137 | /** |
diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c index a4ec44a052b2..a2ee12948f40 100644 --- a/arch/openrisc/kernel/traps.c +++ b/arch/openrisc/kernel/traps.c | |||
@@ -115,6 +115,7 @@ void dump_stack(void) | |||
115 | 115 | ||
116 | show_stack(current, &stack); | 116 | show_stack(current, &stack); |
117 | } | 117 | } |
118 | EXPORT_SYMBOL(dump_stack); | ||
118 | 119 | ||
119 | void show_registers(struct pt_regs *regs) | 120 | void show_registers(struct pt_regs *regs) |
120 | { | 121 | { |
@@ -145,8 +146,8 @@ void show_registers(struct pt_regs *regs) | |||
145 | regs->gpr[24], regs->gpr[25], regs->gpr[26], regs->gpr[27]); | 146 | regs->gpr[24], regs->gpr[25], regs->gpr[26], regs->gpr[27]); |
146 | printk("GPR28: %08lx GPR29: %08lx GPR30: %08lx GPR31: %08lx\n", | 147 | printk("GPR28: %08lx GPR29: %08lx GPR30: %08lx GPR31: %08lx\n", |
147 | regs->gpr[28], regs->gpr[29], regs->gpr[30], regs->gpr[31]); | 148 | regs->gpr[28], regs->gpr[29], regs->gpr[30], regs->gpr[31]); |
148 | printk(" RES: %08lx oGPR11: %08lx syscallno: %08lx\n", | 149 | printk(" RES: %08lx oGPR11: %08lx\n", |
149 | regs->gpr[11], regs->orig_gpr11, regs->syscallno); | 150 | regs->gpr[11], regs->orig_gpr11); |
150 | 151 | ||
151 | printk("Process %s (pid: %d, stackpage=%08lx)\n", | 152 | printk("Process %s (pid: %d, stackpage=%08lx)\n", |
152 | current->comm, current->pid, (unsigned long)current); | 153 | current->comm, current->pid, (unsigned long)current); |
@@ -207,8 +208,8 @@ void nommu_dump_state(struct pt_regs *regs, | |||
207 | regs->gpr[24], regs->gpr[25], regs->gpr[26], regs->gpr[27]); | 208 | regs->gpr[24], regs->gpr[25], regs->gpr[26], regs->gpr[27]); |
208 | printk("GPR28: %08lx GPR29: %08lx GPR30: %08lx GPR31: %08lx\n", | 209 | printk("GPR28: %08lx GPR29: %08lx GPR30: %08lx GPR31: %08lx\n", |
209 | regs->gpr[28], regs->gpr[29], regs->gpr[30], regs->gpr[31]); | 210 | regs->gpr[28], regs->gpr[29], regs->gpr[30], regs->gpr[31]); |
210 | printk(" RES: %08lx oGPR11: %08lx syscallno: %08lx\n", | 211 | printk(" RES: %08lx oGPR11: %08lx\n", |
211 | regs->gpr[11], regs->orig_gpr11, regs->syscallno); | 212 | regs->gpr[11], regs->orig_gpr11); |
212 | 213 | ||
213 | printk("Process %s (pid: %d, stackpage=%08lx)\n", | 214 | printk("Process %s (pid: %d, stackpage=%08lx)\n", |
214 | ((struct task_struct *)(__pa(current)))->comm, | 215 | ((struct task_struct *)(__pa(current)))->comm, |
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c index 359dcb20fe85..736f6b2f30af 100644 --- a/arch/openrisc/mm/init.c +++ b/arch/openrisc/mm/init.c | |||
@@ -222,8 +222,7 @@ void __init mem_init(void) | |||
222 | { | 222 | { |
223 | int codesize, reservedpages, datasize, initsize; | 223 | int codesize, reservedpages, datasize, initsize; |
224 | 224 | ||
225 | if (!mem_map) | 225 | BUG_ON(!mem_map); |
226 | BUG(); | ||
227 | 226 | ||
228 | set_max_mapnr_init(); | 227 | set_max_mapnr_init(); |
229 | 228 | ||