AnsweredAssumed Answered

Question about switching task on mpc8306

Question asked by mao jiu on Aug 13, 2014
Latest reply on Aug 19, 2014 by mao jiu

I am porting some embedded system to mpc8306 and  switch my tasks in the function handling timer interrupt. I  know that the basic concept of task switching is to save the values of all the registers working for current task  and reload the values of the registers for another task. Since all the register should be saved for current task to the task's stack,  I think the meaning of  the first several statements in the timer interrupt function should be like "lwz  r1,(address of current task stack) ".  Thus, my question is: how can I save the value of "r1" since it is written before I get the stack address ?

 

Outcomes