aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAarya Chaumal <aarya.chaumal@gmail.com>2022-12-21 21:28:15 +0530
committerAnastasia Klimchuk <aklm@chromium.org>2023-01-16 01:51:59 +0000
commitb86803830399fe05b0ef81d56d1da027433e5af7 (patch)
treeab7ba25161beeea3413431f7774e1cd9d34fad28 /include
parentf2d20cf713f892ca1798fb2304320e44d7f80179 (diff)
downloadflashrom-b86803830399fe05b0ef81d56d1da027433e5af7.tar.gz
flashrom-b86803830399fe05b0ef81d56d1da027433e5af7.tar.bz2
flashrom-b86803830399fe05b0ef81d56d1da027433e5af7.zip
flash.h: Make functions global that will be used for new erase algorithm
The new erase algorithm uses some of the functions which are static to `flashrom.c`. So make these functions global and add prototypes to `include\flash.h` and `include\layout.h'. Change-Id: I7ee7e208948337b88467935fd2861b5f9ad6af9d Signed-off-by: Aarya Chaumal <aarya.chaumal@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/71174 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/flash.h7
-rw-r--r--include/layout.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/include/flash.h b/include/flash.h
index 2ea9c864..fcefc422 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -619,6 +619,13 @@ int write_buf_to_file(const unsigned char *buf, unsigned long size, const char *
int prepare_flash_access(struct flashctx *, bool read_it, bool write_it, bool erase_it, bool verify_it);
void finalize_flash_access(struct flashctx *);
int register_chip_restore(chip_restore_fn_cb_t func, struct flashctx *flash, uint8_t status);
+int check_block_eraser(const struct flashctx *flash, int k, int log);
+unsigned int count_usable_erasers(const struct flashctx *flash);
+int need_erase(const uint8_t *have, const uint8_t *want, unsigned int len, enum write_granularity gran, const uint8_t erased_value);
+erasefunc_t *lookup_erase_func_ptr(const struct block_eraser *const eraser);
+int check_erased_range(struct flashctx *flash, unsigned int start, unsigned int len);
+unsigned int get_next_write(const uint8_t *have, const uint8_t *want, unsigned int len, unsigned int *first_start, enum write_granularity gran);
+int write_flash(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
/* Something happened that shouldn't happen, but we can go on. */
#define ERROR_FLASHROM_NONFATAL 0x100
diff --git a/include/layout.h b/include/layout.h
index 70d99cbb..5614beaf 100644
--- a/include/layout.h
+++ b/include/layout.h
@@ -72,5 +72,7 @@ const struct romentry *layout_next(const struct flashrom_layout *, const struct
int included_regions_overlap(const struct flashrom_layout *);
void prepare_layout_for_extraction(struct flashrom_flashctx *);
int layout_sanity_checks(const struct flashrom_flashctx *);
+int check_for_unwritable_regions(const struct flashrom_flashctx *flash, unsigned int start, unsigned int len);
+void get_flash_region(const struct flashrom_flashctx *flash, int addr, struct flash_region *region);
#endif /* !__LAYOUT_H__ */