svn commit: r210623 - in head/sys: amd64/include i386/include ia64/include

John Baldwin jhb at freebsd.org
Thu Jul 29 19:26:58 UTC 2010


On Thursday, July 29, 2010 2:44:10 pm John Baldwin wrote:
> Author: jhb
> Date: Thu Jul 29 18:44:10 2010
> New Revision: 210623
> URL: http://svn.freebsd.org/changeset/base/210623
> 
> Log:
>   Mark the __curthread() functions as __pure2 and remove the volatile keyword
>   from the inline assembly.  This allows the compiler to cache invocations of
>   curthread since it's value does not change within a thread context.

Other platforms can add this feature if desired by adding a similar
__curthread() inline function.  curthread is a bit special in this regards as
opposed to other per-CPU values.  I think Peter originally added the
__curthread() inline simply to speed up compile times as the PCPU_*() macros
are a lot of work for the compiler, so that can be another reason to do it on
other platforms.

-- 
John Baldwin


More information about the svn-src-head mailing list