Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Oct 2000 18:56:43 +1100
From:      "Jan Mikkelsen" <janm@transactionsite.com>
To:        "John Baldwin" <jhb@FreeBSD.org>
Cc:        "FreeBSD Hackers" <freebsd-hackers@FreeBSD.ORG>, "Kevin Mills" <kmills@aventail.com>
Subject:   Re: atomic operations
Message-ID:  <001201c02d0f$790c9140$0901a8c0@haym.transactionsite.com>

next in thread | raw e-mail | index | archive | help
John Baldwin <jhb@FreeBSD.org> wrote:
>Uh, there is no xaddl instruction in the x86 instruction set.

It was introduced in the '486.  I've been using it for some years now, so I
am confident of its existence.

A quick test using my example:

$ objdump -d jan.o

jan.o:     file format elf32-i386

Disassembly of section .text:

00000000 <atomic_decrement>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   8b 4d 08                mov    0x8(%ebp),%ecx
   6:   b8 ff ff ff ff          mov    $0xffffffff,%eax
   b:   f0 0f c1 01             lock xadd %eax,(%ecx)
   f:   48                      dec    %eax
  10:   c9                      leave
  11:   c3                      ret

There shouldn't be a need for a loop like the one you describe for a simple
atomic increment.

I'm pretty new to FreeBSD:  what is changing in -current which alters the
behaviour of your code?

Jan Mikkelsen




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001201c02d0f$790c9140$0901a8c0>