Lines Matching refs:os

152 julong os::Bsd::_physical_memory = 0;
155 address os::Bsd::_initial_thread_stack_bottom = NULL;
156 uintptr_t os::Bsd::_initial_thread_stack_size = 0;
159 int (*os::Bsd::_clock_gettime)(clockid_t, struct timespec *) = NULL;
161 int (*os::Bsd::_pthread_getcpuclockid)(pthread_t, clockid_t *) = NULL;
162 Mutex* os::Bsd::_createThread_lock = NULL;
164 pthread_t os::Bsd::_main_thread;
165 int os::Bsd::_page_size = -1;
167 bool os::Bsd::_is_floating_stack = false;
168 bool os::Bsd::_is_NPTL = false;
169 bool os::Bsd::_supports_fast_thread_cpu_time = false;
170 const char * os::Bsd::_glibc_version = NULL;
171 const char * os::Bsd::_libpthread_version = NULL;
197 julong os::available_memory() {
201 julong os::Bsd::available_memory() {
214 julong os::physical_memory() {
218 julong os::allocatable_physical_memory(julong size) {
225 julong reasonable_size = (julong)2*G - 2 * os::vm_page_size();
235 bool os::getenv(const char* name, char* buf, int len) {
248 bool os::have_special_privileges() {
315 pid_t os::Bsd::gettid() {
336 void os::Bsd::initialize_system_info() {
378 void os::Bsd::initialize_system_info() {
381 pid_t pid = os::Bsd::gettid();
410 void os::init_system_properties_values() {
476 os::jvm_path(buf, sizeof(buf));
638 void os::breakpoint() {
652 bool os::Bsd::is_sig_ignored(int sig) {
663 void os::Bsd::signal_sets_init() {
688 if (!os::Bsd::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
692 if (!os::Bsd::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
696 if (!os::Bsd::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
711 sigset_t* os::Bsd::unblocked_signals() {
718 sigset_t* os::Bsd::vm_signals() {
724 sigset_t* os::Bsd::allowdebug_blocked_signals() {
729 void os::Bsd::hotspot_sigmask(Thread* thread) {
738 pthread_sigmask(SIG_UNBLOCK, os::Bsd::unblocked_signals(), NULL);
755 void os::Bsd::libpthread_init() {
771 os::Bsd::set_glibc_version(str);
777 os::Bsd::set_glibc_version(_gnu_libc_version);
790 if (strcmp(os::Bsd::glibc_version(), "glibc 2.3.2") == 0 &&
794 os::Bsd::set_libpthread_version("bsdthreads");
796 os::Bsd::set_libpthread_version(str);
800 os::Bsd::set_libpthread_version("bsdthreads");
804 os::Bsd::set_is_NPTL();
806 os::Bsd::set_is_BsdThreads();
811 if (os::Bsd::is_NPTL() || os::Bsd::supports_variable_stack_size()) {
812 os::Bsd::set_is_floating_stack();
883 bottom = (address)align_size_down((uintptr_t)bottom, os::Bsd::page_size());
884 bottom += os::Bsd::page_size() - 1;
888 // os::current_stack_pointer(), as its result can be slightly below current
900 bool os::Bsd::manually_expand_stack(JavaThread * t, address addr) {
927 if (os::Bsd::is_BsdThreads() && !os::Bsd::is_floating_stack()) {
946 address stack_bottom = os::current_stack_base() - os::current_stack_size();
993 int pid = os::current_process_id();
1021 osthread->set_thread_id(os::Bsd::gettid());
1024 int lgrp_id = os::numa_get_group_id();
1031 os::Bsd::hotspot_sigmask(thread);
1034 os::Bsd::init_thread_fpu_state();
1051 // wait until os::start_thread()
1063 bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
1086 if (os::Bsd::supports_variable_stack_size()) {
1089 stack_size = os::Bsd::default_stack_size(thr_type);
1092 case os::java_thread:
1098 case os::compiler_thread:
1104 case os::vm_thread:
1105 case os::pgc_thread:
1106 case os::cgc_thread:
1107 case os::watcher_thread:
1113 stack_size = MAX2(stack_size, os::Bsd::min_stack_allowed);
1121 pthread_attr_setguardsize(&attr, os::Bsd::default_guard_size(thr_type));
1130 bool lock = os::Bsd::is_BsdThreads() && !os::Bsd::is_floating_stack();
1132 os::Bsd::createThread_lock()->lock_without_safepoint_check();
1149 if (lock) os::Bsd::createThread_lock()->unlock();
1168 os::Bsd::createThread_lock()->unlock();
1190 bool os::create_main_thread(JavaThread* thread) {
1191 assert(os::Bsd::_main_thread == pthread_self(), "should be called inside main thread");
1195 bool os::create_attached_thread(JavaThread* thread) {
1216 osthread->set_thread_id(os::Bsd::gettid());
1221 os::Bsd::init_thread_fpu_state();
1230 int lgrp_id = os::numa_get_group_id();
1236 if (os::Bsd::is_initial_thread()) {
1252 os::Bsd::manually_expand_stack(jt, addr);
1259 os::Bsd::hotspot_sigmask(thread);
1264 void os::pd_start_thread(Thread* thread) {
1273 void os::free_thread(OSThread* osthread) {
1288 int os::allocate_thread_local_storage() {
1297 void os::free_thread_local_storage(int index) {
1302 void os::thread_local_storage_at_put(int index, void* value) {
1316 bool os::Bsd::is_initial_thread(void) {
1323 "os::init did not locate initial thread's stack region");
1357 void os::Bsd::capture_initial_stack(size_t max_size) {
1558 double os::elapsedTime() {
1560 return (double)(os::elapsed_counter()) * 0.000001;
1563 jlong os::elapsed_counter() {
1569 jlong os::elapsed_frequency() {
1574 bool os::supports_vtime() { return false; }
1575 bool os::enable_vtime() { return false; }
1576 bool os::vtime_enabled() { return false; }
1577 double os::elapsedVTime() {
1582 jlong os::javaTimeMillis() {
1594 void os::Bsd::clock_init() {
1598 void os::Bsd::clock_init() {
1608 void os::Bsd::clock_init() {
1660 void os::Bsd::fast_thread_clock_init() {
1688 jlong os::javaTimeNanos() {
1704 void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) {
1725 bool os::getTimesSecs(double* process_real_time,
1744 char * os::local_time_string(char *buf, size_t buflen) {
1755 struct tm* os::localtime_pd(const time_t* clock, struct tm* res) {
1762 // Note: os::shutdown() might be called very early during initialization, or
1763 // called from signal handler. Before adding something to os::shutdown(), make
1765 void os::shutdown() {
1784 // Note: os::abort() might be called very early during initialization, or
1785 // called from signal handler. Before adding something to os::abort(), make
1787 void os::abort(bool dump_core) {
1788 os::shutdown();
1794 jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1805 void os::die() {
1811 void os::set_error_file(const char *logfile) {}
1817 size_t os::lasterror(char *buf, size_t len) {
1831 intx os::current_thread_id() {
1838 int os::current_process_id() {
1868 const char* os::dll_file_extension() { return JNI_LIB_SUFFIX; }
1875 const char* os::get_temp_directory() {
1887 const char* os::get_temp_directory() { return "/tmp"; }
1895 return os::stat(filename, &statbuf) == 0;
1898 void os::dll_build_name(char* buffer, size_t buflen,
1911 } else if (strchr(pname, *os::path_separator()) != NULL) {
1939 const char* os::get_current_directory(char *buf, int buflen) {
1944 bool os::address_is_in_vm(address addr) {
1949 dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo);
1964 bool os::dll_address_to_function_name(address addr, char *buf,
2001 bool os::dll_address_to_library_name(address addr, char* buf,
2060 bool os::dll_address_to_library_name(address addr, char* buf,
2097 void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
2111 void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
2231 #error Method os::dll_load requires that one of following is defined:\
2289 void* os::dll_lookup(void* handle, const char* name) {
2311 void os::print_dll_info(outputStream *st) {
2320 if (!dladdr(CAST_FROM_FN_PTR(void *, os::print_dll_info), &dli)) {
2359 pid_t pid = os::Bsd::gettid();
2369 void os::print_os_info_brief(outputStream* st) {
2372 os::Posix::print_uname_info(st);
2375 void os::print_os_info(outputStream* st) {
2379 os::Posix::print_uname_info(st);
2381 os::Posix::print_rlimit_info(st);
2383 os::Posix::print_load_average(st);
2386 void os::pd_print_cpu_info(outputStream* st) {
2390 void os::print_memory_info(outputStream* st) {
2393 st->print(" %dk page", os::vm_page_size()>>10);
2402 os::physical_memory() >> 10);
2404 os::available_memory() >> 10);
2434 void os::print_siginfo(outputStream* st, void* siginfo) {
2440 st->print("si_signo=%s: ", os::exception_name(si->si_signo, buf, buflen));
2486 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
2505 void os::jvm_path(char *buf, jint buflen) {
2520 CAST_FROM_FN_PTR(address, os::jvm_path),
2597 void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
2601 void os::print_jni_name_suffix_on(outputStream* st, int args_size) {
2621 os::die();
2624 os::signal_notify(sig);
2627 void* os::user_handler() {
2636 void* os::signal(int signal_number, void* handler) {
2651 void os::signal_raise(int signal_number) {
2656 * The following code is moved from os.cpp for making this
2661 int os::sigexitnum_pd() {
2782 void os::signal_init_pd() {
2790 void os::signal_notify(int sig) {
2833 int os::signal_lookup() {
2837 int os::signal_wait() {
2844 int os::vm_page_size() {
2846 assert(os::Bsd::page_size() != -1, "must call os::init");
2847 return os::Bsd::page_size();
2851 int os::vm_allocation_granularity() {
2852 assert(os::Bsd::page_size() != -1, "must call os::init");
2853 return os::Bsd::page_size();
2873 os::get_temp_directory(), os::current_process_id(), num);
2894 warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
2903 bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
2937 bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
2954 void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec,
2964 void os::pd_commit_memory_or_exit(char* addr, size_t size,
2971 void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
2981 void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) {
2985 void os::numa_make_global(char *addr, size_t bytes) {
2988 void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) {
2991 bool os::numa_topology_changed() { return false; }
2993 size_t os::numa_get_groups_num() {
2997 int os::numa_get_group_id() {
3001 size_t os::numa_get_leaf_groups(int *ids, size_t size) {
3009 bool os::get_page_info(char *start, page_info* info) {
3013 char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found) {
3028 void* os::Bsd::libnuma_dlsym(void* handle, const char *name) {
3036 bool os::Bsd::libnuma_init() {
3070 void os::Bsd::rebuild_cpu_to_node_map() {
3080 size_t cpu_num = os::active_processor_count();
3106 int os::Bsd::get_node_by_cpu(int cpu_id) {
3113 GrowableArray<int>* os::Bsd::_cpu_to_node;
3114 os::Bsd::sched_getcpu_func_t os::Bsd::_sched_getcpu;
3115 os::Bsd::numa_node_to_cpus_func_t os::Bsd::_numa_node_to_cpus;
3116 os::Bsd::numa_max_node_func_t os::Bsd::_numa_max_node;
3117 os::Bsd::numa_available_func_t os::Bsd::_numa_available;
3118 os::Bsd::numa_tonode_memory_func_t os::Bsd::_numa_tonode_memory;
3119 os::Bsd::numa_interleave_memory_func_t os::Bsd::_numa_interleave_memory;
3120 unsigned long* os::Bsd::_numa_all_nodes;
3123 bool os::pd_uncommit_memory(char* addr, size_t size) {
3134 bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
3135 return os::commit_memory(addr, size, !ExecMem);
3140 bool os::remove_stack_guard_pages(char* addr, size_t size) {
3141 return os::uncommit_memory(addr, size);
3158 assert((uintptr_t)requested_addr % os::Bsd::page_size() == 0, "unaligned address");
3188 char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
3193 bool os::pd_release_memory(char* addr, size_t size) {
3203 char* bottom = (char*)align_size_down((intptr_t)addr, os::Bsd::page_size());
3212 size = align_size_up(pointer_delta(addr, bottom, 1) + size, os::Bsd::page_size());
3217 bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
3232 bool os::guard_memory(char* addr, size_t size) {
3236 bool os::unguard_memory(char* addr, size_t size) {
3240 bool os::Bsd::hugetlbfs_sanity_check(bool warn, size_t page_size) {
3320 void os::large_page_init() {
3408 char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
3475 bool os::release_memory_special(char* base, size_t bytes) {
3489 size_t os::large_page_size() {
3496 bool os::can_commit_large_page_memory() {
3500 bool os::can_execute_large_page_memory() {
3507 char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
3518 assert(bytes % os::vm_page_size() == 0, "reserving unexpected size block");
3591 size_t os::read(int fd, void *buf, unsigned int nBytes) {
3595 // TODO-FIXME: reconcile Solaris' os::sleep with the bsd variation.
3601 int os::sleep(Thread* thread, jlong millis, bool interruptible) {
3612 if (os::is_interrupted(thread, true)) {
3674 int os::naked_sleep() {
3676 return os::sleep(Thread::current(), 1, false);
3680 void os::infinite_sleep() {
3687 bool os::dont_yield() {
3691 void os::yield() {
3695 os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN ;}
3697 void os::yield_all(int attempts) {
3700 // os::yield_all() with nanosleep(1ms) is not necessary.
3705 void os::loop_breaker(int attempts) {
3706 os::yield_all(attempts);
3727 int os::java_to_os_priority[CriticalPriority + 1] = {
3748 int os::java_to_os_priority[CriticalPriority + 1] = {
3768 int os::java_to_os_priority[CriticalPriority + 1] = {
3802 os::java_to_os_priority[MaxPriority] = os::java_to_os_priority[CriticalPriority];
3807 OSReturn os::set_native_priority(Thread* thread, int newpri) {
3834 OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) {
3857 void os::hint_no_preempt() {}
3916 os::SuspendResume::State current = osthread->sr.state();
3917 if (current == os::SuspendResume::SR_SUSPEND_REQUEST) {
3921 os::SuspendResume::State state = osthread->sr.suspended();
3922 if (state == os::SuspendResume::SR_SUSPENDED) {
3934 os::SuspendResume::State result = osthread->sr.running();
3935 if (result == os::SuspendResume::SR_RUNNING) {
3938 } else if (result != os::SuspendResume::SR_SUSPENDED) {
3943 } else if (state == os::SuspendResume::SR_RUNNING) {
3950 } else if (current == os::SuspendResume::SR_RUNNING) {
3952 } else if (current == os::SuspendResume::SR_WAKEUP_REQUEST) {
3995 os::Bsd::set_our_sigflags(SR_signum, act.sa_flags);
4022 if (osthread->sr.request_suspend() != os::SuspendResume::SR_SUSPEND_REQUEST) {
4038 os::SuspendResume::State cancelled = osthread->sr.cancel_suspend();
4039 if (cancelled == os::SuspendResume::SR_RUNNING) {
4041 } else if (cancelled == os::SuspendResume::SR_SUSPENDED) {
4060 if (osthread->sr.request_wakeup() != os::SuspendResume::SR_WAKEUP_REQUEST) {
4084 void os::interrupt(Thread* thread) {
4109 bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
4165 bool os::Bsd::signal_handlers_are_installed = false;
4168 struct sigaction os::Bsd::sigact[MAXSIGNUM];
4169 unsigned int os::Bsd::sigs = 0;
4170 bool os::Bsd::libjsig_is_loaded = false;
4172 get_signal_t os::Bsd::get_signal_action = NULL;
4174 struct sigaction* os::Bsd::get_chained_signal_action(int sig) {
4234 bool os::Bsd::chained_handler(int sig, siginfo_t* siginfo, void* context) {
4246 struct sigaction* os::Bsd::get_preinstalled_handler(int sig) {
4253 void os::Bsd::save_preinstalled_handler(int sig, struct sigaction& oldAct) {
4260 int os::Bsd::sigflags[MAXSIGNUM];
4262 int os::Bsd::get_our_sigflags(int sig) {
4267 void os::Bsd::set_our_sigflags(int sig, int flags) {
4272 void os::Bsd::set_signal_handler(int sig, bool set_installed) {
4335 void os::Bsd::install_signal_handlers() {
4415 jlong os::Bsd::fast_thread_cpu_time(clockid_t clockid) {
4417 int rc = os::Bsd::clock_gettime(clockid, &tp);
4438 bool found = os::dll_address_to_library_name(handler, buf, buflen, &offset);
4443 size_t len = strlen(os::file_separator());
4444 while ((p2 = strstr(p1, os::file_separator())) != NULL) p1 = p2 + len;
4461 st->print("%s: ", os::exception_name(sig, buf, buflen));
4491 if((int)sa.sa_flags != os::Bsd::get_our_sigflags(sig)) {
4494 os::Bsd::get_our_sigflags(sig));
4503 os::Bsd::check_signal_handler(sig)
4508 void os::run_periodic_checks() {
4541 void os::Bsd::check_signal_handler(int sig) {
4599 } else if(os::Bsd::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Bsd::get_our_sigflags(sig)) {
4601 tty->print("expected:" PTR32_FORMAT, os::Bsd::get_our_sigflags(sig));
4617 const char* os::exception_name(int exception_code, char* buf, size_t size) {
4630 void os::init(void) {
4652 fatal(err_msg("os_bsd.cpp: os::init: sysconf failed (%s)",
4663 initial_time_count = os::elapsed_counter();
4672 _dyld_bind_fully_image_containing_address((const void *) &os::init);
4684 jint os::init_2(void)
4692 guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" );
4694 os::set_polling_page( polling_page );
4704 os::set_memory_serialize_page( mem_serialize_page );
4712 os::large_page_init();
4728 os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed,
4734 threadStackSizeInBytes < os::Bsd::min_stack_allowed) {
4737 os::Bsd::min_stack_allowed/ K);
4795 perror("os::init_2 getrlimit failed");
4809 perror("os::init_2 setrlimit failed");
4815 // Initialize lock used to serialize thread creation (see os::create_thread)
4834 warning("os::init2 atexit(perfMemory_exit_helper) failed");
4853 void os::init_3(void) { }
4856 void os::make_polling_page_unreadable(void) {
4862 void os::make_polling_page_readable(void) {
4868 int os::active_processor_count() {
4880 void os::set_native_thread_name(const char *name) {
4892 bool os::distribute_processes(uint length, uint* distribution) {
4897 bool os::bind_to_processor(uint processor_id) {
4902 void os::SuspendedThreadTask::internal_do_task() {
4911 class PcFetcher : public os::SuspendedThreadTask {
4913 PcFetcher(Thread* thread) : os::SuspendedThreadTask(thread) {}
4916 void do_task(const os::SuspendedThreadTaskContext& context);
4926 void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
4930 _epc = os::Bsd::ucontext_get_pc((ucontext_t *) context.ucontext());
4939 ExtendedPC os::get_thread_pc(Thread* thread) {
4949 int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime)
4976 int page_bits = -os::vm_page_size();
4985 bool os::find(address addr, outputStream* st) {
5031 os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method,
5036 void os::print_statistics() {
5039 int os::message_box(const char* title, const char* message) {
5058 int os::stat(const char *path, struct stat *sbuf) {
5064 os::native_path(strcpy(pathbuf, path));
5068 bool os::check_heap(bool force) {
5077 bool os::dir_is_empty(const char* path) {
5107 int os::open(const char *path, int oflag, int mode) {
5176 int os::create_binary_file(const char* path, bool rewrite_existing) {
5185 jlong os::current_file_offset(int fd) {
5190 jlong os::seek_to_file_offset(int fd, jlong offset) {
5197 int os::available(int fd, jlong *bytes) {
5228 int os::socket_available(int fd, jint *pbytes) {
5243 char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
5275 char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
5279 return os::map_memory(fd, file_name, file_offset, addr, bytes, read_only,
5285 bool os::pd_unmap_memory(char* addr, size_t bytes) {
5297 int rc = os::Bsd::pthread_getcpuclockid(tid, &clockid);
5310 jlong os::current_thread_cpu_time() {
5312 return os::thread_cpu_time(Thread::current(), true /* user + sys */);
5314 if (os::Bsd::supports_fast_thread_cpu_time()) {
5315 return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID);
5323 jlong os::thread_cpu_time(Thread* thread) {
5326 if (os::Bsd::supports_fast_thread_cpu_time()) {
5327 return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread));
5334 jlong os::current_thread_cpu_time(bool user_sys_cpu_time) {
5336 return os::thread_cpu_time(Thread::current(), user_sys_cpu_time);
5338 if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) {
5339 return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID);
5346 jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
5367 if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) {
5368 return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread));
5424 if (proc_task_unchecked && os::Bsd::is_NPTL()) {
5467 void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
5474 void os::thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
5481 bool os::is_thread_cpu_time_supported() {
5494 int os::loadavg(double loadavg[], int nelem) {
5498 void os::pause() {
5607 int os::PlatformEvent::TryPark() {
5615 void os::PlatformEvent::park() { // AKA "down()"
5650 int os::PlatformEvent::park(jlong millis) {
5688 status = os::Bsd::safe_cond_timedwait(_cond, _mutex, &abst);
5714 void os::PlatformEvent::unpark() {
5889 sigset_t* allowdebug_blocked = os::Bsd::allowdebug_blocked_signals();
5900 status = os::Bsd::safe_cond_timedwait (_cond, _mutex, &absTime) ;
5964 int os::fork_and_exec(char* cmd) {
6034 bool os::is_headless_jre() {
6043 os::jvm_path(buf, sizeof(buf));
6070 int os::get_core_path(char* buffer, size_t bufferSize) {