[PATCH] unify x86/x86-64 semaphore code