1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ASM_RISCV_PROTOTYPES_H 3#define _ASM_RISCV_PROTOTYPES_H 4 5#include <linux/ftrace.h> 6#include <asm-generic/asm-prototypes.h> 7 8long long __lshrti3(long long a, int b); 9long long __ashrti3(long long a, int b); 10long long __ashlti3(long long a, int b); 11 12#ifdef CONFIG_RISCV_ISA_V 13 14#ifdef CONFIG_MMU 15asmlinkage int enter_vector_usercopy(void *dst, void *src, size_t n); 16#endif /* CONFIG_MMU */ 17 18void xor_regs_2_(unsigned long bytes, unsigned long *__restrict p1, 19 const unsigned long *__restrict p2); 20void xor_regs_3_(unsigned long bytes, unsigned long *__restrict p1, 21 const unsigned long *__restrict p2, 22 const unsigned long *__restrict p3); 23void xor_regs_4_(unsigned long bytes, unsigned long *__restrict p1, 24 const unsigned long *__restrict p2, 25 const unsigned long *__restrict p3, 26 const unsigned long *__restrict p4); 27void xor_regs_5_(unsigned long bytes, unsigned long *__restrict p1, 28 const unsigned long *__restrict p2, 29 const unsigned long *__restrict p3, 30 const unsigned long *__restrict p4, 31 const unsigned long *__restrict p5); 32 33#ifdef CONFIG_RISCV_ISA_V_PREEMPTIVE 34asmlinkage void riscv_v_context_nesting_start(struct pt_regs *regs); 35asmlinkage void riscv_v_context_nesting_end(struct pt_regs *regs); 36#endif /* CONFIG_RISCV_ISA_V_PREEMPTIVE */ 37 38#endif /* CONFIG_RISCV_ISA_V */ 39 40#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs) 41 42DECLARE_DO_ERROR_INFO(do_trap_unknown); 43DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned); 44DECLARE_DO_ERROR_INFO(do_trap_insn_fault); 45DECLARE_DO_ERROR_INFO(do_trap_insn_illegal); 46DECLARE_DO_ERROR_INFO(do_trap_load_fault); 47DECLARE_DO_ERROR_INFO(do_trap_load_misaligned); 48DECLARE_DO_ERROR_INFO(do_trap_store_misaligned); 49DECLARE_DO_ERROR_INFO(do_trap_store_fault); 50DECLARE_DO_ERROR_INFO(do_trap_ecall_u); 51DECLARE_DO_ERROR_INFO(do_trap_ecall_s); 52DECLARE_DO_ERROR_INFO(do_trap_ecall_m); 53DECLARE_DO_ERROR_INFO(do_trap_break); 54 55asmlinkage void handle_bad_stack(struct pt_regs *regs); 56asmlinkage void do_page_fault(struct pt_regs *regs); 57asmlinkage void do_irq(struct pt_regs *regs); 58 59#endif /* _ASM_RISCV_PROTOTYPES_H */ 60