diff options
Diffstat (limited to 'arch/tile/kernel/intvec_32.S')
-rw-r--r-- | arch/tile/kernel/intvec_32.S | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index 5d56a1ef5ba5..6943515100f8 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
@@ -839,6 +839,18 @@ STD_ENTRY(interrupt_return) | |||
839 | FEEDBACK_REENTER(interrupt_return) | 839 | FEEDBACK_REENTER(interrupt_return) |
840 | 840 | ||
841 | /* | 841 | /* |
842 | * Use r33 to hold whether we have already loaded the callee-saves | ||
843 | * into ptregs. We don't want to do it twice in this loop, since | ||
844 | * then we'd clobber whatever changes are made by ptrace, etc. | ||
845 | * Get base of stack in r32. | ||
846 | */ | ||
847 | { | ||
848 | GET_THREAD_INFO(r32) | ||
849 | movei r33, 0 | ||
850 | } | ||
851 | |||
852 | .Lretry_work_pending: | ||
853 | /* | ||
842 | * Disable interrupts so as to make sure we don't | 854 | * Disable interrupts so as to make sure we don't |
843 | * miss an interrupt that sets any of the thread flags (like | 855 | * miss an interrupt that sets any of the thread flags (like |
844 | * need_resched or sigpending) between sampling and the iret. | 856 | * need_resched or sigpending) between sampling and the iret. |
@@ -848,9 +860,6 @@ STD_ENTRY(interrupt_return) | |||
848 | IRQ_DISABLE(r20, r21) | 860 | IRQ_DISABLE(r20, r21) |
849 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ | 861 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ |
850 | 862 | ||
851 | /* Get base of stack in r32; note r30/31 are used as arguments here. */ | ||
852 | GET_THREAD_INFO(r32) | ||
853 | |||
854 | 863 | ||
855 | /* Check to see if there is any work to do before returning to user. */ | 864 | /* Check to see if there is any work to do before returning to user. */ |
856 | { | 865 | { |
@@ -866,16 +875,18 @@ STD_ENTRY(interrupt_return) | |||
866 | 875 | ||
867 | /* | 876 | /* |
868 | * Make sure we have all the registers saved for signal | 877 | * Make sure we have all the registers saved for signal |
869 | * handling or single-step. Call out to C code to figure out | 878 | * handling, notify-resume, or single-step. Call out to C |
870 | * exactly what we need to do for each flag bit, then if | 879 | * code to figure out exactly what we need to do for each flag bit, |
871 | * necessary, reload the flags and recheck. | 880 | * then if necessary, reload the flags and recheck. |
872 | */ | 881 | */ |
873 | push_extra_callee_saves r0 | ||
874 | { | 882 | { |
875 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) | 883 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) |
876 | jal do_work_pending | 884 | bnz r33, 1f |
877 | } | 885 | } |
878 | bnz r0, .Lresume_userspace | 886 | push_extra_callee_saves r0 |
887 | movei r33, 1 | ||
888 | 1: jal do_work_pending | ||
889 | bnz r0, .Lretry_work_pending | ||
879 | 890 | ||
880 | /* | 891 | /* |
881 | * In the NMI case we | 892 | * In the NMI case we |
@@ -1180,10 +1191,12 @@ handle_syscall: | |||
1180 | add r20, r20, tp | 1191 | add r20, r20, tp |
1181 | lw r21, r20 | 1192 | lw r21, r20 |
1182 | addi r21, r21, 1 | 1193 | addi r21, r21, 1 |
1183 | sw r20, r21 | 1194 | { |
1195 | sw r20, r21 | ||
1196 | GET_THREAD_INFO(r31) | ||
1197 | } | ||
1184 | 1198 | ||
1185 | /* Trace syscalls, if requested. */ | 1199 | /* Trace syscalls, if requested. */ |
1186 | GET_THREAD_INFO(r31) | ||
1187 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET | 1200 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET |
1188 | lw r30, r31 | 1201 | lw r30, r31 |
1189 | andi r30, r30, _TIF_SYSCALL_TRACE | 1202 | andi r30, r30, _TIF_SYSCALL_TRACE |
@@ -1362,7 +1375,10 @@ handle_ill: | |||
1362 | 3: | 1375 | 3: |
1363 | /* set PC and continue */ | 1376 | /* set PC and continue */ |
1364 | lw r26, r24 | 1377 | lw r26, r24 |
1365 | sw r28, r26 | 1378 | { |
1379 | sw r28, r26 | ||
1380 | GET_THREAD_INFO(r0) | ||
1381 | } | ||
1366 | 1382 | ||
1367 | /* | 1383 | /* |
1368 | * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill. | 1384 | * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill. |
@@ -1370,7 +1386,6 @@ handle_ill: | |||
1370 | * need to clear it here and can't really impose on all other arches. | 1386 | * need to clear it here and can't really impose on all other arches. |
1371 | * So what's another write between friends? | 1387 | * So what's another write between friends? |
1372 | */ | 1388 | */ |
1373 | GET_THREAD_INFO(r0) | ||
1374 | 1389 | ||
1375 | addi r1, r0, THREAD_INFO_FLAGS_OFFSET | 1390 | addi r1, r0, THREAD_INFO_FLAGS_OFFSET |
1376 | { | 1391 | { |