diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-02 12:09:56 -0400 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-04 07:00:00 -0400 |
commit | 43f6cdd7693ddddb4db17a1ab591d506cb1fc110 (patch) | |
tree | f05f9e14364b4ea9b82feb37b83538adaee943cf | |
parent | a80a635f3d60e4aa61f96d22a122071cb061be93 (diff) |
CRIS: Simple insn reschedule to avoid interlocks.
Brings down the CPI from ~1.5 to ~1.1.
Signed-off-by: Edgar Iglesias <Edgar.Iglesias@axis.com>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
-rw-r--r-- | arch/cris/arch-v32/kernel/entry.S | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S index 7c14acb754a..ce121df3aae 100644 --- a/arch/cris/arch-v32/kernel/entry.S +++ b/arch/cris/arch-v32/kernel/entry.S | |||
@@ -348,40 +348,40 @@ _syscall_trace_entry: | |||
348 | 348 | ||
349 | .type resume,@function | 349 | .type resume,@function |
350 | resume: | 350 | resume: |
351 | subq 4, $sp | 351 | subq 4, $sp ; Make space for srp. |
352 | move $srp, [$sp] ; Keep old/new PC on the stack. | 352 | |
353 | add.d $r12, $r10 ; R10 = current tasks tss. | 353 | add.d $r12, $r10 ; R10 = current tasks tss. |
354 | addoq +THREAD_ccs, $r10, $acr | 354 | addoq +THREAD_ccs, $r10, $acr |
355 | move $srp, [$sp] ; Keep old/new PC on the stack. | ||
355 | move $ccs, [$acr] ; Save IRQ enable state. | 356 | move $ccs, [$acr] ; Save IRQ enable state. |
356 | di | 357 | di |
357 | 358 | ||
358 | addoq +THREAD_usp, $r10, $acr | 359 | addoq +THREAD_usp, $r10, $acr |
360 | subq 10*4, $sp ; Make room for R9. | ||
359 | move $usp, [$acr] ; Save user-mode stackpointer. | 361 | move $usp, [$acr] ; Save user-mode stackpointer. |
360 | 362 | ||
361 | ;; See copy_thread for the reason why register R9 is saved. | 363 | ;; See copy_thread for the reason why register R9 is saved. |
362 | subq 10*4, $sp | ||
363 | movem $r9, [$sp] ; Save non-scratch registers and R9. | 364 | movem $r9, [$sp] ; Save non-scratch registers and R9. |
364 | 365 | ||
365 | addoq +THREAD_ksp, $r10, $acr | 366 | addoq +THREAD_ksp, $r10, $acr |
367 | move.d $sp, $r10 ; Return last running task in R10. | ||
366 | move.d $sp, [$acr] ; Save kernel SP for old task. | 368 | move.d $sp, [$acr] ; Save kernel SP for old task. |
367 | 369 | ||
368 | move.d $sp, $r10 ; Return last running task in R10. | ||
369 | and.d -8192, $r10 ; Get thread_info from stackpointer. | 370 | and.d -8192, $r10 ; Get thread_info from stackpointer. |
370 | addoq +TI_task, $r10, $acr | 371 | addoq +TI_task, $r10, $acr |
371 | move.d [$acr], $r10 ; Get task. | ||
372 | add.d $r12, $r11 ; Find the new tasks tss. | 372 | add.d $r12, $r11 ; Find the new tasks tss. |
373 | move.d [$acr], $r10 ; Get task. | ||
373 | addoq +THREAD_ksp, $r11, $acr | 374 | addoq +THREAD_ksp, $r11, $acr |
374 | move.d [$acr], $sp ; Switch to new stackframe. | 375 | move.d [$acr], $sp ; Switch to new stackframe. |
376 | addoq +THREAD_usp, $r11, $acr | ||
375 | movem [$sp+], $r9 ; Restore non-scratch registers and R9. | 377 | movem [$sp+], $r9 ; Restore non-scratch registers and R9. |
376 | 378 | ||
377 | addoq +THREAD_usp, $r11, $acr | ||
378 | move [$acr], $usp ; Restore user-mode stackpointer. | 379 | move [$acr], $usp ; Restore user-mode stackpointer. |
379 | 380 | ||
380 | addoq +THREAD_ccs, $r11, $acr | 381 | addoq +THREAD_ccs, $r11, $acr |
382 | move.d [$sp+], $r11 | ||
383 | jump $r11 ; Restore PC. | ||
381 | move [$acr], $ccs ; Restore IRQ enable status. | 384 | move [$acr], $ccs ; Restore IRQ enable status. |
382 | move.d [$sp+], $acr | ||
383 | jump $acr ; Restore PC. | ||
384 | nop | ||
385 | .size resume, . - resume | 385 | .size resume, . - resume |
386 | 386 | ||
387 | nmi_interrupt: | 387 | nmi_interrupt: |