diff options
author | Conor Dooley <conor.dooley@microchip.com> | 2023-01-08 16:33:55 +0000 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2023-02-14 21:29:52 -0800 |
commit | dd23e9535889c8b8d7ea7d6064ad16be903f4270 (patch) | |
tree | 9f63feebd79d0e0cdbae022142d91b0d9e1f9748 /arch/riscv/include/asm/insn-def.h | |
parent | 6067c3aae52f14b025d0a4de5d4d1eb16eb8fe51 (diff) |
RISC-V: replace cbom instructions with an insn-def
Using the cbom instructions directly in ALT_CMO_OP, requires toolchain
support for the instructions. Using an insn-def will allow for removal
of toolchain version checks in the build system & simplification of the
proposed [1] function-based CMO scheme.
Link: https://lore.kernel.org/linux-riscv/fb3b34ae-e35e-4dc2-a8f4-19984a2f58a8@app.fastmail.com/ [1]
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20230108163356.3063839-3-conor@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/include/asm/insn-def.h')
-rw-r--r-- | arch/riscv/include/asm/insn-def.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/insn-def.h b/arch/riscv/include/asm/insn-def.h index 39f9e0893564..e01ab51f50d2 100644 --- a/arch/riscv/include/asm/insn-def.h +++ b/arch/riscv/include/asm/insn-def.h @@ -180,4 +180,16 @@ INSN_R(OPCODE_SYSTEM, FUNC3(0), FUNC7(51), \ __RD(0), RS1(gaddr), RS2(vmid)) +#define CBO_inval(base) \ + INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \ + RS1(base), SIMM12(0)) + +#define CBO_clean(base) \ + INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \ + RS1(base), SIMM12(1)) + +#define CBO_flush(base) \ + INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \ + RS1(base), SIMM12(2)) + #endif /* __ASM_INSN_DEF_H */ |