diff --git a/ChangeLog b/ChangeLog index c080705a78..2122fa0194 100644 --- a/ChangeLog +++ b/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/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h index 2f0309b4ff..1c172db50a 100644 --- a/arch/arm/src/common/up_internal.h +++ b/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/arch/arm/src/sama5/sam_clockconfig.c b/arch/arm/src/sama5/sam_clockconfig.c index be2138d872..099d5da92d 100644 --- a/arch/arm/src/sama5/sam_clockconfig.c +++ b/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/arch/arm/src/sama5/sam_clockconfig.h b/arch/arm/src/sama5/sam_clockconfig.h index 660d442d72..6c88fdae18 100644 --- a/arch/arm/src/sama5/sam_clockconfig.h +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ ****************************************************************************/ #include +#include "up_internal.h" /**************************************************************************** * Pre-processor Definitions