diff options
Diffstat (limited to 'os/kernel/src')
-rw-r--r-- | os/kernel/src/chcond.c | 20 | ||||
-rw-r--r-- | os/kernel/src/chdynamic.c | 6 | ||||
-rw-r--r-- | os/kernel/src/chevents.c | 16 | ||||
-rw-r--r-- | os/kernel/src/chheap.c | 8 | ||||
-rw-r--r-- | os/kernel/src/chmboxes.c | 16 | ||||
-rw-r--r-- | os/kernel/src/chmempools.c | 8 | ||||
-rw-r--r-- | os/kernel/src/chmsg.c | 5 | ||||
-rw-r--r-- | os/kernel/src/chmtx.c | 26 | ||||
-rw-r--r-- | os/kernel/src/chqueues.c | 4 | ||||
-rw-r--r-- | os/kernel/src/chregistry.c | 3 | ||||
-rw-r--r-- | os/kernel/src/chschd.c | 1 | ||||
-rw-r--r-- | os/kernel/src/chsem.c | 24 | ||||
-rw-r--r-- | os/kernel/src/chthreads.c | 16 | ||||
-rw-r--r-- | os/kernel/src/chvt.c | 9 |
14 files changed, 65 insertions, 97 deletions
diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c index 49e1f891e..94fd8e81c 100644 --- a/os/kernel/src/chcond.c +++ b/os/kernel/src/chcond.c @@ -75,7 +75,7 @@ */
void chCondObjectInit(condition_variable_t *cp) {
- chDbgCheck(cp != NULL, "chCondInit");
+ chDbgCheck(cp != NULL);
queue_init(&cp->c_queue);
}
@@ -89,7 +89,7 @@ void chCondObjectInit(condition_variable_t *cp) { */
void chCondSignal(condition_variable_t *cp) {
- chDbgCheck(cp != NULL, "chCondSignal");
+ chDbgCheck(cp != NULL);
chSysLock();
if (queue_notempty(&cp->c_queue))
@@ -111,7 +111,7 @@ void chCondSignal(condition_variable_t *cp) { void chCondSignalI(condition_variable_t *cp) {
chDbgCheckClassI();
- chDbgCheck(cp != NULL, "chCondSignalI");
+ chDbgCheck(cp != NULL);
if (queue_notempty(&cp->c_queue))
chSchReadyI(queue_fifo_remove(&cp->c_queue))->p_u.rdymsg = RDY_OK;
@@ -146,7 +146,7 @@ void chCondBroadcast(condition_variable_t *cp) { void chCondBroadcastI(condition_variable_t *cp) {
chDbgCheckClassI();
- chDbgCheck(cp != NULL, "chCondBroadcastI");
+ chDbgCheck(cp != NULL);
/* Empties the condition variable queue and inserts all the threads into the
ready list in FIFO order. The wakeup message is set to @p RDY_RESET in
@@ -204,10 +204,8 @@ msg_t chCondWaitS(condition_variable_t *cp) { msg_t msg;
chDbgCheckClassS();
- chDbgCheck(cp != NULL, "chCondWaitS");
- chDbgAssert(ctp->p_mtxlist != NULL,
- "chCondWaitS(), #1",
- "not owning a mutex");
+ chDbgCheck(cp != NULL);
+ chDbgAssert(ctp->p_mtxlist != NULL, "not owning a mutex");
mp = chMtxUnlockS();
ctp->p_u.wtobjp = cp;
@@ -289,10 +287,8 @@ msg_t chCondWaitTimeoutS(condition_variable_t *cp, systime_t time) { msg_t msg;
chDbgCheckClassS();
- chDbgCheck((cp != NULL) && (time != TIME_IMMEDIATE), "chCondWaitTimeoutS");
- chDbgAssert(currp->p_mtxlist != NULL,
- "chCondWaitTimeoutS(), #1",
- "not owning a mutex");
+ chDbgCheck((cp != NULL) && (time != TIME_IMMEDIATE));
+ chDbgAssert(currp->p_mtxlist != NULL, "not owning a mutex");
mp = chMtxUnlockS();
currp->p_u.wtobjp = cp;
diff --git a/os/kernel/src/chdynamic.c b/os/kernel/src/chdynamic.c index 86e37df14..5f174eda7 100644 --- a/os/kernel/src/chdynamic.c +++ b/os/kernel/src/chdynamic.c @@ -69,7 +69,7 @@ thread_t *chThdAddRef(thread_t *tp) {
chSysLock();
- chDbgAssert(tp->p_refs < 255, "chThdAddRef(), #1", "too many references");
+ chDbgAssert(tp->p_refs < 255, "too many references");
tp->p_refs++;
chSysUnlock();
return tp;
@@ -92,7 +92,7 @@ void chThdRelease(thread_t *tp) { trefs_t refs;
chSysLock();
- chDbgAssert(tp->p_refs > 0, "chThdRelease(), #1", "not referenced");
+ chDbgAssert(tp->p_refs > 0, "not referenced");
refs = --tp->p_refs;
chSysUnlock();
@@ -198,7 +198,7 @@ thread_t *chThdCreateFromMemoryPool(memory_pool_t *mp, tprio_t prio, void *wsp;
thread_t *tp;
- chDbgCheck(mp != NULL, "chThdCreateFromMemoryPool");
+ chDbgCheck(mp != NULL);
wsp = chPoolAlloc(mp);
if (wsp == NULL)
diff --git a/os/kernel/src/chevents.c b/os/kernel/src/chevents.c index d95730f7c..04b0e6fb8 100644 --- a/os/kernel/src/chevents.c +++ b/os/kernel/src/chevents.c @@ -104,7 +104,7 @@ void chEvtRegisterMask(event_source_t *esp, event_listener_t *elp,
eventmask_t mask) {
- chDbgCheck((esp != NULL) && (elp != NULL), "chEvtRegisterMask");
+ chDbgCheck((esp != NULL) && (elp != NULL));
chSysLock();
elp->el_next = esp->es_next;
@@ -131,7 +131,7 @@ void chEvtRegisterMask(event_source_t *esp, void chEvtUnregister(event_source_t *esp, event_listener_t *elp) {
event_listener_t *p;
- chDbgCheck((esp != NULL) && (elp != NULL), "chEvtUnregister");
+ chDbgCheck((esp != NULL) && (elp != NULL));
p = (event_listener_t *)esp;
chSysLock();
@@ -205,7 +205,7 @@ void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags) { event_listener_t *elp;
chDbgCheckClassI();
- chDbgCheck(esp != NULL, "chEvtBroadcastMaskI");
+ chDbgCheck(esp != NULL);
elp = esp->es_next;
while (elp != (event_listener_t *)esp) {
@@ -248,7 +248,7 @@ eventflags_t chEvtGetAndClearFlags(event_listener_t *elp) { */
void chEvtSignal(thread_t *tp, eventmask_t mask) {
- chDbgCheck(tp != NULL, "chEvtSignal");
+ chDbgCheck(tp != NULL);
chSysLock();
chEvtSignalI(tp, mask);
@@ -271,7 +271,7 @@ void chEvtSignal(thread_t *tp, eventmask_t mask) { void chEvtSignalI(thread_t *tp, eventmask_t mask) {
chDbgCheckClassI();
- chDbgCheck(tp != NULL, "chEvtSignalI");
+ chDbgCheck(tp != NULL);
tp->p_epending |= mask;
/* Test on the AND/OR conditions wait states.*/
@@ -335,14 +335,12 @@ eventflags_t chEvtGetAndClearFlagsI(event_listener_t *elp) { void chEvtDispatch(const evhandler_t *handlers, eventmask_t mask) {
eventid_t eid;
- chDbgCheck(handlers != NULL, "chEvtDispatch");
+ chDbgCheck(handlers != NULL);
eid = 0;
while (mask) {
if (mask & EVENT_MASK(eid)) {
- chDbgAssert(handlers[eid] != NULL,
- "chEvtDispatch(), #1",
- "null handler");
+ chDbgAssert(handlers[eid] != NULL, "null handler");
mask &= ~EVENT_MASK(eid);
handlers[eid](eid);
}
diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index c2732376e..abda4ff10 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -108,7 +108,7 @@ void _heap_init(void) { void chHeapObjectInit(memory_heap_t *heapp, void *buf, size_t size) {
union heap_header *hp;
- chDbgCheck(MEM_IS_ALIGNED(buf) && MEM_IS_ALIGNED(size), "chHeapInit");
+ chDbgCheck(MEM_IS_ALIGNED(buf) && MEM_IS_ALIGNED(size));
heapp->h_provider = (memgetfunc_t)NULL;
heapp->h_free.h.u.next = hp = buf;
@@ -204,7 +204,7 @@ void chHeapFree(void *p) { union heap_header *qp, *hp;
memory_heap_t *heapp;
- chDbgCheck(p != NULL, "chHeapFree");
+ chDbgCheck(p != NULL);
hp = (union heap_header *)p - 1;
heapp = hp->h.u.heap;
@@ -212,9 +212,7 @@ void chHeapFree(void *p) { H_LOCK(heapp);
while (true) {
- chDbgAssert((hp < qp) || (hp >= LIMIT(qp)),
- "chHeapFree(), #1",
- "within free block");
+ chDbgAssert((hp < qp) || (hp >= LIMIT(qp)), "within free block");
if (((qp == &heapp->h_free) || (hp > qp)) &&
((qp->h.u.next == NULL) || (hp < qp->h.u.next))) {
diff --git a/os/kernel/src/chmboxes.c b/os/kernel/src/chmboxes.c index 2a6e6fae8..003c779ec 100644 --- a/os/kernel/src/chmboxes.c +++ b/os/kernel/src/chmboxes.c @@ -86,7 +86,7 @@ */
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));
mbp->mb_buffer = mbp->mb_wrptr = mbp->mb_rdptr = buf;
mbp->mb_top = &buf[n];
@@ -105,7 +105,7 @@ void chMBObjectInit(mailbox_t *mbp, msg_t *buf, cnt_t n) { */
void chMBReset(mailbox_t *mbp) {
- chDbgCheck(mbp != NULL, "chMBReset");
+ chDbgCheck(mbp != NULL);
chSysLock();
mbp->mb_wrptr = mbp->mb_rdptr = mbp->mb_buffer;
@@ -166,7 +166,7 @@ msg_t chMBPostS(mailbox_t *mbp, msg_t msg, systime_t time) { msg_t rdymsg;
chDbgCheckClassS();
- chDbgCheck(mbp != NULL, "chMBPostS");
+ chDbgCheck(mbp != NULL);
rdymsg = chSemWaitTimeoutS(&mbp->mb_emptysem, time);
if (rdymsg == RDY_OK) {
@@ -196,7 +196,7 @@ msg_t chMBPostS(mailbox_t *mbp, msg_t msg, systime_t time) { msg_t chMBPostI(mailbox_t *mbp, msg_t msg) {
chDbgCheckClassI();
- chDbgCheck(mbp != NULL, "chMBPostI");
+ chDbgCheck(mbp != NULL);
if (chSemGetCounterI(&mbp->mb_emptysem) <= 0)
return RDY_TIMEOUT;
@@ -259,7 +259,7 @@ msg_t chMBPostAheadS(mailbox_t *mbp, msg_t msg, systime_t time) { msg_t rdymsg;
chDbgCheckClassS();
- chDbgCheck(mbp != NULL, "chMBPostAheadS");
+ chDbgCheck(mbp != NULL);
rdymsg = chSemWaitTimeoutS(&mbp->mb_emptysem, time);
if (rdymsg == RDY_OK) {
@@ -289,7 +289,7 @@ msg_t chMBPostAheadS(mailbox_t *mbp, msg_t msg, systime_t time) { msg_t chMBPostAheadI(mailbox_t *mbp, msg_t msg) {
chDbgCheckClassI();
- chDbgCheck(mbp != NULL, "chMBPostAheadI");
+ chDbgCheck(mbp != NULL);
if (chSemGetCounterI(&mbp->mb_emptysem) <= 0)
return RDY_TIMEOUT;
@@ -352,7 +352,7 @@ msg_t chMBFetchS(mailbox_t *mbp, msg_t *msgp, systime_t time) { msg_t rdymsg;
chDbgCheckClassS();
- chDbgCheck((mbp != NULL) && (msgp != NULL), "chMBFetchS");
+ chDbgCheck((mbp != NULL) && (msgp != NULL));
rdymsg = chSemWaitTimeoutS(&mbp->mb_fullsem, time);
if (rdymsg == RDY_OK) {
@@ -382,7 +382,7 @@ msg_t chMBFetchS(mailbox_t *mbp, msg_t *msgp, systime_t time) { msg_t chMBFetchI(mailbox_t *mbp, msg_t *msgp) {
chDbgCheckClassI();
- chDbgCheck((mbp != NULL) && (msgp != NULL), "chMBFetchI");
+ chDbgCheck((mbp != NULL) && (msgp != NULL));
if (chSemGetCounterI(&mbp->mb_fullsem) <= 0)
return RDY_TIMEOUT;
diff --git a/os/kernel/src/chmempools.c b/os/kernel/src/chmempools.c index 6d84b557e..d92ea7517 100644 --- a/os/kernel/src/chmempools.c +++ b/os/kernel/src/chmempools.c @@ -75,7 +75,7 @@ */
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 *)));
mp->mp_next = NULL;
mp->mp_object_size = size;
@@ -97,7 +97,7 @@ void chPoolObjectInit(memory_pool_t *mp, size_t size, memgetfunc_t provider) { */
void chPoolLoadArray(memory_pool_t *mp, void *p, size_t n) {
- chDbgCheck((mp != NULL) && (n != 0), "chPoolLoadArray");
+ chDbgCheck((mp != NULL) && (n != 0));
while (n) {
chPoolAdd(mp, p);
@@ -120,7 +120,7 @@ void *chPoolAllocI(memory_pool_t *mp) { void *objp;
chDbgCheckClassI();
- chDbgCheck(mp != NULL, "chPoolAllocI");
+ chDbgCheck(mp != NULL);
if ((objp = mp->mp_next) != NULL)
mp->mp_next = mp->mp_next->ph_next;
@@ -164,7 +164,7 @@ void chPoolFreeI(memory_pool_t *mp, void *objp) { struct pool_header *php = objp;
chDbgCheckClassI();
- chDbgCheck((mp != NULL) && (objp != NULL), "chPoolFreeI");
+ chDbgCheck((mp != NULL) && (objp != NULL));
php->ph_next = mp->mp_next;
mp->mp_next = php;
diff --git a/os/kernel/src/chmsg.c b/os/kernel/src/chmsg.c index 1e99cce3f..335b46c61 100644 --- a/os/kernel/src/chmsg.c +++ b/os/kernel/src/chmsg.c @@ -88,7 +88,7 @@ msg_t chMsgSend(thread_t *tp, msg_t msg) {
thread_t *ctp = currp;
- chDbgCheck(tp != NULL, "chMsgSend");
+ chDbgCheck(tp != NULL);
chSysLock();
ctp->p_msg = msg;
@@ -141,8 +141,7 @@ thread_t *chMsgWait(void) { void chMsgRelease(thread_t *tp, msg_t msg) {
chSysLock();
- chDbgAssert(tp->p_state == CH_STATE_SNDMSG,
- "chMsgRelease(), #1", "invalid state");
+ chDbgAssert(tp->p_state == CH_STATE_SNDMSG, "invalid state");
chMsgReleaseS(tp, msg);
chSysUnlock();
}
diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c index 5f7bdfb8d..0eb02e2b5 100644 --- a/os/kernel/src/chmtx.c +++ b/os/kernel/src/chmtx.c @@ -98,7 +98,7 @@ */
void chMtxObjectInit(mutex_t *mp) {
- chDbgCheck(mp != NULL, "chMtxInit");
+ chDbgCheck(mp != NULL);
queue_init(&mp->m_queue);
mp->m_owner = NULL;
@@ -135,7 +135,7 @@ void chMtxLockS(mutex_t *mp) { thread_t *ctp = currp;
chDbgCheckClassS();
- chDbgCheck(mp != NULL, "chMtxLockS");
+ chDbgCheck(mp != NULL);
/* Is the mutex already locked? */
if (mp->m_owner != NULL) {
@@ -194,8 +194,8 @@ void chMtxLockS(mutex_t *mp) { /* It is assumed that the thread performing the unlock operation assigns
the mutex to this thread.*/
- chDbgAssert(mp->m_owner == ctp, "chMtxLockS(), #1", "not owner");
- chDbgAssert(ctp->p_mtxlist == mp, "chMtxLockS(), #2", "not owned");
+ chDbgAssert(mp->m_owner == ctp, "not owner");
+ chDbgAssert(ctp->p_mtxlist == mp, "not owned");
}
else {
/* It was not owned, inserted in the owned mutexes list.*/
@@ -253,7 +253,7 @@ bool chMtxTryLock(mutex_t *mp) { bool chMtxTryLockS(mutex_t *mp) {
chDbgCheckClassS();
- chDbgCheck(mp != NULL, "chMtxTryLockS");
+ chDbgCheck(mp != NULL);
if (mp->m_owner != NULL)
return false;
@@ -280,12 +280,8 @@ mutex_t *chMtxUnlock(void) { chSysLock();
- chDbgAssert(ctp->p_mtxlist != NULL,
- "chMtxUnlock(), #1",
- "owned mutexes list empty");
- chDbgAssert(ctp->p_mtxlist->m_owner == ctp,
- "chMtxUnlock(), #2",
- "ownership failure");
+ chDbgAssert(ctp->p_mtxlist != NULL, "owned mutexes list empty");
+ chDbgAssert(ctp->p_mtxlist->m_owner == ctp, "ownership failure");
/* Removes the top mutex from the thread's owned mutexes list and marks it
as not owned.*/
@@ -344,12 +340,8 @@ mutex_t *chMtxUnlockS(void) { mutex_t *ump, *mp;
chDbgCheckClassS();
- chDbgAssert(ctp->p_mtxlist != NULL,
- "chMtxUnlockS(), #1",
- "owned mutexes list empty");
- chDbgAssert(ctp->p_mtxlist->m_owner == ctp,
- "chMtxUnlockS(), #2",
- "ownership failure");
+ chDbgAssert(ctp->p_mtxlist != NULL, "owned mutexes list empty");
+ chDbgAssert(ctp->p_mtxlist->m_owner == ctp, "ownership failure");
/* Removes the top mutex from the owned mutexes list and marks it as not
owned.*/
diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c index 7cbc63f50..679d69337 100644 --- a/os/kernel/src/chqueues.c +++ b/os/kernel/src/chqueues.c @@ -245,7 +245,7 @@ size_t chIQReadTimeout(input_queue_t *iqp, uint8_t *bp, qnotify_t nfy = iqp->q_notify;
size_t r = 0;
- chDbgCheck(n > 0, "chIQReadTimeout");
+ chDbgCheck(n > 0);
chSysLock();
while (true) {
@@ -425,7 +425,7 @@ size_t chOQWriteTimeout(output_queue_t *oqp, const uint8_t *bp, qnotify_t nfy = oqp->q_notify;
size_t w = 0;
- chDbgCheck(n > 0, "chOQWriteTimeout");
+ chDbgCheck(n > 0);
chSysLock();
while (true) {
diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c index b0d241fee..685d0c109 100644 --- a/os/kernel/src/chregistry.c +++ b/os/kernel/src/chregistry.c @@ -159,8 +159,7 @@ thread_t *chRegNextThread(thread_t *tp) { ntp = NULL;
#if CH_CFG_USE_DYNAMIC
else {
- chDbgAssert(ntp->p_refs < 255, "chRegNextThread(), #1",
- "too many references");
+ chDbgAssert(ntp->p_refs < 255, "too many references");
ntp->p_refs++;
}
#endif
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 53a14dac7..615008589 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -91,7 +91,6 @@ thread_t *chSchReadyI(thread_t *tp) { /* Integrity checks.*/
chDbgAssert((tp->p_state != CH_STATE_READY) &&
(tp->p_state != CH_STATE_FINAL),
- "chSchReadyI(), #1",
"invalid state");
tp->p_state = CH_STATE_READY;
diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c index d25b93822..388e50bc6 100644 --- a/os/kernel/src/chsem.c +++ b/os/kernel/src/chsem.c @@ -98,7 +98,7 @@ */
void chSemObjectInit(semaphore_t *sp, cnt_t n) {
- chDbgCheck((sp != NULL) && (n >= 0), "chSemInit");
+ chDbgCheck((sp != NULL) && (n >= 0));
queue_init(&sp->s_queue);
sp->s_cnt = n;
@@ -150,10 +150,9 @@ void chSemResetI(semaphore_t *sp, cnt_t n) { cnt_t cnt;
chDbgCheckClassI();
- chDbgCheck((sp != NULL) && (n >= 0), "chSemResetI");
+ chDbgCheck((sp != NULL) && (n >= 0));
chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) ||
((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)),
- "chSemResetI(), #1",
"inconsistent semaphore");
cnt = sp->s_cnt;
@@ -198,10 +197,9 @@ msg_t chSemWait(semaphore_t *sp) { msg_t chSemWaitS(semaphore_t *sp) {
chDbgCheckClassS();
- chDbgCheck(sp != NULL, "chSemWaitS");
+ chDbgCheck(sp != NULL);
chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) ||
((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)),
- "chSemWaitS(), #1",
"inconsistent semaphore");
if (--sp->s_cnt < 0) {
@@ -263,10 +261,9 @@ msg_t chSemWaitTimeout(semaphore_t *sp, systime_t time) { msg_t chSemWaitTimeoutS(semaphore_t *sp, systime_t time) {
chDbgCheckClassS();
- chDbgCheck(sp != NULL, "chSemWaitTimeoutS");
+ chDbgCheck(sp != NULL);
chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) ||
((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)),
- "chSemWaitTimeoutS(), #1",
"inconsistent semaphore");
if (--sp->s_cnt < 0) {
@@ -290,10 +287,9 @@ msg_t chSemWaitTimeoutS(semaphore_t *sp, systime_t time) { */
void chSemSignal(semaphore_t *sp) {
- chDbgCheck(sp != NULL, "chSemSignal");
+ chDbgCheck(sp != NULL);
chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) ||
((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)),
- "chSemSignal(), #1",
"inconsistent semaphore");
chSysLock();
@@ -316,10 +312,9 @@ void chSemSignal(semaphore_t *sp) { void chSemSignalI(semaphore_t *sp) {
chDbgCheckClassI();
- chDbgCheck(sp != NULL, "chSemSignalI");
+ chDbgCheck(sp != NULL);
chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) ||
((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)),
- "chSemSignalI(), #1",
"inconsistent semaphore");
if (++sp->s_cnt <= 0) {
@@ -347,10 +342,9 @@ void chSemSignalI(semaphore_t *sp) { void chSemAddCounterI(semaphore_t *sp, cnt_t n) {
chDbgCheckClassI();
- chDbgCheck((sp != NULL) && (n > 0), "chSemAddCounterI");
+ chDbgCheck((sp != NULL) && (n > 0));
chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) ||
((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)),
- "chSemAddCounterI(), #1",
"inconsistent semaphore");
while (n > 0) {
@@ -376,14 +370,12 @@ void chSemAddCounterI(semaphore_t *sp, cnt_t n) { msg_t chSemSignalWait(semaphore_t *sps, semaphore_t *spw) {
msg_t msg;
- chDbgCheck((sps != NULL) && (spw != NULL), "chSemSignalWait");
+ chDbgCheck((sps != NULL) && (spw != NULL));
chDbgAssert(((sps->s_cnt >= 0) && queue_isempty(&sps->s_queue)) ||
((sps->s_cnt < 0) && queue_notempty(&sps->s_queue)),
- "chSemSignalWait(), #1",
"inconsistent semaphore");
chDbgAssert(((spw->s_cnt >= 0) && queue_isempty(&spw->s_queue)) ||
((spw->s_cnt < 0) && queue_notempty(&spw->s_queue)),
- "chSemSignalWait(), #2",
"inconsistent semaphore");
chSysLock();
diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c index a18e82005..073b6eed7 100644 --- a/os/kernel/src/chthreads.c +++ b/os/kernel/src/chthreads.c @@ -183,8 +183,7 @@ thread_t *chThdCreateI(void *wsp, size_t size, chDbgCheckClassI();
chDbgCheck((wsp != NULL) && (size >= THD_WA_SIZE(0)) &&
- (prio <= HIGHPRIO) && (pf != NULL),
- "chThdCreateI");
+ (prio <= HIGHPRIO) && (pf != NULL));
SETUP_CONTEXT(wsp, size, pf, arg);
return _thread_init(tp, prio);
}
@@ -238,7 +237,7 @@ thread_t *chThdCreateStatic(void *wsp, size_t size, tprio_t chThdSetPriority(tprio_t newprio) {
tprio_t oldprio;
- chDbgCheck(newprio <= HIGHPRIO, "chThdSetPriority");
+ chDbgCheck(newprio <= HIGHPRIO);
chSysLock();
#if CH_CFG_USE_MUTEXES
@@ -272,7 +271,6 @@ thread_t *chThdResume(thread_t *tp) { chSysLock();
chDbgAssert(tp->p_state == CH_STATE_SUSPENDED,
- "chThdResume(), #1",
"thread not in CH_STATE_SUSPENDED state");
chSchWakeupS(tp, RDY_OK);
chSysUnlock();
@@ -312,7 +310,7 @@ void chThdTerminate(thread_t *tp) { */
void chThdSleep(systime_t time) {
- chDbgCheck(time != TIME_IMMEDIATE, "chThdSleep");
+ chDbgCheck(time != TIME_IMMEDIATE);
chSysLock();
chThdSleepS(time);
@@ -403,7 +401,7 @@ void chThdExitS(msg_t msg) { #endif
chSchGoSleepS(CH_STATE_FINAL);
/* The thread never returns here.*/
- chDbgAssert(false, "chThdExitS(), #1", "zombies apocalypse");
+ chDbgAssert(false, "zombies apocalypse");
}
#if CH_CFG_USE_WAITEXIT || defined(__DOXYGEN__)
@@ -441,12 +439,12 @@ void chThdExitS(msg_t msg) { msg_t chThdWait(thread_t *tp) {
msg_t msg;
- chDbgCheck(tp != NULL, "chThdWait");
+ chDbgCheck(tp != NULL);
chSysLock();
- chDbgAssert(tp != currp, "chThdWait(), #1", "waiting self");
+ chDbgAssert(tp != currp, "waiting self");
#if CH_CFG_USE_DYNAMIC
- chDbgAssert(tp->p_refs > 0, "chThdWait(), #2", "not referenced");
+ chDbgAssert(tp->p_refs > 0, "not referenced");
#endif
if (tp->p_state != CH_STATE_FINAL) {
list_insert(currp, &tp->p_waiting);
diff --git a/os/kernel/src/chvt.c b/os/kernel/src/chvt.c index 6fa4dd582..3f1559ac4 100644 --- a/os/kernel/src/chvt.c +++ b/os/kernel/src/chvt.c @@ -118,8 +118,7 @@ void chVTDoSetI(virtual_timer_t *vtp, systime_t delay, virtual_timer_t *p;
chDbgCheckClassI();
- chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (delay != TIME_IMMEDIATE),
- "chVTDoSetI");
+ chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (delay != TIME_IMMEDIATE));
vtp->vt_par = par;
vtp->vt_func = vtfunc;
@@ -181,10 +180,8 @@ void chVTDoSetI(virtual_timer_t *vtp, systime_t delay, void chVTDoResetI(virtual_timer_t *vtp) {
chDbgCheckClassI();
- chDbgCheck(vtp != NULL, "chVTDoResetI");
- chDbgAssert(vtp->vt_func != NULL,
- "chVTDoResetI(), #1",
- "timer not set or already triggered");
+ chDbgCheck(vtp != NULL);
+ chDbgAssert(vtp->vt_func != NULL, "timer not set or already triggered");
/* Removing the element from the delta list.*/
vtp->vt_next->vt_delta += vtp->vt_delta;
|