- Reindented code such that it uses three spaces for indentation instead
of two. The indentation of the DRD source code is now consistent with
the other Valgrind source files.
- Added emacs mode line with indentation settings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9496 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_thread_bitmap.h b/drd/drd_thread_bitmap.h
index 102fd98..0da6c60 100644
--- a/drd/drd_thread_bitmap.h
+++ b/drd/drd_thread_bitmap.h
@@ -1,3 +1,4 @@
+/* -*- mode: C; c-basic-offset: 3; -*- */
/*
This file is part of drd, a thread error detector.
@@ -34,131 +35,157 @@
static __inline__
Bool bm_access_load_1_triggers_conflict(const Addr a1)
{
- DRD_(bm_access_load_1)(DRD_(running_thread_get_segment)()->bm, a1);
- return DRD_(bm_load_1_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1);
+ DRD_(bm_access_load_1)(DRD_(running_thread_get_segment)()->bm, a1);
+ return DRD_(bm_load_1_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1);
}
static __inline__
Bool bm_access_load_2_triggers_conflict(const Addr a1)
{
- if ((a1 & 1) == 0)
- {
- bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1, 2);
- return bm_aligned_load_has_conflict_with(DRD_(thread_get_conflict_set)(), a1, 2);
- }
- else
- {
- DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm, a1, a1 + 2, eLoad);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 2, eLoad);
- }
+ if ((a1 & 1) == 0)
+ {
+ bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1, 2);
+ return bm_aligned_load_has_conflict_with(DRD_(thread_get_conflict_set)(),
+ a1, 2);
+ }
+ else
+ {
+ DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm,
+ a1, a1 + 2, eLoad);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 2, eLoad);
+ }
}
static __inline__
Bool bm_access_load_4_triggers_conflict(const Addr a1)
{
- if ((a1 & 3) == 0)
- {
- bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1, 4);
- return bm_aligned_load_has_conflict_with(DRD_(thread_get_conflict_set)(), a1, 4);
- }
- else
- {
- DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm, a1, a1 + 4, eLoad);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 4, eLoad);
- }
+ if ((a1 & 3) == 0)
+ {
+ bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1, 4);
+ return bm_aligned_load_has_conflict_with(DRD_(thread_get_conflict_set)(),
+ a1, 4);
+ }
+ else
+ {
+ DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm,
+ a1, a1 + 4, eLoad);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 4, eLoad);
+ }
}
static __inline__
Bool bm_access_load_8_triggers_conflict(const Addr a1)
{
- if ((a1 & 7) == 0)
- {
- bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1, 8);
- return bm_aligned_load_has_conflict_with(DRD_(thread_get_conflict_set)(), a1, 8);
- }
- else if ((a1 & 3) == 0)
- {
- bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1 + 0, 4);
- bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1 + 4, 4);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 8, eLoad);
- }
- else
- {
- DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm, a1, a1 + 8, eLoad);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 8, eLoad);
- }
+ if ((a1 & 7) == 0)
+ {
+ bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1, 8);
+ return bm_aligned_load_has_conflict_with(DRD_(thread_get_conflict_set)(),
+ a1, 8);
+ }
+ else if ((a1 & 3) == 0)
+ {
+ bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1 + 0, 4);
+ bm_access_aligned_load(DRD_(running_thread_get_segment)()->bm, a1 + 4, 4);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 8, eLoad);
+ }
+ else
+ {
+ DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm,
+ a1, a1 + 8, eLoad);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 8, eLoad);
+ }
}
static __inline__
Bool bm_access_load_triggers_conflict(const Addr a1, const Addr a2)
{
- DRD_(bm_access_range_load)(DRD_(running_thread_get_segment)()->bm, a1, a2);
- return DRD_(bm_load_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a2);
+ DRD_(bm_access_range_load)(DRD_(running_thread_get_segment)()->bm, a1, a2);
+ return DRD_(bm_load_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a2);
}
static __inline__
Bool bm_access_store_1_triggers_conflict(const Addr a1)
{
- DRD_(bm_access_store_1)(DRD_(running_thread_get_segment)()->bm, a1);
- return DRD_(bm_store_1_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1);
+ DRD_(bm_access_store_1)(DRD_(running_thread_get_segment)()->bm, a1);
+ return DRD_(bm_store_1_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1);
}
static __inline__
Bool bm_access_store_2_triggers_conflict(const Addr a1)
{
- if ((a1 & 1) == 0)
- {
- bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1, 2);
- return bm_aligned_store_has_conflict_with(DRD_(thread_get_conflict_set)(), a1, 2);
- }
- else
- {
- DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm, a1, a1 + 2, eStore);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 2, eStore);
- }
+ if ((a1 & 1) == 0)
+ {
+ bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1, 2);
+ return bm_aligned_store_has_conflict_with(DRD_(thread_get_conflict_set)(),
+ a1, 2);
+ }
+ else
+ {
+ DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm,
+ a1, a1 + 2, eStore);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 2, eStore);
+ }
}
static __inline__
Bool bm_access_store_4_triggers_conflict(const Addr a1)
{
- if ((a1 & 3) == 0)
- {
- bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1, 4);
- return bm_aligned_store_has_conflict_with(DRD_(thread_get_conflict_set)(), a1, 4);
- }
- else
- {
- DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm, a1, a1 + 4, eStore);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 4, eStore);
- }
+ if ((a1 & 3) == 0)
+ {
+ bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1, 4);
+ return bm_aligned_store_has_conflict_with(DRD_(thread_get_conflict_set)(),
+ a1, 4);
+ }
+ else
+ {
+ DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm,
+ a1, a1 + 4, eStore);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 4, eStore);
+ }
}
static __inline__
Bool bm_access_store_8_triggers_conflict(const Addr a1)
{
- if ((a1 & 7) == 0)
- {
- bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1, 8);
- return bm_aligned_store_has_conflict_with(DRD_(thread_get_conflict_set)(), a1, 8);
- }
- else if ((a1 & 3) == 0)
- {
- bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1 + 0, 4);
- bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1 + 4, 4);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 8, eStore);
- }
- else
- {
- DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm, a1, a1 + 8, eStore);
- return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a1 + 8, eStore);
- }
+ if ((a1 & 7) == 0)
+ {
+ bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm, a1, 8);
+ return bm_aligned_store_has_conflict_with(DRD_(thread_get_conflict_set)(),
+ a1, 8);
+ }
+ else if ((a1 & 3) == 0)
+ {
+ bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm,
+ a1 + 0, 4);
+ bm_access_aligned_store(DRD_(running_thread_get_segment)()->bm,
+ a1 + 4, 4);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 8, eStore);
+ }
+ else
+ {
+ DRD_(bm_access_range)(DRD_(running_thread_get_segment)()->bm,
+ a1, a1 + 8, eStore);
+ return DRD_(bm_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a1 + 8, eStore);
+ }
}
static __inline__
Bool bm_access_store_triggers_conflict(const Addr a1, const Addr a2)
{
- DRD_(bm_access_range_store)(DRD_(running_thread_get_segment)()->bm, a1, a2);
- return DRD_(bm_store_has_conflict_with)(DRD_(thread_get_conflict_set)(), a1, a2);
+ DRD_(bm_access_range_store)(DRD_(running_thread_get_segment)()->bm, a1, a2);
+ return DRD_(bm_store_has_conflict_with)(DRD_(thread_get_conflict_set)(),
+ a1, a2);
}
#endif // __DRD_THREAD_BITMAP_H