Remove memory barrier again

Upon further reading, found out that RPi3 features an A53 CPU, which
is one of the ARMv8-A variants that in fact does _not_ have
out-of-order execution.
pull/4/head
Andre Richter 6 years ago
parent de0e42142b
commit 41d69fa594

Binary file not shown.

@ -54,10 +54,6 @@ fn main() {
mbox.buffer[6] = 0;
mbox.buffer[7] = mbox::tag::LAST;
// Insert a memory barrier that ensures mailbox buffer setup
// finishes before VIDEOCORE is notified.
mbox::Mbox::synchronize();
// send the message to the GPU and receive answer
let serial_avail = match mbox.call(mbox::channel::PROP) {
Err(_) => false,

@ -93,19 +93,6 @@ impl Mbox {
}
}
/// ARM Data Memory Barrier (DMB). Intended for use after setting
/// up the mailbox buffer and before calling Mbox::call().
///
/// Prevents that CPU instruction reordering results in notifying
/// the VIDEOCORE about a new message before setting up the
/// mailbox buffer is finished.
#[inline(always)]
pub fn synchronize() {
unsafe {
asm!("DMB SY" :::: "volatile");
}
}
/// Make a mailbox call. Returns Err(MboxError) on failure, Ok(()) success
pub fn call(&mut self, channel: u32) -> Result<()> {
// wait until we can write to the mailbox

@ -77,10 +77,6 @@ impl Uart {
mbox.buffer[7] = 0; // skip turbo setting
mbox.buffer[8] = mbox::tag::LAST;
// Insert a memory barrier that ensures mailbox buffer setup
// finishes before VIDEOCORE is notified.
mbox::Mbox::synchronize();
if let Err(_) = mbox.call(mbox::channel::PROP) {
return Err(UartError::MailboxError); // Abort if UART clocks couldn't be set
};

Loading…
Cancel
Save