[Concept,04/19] sandbox: Move malloc_dump_to_file() prototype to os.h
Commit Message
From: Simon Glass <sjg@chromium.org>
This function is only available in sandbox builds and uses os_open()
and os_write(). Move its declaration from malloc.h (which conflicts
with asm/malloc.h in sandbox files) to os.h where it fits naturally
alongside other sandbox host-file operations.
This allows sandbox code that includes asm/malloc.h to call
malloc_dump_to_file() via os.h without a forward declaration.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
include/malloc.h | 11 -----------
include/os.h | 11 +++++++++++
2 files changed, 11 insertions(+), 11 deletions(-)
@@ -712,17 +712,6 @@ void malloc_disable_testing(void);
*/
void malloc_dump(void);
-/**
- * malloc_dump_to_file() - Write heap dump to a host file
- *
- * @fname: Path to the output file on the host filesystem
- * Return: 0 on success, negative error code on failure
- *
- * This is only available in sandbox builds. It writes the same information
- * as malloc_dump() but to a file instead of the console.
- */
-int malloc_dump_to_file(const char *fname);
-
/**
* malloc_log_start() - Start logging malloc traffic
*
@@ -546,6 +546,17 @@ int os_map_file(const char *pathname, int os_flags, void **bufp, int *sizep);
*/
int os_unmap(void *buf, int size);
+/**
+ * malloc_dump_to_file() - Write heap dump to a host file
+ *
+ * This is only available in sandbox builds. It writes the same information
+ * as malloc_dump() but to a file instead of the console.
+ *
+ * @fname: Path to the output file on the host filesystem
+ * Return: 0 on success, negative error code on failure
+ */
+int malloc_dump_to_file(const char *fname);
+
/*
* os_find_text_base() - Find the text section in this running process
*