xref: /linux/lib/raid/xor/riscv/xor-glue.c (revision 440d6635b20037bc9ad46b20817d7b61cef0fc1b)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (C) 2021 SiFive
4  */
5 
6 #include <asm/vector.h>
7 #include <asm/switch_to.h>
8 #include <asm/asm-prototypes.h>
9 #include "xor_impl.h"
10 #include "xor_arch.h"
11 
12 DO_XOR_BLOCKS(vector_inner, xor_regs_2_, xor_regs_3_, xor_regs_4_, xor_regs_5_);
13 
14 static void xor_gen_vector(void *dest, void **srcs, unsigned int src_cnt,
15 		unsigned int bytes)
16 {
17 	kernel_vector_begin();
18 	xor_gen_vector_inner(dest, srcs, src_cnt, bytes);
19 	kernel_vector_end();
20 }
21 
22 struct xor_block_template xor_block_rvv = {
23 	.name		= "rvv",
24 	.xor_gen	= xor_gen_vector,
25 };
26