Attention is currently required from: Chen, Gang C.
Hello Chen, Gang C,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/86572?usp=email
to review the following change.
Change subject: util/cbfstool: Support CONFIG_BIOS_SIZE in cbfstool ......................................................................
util/cbfstool: Support CONFIG_BIOS_SIZE in cbfstool
Update cbfstool to refer to CONFIG_BIOS_SIZE for support of BIOS sizes exceeding 16MB
Change-Id: I6fd4fb216611fda3d261d4fff9871cfff1ed655f Signed-off-by: Shuo Liu shuo.liu@intel.com Signed-off-by: Gang Chen gang.c.chen@intel.com --- M util/cbfstool/Makefile.mk M util/cbfstool/cbfstool.c 2 files changed, 12 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/86572/1
diff --git a/util/cbfstool/Makefile.mk b/util/cbfstool/Makefile.mk index 8577874..53c672e 100644 --- a/util/cbfstool/Makefile.mk +++ b/util/cbfstool/Makefile.mk @@ -124,6 +124,7 @@ TOOLCPPFLAGS += -I$(objutil)/cbfstool TOOLCPPFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/include TOOLCPPFLAGS += -include $(top)/src/commonlib/bsd/include/commonlib/bsd/compiler.h +TOOLCPPFLAGS += -include $(obj)/config.h TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/include TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/2lib/include TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/host/include @@ -161,43 +162,43 @@ DEBUG= \ hostlib
-$(objutil)/cbfstool/%.o: $(objutil)/cbfstool/%.c +$(objutil)/cbfstool/%.o: $(objutil)/cbfstool/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/flashmap/%.c +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/flashmap/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/src/commonlib/%.c +$(objutil)/cbfstool/%.o: $(top)/src/commonlib/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/src/commonlib/bsd/%.c +$(objutil)/cbfstool/%.o: $(top)/src/commonlib/bsd/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lz4/lib/%.c +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lz4/lib/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) $(LZ4CFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/fpt_formats/%.c +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/fpt_formats/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/bpdt_formats/%.c +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/bpdt_formats/%.c $(obj)/config.h printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index bde61b5..eb55eea 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -392,7 +392,7 @@ }
#define DEFAULT_DECODE_WINDOW_TOP (4ULL * GiB) -#define DEFAULT_DECODE_WINDOW_MAX_SIZE (16 * MiB) +#define DEFAULT_DECODE_WINDOW_MAX_SIZE MAX(16 * MiB, CONFIG_BIOS_SIZE)
static bool create_mmap_windows(void) {