Changeset 309 for trunk/openjdk/hotspot/src/os/solaris
- Timestamp:
- Feb 13, 2012, 10:07:12 PM (14 years ago)
- Location:
- trunk/openjdk
- Files:
-
- 6 deleted
- 32 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk
- Property svn:mergeinfo changed
/branches/vendor/oracle/openjdk6/b24 (added) merged: 308 /branches/vendor/oracle/openjdk6/current merged: 307
- Property svn:mergeinfo changed
-
trunk/openjdk/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
r278 r309 39 39 40 40 #include <proc_service.h> 41 #include "incls/_precompiled.incl" 42 #include "incls/_vmStructs.cpp.incl" 43 41 #include "code/codeBlob.hpp" 42 #include "code/nmethod.hpp" 43 #include "code/pcDesc.hpp" 44 #include "gc_interface/collectedHeap.hpp" 45 #include "memory/heap.hpp" 46 #include "memory/memRegion.hpp" 47 #include "memory/universe.hpp" 48 #include "oops/constMethodOop.hpp" 49 #include "oops/klass.hpp" 50 #include "oops/methodOop.hpp" 51 #include "oops/oop.hpp" 52 #include "oops/symbolOop.hpp" 53 #include "runtime/virtualspace.hpp" 54 #include "runtime/vmStructs.hpp" 55 #include "utilities/accessFlags.hpp" 56 #include "utilities/globalDefinitions.hpp" 44 57 #ifdef COMPILER1 45 58 #if defined(DEBUG) || defined(FASTDEBUG) … … 231 244 GEN_OFFS(CodeBlob, _name); 232 245 GEN_OFFS(CodeBlob, _header_size); 233 GEN_OFFS(CodeBlob, _instructions_offset); 246 GEN_OFFS(CodeBlob, _content_offset); 247 GEN_OFFS(CodeBlob, _code_offset); 234 248 GEN_OFFS(CodeBlob, _data_offset); 235 249 GEN_OFFS(CodeBlob, _frame_size); -
trunk/openjdk/hotspot/src/os/solaris/dtrace/generateJvmOffsets.h
r278 r309 1 1 /* 2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H 26 #define OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H 27 25 28 #include <stdio.h> 26 29 #include <strings.h> … … 37 40 void gen_epilogue(GEN_variant gen_var); 38 41 } 42 43 #endif // OS_SOLARIS_DTRACE_GENERATEJVMOFFSETS_H -
trunk/openjdk/hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/src/os/solaris/dtrace/hotspot.d
r278 r309 1 1 /* 2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/src/os/solaris/dtrace/jvm_dtrace.c
r278 r309 1 1 /* 2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/src/os/solaris/dtrace/jvm_dtrace.h
r278 r309 1 1 /* 2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/src/os/solaris/dtrace/libjvm_db.c
r278 r309 125 125 126 126 int32_t orig_pc_offset; /* _orig_pc_offset */ 127 int32_t instrs_beg; /* _ instructions_offset */127 int32_t instrs_beg; /* _code_offset */ 128 128 int32_t instrs_end; 129 129 int32_t deopt_beg; /* _deoptimize_offset */ … … 588 588 589 589 /* Instructions */ 590 err = ps_pread(J->P, nm + OFFSET_CodeBlob_ instructions_offset, &N->instrs_beg, SZ32);590 err = ps_pread(J->P, nm + OFFSET_CodeBlob_code_offset, &N->instrs_beg, SZ32); 591 591 CHECK_FAIL(err); 592 592 err = ps_pread(J->P, nm + OFFSET_CodeBlob_data_offset, &N->instrs_end, SZ32); -
trunk/openjdk/hotspot/src/os/solaris/dtrace/libjvm_db.h
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 04, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef OS_SOLARIS_DTRACE_LIBJVM_DB_H 26 #define OS_SOLARIS_DTRACE_LIBJVM_DB_H 24 27 25 28 #include <proc_service.h> … … 62 65 } /* extern "C" */ 63 66 #endif /* __cplusplus */ 67 68 #endif // OS_SOLARIS_DTRACE_LIBJVM_DB_H -
trunk/openjdk/hotspot/src/os/solaris/vm/attachListener_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, 20 06, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_attachListener_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "runtime/interfaceSupport.hpp" 27 #include "runtime/os.hpp" 28 #include "services/attachListener.hpp" 29 #include "services/dtraceAttacher.hpp" 27 30 28 31 #include <door.h> -
trunk/openjdk/hotspot/src/os/solaris/vm/c1_globals_solaris.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 01, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP 26 #define OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP 27 28 #include "utilities/globalDefinitions.hpp" 29 #include "utilities/macros.hpp" 30 25 31 // 26 32 // Sets the default values for operating system dependent flags used by the 27 33 // client compiler. (see c1_globals.hpp) 28 34 // 35 36 #endif // OS_SOLARIS_VM_C1_GLOBALS_SOLARIS_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/c2_globals_solaris.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 01, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP 26 #define OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP 27 28 #include "utilities/globalDefinitions.hpp" 29 #include "utilities/macros.hpp" 30 25 31 // 26 32 // Sets the default values for operating system dependent flags used by the 27 33 // server compiler. (see c2_globals.hpp) 28 34 // 35 36 #endif // OS_SOLARIS_VM_C2_GLOBALS_SOLARIS_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/chaitin_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1999, 20 01, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_chaitin_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "opto/chaitin.hpp" 27 #include "opto/machnode.hpp" 27 28 28 29 void PhaseRegAlloc::pd_preallocate_hook() { -
trunk/openjdk/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_dtraceJSDT_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "classfile/javaClasses.hpp" 27 #include "code/codeBlob.hpp" 28 #include "memory/allocation.hpp" 29 #include "prims/jvm.h" 30 #include "runtime/dtraceJSDT.hpp" 31 #include "runtime/jniHandles.hpp" 32 #include "runtime/os.hpp" 33 #include "runtime/signature.hpp" 34 #include "utilities/globalDefinitions.hpp" 27 35 28 36 #ifdef HAVE_DTRACE_H -
trunk/openjdk/hotspot/src/os/solaris/vm/globals_solaris.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP 26 #define OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP 24 27 25 28 // … … 48 51 define_pd_global(bool, UseOSErrorReporting, false); 49 52 define_pd_global(bool, UseThreadPriorities, false); 53 54 #endif // OS_SOLARIS_VM_GLOBALS_SOLARIS_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/interfaceSupport_solaris.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP 26 #define OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP 27 25 28 // Contains inlined functions for class InterfaceSupport 26 29 … … 28 31 os::write_memory_serialize_page(thread); 29 32 } 33 34 #endif // OS_SOLARIS_VM_INTERFACESUPPORT_SOLARIS_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/jsig.c
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 03, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/src/os/solaris/vm/jvm_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_jvm_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "prims/jvm.h" 27 #include "runtime/interfaceSupport.hpp" 28 #include "runtime/osThread.hpp" 27 29 28 30 #include <signal.h> -
trunk/openjdk/hotspot/src/os/solaris/vm/jvm_solaris.h
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 05, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef OS_SOLARIS_VM_JVM_SOLARIS_H 26 #define OS_SOLARIS_VM_JVM_SOLARIS_H 24 27 25 28 /* … … 99 102 100 103 #endif /* JVM_MD_H */ 104 105 #endif // OS_SOLARIS_VM_JVM_SOLARIS_H -
trunk/openjdk/hotspot/src/os/solaris/vm/mutex_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_mutex_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "mutex_solaris.inline.hpp" 27 #include "runtime/interfaceSupport.hpp" 28 #include "runtime/mutex.hpp" 29 #include "thread_solaris.inline.hpp" 30 #include "utilities/events.hpp" 27 31 28 32 // Solaris-specific include, therefore not in includeDB_* -
trunk/openjdk/hotspot/src/os/solaris/vm/mutex_solaris.inline.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 02, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP 26 #define OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP 27 28 #include "os_solaris.inline.hpp" 29 #include "runtime/interfaceSupport.hpp" 30 #include "thread_solaris.inline.hpp" 31 32 #endif // OS_SOLARIS_VM_MUTEX_SOLARIS_INLINE_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/osThread_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 // do not include precompiled header file 26 # include "incls/_osThread_solaris.cpp.incl" 25 // no precompiled headers 26 #include "runtime/atomic.hpp" 27 #include "runtime/handles.inline.hpp" 28 #include "runtime/mutexLocker.hpp" 29 #include "runtime/os.hpp" 30 #include "runtime/osThread.hpp" 31 #include "runtime/safepoint.hpp" 32 #include "runtime/vmThread.hpp" 33 #ifdef TARGET_ARCH_x86 34 # include "assembler_x86.inline.hpp" 35 #endif 36 #ifdef TARGET_ARCH_sparc 37 # include "assembler_sparc.inline.hpp" 38 #endif 39 27 40 # include <signal.h> 28 41 -
trunk/openjdk/hotspot/src/os/solaris/vm/osThread_solaris.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 06, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP 26 #define OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP 24 27 25 28 // This is embedded via include into the class OSThread … … 150 153 void pd_initialize(); 151 154 void pd_destroy(); 155 156 #endif // OS_SOLARIS_VM_OSTHREAD_SOLARIS_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/os_share_solaris.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1999, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP 26 #define OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP 24 27 25 28 // Defines the interfaces to Solaris operating systems that vary across platforms … … 66 69 67 70 #define PROCFILE_LENGTH 128 71 72 #endif // OS_SOLARIS_VM_OS_SHARE_SOLARIS_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 // do not include precompiled header file 26 # include "incls/_os_solaris.cpp.incl" 25 // no precompiled headers 26 #include "classfile/classLoader.hpp" 27 #include "classfile/systemDictionary.hpp" 28 #include "classfile/vmSymbols.hpp" 29 #include "code/icBuffer.hpp" 30 #include "code/vtableStubs.hpp" 31 #include "compiler/compileBroker.hpp" 32 #include "interpreter/interpreter.hpp" 33 #include "jvm_solaris.h" 34 #include "memory/allocation.inline.hpp" 35 #include "memory/filemap.hpp" 36 #include "mutex_solaris.inline.hpp" 37 #include "oops/oop.inline.hpp" 38 #include "os_share_solaris.hpp" 39 #include "prims/jniFastGetField.hpp" 40 #include "prims/jvm.h" 41 #include "prims/jvm_misc.hpp" 42 #include "runtime/arguments.hpp" 43 #include "runtime/extendedPC.hpp" 44 #include "runtime/globals.hpp" 45 #include "runtime/interfaceSupport.hpp" 46 #include "runtime/java.hpp" 47 #include "runtime/javaCalls.hpp" 48 #include "runtime/mutexLocker.hpp" 49 #include "runtime/objectMonitor.hpp" 50 #include "runtime/osThread.hpp" 51 #include "runtime/perfMemory.hpp" 52 #include "runtime/sharedRuntime.hpp" 53 #include "runtime/statSampler.hpp" 54 #include "runtime/stubRoutines.hpp" 55 #include "runtime/threadCritical.hpp" 56 #include "runtime/timer.hpp" 57 #include "services/attachListener.hpp" 58 #include "services/runtimeService.hpp" 59 #include "thread_solaris.inline.hpp" 60 #include "utilities/decoder.hpp" 61 #include "utilities/defaultStream.hpp" 62 #include "utilities/events.hpp" 63 #include "utilities/growableArray.hpp" 64 #include "utilities/vmError.hpp" 65 #ifdef TARGET_ARCH_x86 66 # include "assembler_x86.inline.hpp" 67 # include "nativeInst_x86.hpp" 68 #endif 69 #ifdef TARGET_ARCH_sparc 70 # include "assembler_sparc.inline.hpp" 71 # include "nativeInst_sparc.hpp" 72 #endif 73 #ifdef COMPILER1 74 #include "c1/c1_Runtime1.hpp" 75 #endif 76 #ifdef COMPILER2 77 #include "opto/runtime.hpp" 78 #endif 27 79 28 80 // put OS-includes here 29 81 # include <dlfcn.h> 30 82 # include <errno.h> 83 # include <exception> 31 84 # include <link.h> 32 85 # include <poll.h> … … 64 117 # include <sys/loadavg.h> 65 118 # include <string.h> 119 # include <stdio.h> 66 120 67 121 # define _STRUCTURED_PROC 1 // this gets us the new structured proc interfaces of 5.6 & later … … 168 222 static clock_t clock_tics_per_sec = 100; 169 223 224 // Track if we have called enable_extended_FILE_stdio (on Solaris 10u4+) 225 static bool enabled_extended_FILE_stdio = false; 226 170 227 // For diagnostics to print a message once. see run_periodic_checks 171 228 static bool check_addr0_done = false; … … 227 284 "sp must be inside of selected thread stack"); 228 285 229 thread-> _self_raw_id = raw_id; // mark for quick retrieval286 thread->set_self_raw_id(raw_id); // mark for quick retrieval 230 287 _get_thread_cache[ index ] = thread; 231 288 } … … 335 392 // its former state whether or not an interrupt is received. 336 393 // Used by classloader os::read 337 // hpicalls skip this layer and stay in _thread_in_native394 // os::restartable_read calls skip this layer and stay in _thread_in_native 338 395 339 396 void os::Solaris::setup_interruptible(JavaThread* thread) { … … 1420 1477 } 1421 1478 1479 1480 void _handle_uncaught_cxx_exception() { 1481 VMError err("An uncaught C++ exception"); 1482 err.report_and_die(); 1483 } 1484 1485 1422 1486 // First crack at OS-specific initialization, from inside the new thread. 1423 1487 void os::initialize_thread() { … … 1509 1573 1510 1574 os::Solaris::init_thread_fpu_state(); 1575 std::set_terminate(_handle_uncaught_cxx_exception); 1511 1576 } 1512 1577 … … 1699 1764 1700 1765 bool os::enable_vtime() { 1701 int fd = open("/proc/self/ctl", O_WRONLY);1766 int fd = ::open("/proc/self/ctl", O_WRONLY); 1702 1767 if (fd == -1) 1703 1768 return false; 1704 1769 1705 1770 long cmd[] = { PCSET, PR_MSACCT }; 1706 int res = write(fd, cmd, sizeof(long) * 2);1707 close(fd);1771 int res = ::write(fd, cmd, sizeof(long) * 2); 1772 ::close(fd); 1708 1773 if (res != sizeof(long) * 2) 1709 1774 return false; … … 1713 1778 1714 1779 bool os::vtime_enabled() { 1715 int fd = open("/proc/self/status", O_RDONLY);1780 int fd = ::open("/proc/self/status", O_RDONLY); 1716 1781 if (fd == -1) 1717 1782 return false; 1718 1783 1719 1784 pstatus_t status; 1720 int res = read(fd, (void*) &status, sizeof(pstatus_t));1721 close(fd);1785 int res = os::read(fd, (void*) &status, sizeof(pstatus_t)); 1786 ::close(fd); 1722 1787 if (res != sizeof(pstatus_t)) 1723 1788 return false; … … 1834 1899 void os::dll_build_name(char* buffer, size_t buflen, 1835 1900 const char* pname, const char* fname) { 1836 // Copied from libhpi1837 1901 const size_t pnamelen = pname ? strlen(pname) : 0; 1838 1902 … … 1912 1976 #define RTLD_DL_SYMENT 1 1913 1977 #endif 1914 Sym * info; 1978 #ifdef _LP64 1979 Elf64_Sym * info; 1980 #else 1981 Elf32_Sym * info; 1982 #endif 1915 1983 if (dladdr1_func((void *)addr, &dlinfo, (void **)&info, 1916 1984 RTLD_DL_SYMENT)) { 1917 if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); 1918 if (offset) *offset = addr - (address)dlinfo.dli_saddr; 1919 1920 // check if the returned symbol really covers addr 1921 return ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr); 1922 } else { 1923 if (buf) buf[0] = '\0'; 1924 if (offset) *offset = -1; 1925 return false; 1985 if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) { 1986 if (buf != NULL) { 1987 if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) 1988 jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); 1989 } 1990 if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; 1991 return true; 1992 } 1926 1993 } 1994 if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { 1995 if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), 1996 dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { 1997 return true; 1998 } 1999 } 2000 if (buf != NULL) buf[0] = '\0'; 2001 if (offset != NULL) *offset = -1; 2002 return false; 1927 2003 } else { 1928 2004 // no, only dladdr is available 1929 if(dladdr((void *)addr, &dlinfo)) { 1930 if (buf) jio_snprintf(buf, buflen, dlinfo.dli_sname); 1931 if (offset) *offset = addr - (address)dlinfo.dli_saddr; 2005 if (dladdr((void *)addr, &dlinfo)) { 2006 if (buf != NULL) { 2007 if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) 2008 jio_snprintf(buf, buflen, dlinfo.dli_sname); 2009 } 2010 if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; 2011 return true; 2012 } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { 2013 if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), 2014 dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { 1932 2015 return true; 1933 } else { 1934 if (buf) buf[0] = '\0'; 1935 if (offset) *offset = -1; 1936 return false; 2016 } 1937 2017 } 2018 if (buf != NULL) buf[0] = '\0'; 2019 if (offset != NULL) *offset = -1; 2020 return false; 1938 2021 } 1939 2022 } … … 2130 2213 } 2131 2214 2132 2133 bool _print_ascii_file(const char* filename, outputStream* st) { 2134 int fd = open(filename, O_RDONLY); 2215 int os::stat(const char *path, struct stat *sbuf) { 2216 char pathbuf[MAX_PATH]; 2217 if (strlen(path) > MAX_PATH - 1) { 2218 errno = ENAMETOOLONG; 2219 return -1; 2220 } 2221 os::native_path(strcpy(pathbuf, path)); 2222 return ::stat(pathbuf, sbuf); 2223 } 2224 2225 static bool _print_ascii_file(const char* filename, outputStream* st) { 2226 int fd = ::open(filename, O_RDONLY); 2135 2227 if (fd == -1) { 2136 2228 return false; … … 2139 2231 char buf[32]; 2140 2232 int bytes; 2141 while ((bytes = read(fd, buf, sizeof(buf))) > 0) {2233 while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) { 2142 2234 st->print_raw(buf, bytes); 2143 2235 } 2144 2236 2145 close(fd);2237 ::close(fd); 2146 2238 2147 2239 return true; … … 2206 2298 static bool check_addr0(outputStream* st) { 2207 2299 jboolean status = false; 2208 int fd = open("/proc/self/map",O_RDONLY);2300 int fd = ::open("/proc/self/map",O_RDONLY); 2209 2301 if (fd >= 0) { 2210 2302 prmap_t p; 2211 while( read(fd, &p, sizeof(p)) > 0) {2303 while(::read(fd, &p, sizeof(p)) > 0) { 2212 2304 if (p.pr_vaddr == 0x0) { 2213 2305 st->print("Warning: Address: 0x%x, Size: %dK, ",p.pr_vaddr, p.pr_size/1024, p.pr_mapname); … … 2220 2312 status = true; 2221 2313 } 2222 close(fd);2314 ::close(fd); 2223 2315 } 2224 2316 } … … 2468 2560 // "libjvm"debug_only("_g")".so" since for fastdebug version 2469 2561 // we should have "libjvm.so" but debug_only("_g") adds "_g"! 2470 // It is used when we are choosing the HPI library's name2471 // "libhpi[_g].so" in hpi::initialize_get_interface().2472 2562 len = strlen(buf); 2473 2563 snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p); … … 2491 2581 void os::print_jni_name_suffix_on(outputStream* st, int args_size) { 2492 2582 // no suffix required 2583 } 2584 2585 // This method is a copy of JDK's sysGetLastErrorString 2586 // from src/solaris/hpi/src/system_md.c 2587 2588 size_t os::lasterror(char *buf, size_t len) { 2589 2590 if (errno == 0) return 0; 2591 2592 const char *s = ::strerror(errno); 2593 size_t n = ::strlen(s); 2594 if (n >= len) { 2595 n = len - 1; 2596 } 2597 ::strncpy(buf, s, n); 2598 buf[n] = '\0'; 2599 return n; 2493 2600 } 2494 2601 … … 2987 3094 jio_snprintf(buf, sizeof(buf), ": %s", strerror(err)); 2988 3095 } 2989 warning("attempt_reserve_memory_at: couldn't reserve %dbytes at "3096 warning("attempt_reserve_memory_at: couldn't reserve " SIZE_FORMAT " bytes at " 2990 3097 PTR_FORMAT ": reserve_memory_helper returned " PTR_FORMAT 2991 3098 "%s", bytes, requested_addr, addr, buf); … … 3375 3482 // thread.Interrupt. 3376 3483 3377 if((res == OS_ERR) && (errno == EINTR)) { 3484 // See c/r 6751923. Poll can return 0 before time 3485 // has elapsed if time is set via clock_settime (as NTP does). 3486 // res == 0 if poll timed out (see man poll RETURN VALUES) 3487 // using the logic below checks that we really did 3488 // sleep at least "millis" if not we'll sleep again. 3489 if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) { 3378 3490 newtime = getTimeMillis(); 3379 3491 assert(newtime >= prevtime, "time moving backwards"); … … 3395 3507 size_t os::read(int fd, void *buf, unsigned int nBytes) { 3396 3508 INTERRUPTIBLE_RETURN_INT_VM(::read(fd, buf, nBytes), os::Solaris::clear_interrupted); 3509 } 3510 3511 size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) { 3512 INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted); 3397 3513 } 3398 3514 … … 4566 4682 #define LWPINDEX(ary,ix) ((lwpstatus_t *)(((ary)->pr_entsize * (ix)) + (ADR((ary) + 1)))) 4567 4683 4568 lwpFile = open("/proc/self/lstatus", O_RDONLY, 0);4684 lwpFile = ::open("/proc/self/lstatus", O_RDONLY, 0); 4569 4685 if (lwpFile < 0) { 4570 4686 if (ThreadPriorityVerbose) warning ("Couldn't open /proc/self/lstatus\n"); … … 4573 4689 lwpSize = 16*1024; 4574 4690 for (;;) { 4575 lseek(lwpFile, 0, SEEK_SET);4691 ::lseek64 (lwpFile, 0, SEEK_SET); 4576 4692 lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize); 4577 if ( read(lwpFile, lwpArray, lwpSize) < 0) {4693 if (::read(lwpFile, lwpArray, lwpSize) < 0) { 4578 4694 if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n"); 4579 4695 break; … … 4596 4712 4597 4713 FREE_C_HEAP_ARRAY(char, lwpArray); 4598 close (lwpFile);4714 ::close (lwpFile); 4599 4715 if (ThreadPriorityVerbose) { 4600 4716 if (isT2) tty->print_cr("We are running with a T2 libthread\n"); … … 4792 4908 Solaris::misc_sym_init(); 4793 4909 4794 int fd = open("/dev/zero", O_RDWR);4910 int fd = ::open("/dev/zero", O_RDWR); 4795 4911 if (fd < 0) { 4796 4912 fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno))); … … 4878 4994 // the java system classes, including StackOverflowError - depends on page 4879 4995 // size. Add a page for compiler2 recursion in main thread. 4880 // Add in BytesPerWord times page size to account for VM stack during4996 // Add in 2*BytesPerWord times page size to account for VM stack during 4881 4997 // class initialization depending on 32 or 64 bit VM. 4882 guarantee((Solaris::min_stack_allowed >= 4883 (StackYellowPages+StackRedPages+StackShadowPages+BytesPerWord 4884 COMPILER2_PRESENT(+1)) * page_size), 4885 "need to increase Solaris::min_stack_allowed on this platform"); 4998 os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed, 4999 (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ 5000 2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size); 4886 5001 4887 5002 size_t threadStackSizeInBytes = ThreadStackSize * K; 4888 5003 if (threadStackSizeInBytes != 0 && 4889 threadStackSizeInBytes < Solaris::min_stack_allowed) {5004 threadStackSizeInBytes < os::Solaris::min_stack_allowed) { 4890 5005 tty->print_cr("\nThe stack size specified is too small, Specify at least %dk", 4891 Solaris::min_stack_allowed/K);5006 os::Solaris::min_stack_allowed/K); 4892 5007 return JNI_ERR; 4893 5008 } … … 4963 5078 } 4964 5079 4965 // Initialize HPI.4966 jint hpi_result = hpi::initialize();4967 if (hpi_result != JNI_OK) {4968 tty->print_cr("There was an error trying to initialize the HPI library.");4969 return hpi_result;4970 }4971 4972 5080 // Calculate theoretical max. size of Threads to guard gainst 4973 5081 // artifical out-of-memory situations, where all available address- … … 5028 5136 5029 5137 // OS interface. 5030 5031 int os::stat(const char *path, struct stat *sbuf) {5032 char pathbuf[MAX_PATH];5033 if (strlen(path) > MAX_PATH - 1) {5034 errno = ENAMETOOLONG;5035 return -1;5036 }5037 hpi::native_path(strcpy(pathbuf, path));5038 return ::stat(pathbuf, sbuf);5039 }5040 5041 5138 5042 5139 bool os::check_heap(bool force) { return true; } … … 5084 5181 } 5085 5182 5183 // This code originates from JDK's sysOpen and open64_w 5184 // from src/solaris/hpi/src/system_md.c 5185 5186 #ifndef O_DELETE 5187 #define O_DELETE 0x10000 5188 #endif 5189 5190 // Open a file. Unlink the file immediately after open returns 5191 // if the specified oflag has the O_DELETE flag set. 5192 // O_DELETE is used only in j2se/src/share/native/java/util/zip/ZipFile.c 5193 5194 int os::open(const char *path, int oflag, int mode) { 5195 if (strlen(path) > MAX_PATH - 1) { 5196 errno = ENAMETOOLONG; 5197 return -1; 5198 } 5199 int fd; 5200 int o_delete = (oflag & O_DELETE); 5201 oflag = oflag & ~O_DELETE; 5202 5203 fd = ::open64(path, oflag, mode); 5204 if (fd == -1) return -1; 5205 5206 //If the open succeeded, the file might still be a directory 5207 { 5208 struct stat64 buf64; 5209 int ret = ::fstat64(fd, &buf64); 5210 int st_mode = buf64.st_mode; 5211 5212 if (ret != -1) { 5213 if ((st_mode & S_IFMT) == S_IFDIR) { 5214 errno = EISDIR; 5215 ::close(fd); 5216 return -1; 5217 } 5218 } else { 5219 ::close(fd); 5220 return -1; 5221 } 5222 } 5223 /* 5224 * 32-bit Solaris systems suffer from: 5225 * 5226 * - an historical default soft limit of 256 per-process file 5227 * descriptors that is too low for many Java programs. 5228 * 5229 * - a design flaw where file descriptors created using stdio 5230 * fopen must be less than 256, _even_ when the first limit above 5231 * has been raised. This can cause calls to fopen (but not calls to 5232 * open, for example) to fail mysteriously, perhaps in 3rd party 5233 * native code (although the JDK itself uses fopen). One can hardly 5234 * criticize them for using this most standard of all functions. 5235 * 5236 * We attempt to make everything work anyways by: 5237 * 5238 * - raising the soft limit on per-process file descriptors beyond 5239 * 256 5240 * 5241 * - As of Solaris 10u4, we can request that Solaris raise the 256 5242 * stdio fopen limit by calling function enable_extended_FILE_stdio. 5243 * This is done in init_2 and recorded in enabled_extended_FILE_stdio 5244 * 5245 * - If we are stuck on an old (pre 10u4) Solaris system, we can 5246 * workaround the bug by remapping non-stdio file descriptors below 5247 * 256 to ones beyond 256, which is done below. 5248 * 5249 * See: 5250 * 1085341: 32-bit stdio routines should support file descriptors >255 5251 * 6533291: Work around 32-bit Solaris stdio limit of 256 open files 5252 * 6431278: Netbeans crash on 32 bit Solaris: need to call 5253 * enable_extended_FILE_stdio() in VM initialisation 5254 * Giri Mandalika's blog 5255 * http://technopark02.blogspot.com/2005_05_01_archive.html 5256 */ 5257 #ifndef _LP64 5258 if ((!enabled_extended_FILE_stdio) && fd < 256) { 5259 int newfd = ::fcntl(fd, F_DUPFD, 256); 5260 if (newfd != -1) { 5261 ::close(fd); 5262 fd = newfd; 5263 } 5264 } 5265 #endif // 32-bit Solaris 5266 /* 5267 * All file descriptors that are opened in the JVM and not 5268 * specifically destined for a subprocess should have the 5269 * close-on-exec flag set. If we don't set it, then careless 3rd 5270 * party native code might fork and exec without closing all 5271 * appropriate file descriptors (e.g. as we do in closeDescriptors in 5272 * UNIXProcess.c), and this in turn might: 5273 * 5274 * - cause end-of-file to fail to be detected on some file 5275 * descriptors, resulting in mysterious hangs, or 5276 * 5277 * - might cause an fopen in the subprocess to fail on a system 5278 * suffering from bug 1085341. 5279 * 5280 * (Yes, the default setting of the close-on-exec flag is a Unix 5281 * design flaw) 5282 * 5283 * See: 5284 * 1085341: 32-bit stdio routines should support file descriptors >255 5285 * 4843136: (process) pipe file descriptor from Runtime.exec not being closed 5286 * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9 5287 */ 5288 #ifdef FD_CLOEXEC 5289 { 5290 int flags = ::fcntl(fd, F_GETFD); 5291 if (flags != -1) 5292 ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC); 5293 } 5294 #endif 5295 5296 if (o_delete != 0) { 5297 ::unlink(path); 5298 } 5299 return fd; 5300 } 5301 5086 5302 // create binary file, rewriting existing file if required 5087 5303 int os::create_binary_file(const char* path, bool rewrite_existing) { … … 5101 5317 jlong os::seek_to_file_offset(int fd, jlong offset) { 5102 5318 return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET); 5319 } 5320 5321 jlong os::lseek(int fd, jlong offset, int whence) { 5322 return (jlong) ::lseek64(fd, offset, whence); 5323 } 5324 5325 char * os::native_path(char *path) { 5326 return path; 5327 } 5328 5329 int os::ftruncate(int fd, jlong length) { 5330 return ::ftruncate64(fd, length); 5331 } 5332 5333 int os::fsync(int fd) { 5334 RESTARTABLE_RETURN_INT(::fsync(fd)); 5335 } 5336 5337 int os::available(int fd, jlong *bytes) { 5338 jlong cur, end; 5339 int mode; 5340 struct stat64 buf64; 5341 5342 if (::fstat64(fd, &buf64) >= 0) { 5343 mode = buf64.st_mode; 5344 if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { 5345 /* 5346 * XXX: is the following call interruptible? If so, this might 5347 * need to go through the INTERRUPT_IO() wrapper as for other 5348 * blocking, interruptible calls in this file. 5349 */ 5350 int n,ioctl_return; 5351 5352 INTERRUPTIBLE(::ioctl(fd, FIONREAD, &n),ioctl_return,os::Solaris::clear_interrupted); 5353 if (ioctl_return>= 0) { 5354 *bytes = n; 5355 return 1; 5356 } 5357 } 5358 } 5359 if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) { 5360 return 0; 5361 } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) { 5362 return 0; 5363 } else if (::lseek64(fd, cur, SEEK_SET) == -1) { 5364 return 0; 5365 } 5366 *bytes = end - cur; 5367 return 1; 5103 5368 } 5104 5369 … … 5161 5426 if (fd != -1) { 5162 5427 struct stat buf; 5163 close(fd);5428 ::close(fd); 5164 5429 while (::stat(filename, &buf) == 0) { 5165 5430 (void)::poll(NULL, 0, 100); … … 5358 5623 getpid(), 5359 5624 thread->osthread()->lwp_id()); 5360 fd = open(proc_name, O_RDONLY);5625 fd = ::open(proc_name, O_RDONLY); 5361 5626 if ( fd == -1 ) return -1; 5362 5627 5363 5628 do { 5364 count = pread(fd,5629 count = ::pread(fd, 5365 5630 (void *)&prusage.pr_utime, 5366 5631 thr_time_size, 5367 5632 thr_time_off); 5368 5633 } while (count < 0 && errno == EINTR); 5369 close(fd);5634 ::close(fd); 5370 5635 if ( count < 0 ) return -1; 5371 5636 … … 5837 6102 // First, demultiplex/decode time arguments 5838 6103 timespec absTime; 5839 if (time < 0 ) { // don't wait at all6104 if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all 5840 6105 return; 5841 6106 } … … 6039 6304 } 6040 6305 6041 6306 size_t os::write(int fd, const void *buf, unsigned int nBytes) { 6307 INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted); 6308 } 6309 6310 int os::close(int fd) { 6311 RESTARTABLE_RETURN_INT(::close(fd)); 6312 } 6313 6314 int os::socket_close(int fd) { 6315 RESTARTABLE_RETURN_INT(::close(fd)); 6316 } 6317 6318 int os::recv(int fd, char *buf, int nBytes, int flags) { 6319 INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted); 6320 } 6321 6322 6323 int os::send(int fd, char *buf, int nBytes, int flags) { 6324 INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted); 6325 } 6326 6327 int os::raw_send(int fd, char *buf, int nBytes, int flags) { 6328 RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags)); 6329 } 6330 6331 // As both poll and select can be interrupted by signals, we have to be 6332 // prepared to restart the system call after updating the timeout, unless 6333 // a poll() is done with timeout == -1, in which case we repeat with this 6334 // "wait forever" value. 6335 6336 int os::timeout(int fd, long timeout) { 6337 int res; 6338 struct timeval t; 6339 julong prevtime, newtime; 6340 static const char* aNull = 0; 6341 struct pollfd pfd; 6342 pfd.fd = fd; 6343 pfd.events = POLLIN; 6344 6345 gettimeofday(&t, &aNull); 6346 prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; 6347 6348 for(;;) { 6349 INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted); 6350 if(res == OS_ERR && errno == EINTR) { 6351 if(timeout != -1) { 6352 gettimeofday(&t, &aNull); 6353 newtime = ((julong)t.tv_sec * 1000) + t.tv_usec /1000; 6354 timeout -= newtime - prevtime; 6355 if(timeout <= 0) 6356 return OS_OK; 6357 prevtime = newtime; 6358 } 6359 } else return res; 6360 } 6361 } 6362 6363 int os::connect(int fd, struct sockaddr *him, int len) { 6364 int _result; 6365 INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result, 6366 os::Solaris::clear_interrupted); 6367 6368 // Depending on when thread interruption is reset, _result could be 6369 // one of two values when errno == EINTR 6370 6371 if (((_result == OS_INTRPT) || (_result == OS_ERR)) 6372 && (errno == EINTR)) { 6373 /* restarting a connect() changes its errno semantics */ 6374 INTERRUPTIBLE(::connect(fd, him, len), _result, 6375 os::Solaris::clear_interrupted); 6376 /* undo these changes */ 6377 if (_result == OS_ERR) { 6378 if (errno == EALREADY) { 6379 errno = EINPROGRESS; /* fall through */ 6380 } else if (errno == EISCONN) { 6381 errno = 0; 6382 return OS_OK; 6383 } 6384 } 6385 } 6386 return _result; 6387 } 6388 6389 int os::accept(int fd, struct sockaddr *him, int *len) { 6390 if (fd < 0) 6391 return OS_ERR; 6392 INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him,\ 6393 (socklen_t*) len), os::Solaris::clear_interrupted); 6394 } 6395 6396 int os::recvfrom(int fd, char *buf, int nBytes, int flags, 6397 sockaddr *from, int *fromlen) { 6398 //%%note jvm_r11 6399 INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes,\ 6400 flags, from, fromlen), os::Solaris::clear_interrupted); 6401 } 6402 6403 int os::sendto(int fd, char *buf, int len, int flags, 6404 struct sockaddr *to, int tolen) { 6405 //%%note jvm_r11 6406 INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, flags,\ 6407 to, tolen), os::Solaris::clear_interrupted); 6408 } 6409 6410 int os::socket_available(int fd, jint *pbytes) { 6411 if (fd < 0) 6412 return OS_OK; 6413 6414 int ret; 6415 6416 RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret); 6417 6418 //%% note ioctl can return 0 when successful, JVM_SocketAvailable 6419 // is expected to return 0 on failure and 1 on success to the jdk. 6420 6421 return (ret == OS_ERR) ? 0 : 1; 6422 } 6423 6424 6425 int os::bind(int fd, struct sockaddr *him, int len) { 6426 INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),\ 6427 os::Solaris::clear_interrupted); 6428 } -
trunk/openjdk/hotspot/src/os/solaris/vm/os_solaris.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef OS_SOLARIS_VM_OS_SOLARIS_HPP 26 #define OS_SOLARIS_VM_OS_SOLARIS_HPP 27 25 28 // Solaris_OS defines the interface to Solaris operating systems 26 29 … … 395 398 } 396 399 } ; 400 401 #endif // OS_SOLARIS_VM_OS_SOLARIS_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP 26 #define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP 27 28 #include "runtime/atomic.hpp" 29 #include "runtime/os.hpp" 30 #ifdef TARGET_OS_ARCH_solaris_x86 31 # include "atomic_solaris_x86.inline.hpp" 32 # include "orderAccess_solaris_x86.inline.hpp" 33 #endif 34 #ifdef TARGET_OS_ARCH_solaris_sparc 35 # include "atomic_solaris_sparc.inline.hpp" 36 # include "orderAccess_solaris_sparc.inline.hpp" 37 #endif 38 39 // System includes 40 #include <sys/param.h> 41 #include <dlfcn.h> 42 #include <sys/socket.h> 43 #include <sys/poll.h> 44 #include <sys/filio.h> 45 #include <unistd.h> 46 #include <netdb.h> 47 #include <setjmp.h> 48 25 49 inline const char* os::file_separator() { return "/"; } 26 50 inline const char* os::line_separator() { return "\n"; } … … 56 80 inline void os::bang_stack_shadow_pages() { 57 81 } 58 59 inline DIR* os::opendir(const char* dirname) 60 {82 inline void os::dll_unload(void *lib) { ::dlclose(lib); } 83 84 inline DIR* os::opendir(const char* dirname) { 61 85 assert(dirname != NULL, "just checking"); 62 86 return ::opendir(dirname); 63 87 } 64 88 65 inline int os::readdir_buf_size(const char *path) 66 { 89 inline int os::readdir_buf_size(const char *path) { 67 90 int size = pathconf(path, _PC_NAME_MAX); 68 91 return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1; 69 92 } 70 93 71 inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) 72 { 94 inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { 73 95 assert(dirp != NULL, "just checking"); 74 96 #if defined(_LP64) || defined(_GNU_SOURCE) … … 86 108 } 87 109 88 inline int os::closedir(DIR *dirp) 89 { 90 assert(dirp != NULL, "just checking"); 110 inline int os::closedir(DIR *dirp) { 111 assert(dirp != NULL, "argument is NULL"); 91 112 return ::closedir(dirp); 92 113 } … … 208 229 inline bool os::numa_has_static_binding() { return false; } 209 230 inline bool os::numa_has_group_homing() { return true; } 231 232 inline int os::socket(int domain, int type, int protocol) { 233 return ::socket(domain, type, protocol); 234 } 235 236 inline int os::listen(int fd, int count) { 237 if (fd < 0) return OS_ERR; 238 239 return ::listen(fd, count); 240 } 241 242 inline int os::socket_shutdown(int fd, int howto){ 243 return ::shutdown(fd, howto); 244 } 245 246 inline int os::get_sock_name(int fd, struct sockaddr *him, int *len){ 247 return ::getsockname(fd, him, (socklen_t*) len); 248 } 249 250 inline int os::get_host_name(char* name, int namelen){ 251 return ::gethostname(name, namelen); 252 } 253 254 inline struct hostent* os::get_host_by_name(char* name) { 255 return ::gethostbyname(name); 256 } 257 inline int os::get_sock_opt(int fd, int level, int optname, 258 char *optval, int* optlen){ 259 return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen); 260 } 261 262 inline int os::set_sock_opt(int fd, int level, int optname, 263 const char *optval, int optlen){ 264 return ::setsockopt(fd, level, optname, optval, optlen); 265 } 266 #endif // OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_perfMemory_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "classfile/vmSymbols.hpp" 27 #include "memory/allocation.inline.hpp" 28 #include "memory/resourceArea.hpp" 29 #include "oops/oop.inline.hpp" 30 #include "os_solaris.inline.hpp" 31 #include "runtime/handles.inline.hpp" 32 #include "runtime/perfMemory.hpp" 33 #include "utilities/exceptions.hpp" 27 34 28 35 // put OS-includes here -
trunk/openjdk/hotspot/src/os/solaris/vm/stubRoutines_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 02, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_stubRoutines_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "runtime/os.hpp" 27 #include "runtime/stubRoutines.hpp" 28 -
trunk/openjdk/hotspot/src/os/solaris/vm/threadCritical_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 03, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_threadCritical_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "runtime/threadCritical.hpp" 27 #include "thread_solaris.inline.hpp" 27 28 28 29 // OS-includes here -
trunk/openjdk/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 03, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP 26 #define OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP 27 28 #include "runtime/atomic.hpp" 29 #include "runtime/prefetch.hpp" 30 #include "runtime/thread.hpp" 31 #include "runtime/threadLocalStorage.hpp" 32 #ifdef TARGET_OS_ARCH_solaris_x86 33 # include "atomic_solaris_x86.inline.hpp" 34 # include "orderAccess_solaris_x86.inline.hpp" 35 # include "prefetch_solaris_x86.inline.hpp" 36 #endif 37 #ifdef TARGET_OS_ARCH_solaris_sparc 38 # include "atomic_solaris_sparc.inline.hpp" 39 # include "orderAccess_solaris_sparc.inline.hpp" 40 # include "prefetch_solaris_sparc.inline.hpp" 41 #endif 42 25 43 // Thread::current is "hot" it's called > 128K times in the 1st 500 msecs of 26 44 // startup. … … 36 54 uintptr_t raw = pd_raw_thread_id(); 37 55 int ix = pd_cache_index(raw); 38 Thread *Candidate = ThreadLocalStorage::_get_thread_cache[ix];39 if ( Candidate->_self_raw_id== raw) {56 Thread* candidate = ThreadLocalStorage::_get_thread_cache[ix]; 57 if (candidate->self_raw_id() == raw) { 40 58 // hit 41 return Candidate;59 return candidate; 42 60 } else { 43 61 return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix); 44 62 } 45 63 } 64 65 #endif // OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP -
trunk/openjdk/hotspot/src/os/solaris/vm/vmError_solaris.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 06, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_vmError_solaris.cpp.incl" 25 #include "precompiled.hpp" 26 #include "runtime/arguments.hpp" 27 #include "runtime/os.hpp" 28 #include "runtime/thread.hpp" 29 #include "utilities/vmError.hpp" 27 30 28 31 #include <sys/types.h>
Note:
See TracChangeset
for help on using the changeset viewer.