diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/events.h | 5 | ||||
| -rw-r--r-- | src/include/scheduler.h | 10 | ||||
| -rw-r--r-- | src/include/threads.h | 8 |
3 files changed, 9 insertions, 14 deletions
diff --git a/src/include/events.h b/src/include/events.h index c5dfe7438..322f7ec7d 100644 --- a/src/include/events.h +++ b/src/include/events.h @@ -70,7 +70,7 @@ typedef struct EventSource { * @note Can be called with interrupts disabled or enabled.
*/
#define chEvtIsListening(esp) \
- ((esp) != (EventSource *)(esp)->es_next)
+ ((esp) != (EventSource *)(esp)->es_next)
/** Event Handler callback function.*/
@@ -81,7 +81,8 @@ void chEvtUnregister(EventSource *esp, EventListener *elp); void chEvtClear(t_eventmask mask);
void chEvtSend(EventSource *esp);
void chEvtSendI(EventSource *esp);
-t_eventid chEvtWait(t_eventmask ewmask, t_evhandler handlers[]);
+t_eventid chEvtWait(t_eventmask ewmask,
+ t_evhandler handlers[]);
#ifdef CH_USE_EVENTS_TIMEOUT
t_eventid chEvtWaitTimeout(t_eventmask ewmask,
t_evhandler handlers[],
diff --git a/src/include/scheduler.h b/src/include/scheduler.h index 2efabbcd2..6a3f7f8f8 100644 --- a/src/include/scheduler.h +++ b/src/include/scheduler.h @@ -32,18 +32,14 @@ /** Returned if the thread was made ready because a reset.*/
#define RDY_RESET -2
-#define firstprio(qp) ((qp)->p_next->p_prio)
+#define firstprio(rlp) ((rlp)->p_next->p_prio)
/**
* Ready list header.
*/
typedef struct {
- /** Highest priority \p Thread in the list.*/
- Thread *p_next;
- /** Lowest priority \p Thread in the list.*/
- Thread *p_prev;
- /** Alwas set to \p MAXPRIO.*/
- t_prio p_prio;
+ ThreadsQueue r_queue;
+ t_prio r_prio;
} ReadyList;
/*
diff --git a/src/include/threads.h b/src/include/threads.h index beb41aae7..12737de2e 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -78,7 +78,7 @@ struct Thread { * systems, be caruful in doing so.
*/
#ifdef CH_USE_WAITEXIT
- /** The queue of the threads waiting for this thread termination.*/
+ /** The list of the threads waiting for this thread termination.*/
ThreadsList p_waiting;
#endif
#ifdef CH_USE_EXIT_EVENT
@@ -151,10 +151,8 @@ typedef t_msg (*t_tfunc)(void *); #ifdef CH_OPTIMIZE_SPEED
static INLINE void fifo_insert(Thread *tp, ThreadsQueue *tqp) {
- tp->p_next = (Thread *)tqp;
- tp->p_prev = tqp->p_prev;
- tqp->p_prev->p_next = tp;
- tqp->p_prev = tp;
+ tp->p_prev = (tp->p_next = (Thread *)tqp)->p_prev;
+ tp->p_prev->p_next = tqp->p_prev = tp;
}
static INLINE Thread *fifo_remove(ThreadsQueue *tqp) {
|
