Skip to content

Instantly share code, notes, and snippets.

@edwintorok
Created April 13, 2011 21:31
Show Gist options
  • Save edwintorok/918468 to your computer and use it in GitHub Desktop.
Save edwintorok/918468 to your computer and use it in GitHub Desktop.
asm volatile("movzwl %2, %0\n\t"
"cmpb %h0,%b0\n\t"
"leal 0x100(%" REG_PTR_MODE "0), %1\n\t"
"jne 1f\n\t"
LOCK_PREFIX "cmpxchgw %w1,%2\n\t"
"1:"
"sete %b1\n\t"
"movzbl %b1,%0\n\t"
: "=&a" (tmp), "=&q" (new), "+m" (lock->slock)
:
: "memory", "cc");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment