src/share/vm/runtime/os.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot-rt-fx60 Sdiff src/share/vm/runtime

src/share/vm/runtime/os.hpp

Print this page




  56 class FileHandle;
  57 template<class E> class GrowableArray;
  58 
  59 // %%%%% Moved ThreadState, START_FN, OSThread to new osThread.hpp. -- Rose
  60 
  61 // Platform-independent error return values from OS functions
  62 enum OSReturn {
  63   OS_OK         =  0,        // Operation was successful
  64   OS_ERR        = -1,        // Operation failed
  65   OS_INTRPT     = -2,        // Operation was interrupted
  66   OS_TIMEOUT    = -3,        // Operation timed out
  67   OS_NOMEM      = -5,        // Operation failed for lack of memory
  68   OS_NORESOURCE = -6         // Operation failed for lack of nonmemory resource
  69 };
  70 
  71 enum ThreadPriority {        // JLS 20.20.1-3
  72   NoPriority       = -1,     // Initial non-priority value
  73   MinPriority      =  1,     // Minimum priority
  74   NormPriority     =  5,     // Normal (non-daemon) priority
  75   NearMaxPriority  =  9,     // High priority, used for VMThread
  76   MaxPriority      = 10      // Highest priority, used for WatcherThread
  77                              // ensures that VMThread doesn't starve profiler

  78 };
  79 
  80 // Typedef for structured exception handling support
  81 typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
  82 
  83 class os: AllStatic {
  84  public:
  85   enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel)
  86 
  87  private:
  88   static OSThread*          _starting_thread;
  89   static address            _polling_page;
  90   static volatile int32_t * _mem_serialize_page;
  91   static uintptr_t          _serialize_page_mask;
  92  public:
  93   static size_t             _page_sizes[page_sizes_max];
  94 
  95  private:
  96   static void init_page_sizes(size_t default_page_size) {
  97     _page_sizes[0] = default_page_size;


 716 #ifdef TARGET_OS_ARCH_linux_ppc
 717 # include "os_linux_ppc.hpp"
 718 #endif
 719 #ifdef TARGET_OS_ARCH_bsd_x86
 720 # include "os_bsd_x86.hpp"
 721 #endif
 722 #ifdef TARGET_OS_ARCH_bsd_zero
 723 # include "os_bsd_zero.hpp"
 724 #endif
 725 
 726  public:
 727   // debugging support (mostly used by debug.cpp but also fatal error handler)
 728   static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address
 729 
 730   static bool dont_yield();                     // when true, JVM_Yield() is nop
 731   static void print_statistics();
 732 
 733   // Thread priority helpers (implemented in OS-specific part)
 734   static OSReturn set_native_priority(Thread* thread, int native_prio);
 735   static OSReturn get_native_priority(const Thread* const thread, int* priority_ptr);
 736   static int java_to_os_priority[MaxPriority + 1];
 737   // Hint to the underlying OS that a task switch would not be good.
 738   // Void return because it's a hint and can fail.
 739   static void hint_no_preempt();
 740 
 741   // Used at creation if requested by the diagnostic flag PauseAtStartup.
 742   // Causes the VM to wait until an external stimulus has been applied
 743   // (for Unix, that stimulus is a signal, for Windows, an external
 744   // ResumeThread call)
 745   static void pause();
 746 
 747  protected:
 748   static long _rand_seed;                   // seed for random number generator
 749   static int _processor_count;              // number of processors
 750 
 751   static char* format_boot_path(const char* format_string,
 752                                 const char* home,
 753                                 int home_len,
 754                                 char fileSep,
 755                                 char pathSep);
 756   static bool set_boot_path(char fileSep, char pathSep);


  56 class FileHandle;
  57 template<class E> class GrowableArray;
  58 
  59 // %%%%% Moved ThreadState, START_FN, OSThread to new osThread.hpp. -- Rose
  60 
  61 // Platform-independent error return values from OS functions
  62 enum OSReturn {
  63   OS_OK         =  0,        // Operation was successful
  64   OS_ERR        = -1,        // Operation failed
  65   OS_INTRPT     = -2,        // Operation was interrupted
  66   OS_TIMEOUT    = -3,        // Operation timed out
  67   OS_NOMEM      = -5,        // Operation failed for lack of memory
  68   OS_NORESOURCE = -6         // Operation failed for lack of nonmemory resource
  69 };
  70 
  71 enum ThreadPriority {        // JLS 20.20.1-3
  72   NoPriority       = -1,     // Initial non-priority value
  73   MinPriority      =  1,     // Minimum priority
  74   NormPriority     =  5,     // Normal (non-daemon) priority
  75   NearMaxPriority  =  9,     // High priority, used for VMThread
  76   MaxPriority      = 10,     // Highest priority, used for WatcherThread
  77                              // ensures that VMThread doesn't starve profiler
  78   CriticalPriority = 11      // Critical thread priority
  79 };
  80 
  81 // Typedef for structured exception handling support
  82 typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
  83 
  84 class os: AllStatic {
  85  public:
  86   enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel)
  87 
  88  private:
  89   static OSThread*          _starting_thread;
  90   static address            _polling_page;
  91   static volatile int32_t * _mem_serialize_page;
  92   static uintptr_t          _serialize_page_mask;
  93  public:
  94   static size_t             _page_sizes[page_sizes_max];
  95 
  96  private:
  97   static void init_page_sizes(size_t default_page_size) {
  98     _page_sizes[0] = default_page_size;


 717 #ifdef TARGET_OS_ARCH_linux_ppc
 718 # include "os_linux_ppc.hpp"
 719 #endif
 720 #ifdef TARGET_OS_ARCH_bsd_x86
 721 # include "os_bsd_x86.hpp"
 722 #endif
 723 #ifdef TARGET_OS_ARCH_bsd_zero
 724 # include "os_bsd_zero.hpp"
 725 #endif
 726 
 727  public:
 728   // debugging support (mostly used by debug.cpp but also fatal error handler)
 729   static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address
 730 
 731   static bool dont_yield();                     // when true, JVM_Yield() is nop
 732   static void print_statistics();
 733 
 734   // Thread priority helpers (implemented in OS-specific part)
 735   static OSReturn set_native_priority(Thread* thread, int native_prio);
 736   static OSReturn get_native_priority(const Thread* const thread, int* priority_ptr);
 737   static int java_to_os_priority[CriticalPriority + 1];
 738   // Hint to the underlying OS that a task switch would not be good.
 739   // Void return because it's a hint and can fail.
 740   static void hint_no_preempt();
 741 
 742   // Used at creation if requested by the diagnostic flag PauseAtStartup.
 743   // Causes the VM to wait until an external stimulus has been applied
 744   // (for Unix, that stimulus is a signal, for Windows, an external
 745   // ResumeThread call)
 746   static void pause();
 747 
 748  protected:
 749   static long _rand_seed;                   // seed for random number generator
 750   static int _processor_count;              // number of processors
 751 
 752   static char* format_boot_path(const char* format_string,
 753                                 const char* home,
 754                                 int home_len,
 755                                 char fileSep,
 756                                 char pathSep);
 757   static bool set_boot_path(char fileSep, char pathSep);
src/share/vm/runtime/os.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File