summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-10-23 17:25:58 -0600
committerSimon Glass <sjg@chromium.org>2021-11-28 16:51:51 -0700
commita0ff280a8988dd62c8dc9a3156f6f80a346000e5 (patch)
tree9645997be3a755337f658716b01c5b875cac3c4a /include
parent15156c95e9710447cc66f4b18009220bc4098d4e (diff)
sandbox: Support unmapping a file
Add the opposite of mapping, so that we can unmap and avoid running out of address space. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/os.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h
index 770d76e02f7..4cbcbd93a71 100644
--- a/include/os.h
+++ b/include/os.h
@@ -419,6 +419,15 @@ int os_read_file(const char *name, void **bufp, int *sizep);
*/
int os_map_file(const char *pathname, int os_flags, void **bufp, int *sizep);
+/**
+ * os_unmap() - Unmap a file previously mapped
+ *
+ * @buf: Mapped address
+ * @size: Size in bytes
+ * Return: 0 if OK, -ve on error
+ */
+int os_unmap(void *buf, int size);
+
/*
* os_find_text_base() - Find the text section in this running process
*