Skip to content

Commit a07c07f

Browse files
author
Steven Cartmell
committed
Update HAL API header information
1 parent 84391f0 commit a07c07f

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

hal/critical_section_api.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ extern "C" {
3333
* This function is called directly by core_util_critical_section_enter on
3434
* first entrance to a critical section.
3535
*
36-
* The default behavior of this function is to save the current state of
37-
* interrupts before disabling them.
36+
* There is a default implementation of this function which will save the
37+
* current state of interrupts before disabling them. This implementation can
38+
* be found in mbed_critical_section_api.c. This behaviour is can be overridden
39+
* on a per platform basis by providing a different implementation within the
40+
* correct targets directory.
3841
*
3942
* The function is only called once per critical section by
4043
* core_util_critical_section_enter. When implementing this function for a
@@ -49,8 +52,11 @@ void hal_critical_section_enter(void);
4952
* This function is called directly by core_util_critical_section_exit on the
5053
* final exit from a critical section.
5154
*
52-
* The default behavior of this function is to restore the state of interrupts
53-
* as they were prior to entering this critical section.
55+
* There is a default implementation of this function, it will restore the
56+
* state of the interrupts as they were prior to entering this critical
57+
* section, this implementation can be found in mbed_critical_section_api.c.
58+
* This behavior is overridable by providing a different function
59+
* implementation within the correct targets directory.
5460
*
5561
* This function is only called once per critical section. When implemented
5662
* for a specific platform it must restore any state that was saved upon

platform/mbed_critical.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ void core_util_critical_section_enter(void)
6161
// FIXME
6262
#ifdef FEATURE_UVISOR
6363
#warning "core_util_critical_section_enter needs fixing to work from unprivileged code"
64-
#endif /* FEATURE_UVISOR */
65-
64+
#else
6665
// If the reentrancy counter overflows something has gone badly wrong.
6766
MBED_ASSERT(critical_section_reentrancy_counter < UINT32_MAX);
67+
#endif /* FEATURE_UVISOR */
6868

6969
if (critical_section_reentrancy_counter == 0) {
7070
hal_critical_section_enter();

0 commit comments

Comments
 (0)