diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-12-07 18:58:21 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-12-07 18:58:21 +0000 |
commit | eb6f9511569dc0156fdcad88f9d21e0ae352b63a (patch) | |
tree | 197ae7885c03edbda5fc8fc0c8578d3a6ec6b94b /nuttx/arch/arm/src/common | |
parent | 5898e4fc6d4bcaf4b570039dbd8d3aca94fddbb0 (diff) |
Add support for the Cortex-M4 floating pointing
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4144 7fd9a85b-ad96-42d3-883c-3090e2eb8679
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 a22855ba7f..c90f49a3d1 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); |