Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个 Linux 内核补丁,它使用 cmpxchg 来加速一些情况,除了修复一些语义问题,但是我注意到某些架构只支持 xchg 而不是 cmpxchg,我如何在编译时确定架构是否内核是否正在编译是否支持硬件中的 cmpxchg?
怎么样#ifdef __HAVE_ARCH_CMPXCHG?
#ifdef __HAVE_ARCH_CMPXCHG