19 #define LT(cr) ((cr)*4+0) 20 #define GT(cr) ((cr)*4+1) 21 #define EQ(cr) ((cr)*4+2) 24 #define STW_R1_R13(off) ((((36<<10)|(r1<<5)|(r13))<<16) | ((off)&0xffff)) 26 #define FRAME_REGISTER r14 27 #define VECTOR_REGISTER r4 28 #define SCRATCH_REGISTER_0 r5 29 #define SCRATCH_REGISTER_1 r6 30 #define SCRATCH_REGISTER_2 r7 32 #define FRAME_OFFSET( r) GPR14_OFFSET( r) 33 #define VECTOR_OFFSET( r) GPR4_OFFSET( r) 34 #define SCRATCH_REGISTER_0_OFFSET( r) GPR5_OFFSET( r) 35 #define SCRATCH_REGISTER_1_OFFSET( r) GPR6_OFFSET( r) 36 #define SCRATCH_REGISTER_2_OFFSET( r) GPR7_OFFSET( r) 77 .macro PPC_EXC_MIN_PROLOG_ASYNC _NAME _VEC _PRI _FLVR
79 .global ppc_exc_min_prolog_async_\_NAME
80 ppc_exc_min_prolog_async_\_NAME:
101 stw r1, ppc_exc_lock_\_PRI@sdarel(r13)
106 stw VECTOR_REGISTER, ppc_exc_vector_register_\_PRI@sdarel(r13)
109 li VECTOR_REGISTER, ( \_VEC | 0xffff8000 )
115 .
int ppc_exc_wrap_\_FLVR
129 .macro PPC_EXC_MIN_PROLOG_SYNC _NAME _VEC _PRI _FLVR
131 .global ppc_exc_min_prolog_sync_\_NAME
132 ppc_exc_min_prolog_sync_\_NAME:
133 stwu r1, -EXCEPTION_FRAME_END(r1)
134 stw VECTOR_REGISTER, VECTOR_OFFSET(r1)
135 li VECTOR_REGISTER, \_VEC
141 .int ppc_exc_wrap_nopush_\_FLVR
159 .macro TEST_1ST_OPCODE_crit _REG
161 lwz \_REG, SRR0_FRAME_OFFSET(FRAME_REGISTER)
166 subis \_REG, \_REG, STW_R1_R13(0)@h
171 cmplwi cr0, \_REG, ppc_exc_lock_std@sdarel
184 .macro TEST_LOCK_std _FLVR
186 creqv EQ(CR_LOCK), EQ(CR_LOCK), EQ(CR_LOCK)
205 .macro TEST_LOCK_crit _FLVR
209 GET_INTERRUPT_MASK mask=SCRATCH_REGISTER_1
211 andis. SCRATCH_REGISTER_1, SCRATCH_REGISTER_1, MSR_CE@h
212 beq TEST_LOCK_crit_done_\_FLVR
218 TEST_1ST_OPCODE_crit _REG=SCRATCH_REGISTER_0
227 lwz SCRATCH_REGISTER_1, ppc_exc_lock_std@sdarel(r13)
228 cmplwi CR_LOCK, SCRATCH_REGISTER_1, 0
231 TEST_LOCK_crit_done_\_FLVR:
242 crandc EQ(CR_LOCK), EQ(CR_LOCK), EQ(cr0)
262 .macro TEST_LOCK_mchk _SRR0 _FLVR
264 crxor EQ(CR_LOCK), EQ(CR_LOCK), EQ(CR_LOCK)
281 .macro RECOVER_CHECK_std _FLVR
283 #ifndef PPC_EXC_CONFIG_BOOKE_ONLY 286 lwz SCRATCH_REGISTER_0, SRR1_FRAME_OFFSET(FRAME_REGISTER)
288 xor SCRATCH_REGISTER_1, SCRATCH_REGISTER_1, SCRATCH_REGISTER_0
289 andi. SCRATCH_REGISTER_0, SCRATCH_REGISTER_1, MSR_RI
291 recover_check_twiddle_std_\_FLVR:
294 bne recover_check_twiddle_std_\_FLVR
301 .macro RECOVER_CHECK_crit _FLVR
308 .macro RECOVER_CHECK_mchk _FLVR
310 #ifndef PPC_EXC_CONFIG_BOOKE_ONLY 313 lwz SCRATCH_REGISTER_0, SRR1_FRAME_OFFSET(FRAME_REGISTER)
315 xor SCRATCH_REGISTER_1, SCRATCH_REGISTER_1, SCRATCH_REGISTER_0
316 andi. SCRATCH_REGISTER_0, SCRATCH_REGISTER_1, MSR_RI
318 recover_check_twiddle_mchk_\_FLVR:
321 bne recover_check_twiddle_mchk_\_FLVR
392 .macro WRAP _FLVR _PRI _SRR0 _SRR1 _RFI
394 .global ppc_exc_wrap_\_FLVR
398 stwu r1, -EXCEPTION_FRAME_END(r1)
400 .global ppc_exc_wrap_nopush_\_FLVR
401 ppc_exc_wrap_nopush_\_FLVR:
404 stw FRAME_REGISTER, FRAME_OFFSET(r1)
406 wrap_no_save_frame_register_\_FLVR:
415 mr FRAME_REGISTER, r1
418 stw SCRATCH_REGISTER_0, SCRATCH_REGISTER_0_OFFSET(FRAME_REGISTER)
419 stw SCRATCH_REGISTER_1, SCRATCH_REGISTER_1_OFFSET(FRAME_REGISTER)
420 stw SCRATCH_REGISTER_2, SCRATCH_REGISTER_2_OFFSET(FRAME_REGISTER)
423 mfcr SCRATCH_REGISTER_0
424 stw SCRATCH_REGISTER_0, EXC_CR_OFFSET(FRAME_REGISTER)
427 cmpwi CR_TYPE, VECTOR_REGISTER, 0
429 #if defined(PPC_MULTILIB_FPU) || defined(PPC_MULTILIB_ALTIVEC) 431 mfmsr SCRATCH_REGISTER_0
432 #ifdef PPC_MULTILIB_FPU 433 ori SCRATCH_REGISTER_0, SCRATCH_REGISTER_0, MSR_FP
435 #ifdef PPC_MULTILIB_ALTIVEC 436 oris SCRATCH_REGISTER_0, SCRATCH_REGISTER_0, MSR_VE >> 16
438 mtmsr SCRATCH_REGISTER_0
448 bge CR_TYPE, wrap_save_non_volatile_regs_\_FLVR
458 GET_SELF_CPU_CONTROL SCRATCH_REGISTER_2
459 lwz SCRATCH_REGISTER_0, PER_CPU_ISR_NEST_LEVEL@
l(SCRATCH_REGISTER_2)
460 lwz SCRATCH_REGISTER_1, PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL(SCRATCH_REGISTER_2)
461 addi SCRATCH_REGISTER_0, SCRATCH_REGISTER_0, 1
462 addi SCRATCH_REGISTER_1, SCRATCH_REGISTER_1, 1
463 stw SCRATCH_REGISTER_0, PER_CPU_ISR_NEST_LEVEL@
l(SCRATCH_REGISTER_2)
464 stw SCRATCH_REGISTER_1, PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL(SCRATCH_REGISTER_2)
472 li SCRATCH_REGISTER_0, 0
473 stw SCRATCH_REGISTER_0, ppc_exc_lock_\_PRI@sdarel(r13)
476 mfspr SCRATCH_REGISTER_0, SPRG1
477 cmpw SCRATCH_REGISTER_0, r1
478 blt wrap_stack_switch_\_FLVR
479 mfspr SCRATCH_REGISTER_1, SPRG2
480 cmpw SCRATCH_REGISTER_1, r1
481 blt wrap_stack_switch_done_\_FLVR
483 wrap_stack_switch_\_FLVR:
485 mr r1, SCRATCH_REGISTER_0
487 wrap_stack_switch_done_\_FLVR:
494 lwz SCRATCH_REGISTER_2, ppc_exc_vector_register_\_PRI@sdarel(r13)
497 stw SCRATCH_REGISTER_2, VECTOR_OFFSET(FRAME_REGISTER)
499 wrap_disable_thread_dispatching_done_\_FLVR:
511 mfspr SCRATCH_REGISTER_0, \_SRR0
512 stw SCRATCH_REGISTER_0, SRR0_FRAME_OFFSET(FRAME_REGISTER)
515 mfspr SCRATCH_REGISTER_0, \_SRR1
516 stw SCRATCH_REGISTER_0, SRR1_FRAME_OFFSET(FRAME_REGISTER)
519 mfctr SCRATCH_REGISTER_0
520 stw SCRATCH_REGISTER_0, EXC_CTR_OFFSET(FRAME_REGISTER)
523 mfxer SCRATCH_REGISTER_0
524 stw SCRATCH_REGISTER_0, EXC_XER_OFFSET(FRAME_REGISTER)
527 mflr SCRATCH_REGISTER_0
528 stw SCRATCH_REGISTER_0, EXC_LR_OFFSET(FRAME_REGISTER)
531 stw r0, GPR0_OFFSET(FRAME_REGISTER)
532 stw r3, GPR3_OFFSET(FRAME_REGISTER)
533 stw r8, GPR8_OFFSET(FRAME_REGISTER)
534 stw r9, GPR9_OFFSET(FRAME_REGISTER)
535 stw r10, GPR10_OFFSET(FRAME_REGISTER)
536 stw r11, GPR11_OFFSET(FRAME_REGISTER)
537 stw r12, GPR12_OFFSET(FRAME_REGISTER)
540 stw r2, GPR2_OFFSET(FRAME_REGISTER)
543 stw VECTOR_REGISTER, EXCEPTION_NUMBER_OFFSET(FRAME_REGISTER)
545 #ifndef PPC_EXC_CONFIG_BOOKE_ONLY 554 cmpwi CR_MSR, SCRATCH_REGISTER_0, 0
555 bne CR_MSR, wrap_change_msr_\_FLVR
557 wrap_change_msr_done_\_FLVR:
561 #if defined(__ALTIVEC__) && !defined(PPC_MULTILIB_ALTIVEC) 562 LA SCRATCH_REGISTER_0, _CPU_save_altivec_volatile
563 mtctr SCRATCH_REGISTER_0
564 addi r3, FRAME_REGISTER, EXC_VEC_OFFSET
569 li SCRATCH_REGISTER_0, 0
570 mtvrsave SCRATCH_REGISTER_0
579 lwz VECTOR_REGISTER, EXCEPTION_NUMBER_OFFSET(FRAME_REGISTER)
582 #ifdef PPC_MULTILIB_ALTIVEC 583 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(0)
584 stvx v0, FRAME_REGISTER, SCRATCH_REGISTER_0
586 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(1)
587 stvx v1, FRAME_REGISTER, SCRATCH_REGISTER_0
588 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(2)
589 stvx v2, FRAME_REGISTER, SCRATCH_REGISTER_0
590 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(3)
591 stvx v3, FRAME_REGISTER, SCRATCH_REGISTER_0
592 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(4)
593 stvx v4, FRAME_REGISTER, SCRATCH_REGISTER_0
594 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(5)
595 stvx v5, FRAME_REGISTER, SCRATCH_REGISTER_0
596 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(6)
597 stvx v6, FRAME_REGISTER, SCRATCH_REGISTER_0
598 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(7)
599 stvx v7, FRAME_REGISTER, SCRATCH_REGISTER_0
600 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(8)
601 stvx v8, FRAME_REGISTER, SCRATCH_REGISTER_0
602 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(9)
603 stvx v9, FRAME_REGISTER, SCRATCH_REGISTER_0
604 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(0)
605 stvx v10, FRAME_REGISTER, SCRATCH_REGISTER_0
606 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(11)
607 stvx v11, FRAME_REGISTER, SCRATCH_REGISTER_0
608 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(12)
609 stvx v12, FRAME_REGISTER, SCRATCH_REGISTER_0
610 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(13)
611 stvx v13, FRAME_REGISTER, SCRATCH_REGISTER_0
612 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(14)
613 stvx v14, FRAME_REGISTER, SCRATCH_REGISTER_0
614 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(15)
615 stvx v15, FRAME_REGISTER, SCRATCH_REGISTER_0
616 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(16)
617 stvx v16, FRAME_REGISTER, SCRATCH_REGISTER_0
618 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(17)
619 stvx v17, FRAME_REGISTER, SCRATCH_REGISTER_0
620 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(18)
621 stvx v18, FRAME_REGISTER, SCRATCH_REGISTER_0
622 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(19)
623 stvx v19, FRAME_REGISTER, SCRATCH_REGISTER_0
624 li SCRATCH_REGISTER_0, PPC_EXC_VSCR_OFFSET
625 stvewx v0, r1, SCRATCH_REGISTER_0
628 #ifdef PPC_MULTILIB_FPU 629 stfd f0, PPC_EXC_FR_OFFSET(0)(FRAME_REGISTER)
631 stfd f1, PPC_EXC_FR_OFFSET(1)(FRAME_REGISTER)
632 stfd f2, PPC_EXC_FR_OFFSET(2)(FRAME_REGISTER)
633 stfd f3, PPC_EXC_FR_OFFSET(3)(FRAME_REGISTER)
634 stfd f4, PPC_EXC_FR_OFFSET(4)(FRAME_REGISTER)
635 stfd f5, PPC_EXC_FR_OFFSET(5)(FRAME_REGISTER)
636 stfd f6, PPC_EXC_FR_OFFSET(6)(FRAME_REGISTER)
637 stfd f7, PPC_EXC_FR_OFFSET(7)(FRAME_REGISTER)
638 stfd f8, PPC_EXC_FR_OFFSET(8)(FRAME_REGISTER)
639 stfd f9, PPC_EXC_FR_OFFSET(9)(FRAME_REGISTER)
640 stfd f10, PPC_EXC_FR_OFFSET(10)(FRAME_REGISTER)
641 stfd f11, PPC_EXC_FR_OFFSET(11)(FRAME_REGISTER)
642 stfd f12, PPC_EXC_FR_OFFSET(12)(FRAME_REGISTER)
643 stfd f13, PPC_EXC_FR_OFFSET(13)(FRAME_REGISTER)
644 stfd f0, PPC_EXC_FPSCR_OFFSET(FRAME_REGISTER)
657 rlwinm SCRATCH_REGISTER_1, VECTOR_REGISTER, 2, 25, 29
663 lwzx SCRATCH_REGISTER_0, SCRATCH_REGISTER_0, SCRATCH_REGISTER_1
671 addi r3, FRAME_REGISTER, FRAME_LINK_SPACE
680 rlwinm VECTOR_REGISTER, VECTOR_REGISTER, 0, 27, 31
683 mtctr SCRATCH_REGISTER_0
688 bne wrap_call_global_handler_\_FLVR
690 wrap_handler_done_\_FLVR:
693 RECOVER_CHECK_\_PRI _FLVR=\_FLVR
702 bge CR_TYPE, wrap_restore_non_volatile_regs_\_FLVR
708 mr r1, FRAME_REGISTER
718 GET_SELF_CPU_CONTROL SCRATCH_REGISTER_2
719 lwz SCRATCH_REGISTER_0, PER_CPU_ISR_NEST_LEVEL@
l(SCRATCH_REGISTER_2)
720 lwz SCRATCH_REGISTER_1, PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL(SCRATCH_REGISTER_2)
721 subi SCRATCH_REGISTER_0, SCRATCH_REGISTER_0, 1
722 subic. SCRATCH_REGISTER_1, SCRATCH_REGISTER_1, 1
723 stw SCRATCH_REGISTER_0, PER_CPU_ISR_NEST_LEVEL@
l(SCRATCH_REGISTER_2)
724 stw SCRATCH_REGISTER_1, PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL(SCRATCH_REGISTER_2)
727 bne wrap_thread_dispatching_done_\_FLVR
730 TEST_LOCK_\_PRI _FLVR=\_FLVR
733 bne CR_LOCK, wrap_thread_dispatching_done_\_FLVR
736 LA SCRATCH_REGISTER_0, ppc_exc_wrapup
739 addi r3, FRAME_REGISTER, FRAME_LINK_SPACE
742 mtctr SCRATCH_REGISTER_0
745 wrap_thread_dispatching_done_\_FLVR:
747 #if defined(__ALTIVEC__) && !defined(PPC_MULTILIB_ALTIVEC) 748 LA SCRATCH_REGISTER_0, _CPU_load_altivec_volatile
749 mtctr SCRATCH_REGISTER_0
750 addi r3, FRAME_REGISTER, EXC_VEC_OFFSET
754 #ifdef PPC_MULTILIB_ALTIVEC 755 li SCRATCH_REGISTER_0, PPC_EXC_MIN_VSCR_OFFSET
756 lvewx v0, r1, SCRATCH_REGISTER_0
758 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(0)
759 lvx v0, FRAME_REGISTER, SCRATCH_REGISTER_0
760 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(1)
761 lvx v1, FRAME_REGISTER, SCRATCH_REGISTER_0
762 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(2)
763 lvx v2, FRAME_REGISTER, SCRATCH_REGISTER_0
764 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(3)
765 lvx v3, FRAME_REGISTER, SCRATCH_REGISTER_0
766 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(4)
767 lvx v4, FRAME_REGISTER, SCRATCH_REGISTER_0
768 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(5)
769 lvx v5, FRAME_REGISTER, SCRATCH_REGISTER_0
770 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(6)
771 lvx v6, FRAME_REGISTER, SCRATCH_REGISTER_0
772 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(7)
773 lvx v7, FRAME_REGISTER, SCRATCH_REGISTER_0
774 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(8)
775 lvx v8, FRAME_REGISTER, SCRATCH_REGISTER_0
776 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(9)
777 lvx v9, FRAME_REGISTER, SCRATCH_REGISTER_0
778 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(0)
779 lvx v10, FRAME_REGISTER, SCRATCH_REGISTER_0
780 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(11)
781 lvx v11, FRAME_REGISTER, SCRATCH_REGISTER_0
782 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(12)
783 lvx v12, FRAME_REGISTER, SCRATCH_REGISTER_0
784 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(13)
785 lvx v13, FRAME_REGISTER, SCRATCH_REGISTER_0
786 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(14)
787 lvx v14, FRAME_REGISTER, SCRATCH_REGISTER_0
788 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(15)
789 lvx v15, FRAME_REGISTER, SCRATCH_REGISTER_0
790 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(16)
791 lvx v16, FRAME_REGISTER, SCRATCH_REGISTER_0
792 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(17)
793 lvx v17, FRAME_REGISTER, SCRATCH_REGISTER_0
794 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(18)
795 lvx v18, FRAME_REGISTER, SCRATCH_REGISTER_0
796 li SCRATCH_REGISTER_0, PPC_EXC_VR_OFFSET(19)
797 lvx v19, FRAME_REGISTER, SCRATCH_REGISTER_0
800 #ifdef PPC_MULTILIB_FPU 801 lfd f0, PPC_EXC_FPSCR_OFFSET(FRAME_REGISTER)
803 lfd f0, PPC_EXC_FR_OFFSET(0)(FRAME_REGISTER)
804 lfd f1, PPC_EXC_FR_OFFSET(1)(FRAME_REGISTER)
805 lfd f2, PPC_EXC_FR_OFFSET(2)(FRAME_REGISTER)
806 lfd f3, PPC_EXC_FR_OFFSET(3)(FRAME_REGISTER)
807 lfd f4, PPC_EXC_FR_OFFSET(4)(FRAME_REGISTER)
808 lfd f5, PPC_EXC_FR_OFFSET(5)(FRAME_REGISTER)
809 lfd f6, PPC_EXC_FR_OFFSET(6)(FRAME_REGISTER)
810 lfd f7, PPC_EXC_FR_OFFSET(7)(FRAME_REGISTER)
811 lfd f8, PPC_EXC_FR_OFFSET(8)(FRAME_REGISTER)
812 lfd f9, PPC_EXC_FR_OFFSET(9)(FRAME_REGISTER)
813 lfd f10, PPC_EXC_FR_OFFSET(10)(FRAME_REGISTER)
814 lfd f11, PPC_EXC_FR_OFFSET(11)(FRAME_REGISTER)
815 lfd f12, PPC_EXC_FR_OFFSET(12)(FRAME_REGISTER)
816 lfd f13, PPC_EXC_FR_OFFSET(13)(FRAME_REGISTER)
819 #ifndef PPC_EXC_CONFIG_BOOKE_ONLY
822 bne CR_MSR, wrap_restore_msr_\_FLVR
824 wrap_restore_msr_done_\_FLVR:
834 lwz FRAME_REGISTER, FRAME_OFFSET(r1)
837 lwz SCRATCH_REGISTER_0, EXC_XER_OFFSET(r1)
838 lwz SCRATCH_REGISTER_1, EXC_CTR_OFFSET(r1)
839 mtxer SCRATCH_REGISTER_0
840 mtctr SCRATCH_REGISTER_1
843 lwz SCRATCH_REGISTER_0, EXC_CR_OFFSET(r1)
844 lwz SCRATCH_REGISTER_1, EXC_LR_OFFSET(r1)
845 mtcr SCRATCH_REGISTER_0
846 mtlr SCRATCH_REGISTER_1
849 lwz r0, GPR0_OFFSET(r1)
850 lwz r3, GPR3_OFFSET(r1)
851 lwz r8, GPR8_OFFSET(r1)
852 lwz r9, GPR9_OFFSET(r1)
853 lwz r10, GPR10_OFFSET(r1)
854 lwz r11, GPR11_OFFSET(r1)
855 lwz r12, GPR12_OFFSET(r1)
858 lwz r2, GPR2_OFFSET(r1)
861 lwz VECTOR_REGISTER, VECTOR_OFFSET(r1)
867 INTERRUPT_DISABLE SCRATCH_REGISTER_1, SCRATCH_REGISTER_0
870 lwz SCRATCH_REGISTER_0, SRR0_FRAME_OFFSET(r1)
871 lwz SCRATCH_REGISTER_1, SRR1_FRAME_OFFSET(r1)
872 lwz SCRATCH_REGISTER_2, SCRATCH_REGISTER_2_OFFSET(r1)
873 mtspr \_SRR0, SCRATCH_REGISTER_0
874 lwz SCRATCH_REGISTER_0, SCRATCH_REGISTER_0_OFFSET(r1)
875 mtspr \_SRR1, SCRATCH_REGISTER_1
876 lwz SCRATCH_REGISTER_1, SCRATCH_REGISTER_1_OFFSET(r1)
888 #ifndef PPC_EXC_CONFIG_BOOKE_ONLY
890 wrap_change_msr_\_FLVR:
892 mfmsr SCRATCH_REGISTER_1
893 or SCRATCH_REGISTER_1, SCRATCH_REGISTER_1, SCRATCH_REGISTER_0
894 mtmsr SCRATCH_REGISTER_1
897 b wrap_change_msr_done_\_FLVR
899 wrap_restore_msr_\_FLVR:
902 mfmsr SCRATCH_REGISTER_1
903 andc SCRATCH_REGISTER_1, SCRATCH_REGISTER_1, SCRATCH_REGISTER_0
904 mtmsr SCRATCH_REGISTER_1
907 b wrap_restore_msr_done_\_FLVR
911 wrap_save_non_volatile_regs_\_FLVR:
914 lwz SCRATCH_REGISTER_1, 0(FRAME_REGISTER)
917 stw r13, GPR13_OFFSET(FRAME_REGISTER)
920 stw SCRATCH_REGISTER_1, GPR1_OFFSET(FRAME_REGISTER)
926 stmw r15, GPR15_OFFSET(FRAME_REGISTER)
928 stw r15, GPR15_OFFSET(FRAME_REGISTER)
929 stw r16, GPR16_OFFSET(FRAME_REGISTER)
930 stw r17, GPR17_OFFSET(FRAME_REGISTER)
931 stw r18, GPR18_OFFSET(FRAME_REGISTER)
932 stw r19, GPR19_OFFSET(FRAME_REGISTER)
933 stw r20, GPR20_OFFSET(FRAME_REGISTER)
934 stw r21, GPR21_OFFSET(FRAME_REGISTER)
935 stw r22, GPR22_OFFSET(FRAME_REGISTER)
936 stw r23, GPR23_OFFSET(FRAME_REGISTER)
937 stw r24, GPR24_OFFSET(FRAME_REGISTER)
938 stw r25, GPR25_OFFSET(FRAME_REGISTER)
939 stw r26, GPR26_OFFSET(FRAME_REGISTER)
940 stw r27, GPR27_OFFSET(FRAME_REGISTER)
941 stw r28, GPR28_OFFSET(FRAME_REGISTER)
942 stw r29, GPR29_OFFSET(FRAME_REGISTER)
943 stw r30, GPR30_OFFSET(FRAME_REGISTER)
944 stw r31, GPR31_OFFSET(FRAME_REGISTER)
947 #ifdef PPC_MULTILIB_ALTIVEC 948 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(20)
949 stvx v20, FRAME_REGISTER, SCRATCH_REGISTER_1
950 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(21)
951 stvx v21, FRAME_REGISTER, SCRATCH_REGISTER_1
952 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(22)
953 stvx v22, FRAME_REGISTER, SCRATCH_REGISTER_1
954 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(23)
955 stvx v23, FRAME_REGISTER, SCRATCH_REGISTER_1
956 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(24)
957 stvx v24, FRAME_REGISTER, SCRATCH_REGISTER_1
958 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(25)
959 stvx v25, FRAME_REGISTER, SCRATCH_REGISTER_1
960 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(26)
961 stvx v26, FRAME_REGISTER, SCRATCH_REGISTER_1
962 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(27)
963 stvx v27, FRAME_REGISTER, SCRATCH_REGISTER_1
964 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(28)
965 stvx v28, FRAME_REGISTER, SCRATCH_REGISTER_1
966 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(29)
967 stvx v29, FRAME_REGISTER, SCRATCH_REGISTER_1
968 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(30)
969 stvx v30, FRAME_REGISTER, SCRATCH_REGISTER_1
970 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(31)
971 stvx v31, FRAME_REGISTER, SCRATCH_REGISTER_1
972 mfvrsave SCRATCH_REGISTER_1
973 stw SCRATCH_REGISTER_1, PPC_EXC_VRSAVE_OFFSET(FRAME_REGISTER)
976 #ifdef PPC_MULTILIB_FPU 977 stfd f14, PPC_EXC_FR_OFFSET(14)(FRAME_REGISTER)
978 stfd f15, PPC_EXC_FR_OFFSET(15)(FRAME_REGISTER)
979 stfd f16, PPC_EXC_FR_OFFSET(16)(FRAME_REGISTER)
980 stfd f17, PPC_EXC_FR_OFFSET(17)(FRAME_REGISTER)
981 stfd f18, PPC_EXC_FR_OFFSET(18)(FRAME_REGISTER)
982 stfd f19, PPC_EXC_FR_OFFSET(19)(FRAME_REGISTER)
983 stfd f20, PPC_EXC_FR_OFFSET(20)(FRAME_REGISTER)
984 stfd f21, PPC_EXC_FR_OFFSET(21)(FRAME_REGISTER)
985 stfd f22, PPC_EXC_FR_OFFSET(22)(FRAME_REGISTER)
986 stfd f23, PPC_EXC_FR_OFFSET(23)(FRAME_REGISTER)
987 stfd f24, PPC_EXC_FR_OFFSET(24)(FRAME_REGISTER)
988 stfd f25, PPC_EXC_FR_OFFSET(25)(FRAME_REGISTER)
989 stfd f26, PPC_EXC_FR_OFFSET(26)(FRAME_REGISTER)
990 stfd f27, PPC_EXC_FR_OFFSET(27)(FRAME_REGISTER)
991 stfd f28, PPC_EXC_FR_OFFSET(28)(FRAME_REGISTER)
992 stfd f29, PPC_EXC_FR_OFFSET(29)(FRAME_REGISTER)
993 stfd f30, PPC_EXC_FR_OFFSET(30)(FRAME_REGISTER)
994 stfd f31, PPC_EXC_FR_OFFSET(31)(FRAME_REGISTER)
997 b wrap_disable_thread_dispatching_done_\_FLVR
999 wrap_restore_non_volatile_regs_\_FLVR:
1002 lwz SCRATCH_REGISTER_0, GPR1_OFFSET(r1)
1005 lwz r13, GPR13_OFFSET(r1)
1011 lmw r15, GPR15_OFFSET(r1)
1013 lwz r15, GPR15_OFFSET(FRAME_REGISTER)
1014 lwz r16, GPR16_OFFSET(FRAME_REGISTER)
1015 lwz r17, GPR17_OFFSET(FRAME_REGISTER)
1016 lwz r18, GPR18_OFFSET(FRAME_REGISTER)
1017 lwz r19, GPR19_OFFSET(FRAME_REGISTER)
1018 lwz r20, GPR20_OFFSET(FRAME_REGISTER)
1019 lwz r21, GPR21_OFFSET(FRAME_REGISTER)
1020 lwz r22, GPR22_OFFSET(FRAME_REGISTER)
1021 lwz r23, GPR23_OFFSET(FRAME_REGISTER)
1022 lwz r24, GPR24_OFFSET(FRAME_REGISTER)
1023 lwz r25, GPR25_OFFSET(FRAME_REGISTER)
1024 lwz r26, GPR26_OFFSET(FRAME_REGISTER)
1025 lwz r27, GPR27_OFFSET(FRAME_REGISTER)
1026 lwz r28, GPR28_OFFSET(FRAME_REGISTER)
1027 lwz r29, GPR29_OFFSET(FRAME_REGISTER)
1028 lwz r30, GPR30_OFFSET(FRAME_REGISTER)
1029 lwz r31, GPR31_OFFSET(FRAME_REGISTER)
1033 stw SCRATCH_REGISTER_0, 0(r1)
1035 #ifdef PPC_MULTILIB_ALTIVEC
1036 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(20)
1037 lvx v20, FRAME_REGISTER, SCRATCH_REGISTER_1
1038 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(21)
1039 lvx v21, FRAME_REGISTER, SCRATCH_REGISTER_1
1040 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(22)
1041 lvx v22, FRAME_REGISTER, SCRATCH_REGISTER_1
1042 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(23)
1043 lvx v23, FRAME_REGISTER, SCRATCH_REGISTER_1
1044 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(24)
1045 lvx v24, FRAME_REGISTER, SCRATCH_REGISTER_1
1046 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(25)
1047 lvx v25, FRAME_REGISTER, SCRATCH_REGISTER_1
1048 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(26)
1049 lvx v26, FRAME_REGISTER, SCRATCH_REGISTER_1
1050 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(27)
1051 lvx v27, FRAME_REGISTER, SCRATCH_REGISTER_1
1052 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(28)
1053 lvx v28, FRAME_REGISTER, SCRATCH_REGISTER_1
1054 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(29)
1055 lvx v29, FRAME_REGISTER, SCRATCH_REGISTER_1
1056 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(30)
1057 lvx v30, FRAME_REGISTER, SCRATCH_REGISTER_1
1058 li SCRATCH_REGISTER_1, PPC_EXC_VR_OFFSET(31)
1059 lvx v31, FRAME_REGISTER, SCRATCH_REGISTER_1
1060 lwz SCRATCH_REGISTER_1, PPC_EXC_VRSAVE_OFFSET(FRAME_REGISTER)
1061 mtvrsave SCRATCH_REGISTER_1
1064 #ifdef PPC_MULTILIB_FPU 1065 lfd f14, PPC_EXC_FR_OFFSET(14)(FRAME_REGISTER)
1066 lfd f15, PPC_EXC_FR_OFFSET(15)(FRAME_REGISTER)
1067 lfd f16, PPC_EXC_FR_OFFSET(16)(FRAME_REGISTER)
1068 lfd f17, PPC_EXC_FR_OFFSET(17)(FRAME_REGISTER)
1069 lfd f18, PPC_EXC_FR_OFFSET(18)(FRAME_REGISTER)
1070 lfd f19, PPC_EXC_FR_OFFSET(19)(FRAME_REGISTER)
1071 lfd f20, PPC_EXC_FR_OFFSET(20)(FRAME_REGISTER)
1072 lfd f21, PPC_EXC_FR_OFFSET(21)(FRAME_REGISTER)
1073 lfd f22, PPC_EXC_FR_OFFSET(22)(FRAME_REGISTER)
1074 lfd f23, PPC_EXC_FR_OFFSET(23)(FRAME_REGISTER)
1075 lfd f24, PPC_EXC_FR_OFFSET(24)(FRAME_REGISTER)
1076 lfd f25, PPC_EXC_FR_OFFSET(25)(FRAME_REGISTER)
1077 lfd f26, PPC_EXC_FR_OFFSET(26)(FRAME_REGISTER)
1078 lfd f27, PPC_EXC_FR_OFFSET(27)(FRAME_REGISTER)
1079 lfd f28, PPC_EXC_FR_OFFSET(28)(FRAME_REGISTER)
1080 lfd f29, PPC_EXC_FR_OFFSET(29)(FRAME_REGISTER)
1081 lfd f30, PPC_EXC_FR_OFFSET(30)(FRAME_REGISTER)
1082 lfd f31, PPC_EXC_FR_OFFSET(31)(FRAME_REGISTER)
1085 b wrap_thread_dispatching_done_\_FLVR
1087 wrap_call_global_handler_\_FLVR:
1090 addi r3, FRAME_REGISTER, FRAME_LINK_SPACE
1092 #ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER
1098 cmpwi SCRATCH_REGISTER_0, 0
1099 beq wrap_handler_done_\_FLVR
1102 mtctr SCRATCH_REGISTER_0
1112 b wrap_handler_done_\_FLVR
exception_handler_t globalExceptHdl
Global exception handler.
Definition: ppc_exc_hdl.c:52
General purpose assembler macros, linker command file support and some inline functions for direct re...
uint32_t ppc_exc_msr_bits
Bits for MSR update.
Definition: ppc_exc_hdl.c:41
void C_exception_handler(BSP_Exception_frame *excPtr)
Default global exception handler.
Definition: ppc_exc_global_handler.c:22
ppc_exc_handler_t ppc_exc_handler_table[LAST_VALID_EXC+1]
High-level exception handler table.
Definition: ppc_exc_hdl.c:55
unsigned l
Definition: tte.h:86