summaryrefslogtreecommitdiff
path: root/src/sys/io
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-22 13:12:08 -0400
committerIan Moffett <ian@osmora.org>2025-09-22 13:12:08 -0400
commitff81177f70f0a9e82a6932e86f5f9cc9dded2b4e (patch)
tree3b7d56af19112db4890d53d1af06f62d79728dd5 /src/sys/io
parent38043245f0b186421c355cce327d2567dd19f8e9 (diff)
kern: dma: Zero new memory by default
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/io')
-rw-r--r--src/sys/io/dma/alloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sys/io/dma/alloc.c b/src/sys/io/dma/alloc.c
index 3322879..7af2d87 100644
--- a/src/sys/io/dma/alloc.c
+++ b/src/sys/io/dma/alloc.c
@@ -35,6 +35,7 @@
#include <vm/mmu.h>
#include <vm/map.h>
#include <vm/vm.h>
+#include <string.h>
/*
* Allocate DMA pages
@@ -42,6 +43,7 @@
void *
dma_alloc_pg(size_t npages)
{
+ const size_t PSIZE = DEFAULT_PAGESIZE;
struct vm_vas vas;
struct mmu_map spec;
size_t length;
@@ -71,6 +73,7 @@ dma_alloc_pg(size_t npages)
}
buf = (void *)spec.va;
+ memset(buf, 0, npages * PSIZE);
done:
return buf;
}