src/os/linux/vm/os_linux.hpp

Print this page




  53   static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
  54 
  55   static address   _initial_thread_stack_bottom;
  56   static uintptr_t _initial_thread_stack_size;
  57 
  58   static const char *_glibc_version;
  59   static const char *_libpthread_version;
  60 
  61   static bool _is_floating_stack;
  62   static bool _is_NPTL;
  63   static bool _supports_fast_thread_cpu_time;
  64 
  65   static GrowableArray<int>* _cpu_to_node;
  66 
  67  protected:
  68 
  69   static julong _physical_memory;
  70   static pthread_t _main_thread;
  71   static Mutex* _createThread_lock;
  72   static int _page_size;

  73 
  74   static julong available_memory();
  75   static julong physical_memory() { return _physical_memory; }
  76   static void initialize_system_info();
  77 
  78   static void set_glibc_version(const char *s)      { _glibc_version = s; }
  79   static void set_libpthread_version(const char *s) { _libpthread_version = s; }
  80 
  81   static bool supports_variable_stack_size();
  82 
  83   static void set_is_NPTL()                   { _is_NPTL = true;  }
  84   static void set_is_LinuxThreads()           { _is_NPTL = false; }
  85   static void set_is_floating_stack()         { _is_floating_stack = true; }
  86 
  87   static void rebuild_cpu_to_node_map();
  88   static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
  89 
  90   static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
  91 
  92   static void print_full_memory_info(outputStream* st);


  98   static void *dlopen_helper(const char *name, char *ebuf, int ebuflen);
  99   static void *dll_load_in_vmthread(const char *name, char *ebuf, int ebuflen);
 100 
 101   static void init_thread_fpu_state();
 102   static int  get_fpu_control_word();
 103   static void set_fpu_control_word(int fpu_control);
 104   static pthread_t main_thread(void)                                { return _main_thread; }
 105   // returns kernel thread id (similar to LWP id on Solaris), which can be
 106   // used to access /proc
 107   static pid_t gettid();
 108   static void set_createThread_lock(Mutex* lk)                      { _createThread_lock = lk; }
 109   static Mutex* createThread_lock(void)                             { return _createThread_lock; }
 110   static void hotspot_sigmask(Thread* thread);
 111 
 112   static address   initial_thread_stack_bottom(void)                { return _initial_thread_stack_bottom; }
 113   static uintptr_t initial_thread_stack_size(void)                  { return _initial_thread_stack_size; }
 114   static bool is_initial_thread(void);
 115 
 116   static int page_size(void)                                        { return _page_size; }
 117   static void set_page_size(int val)                                { _page_size = val; }


 118 
 119   static address   ucontext_get_pc(ucontext_t* uc);
 120   static intptr_t* ucontext_get_sp(ucontext_t* uc);
 121   static intptr_t* ucontext_get_fp(ucontext_t* uc);
 122 
 123   // For Analyzer Forte AsyncGetCallTrace profiling support:
 124   //
 125   // This interface should be declared in os_linux_i486.hpp, but
 126   // that file provides extensions to the os class and not the
 127   // Linux class.
 128   static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
 129     intptr_t** ret_sp, intptr_t** ret_fp);
 130 
 131   // This boolean allows users to forward their own non-matching signals
 132   // to JVM_handle_linux_signal, harmlessly.
 133   static bool signal_handlers_are_installed;
 134 
 135   static int get_our_sigflags(int);
 136   static void set_our_sigflags(int, int);
 137   static void signal_sets_init();




  53   static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
  54 
  55   static address   _initial_thread_stack_bottom;
  56   static uintptr_t _initial_thread_stack_size;
  57 
  58   static const char *_glibc_version;
  59   static const char *_libpthread_version;
  60 
  61   static bool _is_floating_stack;
  62   static bool _is_NPTL;
  63   static bool _supports_fast_thread_cpu_time;
  64 
  65   static GrowableArray<int>* _cpu_to_node;
  66 
  67  protected:
  68 
  69   static julong _physical_memory;
  70   static pthread_t _main_thread;
  71   static Mutex* _createThread_lock;
  72   static int _page_size;
  73   static const int _vm_default_page_size;
  74 
  75   static julong available_memory();
  76   static julong physical_memory() { return _physical_memory; }
  77   static void initialize_system_info();
  78 
  79   static void set_glibc_version(const char *s)      { _glibc_version = s; }
  80   static void set_libpthread_version(const char *s) { _libpthread_version = s; }
  81 
  82   static bool supports_variable_stack_size();
  83 
  84   static void set_is_NPTL()                   { _is_NPTL = true;  }
  85   static void set_is_LinuxThreads()           { _is_NPTL = false; }
  86   static void set_is_floating_stack()         { _is_floating_stack = true; }
  87 
  88   static void rebuild_cpu_to_node_map();
  89   static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
  90 
  91   static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
  92 
  93   static void print_full_memory_info(outputStream* st);


  99   static void *dlopen_helper(const char *name, char *ebuf, int ebuflen);
 100   static void *dll_load_in_vmthread(const char *name, char *ebuf, int ebuflen);
 101 
 102   static void init_thread_fpu_state();
 103   static int  get_fpu_control_word();
 104   static void set_fpu_control_word(int fpu_control);
 105   static pthread_t main_thread(void)                                { return _main_thread; }
 106   // returns kernel thread id (similar to LWP id on Solaris), which can be
 107   // used to access /proc
 108   static pid_t gettid();
 109   static void set_createThread_lock(Mutex* lk)                      { _createThread_lock = lk; }
 110   static Mutex* createThread_lock(void)                             { return _createThread_lock; }
 111   static void hotspot_sigmask(Thread* thread);
 112 
 113   static address   initial_thread_stack_bottom(void)                { return _initial_thread_stack_bottom; }
 114   static uintptr_t initial_thread_stack_size(void)                  { return _initial_thread_stack_size; }
 115   static bool is_initial_thread(void);
 116 
 117   static int page_size(void)                                        { return _page_size; }
 118   static void set_page_size(int val)                                { _page_size = val; }
 119 
 120   static int vm_default_page_size(void)                             { return _vm_default_page_size; }
 121 
 122   static address   ucontext_get_pc(ucontext_t* uc);
 123   static intptr_t* ucontext_get_sp(ucontext_t* uc);
 124   static intptr_t* ucontext_get_fp(ucontext_t* uc);
 125 
 126   // For Analyzer Forte AsyncGetCallTrace profiling support:
 127   //
 128   // This interface should be declared in os_linux_i486.hpp, but
 129   // that file provides extensions to the os class and not the
 130   // Linux class.
 131   static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
 132     intptr_t** ret_sp, intptr_t** ret_fp);
 133 
 134   // This boolean allows users to forward their own non-matching signals
 135   // to JVM_handle_linux_signal, harmlessly.
 136   static bool signal_handlers_are_installed;
 137 
 138   static int get_our_sigflags(int);
 139   static void set_our_sigflags(int, int);
 140   static void signal_sets_init();