diff options
-rw-r--r-- | include/flash.h | 2 | ||||
-rw-r--r-- | include/libflashrom.h | 2 | ||||
-rw-r--r-- | libflashrom.c | 22 |
3 files changed, 17 insertions, 9 deletions
diff --git a/include/flash.h b/include/flash.h index aabc785e..2ea9c864 100644 --- a/include/flash.h +++ b/include/flash.h @@ -530,6 +530,8 @@ struct flashrom_flashctx { bool force_boardmismatch; bool verify_after_write; bool verify_whole_chip; + bool skip_unreadable_regions; + bool skip_unwritable_regions; } flags; /* We cache the state of the extended address register (highest byte * of a 4BA for 3BA instructions) and the state of the 4BA mode here. diff --git a/include/libflashrom.h b/include/libflashrom.h index bac76c2c..490ef03b 100644 --- a/include/libflashrom.h +++ b/include/libflashrom.h @@ -251,6 +251,8 @@ enum flashrom_flag { FLASHROM_FLAG_FORCE_BOARDMISMATCH, FLASHROM_FLAG_VERIFY_AFTER_WRITE, FLASHROM_FLAG_VERIFY_WHOLE_CHIP, + FLASHROM_FLAG_SKIP_UNREADABLE_REGIONS, + FLASHROM_FLAG_SKIP_UNWRITABLE_REGIONS, }; /** diff --git a/libflashrom.c b/libflashrom.c index 44f297f6..2e89fe5a 100644 --- a/libflashrom.c +++ b/libflashrom.c @@ -265,21 +265,25 @@ void flashrom_flag_set(struct flashrom_flashctx *const flashctx, const enum flashrom_flag flag, const bool value) { switch (flag) { - case FLASHROM_FLAG_FORCE: flashctx->flags.force = value; break; - case FLASHROM_FLAG_FORCE_BOARDMISMATCH: flashctx->flags.force_boardmismatch = value; break; - case FLASHROM_FLAG_VERIFY_AFTER_WRITE: flashctx->flags.verify_after_write = value; break; - case FLASHROM_FLAG_VERIFY_WHOLE_CHIP: flashctx->flags.verify_whole_chip = value; break; + case FLASHROM_FLAG_FORCE: flashctx->flags.force = value; break; + case FLASHROM_FLAG_FORCE_BOARDMISMATCH: flashctx->flags.force_boardmismatch = value; break; + case FLASHROM_FLAG_VERIFY_AFTER_WRITE: flashctx->flags.verify_after_write = value; break; + case FLASHROM_FLAG_VERIFY_WHOLE_CHIP: flashctx->flags.verify_whole_chip = value; break; + case FLASHROM_FLAG_SKIP_UNREADABLE_REGIONS: flashctx->flags.skip_unreadable_regions = value; break; + case FLASHROM_FLAG_SKIP_UNWRITABLE_REGIONS: flashctx->flags.skip_unwritable_regions = value; break; } } bool flashrom_flag_get(const struct flashrom_flashctx *const flashctx, const enum flashrom_flag flag) { switch (flag) { - case FLASHROM_FLAG_FORCE: return flashctx->flags.force; - case FLASHROM_FLAG_FORCE_BOARDMISMATCH: return flashctx->flags.force_boardmismatch; - case FLASHROM_FLAG_VERIFY_AFTER_WRITE: return flashctx->flags.verify_after_write; - case FLASHROM_FLAG_VERIFY_WHOLE_CHIP: return flashctx->flags.verify_whole_chip; - default: return false; + case FLASHROM_FLAG_FORCE: return flashctx->flags.force; + case FLASHROM_FLAG_FORCE_BOARDMISMATCH: return flashctx->flags.force_boardmismatch; + case FLASHROM_FLAG_VERIFY_AFTER_WRITE: return flashctx->flags.verify_after_write; + case FLASHROM_FLAG_VERIFY_WHOLE_CHIP: return flashctx->flags.verify_whole_chip; + case FLASHROM_FLAG_SKIP_UNREADABLE_REGIONS: return flashctx->flags.skip_unreadable_regions; + case FLASHROM_FLAG_SKIP_UNWRITABLE_REGIONS: return flashctx->flags.skip_unwritable_regions; + default: return false; } } |