summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2018-04-20 10:37:51 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-05-04 10:06:18 +0000
commit64049be508671bbd98e2c69bbe32a2434bc17b9d (patch)
tree47426e72f0723dcf60a10970ee8c6bba6697cf75 /src/include
parentc653623d59bc207d035078b63d4bfe1c45e6f58d (diff)
downloadcoreboot-64049be508671bbd98e2c69bbe32a2434bc17b9d.tar.xz
lib/bootmem: Add method to walk OS POV memory tables
Add method to walk memory tables from OS point of view. The tables don't change when modifiying bootmem entries and doesn't contain bootmem specific tags. Change-Id: Iee332a9821d12a7d9a684063b77b0502febd8d7d Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/25747 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/bootmem.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/bootmem.h b/src/include/bootmem.h
index 161f482e13..7503306167 100644
--- a/src/include/bootmem.h
+++ b/src/include/bootmem.h
@@ -71,6 +71,17 @@ void bootmem_dump_ranges(void);
typedef bool (*range_action_t)(const struct range_entry *r, void *arg);
/**
+ * Walk memory tables from OS point of view and call the provided function,
+ * for every region. The caller has to return false to break out of the loop any
+ * time, or return true to continue.
+ *
+ * @param action The function to call for each memory range.
+ * @param arg Pointer passed to function @action. Set to NULL if unused.
+ * @return true if the function 'action' returned false.
+ */
+bool bootmem_walk_os_mem(range_action_t action, void *arg);
+
+/**
* Walk memory tables and call the provided function, for every region.
* The caller has to return false to break out of the loop any time, or
* return true to continue.