diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-07 18:58:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-07 18:58:21 +0000 |
commit | 3e2d87c22ade20620724b7696e763a800e320cdc (patch) | |
tree | 197ae7885c03edbda5fc8fc0c8578d3a6ec6b94b /nuttx/arch/arm/src/common | |
parent | df19be6fa87a092e5ed5cd96ec59640b59afc69e (diff) | |
download | px4-nuttx-3e2d87c22ade20620724b7696e763a800e320cdc.tar.gz px4-nuttx-3e2d87c22ade20620724b7696e763a800e320cdc.tar.bz2 px4-nuttx-3e2d87c22ade20620724b7696e763a800e320cdc.zip |
Add support for the Cortex-M4 floating pointing
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4144 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/common')
-rw-r--r-- | nuttx/arch/arm/src/common/up_internal.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h index a22855ba7..c90f49a3d 100644 --- a/nuttx/arch/arm/src/common/up_internal.h +++ b/nuttx/arch/arm/src/common/up_internal.h @@ -2,7 +2,7 @@ * common/up_internal.h * * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -76,14 +76,23 @@ # define CONFIG_ARCH_INTERRUPTSTACK 0 #endif -/* Macros to handle saving and restore interrupt state. In the current ARM +/* 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. */ #if defined(CONFIG_ARCH_CORTEXM3) || defined(CONFIG_ARCH_CORTEXM4) -# define up_savestate(regs) up_copystate(regs, (uint32_t*)current_regs) +# ifdef CONFIG_ARCH_FPU +# define up_savestate(regs) \ + do { \ + up_copystate(regs, (uint32_t*)current_regs); \ + up_savefpu(regs); \ + } \ + while (0) +# else +# 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) @@ -240,6 +249,16 @@ extern void up_vectoraddrexcptn(void); extern void up_vectorirq(void); extern void up_vectorfiq(void); +/* Floating point unit ******************************************************/ + +#ifdef CONFIG_ARCH_FPU +extern void up_savefpu(uint32_t *regs); +extern void up_restorefpu(const uint32_t *regs); +#else +# define up_savefpu(regs) +# define up_restorefpu(regs) +#endif + /* System timer *************************************************************/ extern void up_timerinit(void); |