Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Apr 2009 09:06:05 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        current@freebsd.org
Subject:   cmpxchg / atomic_cmpset_int emulation for userland (i386)  ?
Message-ID:  <20090402070605.GA96848@onelab2.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
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).

	cheers
	luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090402070605.GA96848>