os.hpp revision 2842
2N/A * or visit www.oracle.com if you need additional information or have any
2N/A#ifndef SHARE_VM_RUNTIME_OS_HPP
2N/A#define SHARE_VM_RUNTIME_OS_HPP
2N/A#include "jvmtifiles/jvmti.h"
2N/A#include "runtime/atomic.hpp"
2N/A#include "runtime/extendedPC.hpp"
2N/A#include "runtime/handles.hpp"
2N/A#ifdef TARGET_OS_FAMILY_linux
2N/A# include "jvm_linux.h"
#ifdef TARGET_OS_FAMILY_solaris
# include "jvm_solaris.h"
#ifdef TARGET_OS_FAMILY_windows
# include "jvm_windows.h"
#ifdef TARGET_OS_FAMILY_bsd
# include "jvm_bsd.h"
typedef void (*dll_func)(...);
class Thread;
class JavaThread;
class Event;
class DLL;
class FileHandle;
template<class E> class GrowableArray;
// %%%%% Moved ThreadState, START_FN, OSThread to new osThread.hpp. -- Rose
enum OSReturn {
typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
static bool have_special_privileges();
static void run_periodic_checks();
static double elapsedTime();
double* process_user_time,
double* process_system_time);
static bool supports_vtime();
static bool enable_vtime();
static bool vtime_enabled();
static double elapsedVTime();
static inline bool is_MP() {
static bool is_server_class_machine();
static int processor_count() {
return _processor_count;
static int active_processor_count();
static bool uses_stack_guard_pages();
static bool allocate_stack_guard_pages();
static void bang_stack_shadow_pages();
static int vm_page_size();
static int vm_allocation_granularity();
bool executable = false);
bool executable = false);
bool is_committed = true);
bool allow_exec = false);
bool allow_exec);
static bool numa_has_static_binding();
static bool numa_has_group_homing();
static bool numa_topology_changed();
static int numa_get_group_id();
struct page_info {
int lgrp_id;
static char* non_memory_address_word();
bool executable = false);
static void large_page_init();
static bool can_commit_large_page_memory();
static bool can_execute_large_page_memory();
static bool is_poll_address(address addr) { return addr >= _polling_page && addr < (_polling_page + os::vm_page_size()); }
static void make_polling_page_unreadable();
static void make_polling_page_readable();
static void serialize_thread_states();
static int get_serialize_page_shift_count() {
return SerializePageShiftCount;
static unsigned int get_serialize_page_mask() {
return _serialize_page_mask;
if (UseMembar) return false;
static void block_on_serialize_page_trap();
enum ThreadType {
static void initialize_thread();
static int current_process_id();
static int naked_sleep();
enum YieldResult {
static void loop_breaker(int attempts); // called from within tight loops to possibly influence time-sharing
static void breakpoint();
static void shutdown();
static void die();
static const int default_file_open_flags();
static const char* dll_file_extension();
static const char* get_temp_directory();
static void print_environment_variables(outputStream* st, const char** env_list, char* buffer, int len);
static bool is_debugger_attached();
static void wait_for_keypress_at_exit(void);
static void* native_java_library();
static bool is_headless_jre();
static const char* file_separator();
static const char* line_separator();
static const char* path_separator();
static void init_system_properties_values();
static int allocate_thread_local_storage();
#ifndef PRODUCT
static const char* jlong_format_specifier();
static const char* julong_format_specifier();
static void signal_init();
static void signal_init_pd();
static int signal_wait();
static int signal_lookup();
static void* user_handler();
static void terminate_signal_thread();
static int sigexitnum_pd();
static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
// On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits
static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize);
static bool is_thread_cpu_time_supported();
#ifdef TARGET_OS_FAMILY_linux
# include "os_linux.hpp"
#ifdef TARGET_OS_FAMILY_solaris
# include "os_solaris.hpp"
#ifdef TARGET_OS_FAMILY_windows
# include "os_windows.hpp"
#ifdef TARGET_OS_FAMILY_bsd
# include "os_bsd.hpp"
#ifdef TARGET_OS_ARCH_linux_x86
# include "os_linux_x86.hpp"
#ifdef TARGET_OS_ARCH_linux_sparc
# include "os_linux_sparc.hpp"
#ifdef TARGET_OS_ARCH_linux_zero
# include "os_linux_zero.hpp"
#ifdef TARGET_OS_ARCH_solaris_x86
# include "os_solaris_x86.hpp"
#ifdef TARGET_OS_ARCH_solaris_sparc
# include "os_solaris_sparc.hpp"
#ifdef TARGET_OS_ARCH_windows_x86
# include "os_windows_x86.hpp"
#ifdef TARGET_OS_ARCH_linux_arm
# include "os_linux_arm.hpp"
#ifdef TARGET_OS_ARCH_linux_ppc
# include "os_linux_ppc.hpp"
#ifdef TARGET_OS_ARCH_bsd_x86
# include "os_bsd_x86.hpp"
#ifdef TARGET_OS_ARCH_bsd_zero
# include "os_bsd_zero.hpp"
// debugging support (mostly used by debug.cpp but also fatal error handler)
static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address
static void print_statistics();
static void hint_no_preempt();
static void pause();
const char* home,
int home_len,
char fileSep,
char pathSep);