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.
pull/2642/head
Russ Butler 2016-09-13 15:42:04 -05:00
parent 1921b1aa96
commit 9e4a479794
5 changed files with 25 additions and 25 deletions

View File

@ -81,9 +81,9 @@ MBED_UNUSED static void send_stack_info()
} }
// Print info for all other threads // Print info for all other threads
osThreadEnumId enum_id = osThreadsEnumStart(); osThreadEnumId enum_id = _osThreadsEnumStart();
while (true) { while (true) {
osThreadId thread_id = osThreadEnumNext(enum_id); osThreadId thread_id = _osThreadEnumNext(enum_id);
if (NULL == thread_id) { if (NULL == thread_id) {
// End of enumeration // End of enumeration
break; break;
@ -91,7 +91,7 @@ MBED_UNUSED static void send_stack_info()
enqeue_thread_info(thread_id); enqeue_thread_info(thread_id);
deque_and_print_thread_info(); deque_and_print_thread_info();
} }
osThreadEnumFree(enum_id); _osThreadEnumFree(enum_id);
mutex->unlock(); mutex->unlock();
} }
@ -115,22 +115,22 @@ static void enqeue_thread_info(osThreadId id)
{ {
osEvent info; osEvent info;
thread_info_t thread_info = {}; thread_info_t thread_info = {};
info = osThreadGetInfo(id, osThreadInfoEntry); info = _osThreadGetInfo(id, osThreadInfoEntry);
if (info.status != osOK) { if (info.status != osOK) {
return; return;
} }
thread_info.entry = (uint32_t)info.value.p; thread_info.entry = (uint32_t)info.value.p;
info = osThreadGetInfo(id, osThreadInfoArg); info = _osThreadGetInfo(id, osThreadInfoArg);
if (info.status != osOK) { if (info.status != osOK) {
return; return;
} }
thread_info.arg = (uint32_t)info.value.p; thread_info.arg = (uint32_t)info.value.p;
info = osThreadGetInfo(id, osThreadInfoStackSize); info = _osThreadGetInfo(id, osThreadInfoStackSize);
if (info.status != osOK) { if (info.status != osOK) {
return; return;
} }
thread_info.stack_size = (uint32_t)info.value.v; thread_info.stack_size = (uint32_t)info.value.v;
info = osThreadGetInfo(id, osThreadInfoStackMax); info = _osThreadGetInfo(id, osThreadInfoStackMax);
if (info.status != osOK) { if (info.status != osOK) {
return; return;
} }

View File

@ -466,7 +466,7 @@ uint8_t osThreadGetState (osThreadId thread_id);
/// \param[in] info information to read. /// \param[in] info information to read.
/// \return current state of the thread function. /// \return current state of the thread function.
/// \return requested info that includes the status code. /// \return requested info that includes the status code.
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info); os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info);
// ==== Generic Wait Functions ==== // ==== Generic Wait Functions ====
@ -849,16 +849,16 @@ osStatus osMailFree (osMailQId queue_id, void *mail);
/// Start a thread enumeration. /// Start a thread enumeration.
/// \return an enumeration ID or NULL on error. /// \return an enumeration ID or NULL on error.
osThreadEnumId osThreadsEnumStart(void); osThreadEnumId _osThreadsEnumStart(void);
/// Get the next task ID in the enumeration. /// Get the next task ID in the enumeration.
/// \return a thread ID or NULL on if the end of the enumeration has been reached. /// \return a thread ID or NULL on if the end of the enumeration has been reached.
osThreadId osThreadEnumNext(osThreadEnumId enum_id); osThreadId _osThreadEnumNext(osThreadEnumId enum_id);
/// Free the enumeration structure. /// Free the enumeration structure.
/// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref osThreadsEnumStart. /// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref _osThreadsEnumStart.
/// \return status code that indicates the execution status of the function. /// \return status code that indicates the execution status of the function.
osStatus osThreadEnumFree(osThreadEnumId enum_id); osStatus _osThreadEnumFree(osThreadEnumId enum_id);
#endif // Thread Enumeration available #endif // Thread Enumeration available

View File

