|
From: <sv...@va...> - 2009-06-12 02:44:45
|
Author: njn
Date: 2009-06-12 03:44:22 +0100 (Fri, 12 Jun 2009)
New Revision: 10303
Log:
More preprocessor-based file selection.
Modified:
branches/BUILD_TWEAKS/coregrind/Makefile.am
branches/BUILD_TWEAKS/coregrind/m_initimg/initimg-darwin.c
branches/BUILD_TWEAKS/coregrind/m_mach/mach_basics.c
branches/BUILD_TWEAKS/coregrind/m_mach/mach_msg.c
branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-amd64-darwin.S
branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-x86-darwin.S
branches/BUILD_TWEAKS/coregrind/m_start-amd64-darwin.S
branches/BUILD_TWEAKS/coregrind/m_start-x86-darwin.S
branches/BUILD_TWEAKS/coregrind/pub_core_mach.h
Modified: branches/BUILD_TWEAKS/coregrind/Makefile.am
===================================================================
--- branches/BUILD_TWEAKS/coregrind/Makefile.am 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/Makefile.am 2009-06-12 02:44:22 UTC (rev 10303)
@@ -167,7 +167,7 @@
pub_core_libcprint.h \
pub_core_libcproc.h \
pub_core_libcsignal.h \
- pub_core_mach.h \
+ pub_core_mach.h \
pub_core_machine.h \
pub_core_mallocfree.h \
pub_core_options.h \
@@ -301,6 +301,11 @@
m_dispatch/dispatch-ppc64-aix5.S \
m_dispatch/dispatch-x86-darwin.S \
m_dispatch/dispatch-amd64-darwin.S \
+ m_initimg/initimg-darwin.c \
+ m_mach/mach_basics.c \
+ m_mach/mach_msg.c \
+ m_mach/mach_traps-x86-darwin.S \
+ m_mach/mach_traps-amd64-darwin.S \
m_replacemalloc/replacemalloc_core.c \
m_scheduler/scheduler.c \
m_scheduler/sema.c \
@@ -312,6 +317,8 @@
m_sigframe/sigframe-ppc64-aix5.c \
m_sigframe/sigframe-x86-darwin.c \
m_sigframe/sigframe-amd64-darwin.c \
+ m_start-x86-darwin.S \
+ m_start-amd64-darwin.S \
m_syswrap/syscall-x86-linux.S \
m_syswrap/syscall-amd64-linux.S \
m_syswrap/syscall-ppc32-linux.S \
@@ -354,8 +361,6 @@
m_initimg/initimg-aix5.c \
m_syswrap/syswrap-aix5.c
- # Note that the *User.c files are generated using 'mig' from $mach_defs
- # above.
COREGRIND_DARWIN_SOURCE = \
m_aspacemgr/aspacemgr-linux.c \
m_debuginfo/readdwarf.c \
@@ -363,13 +368,11 @@
m_debuginfo/readstabs.c \
m_debuginfo/readmacho.c \
m_debuginfo/readpdb.c \
- m_mach/mach_basics.c \
- m_mach/mach_msg.c \
- m_initimg/initimg-darwin.c \
m_initimg/initimg-pathscan.c \
m_syswrap/syswrap-darwin.c \
m_syswrap/syswrap-generic.c
+ # These are generated using 'mig' from $mach_defs above.
COREGRIND_DARWIN_BUILT_SOURCES = \
m_mach/mach_vmUser.c \
m_mach/taskUser.c \
@@ -422,9 +425,7 @@
libcoregrind_x86_darwin_a_SOURCES = \
$(COREGRIND_SOURCES_COMMON) \
- $(COREGRIND_DARWIN_SOURCE) \
- m_mach/mach_traps-x86-darwin.S \
- m_start-x86-darwin.S
+ $(COREGRIND_DARWIN_SOURCE)
nodist_libcoregrind_x86_darwin_a_SOURCES = $(COREGRIND_DARWIN_BUILT_SOURCES)
libcoregrind_x86_darwin_a_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN)
libcoregrind_x86_darwin_a_CFLAGS = $(AM_CFLAGS_X86_DARWIN)
@@ -432,9 +433,7 @@
libcoregrind_amd64_darwin_a_SOURCES = \
$(COREGRIND_SOURCES_COMMON) \
- $(COREGRIND_DARWIN_SOURCE) \
- m_mach/mach_traps-amd64-darwin.S \
- m_start-amd64-darwin.S
+ $(COREGRIND_DARWIN_SOURCE)
nodist_libcoregrind_amd64_darwin_a_SOURCES = $(COREGRIND_DARWIN_BUILT_SOURCES)
libcoregrind_amd64_darwin_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN)
libcoregrind_amd64_darwin_a_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN)
Modified: branches/BUILD_TWEAKS/coregrind/m_initimg/initimg-darwin.c
===================================================================
--- branches/BUILD_TWEAKS/coregrind/m_initimg/initimg-darwin.c 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/m_initimg/initimg-darwin.c 2009-06-12 02:44:22 UTC (rev 10303)
@@ -29,6 +29,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+#if defined(VGO_darwin)
+
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_debuglog.h"
@@ -619,3 +621,9 @@
VG_TRACK( post_reg_write, Vg_CoreStartup, /*tid*/1, /*offset*/0,
sizeof(VexGuestArchState));
}
+
+#endif // defined(VGO_darwin)
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: branches/BUILD_TWEAKS/coregrind/m_mach/mach_basics.c
===================================================================
--- branches/BUILD_TWEAKS/coregrind/m_mach/mach_basics.c 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/m_mach/mach_basics.c 2009-06-12 02:44:22 UTC (rev 10303)
@@ -28,11 +28,11 @@
The GNU General Public License is contained in the file COPYING.
*/
+#if defined(VGO_darwin)
+
#include "pub_core_basics.h"
#include "pub_core_mach.h"
-#if defined(VGO_darwin)
-
#include <mach/mach.h>
#include <mach/machine/ndr_def.h>
@@ -84,18 +84,8 @@
vm_page_size = 4096;
}
+#endif // defined(VGO_darwin)
-#else
-
-// For platforms that don't actually have Mach kernel interfaces
-
-void VG_(mach_init)(void)
-{
- // do nothing
-}
-
-#endif
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: branches/BUILD_TWEAKS/coregrind/m_mach/mach_msg.c
===================================================================
--- branches/BUILD_TWEAKS/coregrind/m_mach/mach_msg.c 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/m_mach/mach_msg.c 2009-06-12 02:44:22 UTC (rev 10303)
@@ -1,8 +1,3 @@
-#include "pub_core_basics.h"
-#include "pub_core_mach.h"
-
-#if defined(VGO_darwin)
-
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
@@ -42,6 +37,11 @@
*
*/
+#if defined(VGO_darwin)
+
+#include "pub_core_basics.h"
+#include "pub_core_mach.h"
+
#include <mach/port.h>
#include <mach/message.h>
@@ -103,4 +103,8 @@
return mr;
}
-#endif
+#endif // defined(VGO_darwin)
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-amd64-darwin.S
===================================================================
--- branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-amd64-darwin.S 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-amd64-darwin.S 2009-06-12 02:44:22 UTC (rev 10303)
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------*/
-/*--- Basic Mach traps mach_traps.S ---*/
+/*--- Basic Mach traps. mach_traps-amd64-darwin.S ---*/
/*--------------------------------------------------------------------*/
/*
@@ -27,6 +27,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+#if defined(VGP_amd64_darwin)
+
#include "vki/vki-scnums-darwin.h"
// mach_port_name_t task_self_trap(void)
@@ -130,6 +132,7 @@
syscall
ret
+#endif defined(VGP_amd64_darwin)
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-x86-darwin.S
===================================================================
--- branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-x86-darwin.S 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/m_mach/mach_traps-x86-darwin.S 2009-06-12 02:44:22 UTC (rev 10303)
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------*/
-/*--- Basic Mach traps mach_traps.S ---*/
+/*--- Basic Mach traps. mach_traps-x86-darwin.S ---*/
/*--------------------------------------------------------------------*/
/*
@@ -27,7 +27,11 @@
The GNU General Public License is contained in the file COPYING.
*/
+#if defined(VGP_x86_darwin)
+// DDD: should use __NR_ constants in here instead of the trap numbers
+// directly!
+
// mach_port_name_t task_self_trap(void)
.text
.align 4
@@ -118,6 +122,7 @@
int $0x81
ret
+#endif // defined(VGP_x86_darwin)
/*--------------------------------------------------------------------*/
/*--- end ---*/
Modified: branches/BUILD_TWEAKS/coregrind/m_start-amd64-darwin.S
===================================================================
--- branches/BUILD_TWEAKS/coregrind/m_start-amd64-darwin.S 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/m_start-amd64-darwin.S 2009-06-12 02:44:22 UTC (rev 10303)
@@ -28,6 +28,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+#if defined(VGP_amd64_darwin)
+
#include "pub_core_basics_asm.h"
.text
@@ -79,3 +81,8 @@
int $3
int $3
+#endif // defined(VGP_amd64_darwin)
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: branches/BUILD_TWEAKS/coregrind/m_start-x86-darwin.S
===================================================================
--- branches/BUILD_TWEAKS/coregrind/m_start-x86-darwin.S 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/m_start-x86-darwin.S 2009-06-12 02:44:22 UTC (rev 10303)
@@ -28,6 +28,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+#if defined(VGP_x86_darwin)
+
#include "pub_core_basics_asm.h"
.text
@@ -78,3 +80,9 @@
// should not reach here
int $3
int $3
+
+#endif // defined(VGP_x86_darwin)
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: branches/BUILD_TWEAKS/coregrind/pub_core_mach.h
===================================================================
--- branches/BUILD_TWEAKS/coregrind/pub_core_mach.h 2009-06-12 02:23:28 UTC (rev 10302)
+++ branches/BUILD_TWEAKS/coregrind/pub_core_mach.h 2009-06-12 02:44:22 UTC (rev 10303)
@@ -28,6 +28,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+#if defined(VGO_darwin)
+
#ifndef __PUB_CORE_MACH_H
#define __PUB_CORE_MACH_H
@@ -36,13 +38,13 @@
// for operating systems like Darwin / Mac OS X that use it.
//--------------------------------------------------------------------
-#if defined(VGO_darwin)
// Call this early in Valgrind's main(). It depends on nothing.
extern void VG_(mach_init)(void);
-#endif
-#endif // __PUB_CORE_MACH_H
+#endif // __PUB_CORE_MACH_H
+#endif // defined(VGO_darwin)
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
|