hotspot/src/os/linux/vm/os_linux.cpp
changeset 29185 41cf0610fedf
parent 28172 19ae5c844e75
parent 29181 89beae49867c
child 29193 3ede621e9262
equal deleted inserted replaced
28506:8c606017b9cf 29185:41cf0610fedf
   245   #ifdef _LP64
   245   #ifdef _LP64
   246 static char cpu_arch[] = "sparcv9";
   246 static char cpu_arch[] = "sparcv9";
   247   #else
   247   #else
   248 static char cpu_arch[] = "sparc";
   248 static char cpu_arch[] = "sparc";
   249   #endif
   249   #endif
       
   250 #elif defined(AARCH64)
       
   251 static char cpu_arch[] = "aarch64";
   250 #else
   252 #else
   251   #error Add appropriate cpu_arch setting
   253   #error Add appropriate cpu_arch setting
   252 #endif
   254 #endif
   253 
   255 
   254 
   256 
  1892   } arch_t;
  1894   } arch_t;
  1893 
  1895 
  1894 #ifndef EM_486
  1896 #ifndef EM_486
  1895   #define EM_486          6               /* Intel 80486 */
  1897   #define EM_486          6               /* Intel 80486 */
  1896 #endif
  1898 #endif
       
  1899 #ifndef EM_AARCH64
       
  1900   #define EM_AARCH64    183               /* ARM AARCH64 */
       
  1901 #endif
  1897 
  1902 
  1898   static const arch_t arch_array[]={
  1903   static const arch_t arch_array[]={
  1899     {EM_386,         EM_386,     ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
  1904     {EM_386,         EM_386,     ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
  1900     {EM_486,         EM_386,     ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
  1905     {EM_486,         EM_386,     ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
  1901     {EM_IA_64,       EM_IA_64,   ELFCLASS64, ELFDATA2LSB, (char*)"IA 64"},
  1906     {EM_IA_64,       EM_IA_64,   ELFCLASS64, ELFDATA2LSB, (char*)"IA 64"},
  1913     {EM_S390,        EM_S390,    ELFCLASSNONE, ELFDATA2MSB, (char*)"IBM System/390"},
  1918     {EM_S390,        EM_S390,    ELFCLASSNONE, ELFDATA2MSB, (char*)"IBM System/390"},
  1914     {EM_ALPHA,       EM_ALPHA,   ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"},
  1919     {EM_ALPHA,       EM_ALPHA,   ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"},
  1915     {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"},
  1920     {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"},
  1916     {EM_MIPS,        EM_MIPS,    ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"},
  1921     {EM_MIPS,        EM_MIPS,    ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"},
  1917     {EM_PARISC,      EM_PARISC,  ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"},
  1922     {EM_PARISC,      EM_PARISC,  ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"},
  1918     {EM_68K,         EM_68K,     ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}
  1923     {EM_68K,         EM_68K,     ELFCLASS32, ELFDATA2MSB, (char*)"M68k"},
       
  1924     {EM_AARCH64,     EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"},
  1919   };
  1925   };
  1920 
  1926 
  1921 #if  (defined IA32)
  1927 #if  (defined IA32)
  1922   static  Elf32_Half running_arch_code=EM_386;
  1928   static  Elf32_Half running_arch_code=EM_386;
  1923 #elif   (defined AMD64)
  1929 #elif   (defined AMD64)
  1944   static  Elf32_Half running_arch_code=EM_PARISC;
  1950   static  Elf32_Half running_arch_code=EM_PARISC;
  1945 #elif  (defined MIPS)
  1951 #elif  (defined MIPS)
  1946   static  Elf32_Half running_arch_code=EM_MIPS;
  1952   static  Elf32_Half running_arch_code=EM_MIPS;
  1947 #elif  (defined M68K)
  1953 #elif  (defined M68K)
  1948   static  Elf32_Half running_arch_code=EM_68K;
  1954   static  Elf32_Half running_arch_code=EM_68K;
       
  1955 #elif  (defined AARCH64)
       
  1956   static  Elf32_Half running_arch_code=EM_AARCH64;
  1949 #else
  1957 #else
  1950     #error Method os::dll_load requires that one of following is defined:\
  1958     #error Method os::dll_load requires that one of following is defined:\
  1951          IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K
  1959          IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64
  1952 #endif
  1960 #endif
  1953 
  1961 
  1954   // Identify compatability class for VM's architecture and library's architecture
  1962   // Identify compatability class for VM's architecture and library's architecture
  1955   // Obtain string descriptions for architectures
  1963   // Obtain string descriptions for architectures
  1956 
  1964 
  3277   // format has been changed), we'll use the largest page size supported by
  3285   // format has been changed), we'll use the largest page size supported by
  3278   // the processor.
  3286   // the processor.
  3279 
  3287 
  3280 #ifndef ZERO
  3288 #ifndef ZERO
  3281   large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M)
  3289   large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M)
  3282                      ARM_ONLY(2 * M) PPC_ONLY(4 * M);
  3290                      ARM_ONLY(2 * M) PPC_ONLY(4 * M) AARCH64_ONLY(2 * M);
  3283 #endif // ZERO
  3291 #endif // ZERO
  3284 
  3292 
  3285   FILE *fp = fopen("/proc/meminfo", "r");
  3293   FILE *fp = fopen("/proc/meminfo", "r");
  3286   if (fp) {
  3294   if (fp) {
  3287     while (!feof(fp)) {
  3295     while (!feof(fp)) {
  5860 
  5868 
  5861 
  5869 
  5862 extern char** environ;
  5870 extern char** environ;
  5863 
  5871 
  5864 #ifndef __NR_fork
  5872 #ifndef __NR_fork
  5865   #define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57)
  5873   #define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57) AARCH64_ONLY(1079)
  5866 #endif
  5874 #endif
  5867 
  5875 
  5868 #ifndef __NR_execve
  5876 #ifndef __NR_execve
  5869   #define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59)
  5877   #define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59) AARCH64_ONLY(221)
  5870 #endif
  5878 #endif
  5871 
  5879 
  5872 // Run the specified command in a separate process. Return its exit value,
  5880 // Run the specified command in a separate process. Return its exit value,
  5873 // or -1 on failure (e.g. can't fork a new process).
  5881 // or -1 on failure (e.g. can't fork a new process).
  5874 // Unlike system(), this function can be called from signal handler. It
  5882 // Unlike system(), this function can be called from signal handler. It