1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-06-30 21:52:36 +02:00

Bus Pirate buffer management revamp

The buffer management of the Bus Pirate driver has been revamped to use
grow-only buffers with a reasonable initial default size so realloc()
will not have to be called in normal operation. A side effect is the
ability to switch to a static buffer without major hassle.
Handle OOM gracefully.

Corresponding to flashrom svn r1541.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Carl-Daniel Hailfinger
2012-06-08 15:27:47 +00:00
parent 1c15548888
commit 316fdfbf82
2 changed files with 110 additions and 67 deletions

View File

@ -36,6 +36,7 @@
#define ERROR_PTR ((void*)-1)
/* Error codes */
#define ERROR_OOM -100
#define TIMEOUT_ERROR -101
typedef unsigned long chipaddr;