|
|
|
@ -1,8 +1,8 @@
@@ -1,8 +1,8 @@
|
|
|
|
|
/************************************************************************************
|
|
|
|
|
* configs/stm32f4discovery/src/up_cxxinitialize.c |
|
|
|
|
* src/modules/systemlib/up_cxxinitialize.c |
|
|
|
|
* arch/arm/src/board/up_cxxinitialize.c |
|
|
|
|
* |
|
|
|
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved. |
|
|
|
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved. |
|
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org> |
|
|
|
|
* |
|
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
|
@ -54,25 +54,12 @@
@@ -54,25 +54,12 @@
|
|
|
|
|
/* Debug ****************************************************************************/ |
|
|
|
|
/* Non-standard debug that may be enabled just for testing the static constructors */ |
|
|
|
|
|
|
|
|
|
#ifndef CONFIG_DEBUG |
|
|
|
|
#undef CONFIG_DEBUG_CXX |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_CXX |
|
|
|
|
# define cxxdbg dbg |
|
|
|
|
# define cxxlldbg lldbg |
|
|
|
|
# ifdef CONFIG_DEBUG_VERBOSE |
|
|
|
|
# define cxxvdbg vdbg |
|
|
|
|
# define cxxllvdbg llvdbg |
|
|
|
|
# else |
|
|
|
|
# define cxxvdbg(x...) |
|
|
|
|
# define cxxllvdbg(x...) |
|
|
|
|
# endif |
|
|
|
|
# define cxxinfo _info |
|
|
|
|
# else |
|
|
|
|
# define cxxdbg(x...) |
|
|
|
|
# define cxxlldbg(x...) |
|
|
|
|
# define cxxvdbg(x...) |
|
|
|
|
# define cxxllvdbg(x...) |
|
|
|
|
# define cxxinfo(x...) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/************************************************************************************
|
|
|
|
@ -128,14 +115,14 @@ void up_cxxinitialize(void)
@@ -128,14 +115,14 @@ void up_cxxinitialize(void)
|
|
|
|
|
{ |
|
|
|
|
initializer_t *initp; |
|
|
|
|
|
|
|
|
|
cxxdbg("_sinit: %p _einit: %p _stext: %p _etext: %p\n", |
|
|
|
|
cxxinfo("_sinit: %p _einit: %p _stext: %p _etext: %p\n", |
|
|
|
|
&_sinit, &_einit, &_stext, &_etext); |
|
|
|
|
|
|
|
|
|
/* Visit each entry in the initialzation table */ |
|
|
|
|
|
|
|
|
|
for (initp = &_sinit; initp != &_einit; initp++) { |
|
|
|
|
initializer_t initializer = *initp; |
|
|
|
|
cxxdbg("initp: %p initializer: %p\n", initp, initializer); |
|
|
|
|
cxxinfo("initp: %p initializer: %p\n", initp, initializer); |
|
|
|
|
|
|
|
|
|
/* Make sure that the address is non-NULL and lies in the text region
|
|
|
|
|
* defined by the linker script. Some toolchains may put NULL values |
|
|
|
@ -143,7 +130,7 @@ void up_cxxinitialize(void)
@@ -143,7 +130,7 @@ void up_cxxinitialize(void)
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
if ((void *)initializer > (void *)&_stext && (void *)initializer < (void *)&_etext) { |
|
|
|
|
cxxdbg("Calling %p\n", initializer); |
|
|
|
|
cxxinfo("Calling %p\n", initializer); |
|
|
|
|
initializer(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|