aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Kconfig
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2012-03-23 18:02:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 19:58:38 -0400
commit5cde7656d0dd222170eb0250bd1f70c9018fd438 (patch)
tree6ebd5b76968f84d5fd8545cfe3400162d76d222c /lib/Kconfig
parent577eba9e22e872574c466648b46eeb3e0d04372e (diff)
crc32: select an algorithm via Kconfig
Allow the kernel builder to choose a crc32* algorithm for the kernel. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Cc: Bob Pearson <rpearson@systemfabricworks.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/Kconfig')
-rw-r--r--lib/Kconfig43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index 6d7ce4b138c4..43359bb1ca90 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -80,6 +80,49 @@ config CRC32_SELFTEST
80 and crc32_be over byte strings with random alignment and length 80 and crc32_be over byte strings with random alignment and length
81 and computes the total elapsed time and number of bytes processed. 81 and computes the total elapsed time and number of bytes processed.
82 82
83choice
84 prompt "CRC32 implementation"
85 depends on CRC32
86 default CRC32_SLICEBY8
87
88config CRC32_SLICEBY8
89 bool "Slice by 8 bytes"
90 help
91 Calculate checksum 8 bytes at a time with a clever slicing algorithm.
92 This is the fastest algorithm, but comes with a 8KiB lookup table.
93 Most modern processors have enough cache to hold this table without
94 thrashing the cache.
95
96 This is the default implementation choice. Choose this one unless
97 you have a good reason not to.
98
99config CRC32_SLICEBY4
100 bool "Slice by 4 bytes"
101 help
102 Calculate checksum 4 bytes at a time with a clever slicing algorithm.
103 This is a bit slower than slice by 8, but has a smaller 4KiB lookup
104 table.
105
106 Only choose this option if you know what you are doing.
107
108config CRC32_SARWATE
109 bool "Sarwate's Algorithm (one byte at a time)"
110 help
111 Calculate checksum a byte at a time using Sarwate's algorithm. This
112 is not particularly fast, but has a small 256 byte lookup table.
113
114 Only choose this option if you know what you are doing.
115
116config CRC32_BIT
117 bool "Classic Algorithm (one bit at a time)"
118 help
119 Calculate checksum one bit at a time. This is VERY slow, but has
120 no lookup table. This is provided as a debugging option.
121
122 Only choose this option if you are debugging crc32.
123
124endchoice
125
83config CRC7 126config CRC7
84 tristate "CRC7 functions" 127 tristate "CRC7 functions"
85 help 128 help