lkml.org 
[lkml]   [2009]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip] x86: atomic64: inline atomic64_read()

* Arjan van de Ven <arjan@infradead.org> wrote:

> On Fri, 3 Jul 2009 20:04:50 +0200
> Ingo Molnar <mingo@elte.hu> wrote:
>
> > > +static inline u64 atomic64_read(atomic64_t *ptr)
> > > +{
> > > + u64 res;
> > > +
> > > + asm volatile(
> > > + "mov %%ebx, %%eax\n\t"
> > > + "mov %%ecx, %%edx\n\t"
> > > + LOCK_PREFIX "cmpxchg8b %1\n"
>
> also afaik cmpxchg implies the lock prefix, so no need to make an
> explicit one... it just adds code size and alternatives-work

good point!

Is the same true of XADD as well? If yes then we can remove the lock
prefix from those as well - there's a few uses of that on 32-bit and
64-bit as well.

Ingo


\
 
 \ /
  Last update: 2009-07-03 20:21    [W:0.136 / U:2.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site