[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is it correct to store MSR in context switch?

leonp wrote:

> Hello, all.
> 	I encountered the following problem (MPC860, RTEMS 20001201 but this seems 
> to be not touched):
> 	The Machine Status Register is saved each time the context switch is 
> performed. This leads to the following unexpected result - if in one task the 
> _ISR_Disable(arg) is used, it may be neutralized by the task switch. One can 
> say, that this is very unusual thing to disable interrupts in the running 
> system still doing task switching. But this is not an impossible case - I 
> need it :-)).
> 	Will it cause any harm if the MSR register will not be saved in context 
> switches? It does not seem to contain any task specific information...

Yes this will in general : the MSR status is a thread attribute that 
shall not be lost. It contains for example the FP status (enabled 
disabled, single stepping) that you cannot lost when switching back.

   /  `                          Eric Valette - Canon CRF
  /--   __  o _.                 Product Dev. Group Software Team Leader
(___, / (_(_(__                 Rue de la touche lambert
                                 35517 Cesson-Sevigne  Cedex
Tel: +33 (0)2 99 87 68 91       Fax: +33 (0)2 99 84 11 30
E-mail: valette at crf.canon.fr    http://www.crf.canon.fr