about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2013-12-28 18:01:53 +0400
committerPeter Zotov <whitequark@whitequark.org>2013-12-31 02:54:25 +0400
commitf98f83a15de649f3b4d152737336e95a0969e265 (patch)
tree10e22bbdb54bd6a4399e1a8aedae8fe25577ea50 /src/libstd
parent1502b1197b78624aad5180fa8eff3f77f6f0abfc (diff)
downloadrust-f98f83a15de649f3b4d152737336e95a0969e265.tar.gz
rust-f98f83a15de649f3b4d152737336e95a0969e265.zip
Implement volatile_load and volatile_store intrinsics.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/unstable/intrinsics.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs
index d3649f0285c..46dc03e82b0 100644
--- a/src/libstd/unstable/intrinsics.rs
+++ b/src/libstd/unstable/intrinsics.rs
@@ -12,6 +12,15 @@
 
 The corresponding definitions are in librustc/middle/trans/foreign.rs.
 
+# Volatiles
+
+The volatile intrinsics provide operations intended to act on I/O
+memory, which are guaranteed to not be reordered by the compiler
+across other volatile intrinsics. See the LLVM documentation on
+[[volatile]].
+
+[volatile]: http://llvm.org/docs/LangRef.html#volatile-memory-accesses
+
 # Atomics
 
 The atomic intrinsics provide common atomic operations on machine
@@ -179,6 +188,9 @@ extern "rust-intrinsic" {
     /// Execute a breakpoint trap, for inspection by a debugger.
     pub fn breakpoint();
 
+    #[cfg(not(stage0))] pub fn volatile_load<T>(src: *T) -> T;
+    #[cfg(not(stage0))] pub fn volatile_store<T>(dst: *mut T, val: T);
+
     /// Atomic compare and exchange, sequentially consistent.
     pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
     /// Atomic compare and exchange, acquire ordering.