diff options
Diffstat (limited to 'lib/raid6/mktables.c')
-rw-r--r-- | lib/raid6/mktables.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/raid6/mktables.c b/lib/raid6/mktables.c index 39787db588b0..e824d088f72c 100644 --- a/lib/raid6/mktables.c +++ b/lib/raid6/mktables.c | |||
@@ -125,6 +125,26 @@ int main(int argc, char *argv[]) | |||
125 | printf("EXPORT_SYMBOL(raid6_gfexp);\n"); | 125 | printf("EXPORT_SYMBOL(raid6_gfexp);\n"); |
126 | printf("#endif\n"); | 126 | printf("#endif\n"); |
127 | 127 | ||
128 | /* Compute log-of-2 table */ | ||
129 | printf("\nconst u8 __attribute__((aligned(256)))\n" | ||
130 | "raid6_gflog[256] =\n" "{\n"); | ||
131 | for (i = 0; i < 256; i += 8) { | ||
132 | printf("\t"); | ||
133 | for (j = 0; j < 8; j++) { | ||
134 | v = 255; | ||
135 | for (k = 0; k < 256; k++) | ||
136 | if (exptbl[k] == (i + j)) { | ||
137 | v = k; | ||
138 | break; | ||
139 | } | ||
140 | printf("0x%02x,%c", v, (j == 7) ? '\n' : ' '); | ||
141 | } | ||
142 | } | ||
143 | printf("};\n"); | ||
144 | printf("#ifdef __KERNEL__\n"); | ||
145 | printf("EXPORT_SYMBOL(raid6_gflog);\n"); | ||
146 | printf("#endif\n"); | ||
147 | |||
128 | /* Compute inverse table x^-1 == x^254 */ | 148 | /* Compute inverse table x^-1 == x^254 */ |
129 | printf("\nconst u8 __attribute__((aligned(256)))\n" | 149 | printf("\nconst u8 __attribute__((aligned(256)))\n" |
130 | "raid6_gfinv[256] =\n" "{\n"); | 150 | "raid6_gfinv[256] =\n" "{\n"); |