From 17f0815d52977bd1e3e9e662d2ffdccbaf77a6bd Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 21 Feb 2011 18:00:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2756 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chevents.h | 36 ++++++++++++++++++++++++++++++------ os/kernel/include/chmboxes.h | 3 +++ 2 files changed, 33 insertions(+), 6 deletions(-) (limited to 'os/kernel/include') diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h index 6a1cd6106..d934340ab 100644 --- a/os/kernel/include/chevents.h +++ b/os/kernel/include/chevents.h @@ -55,6 +55,11 @@ typedef struct EventSource { Source. */ } EventSource; +/** + * @brief Event Handler callback function. + */ +typedef void (*evhandler_t)(eventid_t); + /** * @brief Data part of a static event source initializer. * @details This macro should be used when statically initializing an event @@ -119,9 +124,28 @@ typedef struct EventSource { ((void *)(esp) != (void *)(esp)->es_next) /** - * @brief Event Handler callback function. + * @brief Signals all the Event Listeners registered on the specified Event + * Source. + * + * @param[in] esp pointer to the @p EventSource structure + * + * @api */ -typedef void (*evhandler_t)(eventid_t); +#define chEvtBroadcast(esp) chEvtBroadcastFlags(esp, 0) + +/** + * @brief Signals all the Event Listeners registered on the specified Event + * Source. + * @post This function does not reschedule so a call to a rescheduling + * function must be performed before unlocking the kernel. Note that + * interrupt handlers always reschedule on exit so an explicit + * reschedule must not be performed in ISRs. + * + * @param[in] esp pointer to the @p EventSource structure + * + * @iclass + */ +#define chEvtBroadcastI(esp) chEvtBroadcastFlagsI(esp, 0) #ifdef __cplusplus extern "C" { @@ -132,10 +156,10 @@ extern "C" { void chEvtUnregister(EventSource *esp, EventListener *elp); eventmask_t chEvtClearFlags(eventmask_t mask); eventmask_t chEvtAddFlags(eventmask_t mask); - void chEvtSignal(Thread *tp, eventmask_t mask); - void chEvtSignalI(Thread *tp, eventmask_t mask); - void chEvtBroadcast(EventSource *esp); - void chEvtBroadcastI(EventSource *esp); + void chEvtSignalFlags(Thread *tp, eventmask_t mask); + void chEvtSignalFlagsI(Thread *tp, eventmask_t mask); + void chEvtBroadcastFlags(EventSource *esp, eventmask_t mask); + void chEvtBroadcastFlagsI(EventSource *esp, eventmask_t mask); void chEvtDispatch(const evhandler_t *handlers, eventmask_t mask); #if CH_OPTIMIZE_SPEED || !CH_USE_EVENTS_TIMEOUT eventmask_t chEvtWaitOne(eventmask_t mask); diff --git a/os/kernel/include/chmboxes.h b/os/kernel/include/chmboxes.h index ce3f238be..fcd26597d 100644 --- a/os/kernel/include/chmboxes.h +++ b/os/kernel/include/chmboxes.h @@ -60,10 +60,13 @@ extern "C" { void chMBReset(Mailbox *mbp); msg_t chMBPost(Mailbox *mbp, msg_t msg, systime_t timeout); msg_t chMBPostS(Mailbox *mbp, msg_t msg, systime_t timeout); + msg_t chMBPostI(Mailbox *mbp, msg_t msg); msg_t chMBPostAhead(Mailbox *mbp, msg_t msg, systime_t timeout); msg_t chMBPostAheadS(Mailbox *mbp, msg_t msg, systime_t timeout); + msg_t chMBPostAheadI(Mailbox *mbp, msg_t msg); msg_t chMBFetch(Mailbox *mbp, msg_t *msgp, systime_t timeout); msg_t chMBFetchS(Mailbox *mbp, msg_t *msgp, systime_t timeout); + msg_t chMBFetchI(Mailbox *mbp, msg_t *msgp); #ifdef __cplusplus } #endif -- cgit v1.2.3