Lines Matching refs:os
229 address os::Solaris::handler_start; // start pc of thr_sighndlrinfo
230 address os::Solaris::handler_end; // end pc of thr_sighndlrinfo
232 address os::Solaris::_main_stack_base = NULL; // 4352906 workaround
278 address sp = os::current_stack_pointer();
299 os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread);
343 address os::current_stack_base() {
351 if (!is_primordial_thread || os::Solaris::_main_stack_base == NULL) {
355 os::Solaris::_main_stack_base = (address)st.ss_sp;
359 guarantee(os::Solaris::_main_stack_base != NULL, "Attempt to use null cached stack base");
360 return os::Solaris::_main_stack_base;
364 size_t os::current_stack_size() {
374 size = adjust_stack_size(os::Solaris::_main_stack_base, (size_t)limits.rlim_cur);
378 address bottom = (address)align_size_up((intptr_t)(base - size), os::vm_page_size());;
382 struct tm* os::localtime_pd(const time_t* clock, struct tm* res) {
392 // Used by classloader os::read
393 // os::restartable_read calls skip this layer and stay in _thread_in_native
395 void os::Solaris::setup_interruptible(JavaThread* thread) {
409 void os::Solaris::setup_interruptible_already_blocked(JavaThread* thread) {
413 JavaThread* os::Solaris::setup_interruptible() {
419 void os::Solaris::try_enable_extended_io() {
437 JavaThread* os::Solaris::setup_interruptible_native() {
444 void os::Solaris::cleanup_interruptible_native(JavaThread* thread) {
453 void os::Solaris::cleanup_interruptible(JavaThread* thread) {
461 void os::Solaris::bump_interrupted_before_count() {
465 void os::Solaris::bump_interrupted_during_count() {
471 jint os::Solaris::_os_thread_limit = 0;
472 volatile jint os::Solaris::_os_thread_count = 0;
474 julong os::available_memory() {
478 julong os::Solaris::available_memory() {
479 return (julong)sysconf(_SC_AVPHYS_PAGES) * os::vm_page_size();
482 julong os::Solaris::_physical_memory = 0;
484 julong os::physical_memory() {
488 julong os::allocatable_physical_memory(julong size) {
515 void os::Solaris::initialize_system_info() {
521 int os::active_processor_count() {
671 void os::set_native_thread_name(const char *name) {
676 bool os::distribute_processes(uint length, uint* distribution) {
703 bool os::bind_to_processor(uint processor_id) {
715 bool os::getenv(const char* name, char* buffer, int len) {
729 bool os::have_special_privileges() {
740 void os::init_system_properties_values() {
786 os::jvm_path(buf, sizeof(buf));
929 strcat(library_path, os::path_separator());
933 strcat(library_path, os::path_separator());
984 void os::breakpoint() {
988 bool os::obsolete_option(const JavaVMOption *option)
1002 bool os::Solaris::valid_stack_address(Thread* thread, address sp) {
1023 int pid = os::current_process_id();
1034 int lgrp_id = os::numa_get_group_id();
1058 os::set_native_priority(thread, prio);
1064 assert(osthr->get_state() == RUNNABLE, "invalid os thread state");
1067 os::Solaris::hotspot_sigmask(thread);
1075 Atomic::dec(&os::Solaris::_os_thread_count);
1096 int lgrp_id = os::numa_get_group_id();
1113 void os::Solaris::hotspot_sigmask(Thread* thread) {
1121 thr_sigsetmask(SIG_UNBLOCK, os::Solaris::unblocked_signals(), NULL);
1134 bool os::create_attached_thread(JavaThread* thread) {
1149 os::Solaris::hotspot_sigmask(thread);
1154 bool os::create_main_thread(JavaThread* thread) {
1172 os::Solaris::hotspot_sigmask(thread);
1179 bool os::Solaris::_T2_libthread = false;
1181 bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
1222 case os::java_thread:
1226 case os::compiler_thread:
1232 case os::vm_thread:
1233 case os::pgc_thread:
1234 case os::cgc_thread:
1235 case os::watcher_thread:
1240 stack_size = MAX2(stack_size, os::Solaris::min_stack_allowed);
1245 if (os::Solaris::_os_thread_count > os::Solaris::_os_thread_limit) {
1250 char* mem = os::reserve_memory(VirtualMemoryBangSize);
1256 os::release_memory(mem, VirtualMemoryBangSize);
1269 | ((UseBoundThreads || os::Solaris::T2_libthread() ||
1311 if (AdjustConcurrency && os::Solaris::_os_thread_count < (_processors_online+3)) {
1313 thr_setconcurrency (os::Solaris::_os_thread_count); // avoid starvation
1321 (!os::Solaris::T2_libthread() && (!(flags & THR_BOUND))) &&
1337 perror("os::create_thread");
1345 Atomic::inc(&os::Solaris::_os_thread_count);
1379 int os::Solaris::_SIGinterrupt = INTERRUPT_SIGNAL;
1380 int os::Solaris::_SIGasync = ASYNC_SIGNAL;
1382 bool os::Solaris::is_sig_ignored(int sig) {
1399 void os::Solaris::signal_sets_init() {
1423 os::Solaris::set_SIGinterrupt(SIGJVM1);
1424 os::Solaris::set_SIGasync(SIGJVM2);
1426 os::Solaris::set_SIGinterrupt(ALT_INTERRUPT_SIGNAL);
1427 os::Solaris::set_SIGasync(ALT_ASYNC_SIGNAL);
1429 os::Solaris::set_SIGinterrupt(INTERRUPT_SIGNAL);
1430 os::Solaris::set_SIGasync(ASYNC_SIGNAL);
1433 sigaddset(&unblocked_sigs, os::Solaris::SIGinterrupt());
1434 sigaddset(&unblocked_sigs, os::Solaris::SIGasync());
1437 if (!os::Solaris::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
1441 if (!os::Solaris::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
1445 if (!os::Solaris::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
1462 sigset_t* os::Solaris::unblocked_signals() {
1469 sigset_t* os::Solaris::vm_signals() {
1475 sigset_t* os::Solaris::allowdebug_blocked_signals() {
1488 void os::initialize_thread(Thread* thr) {
1517 address bottom = (address)align_size_up((intptr_t)(base - stack_size), os::vm_page_size());;
1575 os::Solaris::init_thread_fpu_state();
1582 void os::free_thread(OSThread* osthread) {
1583 assert(osthread != NULL, "os::free_thread but osthread not set");
1591 || (osthread == VMThread::vm_thread()->osthread())), "os::free_thread but not current thread");
1600 void os::pd_start_thread(Thread* thread) {
1606 intx os::current_thread_id() {
1612 int os::current_process_id() {
1616 int os::allocate_thread_local_storage() {
1636 fatal(err_msg("os::allocate_thread_local_storage: thr_keycreate failed "
1641 void os::free_thread_local_storage(int index) {
1644 // fatal("os::free_thread_local_storage: pthread_key_delete failed");
1649 void os::thread_local_storage_at_put(int index, void* value) {
1655 fatal(err_msg("os::thread_local_storage_at_put: thr_setspecific failed "
1666 void* os::thread_local_storage_at(int index) {
1729 double os::elapsedTime() {
1733 jlong os::elapsed_counter() {
1737 jlong os::elapsed_frequency() {
1743 bool os::getTimesSecs(double* process_real_time,
1763 bool os::supports_vtime() { return true; }
1765 bool os::enable_vtime() {
1779 bool os::vtime_enabled() {
1785 int res = os::read(fd, (void*) &status, sizeof(pstatus_t));
1793 double os::elapsedVTime() {
1805 jlong os::javaTimeMillis() {
1808 fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno)));
1812 jlong os::javaTimeNanos() {
1816 void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) {
1823 char * os::local_time_string(char *buf, size_t buflen) {
1834 // Note: os::shutdown() might be called very early during initialization, or
1835 // called from signal handler. Before adding something to os::shutdown(), make
1837 void os::shutdown() {
1855 // Note: os::abort() might be called very early during initialization, or
1856 // called from signal handler. Before adding something to os::abort(), make
1858 void os::abort(bool dump_core) {
1859 os::shutdown();
1865 jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1876 void os::die() {
1881 void os::set_error_file(const char *logfile) {}
1885 const char* os::dll_file_extension() { return ".so"; }
1889 const char* os::get_temp_directory() { return "/tmp"; }
1896 return os::stat(filename, &statbuf) == 0;
1899 void os::dll_build_name(char* buffer, size_t buflen,
1911 } else if (strchr(pname, *os::path_separator()) != NULL) {
1938 const char* os::get_current_directory(char *buf, int buflen) {
1943 bool os::address_is_in_vm(address addr) {
1948 dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo);
1963 bool os::dll_address_to_function_name(address addr, char *buf,
1967 // dladdr1_func was initialized in os::init()
2024 bool os::dll_address_to_library_name(address addr, char* buf,
2041 void os::print_dll_info(outputStream * st) {
2049 if (!dladdr(CAST_FROM_FN_PTR(void *, os::print_dll_info), &dli)) {
2079 void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
2157 #error Method os::dll_load requires that one of following is defined:\
2211 void* os::dll_lookup(void* handle, const char* name) {
2215 int os::stat(const char *path, struct stat *sbuf) {
2221 os::native_path(strcpy(pathbuf, path));
2242 void os::print_os_info_brief(outputStream* st) {
2243 os::Solaris::print_distro_info(st);
2245 os::Posix::print_uname_info(st);
2247 os::Solaris::print_libversion_info(st);
2250 void os::print_os_info(outputStream* st) {
2253 os::Solaris::print_distro_info(st);
2255 os::Posix::print_uname_info(st);
2257 os::Solaris::print_libversion_info(st);
2259 os::Posix::print_rlimit_info(st);
2261 os::Posix::print_load_average(st);
2264 void os::Solaris::print_distro_info(outputStream* st) {
2271 void os::Solaris::print_libversion_info(outputStream* st) {
2272 if (os::Solaris::T2_libthread()) {
2303 void os::pd_print_cpu_info(outputStream* st) {
2307 void os::print_memory_info(outputStream* st) {
2309 st->print(" %dk page", os::vm_page_size()>>10);
2310 st->print(", physical " UINT64_FORMAT "k", os::physical_memory()>>10);
2311 st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10);
2330 void os::print_siginfo(outputStream* st, void* siginfo) {
2336 st->print("si_signo=%s: ", os::exception_name(si->si_signo, buf, buflen));
2387 int os::Solaris::get_our_sigflags(int sig) {
2393 void os::Solaris::set_our_sigflags(int sig, int flags) {
2403 bool found = os::dll_address_to_library_name(handler, buf, buflen, &offset);
2408 size_t len = strlen(os::file_separator());
2409 while ((p2 = strstr(p1, os::file_separator())) != NULL) p1 = p2 + len;
2423 st->print("%s: ", os::exception_name(sig, buf, buflen));
2453 if(sa.sa_flags != os::Solaris::get_our_sigflags(sig)) {
2456 os::Solaris::get_our_sigflags(sig));
2462 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
2476 print_signal_handler(st, os::Solaris::SIGinterrupt(), buf, buflen);
2477 print_signal_handler(st, os::Solaris::SIGasync(), buf, buflen);
2483 void os::jvm_path(char *buf, jint buflen) {
2497 int ret = dladdr(CAST_FROM_FN_PTR(void *, os::jvm_path), &dlinfo);
2563 void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
2568 void os::print_jni_name_suffix_on(outputStream* st, int args_size) {
2575 size_t os::lasterror(char *buf, size_t len) {
2597 os::die();
2600 os::signal_notify(sig);
2605 void* os::user_handler() {
2665 void* os::signal(int signal_number, void* handler) {
2678 void os::signal_raise(int signal_number) {
2683 * The following code is moved from os.cpp for making this
2695 version_getting_t os::Solaris::get_libjsig_version = NULL;
2698 int os::sigexitnum_pd() {
2703 void os::Solaris::init_signal_mem() {
2713 pending_signals = (jint *)os::malloc(sizeof(jint) * (Sigexit+1), mtInternal);
2720 preinstalled_sigs = (int *)os::malloc(sizeof(int) * (Maxsignum + 1), mtInternal);
2727 void os::signal_init_pd() {
2734 void os::signal_notify(int signal_number) {
2783 int os::signal_lookup() {
2787 int os::signal_wait() {
2800 int os::vm_page_size() {
2801 assert(page_size != -1, "must call os::init");
2806 int os::vm_allocation_granularity() {
2807 assert(page_size != -1, "must call os::init");
2833 warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
2841 warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
2846 int os::Solaris::commit_memory_impl(char* addr, size_t bytes, bool exec) {
2867 bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) {
2871 void os::pd_commit_memory_or_exit(char* addr, size_t bytes, bool exec,
2874 int err = os::Solaris::commit_memory_impl(addr, bytes, exec);
2882 int os::Solaris::commit_memory_impl(char* addr, size_t bytes,
2911 bool os::pd_commit_memory(char* addr, size_t bytes, size_t alignment_hint,
2916 void os::pd_commit_memory_or_exit(char* addr, size_t bytes,
2920 int err = os::Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec);
2929 void os::pd_free_memory(char* addr, size_t bytes, size_t alignment_hint) {
2936 bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
2937 return os::commit_memory(addr, size, !ExecMem);
2940 bool os::remove_stack_guard_pages(char* addr, size_t size) {
2941 return os::uncommit_memory(addr, size);
2945 void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
2954 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) {
2955 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned.");
2962 void os::numa_make_global(char *addr, size_t bytes) {
2963 assert((intptr_t)addr % os::vm_page_size() == 0, "Address should be page-aligned.");
2970 size_t os::numa_get_groups_num() {
2978 size_t os::numa_get_leaf_groups(int *ids, size_t size) {
3013 bool os::numa_topology_changed() {
3026 int os::numa_get_group_id() {
3031 const int size = os::numa_get_groups_num();
3040 return ids[os::random() % r];
3044 bool os::get_page_info(char *start, page_info* info) {
3050 if (os::Solaris::meminfo(&addr, 1, info_types, 2, outdata, &validity) < 0) {
3071 char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found) {
3077 size_t page_size = MAX2((size_t)os::vm_page_size(), page_expected->size);
3087 if (os::Solaris::meminfo(addrs, addrs_count, info_types, types, outdata, validity) < 0) {
3132 bool os::pd_uncommit_memory(char* addr, size_t bytes) {
3143 char* os::Solaris::mmap_chunk(char *addr, size_t size, int flags, int prot) {
3144 char *b = (char *)mmap(addr, size, prot, flags, os::Solaris::_dev_zero_fd, 0);
3152 char* os::Solaris::anon_mmap(char* requested_addr, size_t bytes, size_t alignment_hint, bool fixed) {
3171 char* os::pd_reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hint) {
3182 char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
3199 assert(bytes % os::vm_page_size() == 0, "reserving unexpected size block");
3305 bool os::pd_release_memory(char* addr, size_t bytes) {
3311 assert(addr == (char*)align_size_down((uintptr_t)addr, os::vm_page_size()),
3321 bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
3339 bool os::guard_memory(char* addr, size_t bytes) {
3343 bool os::unguard_memory(char* addr, size_t bytes) {
3373 bool os::Solaris::ism_sanity_check(bool warn, size_t * page_size) {
3401 bool os::Solaris::mpss_sanity_check(bool warn, size_t * page_size) {
3429 DEBUG_ONLY(warning("increase the size of the os::_page_sizes array.");)
3466 void os::large_page_init() {
3493 bool os::Solaris::set_mpss_range(caddr_t start, size_t bytes, size_t align) {
3508 char* os::reserve_memory_special(size_t size, char* addr, bool exec) {
3564 bool os::release_memory_special(char* base, size_t bytes) {
3577 size_t os::large_page_size() {
3583 bool os::can_commit_large_page_memory() {
3587 bool os::can_execute_large_page_memory() {
3611 // Following assert fails for os::yield_all:
3618 os::Solaris::clear_interrupted);
3647 size_t os::read(int fd, void *buf, unsigned int nBytes) {
3648 INTERRUPTIBLE_RETURN_INT_VM(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
3651 size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
3652 INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
3655 int os::sleep(Thread* thread, jlong millis, bool interruptible) {
3718 int os::naked_sleep() {
3724 void os::infinite_sleep() {
3731 bool os::dont_yield() {
3748 // Caveat: Solaris os::yield() causes a thread-state transition whereas
3751 void os::yield() {
3753 os::sleep(Thread::current(), 0, false);
3761 os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
3773 void os::yield_all(int attempts) {
3776 os::sleep(Thread::current(), 1, false);
3779 if (iterations == 0 && !os::Solaris::T2_libthread()) {
3786 os::sleep(Thread::current(), 1, false);
3788 os::sleep(Thread::current(), 10, false);
3794 void os::loop_breaker(int attempts) {
3795 os::yield_all(attempts);
3902 if (os::Solaris::T2_libthread() || UseBoundThreads) {
3906 os::java_to_os_priority[i] = prio_policy1[i];
3913 java_MaxPriority_to_os_priority = os::java_to_os_priority[MaxPriority];
3915 os::java_to_os_priority[MaxPriority] = -criticalPrio;
3921 os::java_to_os_priority[i] = prio_policy1[i];
4233 int os::java_to_os_priority[CriticalPriority + 1] = {
4253 OSReturn os::set_native_priority(Thread* thread, int newpri) {
4276 if (os::Solaris::T2_libthread() ||
4297 OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) {
4314 void os::hint_no_preempt() {
4328 void os::Solaris::SR_handler(Thread* thread, ucontext_t* uc) {
4336 os::SuspendResume::State current = osthread->sr.state();
4337 if (current == os::SuspendResume::SR_SUSPEND_REQUEST) {
4341 os::SuspendResume::State state = osthread->sr.suspended();
4342 if (state == os::SuspendResume::SR_SUSPENDED) {
4347 sigdelset(&suspend_set, os::Solaris::SIGasync());
4354 os::SuspendResume::State result = osthread->sr.running();
4355 if (result == os::SuspendResume::SR_RUNNING) {
4361 } else if (state == os::SuspendResume::SR_RUNNING) {
4368 } else if (current == os::SuspendResume::SR_RUNNING) {
4370 } else if (current == os::SuspendResume::SR_WAKEUP_REQUEST) {
4380 void os::interrupt(Thread* thread) {
4389 // os::sleep() is implemented with either poll (NULL,0,timeout) or
4405 // When events are used everywhere for os::sleep, then this thr_kill
4409 int status = thr_kill(osthread->thread_id(), os::Solaris::SIGinterrupt());
4418 bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
4432 // the interrupted flag into the os::Solaris::Event structure,
4441 void os::print_statistics() {
4444 int os::message_box(const char* title, const char* message) {
4464 int status = thr_kill(osthread->thread_id(), os::Solaris::SIGasync());
4480 if (osthread->sr.request_suspend() != os::SuspendResume::SR_SUSPEND_REQUEST) {
4496 os::SuspendResume::State cancelled = osthread->sr.cancel_suspend();
4497 if (cancelled == os::SuspendResume::SR_RUNNING) {
4499 } else if (cancelled == os::SuspendResume::SR_SUSPENDED) {
4518 if (osthread->sr.request_wakeup() != os::SuspendResume::SR_WAKEUP_REQUEST) {
4539 void os::SuspendedThreadTask::internal_do_task() {
4547 class PcFetcher : public os::SuspendedThreadTask {
4549 PcFetcher(Thread* thread) : os::SuspendedThreadTask(thread) {}
4552 void do_task(const os::SuspendedThreadTaskContext& context);
4562 void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
4566 _epc = os::Solaris::ucontext_get_pc((ucontext_t *) context.ucontext());
4575 ExtendedPC os::get_thread_pc(Thread* thread) {
4588 void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread) {
4607 // os::Solaris::SIGasync
4609 // It explicitly does not recognize os::Solaris::SIGinterrupt
4635 struct sigaction *actp = os::Solaris::get_chained_signal_action(sig);
4644 bool os::Solaris::signal_handlers_are_installed = false;
4647 bool os::Solaris::libjsig_is_loaded = false;
4649 get_signal_t os::Solaris::get_signal_action = NULL;
4651 struct sigaction* os::Solaris::get_chained_signal_action(int sig) {
4711 bool os::Solaris::chained_handler(int sig, siginfo_t* siginfo, void* context) {
4723 struct sigaction* os::Solaris::get_preinstalled_handler(int sig) {
4731 void os::Solaris::save_preinstalled_handler(int sig, struct sigaction& oldAct) {
4739 void os::Solaris::set_signal_handler(int sig, bool set_installed, bool oktochain) {
4777 } else if (sig == os::Solaris::SIGinterrupt()) {
4785 os::Solaris::set_our_sigflags(sig, sigAct.sa_flags);
4797 os::Solaris::check_signal_handler(sig)
4802 void os::run_periodic_checks() {
4830 DO_SIGNAL_CHECK(os::Solaris::SIGinterrupt());
4831 DO_SIGNAL_CHECK(os::Solaris::SIGasync());
4839 void os::Solaris::check_signal_handler(int sig) {
4875 int intrsig = os::Solaris::SIGinterrupt();
4876 int asynsig = os::Solaris::SIGasync();
4895 } else if(os::Solaris::get_our_sigflags(sig) != 0 && act.sa_flags != os::Solaris::get_our_sigflags(sig)) {
4897 tty->print("expected:" PTR32_FORMAT, os::Solaris::get_our_sigflags(sig));
4910 void os::Solaris::install_signal_handlers() {
4928 if (os::Solaris::get_libjsig_version != NULL) {
4929 libjsigversion = (*os::Solaris::get_libjsig_version)();
4946 if (os::Solaris::SIGinterrupt() > OLDMAXSIGNUM || os::Solaris::SIGasync() > OLDMAXSIGNUM) {
4958 set_signal_handler(os::Solaris::SIGinterrupt(), true, false);
4959 set_signal_handler(os::Solaris::SIGasync(), true, true);
5000 const char* os::exception_name(int exception_code, char* buf, size_t size) {
5015 int_fnP_thread_t_iP_uP_stack_tP_gregset_t os::Solaris::_thr_getstate;
5016 int_fnP_thread_t_i_gregset_t os::Solaris::_thr_setstate;
5017 int_fnP_thread_t_i os::Solaris::_thr_setmutator;
5018 int_fnP_thread_t os::Solaris::_thr_suspend_mutator;
5019 int_fnP_thread_t os::Solaris::_thr_continue_mutator;
5022 os::Solaris::getisax_func_t os::Solaris::_getisax = 0;
5025 os::Solaris::lgrp_home_func_t os::Solaris::_lgrp_home;
5026 os::Solaris::lgrp_init_func_t os::Solaris::_lgrp_init;
5027 os::Solaris::lgrp_fini_func_t os::Solaris::_lgrp_fini;
5028 os::Solaris::lgrp_root_func_t os::Solaris::_lgrp_root;
5029 os::Solaris::lgrp_children_func_t os::Solaris::_lgrp_children;
5030 os::Solaris::lgrp_resources_func_t os::Solaris::_lgrp_resources;
5031 os::Solaris::lgrp_nlgrps_func_t os::Solaris::_lgrp_nlgrps;
5032 os::Solaris::lgrp_cookie_stale_func_t os::Solaris::_lgrp_cookie_stale;
5033 os::Solaris::lgrp_cookie_t os::Solaris::_lgrp_cookie = 0;
5036 os::Solaris::meminfo_func_t os::Solaris::_meminfo = 0;
5121 void os::Solaris::libthread_init() {
5125 os::Solaris::set_T2_libthread(isT2_libthread());
5139 os::Solaris::set_thr_getstate(CAST_TO_FN_PTR(int_fnP_thread_t_iP_uP_stack_tP_gregset_t, func));
5142 os::Solaris::set_thr_setstate(CAST_TO_FN_PTR(int_fnP_thread_t_i_gregset_t, func));
5145 os::Solaris::set_thr_setmutator(CAST_TO_FN_PTR(int_fnP_thread_t_i, func));
5148 os::Solaris::set_thr_suspend_mutator(CAST_TO_FN_PTR(int_fnP_thread_t, func));
5151 os::Solaris::set_thr_continue_mutator(CAST_TO_FN_PTR(int_fnP_thread_t, func));
5161 int_fnP_mutex_tP os::Solaris::_mutex_lock;
5162 int_fnP_mutex_tP os::Solaris::_mutex_trylock;
5163 int_fnP_mutex_tP os::Solaris::_mutex_unlock;
5164 int_fnP_mutex_tP_i_vP os::Solaris::_mutex_init;
5165 int_fnP_mutex_tP os::Solaris::_mutex_destroy;
5166 int os::Solaris::_mutex_scope = USYNC_THREAD;
5168 int_fnP_cond_tP_mutex_tP_timestruc_tP os::Solaris::_cond_timedwait;
5169 int_fnP_cond_tP_mutex_tP os::Solaris::_cond_wait;
5170 int_fnP_cond_tP os::Solaris::_cond_signal;
5171 int_fnP_cond_tP os::Solaris::_cond_broadcast;
5172 int_fnP_cond_tP_i_vP os::Solaris::_cond_init;
5173 int_fnP_cond_tP os::Solaris::_cond_destroy;
5174 int os::Solaris::_cond_scope = USYNC_THREAD;
5176 void os::Solaris::synchronization_init() {
5178 os::Solaris::set_mutex_lock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("_lwp_mutex_lock")));
5179 os::Solaris::set_mutex_trylock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("_lwp_mutex_trylock")));
5180 os::Solaris::set_mutex_unlock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("_lwp_mutex_unlock")));
5181 os::Solaris::set_mutex_init(lwp_mutex_init);
5182 os::Solaris::set_mutex_destroy(lwp_mutex_destroy);
5183 os::Solaris::set_mutex_scope(USYNC_THREAD);
5185 os::Solaris::set_cond_timedwait(CAST_TO_FN_PTR(int_fnP_cond_tP_mutex_tP_timestruc_tP, resolve_symbol("_lwp_cond_timedwait")));
5186 os::Solaris::set_cond_wait(CAST_TO_FN_PTR(int_fnP_cond_tP_mutex_tP, resolve_symbol("_lwp_cond_wait")));
5187 os::Solaris::set_cond_signal(CAST_TO_FN_PTR(int_fnP_cond_tP, resolve_symbol("_lwp_cond_signal")));
5188 os::Solaris::set_cond_broadcast(CAST_TO_FN_PTR(int_fnP_cond_tP, resolve_symbol("_lwp_cond_broadcast")));
5189 os::Solaris::set_cond_init(lwp_cond_init);
5190 os::Solaris::set_cond_destroy(lwp_cond_destroy);
5191 os::Solaris::set_cond_scope(USYNC_THREAD);
5194 os::Solaris::set_mutex_scope(USYNC_THREAD);
5195 os::Solaris::set_cond_scope(USYNC_THREAD);
5198 os::Solaris::set_mutex_lock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("pthread_mutex_lock")));
5199 os::Solaris::set_mutex_trylock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("pthread_mutex_trylock")));
5200 os::Solaris::set_mutex_unlock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("pthread_mutex_unlock")));
5201 os::Solaris::set_mutex_init(pthread_mutex_default_init);
5202 os::Solaris::set_mutex_destroy(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("pthread_mutex_destroy")));
5204 os::Solaris::set_cond_timedwait(CAST_TO_FN_PTR(int_fnP_cond_tP_mutex_tP_timestruc_tP, resolve_symbol("pthread_cond_timedwait")));
5205 os::Solaris::set_cond_wait(CAST_TO_FN_PTR(int_fnP_cond_tP_mutex_tP, resolve_symbol("pthread_cond_wait")));
5206 os::Solaris::set_cond_signal(CAST_TO_FN_PTR(int_fnP_cond_tP, resolve_symbol("pthread_cond_signal")));
5207 os::Solaris::set_cond_broadcast(CAST_TO_FN_PTR(int_fnP_cond_tP, resolve_symbol("pthread_cond_broadcast")));
5208 os::Solaris::set_cond_init(pthread_cond_default_init);
5209 os::Solaris::set_cond_destroy(CAST_TO_FN_PTR(int_fnP_cond_tP, resolve_symbol("pthread_cond_destroy")));
5212 os::Solaris::set_mutex_lock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("mutex_lock")));
5213 os::Solaris::set_mutex_trylock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("mutex_trylock")));
5214 os::Solaris::set_mutex_unlock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("mutex_unlock")));
5215 os::Solaris::set_mutex_init(::mutex_init);
5216 os::Solaris::set_mutex_destroy(::mutex_destroy);
5218 os::Solaris::set_cond_timedwait(CAST_TO_FN_PTR(int_fnP_cond_tP_mutex_tP_timestruc_tP, resolve_symbol("cond_timedwait")));
5219 os::Solaris::set_cond_wait(CAST_TO_FN_PTR(int_fnP_cond_tP_mutex_tP, resolve_symbol("cond_wait")));
5220 os::Solaris::set_cond_signal(CAST_TO_FN_PTR(int_fnP_cond_tP, resolve_symbol("cond_signal")));
5221 os::Solaris::set_cond_broadcast(CAST_TO_FN_PTR(int_fnP_cond_tP, resolve_symbol("cond_broadcast")));
5222 os::Solaris::set_cond_init(::cond_init);
5223 os::Solaris::set_cond_destroy(::cond_destroy);
5228 bool os::Solaris::liblgrp_init() {
5231 os::Solaris::set_lgrp_home(CAST_TO_FN_PTR(lgrp_home_func_t, dlsym(handle, "lgrp_home")));
5232 os::Solaris::set_lgrp_init(CAST_TO_FN_PTR(lgrp_init_func_t, dlsym(handle, "lgrp_init")));
5233 os::Solaris::set_lgrp_fini(CAST_TO_FN_PTR(lgrp_fini_func_t, dlsym(handle, "lgrp_fini")));
5234 os::Solaris::set_lgrp_root(CAST_TO_FN_PTR(lgrp_root_func_t, dlsym(handle, "lgrp_root")));
5235 os::Solaris::set_lgrp_children(CAST_TO_FN_PTR(lgrp_children_func_t, dlsym(handle, "lgrp_children")));
5236 os::Solaris::set_lgrp_resources(CAST_TO_FN_PTR(lgrp_resources_func_t, dlsym(handle, "lgrp_resources")));
5237 os::Solaris::set_lgrp_nlgrps(CAST_TO_FN_PTR(lgrp_nlgrps_func_t, dlsym(handle, "lgrp_nlgrps")));
5238 os::Solaris::set_lgrp_cookie_stale(CAST_TO_FN_PTR(lgrp_cookie_stale_func_t,
5248 void os::Solaris::misc_sym_init() {
5254 os::Solaris::_getisax = CAST_TO_FN_PTR(getisax_func_t, func);
5260 os::Solaris::set_meminfo(CAST_TO_FN_PTR(meminfo_func_t, func));
5264 uint_t os::Solaris::getisax(uint32_t* array, uint_t n) {
5286 int os::Solaris::_dev_zero_fd = -1;
5289 void os::init(void) {
5298 fatal(err_msg("os_solaris.cpp: os::init: sysconf failed (%s)",
5310 fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno)));
5321 // dladdr for os::dll_address_to_function_name. It comes with SunOS 5.9
5355 jint os::init_2(void) {
5357 os::Solaris::try_enable_extended_io();
5371 os::set_polling_page(polling_page);
5381 os::set_memory_serialize_page( mem_serialize_page );
5389 os::large_page_init();
5396 os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed,
5402 threadStackSizeInBytes < os::Solaris::min_stack_allowed) {
5404 os::Solaris::min_stack_allowed/K);
5434 size_t lgrp_limit = os::numa_get_groups_num();
5436 size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
5481 perror("os::init_2 getrlimit failed");
5487 perror("os::init_2 setrlimit failed");
5523 warning("os::init2 atexit(perfMemory_exit_helper) failed");
5533 void os::init_3(void) {
5538 void os::make_polling_page_unreadable(void) {
5544 void os::make_polling_page_readable(void) {
5551 bool os::check_heap(bool force) { return true; }
5575 bool os::dir_is_empty(const char* path) {
5606 int os::open(const char *path, int oflag, int mode) {
5715 int os::create_binary_file(const char* path, bool rewrite_existing) {
5724 jlong os::current_file_offset(int fd) {
5729 jlong os::seek_to_file_offset(int fd, jlong offset) {
5733 jlong os::lseek(int fd, jlong offset, int whence) {
5737 char * os::native_path(char *path) {
5741 int os::ftruncate(int fd, jlong length) {
5745 int os::fsync(int fd) {
5749 int os::available(int fd, jlong *bytes) {
5764 INTERRUPTIBLE(::ioctl(fd, FIONREAD, &n),ioctl_return,os::Solaris::clear_interrupted);
5783 char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
5815 char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
5819 return os::map_memory(fd, file_name, file_offset, addr, bytes, read_only,
5825 bool os::pd_unmap_memory(char* addr, size_t bytes) {
5829 void os::pause() {
6008 jlong os::current_thread_cpu_time() {
6012 jlong os::thread_cpu_time(Thread *thread) {
6016 return os::thread_cpu_time(thread, false /* user time only */);
6019 jlong os::current_thread_cpu_time(bool user_sys_cpu_time) {
6021 return os::thread_cpu_time(Thread::current(), user_sys_cpu_time);
6023 return os::current_thread_cpu_time();
6027 jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
6064 void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
6071 void os::thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
6078 bool os::is_thread_cpu_time_supported() {
6079 if ( os::Solaris::T2_libthread() || UseBoundThreads ) {
6089 int os::loadavg(double loadavg[], int nelem) {
6100 intptr_t page_bits = -os::vm_page_size();
6109 bool os::find(address addr, outputStream* st) {
6287 int os::PlatformEvent::TryPark() {
6295 void os::PlatformEvent::park() { // AKA: down()
6312 int status = os::Solaris::mutex_lock(_mutex);
6320 status = os::Solaris::cond_wait(_cond, _mutex);
6326 status = os::Solaris::mutex_unlock(_mutex);
6334 int os::PlatformEvent::park(jlong millis) {
6354 int status = os::Solaris::mutex_lock(_mutex);
6359 int status = os::Solaris::cond_timedwait(_cond, _mutex, &abst);
6370 status = os::Solaris::mutex_unlock(_mutex);
6378 void os::PlatformEvent::unpark() {
6398 int status = os::Solaris::mutex_lock(_mutex);
6401 status = os::Solaris::mutex_unlock(_mutex);
6407 status = os::Solaris::cond_signal(_cond);
6525 os::Solaris::mutex_trylock(_mutex) != 0) {
6533 status = os::Solaris::mutex_unlock(_mutex);
6545 sigset_t* allowdebug_blocked = os::Solaris::allowdebug_blocked_signals();
6562 status = os::Solaris::cond_wait (_cond, _mutex) ;
6564 status = os::Solaris::cond_timedwait (_cond, _mutex, &absTime);
6576 status = os::Solaris::mutex_unlock(_mutex);
6590 status = os::Solaris::mutex_lock (_mutex) ;
6594 status = os::Solaris::mutex_unlock (_mutex) ;
6598 status = os::Solaris::cond_signal (_cond) ;
6609 int os::fork_and_exec(char* cmd) {
6680 bool os::is_headless_jre() {
6689 os::jvm_path(buf, sizeof(buf));
6714 size_t os::write(int fd, const void *buf, unsigned int nBytes) {
6715 INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
6718 int os::close(int fd) {
6722 int os::socket_close(int fd) {
6726 int os::recv(int fd, char* buf, size_t nBytes, uint flags) {
6727 INTERRUPTIBLE_RETURN_INT((int)::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
6730 int os::send(int fd, char* buf, size_t nBytes, uint flags) {
6731 INTERRUPTIBLE_RETURN_INT((int)::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
6734 int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) {
6743 int os::timeout(int fd, long timeout) {
6756 INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted);
6770 int os::connect(int fd, struct sockaddr *him, socklen_t len) {
6773 os::Solaris::clear_interrupted);
6782 os::Solaris::clear_interrupted);
6796 int os::accept(int fd, struct sockaddr* him, socklen_t* len) {
6801 os::Solaris::clear_interrupted);
6804 int os::recvfrom(int fd, char* buf, size_t nBytes, uint flags,
6807 os::Solaris::clear_interrupted);
6810 int os::sendto(int fd, char* buf, size_t len, uint flags,
6813 os::Solaris::clear_interrupted);
6816 int os::socket_available(int fd, jint *pbytes) {
6827 int os::bind(int fd, struct sockaddr* him, socklen_t len) {
6829 os::Solaris::clear_interrupted);
6834 int os::get_core_path(char* buffer, size_t bufferSize) {