From: Florian Krohm Date: Thu, 18 Oct 2012 03:11:39 +0000 (+0000) Subject: Allow representation of trace caches (VexCache). X-Git-Tag: svn/VALGRIND_3_9_0^2~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1ca50dc5db3781ccf6211b9108e48517fc74fa3;p=thirdparty%2Fvalgrind.git Allow representation of trace caches (VexCache). Add more verbiage as to what can be expected from the "caches" array. git-svn-id: svn://svn.valgrind.org/vex/trunk@2553 --- diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index 328da07ccc..0167a4ff5f 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -195,22 +195,26 @@ typedef struct { UInt sizeB; /* size of this cache in bytes */ UInt line_sizeB; /* cache line size in bytes */ UInt assoc; /* set associativity */ + Bool is_trace_cache; /* False, except for certain Pentium 4 models */ } VexCache; /* Convenience macro to initialise a VexCache */ #define VEX_CACHE_INIT(_kind, _level, _size, _line_size, _assoc) \ ({ (VexCache) { .kind = _kind, .level = _level, .sizeB = _size, \ - .line_sizeB = _line_size, .assoc = _assoc }; }) + .line_sizeB = _line_size, .assoc = _assoc, \ + .is_trace_cache = False }; }) /* Information about the cache system as a whole */ typedef struct { UInt num_levels; UInt num_caches; /* Unordered array of caches for this host. NULL if there are - no caches. Users can assume that the array contains at most one - cache of a given kind per cache level. Additionally, if there exists - a unified cache at a particular level then no other cache exists - at that level. */ + no caches. The following can always be assumed: + (1) There is at most one cache of a given kind per cache level. + (2) If there exists a unified cache at a particular level then + no other cache exists at that level. + (3) The existence of a cache at level N > 1 implies the existence of + at least one cache at level N-1. */ VexCache *caches; Bool icaches_maintain_coherence; } VexCacheInfo;