aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/branch.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/branch.h')
-rw-r--r--arch/mips/include/asm/branch.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/mips/include/asm/branch.h b/arch/mips/include/asm/branch.h
index e28a3e0eb3cb..de781cf54bc7 100644
--- a/arch/mips/include/asm/branch.h
+++ b/arch/mips/include/asm/branch.h
@@ -8,6 +8,8 @@
8#ifndef _ASM_BRANCH_H 8#ifndef _ASM_BRANCH_H
9#define _ASM_BRANCH_H 9#define _ASM_BRANCH_H
10 10
11#include <asm/cpu-features.h>
12#include <asm/mipsregs.h>
11#include <asm/ptrace.h> 13#include <asm/ptrace.h>
12#include <asm/inst.h> 14#include <asm/inst.h>
13 15
@@ -18,12 +20,40 @@ extern int __compute_return_epc_for_insn(struct pt_regs *regs,
18extern int __microMIPS_compute_return_epc(struct pt_regs *regs); 20extern int __microMIPS_compute_return_epc(struct pt_regs *regs);
19extern int __MIPS16e_compute_return_epc(struct pt_regs *regs); 21extern int __MIPS16e_compute_return_epc(struct pt_regs *regs);
20 22
23/*
24 * microMIPS bitfields
25 */
26#define MM_POOL32A_MINOR_MASK 0x3f
27#define MM_POOL32A_MINOR_SHIFT 0x6
28#define MM_MIPS32_COND_FC 0x30
29
30extern int __mm_isBranchInstr(struct pt_regs *regs,
31 struct mm_decoded_insn dec_insn, unsigned long *contpc);
32
33static inline int mm_isBranchInstr(struct pt_regs *regs,
34 struct mm_decoded_insn dec_insn, unsigned long *contpc)
35{
36 if (!cpu_has_mmips)
37 return 0;
38
39 return __mm_isBranchInstr(regs, dec_insn, contpc);
40}
21 41
22static inline int delay_slot(struct pt_regs *regs) 42static inline int delay_slot(struct pt_regs *regs)
23{ 43{
24 return regs->cp0_cause & CAUSEF_BD; 44 return regs->cp0_cause & CAUSEF_BD;
25} 45}
26 46
47static inline void clear_delay_slot(struct pt_regs *regs)
48{
49 regs->cp0_cause &= ~CAUSEF_BD;
50}
51
52static inline void set_delay_slot(struct pt_regs *regs)
53{
54 regs->cp0_cause |= CAUSEF_BD;
55}
56
27static inline unsigned long exception_epc(struct pt_regs *regs) 57static inline unsigned long exception_epc(struct pt_regs *regs)
28{ 58{
29 if (likely(!delay_slot(regs))) 59 if (likely(!delay_slot(regs)))