Re: assembly lock primitive question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/7/07, mohanlal jangir <mohanlal@xxxxxxxxxxx> wrote:
Is following code SMP safe?

#define InterlockedIncrement(x)  ({ asm volatile ("lock; incl %0" : : "m"
(*x) );  })
#define InterlockedDecrement(x)  ({ asm volatile ("lock; decl %0" : : "m"
(*x) );  })

AFAIK it is SMP safe.

Does -O2 option affect SMP safeness in this case?
IMO no.

Are you getting some strange warnings related to volatile with your
kernel/compiler?

Thanks
~psr


Regards,
Mohan


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




--
play the game

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux