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-Tag: next-20140516~100^2~35 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a7cf6b23cd8ca6470de0512039bc9774524d508f;p=karo-tx-linux.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)))