diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-04-02 08:19:53 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-04-02 08:19:53 +0000 |
commit | ee8e0c61f9fd4e8c496b13ac47179c9621206db6 (patch) | |
tree | 4cf6d41a581f0bfd2db64a71cd8e9c103201e544 /os | |
parent | c047b2198006076a00ebfe9cff9e8537aeb8ca96 (diff) | |
download | ChibiOS-ee8e0c61f9fd4e8c496b13ac47179c9621206db6.tar.gz ChibiOS-ee8e0c61f9fd4e8c496b13ac47179c9621206db6.tar.bz2 ChibiOS-ee8e0c61f9fd4e8c496b13ac47179c9621206db6.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1826 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/ports/GCC/ARMCMx/chcore.h | 30 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/chcore_v6m.h | 20 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/chcore_v7m.h | 20 |
3 files changed, 27 insertions, 43 deletions
diff --git a/os/ports/GCC/ARMCMx/chcore.h b/os/ports/GCC/ARMCMx/chcore.h index 5d45b00fd..224d09c68 100644 --- a/os/ports/GCC/ARMCMx/chcore.h +++ b/os/ports/GCC/ARMCMx/chcore.h @@ -73,7 +73,8 @@ #define CORTEX_MAXIMUM_PRIORITY 0
/**
- * @brief Disabled value for BASEPRI register. + * @brief Disabled value for BASEPRI register.
+ * @note ARMv7-M architecture only. */
#define CORTEX_BASEPRI_DISABLED 0
@@ -155,7 +156,9 @@ /**
* @brief BASEPRI level within kernel lock.
- * @note This value must not mask the SVCALL priority level.
+ * @note This value must not mask the SVCALL priority level or the
+ * kernel would hard fault.
+ * @note ARMv7-M architecture only.
*/
#ifndef CORTEX_BASEPRI_KERNEL
#define CORTEX_BASEPRI_KERNEL CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1)
@@ -204,7 +207,7 @@ #endif
/*===========================================================================*/
-/* Port implementation part. */
+/* Port implementation part (common). */
/*===========================================================================*/
/**
@@ -228,6 +231,27 @@ struct context { };
#endif
+/**
+ * @brief Enforces a correct alignment for a stack area size value.
+ */
+#define STACK_ALIGN(n) ((((n) - 1) | (sizeof(stkalign_t) - 1)) + 1)
+
+/**
+ * @brief Computes the thread working area global size.
+ */
+#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
+ sizeof(struct intctx) + \
+ sizeof(struct extctx) + \
+ (n) + (INT_REQUIRED_STACK))
+
+/**
+ * @brief Static working area allocation.
+ * @details This macro is used to allocate a static thread working area
+ * aligned as both position and size.
+ */
+#define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)];
+
+/* Includes the architecture-specific implementation part.*/
#if defined(CH_ARCHITECTURE_ARM_v6M)
#include "chcore_v6m.h"
#elif defined(CH_ARCHITECTURE_ARM_v7M)
diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h index 7aff774bc..f031f6272 100644 --- a/os/ports/GCC/ARMCMx/chcore_v6m.h +++ b/os/ports/GCC/ARMCMx/chcore_v6m.h @@ -124,26 +124,6 @@ struct intctx { #endif
/**
- * @brief Enforces a correct alignment for a stack area size value.
- */
-#define STACK_ALIGN(n) ((((n) - 1) | (sizeof(stkalign_t) - 1)) + 1)
-
-/**
- * @brief Computes the thread working area global size.
- */
-#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
- sizeof(struct intctx) + \
- sizeof(struct extctx) + \
- (n) + (INT_REQUIRED_STACK))
-
-/**
- * @brief Static working area allocation.
- * @details This macro is used to allocate a static thread working area
- * aligned as both position and size.
- */
-#define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)];
-
-/**
* @brief IRQ prologue code.
* @details This macro must be inserted at the start of all IRQ handlers
* enabled to invoke system APIs.
diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h index 804f6357e..b575376ea 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/chcore_v7m.h @@ -117,26 +117,6 @@ struct intctx { #endif
/**
- * @brief Enforces a correct alignment for a stack area size value.
- */
-#define STACK_ALIGN(n) ((((n) - 1) | (sizeof(stkalign_t) - 1)) + 1)
-
-/**
- * @brief Computes the thread working area global size.
- */
-#define THD_WA_SIZE(n) STACK_ALIGN(sizeof(Thread) + \
- sizeof(struct intctx) + \
- sizeof(struct extctx) + \
- (n) + (INT_REQUIRED_STACK))
-
-/**
- * @brief Static working area allocation.
- * @details This macro is used to allocate a static thread working area
- * aligned as both position and size.
- */
-#define WORKING_AREA(s, n) stkalign_t s[THD_WA_SIZE(n) / sizeof(stkalign_t)];
-
-/**
* @brief IRQ prologue code.
* @details This macro must be inserted at the start of all IRQ handlers
* enabled to invoke system APIs.
|