diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-04-16 16:12:51 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-04-16 16:12:51 +0000 |
commit | d57f92801471b1337ed49d989026e1c212cdfc73 (patch) | |
tree | 53a02411539973d50e5504c25a050d383116f5b0 | |
parent | 9d3bca73d4fa4cf5543c68902dfc6e589c7d7bb2 (diff) | |
download | ChibiOS-d57f92801471b1337ed49d989026e1c212cdfc73.tar.gz ChibiOS-d57f92801471b1337ed49d989026e1c212cdfc73.tar.bz2 ChibiOS-d57f92801471b1337ed49d989026e1c212cdfc73.zip |
More infos in chtypes.h.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9292 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/common/ports/ARM/compilers/GCC/chtypes.h | 24 | ||||
-rw-r--r-- | os/common/ports/ARMCMx/compilers/GCC/chtypes.h | 24 | ||||
-rw-r--r-- | os/common/ports/ARMCMx/compilers/IAR/chtypes.h | 24 | ||||
-rw-r--r-- | os/common/ports/ARMCMx/compilers/RVCT/chtypes.h | 24 | ||||
-rw-r--r-- | os/common/ports/AVR/compilers/GCC/chtypes.h | 20 | ||||
-rw-r--r-- | os/common/ports/SIMIA32/compilers/GCC/chtypes.h | 24 | ||||
-rw-r--r-- | os/common/ports/e200/compilers/CW/chtypes.h | 24 | ||||
-rw-r--r-- | os/common/ports/e200/compilers/GCC/chtypes.h | 24 | ||||
-rw-r--r-- | os/common/ports/templates/chtypes.h | 20 |
9 files changed, 158 insertions, 50 deletions
diff --git a/os/common/ports/ARM/compilers/GCC/chtypes.h b/os/common/ports/ARM/compilers/GCC/chtypes.h index a34c5bd04..bc0c8dc20 100644 --- a/os/common/ports/ARM/compilers/GCC/chtypes.h +++ b/os/common/ports/ARM/compilers/GCC/chtypes.h @@ -74,14 +74,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
+ * @note If the compiler does not support such attribute then some
+ * time-dependent services could be degraded.
*/
-#define NOINLINE __attribute__((noinline))
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -91,12 +91,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __attribute__((packed))
+#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
#endif /* CHTYPES_H */
diff --git a/os/common/ports/ARMCMx/compilers/GCC/chtypes.h b/os/common/ports/ARMCMx/compilers/GCC/chtypes.h index 8c03899d7..e91763c10 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/chtypes.h +++ b/os/common/ports/ARMCMx/compilers/GCC/chtypes.h @@ -74,14 +74,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
+ * @note If the compiler does not support such attribute then some
+ * time-dependent services could be degraded.
*/
-#define NOINLINE __attribute__((noinline))
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -91,12 +91,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __attribute__((packed))
+#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
#endif /* CHTYPES_H */
diff --git a/os/common/ports/ARMCMx/compilers/IAR/chtypes.h b/os/common/ports/ARMCMx/compilers/IAR/chtypes.h index 1cec367f0..07287e5cc 100644 --- a/os/common/ports/ARMCMx/compilers/IAR/chtypes.h +++ b/os/common/ports/ARMCMx/compilers/IAR/chtypes.h @@ -74,14 +74,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
+ * @note If the compiler does not support such attribute then some
+ * time-dependent services could be degraded.
*/
-#define NOINLINE
+#define NOINLINE _Pragma("inline=never")
/**
* @brief Optimized thread function declaration macro.
@@ -91,12 +91,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __packed
+#define PACKED_VAR __packed
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) _Pragma(__CH_STRINGIFY(data_alignment=##n))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
#endif /* CHTYPES_H */
diff --git a/os/common/ports/ARMCMx/compilers/RVCT/chtypes.h b/os/common/ports/ARMCMx/compilers/RVCT/chtypes.h index 73a960376..0b24b648b 100644 --- a/os/common/ports/ARMCMx/compilers/RVCT/chtypes.h +++ b/os/common/ports/ARMCMx/compilers/RVCT/chtypes.h @@ -74,14 +74,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
+ * @note If the compiler does not support such attribute then some
+ * time-dependent services could be degraded.
*/
-#define NOINLINE
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -91,12 +91,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __packed
+#define PACKED_VAR __packed
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
#endif /* CHTYPES_H */
diff --git a/os/common/ports/AVR/compilers/GCC/chtypes.h b/os/common/ports/AVR/compilers/GCC/chtypes.h index 8222a3f8e..91215dde7 100644 --- a/os/common/ports/AVR/compilers/GCC/chtypes.h +++ b/os/common/ports/AVR/compilers/GCC/chtypes.h @@ -74,14 +74,14 @@ typedef uint8_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
* @note If the compiler does not support such attribute then the
* realtime counter precision could be degraded.
*/
-#define NOINLINE __attribute__((noinline))
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -91,12 +91,24 @@ typedef uint8_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __attribute__((packed))
+#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 2
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
#endif /* CHTYPES_H */
diff --git a/os/common/ports/SIMIA32/compilers/GCC/chtypes.h b/os/common/ports/SIMIA32/compilers/GCC/chtypes.h index db35061be..330c798ab 100644 --- a/os/common/ports/SIMIA32/compilers/GCC/chtypes.h +++ b/os/common/ports/SIMIA32/compilers/GCC/chtypes.h @@ -86,14 +86,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
+ * @note If the compiler does not support such attribute then some
+ * time-dependent services could be degraded.
*/
-#define NOINLINE __attribute__((noinline))
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -103,12 +103,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __attribute__((packed))
+#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
#endif /* CHTYPES_H */
diff --git a/os/common/ports/e200/compilers/CW/chtypes.h b/os/common/ports/e200/compilers/CW/chtypes.h index f8e6f2691..b2c55a5eb 100644 --- a/os/common/ports/e200/compilers/CW/chtypes.h +++ b/os/common/ports/e200/compilers/CW/chtypes.h @@ -74,14 +74,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
+ * @note If the compiler does not support such attribute then some
+ * time-dependent services could be degraded.
*/
-#define NOINLINE __attribute__((noinline))
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -91,12 +91,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __attribute__((packed))
+#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 0
#endif /* CHTYPES_H */
diff --git a/os/common/ports/e200/compilers/GCC/chtypes.h b/os/common/ports/e200/compilers/GCC/chtypes.h index 124874850..20a601e93 100644 --- a/os/common/ports/e200/compilers/GCC/chtypes.h +++ b/os/common/ports/e200/compilers/GCC/chtypes.h @@ -74,14 +74,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
+ * @note If the compiler does not support such attribute then some
+ * time-dependent services could be degraded.
*/
-#define NOINLINE __attribute__((noinline))
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -91,12 +91,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __attribute__((packed))
+#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 0
#endif /* CHTYPES_H */
diff --git a/os/common/ports/templates/chtypes.h b/os/common/ports/templates/chtypes.h index fa63f8898..eb75204c4 100644 --- a/os/common/ports/templates/chtypes.h +++ b/os/common/ports/templates/chtypes.h @@ -78,14 +78,14 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ * @brief ROM constant modifier.
* @note It is set to use the "const" keyword in this port.
*/
-#define ROMCONST const
+#define ROMCONST const
/**
* @brief Makes functions not inlineable.
* @note If the compiler does not support such attribute then the
* realtime counter precision could be degraded.
*/
-#define NOINLINE __attribute__((noinline))
+#define NOINLINE __attribute__((noinline))
/**
* @brief Optimized thread function declaration macro.
@@ -95,12 +95,24 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /**
* @brief Packed variable specifier.
*/
-#define PACKED_VAR __attribute__((packed))
+#define PACKED_VAR __attribute__((packed))
/**
* @brief Memory alignment enforcement for variables.
*/
-#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+#define ALIGNED_VAR(n) __attribute__((aligned(n)))
+
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
#endif /* CHTYPES_H */
|