xor.c (685784aaf3cd0e3ff5e36c7ecf6f441cdbf57f73) xor.c (9bc89cd82d6f88fb0ca39b30445c329a430fd66b)
1/*
2 * xor.c : Multiple Devices driver for Linux
3 *
4 * Copyright (C) 1996, 1997, 1998, 1999, 2000,
5 * Ingo Molnar, Matti Aarnio, Jakub Jelinek, Richard Henderson.
6 *
7 * Dispatch optimized RAID-5 checksumming functions.
8 *

--- 12 unchanged lines hidden (view full) ---

21#include <linux/raid/md.h>
22#include <linux/raid/xor.h>
23#include <asm/xor.h>
24
25/* The xor routines to use. */
26static struct xor_block_template *active_template;
27
28void
1/*
2 * xor.c : Multiple Devices driver for Linux
3 *
4 * Copyright (C) 1996, 1997, 1998, 1999, 2000,
5 * Ingo Molnar, Matti Aarnio, Jakub Jelinek, Richard Henderson.
6 *
7 * Dispatch optimized RAID-5 checksumming functions.
8 *

--- 12 unchanged lines hidden (view full) ---

21#include <linux/raid/md.h>
22#include <linux/raid/xor.h>
23#include <asm/xor.h>
24
25/* The xor routines to use. */
26static struct xor_block_template *active_template;
27
28void
29xor_blocks(unsigned int count, unsigned int bytes, void **ptr)
29xor_blocks(unsigned int src_count, unsigned int bytes, void *dest, void **srcs)
30{
30{
31 unsigned long *p0, *p1, *p2, *p3, *p4;
31 unsigned long *p1, *p2, *p3, *p4;
32
32
33 p0 = (unsigned long *) ptr[0];
34 p1 = (unsigned long *) ptr[1];
35 if (count == 2) {
36 active_template->do_2(bytes, p0, p1);
33 p1 = (unsigned long *) srcs[0];
34 if (src_count == 1) {
35 active_template->do_2(bytes, dest, p1);
37 return;
38 }
39
36 return;
37 }
38
40 p2 = (unsigned long *) ptr[2];
41 if (count == 3) {
42 active_template->do_3(bytes, p0, p1, p2);
39 p2 = (unsigned long *) srcs[1];
40 if (src_count == 2) {
41 active_template->do_3(bytes, dest, p1, p2);
43 return;
44 }
45
42 return;
43 }
44
46 p3 = (unsigned long *) ptr[3];
47 if (count == 4) {
48 active_template->do_4(bytes, p0, p1, p2, p3);
45 p3 = (unsigned long *) srcs[2];
46 if (src_count == 3) {
47 active_template->do_4(bytes, dest, p1, p2, p3);
49 return;
50 }
51
48 return;
49 }
50
52 p4 = (unsigned long *) ptr[4];
53 active_template->do_5(bytes, p0, p1, p2, p3, p4);
51 p4 = (unsigned long *) srcs[3];
52 active_template->do_5(bytes, dest, p1, p2, p3, p4);
54}
55EXPORT_SYMBOL(xor_blocks);
56
57/* Set of all registered templates. */
58static struct xor_block_template *template_list;
59
60#define BENCH_SIZE (PAGE_SIZE)
61

--- 61 unchanged lines hidden (view full) ---

123#define xor_speed(templ) do_xor_speed((templ), b1, b2)
124
125 if (fastest) {
126 printk(KERN_INFO "xor: automatically using best "
127 "checksumming function: %s\n",
128 fastest->name);
129 xor_speed(fastest);
130 } else {
53}
54EXPORT_SYMBOL(xor_blocks);
55
56/* Set of all registered templates. */
57static struct xor_block_template *template_list;
58
59#define BENCH_SIZE (PAGE_SIZE)
60

--- 61 unchanged lines hidden (view full) ---

122#define xor_speed(templ) do_xor_speed((templ), b1, b2)
123
124 if (fastest) {
125 printk(KERN_INFO "xor: automatically using best "
126 "checksumming function: %s\n",
127 fastest->name);
128 xor_speed(fastest);
129 } else {
131 printk(KERN_INFO "xor: measuring checksumming speed\n");
130 printk(KERN_INFO "xor: measuring software checksum speed\n");
132 XOR_TRY_TEMPLATES;
133 fastest = template_list;
134 for (f = fastest; f; f = f->next)
135 if (f->speed > fastest->speed)
136 fastest = f;
137 }
138
139 printk(KERN_INFO "xor: using function: %s (%d.%03d MB/sec)\n",

--- 17 unchanged lines hidden ---
131 XOR_TRY_TEMPLATES;
132 fastest = template_list;
133 for (f = fastest; f; f = f->next)
134 if (f->speed > fastest->speed)
135 fastest = f;
136 }
137
138 printk(KERN_INFO "xor: using function: %s (%d.%03d MB/sec)\n",

--- 17 unchanged lines hidden ---