Skip to content

Commit

Permalink
MIPS: branch: New helpers to modify branch delay slot flag in struct …
Browse files Browse the repository at this point in the history
…pt_regs

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed May 21, 2014
1 parent 2209bcb commit 5a7ebbf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/mips/include/asm/branch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 5a7ebbf

Please sign in to comment.