Home | History | Annotate | Download | only in esan

Lines Matching refs:Shadow

23 // We shadow every cache line of app memory with one shadow byte.
24 // - The highest bit of each shadow byte indicates whether the corresponding
26 // - The lowest bit of each shadow byte indicates whether the corresponding
37 // We live with races in accessing each shadow byte.
42 // Our shadow memory assumes that the line size is 64.
45 // See the shadow byte layout description above.
62 static const u32 NumFreq = 8; // One for each bit of our shadow bytes.
92 byte *Shadow = (byte *)appToShadow(Addr);
93 // Write shadow bytes until we're word-aligned.
94 while (I < NumLines && (uptr)Shadow % 4 != 0) {
95 if ((*Shadow & ShadowAccessedVal) != ShadowAccessedVal)
96 *Shadow |= ShadowAccessedVal;
97 ++Shadow;
100 // Write whole shadow words at a time.
106 if ((*(u32*)Shadow & WordValue) != WordValue)
107 *(u32*)Shadow |= WordValue;
108 Shadow += 4;
111 // Write any trailing shadow bytes.
113 if ((*Shadow & ShadowAccessedVal) != ShadowAccessedVal)
114 *Shadow |= ShadowAccessedVal;
115 ++Shadow;
147 // Clear this bit from every shadow byte.
155 // Scan shadow memory to calculate the number of cache lines being accessed,
156 // i.e., the number of non-zero bits indexed by BitIdx in each shadow byte.
166 VPrintf(4, "%s: considering %p-%p app=%d shadow=%d prot=%u\n",