< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page




1756   };
1757 
1758 #if  (defined IA32)
1759   static  Elf32_Half running_arch_code=EM_386;
1760 #elif   (defined AMD64)
1761   static  Elf32_Half running_arch_code=EM_X86_64;
1762 #elif  (defined IA64)
1763   static  Elf32_Half running_arch_code=EM_IA_64;
1764 #elif  (defined __sparc) && (defined _LP64)
1765   static  Elf32_Half running_arch_code=EM_SPARCV9;
1766 #elif  (defined __sparc) && (!defined _LP64)
1767   static  Elf32_Half running_arch_code=EM_SPARC;
1768 #elif  (defined __powerpc64__)
1769   static  Elf32_Half running_arch_code=EM_PPC64;
1770 #elif  (defined __powerpc__)
1771   static  Elf32_Half running_arch_code=EM_PPC;
1772 #elif  (defined AARCH64)
1773   static  Elf32_Half running_arch_code=EM_AARCH64;
1774 #elif  (defined ARM)
1775   static  Elf32_Half running_arch_code=EM_ARM;


1776 #elif  (defined S390)
1777   static  Elf32_Half running_arch_code=EM_S390;
1778 #elif  (defined ALPHA)
1779   static  Elf32_Half running_arch_code=EM_ALPHA;
1780 #elif  (defined MIPSEL)
1781   static  Elf32_Half running_arch_code=EM_MIPS_RS3_LE;
1782 #elif  (defined PARISC)
1783   static  Elf32_Half running_arch_code=EM_PARISC;
1784 #elif  (defined MIPS)
1785   static  Elf32_Half running_arch_code=EM_MIPS;
1786 #elif  (defined M68K)
1787   static  Elf32_Half running_arch_code=EM_68K;
1788 #elif  (defined SH)
1789   static  Elf32_Half running_arch_code=EM_SH;
1790 #else
1791     #error Method os::dll_load requires that one of following is defined:\
1792         AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, S390, SH, __sparc
1793 #endif
1794 
1795   // Identify compatability class for VM's architecture and library's architecture


3499   size_t large_page_size = 0;
3500 
3501   // large_page_size on Linux is used to round up heap size. x86 uses either
3502   // 2M or 4M page, depending on whether PAE (Physical Address Extensions)
3503   // mode is enabled. AMD64/EM64T uses 2M page in 64bit mode. IA64 can use
3504   // page as large as 256M.
3505   //
3506   // Here we try to figure out page size by parsing /proc/meminfo and looking
3507   // for a line with the following format:
3508   //    Hugepagesize:     2048 kB
3509   //
3510   // If we can't determine the value (e.g. /proc is not mounted, or the text
3511   // format has been changed), we'll use the largest page size supported by
3512   // the processor.
3513 
3514 #ifndef ZERO
3515   large_page_size =
3516     AARCH64_ONLY(2 * M)
3517     AMD64_ONLY(2 * M)
3518     ARM32_ONLY(2 * M)

3519     IA32_ONLY(4 * M)
3520     IA64_ONLY(256 * M)
3521     PPC_ONLY(4 * M)
3522     S390_ONLY(1 * M)
3523     SPARC_ONLY(4 * M);
3524 #endif // ZERO
3525 
3526   FILE *fp = fopen("/proc/meminfo", "r");
3527   if (fp) {
3528     while (!feof(fp)) {
3529       int x = 0;
3530       char buf[16];
3531       if (fscanf(fp, "Hugepagesize: %d", &x) == 1) {
3532         if (x && fgets(buf, sizeof(buf), fp) && strcmp(buf, " kB\n") == 0) {
3533           large_page_size = x * K;
3534           break;
3535         }
3536       } else {
3537         // skip to next line
3538         for (;;) {




1756   };
1757 
1758 #if  (defined IA32)
1759   static  Elf32_Half running_arch_code=EM_386;
1760 #elif   (defined AMD64)
1761   static  Elf32_Half running_arch_code=EM_X86_64;
1762 #elif  (defined IA64)
1763   static  Elf32_Half running_arch_code=EM_IA_64;
1764 #elif  (defined __sparc) && (defined _LP64)
1765   static  Elf32_Half running_arch_code=EM_SPARCV9;
1766 #elif  (defined __sparc) && (!defined _LP64)
1767   static  Elf32_Half running_arch_code=EM_SPARC;
1768 #elif  (defined __powerpc64__)
1769   static  Elf32_Half running_arch_code=EM_PPC64;
1770 #elif  (defined __powerpc__)
1771   static  Elf32_Half running_arch_code=EM_PPC;
1772 #elif  (defined AARCH64)
1773   static  Elf32_Half running_arch_code=EM_AARCH64;
1774 #elif  (defined ARM)
1775   static  Elf32_Half running_arch_code=EM_ARM;
1776 #elif  (defined AARCH32)
1777   static  Elf32_Half running_arch_code=EM_ARM;
1778 #elif  (defined S390)
1779   static  Elf32_Half running_arch_code=EM_S390;
1780 #elif  (defined ALPHA)
1781   static  Elf32_Half running_arch_code=EM_ALPHA;
1782 #elif  (defined MIPSEL)
1783   static  Elf32_Half running_arch_code=EM_MIPS_RS3_LE;
1784 #elif  (defined PARISC)
1785   static  Elf32_Half running_arch_code=EM_PARISC;
1786 #elif  (defined MIPS)
1787   static  Elf32_Half running_arch_code=EM_MIPS;
1788 #elif  (defined M68K)
1789   static  Elf32_Half running_arch_code=EM_68K;
1790 #elif  (defined SH)
1791   static  Elf32_Half running_arch_code=EM_SH;
1792 #else
1793     #error Method os::dll_load requires that one of following is defined:\
1794         AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, S390, SH, __sparc
1795 #endif
1796 
1797   // Identify compatability class for VM's architecture and library's architecture


3501   size_t large_page_size = 0;
3502 
3503   // large_page_size on Linux is used to round up heap size. x86 uses either
3504   // 2M or 4M page, depending on whether PAE (Physical Address Extensions)
3505   // mode is enabled. AMD64/EM64T uses 2M page in 64bit mode. IA64 can use
3506   // page as large as 256M.
3507   //
3508   // Here we try to figure out page size by parsing /proc/meminfo and looking
3509   // for a line with the following format:
3510   //    Hugepagesize:     2048 kB
3511   //
3512   // If we can't determine the value (e.g. /proc is not mounted, or the text
3513   // format has been changed), we'll use the largest page size supported by
3514   // the processor.
3515 
3516 #ifndef ZERO
3517   large_page_size =
3518     AARCH64_ONLY(2 * M)
3519     AMD64_ONLY(2 * M)
3520     ARM32_ONLY(2 * M)
3521     AARCH32_ONLY(2 * M)
3522     IA32_ONLY(4 * M)
3523     IA64_ONLY(256 * M)
3524     PPC_ONLY(4 * M)
3525     S390_ONLY(1 * M)
3526     SPARC_ONLY(4 * M);
3527 #endif // ZERO
3528 
3529   FILE *fp = fopen("/proc/meminfo", "r");
3530   if (fp) {
3531     while (!feof(fp)) {
3532       int x = 0;
3533       char buf[16];
3534       if (fscanf(fp, "Hugepagesize: %d", &x) == 1) {
3535         if (x && fgets(buf, sizeof(buf), fp) && strcmp(buf, " kB\n") == 0) {
3536           large_page_size = x * K;
3537           break;
3538         }
3539       } else {
3540         // skip to next line
3541         for (;;) {


< prev index next >