Date: Tue, 28 Dec 2010 12:36:47 +0100 From: Robert Millan <rmh@debian.org> To: "Jayachandran C." <jchandra@freebsd.org> Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Retrieval of TLS pointer via RDHWR Message-ID: <AANLkTi=nyXw3Tw-BnhAMwob4yP0-TSxeh5f_wEjtEfQ9@mail.gmail.com> In-Reply-To: <AANLkTimyqAWFo5Ddd8_UAL654iGquCMnEjFETUnsFdxO@mail.gmail.com> References: <AANLkTimg3CUk0p8YPyepiumEHvKo2F6jdVA0=1CefYrQ@mail.gmail.com> <AANLkTikxHUj%2BGe3YyJOWMQne31D=uY_712Qveq=Dmh2A@mail.gmail.com> <AANLkTimyqAWFo5Ddd8_UAL654iGquCMnEjFETUnsFdxO@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Not interested? Note this might become mandatory if you ever want to compile code that uses TLS with recent GCC. In any case, when executed natively, rdhwr is a speed-up compared to a sysarch() call. 2010/12/9 Robert Millan <rmh@debian.org>: > 2010/12/9 Jayachandran C. <jchandra@freebsd.org>: >> I'm not sure that the freebsd mips toolchain supports the __thread >> directive yet. =C2=A0Were you able to test this from C? > > Yes, but not via __thread. =C2=A0I wrote a small program that sets > the TLS pointer to an arbitrary value (via MIPS_SET_TLS), > then issued rdhwr instruction using C inline assembly, and > finally verified that both values are the same. > > (the toolchain I'm using doesn't support __thread either, > but I submit this patch with the expectation that it can be > useful later on) > > -- > Robert Millan > --=20 Robert Millan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=nyXw3Tw-BnhAMwob4yP0-TSxeh5f_wEjtEfQ9>