|
From: <sv...@va...> - 2008-03-13 19:10:13
|
Author: bart
Date: 2008-03-13 19:10:06 +0000 (Thu, 13 Mar 2008)
New Revision: 7674
Log:
Made arguments of bitmap manipulating functions more uniform.
Modified:
trunk/exp-drd/drd_bitmap.c
trunk/exp-drd/drd_main.c
trunk/exp-drd/drd_suppression.c
trunk/exp-drd/pub_drd_bitmap.h
Modified: trunk/exp-drd/drd_bitmap.c
===================================================================
--- trunk/exp-drd/drd_bitmap.c 2008-03-13 19:03:38 UTC (rev 7673)
+++ trunk/exp-drd/drd_bitmap.c 2008-03-13 19:10:06 UTC (rev 7674)
@@ -147,25 +147,24 @@
}
/**
- * Record an access of type access_type at addresses a .. a + size - 1 in
+ * Record an access of type access_type at addresses a1 .. a2 - 1 in
* bitmap bm.
*/
void bm_access_range(struct bitmap* const bm,
- const Addr a,
- const SizeT size,
+ const Addr a1, const Addr a2,
const BmAccessTypeT access_type)
{
tl_assert(bm);
- tl_assert(size > 0);
+ tl_assert(a1 < a2);
- if (size == 4)
- bm_access_4(bm, a, access_type);
- else if (size == 1)
- bm_access_1(bm, a, access_type);
+ if (a2 - a1 == 4)
+ bm_access_4(bm, a1, access_type);
+ else if (a2 - a1 == 1)
+ bm_access_1(bm, a1, access_type);
else
{
Addr b;
- for (b = a; b != a + size; b++)
+ for (b = a1; b != a2; b++)
{
bm_access_1(bm, b, access_type);
}
@@ -614,8 +613,10 @@
for (i = 0; i < sizeof(s_args)/sizeof(s_args[0]); i++)
{
- bm_access_range(bm, s_args[i].address,
- s_args[i].size, s_args[i].access_type);
+ bm_access_range(bm,
+ s_args[i].address,
+ s_args[i].address + s_args[i].size,
+ s_args[i].access_type);
}
VG_(printf)("Map contents -- should contain 10 addresses:\n");
Modified: trunk/exp-drd/drd_main.c
===================================================================
--- trunk/exp-drd/drd_main.c 2008-03-13 19:03:38 UTC (rev 7673)
+++ trunk/exp-drd/drd_main.c 2008-03-13 19:10:06 UTC (rev 7674)
@@ -180,7 +180,7 @@
}
#endif
sg = thread_get_segment(thread_get_running_tid());
- bm_access_range(sg->bm, addr, size, eLoad);
+ bm_access_range(sg->bm, addr, addr + size, eLoad);
if (bm_has_conflict_with(thread_get_danger_set(), addr, addr + size, eLoad)
&& ! drd_is_suppressed(addr, addr + size))
{
@@ -230,7 +230,7 @@
}
#endif
sg = thread_get_segment(thread_get_running_tid());
- bm_access_range(sg->bm, addr, size, eStore);
+ bm_access_range(sg->bm, addr, addr + size, eStore);
if (bm_has_conflict_with(thread_get_danger_set(), addr, addr + size, eStore)
&& ! drd_is_suppressed(addr, addr + size))
{
Modified: trunk/exp-drd/drd_suppression.c
===================================================================
--- trunk/exp-drd/drd_suppression.c 2008-03-13 19:03:38 UTC (rev 7673)
+++ trunk/exp-drd/drd_suppression.c 2008-03-13 19:10:06 UTC (rev 7674)
@@ -62,7 +62,7 @@
tl_assert(a1 < a2);
tl_assert(! drd_is_any_suppressed(a1, a2));
- bm_access_range(s_suppressed, a1, a2 - a1, eStore);
+ bm_access_range(s_suppressed, a1, a2, eStore);
}
void drd_finish_suppression(const Addr a1, const Addr a2)
Modified: trunk/exp-drd/pub_drd_bitmap.h
===================================================================
--- trunk/exp-drd/pub_drd_bitmap.h 2008-03-13 19:03:38 UTC (rev 7673)
+++ trunk/exp-drd/pub_drd_bitmap.h 2008-03-13 19:10:06 UTC (rev 7674)
@@ -57,8 +57,7 @@
struct bitmap* bm_new(void);
void bm_delete(struct bitmap* const bm);
void bm_access_range(struct bitmap* const bm,
- const Addr address,
- const SizeT size,
+ const Addr a1, const Addr a2,
const BmAccessTypeT access_type);
void bm_access_4(struct bitmap* const bm,
const Addr address,
@@ -96,8 +95,6 @@
void bm_print(const struct bitmap* bm);
ULong bm_get_bitmap_creation_count(void);
ULong bm_get_bitmap2_creation_count(void);
-void bm_test(void);
-
#endif /* __DRD_BITMAP_H */
|