summaryrefslogtreecommitdiffstats
path: root/libflashrom.h
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2018-01-15 01:10:36 +0300
committerNico Huber <nico.h@gmx.de>2018-02-11 16:54:14 +0000
commitf701f343117270b4373320eb25ae259b8e513b7d (patch)
tree2749940aec9f2b1dc0ad53069079b78f225d76cf /libflashrom.h
parent3a826043dbd389b4be2f5783c1b984ba297b8179 (diff)
downloadflashrom-f701f343117270b4373320eb25ae259b8e513b7d.tar.gz
flashrom-f701f343117270b4373320eb25ae259b8e513b7d.tar.bz2
flashrom-f701f343117270b4373320eb25ae259b8e513b7d.zip
Add support for reading the current flash contents from a file
When developing software that has to be flashed to a flash chip to be executed, it often takes a long time to read the current flash contents (for flashrom to know what pages to erase and reprogram) each time when writing the new image. However, when the flash was just reprogrammed, its current state is known to be the previous image that was flashed (assuming it was verified). Thus, it makes sense to provide that image as a file for the flash contents instead of wasting valuable time read the whole flash each time. Change-Id: Idf153b6955f37779ae9bfb228a434ed10c304947 Signed-off-by: Mike Banon <mikebdp2@gmail.com> Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: https://review.coreboot.org/23263 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'libflashrom.h')
-rw-r--r--libflashrom.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libflashrom.h b/libflashrom.h
index d3f3dedcf..786147b2d 100644
--- a/libflashrom.h
+++ b/libflashrom.h
@@ -60,7 +60,7 @@ void flashrom_flag_set(struct flashrom_flashctx *, enum flashrom_flag, bool valu
bool flashrom_flag_get(const struct flashrom_flashctx *, enum flashrom_flag);
int flashrom_image_read(struct flashrom_flashctx *, void *buffer, size_t buffer_len);
-int flashrom_image_write(struct flashrom_flashctx *, void *buffer, size_t buffer_len);
+int flashrom_image_write(struct flashrom_flashctx *, void *buffer, size_t buffer_len, const void *refbuffer);
int flashrom_image_verify(struct flashrom_flashctx *, const void *buffer, size_t buffer_len);
struct flashrom_layout;
@@ -69,4 +69,4 @@ int flashrom_layout_include_region(struct flashrom_layout *, const char *name);
void flashrom_layout_release(struct flashrom_layout *);
void flashrom_layout_set(struct flashrom_flashctx *, const struct flashrom_layout *);
-#endif /* !__LIBFLASHROM_H__ */
+#endif /* !__LIBFLASHROM_H__ */ \ No newline at end of file