Two AArch64-related patches
Michal Vyskocil
mvyskocil at suse.cz
Fri Mar 22 04:32:46 PDT 2013
On Fri, Mar 22, 2013 at 10:43:01AM +0000, Andrew Haley wrote:
> Michal Vyskocil writes:
>
> > I'm a maintainer of openjdk for SUSE and recently I've got two patches
> > from our AArch64 team for openjdk7. I have no idea if porting of
> > openjdk7 is important for this group, but it is probably better to try
> > it.
>
> You may be aware that there is an AArch64 porting project.
>
> Mailing List
> aarch64-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/aarch64-dev
>
> The actual source code still isn't there, but hopefully will be as
> soon as we get all the legal details sorted out.
>
> Now for the patch itself:
>
> > --- icedtea-2.3.7/openjdk/hotspot/src/os/linux/vm/os_linux.cpp
> > +++ icedtea-2.3.7/openjdk/hotspot/src/os/linux/vm/os_linux.cpp
> > @@ -1893,7 +1893,8 @@ void * os::dll_load(const char *filename
> > {EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"},
> > {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"},
> > {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"},
> > - {EM_SH, EM_SH, ELFCLASS32, ELFDATA2LSB, (char*)"SH"} /* Support little endian only*/
> > + {EM_SH, EM_SH, ELFCLASS32, ELFDATA2LSB, (char*)"SH"}, /* Support little endian only*/
> > + {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"} /* Support little endian only*/
> > };
> >
> > #if (defined IA32)
> > @@ -1926,6 +1927,8 @@ void * os::dll_load(const char *filename
> > static Elf32_Half running_arch_code=EM_68K;
> > #elif (defined SH)
> > static Elf32_Half running_arch_code=EM_SH;
> > + #elif (defined AARCH64)
> > + static Elf32_Half running_arch_code=EM_AARCH64;
> > #else
> > #error Method os::dll_load requires that one of following is defined:\
> > IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, SH
>
> This part seems reasonable.
>
> > --- icedtea-2.3.7/openjdk/hotspot/src/os/linux/vm/os_linux.cpp
> > +++ icedtea-2.3.7/openjdk/hotspot/src/os/linux/vm/os_linux.cpp
> > @@ -5374,14 +5374,6 @@ void Parker::unpark() {
> >
> > 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
> > @@ -5392,10 +5384,11 @@ int os::fork_and_exec(char* cmd) {
> > // fork() in LinuxThreads/NPTL is not async-safe. It needs to run
> > // pthread_atfork handlers and reset pthread library. All we need is a
> > // 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);)
> > - IA64_ONLY(fork();)
> > +#ifdef SYS_fork
> > + pid_t pid = syscall(SYS_fork);
> > +#else
> > + pid_t pid = syscall(SYS_clone, SIGCHLD, 0, 0, 0, 0);
> > +#endif
> >
> > if (pid < 0) {
> > // fork failed
> > @@ -5409,10 +5402,7 @@ int os::fork_and_exec(char* cmd) {
> > // not reset by fork() (see notes above), execve() will instead kill
> > // every thread in the parent process. We know this is the only thread
> > // 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);)
> > - IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);)
> > + syscall(SYS_execve, "/bin/sh", argv, environ);
> >
> > // execve failed
> > _exit(-1);
>
> Why have you deleted the IA-64 code?
I've forgot to add an original author into CC, fixed now.
Andreas, please comment
Regards
Michal Vyskocil
>
> Andrew.
More information about the porters-dev
mailing list