view ppc_patches/0002_PPC_defines.patch @ 4798:df79d76c17ab

Patch queue containing the ppc port. Applying this to the staging repository at tag hs25-b34 leads to the code contained in this repository. We will update the patches so that with the staging repo and the patches always a working hotspot for ppc can be built.
author Goetz
date Wed, 12 Jun 2013 15:55:20 +0200
parents
children 2a6fd169b0b7
line wrap: on
line source
# HG changeset patch
# Parent 06bfb810994ad0a0511d16386a4b5c20b705e6d6
Clean up PPC defines.

Reorganize PPC defines.  Distinguish PPC, PPC64 and PPC32.
PPC should guard code needed on PPC regardless of word size.
PPC32 and PPC64 should guard code needed in the 64-bit or
the 32-bit port.

diff -r 06bfb810994a src/os/bsd/vm/os_bsd.cpp
--- a/src/os/bsd/vm/os_bsd.cpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/os/bsd/vm/os_bsd.cpp	Fri Apr 26 10:15:14 2013 +0200
@@ -219,7 +219,7 @@
 static char cpu_arch[] = "amd64";
 #elif defined(ARM)
 static char cpu_arch[] = "arm";
-#elif defined(PPC)
+#elif defined(PPC32)
 static char cpu_arch[] = "ppc";
 #elif defined(SPARC)
 #  ifdef _LP64
diff -r 06bfb810994a src/os/linux/vm/os_linux.cpp
--- a/src/os/linux/vm/os_linux.cpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/os/linux/vm/os_linux.cpp	Fri Apr 26 10:15:14 2013 +0200
@@ -258,7 +258,7 @@
 static char cpu_arch[] = "amd64";
 #elif defined(ARM)
 static char cpu_arch[] = "arm";
-#elif defined(PPC)
+#elif defined(PPC32)
 static char cpu_arch[] = "ppc";
 #elif defined(SPARC)
 #  ifdef _LP64
