|
From: <sv...@va...> - 2005-05-02 10:33:47
|
Author: sewardj
Date: 2005-05-02 11:33:44 +0100 (Mon, 02 May 2005)
New Revision: 3592
Modified:
trunk/coregrind/m_debuglog.c
trunk/coregrind/vg_main.c
Log:
Initial cleanups based on target-specific defines.
Modified: trunk/coregrind/m_debuglog.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/m_debuglog.c 2005-05-02 10:28:42 UTC (rev 3591)
+++ trunk/coregrind/m_debuglog.c 2005-05-02 10:33:44 UTC (rev 3592)
@@ -55,9 +55,7 @@
=20
/* ----- x86-linux specifics ----- */
=20
-/* Arse! Really I want to test VG_PLATFORM, but this does not
- seem to be possible. */
-#if defined(__i386__) && defined(__linux__)
+#if defined(VGP_x86_linux)
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
@@ -94,7 +92,7 @@
return __res;
}
=20
-#elif defined(__x86_64__) && defined(__linux__)
+#elif defined(VGP_amd64_linux)
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
@@ -128,7 +126,7 @@
}
=20
#else
-#error Unknown VG_PLATFORM
+# error Unknown platform
#endif
=20
=20
Modified: trunk/coregrind/vg_main.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/vg_main.c 2005-05-02 10:28:42 UTC (rev 3591)
+++ trunk/coregrind/vg_main.c 2005-05-02 10:33:44 UTC (rev 3592)
@@ -1081,7 +1081,7 @@
=20
// XXX: what architectures is this necessary for? x86 yes, PPC no, othe=
rs ?
// Perhaps a per-arch VGA_NEEDS_TRAMPOLINE constant is necessary?
-#if defined(__i386__) || defined(__amd64__)
+#if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
/* --- trampoline page --- */
VG_(memcpy)( (void *)VG_(client_trampoline_code),
&VG_(trampoline_code_start), VG_(trampoline_code_length)=
);
@@ -1629,7 +1629,7 @@
"./configure --prefix=3D... or --libdir=3D...");
=20
// XXX: what architectures is this necessary for? x86 yes, PPC no, othe=
rs ?
-#ifdef __x86__
+#if defined(VGP_x86_linux)
{
UInt* auxp;
for (auxp =3D client_auxv; auxp[0] !=3D AT_NULL; auxp +=3D 2) {
@@ -2672,7 +2672,7 @@
VG_(parse_procselfmaps) ( build_segment_map_callback ); /* everythin=
g */
sp_at_startup___global_arg =3D 0;
=20
-#if defined(__i386__) || defined(__amd64__)
+#if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
//--------------------------------------------------------------
// Protect client trampoline page (which is also sysinfo stuff)
// p: segment stuff [otherwise get seg faults...]
@@ -2681,12 +2681,13 @@
Segment *seg;
VG_(mprotect)( (void *)VG_(client_trampoline_code),
VG_(trampoline_code_length), VKI_PROT_READ|VKI_PROT_EXEC );
-#endif
+
/* Make sure this segment isn't treated as stack */
seg =3D VG_(find_segment)(VG_(client_trampoline_code));
if (seg)
seg->flags &=3D ~(SF_STACK | SF_GROWDOWN);
}
+#endif
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Can use VG_(map)() after segments set up
|