changeset 3831:05cfb8042c3c

PR1551: Add build support for Zero AArch64
author andrew
date Wed, 04 Sep 2013 18:21:33 +0100
parents 4b04ad70d347
children 654ac2276f33
files src/os/linux/vm/os_linux.cpp src/os_cpu/linux_zero/vm/globals_linux_zero.hpp src/share/vm/utilities/macros.hpp
diffstat 3 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/linux/vm/os_linux.cpp	Fri Sep 27 20:43:52 2013 +0100
+++ b/src/os/linux/vm/os_linux.cpp	Wed Sep 04 18:21:33 2013 +0100
@@ -387,7 +387,7 @@
  *        ...
  *        7: The default directories, normally /lib and /usr/lib.
  */
-#if defined(AMD64) || defined(_LP64) && (defined(SPARC) || defined(PPC) || defined(S390))
+#if defined(AMD64) || defined(_LP64) && (defined(SPARC) || defined(PPC) || defined(S390) || defined(AARCH64))
 #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
 #else
 #define DEFAULT_LIBPATH "/lib:/usr/lib"
@@ -5365,14 +5365,6 @@
 
 extern char** environ;
 
-#ifndef __NR_fork
-#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57)
-#endif
-
-#ifndef __NR_execve
-#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59)
-#endif
-
 // Run the specified command in a separate process. Return its exit value,
 // or -1 on failure (e.g. can't fork a new process).
 // Unlike system(), this function can be called from signal handler. It
@@ -5385,8 +5377,9 @@
   // separate process to execve. Make a direct syscall to fork process.
   // On IA64 there's no fork syscall, we have to use fork() and hope for
   // the best...
-  pid_t pid = NOT_IA64(syscall(__NR_fork);)
+  pid_t pid = NOT_IA64(NOT_AARCH64(syscall(SYS_fork);))
               IA64_ONLY(fork();)
+              AARCH64_ONLY(vfork();)
 
   if (pid < 0) {
     // fork failed
@@ -5402,7 +5395,7 @@
     // in the new process, so make a system call directly.
     // IA64 should use normal execve() from glibc to match the glibc fork()
     // above.
-    NOT_IA64(syscall(__NR_execve, "/bin/sh", argv, environ);)
+    NOT_IA64(syscall(SYS_execve, "/bin/sh", argv, environ);)
     IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);)
 
     // execve failed
--- a/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Fri Sep 27 20:43:52 2013 +0100
+++ b/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Wed Sep 04 18:21:33 2013 +0100
@@ -32,7 +32,7 @@
 //
 
 define_pd_global(bool,  DontYieldALot,           false);
-define_pd_global(intx,  ThreadStackSize,         1536);
+define_pd_global(intx,  ThreadStackSize,         1664);
 #ifdef _LP64
 define_pd_global(intx,  VMThreadStackSize,       1024);
 #else
--- a/src/share/vm/utilities/macros.hpp	Fri Sep 27 20:43:52 2013 +0100
+++ b/src/share/vm/utilities/macros.hpp	Wed Sep 04 18:21:33 2013 +0100
@@ -260,6 +260,14 @@
 #define NOT_ARM(code) code
 #endif
 
+#ifdef AARCH64
+#define AARCH64_ONLY(code) code
+#define NOT_AARCH64(code)
+#else
+#define AARCH64_ONLY(code)
+#define NOT_AARCH64(code) code
+#endif
+
 #ifdef JAVASE_EMBEDDED
 #define EMBEDDED_ONLY(code) code
 #define NOT_EMBEDDED(code)