summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/common/up_internal.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-26 19:55:12 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-02-26 19:55:12 +0000
commit72bbeebe973f7313f3675533d8d19b382c8b1ac9 (patch)
tree96b2b0980e32198737475000aae4e3ed9ad264ce /nuttx/arch/arm/src/common/up_internal.h
parentd681635b85e4a498dafd8822af19e0d5cd7f8f2f (diff)
downloadpx4-nuttx-72bbeebe973f7313f3675533d8d19b382c8b1ac9.tar.gz
px4-nuttx-72bbeebe973f7313f3675533d8d19b382c8b1ac9.tar.bz2
px4-nuttx-72bbeebe973f7313f3675533d8d19b382c8b1ac9.zip
Another Cortex-M0 fix
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5676 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/common/up_internal.h')
-rw-r--r--nuttx/arch/arm/src/common/up_internal.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h
index 87fad04bd..6e874b2ca 100644
--- a/nuttx/arch/arm/src/common/up_internal.h
+++ b/nuttx/arch/arm/src/common/up_internal.h
@@ -112,11 +112,15 @@
/* Macros to handle saving and restoring interrupt state. In the current ARM
* model, the state is always copied to and from the stack and TCB. In the
- * Cortex-M3 model, the state is copied from the stack to the TCB, but only
- * a referenced is passed to get the state from the TCB.
+ * Cortex-M0/3 model, the state is copied from the stack to the TCB, but only
+ * a referenced is passed to get the state from the TCB. Cortex-M4 is the
+ * same, but may have additional complexity for floating point support in
+ * some configurations.
*/
-#if defined(CONFIG_ARCH_CORTEXM3) || defined(CONFIG_ARCH_CORTEXM4)
+#if defined(CONFIG_ARCH_CORTEXM0) || defined(CONFIG_ARCH_CORTEXM3) || \
+ defined(CONFIG_ARCH_CORTEXM4)
+
# if defined(CONFIG_ARCH_FPU) && !defined(CONFIG_ARMV7M_CMNVECTOR)
# define up_savestate(regs) \
do { \
@@ -128,9 +132,12 @@
# define up_savestate(regs) up_copystate(regs, (uint32_t*)current_regs)
# endif
# define up_restorestate(regs) (current_regs = regs)
+
#else
+
# define up_savestate(regs) up_copystate(regs, (uint32_t*)current_regs)
# define up_restorestate(regs) up_copystate((uint32_t*)current_regs, regs)
+
#endif
/****************************************************************************
@@ -164,7 +171,8 @@ extern const uint32_t g_heapbase;
/* Address of the saved user stack pointer */
#if CONFIG_ARCH_INTERRUPTSTACK > 3
-#if defined(CONFIG_ARCH_CORTEXM3) || defined(CONFIG_ARCH_CORTEXM4)
+#if defined(CONFIG_ARCH_CORTEXM0) || defined(CONFIG_ARCH_CORTEXM3) || \
+ defined(CONFIG_ARCH_CORTEXM4)
extern uint32_t g_intstackbase;
# else
extern uint32_t g_userstack;
@@ -254,7 +262,8 @@ void up_pminitialize(void);
# define up_pminitialize()
#endif
-#if defined(CONFIG_ARCH_CORTEXM3) || defined(CONFIG_ARCH_CORTEXM4)
+#if defined(CONFIG_ARCH_CORTEXM0) || defined(CONFIG_ARCH_CORTEXM3) || \
+ defined(CONFIG_ARCH_CORTEXM4)
void up_systemreset(void) noreturn_function;
#endif
@@ -290,7 +299,7 @@ void up_prefetchabort(uint32_t *regs);
void up_syscall(uint32_t *regs);
void up_undefinedinsn(uint32_t *regs);
-#endif /* CONFIG_ARCH_CORTEXM3 || CONFIG_ARCH_CORTEXM4 */
+#endif /* CONFIG_ARCH_CORTEXM0 || CONFIG_ARCH_CORTEXM3 || CONFIG_ARCH_CORTEXM4 */
void up_vectorundefinsn(void);
void up_vectorswi(void);