]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Move the *ROUND* macros to a better place.
authorNicholas Nethercote <njn@valgrind.org>
Sun, 12 Jun 2005 04:34:51 +0000 (04:34 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 12 Jun 2005 04:34:51 +0000 (04:34 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3897

coregrind/stage1.c
coregrind/ume.c
include/basic_types.h
include/pub_tool_libcbase.h
include/tool.h

index 7a3fb7713836b1f4dbd4d066abfe0a7fc6a0e9a1..45a1999d12d32a240199a39e786b88dd5230a7b0 100644 (file)
@@ -45,6 +45,7 @@
 #include "ume.h"
 #include "memcheck/memcheck.h"
 #include "pub_core_debuglog.h"
+#include "pub_core_libcbase.h"
 #include "pub_core_libcproc.h"
 
 
index 939392162656d15a27e3fbe6f41c844bf5f2f69f..cd997ffbcff8b6c640efd3ee08dc759141aa724f 100644 (file)
@@ -45,6 +45,7 @@
 #include <assert.h>
 
 #include "ume.h"
+#include "pub_core_libcbase.h"
 
 #if    ELFSZ == 64
 #define ESZ(x) Elf64_##x
index 786c3a284ec9be588c8b78ed18b3a1c7857719e6..7b747c5be93a786c7c190c1f5d32090245a0ab44 100644 (file)
@@ -69,11 +69,19 @@ typedef  Word                   OffT;     // 32             64
    non-builtin types
    ------------------------------------------------------------------ */
 
+// XXX: these probably shouldn't be here...
+
 /* ThreadIds are simply indices into the VG_(threads)[] array. */
 typedef
    UInt
    ThreadId;
 
+/* Special magic value for an invalid ThreadId.  It corresponds to
+   LinuxThreads using zero as the initial value for
+   pthread_mutex_t.__m_owner and pthread_cond_t.__c_waiting. */
+#define VG_INVALID_THREADID ((ThreadId)(0))
+
+
 /* An abstraction of syscall return values.
    When .isError == False, val holds the return value.
    When .isError == True,  val holds the error code.
index e96a8c58878f3a6a42018f60df69edc5ee046433..fb59b39b93e1a539c84dd91070441c2a1cf711e3 100644 (file)
@@ -96,6 +96,13 @@ extern Int   VG_(memcmp) ( const void* s1, const void* s2, SizeT n );
 #define VG_IS_WORD_ALIGNED(aaa_p) (0 == (((Addr)(aaa_p)) & ((Addr)(sizeof(Addr)-1))))
 #define VG_IS_PAGE_ALIGNED(aaa_p) (0 == (((Addr)(aaa_p)) & ((Addr)(VKI_PAGE_SIZE-1))))
 
+// 'a' -- the alignment -- must be a power of 2.
+// The latter two require the vki-*.h header to be imported also.
+#define VG_ROUNDDN(p, a)   ((Addr)(p) & ~((Addr)(a)-1))
+#define VG_ROUNDUP(p, a)   VG_ROUNDDN((p)+(a)-1, (a))
+#define VG_PGROUNDDN(p)    VG_ROUNDDN(p, VKI_PAGE_SIZE)
+#define VG_PGROUNDUP(p)    VG_ROUNDUP(p, VKI_PAGE_SIZE)
+
 /* ---------------------------------------------------------------------
    Misc useful functions
    ------------------------------------------------------------------ */
index d837f3c9e544b179780b5313a8d9aa255caf501f..6fcb90d5feab0d256cc76a3ceb5f76c62dcf1a6d 100644 (file)
 /*=== Useful macros                                                ===*/
 /*====================================================================*/
 
-// 'a' -- the alignment -- must be a power of 2
-#define VG_ROUNDDN(p, a)   ((Addr)(p) & ~((Addr)(a)-1))
-#define VG_ROUNDUP(p, a)   VG_ROUNDDN((p)+(a)-1, (a))
-#define VG_PGROUNDDN(p)    VG_ROUNDDN(p, VKI_PAGE_SIZE)
-#define VG_PGROUNDUP(p)    VG_ROUNDUP(p, VKI_PAGE_SIZE)
-
 /* Path to all our library/aux files */
 extern const Char *VG_(libdir);
 
@@ -73,11 +67,6 @@ extern const Char *VG_(libdir);
 /* ------------------------------------------------------------------ */
 /* Thread-related stuff */
 
-/* Special magic value for an invalid ThreadId.  It corresponds to
-   LinuxThreads using zero as the initial value for
-   pthread_mutex_t.__m_owner and pthread_cond_t.__c_waiting. */
-#define VG_INVALID_THREADID ((ThreadId)(0))
-
 /* Get the TID of the thread which currently has the CPU. */
 extern ThreadId VG_(get_running_tid) ( void );