From 195a9c7951c29828d7eddefcd77d7a98d18f75f3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 16 Nov 2007 16:15:47 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@94 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chevents.c | 4 ++-- src/chschd.c | 9 +++++++-- src/include/events.h | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src') 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 } -- cgit v1.2.3