RISC-V: Move riscv_insn_is_* macros into a common header
authorHeiko Stuebner <heiko.stuebner@vrull.eu>
Fri, 23 Dec 2022 22:13:26 +0000 (23:13 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 29 Dec 2022 14:59:46 +0000 (06:59 -0800)
commitec5f908775160d4d635f99cbad9a5ea138894038
tree41bc73c6bcc9f82a59c88144dbac77feac78060c
parentcde4a69302a4a57374a9daa463c493ff45038c99
RISC-V: Move riscv_insn_is_* macros into a common header

Right now the riscv kernel has (at least) two independent sets
of functions to check if an encoded instruction is of a specific
type. One in kgdb and one kprobes simulate-insn code.

More parts of the kernel will probably need this in the future,
so instead of allowing this duplication to go on further,
move macros that do the function declaration in a common header,
similar to at least aarch64.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Link: https://lore.kernel.org/r/20221223221332.4127602-7-heiko@sntech.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/parse_asm.h
arch/riscv/kernel/kgdb.c
arch/riscv/kernel/probes/simulate-insn.h