I’d like to increment the 64bit(long type in C++) counter in inline assembly atomically. I know how to do that on 32bit value(int):
asm volatile("lock; incl %0" : "=m" (val) : "m"(val));
But I have no idea how to perform that on long value.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
moved self answer from the question to an answer
It was quite easy, but I haven’t been familiar with x86-64.