diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-04-17 08:56:20 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-04-17 08:56:20 -0600 |
commit | 935fad106477360189d20ac619d76d86109742d6 (patch) | |
tree | ad8abde80f9303384cab7881a855edd6a6af6d3f | |
parent | 688a7943504c5f4163df760024de40305c0b70ed (diff) | |
download | px4-nuttx-935fad106477360189d20ac619d76d86109742d6.tar.gz px4-nuttx-935fad106477360189d20ac619d76d86109742d6.tar.bz2 px4-nuttx-935fad106477360189d20ac619d76d86109742d6.zip |
Move the un-definitions of __ramfuncs__ from the sam_clockconfig.c to the common up_internal.h header file so that the attribute will be applied the same to function definitions and prototypes.
-rw-r--r-- | nuttx/ChangeLog | 6 | ||||
-rw-r--r-- | nuttx/arch/arm/src/common/up_internal.h | 10 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_clockconfig.c | 5 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sama5/sam_clockconfig.h | 3 |
4 files changed, 15 insertions, 9 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index c080705a7..2122fa019 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -7179,5 +7179,7 @@ Duckworth (2014-4-16). * arch/arm/src/stm32/chip/stm32f20xxx_pinmap.h: Correct a mapping for SPI MOSI pin. From dlsitzer (2014-4-26). - - + * arm/src/sama5/sam_clockconfig.c/.h: Move the un-definitions of + __ramfuncs__ from the .c file to the .h file or, otherwise, the + attribute will be applied differently for the prototype and the + function definition. Sourceforge patch 38 from Luciano Neri (2014-4-17). diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h index 2f0309b4f..1c172db50 100644 --- a/nuttx/arch/arm/src/common/up_internal.h +++ b/nuttx/arch/arm/src/common/up_internal.h @@ -253,7 +253,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ # define __ramfunc__ __attribute__ ((section(".ramfunc"),long_call)) -/* Functions decleared in the .ramfunc section will be packaged together +/* Functions declared in the .ramfunc section will be packaged together * by the linker script and stored in FLASH. During boot-up, the start * logic must include logic to copy the RAM functions from their storage * location in FLASH to their correct destination in SRAM. The following @@ -265,6 +265,14 @@ extern const uint32_t _framfuncs; /* Copy source address in FLASH */ extern uint32_t _sramfuncs; /* Copy destination start address in RAM */ extern uint32_t _eramfuncs; /* Copy destination end address in RAM */ +#else /* CONFIG_ARCH_RAMFUNCS */ + +/* Otherwise, a null definition is provided so that condition compilation is + * not necessary in code that may operate with or without RAM functions. + */ + +# define __ramfunc__ + #endif /* CONFIG_ARCH_RAMFUNCS */ #endif /* __ASSEMBLY__ */ diff --git a/nuttx/arch/arm/src/sama5/sam_clockconfig.c b/nuttx/arch/arm/src/sama5/sam_clockconfig.c index be2138d87..099d5da92 100644 --- a/nuttx/arch/arm/src/sama5/sam_clockconfig.c +++ b/nuttx/arch/arm/src/sama5/sam_clockconfig.c @@ -75,11 +75,6 @@ # error "CONFIG_ARCH_RAMFUNCS must be defined for this logic" #endif -#ifndef CONFIG_ARCH_RAMFUNCS -# undef __ramfunc__ -# define __ramfunc__ -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/nuttx/arch/arm/src/sama5/sam_clockconfig.h b/nuttx/arch/arm/src/sama5/sam_clockconfig.h index 660d442d7..6c88fdae1 100644 --- a/nuttx/arch/arm/src/sama5/sam_clockconfig.h +++ b/nuttx/arch/arm/src/sama5/sam_clockconfig.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/sama5/sam_clockconfig.h * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ ****************************************************************************/ #include <nuttx/config.h> +#include "up_internal.h" /**************************************************************************** * Pre-processor Definitions |