From faeaa54925e0a6fa197c48faf6317a86824f64d7 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 24 Oct 2019 11:07:52 -0400 Subject: armcm_boot: Use armcm_main() instead of main() to start board code The main() function has a special meaning to gcc and using it can result in different code generation. Use armcm_main() to avoid that. Also, invoke SystemInit() from the board specific armcm_main() code. This gives the board code more control over board initialization. Signed-off-by: Kevin O'Connor --- src/generic/armcm_boot.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/generic/armcm_boot.c') diff --git a/src/generic/armcm_boot.c b/src/generic/armcm_boot.c index ad7461ca..261fb912 100644 --- a/src/generic/armcm_boot.c +++ b/src/generic/armcm_boot.c @@ -6,8 +6,8 @@ #include "armcm_boot.h" // DECL_ARMCM_IRQ #include "autoconf.h" // CONFIG_MCU -#include "board/internal.h" // SystemInit #include "command.h" // DECL_CONSTANT_STR +#include "misc.h" // dynmem_start // Export MCU type DECL_CONSTANT_STR("MCU", CONFIG_MCU); @@ -37,14 +37,10 @@ ResetHandler(void) // Initializing the C library isn't needed... //__libc_init_array(); - // Initialize the machine - SystemInit(); + // Run the main board specific code + armcm_main(); - // Run the main code - extern int main(void); - main(); - - // The main() call should not return + // The armcm_main() call should not return for (;;) ; } -- cgit v1.2.3-70-g09d2