/* -*- linux-c -*- ------------------------------------------------------- * * * Copyright 2002-2004 H. Peter Anvin - All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, Inc., 53 Temple Place Ste 330, * Boston MA 02111-1307, USA; either version 2 of the License, or * (at your option) any later version; incorporated herein by reference. * * ----------------------------------------------------------------------- */ /* * int8.c * * 8-way unrolled portable integer math RAID-6 instruction set * * This file is postprocessed using unroll.awk */ #include <linux/raid/pq.h> /* * This is the C data type to use */ /* Change this from BITS_PER_LONG if there is something better... */ #if BITS_PER_LONG == 64 #define NBYTES(x) … #define NSIZE … #define NSHIFT … #define NSTRING … unative_t; #else #define NBYTES … #define NSIZE … #define NSHIFT … #define NSTRING … typedef u32 unative_t; #endif /* * These sub-operations are separate inlines since they can sometimes be * specially optimized using architecture-specific hacks. */ /* * The SHLBYTE() operation shifts each byte left by 1, *not* * rolling over into the next byte */ static inline __attribute_const__ unative_t SHLBYTE(unative_t v) { … } /* * The MASK() operation returns 0xFF in any byte for which the high * bit is 1, 0x00 for any byte for which the high bit is 0. */ static inline __attribute_const__ unative_t MASK(unative_t v) { … } static void raid6_int8_gen_syndrome(int disks, size_t bytes, void **ptrs) { … } static void raid6_int8_xor_syndrome(int disks, int start, int stop, size_t bytes, void **ptrs) { … } const struct raid6_calls raid6_intx8 = …;