lkml.org 
[lkml]   [1999]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:1.183 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site