Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Mar 2011 06:57:29 +1100
From:      Peter Jeremy <peterjeremy@acm.org>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, Roman Divacky <rdivacky@FreeBSD.org>, Bruce Evans <brde@optusnet.com.au>, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Maxim Dounin <mdounin@mdounin.ru>
Subject:   Re: svn commit: r219679 - head/sys/i386/include
Message-ID:  <20110317195729.GA65858@server.vk2pj.dyndns.org>
In-Reply-To: <201103161634.08104.jkim@FreeBSD.org>
References:  <201103152145.p2FLjAlt060256@svn.freebsd.org> <201103161233.16347.jkim@FreeBSD.org> <20110316174553.GA6367@freebsd.org> <201103161634.08104.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2011-Mar-16 16:34:04 -0400, Jung-uk Kim <jkim@FreeBSD.org> wrote:
>On Wednesday 16 March 2011 01:45 pm, Roman Divacky wrote:
>> if we drop i486 I think it makes sense to require something that
>> has at least SSE2, thus we can have the same expectations as on
>> amd64.

I think it's stil a bit early for that - especially the SSE2 requirement.

>This is a proof-of-concept patch for sys/x86/isa/clock.c:
>
>http://people.freebsd.org/~jkim/clock.diff
>
>You see the complexity, just because I wanted to load 64-bit value=20
>atomically... :-(

An alternative approach is to have _fetch_frequency() be
  uint64_t (*_fetch_frequency)(uint64_t *);
if i386 and I486 are defined (otherwise it's just the #define (*(p)))
then initialise it to either atomic_fetch_quad_i386 or
atomic_fetch_quad_i586 as part of the CPU detection process.  This is
the way bcopy() is/was handled on Pentium.

Another approach would be to always have cmpxchg8b instructions
(followed by a suitably large NOP) always inlined in the code and if
it traps, patch the code to call a function that emulates it.

--=20
Peter Jeremy

--T4sUOijqQbZv57TR
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iEYEARECAAYFAk2CZ6kACgkQ/opHv/APuIf4HgCglRSBF80GZRoaO3asSrakTbct
VKoAoI9R8PNjJjwCUnvVIyuvNqobcboa
=7WMx
-----END PGP SIGNATURE-----

--T4sUOijqQbZv57TR--



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