rust-embedded / volatile-register Goto Github PK
View Code? Open in Web Editor NEWVolatile access to memory mapped hardware registers
License: Other
Volatile access to memory mapped hardware registers
License: Other
Rust considers all references dereferencable and hence adds the dereferencable
attribute. This allows the compiler to insert spurious reads from that reference. There is currently no way around that.
Some more discussions for context:
Unfortunately, this means the approach implemented by this crate is currently flawed: the compiler may insert spurious reads from an &RO<T>
(or any of the other types, including WO
).
The UCG thread is probably the best place to discuss possible solutions to this problem.
(I am not sure if this issue should be reported against this crate or vcell
.)
Same as japaric/vcell#5, and maybe similar to #5
RW
, RW
and WO
are used in ABI sensitive codes. So, it would be better to add repr(transparent)
to those struct.
In the WO struct you use an UnsafeCell to hold the value, but UnsafeCell isn't repr(C) compatible. This causes rust to throw a warning that some struct element isn't repr(C) and should be.
I'm unsure whether or not this breaks things in practice, so what's the fix here, if any? My fork just made it work like RW structs, but would require a minor change to svd2rust (all write functions use mutable borrows).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.