diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-05-30 13:35:18 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-05-30 13:35:18 +1000 |
commit | 8456fabfce852ba7a9c1a80c260a68d6127c8c4a (patch) | |
tree | a0ef23d8a184e7717bec4b6206c39fed3fdfb7ee /lib/raid6/mktables.c | |
parent | 2c5ac53196f1081a8cf90c0ee56fab1dc381ff5c (diff) | |
parent | 5566e5d3479194537414c469e6b91d2d38a62d44 (diff) |
Merge remote-tracking branch 'slave-dma/next'
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[]) 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"); |