aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-07-21 04:22:45 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-21 04:22:45 -0400
commit14764b01a5576ce23a9d0c95a027049206a19cef (patch)
treefa7f4e3b9b62598076baf7d312dd37d6c91b0d56 /arch/arm/kernel
parentfc4978b796e5e52ab3a709495a968199afe0a108 (diff)
parent5ccd4302a20bfe56eb72a5e27ad0be046fc820a5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nico/orion into devel-stable
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/entry-armv.S16
-rw-r--r--arch/arm/kernel/kprobes-decode.c5
-rw-r--r--arch/arm/kernel/perf_event.c2
-rw-r--r--arch/arm/kernel/process.c23
4 files changed, 24 insertions, 22 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 2d14081b26b..9ef9a826699 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -162,8 +162,6 @@ ENDPROC(__und_invalid)
162 @ r4 - orig_r0 (see pt_regs definition in ptrace.h) 162 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
163 @ 163 @
164 stmia r5, {r0 - r4} 164 stmia r5, {r0 - r4}
165
166 asm_trace_hardirqs_off
167 .endm 165 .endm
168 166
169 .align 5 167 .align 5
@@ -204,7 +202,7 @@ __dabt_svc:
204 @ 202 @
205 @ IRQs off again before pulling preserved data off the stack 203 @ IRQs off again before pulling preserved data off the stack
206 @ 204 @
207 disable_irq 205 disable_irq_notrace
208 206
209 @ 207 @
210 @ restore SPSR and restart the instruction 208 @ restore SPSR and restart the instruction
@@ -218,6 +216,9 @@ ENDPROC(__dabt_svc)
218__irq_svc: 216__irq_svc:
219 svc_entry 217 svc_entry
220 218
219#ifdef CONFIG_TRACE_IRQFLAGS
220 bl trace_hardirqs_off
221#endif
221#ifdef CONFIG_PREEMPT 222#ifdef CONFIG_PREEMPT
222 get_thread_info tsk 223 get_thread_info tsk
223 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count 224 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
@@ -291,7 +292,7 @@ __und_svc:
291 @ 292 @
292 @ IRQs off again before pulling preserved data off the stack 293 @ IRQs off again before pulling preserved data off the stack
293 @ 294 @
2941: disable_irq 2951: disable_irq_notrace
295 296
296 @ 297 @
297 @ restore SPSR and restart the instruction 298 @ restore SPSR and restart the instruction
@@ -327,7 +328,7 @@ __pabt_svc:
327 @ 328 @
328 @ IRQs off again before pulling preserved data off the stack 329 @ IRQs off again before pulling preserved data off the stack
329 @ 330 @
330 disable_irq 331 disable_irq_notrace
331 332
332 @ 333 @
333 @ restore SPSR and restart the instruction 334 @ restore SPSR and restart the instruction
@@ -393,8 +394,6 @@ ENDPROC(__pabt_svc)
393 @ Clear FP to mark the first stack frame 394 @ Clear FP to mark the first stack frame
394 @ 395 @
395 zero_fp 396 zero_fp
396
397 asm_trace_hardirqs_off
398 .endm 397 .endm
399 398
400 .macro kuser_cmpxchg_check 399 .macro kuser_cmpxchg_check
@@ -465,9 +464,6 @@ __irq_usr:
465 THUMB( movne r0, #0 ) 464 THUMB( movne r0, #0 )
466 THUMB( strne r0, [r0] ) 465 THUMB( strne r0, [r0] )
467#endif 466#endif
468#ifdef CONFIG_TRACE_IRQFLAGS
469 bl trace_hardirqs_on
470#endif
471 467
472 mov why, #0 468 mov why, #0
473 b ret_to_user 469 b ret_to_user
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
index da1f94906a4..8bccbfa693f 100644
--- a/arch/arm/kernel/kprobes-decode.c
+++ b/arch/arm/kernel/kprobes-decode.c
@@ -583,13 +583,14 @@ static void __kprobes emulate_ldr(struct kprobe *p, struct pt_regs *regs)
583{ 583{
584 insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0]; 584 insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0];
585 kprobe_opcode_t insn = p->opcode; 585 kprobe_opcode_t insn = p->opcode;
586 long ppc = (long)p->addr + 8;
586 union reg_pair fnr; 587 union reg_pair fnr;
587 int rd = (insn >> 12) & 0xf; 588 int rd = (insn >> 12) & 0xf;
588 int rn = (insn >> 16) & 0xf; 589 int rn = (insn >> 16) & 0xf;
589 int rm = insn & 0xf; 590 int rm = insn & 0xf;
590 long rdv; 591 long rdv;
591 long rnv = regs->uregs[rn]; 592 long rnv = (rn == 15) ? ppc : regs->uregs[rn];
592 long rmv = regs->uregs[rm]; /* rm/rmv may be invalid, don't care. */ 593 long rmv = (rm == 15) ? ppc : regs->uregs[rm];
593 long cpsr = regs->ARM_cpsr; 594 long cpsr = regs->ARM_cpsr;
594 595
595 fnr.dr = insnslot_llret_3arg_rflags(rnv, 0, rmv, cpsr, i_fn); 596 fnr.dr = insnslot_llret_3arg_rflags(rnv, 0, rmv, cpsr, i_fn);
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index c45768614c8..de12536d687 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -201,7 +201,7 @@ armpmu_event_update(struct perf_event *event,
201{ 201{
202 int shift = 64 - 32; 202 int shift = 64 - 32;
203 s64 prev_raw_count, new_raw_count; 203 s64 prev_raw_count, new_raw_count;
204 s64 delta; 204 u64 delta;
205 205
206again: 206again:
207 prev_raw_count = atomic64_read(&hwc->prev_count); 207 prev_raw_count = atomic64_read(&hwc->prev_count);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 090ac9459da..43557a1eb61 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -358,17 +358,21 @@ EXPORT_SYMBOL(dump_fpu);
358 358
359/* 359/*
360 * Shuffle the argument into the correct register before calling the 360 * Shuffle the argument into the correct register before calling the
361 * thread function. r1 is the thread argument, r2 is the pointer to 361 * thread function. r4 is the thread argument, r5 is the pointer to
362 * the thread function, and r3 points to the exit function. 362 * the thread function, and r6 points to the exit function.
363 */ 363 */
364extern void kernel_thread_helper(void); 364extern void kernel_thread_helper(void);
365asm( ".pushsection .text\n" 365asm( ".pushsection .text\n"
366" .align\n" 366" .align\n"
367" .type kernel_thread_helper, #function\n" 367" .type kernel_thread_helper, #function\n"
368"kernel_thread_helper:\n" 368"kernel_thread_helper:\n"
369" mov r0, r1\n" 369#ifdef CONFIG_TRACE_IRQFLAGS
370" mov lr, r3\n" 370" bl trace_hardirqs_on\n"
371" mov pc, r2\n" 371#endif
372" msr cpsr_c, r7\n"
373" mov r0, r4\n"
374" mov lr, r6\n"
375" mov pc, r5\n"
372" .size kernel_thread_helper, . - kernel_thread_helper\n" 376" .size kernel_thread_helper, . - kernel_thread_helper\n"
373" .popsection"); 377" .popsection");
374 378
@@ -398,11 +402,12 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
398 402
399 memset(&regs, 0, sizeof(regs)); 403 memset(&regs, 0, sizeof(regs));
400 404
401 regs.ARM_r1 = (unsigned long)arg; 405 regs.ARM_r4 = (unsigned long)arg;
402 regs.ARM_r2 = (unsigned long)fn; 406 regs.ARM_r5 = (unsigned long)fn;
403 regs.ARM_r3 = (unsigned long)kernel_thread_exit; 407 regs.ARM_r6 = (unsigned long)kernel_thread_exit;
408 regs.ARM_r7 = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE;
404 regs.ARM_pc = (unsigned long)kernel_thread_helper; 409 regs.ARM_pc = (unsigned long)kernel_thread_helper;
405 regs.ARM_cpsr = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE; 410 regs.ARM_cpsr = regs.ARM_r7 | PSR_I_BIT;
406 411
407 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 412 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
408} 413}