Thanks for the quick reply, Miro. I had overlooked your point about the race condition in my initial implementation. On further investigation of the reference manual for my particular Coldfire part I found this passage:
"Unlike the M68000 family, all ColdFire processors guarantee that the first instruction of the service routine
is executed before sampling for interrupts is resumed. By making this initial instruction a load of the SR,
interrupts can be safely disabled if required."
If I code the QK_ISR_ENTRY() macro to have the first insruction set the status register interrupt level to 7 (masking all ints below this level) I think that should prevent any other interrupts (except processor exceptions) from firing while I increase QK_intNest_ variable.
All Coldfire parts with that support the ISA_A+ or ISA_C instuction sets have the STLDSA instruction that stores the current status register value on the stack and loads it with a new value. This might be the way to go, but I need to do a little more investigation.
One question, is the QK_intNest_ variable used to determine when to call the scheduler (i.e. only when it is 0)? Does it have other uses?