This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to register timer DSR


On Fri, 2003-06-13 at 11:17, mohanlal jangir wrote:
> > > Hi,
> > > I want a call back function to be called every 10ms.
> 
> > http://ecos.sourceware.org/ecos/docs-latest/ref/kernel-alarms.html
> > You can see an example in the eCos examples, which comes with eCos. Look
> > at simple-alarm.c.
> > Jifl
> 
> Thanks Jonathan for your quick response. I want to know if the function
> test_alarm_func (the alarm handler in example simple-alarm.c) is called in
> interrut context?

Did you read the document from the reference jifl send you ? Just copy
and paste ...

"The alarm function is invoked when a counter tick occurs, in other
words when there is a call to cyg_counter_tick, and will happen in the
same context. If the alarm is associated with the system's real-time
clock then this will be DSR context, following a clock interrupt. If the
alarm is associated with some other application-specific counter then
the details will depend on how that counter is updated."

Read a little more and make sure you understand the clock and counter
mechanism. Basically, the alarm function will run in the context of
whatever "ticks" the counter, which can be anything, depending on how
you set it up.

Bob


> Basically I want to know if some other function can be called (or
> rescheduling is possible), when test_alarm_func is getting executed.
> 
> Does the following code have synchronisation problem?
> 
> test_alarm_func( ) {
>     access critical data    /* no locks here */
> }
> 
> another_function ( ) {
>     lock schedular
>     access critical data
>     unlock schedular
> }
> 
> one_more_function ( ) {
>     lock schedular
>     access critical data
>     unlock schedular
> }
-- 
----------------------------------------------------------------------
ir. Bob Koninckx
Katholieke Universiteit Leuven
Division Production Engineering,                   tel.  +32 16 322535
Machine Design and Automation                      fax.  +32 16 322987
Celestijnenlaan 300B                  bob.koninckx@mech.kuleuven.ac.be
B-3001 Leuven Belgium               http://www.mech.kuleuven.ac.be/pma
----------------------------------------------------------------------



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]