From: Bart Van Assche Date: Sat, 29 Mar 2008 14:40:08 +0000 (+0000) Subject: Added functions bm_clear_load() and bm_clear_store(). X-Git-Tag: svn/VALGRIND_3_4_0~782 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0924ca336c9f1dc5cb7a1c0042950377b633428e;p=thirdparty%2Fvalgrind.git Added functions bm_clear_load() and bm_clear_store(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7813 --- diff --git a/exp-drd/drd_bitmap.c b/exp-drd/drd_bitmap.c index 5b994fdb38..81424baf6c 100644 --- a/exp-drd/drd_bitmap.c +++ b/exp-drd/drd_bitmap.c @@ -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) diff --git a/exp-drd/pub_drd_bitmap.h b/exp-drd/pub_drd_bitmap.h index 2bbca0aa9f..ede095e4ce 100644 --- a/exp-drd/pub_drd_bitmap.h +++ b/exp-drd/pub_drd_bitmap.h @@ -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);