History

bpf: Add MIPS support to samples/bpf.

David Daney committed 9 years ago

Commit c1932cd1 parent b7127cf1 file · +13 −0Browse files

Unified · Split

samples/bpf/bpf_helpers.h+13−0
@@ -136,6 +136,19 @@ static int (*bpf_skb_change_head)(void *, int len, int flags) = · 135 unmodified lines
136136 #define PT_REGS_SP(x) ((x)->sp)
137137 #define PT_REGS_IP(x) ((x)->pc)
138138
139+#elif defined(__mips__)
140+
141+#define PT_REGS_PARM1(x) ((x)->regs[4])
142+#define PT_REGS_PARM2(x) ((x)->regs[5])
143+#define PT_REGS_PARM3(x) ((x)->regs[6])
144+#define PT_REGS_PARM4(x) ((x)->regs[7])
145+#define PT_REGS_PARM5(x) ((x)->regs[8])
146+#define PT_REGS_RET(x) ((x)->regs[31])
147+#define PT_REGS_FP(x) ((x)->regs[30]) /* Works only with CONFIG_FRAME_POINTER */
148+#define PT_REGS_RC(x) ((x)->regs[1])
149+#define PT_REGS_SP(x) ((x)->regs[29])
150+#define PT_REGS_IP(x) ((x)->cp0_epc)
151+
139152 #elif defined(__powerpc__)
140153
141154 #define PT_REGS_PARM1(x) ((x)->gpr[3])