xref: /linux/lib/raid/xor/powerpc/xor_vmx_glue.c (revision 440d6635b20037bc9ad46b20817d7b61cef0fc1b)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Altivec XOR operations
4  *
5  * Copyright 2017 IBM Corp.
6  */
7 
8 #include <linux/preempt.h>
9 #include <linux/sched.h>
10 #include <asm/switch_to.h>
11 #include "xor_impl.h"
12 #include "xor_arch.h"
13 #include "xor_vmx.h"
14 
15 static void xor_gen_altivec(void *dest, void **srcs, unsigned int src_cnt,
16 		unsigned int bytes)
17 {
18 	preempt_disable();
19 	enable_kernel_altivec();
20 	xor_gen_altivec_inner(dest, srcs, src_cnt, bytes);
21 	disable_kernel_altivec();
22 	preempt_enable();
23 }
24 
25 struct xor_block_template xor_block_altivec = {
26 	.name		= "altivec",
27 	.xor_gen	= xor_gen_altivec,
28 };
29