summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/libc/malloc.c')
-rw-r--r--payloads/libpayload/libc/malloc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/malloc.c b/payloads/libpayload/libc/malloc.c
index 1fc2ef1013..f8a9ddf912 100644
--- a/payloads/libpayload/libc/malloc.c
+++ b/payloads/libpayload/libc/malloc.c
@@ -123,6 +123,18 @@ int dma_coherent(const void *ptr)
return !dma_initialized() || (dma->start <= ptr && dma->end > ptr);
}
+/* Get the range of memory that can be allocated by the dma allocator. */
+void dma_allocator_range(void **start_out, size_t *size_out)
+{
+ if (dma_initialized()) {
+ *start_out = dma->start;
+ *size_out = dma->end - dma->start;
+ } else {
+ *start_out = NULL;
+ *size_out = 0;
+ }
+}
+
/* Find free block of size >= len */
static hdrtype_t volatile *find_free_block(int len, struct memory_type *type)
{