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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/cortexm3/up_initialstate.c b/nuttx/arch/arm/src/cortexm3/up_initialstate.c
index c529064d4..9bf65bf57 100644
--- a/nuttx/arch/arm/src/cortexm3/up_initialstate.c
+++ b/nuttx/arch/arm/src/cortexm3/up_initialstate.c
@@ -97,6 +97,21 @@ void up_initial_state(_TCB *tcb)
xcp->regs[REG_XPSR] = CORTEXM3_XPSR_T;
+ /* If this task is running PIC, then set the PIC base register to the
+ * address of the allocated D-Space region.
+ */
+
+#ifdef CONFIG_PIC
+ if (tcb->dspace != NULL)
+ {
+ /* Set the PIC base register (probably R10) to the address of the
+ * alloacated D-Space region.
+ */
+
+ xcp->regs[REG_PIC] = (uint32)tcb->dspace->region;
+ }
+#endif
+
/* Enable or disable interrupts, based on user configuration */
# ifdef CONFIG_SUPPRESS_INTERRUPTS