This is the mail archive of the ecos-patches@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: [PATCH] move cyg_posix_function_start() and _finish() from misc.cxx to pthread.cxx


Hi,

On Thursday 27 October 2005 20:59, you wrote:
> On Wed, Oct 26, 2005 at 09:22:09PM +0200, Alexander Neundorf wrote:
> > Hi,
> >
> > the functions cyg_posix_function_start() and _finish() from
> > compat/posix/current/src/misc.cxx deal with ASR handling and nothing
> > else. From checking the eCos code it seems the only two files which use
> > ASRs are pthread.cxx and signal.cxx in the POSIX package.
>
> You missed that the fileio package makes use of them.
>
> > So IMO cyg_posix_function_start() and _finish() should be moved to
> > pthread.cxx, so that they are only compiled and used if they are actually
> > required.
>
> They are currently only used if actually required. The linker will
> only pull them into the image if something calls them. So i don't
> really see the point of the patch. It does not make the image smaller
> and it does not aid maintainability.

Maybe I didn't understand the two functions correctly. 
That's how I understand the mechanism:  _start() and _finish() do some stuff 
to enable correct handling of ASRs. The only two places where set_asr() or 
set_asr_pending() is called is in pthread.cxx and signal.cxx (POSIX signal 
delivery, POSIX timers and pthread cancellation I think). 
In fileio and stdio _start() and _finish() are called to enable correct 
handling of the ASRs. But since ASRs can only be caused by pthread.cxx and 
signal.cxx the _start() and _finish() functions actually only need to be 
called if pthread.cxx or signal.cxx are active. 
As it is now, if just the POSIX package is active but not pthread.cxx and 
signal.cxx, the _start() and _finish() function are called e.g. in fileio, 
but since there is no one causing ASRs, it's of no use. But the linker won't 
throw them away because they are called.

Where did I get it wrong ?

Bye
Alex
-- 
Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de
Home: neundorf@kde.org                - http://www.kde.org
      alex@neundorf.net               - http://www.neundorf.net


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