aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-16 16:15:47 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-16 16:15:47 +0000
commit195a9c7951c29828d7eddefcd77d7a98d18f75f3 (patch)
tree3d35476b307e444dba02720f3503be1e6c6c2296 /src
parentda365c95e4460bda1f5b49a2e55ae144da1faf3f (diff)
downloadChibiOS-195a9c7951c29828d7eddefcd77d7a98d18f75f3.tar.gz
ChibiOS-195a9c7951c29828d7eddefcd77d7a98d18f75f3.tar.bz2
ChibiOS-195a9c7951c29828d7eddefcd77d7a98d18f75f3.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@94 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r--src/chevents.c4
-rw-r--r--src/chschd.c9
-rw-r--r--src/include/events.h6
3 files changed, 12 insertions, 7 deletions
diff --git a/src/chevents.c b/src/chevents.c
index 5f7ce6aaa..e6d957700 100644
--- a/src/chevents.c
+++ b/src/chevents.c
@@ -136,7 +136,7 @@ void chEvtSendI(EventSource *esp) {
* an higher priority.
*/
t_eventid chEvtWait(t_eventmask ewmask,
- t_evhandler handlers[]) {
+ const t_evhandler handlers[]) {
t_eventid i;
t_eventmask m;
@@ -191,7 +191,7 @@ static void wakeup(void *p) {
* option is enabled in \p chconf.h.
*/
t_eventid chEvtWaitTimeout(t_eventmask ewmask,
- t_evhandler handlers[],
+ const t_evhandler handlers[],
t_time time) {
t_eventid i;
t_eventmask m;
diff --git a/src/chschd.c b/src/chschd.c
index d3b112cf1..a6299644e 100644
--- a/src/chschd.c
+++ b/src/chschd.c
@@ -61,13 +61,17 @@ void chSchInit(void) {
* be called soon after.
* @note The function is not meant to be used in the user code directly.
*/
+#ifdef CH_OPTIMIZE_SPEED
+/* NOTE: it is inlined in this module only.*/
+INLINE Thread *chSchReadyI(Thread *tp) {
+#else
Thread *chSchReadyI(Thread *tp) {
- Thread *cp;
+#endif
+ Thread *cp = rlist.r_queue.p_prev;
t_prio prio = tp->p_prio;
tp->p_state = PRREADY;
tp->p_rdymsg = RDY_OK;
- cp = rlist.r_queue.p_prev;
while (cp->p_prio < prio)
cp = cp->p_prev;
// Insertion on p_next
@@ -79,6 +83,7 @@ Thread *chSchReadyI(Thread *tp) {
/*
* Switches to the next thread in the ready list, the ready list is assumed
* to contain at least a thread.
+ * NOTE: it is inlined in this module only.
*/
#ifdef CH_OPTIMIZE_SPEED
static INLINE void nextready(void) {
diff --git a/src/include/events.h b/src/include/events.h
index 94b277692..78b695910 100644
--- a/src/include/events.h
+++ b/src/include/events.h
@@ -85,11 +85,11 @@ extern "C" {
void chEvtSend(EventSource *esp);
void chEvtSendI(EventSource *esp);
t_eventid chEvtWait(t_eventmask ewmask,
- t_evhandler handlers[]);
+ const t_evhandler handlers[]);
#ifdef CH_USE_EVENTS_TIMEOUT
t_eventid chEvtWaitTimeout(t_eventmask ewmask,
- t_evhandler handlers[],
- t_time time);
+ const t_evhandler handlers[],
+ t_time time);
#endif
#ifdef __cplusplus
}