More infos in chtypes.h.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9292 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-04-16 16:12:51 +00:00
parent 9d3bca73d4
commit d57f928014
9 changed files with 158 additions and 50 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */