projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add wizard support and linker scripts for STM32F103RE
[bertos.git]
/
bertos
/
cfg
/
compiler.h
diff --git
a/bertos/cfg/compiler.h
b/bertos/cfg/compiler.h
index 0121b96367fe067cc98ba9a92004356c05ef56a5..c2e814e522e0be69086eb447ef7442d81ced9d51 100644
(file)
--- a/
bertos/cfg/compiler.h
+++ b/
bertos/cfg/compiler.h
@@
-603,4
+603,11
@@
typedef unsigned char sigmask_t; /**< Type for signal masks. */
do { (void)(&(var) == (type *)0); } while(0)
#endif
do { (void)(&(var) == (type *)0); } while(0)
#endif
+/**
+ * Prevent the compiler from optimizing access to the variable \a x, enforcing
+ * a refetch from memory. This also forbid from reordering successing instances
+ * of ACCESS_SAFE().
+ */
+#define ACCESS_SAFE(x) (*(volatile typeof(x) *)&(x))
+
#endif /* BERTOS_COMPILER_H */
#endif /* BERTOS_COMPILER_H */