]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Allow representation of trace caches (VexCache).
authorFlorian Krohm <florian@eich-krohm.de>
Thu, 18 Oct 2012 03:11:39 +0000 (03:11 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Thu, 18 Oct 2012 03:11:39 +0000 (03:11 +0000)
Add more verbiage as to what can be expected from the "caches" array.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2553

VEX/pub/libvex.h

index 328da07cccdfdb7ce6ac197d326a43df198c844c..0167a4ff5f6e229813d0f85d8592ef470215038c 100644 (file)
@@ -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;