1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2021 SiFive
6 #include <linux/hardirq.h>
7 #include <asm-generic/xor.h>
8 #ifdef CONFIG_RISCV_ISA_V
9 #include <asm/vector.h>
10 #include <asm/switch_to.h>
11 #include <asm/asm-prototypes.h>
13 static void xor_vector_2(unsigned long bytes
, unsigned long *__restrict p1
,
14 const unsigned long *__restrict p2
)
16 kernel_vector_begin();
17 xor_regs_2_(bytes
, p1
, p2
);
21 static void xor_vector_3(unsigned long bytes
, unsigned long *__restrict p1
,
22 const unsigned long *__restrict p2
,
23 const unsigned long *__restrict p3
)
25 kernel_vector_begin();
26 xor_regs_3_(bytes
, p1
, p2
, p3
);
30 static void xor_vector_4(unsigned long bytes
, unsigned long *__restrict p1
,
31 const unsigned long *__restrict p2
,
32 const unsigned long *__restrict p3
,
33 const unsigned long *__restrict p4
)
35 kernel_vector_begin();
36 xor_regs_4_(bytes
, p1
, p2
, p3
, p4
);
40 static void xor_vector_5(unsigned long bytes
, unsigned long *__restrict p1
,
41 const unsigned long *__restrict p2
,
42 const unsigned long *__restrict p3
,
43 const unsigned long *__restrict p4
,
44 const unsigned long *__restrict p5
)
46 kernel_vector_begin();
47 xor_regs_5_(bytes
, p1
, p2
, p3
, p4
, p5
);
51 static struct xor_block_template xor_block_rvv
= {
59 #undef XOR_TRY_TEMPLATES
60 #define XOR_TRY_TEMPLATES \
62 xor_speed(&xor_block_8regs); \
63 xor_speed(&xor_block_32regs); \
65 xor_speed(&xor_block_rvv);\