projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename CPU_MEMORY_BARRIER to MEMORY_BARRIER and move it in compiler header.
[bertos.git]
/
cfg
/
compiler.h
diff --git
a/cfg/compiler.h
b/cfg/compiler.h
index 6485473cf2f12d086e99acca3599b83fbbfb5a0e..a303dc776115cc0ab9640d4eb208bfe366c950ad 100644
(file)
--- a/
cfg/compiler.h
+++ b/
cfg/compiler.h
@@
-37,8
+37,8
@@
* \author Bernardo Innocenti <bernie@develer.com>
*/
* \author Bernardo Innocenti <bernie@develer.com>
*/
-#ifndef
DEVLIB
_COMPILER_H
-#define
DEVLIB
_COMPILER_H
+#ifndef
BERTOS
_COMPILER_H
+#define
BERTOS
_COMPILER_H
#include <cpu/detect.h>
#include <cpu/detect.h>
@@
-180,6
+180,12
@@
#define USED_FUNC __attribute__((__used__))
#define RESTRICT __restrict__
#define MUST_CHECK __attribute__((warn_unused_result))
#define USED_FUNC __attribute__((__used__))
#define RESTRICT __restrict__
#define MUST_CHECK __attribute__((warn_unused_result))
+ #define PACKED __attribute__((packed))
+ /**
+ * Force compiler to realod context variable.
+ */
+ #define MEMORY_BARRIER asm volatile ("" : : : "memory")
+
#if GNUC_PREREQ(3,1)
#define DEPRECATED __attribute__((__deprecated__))
#endif
#if GNUC_PREREQ(3,1)
#define DEPRECATED __attribute__((__deprecated__))
#endif
@@
-210,6
+216,8
@@
#pragma GCC poison cin cout cerr clog
#endif
#pragma GCC poison cin cout cerr clog
#endif
+
+
#elif defined(__MWERKS__)
/* Compiler features */
#elif defined(__MWERKS__)
/* Compiler features */
@@
-309,6
+317,14
@@
#ifndef MUST_CHECK
#define MUST_CHECK /* nothing */
#endif
#ifndef MUST_CHECK
#define MUST_CHECK /* nothing */
#endif
+#ifndef PACKED
+#define PACKED /* nothing */
+#endif
+#ifndef MEMORY_BARRIER
+#define MEMORY_BARRIER /* nothing */
+#warning No memory barrier defined for select compiler. If you use the kernel check it.
+#endif
+
/* Misc definitions */
#ifndef NULL
/* Misc definitions */
#ifndef NULL
@@
-318,7
+334,6
@@
#define EOF (-1)
#endif
#define EOF (-1)
#endif
-
/* Support for hybrid C/C++ applications. */
#ifdef __cplusplus
#define EXTERN_C extern "C"
/* Support for hybrid C/C++ applications. */
#ifdef __cplusplus
#define EXTERN_C extern "C"
@@
-510,4
+525,4
@@
typedef unsigned char page_t; /**< Type for banked memory pages. */
do { (void)(&(var) == (type *)0); } while(0)
#endif
do { (void)(&(var) == (type *)0); } while(0)
#endif
-#endif /*
DEVLIB
_COMPILER_H */
+#endif /*
BERTOS
_COMPILER_H */