diff options
Diffstat (limited to 'c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq_asm.S')
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq_asm.S | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq_asm.S b/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq_asm.S index f38d3dad83..e42a7060e3 100644 --- a/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq_asm.S +++ b/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq_asm.S @@ -12,6 +12,9 @@ * Modifications to store nesting level in global _ISR_Nest_level * variable instead of SPRG0. Andy Dachs <a.dachs@sstl.co.uk> * + * Till Straumann <strauman@slac.stanford.edu>, 2005/4: + * - DONT enable FP across user ISR since fpregs are never saved!! + * * $Id$ */ @@ -93,11 +96,7 @@ SYM (shared_raw_irq_code_entry): * also, on CPUs with FP, enable FP so that FP context can be * saved and restored (using FP instructions) */ -#if (PPC_HAS_FPU == 0) ori r3, r3, MSR_RI /*| MSR_IR | MSR_DR*/ -#else - ori r3, r3, MSR_RI | /*MSR_IR | MSR_DR |*/ MSR_FP -#endif mtmsr r3 SYNC @@ -301,6 +300,27 @@ nested: rfi switch: +#if ( PPC_HAS_FPU != 0 ) +#if ! defined( CPU_USE_DEFERRED_FP_SWITCH ) +#error missing include file??? +#endif + mfmsr r4 +#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) + /* if the executing thread has FP enabled propagate + * this now so _Thread_Dispatch can save/restore the FPREGS + * NOTE: it is *crucial* to disable the FPU across the + * user ISR [independent of using the 'deferred' + * strategy or not]. We don't save FP regs across + * the user ISR and hence we prefer an exception to + * be raised rather than experiencing corruption. + */ + lwz r3, SRR1_FRAME_OFFSET(r1) + rlwimi r4, r3, 0, 18, 18 /* MSR_FP */ +#else + ori r4, r4, MSR_FP +#endif + mtmsr r4 +#endif bl SYM (_Thread_Dispatch) easy_exit: |