git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6001 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2013-07-20 07:24:12 +00:00
parent 25ddb1c801
commit 390ed322cb
33 changed files with 110 additions and 110 deletions

View File

@ -133,7 +133,7 @@ void sdInit(void) {
void sdObjectInit(SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify) { void sdObjectInit(SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify) {
sdp->vmt = &vmt; sdp->vmt = &vmt;
chEvtInit(&sdp->event); chEvtObjectInit(&sdp->event);
sdp->state = SD_STOP; sdp->state = SD_STOP;
chIQInit(&sdp->iqueue, sdp->ib, SERIAL_BUFFERS_SIZE, inotify, sdp); chIQInit(&sdp->iqueue, sdp->ib, SERIAL_BUFFERS_SIZE, inotify, sdp);
chOQInit(&sdp->oqueue, sdp->ob, SERIAL_BUFFERS_SIZE, onotify, sdp); chOQInit(&sdp->oqueue, sdp->ob, SERIAL_BUFFERS_SIZE, onotify, sdp);

View File

@ -81,22 +81,22 @@
/** /**
* @brief Generic success constant. * @brief Generic success constant.
* @details This constant is functionally equivalent to @p FALSE but more * @details This constant is functionally equivalent to @p false but more
* readable, it can be used as return value of all those functions * readable, it can be used as return value of all those functions
* returning a @p bool_t as a status indicator. * returning a @p bool as a status indicator.
*/ */
#if !defined(CH_SUCCESS) || defined(__DOXYGEN__) #if !defined(CH_SUCCESS) || defined(__DOXYGEN__)
#define CH_SUCCESS FALSE #define CH_SUCCESS false
#endif #endif
/** /**
* @brief Generic failure constant. * @brief Generic failure constant.
* @details This constant is functionally equivalent to @p TRUE but more * @details This constant is functionally equivalent to @p true but more
* readable, it can be used as return value of all those functions * readable, it can be used as return value of all those functions
* returning a @p bool_t as a status indicator. * returning a @p bool as a status indicator.
*/ */
#if !defined(CH_FAILED) || defined(__DOXYGEN__) #if !defined(CH_FAILED) || defined(__DOXYGEN__)
#define CH_FAILED TRUE #define CH_FAILED true
#endif #endif
/** @} */ /** @} */

View File

@ -117,15 +117,15 @@ typedef struct {
* *
* @param[out] bsp pointer to a @p binary_semaphore_t structure * @param[out] bsp pointer to a @p binary_semaphore_t structure
* @param[in] taken initial state of the binary semaphore: * @param[in] taken initial state of the binary semaphore:
* - @a FALSE, the initial state is not taken. * - @a false, the initial state is not taken.
* - @a TRUE, the initial state is taken. * - @a true, the initial state is taken.
* . * .
* *
* @init * @init
*/ */
static inline void chBSemInit(binary_semaphore_t *bsp, bool taken) { static inline void chBSemObjectInit(binary_semaphore_t *bsp, bool taken) {
chSemInit(&bsp->bs_sem, taken ? 0 : 1); chSemObjectInit(&bsp->bs_sem, taken ? 0 : 1);
} }
/** /**
@ -225,8 +225,8 @@ static inline msg_t chBSemWaitTimeout(binary_semaphore_t *bsp,
* *
* @param[in] bsp pointer to a @p binary_semaphore_t structure * @param[in] bsp pointer to a @p binary_semaphore_t structure
* @param[in] taken new state of the binary semaphore * @param[in] taken new state of the binary semaphore
* - @a FALSE, the new state is not taken. * - @a false, the new state is not taken.
* - @a TRUE, the new state is taken. * - @a true, the new state is taken.
* . * .
* *
* @iclass * @iclass
@ -246,8 +246,8 @@ static inline void chBSemResetI(binary_semaphore_t *bsp, bool taken) {
* *
* @param[in] bsp pointer to a @p binary_semaphore_t structure * @param[in] bsp pointer to a @p binary_semaphore_t structure
* @param[in] taken new state of the binary semaphore * @param[in] taken new state of the binary semaphore
* - @a FALSE, the new state is not taken. * - @a false, the new state is not taken.
* - @a TRUE, the new state is taken. * - @a true, the new state is taken.
* . * .
* *
* @api * @api
@ -293,8 +293,8 @@ static inline void chBSemSignal(binary_semaphore_t *bsp) {
* *
* @param[in] bsp pointer to a @p binary_semaphore_t structure * @param[in] bsp pointer to a @p binary_semaphore_t structure
* @return The binary semaphore current state. * @return The binary semaphore current state.
* @retval FALSE if the binary semaphore is not taken. * @retval false if the binary semaphore is not taken.
* @retval TRUE if the binary semaphore is taken. * @retval true if the binary semaphore is taken.
* *
* @iclass * @iclass
*/ */
@ -302,7 +302,7 @@ static inline bool chBSemGetStateI(binary_semaphore_t *bsp) {
chDbgCheckClassI(); chDbgCheckClassI();
return bsp->bs_sem.s_cnt > 0 ? FALSE : TRUE; return bsp->bs_sem.s_cnt > 0 ? false : true;
} }
#endif /* CH_USE_SEMAPHORES */ #endif /* CH_USE_SEMAPHORES */

View File

@ -91,7 +91,7 @@ typedef struct condition_variable {
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void chCondInit(condition_variable_t *cp); void chCondObjectInit(condition_variable_t *cp);
void chCondSignal(condition_variable_t *cp); void chCondSignal(condition_variable_t *cp);
void chCondSignalI(condition_variable_t *cp); void chCondSignalI(condition_variable_t *cp);
void chCondBroadcast(condition_variable_t *cp); void chCondBroadcast(condition_variable_t *cp);

View File

@ -164,7 +164,7 @@ extern "C" {
* *
* @init * @init
*/ */
static inline void chEvtInit(event_source_t *esp) { static inline void chEvtObjectInit(event_source_t *esp) {
esp->es_next = (event_listener_t *)(void *)esp; esp->es_next = (event_listener_t *)(void *)esp;
} }

View File

@ -100,7 +100,7 @@ struct memory_heap {
extern "C" { extern "C" {
#endif #endif
void _heap_init(void); void _heap_init(void);
void chHeapInit(memory_heap_t *heapp, void *buf, size_t size); void chHeapObjectInit(memory_heap_t *heapp, void *buf, size_t size);
void *chHeapAlloc(memory_heap_t *heapp, size_t size); void *chHeapAlloc(memory_heap_t *heapp, size_t size);
void chHeapFree(void *p); void chHeapFree(void *p);
size_t chHeapStatus(memory_heap_t *heapp, size_t *sizep); size_t chHeapStatus(memory_heap_t *heapp, size_t *sizep);

View File

@ -87,7 +87,7 @@ static inline void list_init(threads_list_t *tlp) {
} }
/** /**
* @brief Evaluates to @p TRUE if the specified threads list is empty. * @brief Evaluates to @p true if the specified threads list is empty.
* *
* @notapi * @notapi
*/ */
@ -97,7 +97,7 @@ static inline bool list_isempty(threads_list_t *tlp) {
} }
/** /**
* @brief Evaluates to @p TRUE if the specified threads list is not empty. * @brief Evaluates to @p true if the specified threads list is not empty.
* *
* @notapi * @notapi
*/ */
@ -117,7 +117,7 @@ static inline void queue_init(threads_queue_t *tqp) {
} }
/** /**
* @brief Evaluates to @p TRUE if the specified threads queue is empty. * @brief Evaluates to @p true if the specified threads queue is empty.
* *
* @notapi * @notapi
*/ */
@ -127,7 +127,7 @@ static inline bool queue_isempty(threads_queue_t *tqp) {
} }
/** /**
* @brief Evaluates to @p TRUE if the specified threads queue is not empty. * @brief Evaluates to @p true if the specified threads queue is not empty.
* *
* @notapi * @notapi
*/ */

View File

@ -108,7 +108,7 @@ typedef struct {
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void chMBInit(mailbox_t *mbp, msg_t *buf, cnt_t n); void chMBObjectInit(mailbox_t *mbp, msg_t *buf, cnt_t n);
void chMBReset(mailbox_t *mbp); void chMBReset(mailbox_t *mbp);
msg_t chMBPost(mailbox_t *mbp, msg_t msg, systime_t timeout); msg_t chMBPost(mailbox_t *mbp, msg_t msg, systime_t timeout);
msg_t chMBPostS(mailbox_t *mbp, msg_t msg, systime_t timeout); msg_t chMBPostS(mailbox_t *mbp, msg_t msg, systime_t timeout);

View File

@ -106,7 +106,7 @@ typedef struct {
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void chPoolInit(memory_pool_t *mp, size_t size, memgetfunc_t provider); void chPoolObjectInit(memory_pool_t *mp, size_t size, memgetfunc_t provider);
void chPoolLoadArray(memory_pool_t *mp, void *p, size_t n); void chPoolLoadArray(memory_pool_t *mp, void *p, size_t n);
void *chPoolAllocI(memory_pool_t *mp); void *chPoolAllocI(memory_pool_t *mp);
void *chPoolAlloc(memory_pool_t *mp); void *chPoolAlloc(memory_pool_t *mp);

View File

@ -70,7 +70,7 @@ extern "C" {
/*===========================================================================*/ /*===========================================================================*/
/** /**
* @brief Evaluates to TRUE if the thread has pending messages. * @brief Evaluates to @p true if the thread has pending messages.
* *
* @iclass * @iclass
*/ */

View File

@ -89,11 +89,11 @@ typedef struct mutex {
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void chMtxInit(mutex_t *mp); void chMtxObjectInit(mutex_t *mp);
void chMtxLock(mutex_t *mp); void chMtxLock(mutex_t *mp);
void chMtxLockS(mutex_t *mp); void chMtxLockS(mutex_t *mp);
bool_t chMtxTryLock(mutex_t *mp); bool chMtxTryLock(mutex_t *mp);
bool_t chMtxTryLockS(mutex_t *mp); bool chMtxTryLockS(mutex_t *mp);
mutex_t *chMtxUnlock(void); mutex_t *chMtxUnlock(void);
mutex_t *chMtxUnlockS(void); mutex_t *chMtxUnlockS(void);
void chMtxUnlockAll(void); void chMtxUnlockAll(void);

View File

@ -149,24 +149,24 @@ typedef GenericQueue InputQueue;
#define chIQGetEmptyI(iqp) (chQSizeI(iqp) - chQSpaceI(iqp)) #define chIQGetEmptyI(iqp) (chQSizeI(iqp) - chQSpaceI(iqp))
/** /**
* @brief Evaluates to @p TRUE if the specified input queue is empty. * @brief Evaluates to @p true if the specified input queue is empty.
* *
* @param[in] iqp pointer to an @p InputQueue structure. * @param[in] iqp pointer to an @p InputQueue structure.
* @return The queue status. * @return The queue status.
* @retval FALSE if the queue is not empty. * @retval false if the queue is not empty.
* @retval TRUE if the queue is empty. * @retval true if the queue is empty.
* *
* @iclass * @iclass
*/ */
#define chIQIsEmptyI(iqp) ((bool_t)(chQSpaceI(iqp) <= 0)) #define chIQIsEmptyI(iqp) ((bool_t)(chQSpaceI(iqp) <= 0))
/** /**
* @brief Evaluates to @p TRUE if the specified input queue is full. * @brief Evaluates to @p true if the specified input queue is full.
* *
* @param[in] iqp pointer to an @p InputQueue structure. * @param[in] iqp pointer to an @p InputQueue structure.
* @return The queue status. * @return The queue status.
* @retval FALSE if the queue is not full. * @retval false if the queue is not full.
* @retval TRUE if the queue is full. * @retval true if the queue is full.
* *
* @iclass * @iclass
*/ */
@ -264,12 +264,12 @@ typedef GenericQueue OutputQueue;
#define chOQGetEmptyI(oqp) chQSpaceI(oqp) #define chOQGetEmptyI(oqp) chQSpaceI(oqp)
/** /**
* @brief Evaluates to @p TRUE if the specified output queue is empty. * @brief Evaluates to @p true if the specified output queue is empty.
* *
* @param[in] oqp pointer to an @p OutputQueue structure. * @param[in] oqp pointer to an @p OutputQueue structure.
* @return The queue status. * @return The queue status.
* @retval FALSE if the queue is not empty. * @retval false if the queue is not empty.
* @retval TRUE if the queue is empty. * @retval true if the queue is empty.
* *
* @iclass * @iclass
*/ */
@ -277,12 +277,12 @@ typedef GenericQueue OutputQueue;
((oqp)->q_counter != 0))) ((oqp)->q_counter != 0)))
/** /**
* @brief Evaluates to @p TRUE if the specified output queue is full. * @brief Evaluates to @p true if the specified output queue is full.
* *
* @param[in] oqp pointer to an @p OutputQueue structure. * @param[in] oqp pointer to an @p OutputQueue structure.
* @return The queue status. * @return The queue status.
* @retval FALSE if the queue is not full. * @retval false if the queue is not full.
* @retval TRUE if the queue is full. * @retval true if the queue is full.
* *
* @iclass * @iclass
*/ */

View File

@ -170,7 +170,7 @@ extern "C" {
/** /**
* @brief Determines if the current thread must reschedule. * @brief Determines if the current thread must reschedule.
* @details This function returns @p TRUE if there is a ready thread with * @details This function returns @p true if there is a ready thread with
* higher priority. * higher priority.
* *
* @iclass * @iclass
@ -184,7 +184,7 @@ static inline bool chSchIsRescRequiredI(void) {
/** /**
* @brief Determines if yielding is possible. * @brief Determines if yielding is possible.
* @details This function returns @p TRUE if there is a ready thread with * @details This function returns @p true if there is a ready thread with
* equal or higher priority. * equal or higher priority.
* *
* @sclass * @sclass

View File

@ -89,7 +89,7 @@ typedef struct semaphore {
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void chSemInit(semaphore_t *sp, cnt_t n); void chSemObjectInit(semaphore_t *sp, cnt_t n);
void chSemReset(semaphore_t *sp, cnt_t n); void chSemReset(semaphore_t *sp, cnt_t n);
void chSemResetI(semaphore_t *sp, cnt_t n); void chSemResetI(semaphore_t *sp, cnt_t n);
msg_t chSemWait(semaphore_t *sp); msg_t chSemWait(semaphore_t *sp);

View File

@ -302,8 +302,8 @@ typedef msg_t (*tfunc_t)(void *);
* @note Can be invoked in any context. * @note Can be invoked in any context.
* *
* @param[in] tp pointer to the thread * @param[in] tp pointer to the thread
* @retval TRUE thread terminated. * @retval true thread terminated.
* @retval FALSE thread not terminated. * @retval false thread not terminated.
* *
* @special * @special
*/ */
@ -313,8 +313,8 @@ typedef msg_t (*tfunc_t)(void *);
* @brief Verifies if the current thread has a termination request pending. * @brief Verifies if the current thread has a termination request pending.
* @note Can be invoked in any context. * @note Can be invoked in any context.
* *
* @retval TRUE termination request pending. * @retval true termination request pending.
* @retval FALSE termination request not pending. * @retval false termination request not pending.
* *
* @special * @special
*/ */

View File

@ -73,7 +73,7 @@
* *
* @init * @init
*/ */
void chCondInit(condition_variable_t *cp) { void chCondObjectInit(condition_variable_t *cp) {
chDbgCheck(cp != NULL, "chCondInit"); chDbgCheck(cp != NULL, "chCondInit");

View File

@ -88,9 +88,9 @@ void _heap_init(void) {
default_heap.h_free.h.u.next = (union heap_header *)NULL; default_heap.h_free.h.u.next = (union heap_header *)NULL;
default_heap.h_free.h.size = 0; default_heap.h_free.h.size = 0;
#if CH_USE_MUTEXES || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__)
chMtxInit(&default_heap.h_mtx); chMtxObjectInit(&default_heap.h_mtx);
#else #else
chSemInit(&default_heap.h_sem, 1); chSemObjectInit(&default_heap.h_sem, 1);
#endif #endif
} }
@ -105,7 +105,7 @@ void _heap_init(void) {
* *
* @init * @init
*/ */
void chHeapInit(memory_heap_t *heapp, void *buf, size_t size) { void chHeapObjectInit(memory_heap_t *heapp, void *buf, size_t size) {
union heap_header *hp; union heap_header *hp;
chDbgCheck(MEM_IS_ALIGNED(buf) && MEM_IS_ALIGNED(size), "chHeapInit"); chDbgCheck(MEM_IS_ALIGNED(buf) && MEM_IS_ALIGNED(size), "chHeapInit");
@ -116,9 +116,9 @@ void chHeapInit(memory_heap_t *heapp, void *buf, size_t size) {
hp->h.u.next = NULL; hp->h.u.next = NULL;
hp->h.size = size - sizeof(union heap_header); hp->h.size = size - sizeof(union heap_header);
#if CH_USE_MUTEXES || defined(__DOXYGEN__) #if CH_USE_MUTEXES || defined(__DOXYGEN__)
chMtxInit(&heapp->h_mtx); chMtxObjectInit(&heapp->h_mtx);
#else #else
chSemInit(&heapp->h_sem, 1); chSemObjectInit(&heapp->h_sem, 1);
#endif #endif
} }
@ -211,7 +211,7 @@ void chHeapFree(void *p) {
qp = &heapp->h_free; qp = &heapp->h_free;
H_LOCK(heapp); H_LOCK(heapp);
while (TRUE) { while (true) {
chDbgAssert((hp < qp) || (hp >= LIMIT(qp)), chDbgAssert((hp < qp) || (hp >= LIMIT(qp)),
"chHeapFree(), #1", "chHeapFree(), #1",
"within free block"); "within free block");

View File

@ -84,14 +84,14 @@
* *
* @init * @init
*/ */
void chMBInit(mailbox_t *mbp, msg_t *buf, cnt_t n) { void chMBObjectInit(mailbox_t *mbp, msg_t *buf, cnt_t n) {
chDbgCheck((mbp != NULL) && (buf != NULL) && (n > 0), "chMBInit"); chDbgCheck((mbp != NULL) && (buf != NULL) && (n > 0), "chMBInit");
mbp->mb_buffer = mbp->mb_wrptr = mbp->mb_rdptr = buf; mbp->mb_buffer = mbp->mb_wrptr = mbp->mb_rdptr = buf;
mbp->mb_top = &buf[n]; mbp->mb_top = &buf[n];
chSemInit(&mbp->mb_emptysem, n); chSemObjectInit(&mbp->mb_emptysem, n);
chSemInit(&mbp->mb_fullsem, 0); chSemObjectInit(&mbp->mb_fullsem, 0);
} }
/** /**

View File

@ -73,7 +73,7 @@
* *
* @init * @init
*/ */
void chPoolInit(memory_pool_t *mp, size_t size, memgetfunc_t provider) { void chPoolObjectInit(memory_pool_t *mp, size_t size, memgetfunc_t provider) {
chDbgCheck((mp != NULL) && (size >= sizeof(void *)), "chPoolInit"); chDbgCheck((mp != NULL) && (size >= sizeof(void *)), "chPoolInit");

View File

@ -96,7 +96,7 @@
* *
* @init * @init
*/ */
void chMtxInit(mutex_t *mp) { void chMtxObjectInit(mutex_t *mp) {
chDbgCheck(mp != NULL, "chMtxInit"); chDbgCheck(mp != NULL, "chMtxInit");
@ -217,13 +217,13 @@ void chMtxLockS(mutex_t *mp) {
* *
* @param[in] mp pointer to the @p mutex_t structure * @param[in] mp pointer to the @p mutex_t structure
* @return The operation status. * @return The operation status.
* @retval TRUE if the mutex has been successfully acquired * @retval true if the mutex has been successfully acquired
* @retval FALSE if the lock attempt failed. * @retval false if the lock attempt failed.
* *
* @api * @api
*/ */
bool_t chMtxTryLock(mutex_t *mp) { bool chMtxTryLock(mutex_t *mp) {
bool_t b; bool b;
chSysLock(); chSysLock();
@ -245,23 +245,23 @@ bool_t chMtxTryLock(mutex_t *mp) {
* *
* @param[in] mp pointer to the @p mutex_t structure * @param[in] mp pointer to the @p mutex_t structure
* @return The operation status. * @return The operation status.
* @retval TRUE if the mutex has been successfully acquired * @retval true if the mutex has been successfully acquired
* @retval FALSE if the lock attempt failed. * @retval false if the lock attempt failed.
* *
* @sclass * @sclass
*/ */
bool_t chMtxTryLockS(mutex_t *mp) { bool chMtxTryLockS(mutex_t *mp) {
chDbgCheckClassS(); chDbgCheckClassS();
chDbgCheck(mp != NULL, "chMtxTryLockS"); chDbgCheck(mp != NULL, "chMtxTryLockS");
if (mp->m_owner != NULL) if (mp->m_owner != NULL)
return FALSE; return false;
mp->m_owner = currp; mp->m_owner = currp;
mp->m_next = currp->p_mtxlist; mp->m_next = currp->p_mtxlist;
currp->p_mtxlist = mp; currp->p_mtxlist = mp;
return TRUE; return true;
} }
/** /**

View File

@ -224,7 +224,7 @@ size_t chIQReadTimeout(InputQueue *iqp, uint8_t *bp,
chDbgCheck(n > 0, "chIQReadTimeout"); chDbgCheck(n > 0, "chIQReadTimeout");
chSysLock(); chSysLock();
while (TRUE) { while (true) {
if (nfy) if (nfy)
nfy(iqp); nfy(iqp);
@ -404,7 +404,7 @@ size_t chOQWriteTimeout(OutputQueue *oqp, const uint8_t *bp,
chDbgCheck(n > 0, "chOQWriteTimeout"); chDbgCheck(n > 0, "chOQWriteTimeout");
chSysLock(); chSysLock();
while (TRUE) { while (true) {
while (chOQIsFullI(oqp)) { while (chOQIsFullI(oqp)) {
if (qwait((GenericQueue *)oqp, time) != Q_OK) { if (qwait((GenericQueue *)oqp, time) != Q_OK) {
chSysUnlock(); chSysUnlock();

View File

@ -267,9 +267,9 @@ void chSchRescheduleS(void) {
* @note Not a user function, it is meant to be invoked by the scheduler * @note Not a user function, it is meant to be invoked by the scheduler
* itself or from within the port layer. * itself or from within the port layer.
* *
* @retval TRUE if there is a thread that must go in running state * @retval true if there is a thread that must go in running state
* immediately. * immediately.
* @retval FALSE if preemption is not required. * @retval false if preemption is not required.
* *
* @special * @special
*/ */

View File

@ -96,7 +96,7 @@
* *
* @init * @init
*/ */
void chSemInit(semaphore_t *sp, cnt_t n) { void chSemObjectInit(semaphore_t *sp, cnt_t n) {
chDbgCheck((sp != NULL) && (n >= 0), "chSemInit"); chDbgCheck((sp != NULL) && (n >= 0), "chSemInit");

View File

@ -73,7 +73,7 @@ static void _idle_thread(void *p) {
(void)p; (void)p;
chRegSetThreadName("idle"); chRegSetThreadName("idle");
while (TRUE) { while (true) {
port_wait_for_interrupt(); port_wait_for_interrupt();
IDLE_LOOP_HOOK(); IDLE_LOOP_HOOK();
} }

View File

@ -280,7 +280,7 @@ thread_t *chThdResume(thread_t *tp) {
* @brief Requests a thread termination. * @brief Requests a thread termination.
* @pre The target thread must be written to invoke periodically * @pre The target thread must be written to invoke periodically
* @p chThdShouldTerminate() and terminate cleanly if it returns * @p chThdShouldTerminate() and terminate cleanly if it returns
* @p TRUE. * @p true.
* @post The specified thread will terminate after detecting the termination * @post The specified thread will terminate after detecting the termination
* condition. * condition.
* *
@ -400,7 +400,7 @@ void chThdExitS(msg_t msg) {
#endif #endif
chSchGoSleepS(THD_STATE_FINAL); chSchGoSleepS(THD_STATE_FINAL);
/* The thread never returns here.*/ /* The thread never returns here.*/
chDbgAssert(FALSE, "chThdExitS(), #1", "zombies apocalypse"); chDbgAssert(false, "chThdExitS(), #1", "zombies apocalypse");
} }
#if CH_USE_WAITEXIT || defined(__DOXYGEN__) #if CH_USE_WAITEXIT || defined(__DOXYGEN__)

View File

@ -348,7 +348,7 @@ static msg_t thread3(void *p) {
static void bmk7_setup(void) { static void bmk7_setup(void) {
chSemInit(&sem1, 0); chSemObjectInit(&sem1, 0);
} }
static void bmk7_execute(void) { static void bmk7_execute(void) {
@ -541,7 +541,7 @@ ROMCONST struct testcase testbmk10 = {
static void bmk11_setup(void) { static void bmk11_setup(void) {
chSemInit(&sem1, 1); chSemObjectInit(&sem1, 1);
} }
static void bmk11_execute(void) { static void bmk11_execute(void) {
@ -588,7 +588,7 @@ ROMCONST struct testcase testbmk11 = {
static void bmk12_setup(void) { static void bmk12_setup(void) {
chMtxInit(&mtx1); chMtxObjectInit(&mtx1);
} }
static void bmk12_execute(void) { static void bmk12_execute(void) {

View File

@ -77,7 +77,7 @@ static msg_t thread(void *p) {
#if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__) #if (CH_USE_HEAP && !CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
static void dyn1_setup(void) { static void dyn1_setup(void) {
chHeapInit(&heap1, test.buffer, sizeof(union test_buffers)); chHeapObjectInit(&heap1, test.buffer, sizeof(union test_buffers));
} }
static void dyn1_execute(void) { static void dyn1_execute(void) {
@ -135,7 +135,7 @@ ROMCONST struct testcase testdyn1 = {
static void dyn2_setup(void) { static void dyn2_setup(void) {
chPoolInit(&mp1, THD_WA_SIZE(THREADS_STACK_SIZE), NULL); chPoolObjectInit(&mp1, THD_WA_SIZE(THREADS_STACK_SIZE), NULL);
} }
static void dyn2_execute(void) { static void dyn2_execute(void) {
@ -202,7 +202,7 @@ static bool_t regfind(thread_t *tp) {
static void dyn3_setup(void) { static void dyn3_setup(void) {
chHeapInit(&heap1, test.buffer, sizeof(union test_buffers)); chHeapObjectInit(&heap1, test.buffer, sizeof(union test_buffers));
} }
static void dyn3_execute(void) { static void dyn3_execute(void) {

View File

@ -88,7 +88,7 @@ static void evt1_execute(void) {
/* /*
* Testing chEvtRegisterMask() and chEvtUnregister(). * Testing chEvtRegisterMask() and chEvtUnregister().
*/ */
chEvtInit(&es1); chEvtObjectInit(&es1);
chEvtRegisterMask(&es1, &el1, 1); chEvtRegisterMask(&es1, &el1, 1);
chEvtRegisterMask(&es1, &el2, 2); chEvtRegisterMask(&es1, &el2, 2);
test_assert(1, chEvtIsListeningI(&es1), "no listener"); test_assert(1, chEvtIsListeningI(&es1), "no listener");
@ -202,8 +202,8 @@ static void evt2_execute(void) {
/* /*
* Test on chEvtWaitAll(). * Test on chEvtWaitAll().
*/ */
chEvtInit(&es1); chEvtObjectInit(&es1);
chEvtInit(&es2); chEvtObjectInit(&es2);
chEvtRegisterMask(&es1, &el1, 1); chEvtRegisterMask(&es1, &el1, 1);
chEvtRegisterMask(&es2, &el2, 4); chEvtRegisterMask(&es2, &el2, 4);
test_wait_tick(); test_wait_tick();

View File

@ -63,7 +63,7 @@ static memory_heap_t test_heap;
static void heap1_setup(void) { static void heap1_setup(void) {
chHeapInit(&test_heap, test.buffer, sizeof(union test_buffers)); chHeapObjectInit(&test_heap, test.buffer, sizeof(union test_buffers));
} }
static void heap1_execute(void) { static void heap1_execute(void) {

View File

@ -70,7 +70,7 @@ static MAILBOX_DECL(mb1, test.wa.T0, MB_SIZE);
static void mbox1_setup(void) { static void mbox1_setup(void) {
chMBInit(&mb1, (msg_t *)test.wa.T0, MB_SIZE); chMBObjectInit(&mb1, (msg_t *)test.wa.T0, MB_SIZE);
} }
static void mbox1_execute(void) { static void mbox1_execute(void) {

View File

@ -83,7 +83,7 @@ static CONDVAR_DECL(c1);
static void mtx1_setup(void) { static void mtx1_setup(void) {
chMtxInit(&m1); chMtxObjectInit(&m1);
} }
static msg_t thread1(void *p) { static msg_t thread1(void *p) {
@ -150,7 +150,7 @@ ROMCONST struct testcase testmtx1 = {
static void mtx2_setup(void) { static void mtx2_setup(void) {
chMtxInit(&m1); chMtxObjectInit(&m1);
} }
/* Low priority thread */ /* Low priority thread */
@ -240,8 +240,8 @@ ROMCONST struct testcase testmtx2 = {
static void mtx3_setup(void) { static void mtx3_setup(void) {
chMtxInit(&m1); /* Mutex B.*/ chMtxObjectInit(&m1); /* Mutex B.*/
chMtxInit(&m2); /* Mutex A.*/ chMtxObjectInit(&m2); /* Mutex A.*/
} }
/* Lowest priority thread */ /* Lowest priority thread */
@ -340,8 +340,8 @@ ROMCONST struct testcase testmtx3 = {
static void mtx4_setup(void) { static void mtx4_setup(void) {
chMtxInit(&m1); chMtxObjectInit(&m1);
chMtxInit(&m2); chMtxObjectInit(&m2);
} }
static msg_t thread4a(void *p) { static msg_t thread4a(void *p) {
@ -427,7 +427,7 @@ ROMCONST struct testcase testmtx4 = {
static void mtx5_setup(void) { static void mtx5_setup(void) {
chMtxInit(&m1); chMtxObjectInit(&m1);
} }
static void mtx5_execute(void) { static void mtx5_execute(void) {
@ -477,8 +477,8 @@ ROMCONST struct testcase testmtx5 = {
static void mtx6_setup(void) { static void mtx6_setup(void) {
chCondInit(&c1); chCondObjectInit(&c1);
chMtxInit(&m1); chMtxObjectInit(&m1);
} }
static msg_t thread10(void *p) { static msg_t thread10(void *p) {
@ -529,8 +529,8 @@ ROMCONST struct testcase testmtx6 = {
static void mtx7_setup(void) { static void mtx7_setup(void) {
chCondInit(&c1); chCondObjectInit(&c1);
chMtxInit(&m1); chMtxObjectInit(&m1);
} }
static void mtx7_execute(void) { static void mtx7_execute(void) {
@ -564,9 +564,9 @@ ROMCONST struct testcase testmtx7 = {
static void mtx8_setup(void) { static void mtx8_setup(void) {
chCondInit(&c1); chCondObjectInit(&c1);
chMtxInit(&m1); chMtxObjectInit(&m1);
chMtxInit(&m2); chMtxObjectInit(&m2);
} }
static msg_t thread11(void *p) { static msg_t thread11(void *p) {

View File

@ -65,7 +65,7 @@ static void *null_provider(size_t size) {
static void pools1_setup(void) { static void pools1_setup(void) {
chPoolInit(&mp1, THD_WA_SIZE(THREADS_STACK_SIZE), NULL); chPoolObjectInit(&mp1, THD_WA_SIZE(THREADS_STACK_SIZE), NULL);
} }
static void pools1_execute(void) { static void pools1_execute(void) {
@ -93,7 +93,7 @@ static void pools1_execute(void) {
test_assert(4, chPoolAlloc(&mp1) == NULL, "list not empty"); test_assert(4, chPoolAlloc(&mp1) == NULL, "list not empty");
/* Covering the case where a provider is unable to return more memory.*/ /* Covering the case where a provider is unable to return more memory.*/
chPoolInit(&mp1, 16, null_provider); chPoolObjectInit(&mp1, 16, null_provider);
test_assert(5, chPoolAlloc(&mp1) == NULL, "provider returned memory"); test_assert(5, chPoolAlloc(&mp1) == NULL, "provider returned memory");
} }

View File

@ -71,7 +71,7 @@ static SEMAPHORE_DECL(sem1, 0);
static void sem1_setup(void) { static void sem1_setup(void) {
chSemInit(&sem1, 0); chSemObjectInit(&sem1, 0);
} }
static msg_t thread1(void *p) { static msg_t thread1(void *p) {
@ -127,7 +127,7 @@ ROMCONST struct testcase testsem1 = {
static void sem2_setup(void) { static void sem2_setup(void) {
chSemInit(&sem1, 0); chSemObjectInit(&sem1, 0);
} }
static msg_t thread2(void *p) { static msg_t thread2(void *p) {
@ -203,7 +203,7 @@ ROMCONST struct testcase testsem2 = {
static void sem3_setup(void) { static void sem3_setup(void) {
chSemInit(&sem1, 0); chSemObjectInit(&sem1, 0);
} }
static msg_t thread3(void *p) { static msg_t thread3(void *p) {
@ -252,7 +252,7 @@ static void sem4_execute(void) {
binary_semaphore_t bsem; binary_semaphore_t bsem;
/* Creates a taken binary semaphore.*/ /* Creates a taken binary semaphore.*/
chBSemInit(&bsem, TRUE); chBSemObjectInit(&bsem, TRUE);
chBSemReset(&bsem, TRUE); chBSemReset(&bsem, TRUE);
test_assert(1, chBSemGetStateI(&bsem) == TRUE, "not taken"); test_assert(1, chBSemGetStateI(&bsem) == TRUE, "not taken");