I am writing a Linux kernel patch which uses cmpxchg to speed up a few cases besides fixing a few semantic issues, However I’ve noted that certain architectures only support xchg and not cmpxchg, How do i determine at compile time if the architecture the kernel is being compiled for supports cmpxchg in hardware or not ?
Share
How about
#ifdef __HAVE_ARCH_CMPXCHG?