summaryrefslogtreecommitdiffhomepage
path: root/digital/ucoolib
diff options
context:
space:
mode:
authorNicolas Schodet2012-10-21 16:34:40 +0200
committerNicolas Schodet2012-10-21 18:56:30 +0200
commit7b836338fbd45ab7ec0c1dfa06386bca34ed4cee (patch)
treecdd1fed747af5eac0bfd9faba9964ef2e90e6b26 /digital/ucoolib
parent2d7e0605a35ec55d320d04c5c5ae276796a8717b (diff)
digital/ucoolib/ucoolib: add common header
Diffstat (limited to 'digital/ucoolib')
-rw-r--r--digital/ucoolib/ucoolib/common.hh40
1 files changed, 40 insertions, 0 deletions
diff --git a/digital/ucoolib/ucoolib/common.hh b/digital/ucoolib/ucoolib/common.hh
new file mode 100644
index 00000000..a27dfe3b
--- /dev/null
+++ b/digital/ucoolib/ucoolib/common.hh
@@ -0,0 +1,40 @@
+#ifndef ucoolib_common_hh
+#define ucoolib_common_hh
+// ucoolib - Microcontroller object oriented library. {{{
+//
+// Copyright (C) 2012 Nicolas Schodet
+//
+// APBTeam:
+// Web: http://apbteam.org/
+// Email: team AT apbteam DOT org
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// }}}
+#include <stdint.h>
+
+namespace ucoo {
+
+/// Compiler barrier. Prevents the compiler from moving the memory accesses
+/// from one side of it to the other side.
+extern inline void
+barrier ()
+{
+ __asm__ __volatile__("": : : "memory");
+}
+
+} // namespace ucoo
+
+#endif // ucoolib_common_h