diff options
| -rw-r--r-- | arch/arm/kernel/entry-armv.S | 16 | ||||
| -rw-r--r-- | arch/arm/kernel/process.c | 23 |
2 files changed, 20 insertions, 19 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 7ee48e7f8f31..3fd7861de4d1 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 | @ |
| 294 | 1: disable_irq | 295 | 1: 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/process.c b/arch/arm/kernel/process.c index acf5e6fdb6dc..a4a9cc88bec7 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
| @@ -351,17 +351,21 @@ EXPORT_SYMBOL(dump_fpu); | |||
| 351 | 351 | ||
| 352 | /* | 352 | /* |
| 353 | * Shuffle the argument into the correct register before calling the | 353 | * Shuffle the argument into the correct register before calling the |
| 354 | * thread function. r1 is the thread argument, r2 is the pointer to | 354 | * thread function. r4 is the thread argument, r5 is the pointer to |
| 355 | * the thread function, and r3 points to the exit function. | 355 | * the thread function, and r6 points to the exit function. |
| 356 | */ | 356 | */ |
| 357 | extern void kernel_thread_helper(void); | 357 | extern void kernel_thread_helper(void); |
| 358 | asm( ".pushsection .text\n" | 358 | asm( ".pushsection .text\n" |
| 359 | " .align\n" | 359 | " .align\n" |
| 360 | " .type kernel_thread_helper, #function\n" | 360 | " .type kernel_thread_helper, #function\n" |
| 361 | "kernel_thread_helper:\n" | 361 | "kernel_thread_helper:\n" |
| 362 | " mov r0, r1\n" | 362 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 363 | " mov lr, r3\n" | 363 | " bl trace_hardirqs_on\n" |
| 364 | " mov pc, r2\n" | 364 | #endif |
| 365 | " msr cpsr_c, r7\n" | ||
| 366 | " mov r0, r4\n" | ||
| 367 | " mov lr, r6\n" | ||
| 368 | " mov pc, r5\n" | ||
| 365 | " .size kernel_thread_helper, . - kernel_thread_helper\n" | 369 | " .size kernel_thread_helper, . - kernel_thread_helper\n" |
| 366 | " .popsection"); | 370 | " .popsection"); |
| 367 | 371 | ||
| @@ -391,11 +395,12 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | |||
| 391 | 395 | ||
| 392 | memset(®s, 0, sizeof(regs)); | 396 | memset(®s, 0, sizeof(regs)); |
| 393 | 397 | ||
| 394 | regs.ARM_r1 = (unsigned long)arg; | 398 | regs.ARM_r4 = (unsigned long)arg; |
| 395 | regs.ARM_r2 = (unsigned long)fn; | 399 | regs.ARM_r5 = (unsigned long)fn; |
| 396 | regs.ARM_r3 = (unsigned long)kernel_thread_exit; | 400 | regs.ARM_r6 = (unsigned long)kernel_thread_exit; |
| 401 | regs.ARM_r7 = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE; | ||
| 397 | regs.ARM_pc = (unsigned long)kernel_thread_helper; | 402 | regs.ARM_pc = (unsigned long)kernel_thread_helper; |
| 398 | regs.ARM_cpsr = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE; | 403 | regs.ARM_cpsr = regs.ARM_r7 | PSR_I_BIT; |
| 399 | 404 | ||
| 400 | return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | 405 | return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); |
| 401 | } | 406 | } |
