summaryrefslogtreecommitdiffstats
path: root/src/usr/mbox/mbox_dma_buffer.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/mbox/mbox_dma_buffer.C')
-rw-r--r--src/usr/mbox/mbox_dma_buffer.C5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/usr/mbox/mbox_dma_buffer.C b/src/usr/mbox/mbox_dma_buffer.C
index f04c54aee..43c93c681 100644
--- a/src/usr/mbox/mbox_dma_buffer.C
+++ b/src/usr/mbox/mbox_dma_buffer.C
@@ -179,7 +179,8 @@ void DmaBuffer::initPhysicalArea(void*& io_addr, uint64_t& o_phys)
// Move the physical address to the start of the node (unsecure) and
// add on the DMA buffer offset inside the node.
o_phys &= ~(hrmor_base-1);
- o_phys += VmmManager::MBOX_DMA_ADDR;
+ o_phys += reinterpret_cast<uint64_t>(io_addr) +
+ VMM_UNSECURE_RESERVED_MEMORY_BASEADDR;
// Allocate a new VMM block for the buffer.
io_addr = mm_block_map(reinterpret_cast<void*>(o_phys),
@@ -195,5 +196,7 @@ void DmaBuffer::initPhysicalArea(void*& io_addr, uint64_t& o_phys)
reinterpret_cast<uint64_t*>(VmmManager::MBOX_DMA_SIZE +
reinterpret_cast<uint64_t>(io_addr)));
+ memset(io_addr, '\0', VmmManager::MBOX_DMA_SIZE);
+
}
OpenPOWER on IntegriCloud