Messages in this thread | | | Date | Thu, 14 Jan 1999 10:25:57 +0100 | From | Philipp Rumpf <> | Subject | Re: [PATCH] include/asm-i386/semaphore.h speedup |
| |
On Wed, Jan 13, 1999 at 08:22:20PM -0700, Colin Plumb wrote: > Could someone please check out the following. In particular, is the > lock prefix required for cmpxchg, or is it already implicit?
required.
> +#ifdef CONFIG_M386
lock incl is available on 386's, too. (you need incl only as there are no SMP 386).
> unsigned long flags; > > spin_lock_irqsave(&semaphore_wake_lock, flags); > sem->waking++; > spin_unlock_irqrestore(&semaphore_wake_lock, flags); > +#else > + __asm__ __volatile__( > +#ifdef __SMP__ > + "lock ; " > +#endif > + "incl %1" > + : "=m" (sem->waking) : "0" (sem->waking)); > +#endif > }
> +#if CONFIG_386
cmpxchg is new to the Pentium ...
> + __asm__ __volatile__( > + "movl %2,%%eax\n" > + "1:\tmovl %%eax,%1\n\t" > + "decl %1\n\t" > + "jmi 2f\n\t"
That is "js" on Intel normally.
Philipp Rumpf
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |