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.

This commit is contained in:
Gregory Nutt 2014-04-17 08:56:20 -06:00
parent 9efb83c5ab
commit 3133ebfcee
4 changed files with 15 additions and 9 deletions

View File

@ -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).

View File

@ -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__ */

View File

@ -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
****************************************************************************/

View File

@ -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