Skip to content
15 changes: 15 additions & 0 deletions arch/riscv/net/bpf_jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,21 @@ static inline u32 rv_fence(u8 pred, u8 succ)
return rv_i_insn(imm11_0, 0, 0, 0, 0xf);
}

static inline void emit_fence_r_rw(struct rv_jit_context *ctx)
{
emit(rv_fence(0x2, 0x3), ctx);
}

static inline void emit_fence_rw_w(struct rv_jit_context *ctx)
{
emit(rv_fence(0x3, 0x1), ctx);
}

static inline void emit_fence_rw_rw(struct rv_jit_context *ctx)
{
emit(rv_fence(0x3, 0x3), ctx);
}

static inline u32 rv_nop(void)
{
return rv_i_insn(0, 0, 0, 0, 0x13);
Expand Down
Loading