diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-17 23:38:05 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-17 23:38:05 +0000 |
commit | d1a54833aa39c06f38bc656d0811674e9826f7d3 (patch) | |
tree | 4b5911ef52d216a622db785fddf36eb72c5c3512 /nuttx/arch/arm/src/cortexm3/up_initialstate.c | |
parent | 05f9f43d38c58f39c7c62279b6a7d1c848507ade (diff) | |
download | px4-nuttx-d1a54833aa39c06f38bc656d0811674e9826f7d3.tar.gz px4-nuttx-d1a54833aa39c06f38bc656d0811674e9826f7d3.tar.bz2 px4-nuttx-d1a54833aa39c06f38bc656d0811674e9826f7d3.zip |
Integrate PIC support into context switching
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1900 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/cortexm3/up_initialstate.c')
-rw-r--r-- | nuttx/arch/arm/src/cortexm3/up_initialstate.c | 15 |
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 |