]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Initial cleanups based on target-specific defines.
authorJulian Seward <jseward@acm.org>
Mon, 2 May 2005 10:33:44 +0000 (10:33 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 2 May 2005 10:33:44 +0000 (10:33 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3592

coregrind/m_debuglog.c
coregrind/vg_main.c

index 940d1881e017b4f63c01cd20ab7ed4f89c104bbc..f7467f9b9e08731e38b285e03597dda0602cc880 100644 (file)
@@ -55,9 +55,7 @@
 
 /* ----- x86-linux specifics ----- */
 
-/* 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)
 
 static UInt local_sys_write_stderr ( HChar* buf, Int n )
 {
@@ -94,7 +92,7 @@ static UInt local_sys_getpid ( void )
    return __res;
 }
 
-#elif defined(__x86_64__) && defined(__linux__)
+#elif defined(VGP_amd64_linux)
 
 static UInt local_sys_write_stderr ( HChar* buf, Int n )
 {
@@ -128,7 +126,7 @@ static UInt local_sys_getpid ( void )
 }
 
 #else
-#error Unknown VG_PLATFORM
+# error Unknown platform
 #endif
 
 
index c16bb00a7aeab093acc5cd712556667f3898f1a8..84b0c091d9cd8f8fc41ec7095eb38691c4474fcf 100644 (file)
@@ -1081,7 +1081,7 @@ static Addr setup_client_stack(void* init_sp,
 
 // XXX: what architectures is this necessary for?  x86 yes, PPC no, others ?
 // 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 @@ static void process_cmd_line_options( UInt* client_auxv, const char* toolname )
                   "./configure --prefix=... or --libdir=...");
 
 // XXX: what architectures is this necessary for?  x86 yes, PPC no, others ?
-#ifdef __x86__
+#if defined(VGP_x86_linux)
    {
       UInt* auxp;
       for (auxp = client_auxv; auxp[0] != AT_NULL; auxp += 2) {
@@ -2672,7 +2672,7 @@ int main(int argc, char **argv, char **envp)
    VG_(parse_procselfmaps) ( build_segment_map_callback );  /* everything */
    sp_at_startup___global_arg = 0;
    
-#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 @@ int main(int argc, char **argv, char **envp)
       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 = VG_(find_segment)(VG_(client_trampoline_code));
       if (seg)
         seg->flags &= ~(SF_STACK | SF_GROWDOWN);
    }
+#endif
 
    //==============================================================
    // Can use VG_(map)() after segments set up