1
2
3
4
5
6
7
8
9
10
11
12
13 #include <asm/spitfire.h>
14
15 void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
16 void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
17 unsigned long *);
18 void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
19 unsigned long *, unsigned long *);
20 void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
21 unsigned long *, unsigned long *, unsigned long *);
22
23
24
25 static struct xor_block_template xor_block_VIS = {
26 .name = "VIS",
27 .do_2 = xor_vis_2,
28 .do_3 = xor_vis_3,
29 .do_4 = xor_vis_4,
30 .do_5 = xor_vis_5,
31 };
32
33 void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
34 void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
35 unsigned long *);
36 void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
37 unsigned long *, unsigned long *);
38 void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
39 unsigned long *, unsigned long *, unsigned long *);
40
41 static struct xor_block_template xor_block_niagara = {
42 .name = "Niagara",
43 .do_2 = xor_niagara_2,
44 .do_3 = xor_niagara_3,
45 .do_4 = xor_niagara_4,
46 .do_5 = xor_niagara_5,
47 };
48
49 #undef XOR_TRY_TEMPLATES
50 #define XOR_TRY_TEMPLATES \
51 do { \
52 xor_speed(&xor_block_VIS); \
53 xor_speed(&xor_block_niagara); \
54 } while (0)
55
56
57 #define XOR_SELECT_TEMPLATE(FASTEST) \
58 ((tlb_type == hypervisor && \
59 (sun4v_chip_type == SUN4V_CHIP_NIAGARA1 || \
60 sun4v_chip_type == SUN4V_CHIP_NIAGARA2 || \
61 sun4v_chip_type == SUN4V_CHIP_NIAGARA3 || \
62 sun4v_chip_type == SUN4V_CHIP_NIAGARA4 || \
63 sun4v_chip_type == SUN4V_CHIP_NIAGARA5)) ? \
64 &xor_block_niagara : \
65 &xor_block_VIS)