Skip to content

Commit 9e4a479

Browse files
committed
Add prefix to mark cmsis_os functions as private
Add a leading underscore to give an indication that the new cmsis_os API functions are not official.
1 parent 1921b1a commit 9e4a479

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

features/frameworks/greentea-client/source/greentea_metrics.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ MBED_UNUSED static void send_stack_info()
8181
}
8282

8383
// Print info for all other threads
84-
osThreadEnumId enum_id = osThreadsEnumStart();
84+
osThreadEnumId enum_id = _osThreadsEnumStart();
8585
while (true) {
86-
osThreadId thread_id = osThreadEnumNext(enum_id);
86+
osThreadId thread_id = _osThreadEnumNext(enum_id);
8787
if (NULL == thread_id) {
8888
// End of enumeration
8989
break;
9090
}
9191
enqeue_thread_info(thread_id);
9292
deque_and_print_thread_info();
9393
}
94-
osThreadEnumFree(enum_id);
94+
_osThreadEnumFree(enum_id);
9595

9696
mutex->unlock();
9797
}
@@ -115,22 +115,22 @@ static void enqeue_thread_info(osThreadId id)
115115
{
116116
osEvent info;
117117
thread_info_t thread_info = {};
118-
info = osThreadGetInfo(id, osThreadInfoEntry);
118+
info = _osThreadGetInfo(id, osThreadInfoEntry);
119119
if (info.status != osOK) {
120120
return;
121121
}
122122
thread_info.entry = (uint32_t)info.value.p;
123-
info = osThreadGetInfo(id, osThreadInfoArg);
123+
info = _osThreadGetInfo(id, osThreadInfoArg);
124124
if (info.status != osOK) {
125125
return;
126126
}
127127
thread_info.arg = (uint32_t)info.value.p;
128-
info = osThreadGetInfo(id, osThreadInfoStackSize);
128+
info = _osThreadGetInfo(id, osThreadInfoStackSize);
129129
if (info.status != osOK) {
130130
return;
131131
}
132132
thread_info.stack_size = (uint32_t)info.value.v;
133-
info = osThreadGetInfo(id, osThreadInfoStackMax);
133+
info = _osThreadGetInfo(id, osThreadInfoStackMax);
134134
if (info.status != osOK) {
135135
return;
136136
}

rtos/rtx/TARGET_CORTEX_A/cmsis_os.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ uint8_t osThreadGetState (osThreadId thread_id);
466466
/// \param[in] info information to read.
467467
/// \return current state of the thread function.
468468
/// \return requested info that includes the status code.
469-
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info);
469+
os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info);
470470

471471
// ==== Generic Wait Functions ====
472472

@@ -849,16 +849,16 @@ osStatus osMailFree (osMailQId queue_id, void *mail);
849849

850850
/// Start a thread enumeration.
851851
/// \return an enumeration ID or NULL on error.
852-
osThreadEnumId osThreadsEnumStart(void);
852+
osThreadEnumId _osThreadsEnumStart(void);
853853

854854
/// Get the next task ID in the enumeration.
855855
/// \return a thread ID or NULL on if the end of the enumeration has been reached.
856-
osThreadId osThreadEnumNext(osThreadEnumId enum_id);
856+
osThreadId _osThreadEnumNext(osThreadEnumId enum_id);
857857

858858
/// Free the enumeration structure.
859-
/// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref osThreadsEnumStart.
859+
/// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref _osThreadsEnumStart.
860860
/// \return status code that indicates the execution status of the function.
861-
osStatus osThreadEnumFree(osThreadEnumId enum_id);
861+
osStatus _osThreadEnumFree(osThreadEnumId enum_id);
862862

863863
#endif // Thread Enumeration available
864864

rtos/rtx/TARGET_CORTEX_A/rt_CMSIS.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ uint8_t osThreadGetState (osThreadId thread_id) {
10111011
#endif
10121012

10131013
/// Get the requested info from the specified active thread
1014-
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
1014+
os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
10151015
osEvent ret;
10161016
if (__exceptional_mode()) {
10171017
ret.status = osErrorISR;
@@ -1020,14 +1020,14 @@ os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
10201020
return __svcThreadGetInfo(thread_id, info);
10211021
}
10221022

1023-
osThreadEnumId osThreadsEnumStart() {
1023+
osThreadEnumId _osThreadsEnumStart() {
10241024
static uint32_t thread_enum_index;
10251025
osMutexWait(osMutexId_osThreadMutex, osWaitForever);
10261026
thread_enum_index = 0;
10271027
return &thread_enum_index;
10281028
}
10291029

1030-
osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
1030+
osThreadId _osThreadEnumNext(osThreadEnumId enum_id) {
10311031
uint32_t i;
10321032
osThreadId id = NULL;
10331033
uint32_t *index = (uint32_t*)enum_id;
@@ -1045,7 +1045,7 @@ osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
10451045
return id;
10461046
}
10471047

1048-
osStatus osThreadEnumFree(osThreadEnumId enum_id) {
1048+
osStatus _osThreadEnumFree(osThreadEnumId enum_id) {
10491049
uint32_t *index = (uint32_t*)enum_id;
10501050
*index = 0;
10511051
osMutexRelease(osMutexId_osThreadMutex);

rtos/rtx/TARGET_CORTEX_M/cmsis_os.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ uint8_t osThreadGetState (osThreadId thread_id);
376376
/// \param[in] info information to read.
377377
/// \return current state of the thread function.
378378
/// \return requested info that includes the status code.
379-
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info);
379+
os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info);
380380

381381
// ==== Generic Wait Functions ====
382382

@@ -706,16 +706,16 @@ osStatus osMailFree (osMailQId queue_id, void *mail);
706706

707707
/// Start a thread enumeration.
708708
/// \return an enumeration ID or NULL on error.
709-
osThreadEnumId osThreadsEnumStart(void);
709+
osThreadEnumId _osThreadsEnumStart(void);
710710

711711
/// Get the next task ID in the enumeration.
712712
/// \return a thread ID or NULL on if the end of the enumeration has been reached.
713-
osThreadId osThreadEnumNext(osThreadEnumId enum_id);
713+
osThreadId _osThreadEnumNext(osThreadEnumId enum_id);
714714

715715
/// Free the enumeration structure.
716-
/// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref osThreadsEnumStart.
716+
/// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref _osThreadsEnumStart.
717717
/// \return status code that indicates the execution status of the function.
718-
osStatus osThreadEnumFree(osThreadEnumId enum_id);
718+
osStatus _osThreadEnumFree(osThreadEnumId enum_id);
719719

720720
#endif // Thread Enumeration available
721721

rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ uint8_t osThreadGetState (osThreadId thread_id) {
958958
#endif
959959

960960
/// Get the requested info from the specified active thread
961-
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
961+
os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
962962
osEvent ret;
963963

964964
if (__get_IPSR() != 0U) { // Not allowed in ISR
@@ -968,14 +968,14 @@ os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
968968
return __svcThreadGetInfo(thread_id, info);
969969
}
970970

971-
osThreadEnumId osThreadsEnumStart() {
971+
osThreadEnumId _osThreadsEnumStart() {
972972
static uint32_t thread_enum_index;
973973
osMutexWait(osMutexId_osThreadMutex, osWaitForever);
974974
thread_enum_index = 0;
975975
return &thread_enum_index;
976976
}
977977

978-
osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
978+
osThreadId _osThreadEnumNext(osThreadEnumId enum_id) {
979979
uint32_t i;
980980
osThreadId id = NULL;
981981
uint32_t *index = (uint32_t*)enum_id;
@@ -993,7 +993,7 @@ osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
993993
return id;
994994
}
995995

996-
osStatus osThreadEnumFree(osThreadEnumId enum_id) {
996+
osStatus _osThreadEnumFree(osThreadEnumId enum_id) {
997997
uint32_t *index = (uint32_t*)enum_id;
998998
*index = 0;
999999
osMutexRelease(osMutexId_osThreadMutex);

0 commit comments

Comments
 (0)