diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-06-16 16:30:00 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-06-16 16:30:00 +0000 |
commit | 745d8c15044781f1215f2188edcc402fafadd059 (patch) | |
tree | be74d8769cc9ab0ede73b89e3c283494739f7047 /os/kernel/src | |
parent | 2e4ba09bb54f415e7f8fd66f4ccddbf421612820 (diff) | |
download | ChibiOS-745d8c15044781f1215f2188edcc402fafadd059.tar.gz ChibiOS-745d8c15044781f1215f2188edcc402fafadd059.tar.bz2 ChibiOS-745d8c15044781f1215f2188edcc402fafadd059.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@5861 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
-rw-r--r-- | os/kernel/src/chcond.c | 10 | ||||
-rw-r--r-- | os/kernel/src/chlists.c | 8 | ||||
-rw-r--r-- | os/kernel/src/chmsg.c | 2 | ||||
-rw-r--r-- | os/kernel/src/chmtx.c | 14 | ||||
-rw-r--r-- | os/kernel/src/chqueues.c | 8 | ||||
-rw-r--r-- | os/kernel/src/chschd.c | 8 | ||||
-rw-r--r-- | os/kernel/src/chsem.c | 10 |
7 files changed, 30 insertions, 30 deletions
diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c index 0e404808f..e6bf51652 100644 --- a/os/kernel/src/chcond.c +++ b/os/kernel/src/chcond.c @@ -69,7 +69,7 @@ void chCondSignal(CondVar *cp) { chSysLock();
if (queue_notempty(&cp->c_queue))
- chSchWakeupS(fifo_remove(&cp->c_queue), RDY_OK);
+ chSchWakeupS(queue_fifo_remove(&cp->c_queue), RDY_OK);
chSysUnlock();
}
@@ -90,7 +90,7 @@ void chCondSignalI(CondVar *cp) { chDbgCheck(cp != NULL, "chCondSignalI");
if (queue_notempty(&cp->c_queue))
- chSchReadyI(fifo_remove(&cp->c_queue))->p_u.rdymsg = RDY_OK;
+ chSchReadyI(queue_fifo_remove(&cp->c_queue))->p_u.rdymsg = RDY_OK;
}
/**
@@ -128,7 +128,7 @@ void chCondBroadcastI(CondVar *cp) { ready list in FIFO order. The wakeup message is set to @p RDY_RESET in
order to make a chCondBroadcast() detectable from a chCondSignal().*/
while (cp->c_queue.p_next != (void *)&cp->c_queue)
- chSchReadyI(fifo_remove(&cp->c_queue))->p_u.rdymsg = RDY_RESET;
+ chSchReadyI(queue_fifo_remove(&cp->c_queue))->p_u.rdymsg = RDY_RESET;
}
/**
@@ -187,7 +187,7 @@ msg_t chCondWaitS(CondVar *cp) { mp = chMtxUnlockS();
ctp->p_u.wtobjp = cp;
- prio_insert(ctp, &cp->c_queue);
+ queue_prio_insert(ctp, &cp->c_queue);
chSchGoSleepS(THD_STATE_WTCOND);
msg = ctp->p_u.rdymsg;
chMtxLockS(mp);
@@ -272,7 +272,7 @@ msg_t chCondWaitTimeoutS(CondVar *cp, systime_t time) { mp = chMtxUnlockS();
currp->p_u.wtobjp = cp;
- prio_insert(currp, &cp->c_queue);
+ queue_prio_insert(currp, &cp->c_queue);
msg = chSchGoSleepTimeoutS(THD_STATE_WTCOND, time);
if (msg != RDY_TIMEOUT)
chMtxLockS(mp);
diff --git a/os/kernel/src/chlists.c b/os/kernel/src/chlists.c index 8ee309200..2183171a7 100644 --- a/os/kernel/src/chlists.c +++ b/os/kernel/src/chlists.c @@ -41,7 +41,7 @@ *
* @notapi
*/
-void prio_insert(Thread *tp, ThreadsQueue *tqp) {
+void queue_prio_insert(Thread *tp, ThreadsQueue *tqp) {
/* cp iterates over the queue.*/
Thread *cp = (Thread *)tqp;
@@ -81,7 +81,7 @@ void queue_insert(Thread *tp, ThreadsQueue *tqp) { *
* @notapi
*/
-Thread *fifo_remove(ThreadsQueue *tqp) {
+Thread *queue_fifo_remove(ThreadsQueue *tqp) {
Thread *tp = tqp->p_next;
(tqp->p_next = tp->p_next)->p_prev = (Thread *)tqp;
@@ -98,7 +98,7 @@ Thread *fifo_remove(ThreadsQueue *tqp) { *
* @notapi
*/
-Thread *lifo_remove(ThreadsQueue *tqp) {
+Thread *queue_lifo_remove(ThreadsQueue *tqp) {
Thread *tp = tqp->p_prev;
(tqp->p_prev = tp->p_prev)->p_next = (Thread *)tqp;
@@ -115,7 +115,7 @@ Thread *lifo_remove(ThreadsQueue *tqp) { *
* @notapi
*/
-Thread *dequeue(Thread *tp) {
+Thread *queue_dequeue(Thread *tp) {
tp->p_prev->p_next = tp->p_next;
tp->p_next->p_prev = tp->p_prev;
diff --git a/os/kernel/src/chmsg.c b/os/kernel/src/chmsg.c index ad97da79c..d27713ef0 100644 --- a/os/kernel/src/chmsg.c +++ b/os/kernel/src/chmsg.c @@ -102,7 +102,7 @@ Thread *chMsgWait(void) { chSysLock();
if (!chMsgIsPendingI(currp))
chSchGoSleepS(THD_STATE_WTMSG);
- tp = fifo_remove(&currp->p_msgqueue);
+ tp = queue_fifo_remove(&currp->p_msgqueue);
tp->p_state = THD_STATE_SNDMSG;
chSysUnlock();
return tp;
diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c index 84d7e53a6..adeb0dd52 100644 --- a/os/kernel/src/chmtx.c +++ b/os/kernel/src/chmtx.c @@ -132,7 +132,7 @@ void chMtxLockS(Mutex *mp) { switch (tp->p_state) {
case THD_STATE_WTMTX:
/* Re-enqueues the mutex owner with its new priority.*/
- prio_insert(dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp);
+ queue_prio_insert(queue_dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp);
tp = ((Mutex *)tp->p_u.wtobjp)->m_owner;
continue;
#if CH_USE_CONDVARS | \
@@ -148,7 +148,7 @@ void chMtxLockS(Mutex *mp) { case THD_STATE_SNDMSGQ:
#endif
/* Re-enqueues tp with its new priority on the queue.*/
- prio_insert(dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp);
+ queue_prio_insert(queue_dequeue(tp), (ThreadsQueue *)tp->p_u.wtobjp);
break;
#endif
case THD_STATE_READY:
@@ -157,13 +157,13 @@ void chMtxLockS(Mutex *mp) { tp->p_state = THD_STATE_CURRENT;
#endif
/* Re-enqueues tp with its new priority on the ready list.*/
- chSchReadyI(dequeue(tp));
+ chSchReadyI(queue_dequeue(tp));
break;
}
break;
}
/* Sleep on the mutex.*/
- prio_insert(ctp, &mp->m_queue);
+ queue_prio_insert(ctp, &mp->m_queue);
ctp->p_u.wtobjp = mp;
chSchGoSleepS(THD_STATE_WTMTX);
/* It is assumed that the thread performing the unlock operation assigns
@@ -283,7 +283,7 @@ Mutex *chMtxUnlock(void) { ctp->p_prio = newprio;
/* Awakens the highest priority thread waiting for the unlocked mutex and
assigns the mutex to it.*/
- tp = fifo_remove(&ump->m_queue);
+ tp = queue_fifo_remove(&ump->m_queue);
ump->m_owner = tp;
ump->m_next = tp->p_mtxlist;
tp->p_mtxlist = ump;
@@ -342,7 +342,7 @@ Mutex *chMtxUnlockS(void) { ctp->p_prio = newprio;
/* Awakens the highest priority thread waiting for the unlocked mutex and
assigns the mutex to it.*/
- tp = fifo_remove(&ump->m_queue);
+ tp = queue_fifo_remove(&ump->m_queue);
ump->m_owner = tp;
ump->m_next = tp->p_mtxlist;
tp->p_mtxlist = ump;
@@ -373,7 +373,7 @@ void chMtxUnlockAll(void) { Mutex *ump = ctp->p_mtxlist;
ctp->p_mtxlist = ump->m_next;
if (chMtxQueueNotEmptyS(ump)) {
- Thread *tp = fifo_remove(&ump->m_queue);
+ Thread *tp = queue_fifo_remove(&ump->m_queue);
ump->m_owner = tp;
ump->m_next = tp->p_mtxlist;
tp->p_mtxlist = ump;
diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c index fa2bd527b..a4b0aa416 100644 --- a/os/kernel/src/chqueues.c +++ b/os/kernel/src/chqueues.c @@ -114,7 +114,7 @@ void chIQResetI(InputQueue *iqp) { iqp->q_rdptr = iqp->q_wrptr = iqp->q_buffer;
iqp->q_counter = 0;
while (queue_notempty(&iqp->q_waiting))
- chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_RESET;
+ chSchReadyI(queue_fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_RESET;
}
/**
@@ -143,7 +143,7 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { iqp->q_wrptr = iqp->q_buffer;
if (queue_notempty(&iqp->q_waiting))
- chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_OK;
+ chSchReadyI(queue_fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_OK;
return Q_OK;
}
@@ -294,7 +294,7 @@ void chOQResetI(OutputQueue *oqp) { oqp->q_rdptr = oqp->q_wrptr = oqp->q_buffer;
oqp->q_counter = chQSizeI(oqp);
while (queue_notempty(&oqp->q_waiting))
- chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_RESET;
+ chSchReadyI(queue_fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_RESET;
}
/**
@@ -367,7 +367,7 @@ msg_t chOQGetI(OutputQueue *oqp) { oqp->q_rdptr = oqp->q_buffer;
if (queue_notempty(&oqp->q_waiting))
- chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_OK;
+ chSchReadyI(queue_fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_OK;
return b;
}
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 285c36ba3..ab9b88040 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -116,7 +116,7 @@ void chSchGoSleepS(tstate_t newstate) { time quantum when it will wakeup.*/
otp->p_preempt = CH_TIME_QUANTUM;
#endif
- setcurrp(fifo_remove(&rlist.r_queue));
+ setcurrp(queue_fifo_remove(&rlist.r_queue));
currp->p_state = THD_STATE_CURRENT;
chSysSwitch(currp, otp);
}
@@ -150,7 +150,7 @@ static void wakeup(void *p) { case THD_STATE_WTCOND:
#endif
/* States requiring dequeuing.*/
- dequeue(tp);
+ queue_dequeue(tp);
#endif
}
tp->p_u.rdymsg = RDY_TIMEOUT;
@@ -299,7 +299,7 @@ void chSchDoRescheduleBehind(void) { otp = currp;
/* Picks the first thread from the ready queue and makes it current.*/
- setcurrp(fifo_remove(&rlist.r_queue));
+ setcurrp(queue_fifo_remove(&rlist.r_queue));
currp->p_state = THD_STATE_CURRENT;
#if CH_TIME_QUANTUM > 0
otp->p_preempt = CH_TIME_QUANTUM;
@@ -324,7 +324,7 @@ void chSchDoRescheduleAhead(void) { otp = currp;
/* Picks the first thread from the ready queue and makes it current.*/
- setcurrp(fifo_remove(&rlist.r_queue));
+ setcurrp(queue_fifo_remove(&rlist.r_queue));
currp->p_state = THD_STATE_CURRENT;
otp->p_state = THD_STATE_READY;
diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c index 7ea365291..c91264b9d 100644 --- a/os/kernel/src/chsem.c +++ b/os/kernel/src/chsem.c @@ -139,7 +139,7 @@ void chSemResetI(Semaphore *sp, cnt_t n) { cnt = sp->s_cnt;
sp->s_cnt = n;
while (++cnt <= 0)
- chSchReadyI(lifo_remove(&sp->s_queue))->p_u.rdymsg = RDY_RESET;
+ chSchReadyI(queue_lifo_remove(&sp->s_queue))->p_u.rdymsg = RDY_RESET;
}
/**
@@ -278,7 +278,7 @@ void chSemSignal(Semaphore *sp) { chSysLock();
if (++sp->s_cnt <= 0)
- chSchWakeupS(fifo_remove(&sp->s_queue), RDY_OK);
+ chSchWakeupS(queue_fifo_remove(&sp->s_queue), RDY_OK);
chSysUnlock();
}
@@ -305,7 +305,7 @@ void chSemSignalI(Semaphore *sp) { if (++sp->s_cnt <= 0) {
/* Note, it is done this way in order to allow a tail call on
chSchReadyI().*/
- Thread *tp = fifo_remove(&sp->s_queue);
+ Thread *tp = queue_fifo_remove(&sp->s_queue);
tp->p_u.rdymsg = RDY_OK;
chSchReadyI(tp);
}
@@ -335,7 +335,7 @@ void chSemAddCounterI(Semaphore *sp, cnt_t n) { while (n > 0) {
if (++sp->s_cnt <= 0)
- chSchReadyI(fifo_remove(&sp->s_queue))->p_u.rdymsg = RDY_OK;
+ chSchReadyI(queue_fifo_remove(&sp->s_queue))->p_u.rdymsg = RDY_OK;
n--;
}
}
@@ -371,7 +371,7 @@ msg_t chSemSignalWait(Semaphore *sps, Semaphore *spw) { chSysLock();
if (++sps->s_cnt <= 0)
- chSchReadyI(fifo_remove(&sps->s_queue))->p_u.rdymsg = RDY_OK;
+ chSchReadyI(queue_fifo_remove(&sps->s_queue))->p_u.rdymsg = RDY_OK;
if (--spw->s_cnt < 0) {
Thread *ctp = currp;
sem_insert(ctp, &spw->s_queue);
|