/* Performs an atomic increment of the 32-bit unsigned integer specified by Value and returns the incremented value. The increment operation must be performed using MP safe mechanisms. */
UINT32 EFIAPI InternalSyncIncrement(IN volatile UINT32 *Value)
/* Performs an atomic increment of the 32-bit unsigned integer specified by Value and returns the incremented value. The increment operation must be performed using MP safe mechanisms. */
UINT32 EFIAPI InternalSyncIncrement(IN volatile UINT32 *Value)
{
  UINT32  Result;
  __asm__ __volatile__ (
    "movl    $1, %%eax  \n\t"
    "lock               \n\t"
    "xadd    %%eax, %1  \n\t"
    "inc     %%eax      \n\t"
    : "=&a" (Result),
      "+m" (*Value)
    :
    : "memory",
      "cc"
  );
  return Result;
}