summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/flashmap/fmap.c
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2015-12-09 15:11:42 -0800
committerPatrick Georgi <pgeorgi@google.com>2016-01-14 18:44:41 +0100
commit924f0a64219e29a9c394afec3c9e93f7549f8046 (patch)
treed8e44bfa76cac1bf90a8fc15f4646c846aafcfd8 /util/cbfstool/flashmap/fmap.c
parentd201e8c38aa774a63d4ff975f55a19b76964b9c8 (diff)
downloadcoreboot-924f0a64219e29a9c394afec3c9e93f7549f8046.tar.gz
coreboot-924f0a64219e29a9c394afec3c9e93f7549f8046.tar.bz2
coreboot-924f0a64219e29a9c394afec3c9e93f7549f8046.zip
cbfstool: Change FMAP granularity to 16 bytes
Instead of looking for an FMAP at every byte, only search down to a granularity of 16 bytes, reducing the time for a cbfstool call by 0.3s when no FMAP is found. Signed-off-by: Stefan Reinauner <reinauer@chromium.org> BUG=none BRANCH=none TEST=time ./cbfstool coreboot.rom add -f locale_de.bin -n locale_de.bin -t 0x50 -c lzma is 0.3s faster than before. Change-Id: Icb4937330e920ae09928ceda7c1af6a3c5130ac7 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: bc92d838ba9db7733870ea6e8423fa4fa41bf8fe Original-Change-Id: Idbaec58a199df93bdc10e883c56675b419ab5b8e Original-Reviewed-on: https://chromium-review.googlesource.com/317321 Original-Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Original-Tested-by: Stefan Reinauer <reinauer@chromium.org> Original-Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://review.coreboot.org/12932 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'util/cbfstool/flashmap/fmap.c')
-rw-r--r--util/cbfstool/flashmap/fmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/cbfstool/flashmap/fmap.c b/util/cbfstool/flashmap/fmap.c
index 24181d0b4340..733f46839094 100644
--- a/util/cbfstool/flashmap/fmap.c
+++ b/util/cbfstool/flashmap/fmap.c
@@ -139,7 +139,7 @@ static long int fmap_bsearch(const uint8_t *image, size_t len)
* remainder when modding the offset with the previous stride. This
* makes it so that each offset is only checked once.
*/
- for (stride = len / 2; stride >= 1; stride /= 2) {
+ for (stride = len / 2; stride >= 16; stride /= 2) {
if (fmap_found)
break;