mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
The assembler has .insn for building custom instructions now, so change the .4byte to .insn. This ensures the output is marked as an instruction and not as data which may confuse both debuggers and anything else that relies on this sort of marking. Add an ASM_INSN_I() wrapper in asm.h to allow the selecting of how this is output so older assemblers are still good. Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Link: https://lore.kernel.org/r/20251024171640.65232-1-ben.dooks@codethink.co.uk Signed-off-by: Paul Walmsley <pjw@kernel.org>
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
||
/*
|
||
* Copyright (C) 2025 MIPS.
|
||
*/
|
||
|
||
#ifndef _ASM_RISCV_VENDOR_EXTENSIONS_MIPS_H
|
||
#define _ASM_RISCV_VENDOR_EXTENSIONS_MIPS_H
|
||
|
||
#include <linux/types.h>
|
||
|
||
#define RISCV_ISA_VENDOR_EXT_XMIPSEXECTL 0
|
||
|
||
#ifndef __ASSEMBLER__
|
||
struct riscv_isa_vendor_ext_data_list;
|
||
extern struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_mips;
|
||
#endif
|
||
|
||
/* Extension specific instructions */
|
||
|
||
/*
|
||
* All of the xmipsexectl extension instructions are
|
||
* ‘hint’ encodings of the SLLI instruction,
|
||
* with rd = 0, rs1 = 0 and imm = 1 for IHB, imm = 3 for EHB,
|
||
* and imm = 5 for PAUSE.
|
||
* MIPS.PAUSE is an alternative opcode which is implemented to have the
|
||
* same behavior as PAUSE on some MIPS RISCV cores.
|
||
* MIPS.EHB clears all execution hazards before allowing
|
||
* any subsequent instructions to execute.
|
||
* MIPS.IHB clears all instruction hazards before
|
||
* allowing any subsequent instructions to fetch.
|
||
*/
|
||
|
||
#define MIPS_PAUSE ASM_INSN_I("0x00501013\n\t")
|
||
#define MIPS_EHB ASM_INSN_I("0x00301013\n\t")
|
||
#define MIPS_IHB ASM_INSN_I("0x00101013\n\t")
|
||
|
||
#endif // _ASM_RISCV_VENDOR_EXTENSIONS_MIPS_H
|