Add VG_ prefix to SKIPLIST_INIT and IS_*_ALIGNED macros. Also pull
IS_PAGE_ALIGNED into tool.h with the others.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3457 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_memory.c b/coregrind/vg_memory.c
index 421f70d..6b9307d 100644
--- a/coregrind/vg_memory.c
+++ b/coregrind/vg_memory.c
@@ -37,9 +37,6 @@
static const Bool mem_debug = False;
-#define IS_PAGE_ALIGNED(_aa) (((_aa) & (VKI_PAGE_SIZE-1)) == 0)
-
-
/*--------------------------------------------------------------*/
/*--- A simple, self-contained ordered array of segments. ---*/
/*--------------------------------------------------------------*/
@@ -347,7 +344,7 @@
{
Int r;
HWord delta;
- vg_assert(IS_PAGE_ALIGNED(a));
+ vg_assert(VG_IS_PAGE_ALIGNED(a));
r = find_segment(a);
if (r == -1)
/* not found */
@@ -562,8 +559,8 @@
end = addr+len;
/* Everything must be page-aligned */
- vg_assert(IS_PAGE_ALIGNED(addr));
- vg_assert(IS_PAGE_ALIGNED(len));
+ vg_assert(VG_IS_PAGE_ALIGNED(addr));
+ vg_assert(VG_IS_PAGE_ALIGNED(len));
for (i = 0; i < segments_used; i++) {
@@ -675,7 +672,7 @@
addr, (ULong)len, prot, flags, dev, ino, off, filename);
/* Everything must be page-aligned */
- vg_assert(IS_PAGE_ALIGNED(addr));
+ vg_assert(VG_IS_PAGE_ALIGNED(addr));
len = PGROUNDUP(len);
/* Nuke/truncate any existing segment(s) covering [addr,addr+len) */
@@ -786,7 +783,7 @@
if (0) show_segments( "mprotect_range(before)" );
/* Everything must be page-aligned */
- vg_assert(IS_PAGE_ALIGNED(a));
+ vg_assert(VG_IS_PAGE_ALIGNED(a));
len = PGROUNDUP(len);
split_segment(a);
@@ -877,8 +874,8 @@
if (hole_start == hole_end+1)
continue;
- vg_assert(IS_PAGE_ALIGNED(hole_start));
- vg_assert(IS_PAGE_ALIGNED(hole_end+1));
+ vg_assert(VG_IS_PAGE_ALIGNED(hole_start));
+ vg_assert(VG_IS_PAGE_ALIGNED(hole_end+1));
/* ignore holes which fall outside the allowable area */
if (!(hole_start >= base && hole_end <= limit))
@@ -886,7 +883,7 @@
vg_assert(hole_end > hole_start);
hole_len = hole_end - hole_start + 1;
- vg_assert(IS_PAGE_ALIGNED(hole_len));
+ vg_assert(VG_IS_PAGE_ALIGNED(hole_len));
if (hole_len >= len && i_any == -1) {
/* It will at least fit in this hole. */
@@ -1119,8 +1116,8 @@
p = PGROUNDDN(p);
size = PGROUNDUP(size);
- vg_assert(IS_PAGE_ALIGNED(p));
- vg_assert(IS_PAGE_ALIGNED(size));
+ vg_assert(VG_IS_PAGE_ALIGNED(p));
+ vg_assert(VG_IS_PAGE_ALIGNED(size));
for (; size > 0; size -= VKI_PAGE_SIZE) {
seg = VG_(find_segment)(p);
@@ -1288,8 +1285,8 @@
goto failed;
try_here = shadow_alloc;
- vg_assert(IS_PAGE_ALIGNED(try_here));
- vg_assert(IS_PAGE_ALIGNED(size));
+ vg_assert(VG_IS_PAGE_ALIGNED(try_here));
+ vg_assert(VG_IS_PAGE_ALIGNED(size));
vg_assert(size > 0);
if (0)
diff --git a/coregrind/vg_pthreadmodel.c b/coregrind/vg_pthreadmodel.c
index c7f3120..5bc7c12 100644
--- a/coregrind/vg_pthreadmodel.c
+++ b/coregrind/vg_pthreadmodel.c
@@ -112,7 +112,7 @@
return VG_(memcmp)(a, b, sizeof(*a));
}
-static SkipList sk_pthread_map = SKIPLIST_INIT(struct pthread_map, id, pthread_cmp,
+static SkipList sk_pthread_map = VG_SKIPLIST_INIT(struct pthread_map, id, pthread_cmp,
NULL, VG_AR_CORE);
/* Find a ThreadId for a particular pthread_t; block until it becomes available */
diff --git a/coregrind/vg_redir.c b/coregrind/vg_redir.c
index 5461202..8e296e1 100644
--- a/coregrind/vg_redir.c
+++ b/coregrind/vg_redir.c
@@ -81,7 +81,7 @@
return buf;
}
-static SkipList sk_resolved_redir = SKIPLIST_INIT(CodeRedirect, from_addr,
+static SkipList sk_resolved_redir = VG_SKIPLIST_INIT(CodeRedirect, from_addr,
VG_(cmp_Addr), straddr, VG_AR_SYMTAB);
static CodeRedirect *unresolved_redir = NULL;
@@ -518,7 +518,7 @@
//:: }
//::
//:: /* List of wrapped call invocations which are currently active */
-//:: static SkipList wrapped_frames = SKIPLIST_INIT(struct call_instance, key, keycmp,
+//:: static SkipList wrapped_frames = VG_SKIPLIST_INIT(struct call_instance, key, keycmp,
//:: NULL, VG_AR_SYMTAB);
//::
//:: static struct call_instance *find_call(Addr retaddr, Addr argsp, ThreadId tid)
@@ -611,11 +611,11 @@
//:: };
//::
//:: /* A mapping from eip of wrapped function entrypoints to actual wrappers */
-//:: static SkipList wrapped_functions = SKIPLIST_INIT(struct wrapped_function, eip, VG_(cmp_Addr),
+//:: static SkipList wrapped_functions = VG_SKIPLIST_INIT(struct wrapped_function, eip, VG_(cmp_Addr),
//:: NULL, VG_AR_SYMTAB);
//::
//:: /* A set of EIPs which are return addresses for wrapped functions */
-//:: static SkipList wrapper_returns = SKIPLIST_INIT(struct wrapper_return, eip, VG_(cmp_Addr),
+//:: static SkipList wrapper_returns = VG_SKIPLIST_INIT(struct wrapper_return, eip, VG_(cmp_Addr),
//:: NULL, VG_AR_SYMTAB);
//::
//:: /* Wrap function starting at eip */
diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c
index 8ed2a36..66ff80f 100644
--- a/coregrind/vg_scheduler.c
+++ b/coregrind/vg_scheduler.c
@@ -481,13 +481,13 @@
(void*)a_vex, sz_vex, (void*)a_vexsh, sz_vexsh,
(void*)a_spill, sz_spill );
- vg_assert(IS_8_ALIGNED(sz_vex));
- vg_assert(IS_8_ALIGNED(sz_vexsh));
- vg_assert(IS_16_ALIGNED(sz_spill));
+ vg_assert(VG_IS_8_ALIGNED(sz_vex));
+ vg_assert(VG_IS_8_ALIGNED(sz_vexsh));
+ vg_assert(VG_IS_16_ALIGNED(sz_spill));
- vg_assert(IS_4_ALIGNED(a_vex));
- vg_assert(IS_4_ALIGNED(a_vexsh));
- vg_assert(IS_4_ALIGNED(a_spill));
+ vg_assert(VG_IS_4_ALIGNED(a_vex));
+ vg_assert(VG_IS_4_ALIGNED(a_vexsh));
+ vg_assert(VG_IS_4_ALIGNED(a_spill));
vg_assert(sz_vex == sz_vexsh);
vg_assert(a_vex + sz_vex == a_vexsh);
diff --git a/coregrind/vg_skiplist.c b/coregrind/vg_skiplist.c
index 4fdd914..02d345c 100644
--- a/coregrind/vg_skiplist.c
+++ b/coregrind/vg_skiplist.c
@@ -60,7 +60,7 @@
: :
- When you declare the list with SKIPLIST_INIT, you specify the
+ When you declare the list with VG_SKIPLIST_INIT, you specify the
structure for each list node, structure member you want to use as a
key, and the function for comparing keys.
diff --git a/coregrind/vg_threadmodel.c b/coregrind/vg_threadmodel.c
index a1bec5d..69399ed 100644
--- a/coregrind/vg_threadmodel.c
+++ b/coregrind/vg_threadmodel.c
@@ -250,7 +250,7 @@
//:: thread_setstate(th, TS_Dead);
//:: }
//::
-//:: static SkipList sk_threads = SKIPLIST_INIT(struct thread, tid, VG_(cmp_UInt), NULL, VG_AR_CORE);
+//:: static SkipList sk_threads = VG_SKIPLIST_INIT(struct thread, tid, VG_(cmp_UInt), NULL, VG_AR_CORE);
//::
//:: static struct thread *thread_get(ThreadId tid)
//:: {
@@ -683,7 +683,7 @@
//:: VG_(pp_ExeContext)(mx->ec_create);
//:: }
//::
-//:: static SkipList sk_mutex = SKIPLIST_INIT(struct mutex, mutex, VG_(cmp_Addr), NULL, VG_AR_CORE);
+//:: static SkipList sk_mutex = VG_SKIPLIST_INIT(struct mutex, mutex, VG_(cmp_Addr), NULL, VG_AR_CORE);
//::
//:: static struct mutex *mutex_get(Addr mutexp)
//:: {
@@ -1007,7 +1007,7 @@
//:: CVE_Blocked,
//:: };
//::
-//:: static SkipList sk_condvar = SKIPLIST_INIT(struct condvar, condvar, VG_(cmp_Addr),
+//:: static SkipList sk_condvar = VG_SKIPLIST_INIT(struct condvar, condvar, VG_(cmp_Addr),
//:: NULL, VG_AR_CORE);
//::
//:: static struct condvar *condvar_get(Addr condp)