X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..378393581903b274cb7a4d18e0d978071a6b592d:/osfmk/kdp/ml/ppc/kdp_asm.s diff --git a/osfmk/kdp/ml/ppc/kdp_asm.s b/osfmk/kdp/ml/ppc/kdp_asm.s index 4e53ce0b7..764b48580 100644 --- a/osfmk/kdp/ml/ppc/kdp_asm.s +++ b/osfmk/kdp/ml/ppc/kdp_asm.s @@ -38,10 +38,13 @@ ENTRY(kdp_call_with_ctx, TAG_NO_FRAME_USED) - mfmsr r7 /* Get the MSR */ + lis r2,hi16(MASK(MSR_VEC)) ; Get the vector enable + mfmsr r7 ; Get the MSR + ori r2,r2,lo16(MASK(MSR_EE)|MASK(MSR_FP)) ; Get FP and EE mflr r0 - rlwinm r7,r7,0,MSR_EE_BIT+1,MSR_EE_BIT-1 /* Turn off interruptions enable bit */ + andc r7,r7,r2 ; Clear FP, VEC, and EE mtmsr r7 + isync ; Need this because we may have ditched fp/vec mfsprg r8,0 /* Get the per_proc block address */ stw r0, FM_LR_SAVE(r1) /* save lr in the current frame */ @@ -51,7 +54,7 @@ ENTRY(kdp_call_with_ctx, TAG_NO_FRAME_USED) #ifdef LET_KDP_REENTER mr r9, r1 /* get current stack pointer */ - subi r9, r9, FM_REDZONE + SS_SIZE + subi r9, r9, FM_REDZONE + FM_SIZE #else bl EXT(kdp_print_backtrace) #endif @@ -66,10 +69,13 @@ ENTRY(kdp_call_with_ctx, TAG_NO_FRAME_USED) bl EXT(kdp_trap) + lis r2,hi16(MASK(MSR_VEC)) ; Get the vector enable mfmsr r0 /* Get the MSR */ + ori r2,r2,lo16(MASK(MSR_EE)|MASK(MSR_FP)) ; Get FP and EE addi r1, r1, FM_SIZE - rlwinm r0,r0,0,MSR_EE_BIT+1,MSR_EE_BIT-1 /* Turn off interruptions enable bit */ + andc r0,r0,r2 ; Clear FP, VEC, and EE mtmsr r0 + isync ; Need this because we may have ditched fp/vec mfsprg r8,0 /* Get the per_proc block address */