aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_32.S
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-05-14 00:30:48 -0400
committerPaul Mackerras <paulus@samba.org>2008-05-16 09:22:28 -0400
commita560643e21e1ac10f7398b45111aecdd7f47a4a5 (patch)
tree32cd887f782c35c60cc2a925ab4c49f762851319 /arch/powerpc/kernel/entry_32.S
parentfcff474ea5cb17ff015aa40e92ed86fede41f1e2 (diff)
[POWERPC] Defer processing of interrupts when the CPU wakes from sleep mode
This provides a way to defer processing of an interrupt that wakes the processor out of sleep mode. On 32-bit platforms that use an interrupt to wake the processor, we have to have interrupts enabled in hardware at the point where we go to sleep, otherwise the processor will never wake up. However, because interrupts are logically disabled at this point, we don't want to process the interrupt straight away. This is handled by setting the _TLF_SLEEPING flag. When we get an interrupt and _TLF_SLEEPING is set, we firstly clear the MSR_EE (external interrupt enable) bit in the saved MSR value, and secondly we then return to the address in the link register, like we do for _TLF_NAPPING, but without actually handling the interrupt. Note that this is handled somewhat differently on powerbooks, so this new code will only be used on non-Apple machines. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/entry_32.S')
-rw-r--r--arch/powerpc/kernel/entry_32.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 3a05e9f93d4..888a364043a 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -147,6 +147,7 @@ transfer_to_handler:
147 lwz r12,TI_LOCAL_FLAGS(r9) 147 lwz r12,TI_LOCAL_FLAGS(r9)
148 mtcrf 0x01,r12 148 mtcrf 0x01,r12
149 bt- 31-TLF_NAPPING,4f 149 bt- 31-TLF_NAPPING,4f
150 bt- 31-TLF_SLEEPING,7f
150#endif /* CONFIG_6xx */ 151#endif /* CONFIG_6xx */
151 .globl transfer_to_handler_cont 152 .globl transfer_to_handler_cont
152transfer_to_handler_cont: 153transfer_to_handler_cont:
@@ -164,6 +165,13 @@ transfer_to_handler_cont:
1644: rlwinm r12,r12,0,~_TLF_NAPPING 1654: rlwinm r12,r12,0,~_TLF_NAPPING
165 stw r12,TI_LOCAL_FLAGS(r9) 166 stw r12,TI_LOCAL_FLAGS(r9)
166 b power_save_6xx_restore 167 b power_save_6xx_restore
168
1697: rlwinm r12,r12,0,~_TLF_SLEEPING
170 stw r12,TI_LOCAL_FLAGS(r9)
171 lwz r9,_MSR(r11) /* if sleeping, clear MSR.EE */
172 rlwinm r9,r9,0,~MSR_EE
173 lwz r12,_LINK(r11) /* and return to address in LR */
174 b fast_exception_return
167#endif 175#endif
168 176
169/* 177/*