All pastes #47638 Raw Edit

Someone

public text v1 · immutable
#47638 ·published 2006-03-30 23:17 UTC
rendered paste body
#if defined ( __i386__)
AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
{
        __asm __volatile (
        "       lock   xaddl   %0, %1 ;        "
        : "+r" (v),                     /* 0 (result) */
          "=m" (*p)                     /* 1 */
        : "m" (*p));                    /* 2 */
        return (v);
})