diff options
Diffstat (limited to 'arch/mips/kernel/entry.S')
-rw-r--r-- | arch/mips/kernel/entry.S | 69 |
1 files changed, 46 insertions, 23 deletions
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index 83c87fe4ee4f..d101d2fb24ca 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S | |||
@@ -17,6 +17,9 @@ | |||
17 | #include <asm/isadep.h> | 17 | #include <asm/isadep.h> |
18 | #include <asm/thread_info.h> | 18 | #include <asm/thread_info.h> |
19 | #include <asm/war.h> | 19 | #include <asm/war.h> |
20 | #ifdef CONFIG_MIPS_MT_SMTC | ||
21 | #include <asm/mipsmtregs.h> | ||
22 | #endif | ||
20 | 23 | ||
21 | #ifdef CONFIG_PREEMPT | 24 | #ifdef CONFIG_PREEMPT |
22 | .macro preempt_stop | 25 | .macro preempt_stop |
@@ -75,6 +78,37 @@ FEXPORT(syscall_exit) | |||
75 | bnez t0, syscall_exit_work | 78 | bnez t0, syscall_exit_work |
76 | 79 | ||
77 | FEXPORT(restore_all) # restore full frame | 80 | FEXPORT(restore_all) # restore full frame |
81 | #ifdef CONFIG_MIPS_MT_SMTC | ||
82 | /* Detect and execute deferred IPI "interrupts" */ | ||
83 | move a0,sp | ||
84 | jal deferred_smtc_ipi | ||
85 | /* Re-arm any temporarily masked interrupts not explicitly "acked" */ | ||
86 | mfc0 v0, CP0_TCSTATUS | ||
87 | ori v1, v0, TCSTATUS_IXMT | ||
88 | mtc0 v1, CP0_TCSTATUS | ||
89 | andi v0, TCSTATUS_IXMT | ||
90 | ehb | ||
91 | mfc0 t0, CP0_TCCONTEXT | ||
92 | DMT 9 # dmt t1 | ||
93 | jal mips_ihb | ||
94 | mfc0 t2, CP0_STATUS | ||
95 | andi t3, t0, 0xff00 | ||
96 | or t2, t2, t3 | ||
97 | mtc0 t2, CP0_STATUS | ||
98 | ehb | ||
99 | andi t1, t1, VPECONTROL_TE | ||
100 | beqz t1, 1f | ||
101 | EMT | ||
102 | 1: | ||
103 | mfc0 v1, CP0_TCSTATUS | ||
104 | /* We set IXMT above, XOR should cler it here */ | ||
105 | xori v1, v1, TCSTATUS_IXMT | ||
106 | or v1, v0, v1 | ||
107 | mtc0 v1, CP0_TCSTATUS | ||
108 | ehb | ||
109 | xor t0, t0, t3 | ||
110 | mtc0 t0, CP0_TCCONTEXT | ||
111 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
78 | .set noat | 112 | .set noat |
79 | RESTORE_TEMP | 113 | RESTORE_TEMP |
80 | RESTORE_AT | 114 | RESTORE_AT |
@@ -120,28 +154,17 @@ syscall_exit_work: | |||
120 | jal do_syscall_trace | 154 | jal do_syscall_trace |
121 | b resume_userspace | 155 | b resume_userspace |
122 | 156 | ||
157 | #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT) | ||
158 | |||
123 | /* | 159 | /* |
124 | * Common spurious interrupt handler. | 160 | * MIPS32R2 Instruction Hazard Barrier - must be called |
161 | * | ||
162 | * For C code use the inline version named instruction_hazard(). | ||
125 | */ | 163 | */ |
126 | LEAF(spurious_interrupt) | 164 | LEAF(mips_ihb) |
127 | /* | 165 | .set mips32r2 |
128 | * Someone tried to fool us by sending an interrupt but we | 166 | jr.hb ra |
129 | * couldn't find a cause for it. | 167 | nop |
130 | */ | 168 | END(mips_ihb) |
131 | PTR_LA t1, irq_err_count | 169 | |
132 | #ifdef CONFIG_SMP | 170 | #endif /* CONFIG_CPU_MIPSR2 or CONFIG_MIPS_MT */ |
133 | 1: ll t0, (t1) | ||
134 | addiu t0, 1 | ||
135 | sc t0, (t1) | ||
136 | #if R10000_LLSC_WAR | ||
137 | beqzl t0, 1b | ||
138 | #else | ||
139 | beqz t0, 1b | ||
140 | #endif | ||
141 | #else | ||
142 | lw t0, (t1) | ||
143 | addiu t0, 1 | ||
144 | sw t0, (t1) | ||
145 | #endif | ||
146 | j ret_from_irq | ||
147 | END(spurious_interrupt) | ||