fix race condition in hwtimer_spin
improve fix and comment
save one long
Revert "Use GCC/Clang builtins for bit arithmetics"

This reverts commit 18e97f6dd5457538c7bf39c6abcf346f5a080ca5.
initial import
fixup