entry_32.S (2ac5e38ea4203852d6e99edd3cf11f044b0a409f) | entry_32.S (d7cceda96badc1bd444cff27ab9c375a1277c1e3) |
---|---|
1/* 2 * PowerPC version 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 4 * Rewritten by Cort Dougan (cort@fsmlabs.com) for PReP 5 * Copyright (C) 1996 Cort Dougan <cort@fsmlabs.com> 6 * Adapted for Power Macintosh by Paul Mackerras. 7 * Low-level exception handlers and MMU support 8 * rewritten by Paul Mackerras. --- 186 unchanged lines hidden (view full) --- 195 1962: /* if from kernel, check interrupted DOZE/NAP mode and 197 * check for stack overflow 198 */ 199 lwz r9,KSP_LIMIT(r12) 200 cmplw r1,r9 /* if r1 <= ksp_limit */ 201 ble- stack_ovf /* then the kernel stack overflowed */ 2025: | 1/* 2 * PowerPC version 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 4 * Rewritten by Cort Dougan (cort@fsmlabs.com) for PReP 5 * Copyright (C) 1996 Cort Dougan <cort@fsmlabs.com> 6 * Adapted for Power Macintosh by Paul Mackerras. 7 * Low-level exception handlers and MMU support 8 * rewritten by Paul Mackerras. --- 186 unchanged lines hidden (view full) --- 195 1962: /* if from kernel, check interrupted DOZE/NAP mode and 197 * check for stack overflow 198 */ 199 lwz r9,KSP_LIMIT(r12) 200 cmplw r1,r9 /* if r1 <= ksp_limit */ 201 ble- stack_ovf /* then the kernel stack overflowed */ 2025: |
203#if defined(CONFIG_6xx) || defined(CONFIG_E500) | 203#if defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_E500) |
204 CURRENT_THREAD_INFO(r9, r1) 205 tophys(r9,r9) /* check local flags */ 206 lwz r12,TI_LOCAL_FLAGS(r9) 207 mtcrf 0x01,r12 208 bt- 31-TLF_NAPPING,4f 209 bt- 31-TLF_SLEEPING,7f | 204 CURRENT_THREAD_INFO(r9, r1) 205 tophys(r9,r9) /* check local flags */ 206 lwz r12,TI_LOCAL_FLAGS(r9) 207 mtcrf 0x01,r12 208 bt- 31-TLF_NAPPING,4f 209 bt- 31-TLF_SLEEPING,7f |
210#endif /* CONFIG_6xx || CONFIG_E500 */ | 210#endif /* CONFIG_PPC_BOOK3S_32 || CONFIG_E500 */ |
211 .globl transfer_to_handler_cont 212transfer_to_handler_cont: 2133: 214 mflr r9 215 lwz r11,0(r9) /* virtual address of handler */ 216 lwz r9,4(r9) /* where to go when done */ 217#if defined(CONFIG_PPC_8xx) && defined(CONFIG_PERF_EVENTS) 218 mtspr SPRN_NRI, r0 --- 49 unchanged lines hidden (view full) --- 268#else /* CONFIG_TRACE_IRQFLAGS */ 269 mtspr SPRN_SRR0,r11 270 mtspr SPRN_SRR1,r10 271 mtlr r9 272 SYNC 273 RFI /* jump to handler, enable MMU */ 274#endif /* CONFIG_TRACE_IRQFLAGS */ 275 | 211 .globl transfer_to_handler_cont 212transfer_to_handler_cont: 2133: 214 mflr r9 215 lwz r11,0(r9) /* virtual address of handler */ 216 lwz r9,4(r9) /* where to go when done */ 217#if defined(CONFIG_PPC_8xx) && defined(CONFIG_PERF_EVENTS) 218 mtspr SPRN_NRI, r0 --- 49 unchanged lines hidden (view full) --- 268#else /* CONFIG_TRACE_IRQFLAGS */ 269 mtspr SPRN_SRR0,r11 270 mtspr SPRN_SRR1,r10 271 mtlr r9 272 SYNC 273 RFI /* jump to handler, enable MMU */ 274#endif /* CONFIG_TRACE_IRQFLAGS */ 275 |
276#if defined (CONFIG_6xx) || defined(CONFIG_E500) | 276#if defined (CONFIG_PPC_BOOK3S_32) || defined(CONFIG_E500) |
2774: rlwinm r12,r12,0,~_TLF_NAPPING 278 stw r12,TI_LOCAL_FLAGS(r9) 279 b power_save_ppc32_restore 280 2817: rlwinm r12,r12,0,~_TLF_SLEEPING 282 stw r12,TI_LOCAL_FLAGS(r9) 283 lwz r9,_MSR(r11) /* if sleeping, clear MSR.EE */ 284 rlwinm r9,r9,0,~MSR_EE --- 322 unchanged lines hidden (view full) --- 607 * This is in assembler because if do_page_fault tells us that 608 * it is a bad kernel page fault, we want to save the non-volatile 609 * registers before calling bad_page_fault. 610 */ 611 .globl handle_page_fault 612handle_page_fault: 613 stw r4,_DAR(r1) 614 addi r3,r1,STACK_FRAME_OVERHEAD | 2774: rlwinm r12,r12,0,~_TLF_NAPPING 278 stw r12,TI_LOCAL_FLAGS(r9) 279 b power_save_ppc32_restore 280 2817: rlwinm r12,r12,0,~_TLF_SLEEPING 282 stw r12,TI_LOCAL_FLAGS(r9) 283 lwz r9,_MSR(r11) /* if sleeping, clear MSR.EE */ 284 rlwinm r9,r9,0,~MSR_EE --- 322 unchanged lines hidden (view full) --- 607 * This is in assembler because if do_page_fault tells us that 608 * it is a bad kernel page fault, we want to save the non-volatile 609 * registers before calling bad_page_fault. 610 */ 611 .globl handle_page_fault 612handle_page_fault: 613 stw r4,_DAR(r1) 614 addi r3,r1,STACK_FRAME_OVERHEAD |
615#ifdef CONFIG_6xx | 615#ifdef CONFIG_PPC_BOOK3S_32 |
616 andis. r0,r5,DSISR_DABRMATCH@h 617 bne- handle_dabr_fault 618#endif 619 bl do_page_fault 620 cmpwi r3,0 621 beq+ ret_from_except 622 SAVE_NVGPRS(r1) 623 lwz r0,_TRAP(r1) 624 clrrwi r0,r0,1 625 stw r0,_TRAP(r1) 626 mr r5,r3 627 addi r3,r1,STACK_FRAME_OVERHEAD 628 lwz r4,_DAR(r1) 629 bl bad_page_fault 630 b ret_from_except_full 631 | 616 andis. r0,r5,DSISR_DABRMATCH@h 617 bne- handle_dabr_fault 618#endif 619 bl do_page_fault 620 cmpwi r3,0 621 beq+ ret_from_except 622 SAVE_NVGPRS(r1) 623 lwz r0,_TRAP(r1) 624 clrrwi r0,r0,1 625 stw r0,_TRAP(r1) 626 mr r5,r3 627 addi r3,r1,STACK_FRAME_OVERHEAD 628 lwz r4,_DAR(r1) 629 bl bad_page_fault 630 b ret_from_except_full 631 |
632#ifdef CONFIG_6xx | 632#ifdef CONFIG_PPC_BOOK3S_32 |
633 /* We have a data breakpoint exception - handle it */ 634handle_dabr_fault: 635 SAVE_NVGPRS(r1) 636 lwz r0,_TRAP(r1) 637 clrrwi r0,r0,1 638 stw r0,_TRAP(r1) 639 bl do_break 640 b ret_from_except_full --- 717 unchanged lines hidden --- | 633 /* We have a data breakpoint exception - handle it */ 634handle_dabr_fault: 635 SAVE_NVGPRS(r1) 636 lwz r0,_TRAP(r1) 637 clrrwi r0,r0,1 638 stw r0,_TRAP(r1) 639 bl do_break 640 b ret_from_except_full --- 717 unchanged lines hidden --- |