summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/armv7-m/up_fpu.S
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-24 18:24:35 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-24 18:24:35 +0000
commit1b4c92672cfd43d05dbee2db143af08ec84d90af (patch)
tree334ac14c141647e11b2ca6f79d362f15dfd727fa /nuttx/arch/arm/src/armv7-m/up_fpu.S
parent200fa47c3ca70ddbb91057823425c252f3985942 (diff)
downloadpx4-nuttx-1b4c92672cfd43d05dbee2db143af08ec84d90af.tar.gz
px4-nuttx-1b4c92672cfd43d05dbee2db143af08ec84d90af.tar.bz2
px4-nuttx-1b4c92672cfd43d05dbee2db143af08ec84d90af.zip
select() fix to handl POLLHUP; STM32 FPU saving in context switches seems to be functional
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4420 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/armv7-m/up_fpu.S')
-rw-r--r--nuttx/arch/arm/src/armv7-m/up_fpu.S29
1 files changed, 21 insertions, 8 deletions
diff --git a/nuttx/arch/arm/src/armv7-m/up_fpu.S b/nuttx/arch/arm/src/armv7-m/up_fpu.S
index ee3644594..fd6449c2f 100644
--- a/nuttx/arch/arm/src/armv7-m/up_fpu.S
+++ b/nuttx/arch/arm/src/armv7-m/up_fpu.S
@@ -95,11 +95,15 @@ up_savefpu:
/* Some older GNU assemblers don't support all the newer UAL mnemonics. */
#if 1 /* Use UAL mnemonics */
- /* Store all floating point registers */
+ /* Store all floating point registers. Registers are stored in numeric order,
+ * s0, s1, ... in increasing address order.
+ */
vstmia r1!, {s0-s31} /* Save the full FP context */
- /* Store the floating point control and status register */
+ /* Store the floating point control and status register. At the end of the
+ * vstmia, r1 will point to the FPCSR storage location.
+ */
vmrs r2, fpscr /* Fetch the FPCSR */
str r2, [r1], #4 /* Save the floating point control and status register */
@@ -180,10 +184,11 @@ up_savefpu:
*
* Input Parameters:
* regs - A pointer to the register save area containing the floating point
- * registers
+ * registers.
*
* Returned Value:
- * None
+ * This function does not return anything explicitly. However, it is called from
+ * interrupt level assembly logic that assumes that r0 is preserved.
*
************************************************************************************/
@@ -196,16 +201,22 @@ up_restorefpu:
/* Some older GNU assemblers don't support all the newer UAL mnemonics. */
#if 1 /* Use UAL mnemonics */
- /* Load all floating point registers */
+ /* Load all floating point registers. Registers are loaded in numeric order,
+ * s0, s1, ... in increasing address order.
+ */
vldmia r1!, {s0-s31} /* Restore the full FP context */
- /* Load the floating point control and status register */
+ /* Load the floating point control and status register. At the end of the
+ * vstmia, r1 will point to the FPCSR storage location.
+ */
ldr r2, [r1], #4 /* Fetch the floating point control and status register */
vmsr fpscr, r2 /* Restore the FPCSR */
#else
- /* Load all floating point registers */
+ /* Load all floating point registers Registers are loaded in numeric order,
+ * s0, s1, ... in increasing address order.
+ */
#if 1 /* Use load multiple */
fldmias r1!, {s0-s31} /* Restore the full FP context */
@@ -260,7 +271,9 @@ up_restorefpu:
vmov d15, r2, r3 /* Save as d15 */
#endif
- /* Load the floating point control and status register */
+ /* Load the floating point control and status register. r1 points t
+ * the address of the FPCSR register.
+ */
ldr r2, [r1], #4 /* Fetch the floating point control and status register */
fmxr fpscr, r2 /* Restore the FPCSR */