Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Apr 2009 12:28:51 -0500
From:      Nathan Whitehorn <nwhitehorn@freebsd.org>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        arch@FreeBSD.org
Subject:   Re: Simple #define for cache line size
Message-ID:  <49E0D353.7090308@freebsd.org>
In-Reply-To: <alpine.BSF.2.00.0904111700241.19879@fledge.watson.org>
References:  <alpine.BSF.2.00.0904111700241.19879@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:
>
>
> NetBSD, FYI, defines CACHE_LINE_SIZE as a global constant in param.h, 
> but I'm going with an MD definition as I suspect people will want to 
> do different things on different architectures (and there is 
> variation).  I've defaulted all architectures to 64 bytes, but I 
> suspect a number would prefer to use 32.
For what it's worth, this is per-CPU variable on PowerPC and detected at 
runtime. Most of the CPUs we support have 32 byte cache lines, but some 
(e.g. the G5) use 128 bytes. I'm not sure there is a general solution in 
this case, but that's the situation on PPC.
-Nathan



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