Przeglądaj źródła

MIPS: branch: New helpers to modify branch delay slot flag in struct pt_regs

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Ralf Baechle 11 lat temu
rodzic
commit
5a7ebbf893
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      arch/mips/include/asm/branch.h

+ 10 - 0
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)))