fix (workaround) drtioaux packets being corrupted #176
@ -3,6 +3,7 @@ use crc;
|
||||
use core_io::{ErrorKind as IoErrorKind, Error as IoError};
|
||||
use io::{proto::ProtoRead, proto::ProtoWrite, Cursor};
|
||||
use libboard_zynq::{timer::GlobalTimer, time::Milliseconds};
|
||||
use libcortex_a9::asm::dmb;
|
||||
use crate::mem::mem::DRTIOAUX_MEM;
|
||||
use crate::pl::csr::DRTIOAUX;
|
||||
use crate::drtioaux_proto::Error as ProtocolError;
|
||||
@ -62,10 +63,10 @@ pub fn copy_work_buffer(src: *mut u32, dst: *mut u32, len: isize) {
|
||||
// and AXI burst reads/writes are not implemented yet in gateware
|
||||
// thus the need for a work buffer for transmitting and copying it over
|
||||
unsafe {
|
||||
for i in (0..(len/4)).step_by(2) {
|
||||
//mix offsets to prevent bursts
|
||||
*dst.offset(i+1) = *src.offset(i+1);
|
||||
for i in 0..(len/4) {
|
||||
*dst.offset(i) = *src.offset(i);
|
||||
//data memory barrier to prevent bursts
|
||||
|
||||
dmb();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user
I think the compiler is allowed to reorder those, unless the memory is marked as volatile.