diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-02-25 20:16:29 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:14:03 -0500 |
commit | 36344762396ca868d6076c41a84bda25f1ed9d3c (patch) | |
tree | 7471ce9b78736e538417267f1bc27687a1b09542 /include/asm-sparc64 | |
parent | c4e9249b1924118693f298ee8d38f7fe43587af3 (diff) |
[SPARC64]: Niagara optimized XOR functions for RAID.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/xor.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/include/asm-sparc64/xor.h b/include/asm-sparc64/xor.h index 8b3a7e4b6062..8ce3f1813e28 100644 --- a/include/asm-sparc64/xor.h +++ b/include/asm-sparc64/xor.h | |||
@@ -2,9 +2,11 @@ | |||
2 | * include/asm-sparc64/xor.h | 2 | * include/asm-sparc64/xor.h |
3 | * | 3 | * |
4 | * High speed xor_block operation for RAID4/5 utilizing the | 4 | * High speed xor_block operation for RAID4/5 utilizing the |
5 | * UltraSparc Visual Instruction Set. | 5 | * UltraSparc Visual Instruction Set and Niagara block-init |
6 | * twin-load instructions. | ||
6 | * | 7 | * |
7 | * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz) | 8 | * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz) |
9 | * Copyright (C) 2006 David S. Miller <davem@davemloft.net> | ||
8 | * | 10 | * |
9 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
@@ -16,8 +18,7 @@ | |||
16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 18 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | */ | 19 | */ |
18 | 20 | ||
19 | #include <asm/pstate.h> | 21 | #include <asm/spitfire.h> |
20 | #include <asm/asi.h> | ||
21 | 22 | ||
22 | extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); | 23 | extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); |
23 | extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, | 24 | extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *, |
@@ -37,4 +38,29 @@ static struct xor_block_template xor_block_VIS = { | |||
37 | .do_5 = xor_vis_5, | 38 | .do_5 = xor_vis_5, |
38 | }; | 39 | }; |
39 | 40 | ||
40 | #define XOR_TRY_TEMPLATES xor_speed(&xor_block_VIS) | 41 | extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *); |
42 | extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *, | ||
43 | unsigned long *); | ||
44 | extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *, | ||
45 | unsigned long *, unsigned long *); | ||
46 | extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *, | ||
47 | unsigned long *, unsigned long *, unsigned long *); | ||
48 | |||
49 | static struct xor_block_template xor_block_niagara = { | ||
50 | .name = "Niagara", | ||
51 | .do_2 = xor_niagara_2, | ||
52 | .do_3 = xor_niagara_3, | ||
53 | .do_4 = xor_niagara_4, | ||
54 | .do_5 = xor_niagara_5, | ||
55 | }; | ||
56 | |||
57 | #undef XOR_TRY_TEMPLATES | ||
58 | #define XOR_TRY_TEMPLATES \ | ||
59 | do { \ | ||
60 | xor_speed(&xor_block_VIS); \ | ||
61 | xor_speed(&xor_block_niagara); \ | ||
62 | } while (0) | ||
63 | |||
64 | /* For VIS for everything except Niagara. */ | ||
65 | #define XOR_SELECT_TEMPLATE(FASTEST) \ | ||
66 | (tlb_type == hypervisor ? &xor_block_niagara : &xor_block_VIS) | ||