summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/layout.c b/layout.c
index cddd9087e..e46e61ae5 100644
--- a/layout.c
+++ b/layout.c
@@ -217,6 +217,17 @@ static int include_region(struct flashrom_layout *const l, const char *name,
return 1;
}
+/* returns 0 to indicate success, 1 to indicate failure */
+static int exclude_region(struct flashrom_layout *const l, const char *name)
+{
+ struct romentry *const entry = _layout_entry_by_name(l, name);
+ if (entry) {
+ entry->included = false;
+ return 0;
+ }
+ return 1;
+}
+
/* returns -1 if an entry is not found, 0 if found. */
static int romentry_exists(struct flashrom_layout *const l, char *name, char *file)
{
@@ -441,6 +452,11 @@ int flashrom_layout_include_region(struct flashrom_layout *const layout, const c
return include_region(layout, name, NULL);
}
+int flashrom_layout_exclude_region(struct flashrom_layout *const layout, const char *name)
+{
+ return exclude_region(layout, name);
+}
+
int flashrom_layout_get_region_range(struct flashrom_layout *const l, const char *name,
unsigned int *start, unsigned int *len)
{