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