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

View File

@ -466,7 +466,7 @@ uint8_t osThreadGetState (osThreadId thread_id);
/// \param[in] info information to read.
/// \return current state of the thread function.
/// \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 ====
@ -849,16 +849,16 @@ osStatus osMailFree (osMailQId queue_id, void *mail);
/// Start a thread enumeration.
/// \return an enumeration ID or NULL on error.
osThreadEnumId osThreadsEnumStart(void);
osThreadEnumId _osThreadsEnumStart(void);
/// Get the next task ID in the enumeration.
/// \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.
/// \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.
osStatus osThreadEnumFree(osThreadEnumId enum_id);
osStatus _osThreadEnumFree(osThreadEnumId enum_id);
#endif // Thread Enumeration available

View File

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

View File

@ -376,7 +376,7 @@ uint8_t osThreadGetState (osThreadId thread_id);
/// \param[in] info information to read.
/// \return current state of the thread function.
/// \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 ====
@ -706,16 +706,16 @@ osStatus osMailFree (osMailQId queue_id, void *mail);
/// Start a thread enumeration.
/// \return an enumeration ID or NULL on error.
osThreadEnumId osThreadsEnumStart(void);
osThreadEnumId _osThreadsEnumStart(void);
/// Get the next task ID in the enumeration.
/// \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.
/// \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.
osStatus osThreadEnumFree(osThreadEnumId enum_id);
osStatus _osThreadEnumFree(osThreadEnumId enum_id);
#endif // Thread Enumeration available

View File

@ -958,7 +958,7 @@ uint8_t osThreadGetState (osThreadId thread_id) {
#endif
/// 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;
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);
}
osThreadEnumId osThreadsEnumStart() {
osThreadEnumId _osThreadsEnumStart() {
static uint32_t thread_enum_index;
osMutexWait(osMutexId_osThreadMutex, osWaitForever);
thread_enum_index = 0;
return &thread_enum_index;
}
osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
osThreadId _osThreadEnumNext(osThreadEnumId enum_id) {
uint32_t i;
osThreadId id = NULL;
uint32_t *index = (uint32_t*)enum_id;
@ -993,7 +993,7 @@ osThreadId osThreadEnumNext(osThreadEnumId enum_id) {
return id;
}
osStatus osThreadEnumFree(osThreadEnumId enum_id) {
osStatus _osThreadEnumFree(osThreadEnumId enum_id) {
uint32_t *index = (uint32_t*)enum_id;
*index = 0;
osMutexRelease(osMutexId_osThreadMutex);