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