# HG changeset patch # User iveresov # Date 1314664959 25200 # Node ID 9447b2fb6fcf99a6814c12c833ee47762a22a1ad # Parent eeae91c9babac2fab7dd39f671b1d6583af594ba 7082645: Hotspot doesn't compile on old linuxes after 7060836 Summary: Move syscall ids definitions into os_linux.cpp Reviewed-by: johnc diff -r eeae91c9baba -r 9447b2fb6fcf src/os/linux/vm/os_linux.cpp --- a/src/os/linux/vm/os_linux.cpp Mon Aug 29 10:13:06 2011 -0700 +++ b/src/os/linux/vm/os_linux.cpp Mon Aug 29 17:42:39 2011 -0700 @@ -125,10 +125,6 @@ # include # include -#ifdef AMD64 -#include -#endif - #define MAX_PATH (2 * K) // for timer info max values which include all bits @@ -2600,8 +2596,17 @@ int retval = -1; #if defined(IA32) +# ifndef SYS_getcpu +# define SYS_getcpu 318 +# endif retval = syscall(SYS_getcpu, &cpu, NULL, NULL); #elif defined(AMD64) +// Unfortunately we have to bring all these macros here from vsyscall.h +// to be able to compile on old linuxes. +# define __NR_vgetcpu 2 +# define VSYSCALL_START (-10UL << 20) +# define VSYSCALL_SIZE 1024 +# define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr)) typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache); vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); retval = vgetcpu(&cpu, NULL, NULL);