coreboot-kgpe-d16/util/cbfstool
Hung-Te Lin 3cfacbf196 cbfstool: Add buffer management API.
Many functions in cbfstool need to deal with a memory buffer - both location and
size. Right now it's made by different ways: for ROM image using global variable
(romsize, master_header); and in cbfs-* using return value for size and char**
to return memory location.

This may cause bugs like assuming incorrect return types, ex:
	uint32_t file_size = parse();	// which returns "-1" on error
	if (file_size <= 0) { ...
And the parse error will never be caught.

We can simplify this by introducing a buffer API, to change
	unsigned int do_something(char *input, size_t len, char **output, ...)
into
	int do_something(struct buffer *input, struct buffer *output, ...)

The buffer API will be used by further commits.

Change-Id: Iaddaeb109f08be6be84c6728d72c6a043b0e7a9f
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: http://review.coreboot.org/2205
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2013-02-05 22:24:45 +01:00
..
lzma cbfstool: Update LZMA encoder to LZMA SDK 9.12 2012-11-12 18:35:52 +01:00
EXAMPLE cbfstool: Update example file. 2013-02-04 11:12:15 +01:00
Makefile cbfstool: Update LZMA encoder to LZMA SDK 9.12 2012-11-12 18:35:52 +01:00
Makefile.inc cbfstool: Align the column of build hint message. 2012-12-14 08:46:26 +01:00
cbfs-mkpayload.c cbfstool: move flat-binary parsing to cbfs-mkpayload. 2013-02-01 06:06:41 +01:00
cbfs-mkstage.c cbfstool: Make endian detection functions to work without prior setup. 2013-02-01 06:50:17 +01:00
cbfs.h Add more information to the cbfstool print 2013-01-19 02:19:14 +01:00
cbfstool.c cbfstool: Make endian detection functions to work without prior setup. 2013-02-01 06:50:17 +01:00
common.c cbfstool: Add buffer management API. 2013-02-05 22:24:45 +01:00
common.h cbfstool: Add buffer management API. 2013-02-05 22:24:45 +01:00
compress.c cbfstool: Add -v (verbose) output. 2013-02-01 05:54:24 +01:00
elf.h fix some wrong versions of the FSF's address (trivial) 2009-09-23 21:52:45 +00:00
swab.h Various fixes to cbfstool. 2011-10-24 20:29:29 +02:00