From: aleph Date: Mon, 7 Jun 2004 15:58:00 +0000 (+0000) Subject: Add function prototypes X-Git-Tag: 1.0.0~1205 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=f5944176b5a027ad5d7922429f0045f797b0b727;p=bertos.git Add function prototypes git-svn-id: https://src.develer.com/svnoss/bertos/trunk@36 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/timer.h b/drv/timer.h index 3484c5a6..f7fb4bff 100755 --- a/drv/timer.h +++ b/drv/timer.h @@ -15,6 +15,9 @@ /* * $Log$ + * Revision 1.5 2004/06/07 15:57:12 aleph + * Add function prototypes + * * Revision 1.4 2004/06/06 18:25:44 bernie * Rename event macros to look like regular functions. * @@ -47,6 +50,7 @@ typedef struct Timer Event expire; /*!< Event to execute when the timer expires */ } Timer; +/* Function protos */ extern void timer_init(void); extern Timer *timer_new(void); extern void timer_delete(Timer *timer); @@ -56,14 +60,19 @@ extern void timer_delay(time_t time); extern void timer_udelay(utime_t utime); INLINE time_t timer_gettick(void); INLINE time_t timer_gettick_irq(void); +INLINE void timer_set_event_softint(Timer* timer, Hook func, void* user_data); +INLINE void timer_set_delay(Timer* timer, time_t delay); + +#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS -#ifdef CONFIG_KERN_SIGNALS /*! Set the timer so that it sends a signal when it expires */ +INLINE void timer_set_event_signal(Timer* timer, struct Process* proc, sigset_t sigs); INLINE void timer_set_event_signal(Timer* timer, struct Process* proc, sigset_t sigs) { event_initSignal(&timer->expire, proc, sigs); } -#endif + +#endif /* CONFIG_KERN_SIGNALS */ /*! Set the timer so that it calls an user hook when it expires */ INLINE void timer_set_event_softint(Timer* timer, Hook func, void* user_data) diff --git a/kern/event.h b/kern/event.h index cfb81ad8..e1196c9e 100755 --- a/kern/event.h +++ b/kern/event.h @@ -18,6 +18,9 @@ /* * $Log$ + * Revision 1.4 2004/06/07 15:58:00 aleph + * Add function prototypes + * * Revision 1.3 2004/06/06 18:25:44 bernie * Rename event macros to look like regular functions. * @@ -84,6 +87,7 @@ typedef struct Event ((e)->action = EVENT_IGNORE) /*! Same as event_initNone(), but returns the initialized event */ +INLINE Event event_createNone(void); INLINE Event event_createNone(void) { Event e; @@ -96,6 +100,7 @@ INLINE Event event_createNone(void) ((e)->action = EVENT_SOFTINT,(e)->Ev.Int.func = (f), (e)->Ev.Int.user_data = (u)) /*! Same as event_initSoftInt(), but returns the initialized event */ +INLINE Event event_createSoftInt(Hook func, void* user_data); INLINE Event event_createSoftInt(Hook func, void* user_data) { Event e; @@ -113,6 +118,7 @@ INLINE Event event_createSoftInt(Hook func, void* user_data) ((e)->action = EVENT_SIGNAL,(e)->Ev.Sig.sig_proc = (p), (e)->Ev.Sig.sig_bit = (s)) /*! Same as event_initSignal(), but returns the initialized event */ +INLINE Event event_createSignal(struct Process* proc, sig_t bit); INLINE Event event_createSignal(struct Process* proc, sig_t bit) { Event e;