MIPS: branch: New helpers to modify branch delay slot flag in struct pt_regs
authorRalf Baechle <ralf@linux-mips.org>
Tue, 15 Apr 2014 23:52:32 +0000 (01:52 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 21 May 2014 09:12:49 +0000 (11:12 +0200)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/branch.h

index e28a3e0eb3cb6407b4ad6d6ac649e20a876ab69d..c842e7de21c765bdf4922a994d8fb5e21e2a1bd3 100644 (file)
@@ -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)))