]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added functions bm_clear_load() and bm_clear_store().
authorBart Van Assche <bvanassche@acm.org>
Sat, 29 Mar 2008 14:40:08 +0000 (14:40 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 29 Mar 2008 14:40:08 +0000 (14:40 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7813

exp-drd/drd_bitmap.c
exp-drd/pub_drd_bitmap.h

index 5b994fdb3847dd10ec0f1be355096b64164c879d..81424baf6c5c87792f1c5df50e90b89b5d4a2fa9 100644 (file)
@@ -441,6 +441,42 @@ void bm_clear(const struct bitmap* const bm,
   }
 }
 
+/** Clear all references to loads in bitmap bm starting at address a1 and
+ *  up to but not including address a2.
+ */
+void bm_clear_load(const struct bitmap* const bm,
+                   const Addr a1, const Addr a2)
+{
+  Addr a;
+
+  for (a = a1; a < a2; a++)
+  {
+    struct bitmap2* const p2 = bm2_lookup_exclusive(bm, a >> ADDR0_BITS);
+    if (p2)
+    {
+      bm0_clear(p2->bm1.bm0_r, a & ADDR0_MASK);
+    }
+  }
+}
+
+/** Clear all references to stores in bitmap bm starting at address a1 and
+ *  up to but not including address a2.
+ */
+void bm_clear_store(const struct bitmap* const bm,
+                    const Addr a1, const Addr a2)
+{
+  Addr a;
+
+  for (a = a1; a < a2; a++)
+  {
+    struct bitmap2* const p2 = bm2_lookup_exclusive(bm, a >> ADDR0_BITS);
+    if (p2)
+    {
+      bm0_clear(p2->bm1.bm0_w, a & ADDR0_MASK);
+    }
+  }
+}
+
 Bool bm_has_conflict_with(const struct bitmap* const bm,
                           const Addr a1, const Addr a2,
                           const BmAccessTypeT access_type)
index 2bbca0aa9f12f7aab070fbb7af4b5f0fecde1387..ede095e4ce975e99ab3e9b262d5358f98d3a6108 100644 (file)
@@ -80,6 +80,10 @@ UWord bm_has_1(const struct bitmap* const bm,
                const Addr address, const BmAccessTypeT access_type);
 void bm_clear(const struct bitmap* const bm,
               const Addr a1, const Addr a2);
+void bm_clear_load(const struct bitmap* const bm,
+                   const Addr a1, const Addr a2);
+void bm_clear_store(const struct bitmap* const bm,
+                    const Addr a1, const Addr a2);
 Bool bm_has_conflict_with(const struct bitmap* const bm,
                           const Addr a1, const Addr a2,
                           const BmAccessTypeT access_type);