Why _ThreadProcessSignalsFromIrq() in new exception processing?

Valette Eric eric.valette at free.fr
Mon Feb 10 16:38:53 UTC 2003


Sergei Organov wrote:

> Where _ThreadProcessSignalsFromIrq currently does basically the same thing as
> the _Thread_Dispatch would do if no context switch is necessary, so from
> functional point of view it could be considered as an optimized version of
> _Thread_Dispatch.

Yes it is a kind of optmisation...

>>From the point of view of observable behavior, there are two differences
> between these two methods (differences between _Thread_Dispatch and
> _ThreadProcessSignalsFromIrq aside):
> 
> D1. The latter method always stores the whole (exception) context before
>     calling _ThreadProcessSignalsFromIrq.

But only on a path that is documented to be very unfrequent (send a 
signal to myself from ISR)

> D2. The latter method fails to reset _ISR_Signals_to_thread_executing to FALSE
>     if _Context_Switch_necessary is non-zero.

But do you have executed the post switch code on the right thread in 
that case? I guess will be executed once the thread is resumed but did 
not read the code yet to be affirmative...


> These differences lead to the following questions:
> 
> 1. Is the whole (exception) context is *strictly required* at the call to
>    _Thread_Dispatch when _ISR_Signals_to_thread_executing is non-zero from the
>    point of view of correct behavior of the rest of RTEMS (including POSIX
>    signals and Ada runtime)?

strictly speaking, you do not need to push a context in current rtems 
code without some other code I never posted (beginning of kernel 
debugger). But again this path is so infrequent that you can forget it 
as far as performance are concerned...


> 2. Should FPU context be stored along with the whole (exception) context?

This can be deffered until you execute some floating point instruction...

> 3. Is the difference (D2) a bug? If yes, the bug in the former code or in
>    the later?

Good question!!! I think the later has a bug  i should clear it also  :-(

BTW : the clearing of_ISR_Signals_to_thread_executing should be done 
inside the _Thread_Dispatch to avoid errors like this one...


-- 
    __
   /  `                   	Eric Valette
  /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: eric.valette at free.fr









More information about the users mailing list