From: Ralf Baechle Date: Tue, 15 Apr 2014 23:52:32 +0000 (+0200) Subject: MIPS: branch: New helpers to modify branch delay slot flag in struct pt_regs X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5a7ebbf89395392f16cb5dd342b7edd154ca2d11;p=openwrt%2Fstaging%2Fblogic.git MIPS: branch: New helpers to modify branch delay slot flag in struct pt_regs Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/include/asm/branch.h b/arch/mips/include/asm/branch.h index e28a3e0eb3cb..c842e7de21c7 100644 --- a/arch/mips/include/asm/branch.h +++ b/arch/mips/include/asm/branch.h @@ -24,6 +24,16 @@ static inline int delay_slot(struct pt_regs *regs) return regs->cp0_cause & CAUSEF_BD; } +static inline void clear_delay_slot(struct pt_regs *regs) +{ + regs->cp0_cause &= ~CAUSEF_BD; +} + +static inline void set_delay_slot(struct pt_regs *regs) +{ + regs->cp0_cause |= CAUSEF_BD; +} + static inline unsigned long exception_epc(struct pt_regs *regs) { if (likely(!delay_slot(regs)))