I agree with Nicolas on this. It's abominably clever, but I think he's right.
The one place I remain unconvinced is over the issue of preemption of a process
that is in the middle of cnt32_to_63(), where if the preempted process is
asleep for long enough, I think it can wind time backwards when it resumes, but
that's not a problem for the one place I want to use it (sched_clock()) because
that is (almost) always called with preemption disabled in one way or another.
The one place it isn't is a debugging case that I'm not too worried about.
Absolutely.
David
--