Skip to content

Commit 1d4ce63

Browse files
aleksapaunovic-htecPaul Walmsley
authored andcommitted
riscv: Add xmipsexectl instructions
Add xmipsexectl instruction opcodes. This includes the MIPS.PAUSE, MIPS.EHB, and MIPS.IHB instructions. Signed-off-by: Aleksa Paunovic <aleksa.paunovic@htecgroup.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20250724-p8700-pause-v5-3-a6cbbe1c3412@htecgroup.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent a8fed1b commit 1d4ce63

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

  • arch/riscv/include/asm/vendor_extensions

arch/riscv/include/asm/vendor_extensions/mips.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,23 @@ struct riscv_isa_vendor_ext_data_list;
1515
extern struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_mips;
1616
#endif
1717

18+
/* Extension specific instructions */
19+
20+
/*
21+
* All of the xmipsexectl extension instructions are
22+
* ‘hint’ encodings of the SLLI instruction,
23+
* with rd = 0, rs1 = 0 and imm = 1 for IHB, imm = 3 for EHB,
24+
* and imm = 5 for PAUSE.
25+
* MIPS.PAUSE is an alternative opcode which is implemented to have the
26+
* same behavior as PAUSE on some MIPS RISCV cores.
27+
* MIPS.EHB clears all execution hazards before allowing
28+
* any subsequent instructions to execute.
29+
* MIPS.IHB clears all instruction hazards before
30+
* allowing any subsequent instructions to fetch.
31+
*/
32+
33+
#define MIPS_PAUSE ".4byte 0x00501013\n\t"
34+
#define MIPS_EHB ".4byte 0x00301013\n\t"
35+
#define MIPS_IHB ".4byte 0x00101013\n\t"
36+
1837
#endif // _ASM_RISCV_VENDOR_EXTENSIONS_MIPS_H

0 commit comments

Comments
 (0)