diff options
author | iveresov <none@none> | 2011-08-29 17:42:39 -0700 |
---|---|---|
committer | iveresov <none@none> | 2011-08-29 17:42:39 -0700 |
commit | d1b56c563cb8adf887b9f524abfd3ed13c0715e9 (patch) | |
tree | aaa955d6e04873de5446b3e6e274d3edfbc02f0e /src/os/linux | |
parent | 61a24ba44f6867c22c583a745fc24e8078626c9e (diff) |
7082645: Hotspot doesn't compile on old linuxes after 7060836
Summary: Move syscall ids definitions into os_linux.cpp
Reviewed-by: johnc
Diffstat (limited to 'src/os/linux')
-rw-r--r-- | src/os/linux/vm/os_linux.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp index a55111e81..3b0996a98 100644 --- a/src/os/linux/vm/os_linux.cpp +++ b/src/os/linux/vm/os_linux.cpp @@ -125,10 +125,6 @@ # include <inttypes.h> # include <sys/ioctl.h> -#ifdef AMD64 -#include <asm/vsyscall.h> -#endif - #define MAX_PATH (2 * K) // for timer info max values which include all bits @@ -2600,8 +2596,17 @@ int os::Linux::sched_getcpu_syscall(void) { 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); |