From: arighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537> Date: Mon, 14 Mar 2011 12:01:07 +0000 (+0000) Subject: signal: move some of the API documentation in signal.h X-Git-Tag: 2.7.0~199 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=505448bf486b73df77f0fc8a3b596f35657602b5;p=bertos.git signal: move some of the API documentation in signal.h git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4767 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index 3fa8d370..26805b5f 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -246,16 +246,6 @@ INLINE void __sig_signal(Signal *s, Process *proc, sigmask_t sigs, bool wakeup) IRQ_RESTORE(flags); } -/** - * Send the signals \a sigs to the process \a proc and immeditaly dispatch it - * for execution. - * - * The process will be awoken if it was waiting for any of them and immediately - * dispatched for execution. - * - * \note This function can't be called from IRQ context, use sig_post() - * instead. - */ void sig_sendSignal(Signal *s, Process *proc, sigmask_t sigs) { ASSERT_USER_CONTEXT(); @@ -265,12 +255,6 @@ void sig_sendSignal(Signal *s, Process *proc, sigmask_t sigs) __sig_signal(s, proc, sigs, true); } -/** - * Send the signals \a sigs to the process \a proc. - * The process will be awoken if it was waiting for any of them. - * - * \note This call is interrupt safe. - */ void sig_postSignal(Signal *s, Process *proc, sigmask_t sigs) { __sig_signal(s, proc, sigs, false); diff --git a/bertos/kern/signal.h b/bertos/kern/signal.h index 2c51f9e8..c6136041 100644 --- a/bertos/kern/signal.h +++ b/bertos/kern/signal.h @@ -84,6 +84,11 @@ INLINE sigmask_t sig_checkSignal(Signal *s, sigmask_t sigs) return result; } +/** + * Check if any of the signals in \a sigs has occurred and clear them. + * + * \return the signals that have occurred. + */ INLINE sigmask_t sig_check(sigmask_t sigs) { Process *proc = proc_current(); @@ -92,6 +97,16 @@ INLINE sigmask_t sig_check(sigmask_t sigs) void sig_sendSignal(Signal *s, Process *proc, sigmask_t sig); +/** + * Send the signals \a sigs to the process \a proc and immeditaly dispatch it + * for execution. + * + * The process will be awoken if it was waiting for any of them and immediately + * dispatched for execution. + * + * \note This function can't be called from IRQ context, use sig_post() + * instead. + */ INLINE void sig_send(Process *proc, sigmask_t sig) { sig_sendSignal(&proc->sig, proc, sig); @@ -99,6 +114,12 @@ INLINE void sig_send(Process *proc, sigmask_t sig) void sig_postSignal(Signal *s, Process *proc, sigmask_t sig); +/** + * Send the signals \a sigs to the process \a proc. + * The process will be awoken if it was waiting for any of them. + * + * \note This call is interrupt safe. + */ INLINE void sig_post(Process *proc, sigmask_t sig) { sig_postSignal(&proc->sig, proc, sig); @@ -115,6 +136,11 @@ INLINE void sig_signal(Process *proc, sigmask_t sig) sigmask_t sig_waitSignal(Signal *s, sigmask_t sigs); +/** + * Sleep until any of the signals in \a sigs occurs. + * + * \return the signal(s) that have awoken the process. + */ INLINE sigmask_t sig_wait(sigmask_t sigs) { Process *proc = proc_current();