38 #include "prims/jniFastGetField.hpp" 39 #include "prims/jvm.h" 40 #include "prims/jvm_misc.hpp" 41 #include "runtime/arguments.hpp" 42 #include "runtime/extendedPC.hpp" 43 #include "runtime/frame.inline.hpp" 44 #include "runtime/interfaceSupport.hpp" 45 #include "runtime/java.hpp" 46 #include "runtime/javaCalls.hpp" 47 #include "runtime/mutexLocker.hpp" 48 #include "runtime/osThread.hpp" 49 #include "runtime/sharedRuntime.hpp" 50 #include "runtime/stubRoutines.hpp" 51 #include "runtime/thread.inline.hpp" 52 #include "runtime/timer.hpp" 53 #include "utilities/events.hpp" 54 #include "utilities/vmError.hpp" 55 56 // Linux/Sparc has rather obscure naming of registers in sigcontext 57 // different between 32 and 64 bits 58 #ifdef _LP64 59 #define SIG_PC(x) ((x)->sigc_regs.tpc) 60 #define SIG_NPC(x) ((x)->sigc_regs.tnpc) 61 #define SIG_REGS(x) ((x)->sigc_regs) 62 #else 63 #define SIG_PC(x) ((x)->si_regs.pc) 64 #define SIG_NPC(x) ((x)->si_regs.npc) 65 #define SIG_REGS(x) ((x)->si_regs) 66 #endif 67 68 // those are to reference registers in sigcontext 69 enum { 70 CON_G0 = 0, 71 CON_G1, 72 CON_G2, 73 CON_G3, 74 CON_G4, 75 CON_G5, 76 CON_G6, 77 CON_G7, 78 CON_O0, 79 CON_O1, 80 CON_O2, 81 CON_O3, 82 CON_O4, 83 CON_O5, 84 CON_O6, 85 CON_O7, 86 }; 644 645 VMError::report_and_die(t, sig, pc, info, ucVoid); 646 647 ShouldNotReachHere(); 648 return false; 649 } 650 651 void os::Linux::init_thread_fpu_state(void) { 652 // Nothing to do 653 } 654 655 int os::Linux::get_fpu_control_word() { 656 return 0; 657 } 658 659 void os::Linux::set_fpu_control_word(int fpu) { 660 // nothing 661 } 662 663 bool os::is_allocatable(size_t bytes) { 664 #ifdef _LP64 665 return true; 666 #else 667 if (bytes < 2 * G) { 668 return true; 669 } 670 671 char* addr = reserve_memory(bytes, NULL); 672 673 if (addr != NULL) { 674 release_memory(addr, bytes); 675 } 676 677 return addr != NULL; 678 #endif // _LP64 679 } 680 681 /////////////////////////////////////////////////////////////////////////////// 682 // thread stack 683 684 // Minimum usable stack sizes required to get to user code. Space for 685 // HotSpot guard pages is added later. 686 size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K; 687 size_t os::Posix::_java_thread_min_stack_allowed = 64 * K; 688 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K; 689 690 // return default stack size for thr_type 691 size_t os::Posix::default_stack_size(os::ThreadType thr_type) { 692 // default stack size (compiler thread needs larger stack) 693 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M); 694 return s; 695 } 696 697 #ifndef PRODUCT 698 void os::verify_stack_alignment() { | 38 #include "prims/jniFastGetField.hpp" 39 #include "prims/jvm.h" 40 #include "prims/jvm_misc.hpp" 41 #include "runtime/arguments.hpp" 42 #include "runtime/extendedPC.hpp" 43 #include "runtime/frame.inline.hpp" 44 #include "runtime/interfaceSupport.hpp" 45 #include "runtime/java.hpp" 46 #include "runtime/javaCalls.hpp" 47 #include "runtime/mutexLocker.hpp" 48 #include "runtime/osThread.hpp" 49 #include "runtime/sharedRuntime.hpp" 50 #include "runtime/stubRoutines.hpp" 51 #include "runtime/thread.inline.hpp" 52 #include "runtime/timer.hpp" 53 #include "utilities/events.hpp" 54 #include "utilities/vmError.hpp" 55 56 // Linux/Sparc has rather obscure naming of registers in sigcontext 57 // different between 32 and 64 bits 58 #define SIG_PC(x) ((x)->sigc_regs.tpc) 59 #define SIG_NPC(x) ((x)->sigc_regs.tnpc) 60 #define SIG_REGS(x) ((x)->sigc_regs) 61 62 // those are to reference registers in sigcontext 63 enum { 64 CON_G0 = 0, 65 CON_G1, 66 CON_G2, 67 CON_G3, 68 CON_G4, 69 CON_G5, 70 CON_G6, 71 CON_G7, 72 CON_O0, 73 CON_O1, 74 CON_O2, 75 CON_O3, 76 CON_O4, 77 CON_O5, 78 CON_O6, 79 CON_O7, 80 }; 638 639 VMError::report_and_die(t, sig, pc, info, ucVoid); 640 641 ShouldNotReachHere(); 642 return false; 643 } 644 645 void os::Linux::init_thread_fpu_state(void) { 646 // Nothing to do 647 } 648 649 int os::Linux::get_fpu_control_word() { 650 return 0; 651 } 652 653 void os::Linux::set_fpu_control_word(int fpu) { 654 // nothing 655 } 656 657 bool os::is_allocatable(size_t bytes) { 658 return true; 659 } 660 661 /////////////////////////////////////////////////////////////////////////////// 662 // thread stack 663 664 // Minimum usable stack sizes required to get to user code. Space for 665 // HotSpot guard pages is added later. 666 size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K; 667 size_t os::Posix::_java_thread_min_stack_allowed = 64 * K; 668 size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K; 669 670 // return default stack size for thr_type 671 size_t os::Posix::default_stack_size(os::ThreadType thr_type) { 672 // default stack size (compiler thread needs larger stack) 673 size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M); 674 return s; 675 } 676 677 #ifndef PRODUCT 678 void os::verify_stack_alignment() { |