2 * Optimized xor_block operation for RAID4/5
4 * Copyright IBM Corp. 2016
5 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
8 #include <linux/types.h>
9 #include <linux/module.h>
10 #include <linux/raid/xor.h>
12 static void xor_xc_2(unsigned long bytes
, unsigned long *p1
, unsigned long *p2
)
21 "0: xc 0(256,%1),0(%2)\n"
27 "2: xc 0(1,%1),0(%2)\n"
29 : : "d" (bytes
), "a" (p1
), "a" (p2
)
30 : "0", "1", "cc", "memory");
33 static void xor_xc_3(unsigned long bytes
, unsigned long *p1
, unsigned long *p2
,
43 "0: xc 0(256,%1),0(%2)\n"
44 " xc 0(256,%1),0(%3)\n"
52 "2: xc 0(1,%1),0(%2)\n"
55 : "+d" (bytes
), "+a" (p1
), "+a" (p2
), "+a" (p3
)
56 : : "0", "1", "cc", "memory");
59 static void xor_xc_4(unsigned long bytes
, unsigned long *p1
, unsigned long *p2
,
60 unsigned long *p3
, unsigned long *p4
)
69 "0: xc 0(256,%1),0(%2)\n"
70 " xc 0(256,%1),0(%3)\n"
71 " xc 0(256,%1),0(%4)\n"
81 "2: xc 0(1,%1),0(%2)\n"
85 : "+d" (bytes
), "+a" (p1
), "+a" (p2
), "+a" (p3
), "+a" (p4
)
86 : : "0", "1", "cc", "memory");
89 static void xor_xc_5(unsigned long bytes
, unsigned long *p1
, unsigned long *p2
,
90 unsigned long *p3
, unsigned long *p4
, unsigned long *p5
)
92 /* Get around a gcc oddity */
93 register unsigned long *reg7
asm ("7") = p5
;
102 "0: xc 0(256,%1),0(%2)\n"
103 " xc 0(256,%1),0(%3)\n"
104 " xc 0(256,%1),0(%4)\n"
105 " xc 0(256,%1),0(%5)\n"
117 "2: xc 0(1,%1),0(%2)\n"
118 " xc 0(1,%1),0(%3)\n"
119 " xc 0(1,%1),0(%4)\n"
120 " xc 0(1,%1),0(%5)\n"
122 : "+d" (bytes
), "+a" (p1
), "+a" (p2
), "+a" (p3
), "+a" (p4
),
124 : : "0", "1", "cc", "memory");
127 struct xor_block_template xor_block_xc
= {
134 EXPORT_SYMBOL(xor_block_xc
);