|
From: <sv...@va...> - 2005-06-12 04:34:56
|
Author: njn
Date: 2005-06-12 05:34:51 +0100 (Sun, 12 Jun 2005)
New Revision: 3897
Log:
Move the *ROUND* macros to a better place.
Modified:
trunk/coregrind/stage1.c
trunk/coregrind/ume.c
trunk/include/basic_types.h
trunk/include/pub_tool_libcbase.h
trunk/include/tool.h
Modified: trunk/coregrind/stage1.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/stage1.c 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/coregrind/stage1.c 2005-06-12 04:34:51 UTC (rev 3897)
@@ -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"
=20
=20
Modified: trunk/coregrind/ume.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/ume.c 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/coregrind/ume.c 2005-06-12 04:34:51 UTC (rev 3897)
@@ -45,6 +45,7 @@
#include <assert.h>
=20
#include "ume.h"
+#include "pub_core_libcbase.h"
=20
#if ELFSZ =3D=3D 64
#define ESZ(x) Elf64_##x
Modified: trunk/include/basic_types.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/basic_types.h 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/include/basic_types.h 2005-06-12 04:34:51 UTC (rev 3897)
@@ -69,11 +69,19 @@
non-builtin types
------------------------------------------------------------------ */
=20
+// XXX: these probably shouldn't be here...
+
/* ThreadIds are simply indices into the VG_(threads)[] array. */
typedef
UInt
ThreadId;
=20
+/* 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 =3D=3D False, val holds the return value.
When .isError =3D=3D True, val holds the error code.
Modified: trunk/include/pub_tool_libcbase.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_libcbase.h 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/include/pub_tool_libcbase.h 2005-06-12 04:34:51 UTC (rev 3897)
@@ -96,6 +96,13 @@
#define VG_IS_WORD_ALIGNED(aaa_p) (0 =3D=3D (((Addr)(aaa_p)) & ((Addr)(s=
izeof(Addr)-1))))
#define VG_IS_PAGE_ALIGNED(aaa_p) (0 =3D=3D (((Addr)(aaa_p)) & ((Addr)(V=
KI_PAGE_SIZE-1))))
=20
+// '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
------------------------------------------------------------------ */
Modified: trunk/include/tool.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/tool.h 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/include/tool.h 2005-06-12 04:34:51 UTC (rev 3897)
@@ -57,12 +57,6 @@
/*=3D=3D=3D Useful macros =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
-// '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);
=20
@@ -73,11 +67,6 @@
/* ------------------------------------------------------------------ */
/* Thread-related stuff */
=20
-/* 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 );
=20
|