--- zzzz-none-000/linux-2.6.32.61/arch/mips/include/asm/branch.h 2013-06-10 09:43:48.000000000 +0000 +++ virian-300e-630/linux-2.6.32.61/arch/mips/include/asm/branch.h 2014-10-30 09:49:28.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,11 @@ if (!delay_slot(regs)) return regs->cp0_epc; - return regs->cp0_epc + 4; + if(regs->cp0_epc & 0x1) { + 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 +34,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; }