aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-02-12 18:51:48 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-02-12 18:51:48 +0000
commit4d832fdf1c1ca932d16198df7b3c04dcd083e7e2 (patch)
tree39536ef89e04c6e25e29ad18fd0f1b6833d84cd5 /os
parent50254892c53ac6fee9106c3362b2990505420189 (diff)
downloadChibiOS-4d832fdf1c1ca932d16198df7b3c04dcd083e7e2.tar.gz
ChibiOS-4d832fdf1c1ca932d16198df7b3c04dcd083e7e2.tar.bz2
ChibiOS-4d832fdf1c1ca932d16198df7b3c04dcd083e7e2.zip
Few fixes to the new code after the batch build test.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1592 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/Linux/console.c3
-rw-r--r--os/hal/platforms/Win32/console.c3
-rw-r--r--os/kernel/include/events.h6
-rw-r--r--os/kernel/src/chregistry.c9
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;