Messages in this thread | | | From | "Kaigai Kohei" <> | Subject | [PATCH]atomic_inc_return() for i386/x86_64 (Re: RCU issue with SELinux) | Date | Wed, 25 Aug 2004 18:52:02 +0900 |
| |
Hi James, thanks for your comment.
> > In IA-32 or x86_64, can anybady implement atomic_inc_return()? > > If it can not, I'll try to make alternative macros or inline functions. > > If you can get this done, it will be very useful, as I could allso run > some benchmarks on my test systems.
atomic_inc_return() is not defined for arm,arm26,i386,x86_64 and um archtectures. This attached patch adds atomic_inc_return() and atomic_dec_return() to arm,i386 and x86_64.
It is implemented by 'xaddl' operation with LOCK prefix for i386 and x86_64. But this operation is permitted after i486 processor only. Another implementation may be necessary for i386SX/DX processor. But 'xaddl' operation is used in 'include/asm-i386/rwsem.h' unconditionally. I think it has agreed on using 'xaddl' operation in past days.
Is it acceptable? Any comment please.
(*) The implementation for ARM is simple wrapper to atomic_add_return(). -------- Kai Gai <kaigai@ak.jp.nec.com> [unhandled content-type:application/octet-stream] | |