@ -1011,7 +1011,7 @@ uint8_t osThreadGetState (osThreadId thread_id) {
#endif #endif
/// Get the requested info from the specified active thread /// Get the requested info from the specified active thread
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) { os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
osEvent ret; osEvent ret;
if (__exceptional_mode()) { if (__exceptional_mode()) {
ret.status = osErrorISR; ret.status = osErrorISR;
@ -1020,14 +1020,14 @@ os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
return __svcThreadGetInfo(thread_id, info); return __svcThreadGetInfo(thread_id, info);
} }
osThreadEnumId osThreadsEnumStart() { osThreadEnumId _osThreadsEnumStart() {
static uint32_t thread_enum_index; static uint32_t thread_enum_index;
osMutexWait(osMutexId_osThreadMutex, osWaitForever); osMutexWait(osMutexId_osThreadMutex, osWaitForever);
thread_enum_index = 0; thread_enum_index = 0;
return &thread_enum_index; return &thread_enum_index;
} }
osThreadId osThreadEnumNext(osThreadEnumId enum_id) { osThreadId _osThreadEnumNext(osThreadEnumId enum_id) {
uint32_t i; uint32_t i;
osThreadId id = NULL; osThreadId id = NULL;
uint32_t *index = (uint32_t*)enum_id; uint32_t *index = (uint32_t*)enum_id;
@ -1045,7 +1045,7 @@ osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
return id; return id;
} }
osStatus osThreadEnumFree(osThreadEnumId enum_id) { osStatus _osThreadEnumFree(osThreadEnumId enum_id) {
uint32_t *index = (uint32_t*)enum_id; uint32_t *index = (uint32_t*)enum_id;
*index = 0; *index = 0;
osMutexRelease(osMutexId_osThreadMutex); osMutexRelease(osMutexId_osThreadMutex);

View File

@ -376,7 +376,7 @@ uint8_t osThreadGetState (osThreadId thread_id);
/// \param[in] info information to read. /// \param[in] info information to read.
/// \return current state of the thread function. /// \return current state of the thread function.
/// \return requested info that includes the status code. /// \return requested info that includes the status code.
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info); os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info);
// ==== Generic Wait Functions ==== // ==== Generic Wait Functions ====
@ -706,16 +706,16 @@ osStatus osMailFree (osMailQId queue_id, void *mail);
/// Start a thread enumeration. /// Start a thread enumeration.
/// \return an enumeration ID or NULL on error. /// \return an enumeration ID or NULL on error.
osThreadEnumId osThreadsEnumStart(void); osThreadEnumId _osThreadsEnumStart(void);
/// Get the next task ID in the enumeration. /// Get the next task ID in the enumeration.
/// \return a thread ID or NULL on if the end of the enumeration has been reached. /// \return a thread ID or NULL on if the end of the enumeration has been reached.
osThreadId osThreadEnumNext(osThreadEnumId enum_id); osThreadId _osThreadEnumNext(osThreadEnumId enum_id);
/// Free the enumeration structure. /// Free the enumeration structure.
/// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref osThreadsEnumStart. /// \param[in] enum_id pointer to the enumeration ID that was obtained with \ref _osThreadsEnumStart.
/// \return status code that indicates the execution status of the function. /// \return status code that indicates the execution status of the function.
osStatus osThreadEnumFree(osThreadEnumId enum_id); osStatus _osThreadEnumFree(osThreadEnumId enum_id);
#endif // Thread Enumeration available #endif // Thread Enumeration available

View File

@ -958,7 +958,7 @@ uint8_t osThreadGetState (osThreadId thread_id) {
#endif #endif
/// Get the requested info from the specified active thread /// Get the requested info from the specified active thread
os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) { os_InRegs osEvent _osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
osEvent ret; osEvent ret;
if (__get_IPSR() != 0U) { // Not allowed in ISR if (__get_IPSR() != 0U) { // Not allowed in ISR
@ -968,14 +968,14 @@ os_InRegs osEvent osThreadGetInfo(osThreadId thread_id, osThreadInfo info) {
return __svcThreadGetInfo(thread_id, info); return __svcThreadGetInfo(thread_id, info);
} }
osThreadEnumId osThreadsEnumStart() { osThreadEnumId _osThreadsEnumStart() {
static uint32_t thread_enum_index; static uint32_t thread_enum_index;
osMutexWait(osMutexId_osThreadMutex, osWaitForever); osMutexWait(osMutexId_osThreadMutex, osWaitForever);
thread_enum_index = 0; thread_enum_index = 0;
return &thread_enum_index; return &thread_enum_index;
} }
osThreadId osThreadEnumNext(osThreadEnumId enum_id) { osThreadId _osThreadEnumNext(osThreadEnumId enum_id) {
uint32_t i; uint32_t i;
osThreadId id = NULL; osThreadId id = NULL;
uint32_t *index = (uint32_t*)enum_id; uint32_t *index = (uint32_t*)enum_id;
@ -993,7 +993,7 @@ osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
return id; return id;
} }
osStatus osThreadEnumFree(osThreadEnumId enum_id) { osStatus _osThreadEnumFree(osThreadEnumId enum_id) {
uint32_t *index = (uint32_t*)enum_id; uint32_t *index = (uint32_t*)enum_id;
*index = 0; *index = 0;
osMutexRelease(osMutexId_osThreadMutex); osMutexRelease(osMutexId_osThreadMutex);