mirror of https://github.com/ARMmbed/mbed-os.git
Remove invalid assert and move uVisor warning to correct function
parent
3c9ae7bf1c
commit
84391f0b64
|
@ -36,27 +36,14 @@ MBED_WEAK void hal_critical_section_enter(void)
|
||||||
{
|
{
|
||||||
critical_interrupts_enabled = are_interrupts_enabled();
|
critical_interrupts_enabled = are_interrupts_enabled();
|
||||||
|
|
||||||
#ifndef FEATURE_UVISOR
|
|
||||||
// If we are in a nested critical section and interrupts are still enabled
|
|
||||||
// something has gone wrong.
|
|
||||||
MBED_ASSERT(!are_interrupts_enabled());
|
|
||||||
#else
|
|
||||||
#warning "core_util_critical_section_enter needs fixing to work from unprivileged code"
|
|
||||||
#endif /* FEATURE_UVISOR */
|
|
||||||
|
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MBED_WEAK void hal_critical_section_exit()
|
MBED_WEAK void hal_critical_section_exit()
|
||||||
{
|
{
|
||||||
// FIXME
|
|
||||||
#ifndef FEATURE_UVISOR
|
|
||||||
// Interrupts must be disabled on invoking an exit from a critical section
|
// Interrupts must be disabled on invoking an exit from a critical section
|
||||||
MBED_ASSERT(!are_interrupts_enabled());
|
MBED_ASSERT(!are_interrupts_enabled());
|
||||||
#else
|
|
||||||
#warning "core_util_critical_section_exit needs fixing to work from unprivileged code"
|
|
||||||
#endif /* FEATURE_UVISOR */
|
|
||||||
|
|
||||||
// Restore the IRQs to their state prior to entering the critical section
|
// Restore the IRQs to their state prior to entering the critical section
|
||||||
if (critical_interrupts_enabled == true) {
|
if (critical_interrupts_enabled == true) {
|
||||||
|
|
|
@ -58,6 +58,11 @@ bool core_util_in_critical_section(void)
|
||||||
|
|
||||||
void core_util_critical_section_enter(void)
|
void core_util_critical_section_enter(void)
|
||||||
{
|
{
|
||||||
|
// FIXME
|
||||||
|
#ifdef FEATURE_UVISOR
|
||||||
|
#warning "core_util_critical_section_enter needs fixing to work from unprivileged code"
|
||||||
|
#endif /* FEATURE_UVISOR */
|
||||||
|
|
||||||
// If the reentrancy counter overflows something has gone badly wrong.
|
// If the reentrancy counter overflows something has gone badly wrong.
|
||||||
MBED_ASSERT(critical_section_reentrancy_counter < UINT32_MAX);
|
MBED_ASSERT(critical_section_reentrancy_counter < UINT32_MAX);
|
||||||
|
|
||||||
|
@ -70,6 +75,11 @@ void core_util_critical_section_enter(void)
|
||||||
|
|
||||||
void core_util_critical_section_exit(void)
|
void core_util_critical_section_exit(void)
|
||||||
{
|
{
|
||||||
|
// FIXME
|
||||||
|
#ifdef FEATURE_UVISOR
|
||||||
|
#warning "core_util_critical_section_exit needs fixing to work from unprivileged code"
|
||||||
|
#endif /* FEATURE_UVISOR */
|
||||||
|
|
||||||
// If critical_section_enter has not previously been called, do nothing
|
// If critical_section_enter has not previously been called, do nothing
|
||||||
if (critical_section_reentrancy_counter == 0) {
|
if (critical_section_reentrancy_counter == 0) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue