diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/Linux/console.c | 3 | ||||
-rw-r--r-- | os/hal/platforms/Win32/console.c | 3 | ||||
-rw-r--r-- | os/kernel/include/events.h | 6 | ||||
-rw-r--r-- | os/kernel/src/chregistry.c | 9 |
4 files changed, 13 insertions, 8 deletions
diff --git a/os/hal/platforms/Linux/console.c b/os/hal/platforms/Linux/console.c index 7c6bd705d..20443dcaf 100644 --- a/os/hal/platforms/Linux/console.c +++ b/os/hal/platforms/Linux/console.c @@ -107,8 +107,7 @@ static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t time) { }
static const struct BaseChannelVMT vmt = {
- {writes, reads},
- {putwouldblock, getwouldblock, putt, gett, writet, readt}
+ writes, reads, putwouldblock, getwouldblock, putt, gett, writet, readt
};
/*===========================================================================*/
diff --git a/os/hal/platforms/Win32/console.c b/os/hal/platforms/Win32/console.c index 7c6bd705d..20443dcaf 100644 --- a/os/hal/platforms/Win32/console.c +++ b/os/hal/platforms/Win32/console.c @@ -107,8 +107,7 @@ static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t time) { }
static const struct BaseChannelVMT vmt = {
- {writes, reads},
- {putwouldblock, getwouldblock, putt, gett, writet, readt}
+ writes, reads, putwouldblock, getwouldblock, putt, gett, writet, readt
};
/*===========================================================================*/
diff --git a/os/kernel/include/events.h b/os/kernel/include/events.h index b333e07c5..42f415b73 100644 --- a/os/kernel/include/events.h +++ b/os/kernel/include/events.h @@ -145,9 +145,9 @@ extern "C" { #endif
#if !CH_OPTIMIZE_SPEED && CH_USE_EVENTS_TIMEOUT
-#define chEvtWaitOne(ewmask) chEvtWaitOneTimeout(emask, TIME_INFINITE)
-#define chEvtWaitAny(ewmask) chEvtWaitAnyTimeout(emask, TIME_INFINITE)
-#define chEvtWaitAll(ewmask) chEvtWaitAllTimeout(emask, TIME_INFINITE)
+#define chEvtWaitOne(mask) chEvtWaitOneTimeout(mask, TIME_INFINITE)
+#define chEvtWaitAny(mask) chEvtWaitAnyTimeout(mask, TIME_INFINITE)
+#define chEvtWaitAll(mask) chEvtWaitAllTimeout(mask, TIME_INFINITE)
#endif
#endif /* CH_USE_EVENTS */
diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c index 05573acbf..b6555df40 100644 --- a/os/kernel/src/chregistry.c +++ b/os/kernel/src/chregistry.c @@ -43,7 +43,10 @@ Thread *chRegFirstThread(void) { Thread *tp;
chSysLock();
- (tp = rlist.p_newer)->p_refs++;
+ tp = rlist.p_newer;
+#if CH_USE_DYNAMIC
+ tp->p_refs++;
+#endif
chSysUnlock();
return tp;
}
@@ -60,14 +63,18 @@ Thread *chRegFirstThread(void) { Thread *chRegNextThread(Thread *tp) {
chSysLock();
+#if CH_USE_DYNAMIC
chDbgAssert(tp->p_refs > 0, "chRegNextThread(), #1",
"not referenced");
tp->p_refs--;
+#endif
if (tp->p_newer != (Thread *)&rlist) {
tp = tp->p_newer;
+#if CH_USE_DYNAMIC
chDbgAssert(tp->p_refs < 255, "chRegNextThread(), #2",
"too many references");
tp->p_refs++;
+#endif
}
else
tp = NULL;
|