summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/cortexm3/up_initialstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src/cortexm3/up_initialstate.c')
-rw-r--r--nuttx/arch/arm/src/cortexm3/up_initialstate.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/cortexm3/up_initialstate.c b/nuttx/arch/arm/src/cortexm3/up_initialstate.c
index 9bf65bf57..951ce1a95 100644
--- a/nuttx/arch/arm/src/cortexm3/up_initialstate.c
+++ b/nuttx/arch/arm/src/cortexm3/up_initialstate.c
@@ -110,6 +110,16 @@ void up_initial_state(_TCB *tcb)
xcp->regs[REG_PIC] = (uint32)tcb->dspace->region;
}
+
+ /* Make certain that bit 0 is set in the main entry address. This
+ * is only an issue when NXFLAT is enabled. NXFLAT doesn't know
+ * anything about thumb; the addresses that NXFLAT sets are based
+ * on file header info and won't have bit 0 set.
+ */
+
+#ifdef CONFIG_NXFLAT
+ tcb->entry.main = (main_t)((uint32)tcb->entry.main | 1);
+#endif
#endif
/* Enable or disable interrupts, based on user configuration */