1898 } arch_t; |
1900 } arch_t; |
1899 |
1901 |
1900 #ifndef EM_486 |
1902 #ifndef EM_486 |
1901 #define EM_486 6 /* Intel 80486 */ |
1903 #define EM_486 6 /* Intel 80486 */ |
1902 #endif |
1904 #endif |
|
1905 #ifndef EM_AARCH64 |
|
1906 #define EM_AARCH64 183 /* ARM AARCH64 */ |
|
1907 #endif |
1903 |
1908 |
1904 static const arch_t arch_array[]={ |
1909 static const arch_t arch_array[]={ |
1905 {EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, |
1910 {EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, |
1906 {EM_486, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, |
1911 {EM_486, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, |
1907 {EM_IA_64, EM_IA_64, ELFCLASS64, ELFDATA2LSB, (char*)"IA 64"}, |
1912 {EM_IA_64, EM_IA_64, ELFCLASS64, ELFDATA2LSB, (char*)"IA 64"}, |
1919 {EM_S390, EM_S390, ELFCLASSNONE, ELFDATA2MSB, (char*)"IBM System/390"}, |
1924 {EM_S390, EM_S390, ELFCLASSNONE, ELFDATA2MSB, (char*)"IBM System/390"}, |
1920 {EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"}, |
1925 {EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"}, |
1921 {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"}, |
1926 {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"}, |
1922 {EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"}, |
1927 {EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"}, |
1923 {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, |
1928 {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, |
1924 {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"} |
1929 {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}, |
|
1930 {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"}, |
1925 }; |
1931 }; |
1926 |
1932 |
1927 #if (defined IA32) |
1933 #if (defined IA32) |
1928 static Elf32_Half running_arch_code=EM_386; |
1934 static Elf32_Half running_arch_code=EM_386; |
1929 #elif (defined AMD64) |
1935 #elif (defined AMD64) |
1950 static Elf32_Half running_arch_code=EM_PARISC; |
1956 static Elf32_Half running_arch_code=EM_PARISC; |
1951 #elif (defined MIPS) |
1957 #elif (defined MIPS) |
1952 static Elf32_Half running_arch_code=EM_MIPS; |
1958 static Elf32_Half running_arch_code=EM_MIPS; |
1953 #elif (defined M68K) |
1959 #elif (defined M68K) |
1954 static Elf32_Half running_arch_code=EM_68K; |
1960 static Elf32_Half running_arch_code=EM_68K; |
|
1961 #elif (defined AARCH64) |
|
1962 static Elf32_Half running_arch_code=EM_AARCH64; |
1955 #else |
1963 #else |
1956 #error Method os::dll_load requires that one of following is defined:\ |
1964 #error Method os::dll_load requires that one of following is defined:\ |
1957 IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K |
1965 IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64 |
1958 #endif |
1966 #endif |
1959 |
1967 |
1960 // Identify compatability class for VM's architecture and library's architecture |
1968 // Identify compatability class for VM's architecture and library's architecture |
1961 // Obtain string descriptions for architectures |
1969 // Obtain string descriptions for architectures |
1962 |
1970 |
3283 // format has been changed), we'll use the largest page size supported by |
3291 // format has been changed), we'll use the largest page size supported by |
3284 // the processor. |
3292 // the processor. |
3285 |
3293 |
3286 #ifndef ZERO |
3294 #ifndef ZERO |
3287 large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M) |
3295 large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M) |
3288 ARM_ONLY(2 * M) PPC_ONLY(4 * M); |
3296 ARM_ONLY(2 * M) PPC_ONLY(4 * M) AARCH64_ONLY(2 * M); |
3289 #endif // ZERO |
3297 #endif // ZERO |
3290 |
3298 |
3291 FILE *fp = fopen("/proc/meminfo", "r"); |
3299 FILE *fp = fopen("/proc/meminfo", "r"); |
3292 if (fp) { |
3300 if (fp) { |
3293 while (!feof(fp)) { |
3301 while (!feof(fp)) { |
5862 |
5870 |
5863 |
5871 |
5864 extern char** environ; |
5872 extern char** environ; |
5865 |
5873 |
5866 #ifndef __NR_fork |
5874 #ifndef __NR_fork |
5867 #define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57) |
5875 #define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57) AARCH64_ONLY(1079) |
5868 #endif |
5876 #endif |
5869 |
5877 |
5870 #ifndef __NR_execve |
5878 #ifndef __NR_execve |
5871 #define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59) |
5879 #define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59) AARCH64_ONLY(221) |
5872 #endif |
5880 #endif |
5873 |
5881 |
5874 // Run the specified command in a separate process. Return its exit value, |
5882 // Run the specified command in a separate process. Return its exit value, |
5875 // or -1 on failure (e.g. can't fork a new process). |
5883 // or -1 on failure (e.g. can't fork a new process). |
5876 // Unlike system(), this function can be called from signal handler. It |
5884 // Unlike system(), this function can be called from signal handler. It |