]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - lib/raid6/mktables.c
Merge tag 'drm-fixes-for-v4.13-rc1' of git://people.freedesktop.org/~airlied/linux
[karo-tx-linux.git] / lib / raid6 / mktables.c
index 39787db588b00321f91350876676f4cc4cf2ccf3..e824d088f72cc808e8455532e0a6db551098e1e9 100644 (file)
@@ -125,6 +125,26 @@ int main(int argc, char *argv[])
        printf("EXPORT_SYMBOL(raid6_gfexp);\n");
        printf("#endif\n");
 
+       /* Compute log-of-2 table */
+       printf("\nconst u8 __attribute__((aligned(256)))\n"
+              "raid6_gflog[256] =\n" "{\n");
+       for (i = 0; i < 256; i += 8) {
+               printf("\t");
+               for (j = 0; j < 8; j++) {
+                       v = 255;
+                       for (k = 0; k < 256; k++)
+                               if (exptbl[k] == (i + j)) {
+                                       v = k;
+                                       break;
+                               }
+                       printf("0x%02x,%c", v, (j == 7) ? '\n' : ' ');
+               }
+       }
+       printf("};\n");
+       printf("#ifdef __KERNEL__\n");
+       printf("EXPORT_SYMBOL(raid6_gflog);\n");
+       printf("#endif\n");
+
        /* Compute inverse table x^-1 == x^254 */
        printf("\nconst u8 __attribute__((aligned(256)))\n"
               "raid6_gfinv[256] =\n" "{\n");