1
linux/arch/riscv/errata/sifive/errata_cip_453.S
Jisheng Zhang 6868d12e02
riscv: errata: sifive: Use SYM_*() assembly macros
ENTRY()/END() macros are deprecated and we should make use of the
new SYM_*() macros [1] for better annotation of symbols. Replace the
deprecated ones with the new ones.

[1] https://docs.kernel.org/core-api/asm-annotations.html

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-By: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20240709160536.3690-2-jszhang@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-09-15 00:03:22 -07:00

39 lines
835 B
ArmAsm

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2021 SiFive
*/
#include <linux/linkage.h>
#include <asm/asm.h>
#include <asm/asm-offsets.h>
#include <asm/alternative.h>
.macro ADD_SIGN_EXT pt_reg badaddr tmp_reg
REG_L \badaddr, PT_BADADDR(\pt_reg)
li \tmp_reg,1
slli \tmp_reg,\tmp_reg,0x26
and \tmp_reg,\tmp_reg,\badaddr
beqz \tmp_reg, 1f
li \tmp_reg,-1
slli \tmp_reg,\tmp_reg,0x27
or \badaddr,\tmp_reg,\badaddr
REG_S \badaddr, PT_BADADDR(\pt_reg)
1:
.endm
SYM_FUNC_START(sifive_cip_453_page_fault_trp)
ADD_SIGN_EXT a0, t0, t1
#ifdef CONFIG_MMU
la t0, do_page_fault
#else
la t0, do_trap_unknown
#endif
jr t0
SYM_FUNC_END(sifive_cip_453_page_fault_trp)
SYM_FUNC_START(sifive_cip_453_insn_fault_trp)
ADD_SIGN_EXT a0, t0, t1
la t0, do_trap_insn_fault
jr t0
SYM_FUNC_END(sifive_cip_453_insn_fault_trp)