lkml.org 
[lkml]   [2001]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [Q] Implementation of spin_lock on i386: why "rep;nop" ?
Date
Followup to:  <E15j2BM-0007WU-00@the-village.bc.nu>
By author: Alan Cox <alan@lxorguk.ukuu.org.uk>
In newsgroup: linux.dev.kernel
>
> > The "rep;nop" line looks dubious, since the IA-32 programmer's manual from
> > Intel (year 2001) mentions that the behaviour of REP is undefined when it
> > is not used with string opcodes. BTW, according to the same manual, REP is
> > supposed to modify ecx, but it looks like is is not the case here... which
> > is fortunate, since ecx is never saved. :-)
>
> rep nop is a pentium IV operation. Its retroactively after testing defined
> to be portable and ok.
>

Now, the example brought up was assembly, but in general I really
think we should have a processor-independent wait_loop(); inline.
Right now we have a rep_nop(); inline which only works on x86 (and
presumably x86-64).

-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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