Is it correct to store MSR in context switch?

VALETTE Eric valette at crf.canon.fr
Thu Jan 24 08:45:56 UTC 2002


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
                                 FRANCE
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




More information about the users mailing list