diff -r 06bfb810994a src/os_cpu/bsd_zero/vm/os_bsd_zero.hpp
--- a/src/os_cpu/bsd_zero/vm/os_bsd_zero.hpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/os_cpu/bsd_zero/vm/os_bsd_zero.hpp	Fri Apr 26 10:15:14 2013 +0200
@@ -36,7 +36,7 @@
 
   // Atomically copy 64 bits of data
   static void atomic_copy64(volatile void *src, volatile void *dst) {
-#if defined(PPC) && !defined(_LP64)
+#if defined(PPC32)
     double tmp;
     asm volatile ("lfd  %0, 0(%1)\n"
                   "stfd %0, 0(%2)\n"
diff -r 06bfb810994a src/os_cpu/linux_zero/vm/os_linux_zero.hpp
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Fri Apr 26 10:15:14 2013 +0200
@@ -36,7 +36,7 @@
 
   // Atomically copy 64 bits of data
   static void atomic_copy64(volatile void *src, volatile void *dst) {
-#if defined(PPC) && !defined(_LP64)
+#if defined(PPC32)
     double tmp;
     asm volatile ("lfd  %0, 0(%1)\n"
                   "stfd %0, 0(%2)\n"
diff -r 06bfb810994a src/share/vm/runtime/frame.cpp
--- a/src/share/vm/runtime/frame.cpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/share/vm/runtime/frame.cpp	Fri Apr 26 10:15:14 2013 +0200
@@ -918,7 +918,7 @@
     cld_f->do_cld(m->method_holder()->class_loader_data());
   }
 
-#if !defined(PPC) || defined(ZERO)
+#if !defined(PPC32) || defined(ZERO)
   if (m->is_native()) {
 #ifdef CC_INTERP
     interpreterState istate = get_interpreterState();
@@ -927,11 +927,11 @@
     f->do_oop((oop*)( fp() + interpreter_frame_oop_temp_offset ));
 #endif /* CC_INTERP */
   }
-#else // PPC
+#else // PPC32
   if (m->is_native() && m->is_static()) {
     f->do_oop(interpreter_frame_mirror_addr());
   }
-#endif // PPC
+#endif // PPC32
 
   int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
 
diff -r 06bfb810994a src/share/vm/runtime/frame.hpp
--- a/src/share/vm/runtime/frame.hpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/share/vm/runtime/frame.hpp	Fri Apr 26 10:15:14 2013 +0200
@@ -346,7 +346,7 @@
   void interpreter_frame_set_method(Method* method);
   Method** interpreter_frame_method_addr() const;
   ConstantPoolCache** interpreter_frame_cache_addr() const;
-#ifdef PPC
+#ifdef PPC32
   oop* interpreter_frame_mirror_addr() const;
 #endif
 
diff -r 06bfb810994a src/share/vm/runtime/sharedRuntime.cpp
--- a/src/share/vm/runtime/sharedRuntime.cpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Fri Apr 26 10:15:14 2013 +0200
@@ -406,7 +406,7 @@
 
 #endif
 
-#if defined(__SOFTFP__) || defined(PPC)
+#if defined(__SOFTFP__) || defined(PPC32)
 double SharedRuntime::dsqrt(double f) {
   return sqrt(f);
 }
diff -r 06bfb810994a src/share/vm/runtime/sharedRuntime.hpp
--- a/src/share/vm/runtime/sharedRuntime.hpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/share/vm/runtime/sharedRuntime.hpp	Fri Apr 26 10:15:14 2013 +0200
@@ -140,7 +140,7 @@
   static double dabs(double f);
 #endif
 
-#if defined(__SOFTFP__) || defined(PPC)
+#if defined(__SOFTFP__) || defined(PPC32)
   static double dsqrt(double f);
 #endif
 
diff -r 06bfb810994a src/share/vm/runtime/vm_version.cpp
--- a/src/share/vm/runtime/vm_version.cpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/share/vm/runtime/vm_version.cpp	Fri Apr 26 10:15:14 2013 +0200
@@ -186,7 +186,7 @@
                  IA64_ONLY("ia64")               \
                  AMD64_ONLY("amd64")             \
                  ARM_ONLY("arm")                 \
-                 PPC_ONLY("ppc")                 \
+                 PPC32_ONLY("ppc")               \
                  SPARC_ONLY("sparc")
 #endif // ZERO
 
@@ -244,7 +244,7 @@
       #define FLOAT_ARCH_STR "-e500v2"
     #elif defined(ARM)
       #define FLOAT_ARCH_STR "-vfp"
-    #elif defined(PPC)
+    #elif defined(PPC32)
       #define FLOAT_ARCH_STR "-hflt"
     #else
       #define FLOAT_ARCH_STR ""
diff -r 06bfb810994a src/share/vm/utilities/macros.hpp
--- a/src/share/vm/utilities/macros.hpp	Mon Apr 22 09:43:26 2013 +0200
+++ b/src/share/vm/utilities/macros.hpp	Fri Apr 26 10:15:14 2013 +0200
@@ -340,7 +340,8 @@
 #define NOT_SPARC(code) code
 #endif
 
-#ifdef PPC
+#if defined(PPC32) || defined(PPC64)
+#define PPC
 #define PPC_ONLY(code) code
 #define NOT_PPC(code)
 #else
@@ -348,6 +349,22 @@
 #define NOT_PPC(code) code
 #endif
 
+#ifdef PPC32
+#define PPC32_ONLY(code) code
+#define NOT_PPC32(code)
+#else
+#define PPC32_ONLY(code)
+#define NOT_PPC32(code) code
+#endif
+
+#ifdef PPC64
+#define PPC64_ONLY(code) code
+#define NOT_PPC64(code)
+#else
+#define PPC64_ONLY(code)
+#define NOT_PPC64(code) code
+#endif
+
 #ifdef E500V2
 #define E500V2_ONLY(code) code
 #define NOT_E500V2(code)