runtime/kernel/dma: fixed missing end of buffer marker.

The DMA transfer would halt before.
This commit is contained in:
pca006132 2020-08-06 13:59:28 +08:00
parent 7873565917
commit 0354699ae3

View File

@ -151,6 +151,8 @@ pub extern fn dma_retrieve(name: CSlice<u8>) -> 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<u8> as i32;