Skip to content

Implement g_nvic_prio_bits for UVISOR_DISABLED #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2016

Conversation

AlessandroA
Copy link
Contributor

When __uvisor_mode is UVISOR_DISABLED the NVIC APIs are used instead of
the vIRQ ones. Now that those APIs are pre-compiled into a library, the
NVIC APIs use the uVisor built-in definitions from cmsis/core_generic.h.

In that file __NVIC_PRIO_BITS is re-defined as a global variable which
is evaluated at start-up. This behaviour has now been mirrored to the
case of disabled uVisor.

@meriac @Patater

Note: This was previously in a previous PR.

When __uvisor_mode is UVISOR_DISABLED the NVIC APIs are used instead of
the vIRQ ones. Now that those APIs are pre-compiled into a library, the
NVIC APIs use the uVisor built-in definitions from cmsis/core_generic.h.

In that file __NVIC_PRIO_BITS is re-defined as a global variable which
is evaluated at start-up. This behaviour has now been mirrored to the
case of disabled uVisor.

Warning: This is a workaround.

Applications that are written following the uVisor guidelines for the
use of vIRQ APIs will work without problems:
> The vIRQ_SetVector must be used before any other vIRQ API for any given
  IRQn slot.

While this is currently the case for all mbed OS code, it is not
guaranteed to work with new code. For example, if vIRQ_SetPriority is
called before vIRQ_SetVector unpredictable behaviour will follow.

This issue will be fixed by a more generalized approach to disabled
uVisor.
@AlessandroA
Copy link
Contributor Author

@meriac @Patater Commit message updated. The added part (Warning: ...) will be added to a GH issue.

meriac added a commit that referenced this pull request Mar 18, 2016
Implement g_nvic_prio_bits for UVISOR_DISABLED
@meriac meriac merged commit bd7caaf into ARMmbed:master Mar 18, 2016
@AlessandroA AlessandroA deleted the g_nvic_prio branch March 18, 2016 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants