Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions os/common/startup/ARMCMx/compilers/GCC/crt0_v6m.S
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@
#define CRT0_CALL_DESTRUCTORS TRUE
#endif

/**
* @brief Entry Hook Enabled.
*/
#if !defined(CRT0_ENTRY_HOOK) || defined(__DOXYGEN__)
#define CRT0_ENTRY_HOOK FALSE
#endif

/**
* @brief Number of extra cores.
*/
Expand All @@ -163,6 +170,10 @@
.thumb_func
.global _crt0_entry
_crt0_entry:
#if CRT0_ENTRY_HOOK == TRUE
ldr R0, =__entry_hook
blx R0
#endif
/* Interrupts are globally masked initially.*/
cpsid i

Expand Down
11 changes: 11 additions & 0 deletions os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@
#define CRT0_CPACR_INIT 0x00F00000
#endif

/**
* @brief Entry Hook Enabled.
*/
#if !defined(CRT0_ENTRY_HOOK) || defined(__DOXYGEN__)
#define CRT0_ENTRY_HOOK FALSE
#endif

/*===========================================================================*/
/* Code section. */
/*===========================================================================*/
Expand All @@ -201,6 +208,10 @@
.thumb_func
.global _crt0_entry
_crt0_entry:
#if CRT0_ENTRY_HOOK == TRUE
ldr R0, =__entry_hook
blx R0
#endif
/* Interrupts are globally masked initially.*/
cpsid i

Expand Down
14 changes: 14 additions & 0 deletions os/common/startup/ARMCMx/compilers/GCC/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ void __cpu_init(void) {
#endif
}

/**
* @brief called immediately at Reset
* @details This hook is invoked immediately after the Reset Handler
*
* @note This function is a weak symbol.
*/
#if !defined(__DOXYGEN__)
__attribute__((weak))
#endif
/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
#ifndef _ARDUPILOT_
void __entry_hook(void) {}
#endif

/**
* @brief Early initialization.
* @details This hook is invoked immediately after the stack and core
Expand Down