Date: Thu, 2 Apr 2009 11:48:33 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: current@freebsd.org Subject: Re: cmpxchg / atomic_cmpset_int emulation for userland (i386) ? Message-ID: <20090402084833.GZ31897@deviant.kiev.zoral.com.ua> In-Reply-To: <20090402070605.GA96848@onelab2.iet.unipi.it>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Thu, Apr 02, 2009 at 09:06:05AM +0200, Luigi Rizzo wrote: > Hi, > I have some list manipulation algorithm that I would like to use > that relies rather centrally on atomic_cmpset_int(). > > This is an atomic instruction on 486+, but not available on 386 > and maybe other platforms. i386/atomic.h has a replacement > but it uses "pushfl; cli; ... popfl;" so it cannot run in userland. > > I was wondering if there is a good emulation for that instruction > on the i386 that is suitable for userland (other architectures > we support have a CPU instruction that does it, or in the case of ARM, > a usable emulation for userland). FreeBSD cannot boot on anything < 486, i.e. cmpxchgl and xaddl may be considered always supported by the CPU. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAknUe+AACgkQC3+MBN1Mb4gWZwCgzqRxTpUB03rwi1Az4/wvB09p A/8AoO10q/FZ/xdf+gWajB8FqkAVMdHC =bhYi -----END PGP SIGNATURE-----home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090402084833.GZ31897>
