More consistency changes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14348 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
126e5c9344
commit
3be977634b
|
@ -208,8 +208,8 @@ osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio) {
|
|||
case CH_STATE_SNDMSGQ:
|
||||
#endif
|
||||
/* Re-enqueues tp with its new priority on the queue.*/
|
||||
ch_sch_prio_insert(ch_queue_dequeue(&tp->hdr.queue),
|
||||
(ch_queue_t *)tp->u.wtobjp);
|
||||
ch_sch_prio_insert((ch_queue_t *)tp->u.wtobjp,
|
||||
ch_queue_dequeue(&tp->hdr.queue));
|
||||
break;
|
||||
#endif
|
||||
case CH_STATE_READY:
|
||||
|
|
|
@ -2022,8 +2022,8 @@ int32 OS_TaskSetPriority(uint32 task_id, uint32 new_priority) {
|
|||
case CH_STATE_SNDMSGQ:
|
||||
#endif
|
||||
/* Re-enqueues tp with its new priority on the queue.*/
|
||||
ch_sch_prio_insert(ch_queue_dequeue(&tp->hdr.queue),
|
||||
(ch_queue_t *)tp->u.wtobjp);
|
||||
ch_sch_prio_insert((ch_queue_t *)tp->u.wtobjp,
|
||||
ch_queue_dequeue(&tp->hdr.queue));
|
||||
break;
|
||||
case CH_STATE_READY:
|
||||
#if CH_DBG_ENABLE_ASSERTS
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
/*===========================================================================*/
|
||||
|
||||
#if CH_CFG_USE_MESSAGES_PRIORITY == TRUE
|
||||
#define __ch_msg_insert(qp, tp) ch_sch_prio_insert(&tp->hdr.queue, qp)
|
||||
#define __ch_msg_insert(qp, tp) ch_sch_prio_insert(qp, &tp->hdr.queue)
|
||||
#else
|
||||
#define __ch_msg_insert(qp, tp) ch_queue_insert(qp, &tp->hdr.queue)
|
||||
#endif
|
||||
|
|
|
@ -159,7 +159,7 @@ extern "C" {
|
|||
void chSchDoYieldS(void);
|
||||
thread_t *chSchSelectFirstI(void);
|
||||
#if CH_CFG_OPTIMIZE_SPEED == FALSE
|
||||
void ch_sch_prio_insert(ch_queue_t *tp, ch_queue_t *qp);
|
||||
void ch_sch_prio_insert(ch_queue_t *qp, ch_queue_t *tp);
|
||||
#endif /* CH_CFG_OPTIMIZE_SPEED == FALSE */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ extern "C" {
|
|||
/* If the performance code path has been chosen then all the following
|
||||
functions are inlined into the various kernel modules.*/
|
||||
#if CH_CFG_OPTIMIZE_SPEED == TRUE
|
||||
static inline void ch_sch_prio_insert(ch_queue_t *tp, ch_queue_t *qp) {
|
||||
static inline void ch_sch_prio_insert(ch_queue_t *qp, ch_queue_t *tp) {
|
||||
|
||||
ch_queue_t *cp = qp;
|
||||
do {
|
||||
|
|
|
@ -217,7 +217,7 @@ msg_t chCondWaitS(condition_variable_t *cp) {
|
|||
/* Start waiting on the condition variable, on exit the mutex is taken
|
||||
again.*/
|
||||
currtp->u.wtobjp = cp;
|
||||
ch_sch_prio_insert(&currtp->hdr.queue, &cp->queue);
|
||||
ch_sch_prio_insert(&cp->queue, &currtp->hdr.queue);
|
||||
chSchGoSleepS(CH_STATE_WTCOND);
|
||||
msg = currtp->u.rdymsg;
|
||||
chMtxLockS(mp);
|
||||
|
@ -307,7 +307,7 @@ msg_t chCondWaitTimeoutS(condition_variable_t *cp, sysinterval_t timeout) {
|
|||
/* Start waiting on the condition variable, on exit the mutex is taken
|
||||
again.*/
|
||||
currtp->u.wtobjp = cp;
|
||||
ch_sch_prio_insert(&currtp->hdr.queue, &cp->queue);
|
||||
ch_sch_prio_insert(&cp->queue, &currtp->hdr.queue);
|
||||
msg = chSchGoSleepTimeoutS(CH_STATE_WTCOND, timeout);
|
||||
if (msg != MSG_TIMEOUT) {
|
||||
chMtxLockS(mp);
|
||||
|
|
|
@ -170,8 +170,8 @@ void chMtxLockS(mutex_t *mp) {
|
|||
switch (tp->state) {
|
||||
case CH_STATE_WTMTX:
|
||||
/* Re-enqueues the mutex owner with its new priority.*/
|
||||
ch_sch_prio_insert(ch_queue_dequeue(&tp->hdr.queue),
|
||||
&tp->u.wtmtxp->queue);
|
||||
ch_sch_prio_insert(&tp->u.wtmtxp->queue,
|
||||
ch_queue_dequeue(&tp->hdr.queue));
|
||||
tp = tp->u.wtmtxp->owner;
|
||||
/*lint -e{9042} [16.1] Continues the while.*/
|
||||
continue;
|
||||
|
@ -191,8 +191,8 @@ void chMtxLockS(mutex_t *mp) {
|
|||
case CH_STATE_SNDMSGQ:
|
||||
#endif
|
||||
/* Re-enqueues tp with its new priority on the queue.*/
|
||||
ch_sch_prio_insert(ch_queue_dequeue(&tp->hdr.queue),
|
||||
&tp->u.wtmtxp->queue);
|
||||
ch_sch_prio_insert(&tp->u.wtmtxp->queue,
|
||||
ch_queue_dequeue(&tp->hdr.queue));
|
||||
break;
|
||||
#endif
|
||||
case CH_STATE_READY:
|
||||
|
@ -211,7 +211,7 @@ void chMtxLockS(mutex_t *mp) {
|
|||
}
|
||||
|
||||
/* Sleep on the mutex.*/
|
||||
ch_sch_prio_insert(&currtp->hdr.queue, &mp->queue);
|
||||
ch_sch_prio_insert(&mp->queue, &currtp->hdr.queue);
|
||||
currtp->u.wtmtxp = mp;
|
||||
chSchGoSleepS(CH_STATE_WTMTX);
|
||||
|
||||
|
|
|
@ -234,12 +234,12 @@ static void __sch_wakeup(void *p) {
|
|||
* @note The insertion is done by scanning the list from the highest
|
||||
* priority toward the lowest.
|
||||
*
|
||||
* @param[in] tp the pointer to the thread to be inserted in the list
|
||||
* @param[in] qp the pointer to the threads list header
|
||||
* @param[in] tp the pointer to the thread to be inserted in the list
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
void ch_sch_prio_insert(ch_queue_t *tp, ch_queue_t *qp) {
|
||||
void ch_sch_prio_insert(ch_queue_t *qp, ch_queue_t *tp) {
|
||||
|
||||
ch_queue_t *cp = qp;
|
||||
do {
|
||||
|
|
|
@ -171,7 +171,7 @@ msg_t sbSendMessageTimeout(sb_class_t *sbcp,
|
|||
|
||||
/* Sending the message.*/
|
||||
ctp->u.sentmsg = msg;
|
||||
__ch_msg_insert(ctp, &sbcp->tp->msgqueue);
|
||||
__ch_msg_insert(&sbcp->tp->msgqueue, ctp);
|
||||
if (sbcp->tp->state == CH_STATE_WTMSG) {
|
||||
(void) chSchReadyI(sbcp->tp);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue