diff options
Diffstat (limited to 'arch/powerpc/kernel/entry_32.S')
| -rw-r--r-- | arch/powerpc/kernel/entry_32.S | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index b3a979467225..8866fd26c6b9 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
| @@ -128,37 +128,36 @@ transfer_to_handler: | |||
| 128 | stw r12,4(r11) | 128 | stw r12,4(r11) |
| 129 | #endif | 129 | #endif |
| 130 | b 3f | 130 | b 3f |
| 131 | |||
| 131 | 2: /* if from kernel, check interrupted DOZE/NAP mode and | 132 | 2: /* if from kernel, check interrupted DOZE/NAP mode and |
| 132 | * check for stack overflow | 133 | * check for stack overflow |
| 133 | */ | 134 | */ |
| 135 | lwz r9,THREAD_INFO-THREAD(r12) | ||
| 136 | cmplw r1,r9 /* if r1 <= current->thread_info */ | ||
| 137 | ble- stack_ovf /* then the kernel stack overflowed */ | ||
| 138 | 5: | ||
| 134 | #ifdef CONFIG_6xx | 139 | #ifdef CONFIG_6xx |
| 135 | mfspr r11,SPRN_HID0 | 140 | tophys(r9,r9) /* check local flags */ |
| 136 | mtcr r11 | 141 | lwz r12,TI_LOCAL_FLAGS(r9) |
| 137 | BEGIN_FTR_SECTION | 142 | mtcrf 0x01,r12 |
| 138 | bt- 8,4f /* Check DOZE */ | 143 | bt- 31-TLF_NAPPING,4f |
| 139 | END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE) | ||
| 140 | BEGIN_FTR_SECTION | ||
| 141 | bt- 9,4f /* Check NAP */ | ||
| 142 | END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP) | ||
| 143 | #endif /* CONFIG_6xx */ | 144 | #endif /* CONFIG_6xx */ |
| 144 | .globl transfer_to_handler_cont | 145 | .globl transfer_to_handler_cont |
| 145 | transfer_to_handler_cont: | 146 | transfer_to_handler_cont: |
| 146 | lwz r11,THREAD_INFO-THREAD(r12) | ||
| 147 | cmplw r1,r11 /* if r1 <= current->thread_info */ | ||
| 148 | ble- stack_ovf /* then the kernel stack overflowed */ | ||
| 149 | 3: | 147 | 3: |
| 150 | mflr r9 | 148 | mflr r9 |
| 151 | lwz r11,0(r9) /* virtual address of handler */ | 149 | lwz r11,0(r9) /* virtual address of handler */ |
| 152 | lwz r9,4(r9) /* where to go when done */ | 150 | lwz r9,4(r9) /* where to go when done */ |
| 153 | FIX_SRR1(r10,r12) | ||
| 154 | mtspr SPRN_SRR0,r11 | 151 | mtspr SPRN_SRR0,r11 |
| 155 | mtspr SPRN_SRR1,r10 | 152 | mtspr SPRN_SRR1,r10 |
| 156 | mtlr r9 | 153 | mtlr r9 |
| 157 | SYNC | 154 | SYNC |
| 158 | RFI /* jump to handler, enable MMU */ | 155 | RFI /* jump to handler, enable MMU */ |
| 159 | 156 | ||
| 160 | #ifdef CONFIG_6xx | 157 | #ifdef CONFIG_6xx |
| 161 | 4: b power_save_6xx_restore | 158 | 4: rlwinm r12,r12,0,~_TLF_NAPPING |
| 159 | stw r12,TI_LOCAL_FLAGS(r9) | ||
| 160 | b power_save_6xx_restore | ||
| 162 | #endif | 161 | #endif |
| 163 | 162 | ||
| 164 | /* | 163 | /* |
| @@ -167,10 +166,10 @@ transfer_to_handler_cont: | |||
| 167 | */ | 166 | */ |
| 168 | stack_ovf: | 167 | stack_ovf: |
| 169 | /* sometimes we use a statically-allocated stack, which is OK. */ | 168 | /* sometimes we use a statically-allocated stack, which is OK. */ |
| 170 | lis r11,_end@h | 169 | lis r12,_end@h |
| 171 | ori r11,r11,_end@l | 170 | ori r12,r12,_end@l |
| 172 | cmplw r1,r11 | 171 | cmplw r1,r12 |
| 173 | ble 3b /* r1 <= &_end is OK */ | 172 | ble 5b /* r1 <= &_end is OK */ |
| 174 | SAVE_NVGPRS(r11) | 173 | SAVE_NVGPRS(r11) |
| 175 | addi r3,r1,STACK_FRAME_OVERHEAD | 174 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 176 | lis r1,init_thread_union@ha | 175 | lis r1,init_thread_union@ha |
