From 7b836338fbd45ab7ec0c1dfa06386bca34ed4cee Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 21 Oct 2012 16:34:40 +0200 Subject: digital/ucoolib/ucoolib: add common header --- digital/ucoolib/ucoolib/common.hh | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 digital/ucoolib/ucoolib/common.hh (limited to 'digital/ucoolib/ucoolib') 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 + +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 -- cgit v1.2.3