Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

barrier functions wrap unsafe behaviour #47

Closed
wants to merge 1 commit into from
Closed

barrier functions wrap unsafe behaviour #47

wants to merge 1 commit into from

Conversation

JaviMerino
Copy link
Contributor

The safety documentation for the barrier functions just say "In your own hands, this is hardware land!" because the programmer doesn't need to check safety when adding a barrier. Adding a memory barrier does not break the borrow checker, cause undefined behaviour or alter memory in any way. Therefore, we can make dsb(), dmb() and isb() safe wrappers around the asm code that write the intended assembly.

The safety documentation for the barrier functions just say "In your
own hands, this is hardware land!" because the programmer doesn't need
to check safety when adding a barrier.  Adding a memory barrier does
not break the borrow checker, cause undefined behaviour or alter
memory in any way.  Therefore, we can make dsb(), dmb() and isb() safe
wrappers around the asm code that write the intended assembly.
@andre-richter
Copy link
Member

Coincidentally, I have prepared this change already in https://github.com/rust-embedded/cortex-a/tree/safe_barrier and it will go into the next release.

@andre-richter
Copy link
Member

Next release schedule explained in #46 (comment)

@andre-richter
Copy link
Member

Closing in favor of #48

@JaviMerino
Copy link
Contributor Author

Perfect, good timing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants