Documentation ¶
Overview ¶
Package volatile provides definitions for volatile loads and stores. These are implemented as compiler builtins.
The load operations load a volatile value. The store operations store to a volatile value. The compiler will emit exactly one load or store operation when possible and will not reorder volatile operations. However, the compiler may move other operations across load/store operations, so make sure that all relevant loads/stores are done in a volatile way if this is a problem.
These loads and stores are commonly used to read/write values from memory mapped peripheral devices. They do not provide atomicity, use the sync/atomic package for that.
For more details: https://llvm.org/docs/LangRef.html#volatile-memory-accesses and https://blog.regehr.org/archives/28.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadUint16 ¶
LoadUint16 loads the volatile value *addr.
func LoadUint32 ¶
LoadUint32 loads the volatile value *addr.
func StoreUint16 ¶
StoreUint16 stores val to the volatile value *addr.
func StoreUint32 ¶
StoreUint32 stores val to the volatile value *addr.
func StoreUint8 ¶
StoreUint8 stores val to the volatile value *addr.
Types ¶
This section is empty.