This is the mail archive of the ecos-discuss@sourceware.org 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: ecos and gettimeofday()


Andrew Lunn <andrew@lunn.ch> writes:

> > Additionally I'd like to move the rest of misc.c into its own 
> > CYGPKG_POSIX_MISC component, but I haven't figured out yet what 
> > cyg_posix_function_start() and cyg_posix_function_finish() exactly do.
> > What are they required for ?
> 
> Good question. They are only used in the io/fileio. They are called
> when entering or existing all fileio functions. 
> 
> They disable and enable ASR. Why i don't know. That is a question for
> Nick...

They are used mainly to control the delivery of signals.

As far as the POSIX standard is concerned, most IO calls are atomic,
reflecting their implementation in Unix as system call traps. In eCos
these calls are often composed of a sequence of calls on other
subsystems. If a signal handler is delivered at an arbitrary point, it
may longjump out, or make other calls which will leave some
unsuspecting eCos subsystem with inconsistent data structures. To
avoid this the sensitive functions use cyg_posix_function_start() and
_finish() to block ASR and signal delivery.

Any signals that get queued for a thread will only be delivered during
the _finish() call, although the thread may still be knocked out of
any wait it is in regardless of the subsystem it is currently
executing.


-- 
Nick Garnett                                eCos Kernel Architect
http://www.ecoscentric.com           The eCos and RedBoot experts
>>>> Visit us at stand 230 at The Embedded Systems Show 2005 <<<<
>>>> Oct 19-20 NEC, Birmingham, UK http://www.embedded.co.uk <<<<


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


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