aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/intvec_32.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/kernel/intvec_32.S')
-rw-r--r--arch/tile/kernel/intvec_32.S27
1 files changed, 20 insertions, 7 deletions
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S
index 388061319c4c..10767655689e 100644
--- a/arch/tile/kernel/intvec_32.S
+++ b/arch/tile/kernel/intvec_32.S
@@ -28,10 +28,6 @@
28#include <arch/interrupts.h> 28#include <arch/interrupts.h>
29#include <arch/spr_def.h> 29#include <arch/spr_def.h>
30 30
31#ifdef CONFIG_PREEMPT
32# error "No support for kernel preemption currently"
33#endif
34
35#define PTREGS_PTR(reg, ptreg) addli reg, sp, C_ABI_SAVE_AREA_SIZE + (ptreg) 31#define PTREGS_PTR(reg, ptreg) addli reg, sp, C_ABI_SAVE_AREA_SIZE + (ptreg)
36 32
37#define PTREGS_OFFSET_SYSCALL PTREGS_OFFSET_REG(TREG_SYSCALL_NR) 33#define PTREGS_OFFSET_SYSCALL PTREGS_OFFSET_REG(TREG_SYSCALL_NR)
@@ -812,17 +808,34 @@ STD_ENTRY(interrupt_return)
812 } 808 }
813 lw r29, r29 809 lw r29, r29
814 andi r29, r29, SPR_EX_CONTEXT_1_1__PL_MASK /* mask off ICS */ 810 andi r29, r29, SPR_EX_CONTEXT_1_1__PL_MASK /* mask off ICS */
811 bzt r29, .Lresume_userspace
812
813#ifdef CONFIG_PREEMPT
814 /* Returning to kernel space. Check if we need preemption. */
815 GET_THREAD_INFO(r29)
816 addli r28, r29, THREAD_INFO_FLAGS_OFFSET
815 { 817 {
816 bzt r29, .Lresume_userspace 818 lw r28, r28
817 PTREGS_PTR(r29, PTREGS_OFFSET_PC) 819 addli r29, r29, THREAD_INFO_PREEMPT_COUNT_OFFSET
820 }
821 {
822 andi r28, r28, _TIF_NEED_RESCHED
823 lw r29, r29
818 } 824 }
825 bzt r28, 1f
826 bnz r29, 1f
827 jal preempt_schedule_irq
828 FEEDBACK_REENTER(interrupt_return)
8291:
830#endif
819 831
820 /* If we're resuming to _cpu_idle_nap, bump PC forward by 8. */ 832 /* If we're resuming to _cpu_idle_nap, bump PC forward by 8. */
821 { 833 {
822 lw r28, r29 834 PTREGS_PTR(r29, PTREGS_OFFSET_PC)
823 moveli r27, lo16(_cpu_idle_nap) 835 moveli r27, lo16(_cpu_idle_nap)
824 } 836 }
825 { 837 {
838 lw r28, r29
826 auli r27, r27, ha16(_cpu_idle_nap) 839 auli r27, r27, ha16(_cpu_idle_nap)
827 } 840 }
828 { 841 {