Welcome, Guest. Please login or register.

Author Topic: Coldfire status  (Read 8512 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show all replies
Re: Coldfire status
« on: May 13, 2006, 10:32:11 PM »
Quote
For example, IDNestCnt and TDNestCnt have to be LONG since addq.b does not exist on CF and you cannot replace the addq.b by multiple instructions : the update of IDNestCnt and TDNestCnt must be done with one atomic instruction.


I used to think so, too, but then started to guess that they probably do not need to be atomic. The reason being that despite context switches (task - task, task - interrupt) they are saved/restored and so if a context is left and later returned to the IDNestCnt/TDNestCnt value is the same as it used to be when context was left.

They would need to be atomic if a context switch could cause a change of value.

context 1:
  read idnestcnt to register
  inc register
  [context switch to something else]
  [context switch back to here]
  /* no problem, as idnestcnt is same as when context was    left */
  write register to idnestcnt