+ -
当前位置:首页 → 问答吧 → 跪求AT&T一段代码含义?

跪求AT&T一段代码含义?

时间:2010-11-30

来源:互联网

/* Conditionally execute fence after interlocked instruction. */
static INLINE void
AtomicEpilogue(void)
{
#ifdef ATOMIC_USE_FENCE
#ifdef VMM
      /* The monitor conditionally patches out the lfence when not needed.*/
      /* Construct a MonitorPatchTextEntry in the .patchtext section. */
   asm volatile ("1:\n\t"
                 "lfence\n\t"
                 "2:\n\t"
                 ".pushsection .patchtext\n\t"
                 ".quad 1b\n\t"
                 ".quad 2b\n\t"
                 ".popsection\n\t" ::: "memory");
#else
   if (UNLIKELY(AtomicUseFence)) {
      asm volatile ("lfence" ::: "memory");
   }
#endif
#endif

上面这段代码看不懂

作者: lileishitou   发布时间: 2010-11-30

最好说明下代码执行的环境,具体哪里不懂?不是已经有了一些注释了。。。

作者: accessory   发布时间: 2010-12-02