summaryrefslogtreecommitdiff
path: root/lib/raid/xor/powerpc/xor_vmx_glue.c
blob: dbfbb5cadc36afaa62d9a17da24129c2cf645854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Altivec XOR operations
 *
 * Copyright 2017 IBM Corp.
 */

#include <linux/preempt.h>
#include <linux/sched.h>
#include <asm/switch_to.h>
#include "xor_impl.h"
#include "xor_arch.h"
#include "xor_vmx.h"

static void xor_gen_altivec(void *dest, void **srcs, unsigned int src_cnt,
		unsigned int bytes)
{
	preempt_disable();
	enable_kernel_altivec();
	xor_gen_altivec_inner(dest, srcs, src_cnt, bytes);
	disable_kernel_altivec();
	preempt_enable();
}

struct xor_block_template xor_block_altivec = {
	.name		= "altivec",
	.xor_gen	= xor_gen_altivec,
};