--- zzzz-none-000/linux-2.6.28.10/arch/mips/include/asm/branch.h 2009-05-02 18:54:43.000000000 +0000 +++ puma5-6360-529/linux-2.6.28.10/arch/mips/include/asm/branch.h 2011-06-21 13:04:40.000000000 +0000 @@ -9,6 +9,8 @@ #define _ASM_BRANCH_H #include +#include +#include static inline int delay_slot(struct pt_regs *regs) { @@ -20,7 +22,12 @@ if (!delay_slot(regs)) return regs->cp0_epc; - return regs->cp0_epc + 4; + if(regs->cp0_epc & 0x1) { + printk(KERN_ERR "[%s]\n", __FUNCTION__); + return regs->cp0_epc + compute_mips16_insn_size(regs->cp0_epc); + } + + return regs->cp0_epc + 4; } extern int __compute_return_epc(struct pt_regs *regs); @@ -28,7 +35,10 @@ static inline int compute_return_epc(struct pt_regs *regs) { if (!delay_slot(regs)) { - regs->cp0_epc += 4; + if(regs->cp0_epc & 0x1) + regs->cp0_epc += compute_mips16_insn_size(regs->cp0_epc); + else + regs->cp0_epc += 4; return 0; }