From 0354699ae39d545778c5a6f77fade76a1b0264d0 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Thu, 6 Aug 2020 13:59:28 +0800 Subject: [PATCH] runtime/kernel/dma: fixed missing end of buffer marker. The DMA transfer would halt before. --- src/runtime/src/kernel/dma.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/src/kernel/dma.rs b/src/runtime/src/kernel/dma.rs index b5a79bb..4d1859c 100644 --- a/src/runtime/src/kernel/dma.rs +++ b/src/runtime/src/kernel/dma.rs @@ -151,6 +151,8 @@ pub extern fn dma_retrieve(name: CSlice) -> DmaTrace { for _ in 0..padding { v.push(0); } + // trailing zero to indicate end of buffer + v.push(0); v.copy_within(0..original_length, padding); let v = Box::new(v); let address = Box::into_raw(v) as *mut Vec as i32;