Skip to content

Commit

Permalink
Return immediately in main_entry if UVISOR_DISABLED
Browse files Browse the repository at this point in the history
This ensures that applications can run in debug mode with uVisor
disabled. Semihosting is still a requirement for applications that run
with uVisor enabled.
  • Loading branch information
AlessandroA committed Apr 1, 2016
1 parent 54fe069 commit eab5558
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/system/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ UVISOR_NOINLINE void uvisor_init_post(void)

void main_entry(void)
{
/* Return immediately if the magic is invalid or uVisor is disabled.
* This ensures that no uVisor feature that could halt the system is
* active in disabled mode (for example, printing debug messages to the
* semihosting port). */
if (__uvisor_config.magic != UVISOR_MAGIC || !__uvisor_config.mode || *(__uvisor_config.mode) == 0) {
return;
}

/* initialize uvisor */
uvisor_init_pre();

Expand Down

0 comments on commit eab5558

Please sign in to comment.