From b834f7749876e65bb700ba168359a98390ad37c0 Mon Sep 17 00:00:00 2001 From: kurt Date: Wed, 10 Jun 2009 19:01:09 +0000 Subject: [PATCH] - binary plugs distfile no longer needed - sync patches with OpenJDK7 bsd-port repository - install a usable cacerts - Remove Interruptible IO support tested by ian@ william@ --- devel/jdk/1.7/Makefile | 33 +- devel/jdk/1.7/files/cacerts | Bin 0 -> 41997 bytes .../patch-corba_make_common_Defs-bsd_gmk | 12 +- ...atch-corba_make_common_shared_Platform_gmk | 18 +- .../patches/patch-hotspot_agent_make_Makefile | 32 + ...otspot_agent_src_os_bsd_BsdDebuggerLocal_c | 142 +++++ .../patch-hotspot_agent_src_os_bsd_Makefile | 81 +++ ...tspot_agent_src_os_bsd_StubDebuggerLocal_c | 124 ++++ ...patch-hotspot_agent_src_os_bsd_elfmacros_h | 38 ++ ...patch-hotspot_agent_src_os_bsd_hsearch_r_c | 221 +++++++ ...patch-hotspot_agent_src_os_bsd_hsearch_r_h | 46 ++ .../patch-hotspot_agent_src_os_bsd_libproc_h | 63 ++ ...ch-hotspot_agent_src_os_bsd_libproc_impl_c | 97 +++ ...ch-hotspot_agent_src_os_bsd_libproc_impl_h | 32 + .../patch-hotspot_agent_src_os_bsd_mapfile | 24 + .../patch-hotspot_agent_src_os_bsd_ps_core_c | 300 ++++++++++ .../patch-hotspot_agent_src_os_bsd_ps_proc_c | 563 ++++++++++++++++++ .../patch-hotspot_agent_src_os_bsd_salibelf_c | 11 + .../patch-hotspot_agent_src_os_bsd_symtab_c | 67 +++ .../patch-hotspot_agent_src_os_bsd_test_c | 12 + ..._classes_sun_jvm_hotspot_HotSpotAgent_java | 72 +++ ..._sun_jvm_hotspot_bugspot_BugSpotAgent_java | 74 +++ ...jvm_hotspot_debugger_bsd_BsdCDebugger_java | 28 + ..._debugger_bsd_BsdThreadContextFactory_java | 24 + ...asses_sun_jvm_hotspot_runtime_Threads_java | 26 + ...un_jvm_hotspot_runtime_bsd_BsdSignals_java | 63 ++ ...vm_hotspot_runtime_bsd_x86_BsdSignals_java | 63 ++ ...un_jvm_hotspot_utilities_PlatformInfo_java | 18 + ...patch-hotspot_make_bsd_makefiles_defs_make | 10 +- ...h-hotspot_make_bsd_makefiles_launcher_make | 12 + ...tch-hotspot_make_bsd_makefiles_saproc_make | 53 +- .../1.7/patches/patch-hotspot_make_sa_files | 23 + .../patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp | 109 +--- ...tch-hotspot_src_os_bsd_vm_osThread_bsd_hpp | 27 +- .../patch-hotspot_src_os_bsd_vm_os_bsd_cpp | 248 +++----- .../patch-hotspot_src_os_bsd_vm_os_bsd_hpp | 39 +- ...ch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp | 114 +--- .../patch-jdk_make_common_Defs-bsd_gmk | 12 +- .../patch-jdk_make_common_shared_Platform_gmk | 18 +- .../patch-jdk_make_java_hpi_native_Makefile | 15 +- .../patches/patch-jdk_make_java_nio_Makefile | 17 +- .../patch-jdk_make_java_nio_mapfile-bsd | 60 ++ .../patch-jdk_make_java_redist_Makefile | 22 +- .../patches/patch-jdk_src_share_bin_java_c | 12 +- ...native_com_sun_java_util_jar_pack_main_cpp | 18 +- ...aris_classes_sun_nio_fs_BsdFileSystem_java | 29 +- ...lasses_sun_nio_fs_BsdNativeDispatcher_java | 113 ++++ ...olaris_hpi_native_threads_src_sys_api_td_c | 25 - ...olaris_native_sun_nio_ch_SctpChannelImpl_c | 17 + ...dk_src_solaris_native_sun_nio_ch_SctpNet_c | 19 + ...h-jdk_src_solaris_native_sun_nio_ch_Sctp_h | 47 ++ ...is_native_sun_nio_fs_BsdNativeDispatcher_c | 286 +++++++++ ..._native_sun_nio_fs_GnomeFileTypeDetector_c | 13 + devel/jdk/1.7/pkg/PLIST-main | 4 +- 54 files changed, 3089 insertions(+), 557 deletions(-) create mode 100644 devel/jdk/1.7/files/cacerts create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_make_Makefile create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_BsdDebuggerLocal_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_Makefile create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_StubDebuggerLocal_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_elfmacros_h create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_h create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_h create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_h create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_mapfile create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_core_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_proc_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_salibelf_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_symtab_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_test_c create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_HotSpotAgent_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_bugspot_BugSpotAgent_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdCDebugger_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdThreadContextFactory_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_Threads_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_BsdSignals_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_x86_BsdSignals_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_utilities_PlatformInfo_java create mode 100644 devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_launcher_make create mode 100644 devel/jdk/1.7/patches/patch-hotspot_make_sa_files create mode 100644 devel/jdk/1.7/patches/patch-jdk_make_java_nio_mapfile-bsd create mode 100644 devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdNativeDispatcher_java delete mode 100644 devel/jdk/1.7/patches/patch-jdk_src_solaris_hpi_native_threads_src_sys_api_td_c create mode 100644 devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpChannelImpl_c create mode 100644 devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpNet_c create mode 100644 devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_Sctp_h create mode 100644 devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_BsdNativeDispatcher_c create mode 100644 devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_GnomeFileTypeDetector_c diff --git a/devel/jdk/1.7/Makefile b/devel/jdk/1.7/Makefile index 2032c064e44..94abd2cc305 100644 --- a/devel/jdk/1.7/Makefile +++ b/devel/jdk/1.7/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.29 2009/05/23 03:03:24 kurt Exp $ +# $OpenBSD: Makefile,v 1.30 2009/06/10 19:01:09 kurt Exp $ SHARED_ONLY= Yes ONLY_FOR_ARCHS= i386 amd64 @@ -8,11 +8,10 @@ COMMENT-jre= Java2(TM) SE Runtime Environment v${V} Early Access ${B} V= 1.7.0.00 B= b59 DISTFILES= openjdk-7-ea-src-${B}-14_may_2009.zip \ - jdk-7-icedtea-plugs-1.6b.tar.gz:0 \ - jibx_1_1_5.zip:1 + jibx_1_1_5.zip:0 PKGNAME= jdk-${V} -PKGNAME-main= jdk-${V}${B} -PKGNAME-jre= jre-${V}${B} +PKGNAME-main= jdk-${V}${B}p0 +PKGNAME-jre= jre-${V}${B}p0 CATEGORIES= devel/jdk java @@ -25,8 +24,7 @@ FLAVOR?= HOMEPAGE= http://openjdk.java.net/ MASTER_SITES= http://www.java.net/download/openjdk/jdk7/promoted/${B}/ -MASTER_SITES0= http://www.intricatesoftware.com/distfiles/ -MASTER_SITES1= ${MASTER_SITE_SOURCEFORGE:=jibx/} +MASTER_SITES0= ${MASTER_SITE_SOURCEFORGE:=jibx/} MAINTAINER= Kurt Miller @@ -63,7 +61,6 @@ USE_GMAKE= Yes MAKE_ENV= ALT_BOOTDIR=${ALT_BOOTDIR} \ ALT_FREETYPE_HEADERS_PATH=${X11BASE}/include \ ALT_FREETYPE_LIB_PATH=${X11BASE}/lib \ - ALT_BINARY_PLUGS_PATH=${WRKDIR}/jdk-7-icedtea-plugs \ ALT_JIBX_LIBS_PATH=${WRKDIR}/jibx/lib \ ALT_PACKAGE_PATH=${LOCALBASE} \ ALT_X11_PATH=${X11BASE} \ @@ -98,7 +95,14 @@ PKG_ARGS+= -Dclient_vm=1 PKG_ARGS+= -Dclient_vm=0 .endif -COPYDIRS= hotspot/src/os/linux/launcher \ +COPYDIRS= hotspot/agent/src/os/linux \ + hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux \ + hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64 \ + hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86 \ + hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux \ + hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64 \ + hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86 \ + hotspot/src/os/linux/launcher \ hotspot/src/os/linux/vm \ hotspot/src/os_cpu/linux_x86/vm \ hotspot/make/linux \ @@ -106,7 +110,8 @@ COPYDIRS= hotspot/src/os/linux/launcher \ jdk/src/linux/doc/man \ jdk/src/linux/doc/man/ja -COPYFILES= corba/make/common/Defs-linux.gmk \ +COPYFILES= hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java \ + corba/make/common/Defs-linux.gmk \ corba/make/common/shared/Defs-linux.gmk \ jdk/make/com/sun/tools/attach/mapfile-linux \ jdk/make/common/Defs-linux.gmk \ @@ -120,10 +125,12 @@ COPYFILES= corba/make/common/Defs-linux.gmk \ jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java \ jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java \ jdk/src/solaris/classes/sun/nio/fs/LinuxFileStore.java \ + jdk/src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java \ jdk/src/solaris/classes/sun/tools/attach/LinuxAttachProvider.java \ jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java \ jdk/src/solaris/hpi/include/largefile_linux.h \ - jdk/src/solaris/native/java/net/linux_close.c + jdk/src/solaris/native/java/net/linux_close.c \ + jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c # create initial bsd src from linux src (except for threads_solaris.c) post-extract: @@ -132,7 +139,7 @@ post-extract: cd ${WRKDIST}/$$d; \ for f in *; do \ if [ -f $$f ]; then \ - t=`echo ${WRKDIST}/$$d/$$f | sed 's/linux/bsd/g;'`; \ + t=`echo ${WRKDIST}/$$d/$$f | sed 's/linux/bsd/g; s/Linux/Bsd/g'`; \ sed 's/linux/bsd/g; s/Linux/Bsd/g' < $$f > $$t; \ fi; \ done; \ @@ -146,6 +153,8 @@ post-extract: > ${WRKDIST}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c @cp ${WRKDIST}/jdk/src/share/lib/security/java.security \ ${WRKDIST}/jdk/src/share/lib/security/java.security-openbsd + @rm ${WRKDIST}/hotspot/agent/src/os/bsd/proc_service.h + @cp -f ${FILESDIR}/cacerts ${WRKDIST}/jdk/src/share/lib/security post-build: @rm -rf ${JDKIMAGEDIR}/man/ja ${JREIMAGEDIR}/man/ja diff --git a/devel/jdk/1.7/files/cacerts b/devel/jdk/1.7/files/cacerts new file mode 100644 index 0000000000000000000000000000000000000000..b0631404466b3353cfba0de65ddbbb3a03aae0e9 GIT binary patch literal 41997 zcmd>n2Rv2(|G#nVz4uDUzSky^9hn&+d+$v|*(+I%KzMZ zRkuEU*6;iMeShEY_uu2;k#o;+&UxSSdOlzKb-t{BSw})bLIHlbVE+?XI(fKxx_g*A z*aE+qn*twh=LCE{L_*W$5d@1OA%V8QL7;WuM<){%1sMeeB!U|M9*l>M#SwNP>?0mB zG6)R`9M}WF0b`+~YJ<>8P_#86q+nv`1~v(f9Q^b=PL>{!3t)NZr#PgNSFc{>Ik_-& z53daD>c%os#)?i>&b%_}nvAwi=FV;|Jd9>OjBb`zJd6&ujfzK4*CP47AwjXZlcw7$@T>x(4BsVqLh34H`Z@@_f70qzIXKgN=0w7M^wV9GMEl}06vHu^y}TY(A^{;G%zYM z@-dhS&KG;vF{F?{xL|A=kd6Qk7!?H+hbVvmm7oHWCs}%P>!lScTDrvHDy@7&?v+^Y z6ygiX2Rni@xI!2x_Jm@Qq=BiBJil_Oa=T>=z$m)`aZfYs=L`ELP+fS7K=FpiB2_!31XRJh8{O%?IPgPr=?LgWtFj6&)OeiUJNou}2}iKK=z` zpn$%H(8u~yex$%t#C4%TDYETHk)!~V0pAcnk@z~mg*1T+aWN`7ne#xz!D7%II3)Zs z&?__YGpc)w#K0o(zlNMJqX^@V=LZgxcXnemh4bAt zOAAI%cS}ZRCkG!01MHasS0?}ZCyZK9-N2}7>2cNB%^pULB49y?2pIMcphi9sun0hv z{DPu_q5w7i7pyTb1M$hhC@~s%dXZ2{>@yl7GBmIqEE=w}Q%+{kO9ID`hce1LDoBom zGKRc%tk}<8$K9eJID3$P!1A(fAjEvz&wLel&r{^#E}X|ai@&@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5= z(oCh+EYrV#x_!uGIi-znbMvzjg)hkV278Z;5or<2u^rzaqTmVq*?~YH%lNrs?8(#<@}H)jPFgB|Q#khD`M-ab&{oco zh9Kz|@hAvMHOdT5WcKj~_szLmi_2=o#wU|9Ipnn!%`?HcO2)YZFLR8p$2h52N2RJQ z?D<<$s?9akxtVl5+x&y2erqQ>TQ{W$iUb;%mbpwIWa6(P?`1LC&=S&PCE1yEzrKq* zUNkjg$(#E;l?aW9mYH3gfp<%LllF1c{;%lA)@CKySlxSYt*nE7crWYobEOA{CTFV7 zKfHZrQt+fx1DQgU$!=TJ9I5El2SNT28NnrzG7EirfrxXpd5cYQ`+Zwoia0L)i?AJX z1cMsHg08og`zk$p&2J;3dQ-)w5dBv#pnuRu^uNZ2rf(}-?}JBsUen|O$Rr<=s$e~Z zjHlT)&6?^%;G5OFo#%Eh!s_0H /dev/null || sysctl -n hw.physmem) | awk '{print int($$NF / 1048576); }' ) ++ endif +endif + # Windows with and without CYGWIN will be slightly different ifeq ($(SYSTEM_UNAME), Windows_NT) PLATFORM = windows -@@ -373,7 +452,14 @@ endif +@@ -373,7 +456,14 @@ endif # build machines and adjustments will be made to prevent excessing # system swapping during the build. # If we don't know, assume 512. Subtract 128 from MB for VM MAX. @@ -103,7 +107,7 @@ $OpenBSD: patch-corba_make_common_shared_Platform_gmk,v 1.3 2009/05/23 03:03:24 ifneq ($(MB_OF_MEMORY),) LOW_MEMORY_MACHINE := $(shell \ if [ $(MB_OF_MEMORY) -le 512 ] ; then \ -@@ -385,7 +471,7 @@ ifneq ($(MB_OF_MEMORY),) +@@ -385,7 +475,7 @@ ifneq ($(MB_OF_MEMORY),) if [ $(MB_OF_MEMORY) -le 1024 ] ; then \ expr $(MB_OF_MEMORY) '-' 128 ; \ else \ diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_make_Makefile b/devel/jdk/1.7/patches/patch-hotspot_agent_make_Makefile new file mode 100644 index 00000000000..395d32b6bfa --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_make_Makefile @@ -0,0 +1,32 @@ +$OpenBSD: patch-hotspot_agent_make_Makefile,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/make/Makefile.orig Tue Jun 2 12:31:31 2009 ++++ hotspot/agent/make/Makefile Tue Jun 2 12:31:37 2009 +@@ -52,6 +52,9 @@ sun.jvm.hotspot.code \ + sun.jvm.hotspot.compiler \ + sun.jvm.hotspot.debugger \ + sun.jvm.hotspot.debugger.amd64 \ ++sun.jvm.hotspot.debugger.bsd \ ++sun.jvm.hotspot.debugger.bsd.amd64 \ ++sun.jvm.hotspot.debugger.bsd.x86 \ + sun.jvm.hotspot.debugger.cdbg \ + sun.jvm.hotspot.debugger.cdbg.basic \ + sun.jvm.hotspot.debugger.cdbg.basic.amd64 \ +@@ -94,6 +97,9 @@ sun.jvm.hotspot.memory \ + sun.jvm.hotspot.oops \ + sun.jvm.hotspot.runtime \ + sun.jvm.hotspot.runtime.amd64 \ ++sun.jvm.hotspot.runtime.bsd \ ++sun.jvm.hotspot.runtime.bsd_amd64 \ ++sun.jvm.hotspot.runtime.bsd_x86 \ + sun.jvm.hotspot.runtime.ia64 \ + sun.jvm.hotspot.runtime.linux \ + sun.jvm.hotspot.runtime.linux_amd64 \ +@@ -143,6 +149,8 @@ sun/jvm/hotspot/code/*.java \ + sun/jvm/hotspot/compiler/*.java \ + sun/jvm/hotspot/debugger/*.java \ + sun/jvm/hotspot/debugger/amd64/*.java \ ++sun/jvm/hotspot/debugger/bsd/*.java \ ++sun/jvm/hotspot/debugger/bsd/x86/*.java \ + sun/jvm/hotspot/debugger/cdbg/*.java \ + sun/jvm/hotspot/debugger/cdbg/basic/*.java \ + sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \ diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_BsdDebuggerLocal_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_BsdDebuggerLocal_c new file mode 100644 index 00000000000..d78895370c2 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_BsdDebuggerLocal_c @@ -0,0 +1,142 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_BsdDebuggerLocal_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/BsdDebuggerLocal.c.orig Tue Jun 2 12:59:31 2009 ++++ hotspot/agent/src/os/bsd/BsdDebuggerLocal.c Tue Jun 2 12:59:42 2009 +@@ -22,6 +22,7 @@ + * + */ + ++#include + #include + #include "libproc.h" + +@@ -73,7 +74,7 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_b + (JNIEnv *env, jclass cls) { + jclass listClass; + +- if (init_libproc(getenv("LIBSAPROC_DEBUG")) != true) { ++ if (init_libproc(getenv("LIBSAPROC_DEBUG") != NULL) != true) { + THROW_NEW_DEBUGGER_EXCEPTION("can't initialize libproc"); + } + +@@ -275,7 +276,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debu + bufPtr = (*env)->GetByteArrayElements(env, array, &isCopy); + CHECK_EXCEPTION_(0); + +- err = ps_pdread(get_proc_handle(env, this_obj), (psaddr_t) (uintptr_t)addr, bufPtr, numBytes); ++ err = ps_pread(get_proc_handle(env, this_obj), (psaddr_t) (uintptr_t)addr, bufPtr, numBytes); + (*env)->ReleaseByteArrayElements(env, array, bufPtr, 0); + return (err == PS_OK)? array : 0; + } +@@ -283,11 +284,10 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debu + JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0 + (JNIEnv *env, jobject this_obj, jint lwp_id) { + +- struct user_regs_struct gregs; ++ struct reg gregs; + jboolean isCopy; + jlongArray array; + jlong *regs; +- int i; + + struct ps_prochandle* ph = get_proc_handle(env, this_obj); + if (get_lwp_regs(ph, lwp_id, &gregs) != true) { +@@ -317,26 +317,27 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debu + #ifdef i386 + #define REG_INDEX(reg) sun_jvm_hotspot_debugger_x86_X86ThreadContext_##reg + +- regs[REG_INDEX(GS)] = (uintptr_t) gregs.xgs; +- regs[REG_INDEX(FS)] = (uintptr_t) gregs.xfs; +- regs[REG_INDEX(ES)] = (uintptr_t) gregs.xes; +- regs[REG_INDEX(DS)] = (uintptr_t) gregs.xds; +- regs[REG_INDEX(EDI)] = (uintptr_t) gregs.edi; +- regs[REG_INDEX(ESI)] = (uintptr_t) gregs.esi; +- regs[REG_INDEX(FP)] = (uintptr_t) gregs.ebp; +- regs[REG_INDEX(SP)] = (uintptr_t) gregs.esp; +- regs[REG_INDEX(EBX)] = (uintptr_t) gregs.ebx; +- regs[REG_INDEX(EDX)] = (uintptr_t) gregs.edx; +- regs[REG_INDEX(ECX)] = (uintptr_t) gregs.ecx; +- regs[REG_INDEX(EAX)] = (uintptr_t) gregs.eax; +- regs[REG_INDEX(PC)] = (uintptr_t) gregs.eip; +- regs[REG_INDEX(CS)] = (uintptr_t) gregs.xcs; +- regs[REG_INDEX(SS)] = (uintptr_t) gregs.xss; ++ regs[REG_INDEX(GS)] = (uintptr_t) gregs.r_gs; ++ regs[REG_INDEX(FS)] = (uintptr_t) gregs.r_fs; ++ regs[REG_INDEX(ES)] = (uintptr_t) gregs.r_es; ++ regs[REG_INDEX(DS)] = (uintptr_t) gregs.r_ds; ++ regs[REG_INDEX(EDI)] = (uintptr_t) gregs.r_edi; ++ regs[REG_INDEX(ESI)] = (uintptr_t) gregs.r_esi; ++ regs[REG_INDEX(FP)] = (uintptr_t) gregs.r_ebp; ++ regs[REG_INDEX(SP)] = (uintptr_t) gregs.r_isp; ++ regs[REG_INDEX(EBX)] = (uintptr_t) gregs.r_ebx; ++ regs[REG_INDEX(EDX)] = (uintptr_t) gregs.r_edx; ++ regs[REG_INDEX(ECX)] = (uintptr_t) gregs.r_ecx; ++ regs[REG_INDEX(EAX)] = (uintptr_t) gregs.r_eax; ++ regs[REG_INDEX(PC)] = (uintptr_t) gregs.r_eip; ++ regs[REG_INDEX(CS)] = (uintptr_t) gregs.r_cs; ++ regs[REG_INDEX(SS)] = (uintptr_t) gregs.r_ss; + + #endif /* i386 */ + + #if ia64 + regs = (*env)->GetLongArrayElements(env, array, &isCopy); ++ int i; + for (i = 0; i < NPRGREG; i++ ) { + regs[i] = 0xDEADDEAD; + } +@@ -345,31 +346,31 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debu + #ifdef amd64 + #define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg + +- regs[REG_INDEX(R15)] = gregs.r15; +- regs[REG_INDEX(R14)] = gregs.r14; +- regs[REG_INDEX(R13)] = gregs.r13; +- regs[REG_INDEX(R12)] = gregs.r12; +- regs[REG_INDEX(RBP)] = gregs.rbp; +- regs[REG_INDEX(RBX)] = gregs.rbx; +- regs[REG_INDEX(R11)] = gregs.r11; +- regs[REG_INDEX(R10)] = gregs.r10; +- regs[REG_INDEX(R9)] = gregs.r9; +- regs[REG_INDEX(R8)] = gregs.r8; +- regs[REG_INDEX(RAX)] = gregs.rax; +- regs[REG_INDEX(RCX)] = gregs.rcx; +- regs[REG_INDEX(RDX)] = gregs.rdx; +- regs[REG_INDEX(RSI)] = gregs.rsi; +- regs[REG_INDEX(RDI)] = gregs.rdi; +- regs[REG_INDEX(RIP)] = gregs.rip; +- regs[REG_INDEX(CS)] = gregs.cs; +- regs[REG_INDEX(RSP)] = gregs.rsp; +- regs[REG_INDEX(SS)] = gregs.ss; +- regs[REG_INDEX(FSBASE)] = gregs.fs_base; +- regs[REG_INDEX(GSBASE)] = gregs.gs_base; +- regs[REG_INDEX(DS)] = gregs.ds; +- regs[REG_INDEX(ES)] = gregs.es; +- regs[REG_INDEX(FS)] = gregs.fs; +- regs[REG_INDEX(GS)] = gregs.gs; ++ regs[REG_INDEX(R15)] = gregs.r_r15; ++ regs[REG_INDEX(R14)] = gregs.r_r14; ++ regs[REG_INDEX(R13)] = gregs.r_r13; ++ regs[REG_INDEX(R12)] = gregs.r_r12; ++ regs[REG_INDEX(RBP)] = gregs.r_rbp; ++ regs[REG_INDEX(RBX)] = gregs.r_rbx; ++ regs[REG_INDEX(R11)] = gregs.r_r11; ++ regs[REG_INDEX(R10)] = gregs.r_r10; ++ regs[REG_INDEX(R9)] = gregs.r_r9; ++ regs[REG_INDEX(R8)] = gregs.r_r8; ++ regs[REG_INDEX(RAX)] = gregs.r_rax; ++ regs[REG_INDEX(RCX)] = gregs.r_rcx; ++ regs[REG_INDEX(RDX)] = gregs.r_rdx; ++ regs[REG_INDEX(RSI)] = gregs.r_rsi; ++ regs[REG_INDEX(RDI)] = gregs.r_rdi; ++ regs[REG_INDEX(RIP)] = gregs.r_rip; ++ regs[REG_INDEX(CS)] = gregs.r_cs; ++ regs[REG_INDEX(RSP)] = gregs.r_rsp; ++ regs[REG_INDEX(SS)] = gregs.r_ss; ++// regs[REG_INDEX(FSBASE)] = gregs.fs_base; ++// regs[REG_INDEX(GSBASE)] = gregs.gs_base; ++// regs[REG_INDEX(DS)] = gregs.ds; ++// regs[REG_INDEX(ES)] = gregs.es; ++// regs[REG_INDEX(FS)] = gregs.fs; ++// regs[REG_INDEX(GS)] = gregs.gs; + + #endif /* amd64 */ + diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_Makefile b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_Makefile new file mode 100644 index 00000000000..acef142bf3c --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_Makefile @@ -0,0 +1,81 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_Makefile,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/Makefile.orig Tue Jun 2 13:00:17 2009 ++++ hotspot/agent/src/os/bsd/Makefile Tue Jun 2 13:01:26 2009 +@@ -19,10 +19,10 @@ + # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + # CA 95054 USA or visit www.sun.com if you need additional information or + # have any questions. +-# ++# + # + +-ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi ) ++ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "amd64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi ) + GCC = gcc + + JAVAH = ${JAVA_HOME}/bin/javah +@@ -32,25 +32,25 @@ SOURCES = salibelf.c \ + libproc_impl.c \ + ps_proc.c \ + ps_core.c \ +- BsdDebuggerLocal.c ++ hsearch_r.c \ ++ BsdDebuggerLocal.c + +-INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/bsd ++INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") + + OBJS = $(SOURCES:.c=.o) + +-LIBS = -lthread_db ++LIBS = -lutil -lthread_db + +-CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) ++CFLAGS = -c -fPIC -g -Wall -D_ALLBSD_SOURCE -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) + + LIBSA = $(ARCH)/libsaproc.so + + all: $(LIBSA) + + BsdDebuggerLocal.o: BsdDebuggerLocal.c +- $(JAVAH) -jni -classpath ../../../build/classes \ ++ $(JAVAH) -jni -classpath ../../../../../build/bsd-i586/hotspot/outputdir/bsd_i486_compiler2/generated/saclasses \ + sun.jvm.hotspot.debugger.x86.X86ThreadContext \ +- sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \ +- sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext ++ sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext + $(GCC) $(CFLAGS) $< + + .c.obj: +@@ -60,26 +60,19 @@ ifndef LDNOMAP + LFLAGS_LIBSA = -Xlinker --version-script=mapfile + endif + +-# If this is a --hash-style=gnu system, use --hash-style=both +-# The gnu .hash section won't work on some Bsd systems like SuSE 10. +-_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu') +-ifneq ($(_HAS_HASH_STYLE_GNU),) +- LDFLAGS_HASH_STYLE = -Wl,--hash-style=both +-endif +-LFLAGS_LIBSA += $(LDFLAGS_HASH_STYLE) +- + $(LIBSA): $(OBJS) mapfile + if [ ! -d $(ARCH) ] ; then mkdir $(ARCH) ; fi + $(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS) + +-test.o: test.c ++test.o: $(LIBSA) test.c + $(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c + + test: test.o + $(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS) + + clean: +- rm -rf $(LIBSA) +- rm -rf $(OBJS) +- rmdir $(ARCH) ++ rm -f $(LIBSA) ++ rm -f $(OBJS) ++ rm -f test.o ++ -rmdir $(ARCH) + diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_StubDebuggerLocal_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_StubDebuggerLocal_c new file mode 100644 index 00000000000..efdba4cc2e2 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_StubDebuggerLocal_c @@ -0,0 +1,124 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_StubDebuggerLocal_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/StubDebuggerLocal.c.orig Tue Jun 2 13:02:17 2009 ++++ hotspot/agent/src/os/bsd/StubDebuggerLocal.c Tue Jun 2 13:02:28 2009 +@@ -0,0 +1,120 @@ ++/* ++ * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ * ++ */ ++ ++#include ++#include ++ ++#define CHECK_EXCEPTION_(value) if ((*env)->ExceptionOccurred(env)) { return value; } ++#define CHECK_EXCEPTION if ((*env)->ExceptionOccurred(env)) { return;} ++#define THROW_NEW_DEBUGGER_EXCEPTION_(str, value) { throw_new_debugger_exception(env, str); return value; } ++#define THROW_NEW_DEBUGGER_EXCEPTION(str) { throw_new_debugger_exception(env, str); return;} ++ ++static void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) { ++ (*env)->ThrowNew(env, (*env)->FindClass(env, "sun/jvm/hotspot/debugger/DebuggerException"), errMsg); ++} ++ ++/* ++ * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal ++ * Method: init0 ++ * Signature: ()V ++ */ ++JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_init0 ++ (JNIEnv *env, jclass cls) { ++} ++ ++JNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getAddressSize ++ (JNIEnv *env, jclass cls) ++{ ++#ifdef _LP64 ++ return 8; ++#else ++ return 4; ++#endif ++ ++} ++ ++/* ++ * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal ++ * Method: attach0 ++ * Signature: (I)V ++ */ ++JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__I ++ (JNIEnv *env, jobject this_obj, jint jpid) { ++ ++ THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process"); ++} ++ ++/* ++ * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal ++ * Method: attach0 ++ * Signature: (Ljava/lang/String;Ljava/lang/String;)V ++ */ ++JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__Ljava_lang_String_2Ljava_lang_String_2 ++ (JNIEnv *env, jobject this_obj, jstring execName, jstring coreName) { ++ THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the core file"); ++} ++ ++/* ++ * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal ++ * Method: detach0 ++ * Signature: ()V ++ */ ++JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_detach0 ++ (JNIEnv *env, jobject this_obj) { ++} ++ ++/* ++ * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal ++ * Method: lookupByName0 ++ * Signature: (Ljava/lang/String;Ljava/lang/String;)J ++ */ ++JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByName0 ++ (JNIEnv *env, jobject this_obj, jstring objectName, jstring symbolName) { ++ return 0; ++} ++ ++/* ++ * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal ++ * Method: lookupByAddress0 ++ * Signature: (J)Lsun/jvm/hotspot/debugger/cdbg/ClosestSymbol; ++ */ ++JNIEXPORT jobject JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByAddress0 ++ (JNIEnv *env, jobject this_obj, jlong addr) { ++ return 0; ++} ++ ++/* ++ * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal ++ * Method: readBytesFromProcess0 ++ * Signature: (JJ)Lsun/jvm/hotspot/debugger/ReadResult; ++ */ ++JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0 ++ (JNIEnv *env, jobject this_obj, jlong addr, jlong numBytes) { ++ return 0; ++} ++ ++JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0 ++ (JNIEnv *env, jobject this_obj, jint lwp_id) { ++ return 0; ++} diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_elfmacros_h b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_elfmacros_h new file mode 100644 index 00000000000..6b2d2055f85 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_elfmacros_h @@ -0,0 +1,38 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_elfmacros_h,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/elfmacros.h.orig Tue Jun 2 13:02:46 2009 ++++ hotspot/agent/src/os/bsd/elfmacros.h Tue Jun 2 13:02:52 2009 +@@ -25,16 +25,19 @@ + #ifndef _ELFMACROS_H_ + #define _ELFMACROS_H_ + ++#define ELF_NHDR Elf_Note ++ + #if defined(_LP64) + #define ELF_EHDR Elf64_Ehdr + #define ELF_SHDR Elf64_Shdr + #define ELF_PHDR Elf64_Phdr + #define ELF_SYM Elf64_Sym +-#define ELF_NHDR Elf64_Nhdr + #define ELF_DYN Elf64_Dyn + #define ELF_ADDR Elf64_Addr + ++#ifndef ELF_ST_TYPE + #define ELF_ST_TYPE ELF64_ST_TYPE ++#endif + + #else + +@@ -42,11 +45,12 @@ + #define ELF_SHDR Elf32_Shdr + #define ELF_PHDR Elf32_Phdr + #define ELF_SYM Elf32_Sym +-#define ELF_NHDR Elf32_Nhdr + #define ELF_DYN Elf32_Dyn + #define ELF_ADDR Elf32_Addr + ++#ifndef ELF_ST_TYPE + #define ELF_ST_TYPE ELF32_ST_TYPE ++#endif + + #endif + diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_c new file mode 100644 index 00000000000..1133592eb41 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_c @@ -0,0 +1,221 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_hsearch_r_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/hsearch_r.c.orig Tue Jun 2 13:03:08 2009 ++++ hotspot/agent/src/os/bsd/hsearch_r.c Tue Jun 2 13:03:18 2009 +@@ -0,0 +1,217 @@ ++/* Copyright (C) 1993,1995-1997,2002,2005,2007,2008 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1993. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++ ++#include ++ ++#include "hsearch_r.h" ++ ++#define __set_errno(ERRNO) errno = ERRNO ++ ++/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986 ++ [Knuth] The Art of Computer Programming, part 3 (6.4) */ ++ ++ ++/* The reentrant version has no static variables to maintain the state. ++ Instead the interface of all functions is extended to take an argument ++ which describes the current status. */ ++typedef struct _ENTRY ++{ ++ unsigned int used; ++ ENTRY entry; ++} ++_ENTRY; ++ ++ ++/* For the used double hash method the table size has to be a prime. To ++ correct the user given table size we need a prime test. This trivial ++ algorithm is adequate because ++ a) the code is (most probably) called a few times per program run and ++ b) the number is small because the table must fit in the core */ ++static int ++isprime (unsigned int number) ++{ ++ /* no even number will be passed */ ++ unsigned int div = 3; ++ ++ while (div * div < number && number % div != 0) ++ div += 2; ++ ++ return number % div != 0; ++} ++ ++ ++/* Before using the hash table we must allocate memory for it. ++ Test for an existing table are done. We allocate one element ++ more as the found prime number says. This is done for more effective ++ indexing as explained in the comment for the hsearch function. ++ The contents of the table is zeroed, especially the field used ++ becomes zero. */ ++int ++hcreate_r (size_t nel, struct hsearch_data *htab) ++{ ++ /* Test for correct arguments. */ ++ if (htab == NULL) ++ { ++ __set_errno (EINVAL); ++ return 0; ++ } ++ ++ /* There is still another table active. Return with error. */ ++ if (htab->table != NULL) ++ return 0; ++ ++ /* Change nel to the first prime number not smaller as nel. */ ++ nel |= 1; /* make odd */ ++ while (!isprime (nel)) ++ nel += 2; ++ ++ htab->size = nel; ++ htab->filled = 0; ++ ++ /* allocate memory and zero out */ ++ htab->table = (_ENTRY *) calloc (htab->size + 1, sizeof (_ENTRY)); ++ if (htab->table == NULL) ++ return 0; ++ ++ /* everything went alright */ ++ return 1; ++} ++ ++ ++/* After using the hash table it has to be destroyed. The used memory can ++ be freed and the local static variable can be marked as not used. */ ++void ++hdestroy_r (struct hsearch_data *htab) ++{ ++ /* Test for correct arguments. */ ++ if (htab == NULL) ++ { ++ __set_errno (EINVAL); ++ return; ++ } ++ ++ /* Free used memory. */ ++ free (htab->table); ++ ++ /* the sign for an existing table is an value != NULL in htable */ ++ htab->table = NULL; ++} ++ ++ ++/* This is the search function. It uses double hashing with open addressing. ++ The argument item.key has to be a pointer to an zero terminated, most ++ probably strings of chars. The function for generating a number of the ++ strings is simple but fast. It can be replaced by a more complex function ++ like ajw (see [Aho,Sethi,Ullman]) if the needs are shown. ++ ++ We use an trick to speed up the lookup. The table is created by hcreate ++ with one more element available. This enables us to use the index zero ++ special. This index will never be used because we store the first hash ++ index in the field used where zero means not used. Every other value ++ means used. The used field can be used as a first fast comparison for ++ equality of the stored and the parameter value. This helps to prevent ++ unnecessary expensive calls of strcmp. */ ++int ++hsearch_r (ENTRY item, ACTION action, ENTRY **retval, struct hsearch_data *htab) ++{ ++ unsigned int hval; ++ unsigned int count; ++ unsigned int len = strlen (item.key); ++ unsigned int idx; ++ ++ /* Compute an value for the given string. Perhaps use a better method. */ ++ hval = len; ++ count = len; ++ while (count-- > 0) ++ { ++ hval <<= 4; ++ hval += item.key[count]; ++ } ++ ++ /* First hash function: simply take the modul but prevent zero. */ ++ idx = hval % htab->size + 1; ++ ++ if (htab->table[idx].used) ++ { ++ /* Further action might be required according to the action value. */ ++ if (htab->table[idx].used == hval ++ && strcmp (item.key, htab->table[idx].entry.key) == 0) ++ { ++ *retval = &htab->table[idx].entry; ++ return 1; ++ } ++ ++ /* Second hash function, as suggested in [Knuth] */ ++ unsigned int hval2 = 1 + hval % (htab->size - 2); ++ unsigned int first_idx = idx; ++ ++ do ++ { ++ /* Because SIZE is prime this guarantees to step through all ++ available indeces. */ ++ if (idx <= hval2) ++ idx = htab->size + idx - hval2; ++ else ++ idx -= hval2; ++ ++ /* If we visited all entries leave the loop unsuccessfully. */ ++ if (idx == first_idx) ++ break; ++ ++ /* If entry is found use it. */ ++ if (htab->table[idx].used == hval ++ && strcmp (item.key, htab->table[idx].entry.key) == 0) ++ { ++ *retval = &htab->table[idx].entry; ++ return 1; ++ } ++ } ++ while (htab->table[idx].used); ++ } ++ ++ /* An empty bucket has been found. */ ++ if (action == ENTER) ++ { ++ /* If table is full and another entry should be entered return ++ with error. */ ++ if (htab->filled == htab->size) ++ { ++ __set_errno (ENOMEM); ++ *retval = NULL; ++ return 0; ++ } ++ ++ htab->table[idx].used = hval; ++ htab->table[idx].entry = item; ++ ++ ++htab->filled; ++ ++ *retval = &htab->table[idx].entry; ++ return 1; ++ } ++ ++ __set_errno (ESRCH); ++ *retval = NULL; ++ return 0; ++} diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_h b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_h new file mode 100644 index 00000000000..60aaaa14a02 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_hsearch_r_h @@ -0,0 +1,46 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_hsearch_r_h,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/hsearch_r.h.orig Tue Jun 2 13:03:25 2009 ++++ hotspot/agent/src/os/bsd/hsearch_r.h Tue Jun 2 13:03:34 2009 +@@ -0,0 +1,42 @@ ++/* Declarations for System V style searching functions. ++ Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifndef _HSEARCH_R_H_ ++#define _HSEARCH_R_H_ ++ ++#include ++ ++struct _ENTRY; ++ ++/* Data type for reentrant functions. */ ++struct hsearch_data ++ { ++ struct _ENTRY *table; ++ unsigned int size; ++ unsigned int filled; ++ }; ++ ++/* Reentrant versions which can handle multiple hashing tables at the ++ same time. */ ++extern int hsearch_r (ENTRY __item, ACTION __action, ENTRY **__retval, ++ struct hsearch_data *__htab); ++extern int hcreate_r (size_t __nel, struct hsearch_data *__htab); ++extern void hdestroy_r (struct hsearch_data *__htab); ++ ++#endif /* _HSEARCH_R_H_ */ diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_h b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_h new file mode 100644 index 00000000000..b2c2326accc --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_h @@ -0,0 +1,63 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_libproc_h,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/libproc.h.orig Tue Jun 2 13:03:57 2009 ++++ hotspot/agent/src/os/bsd/libproc.h Tue Jun 2 13:04:07 2009 +@@ -27,7 +27,8 @@ + + #include + #include +-#include "proc_service.h" ++#include ++#include + + #if defined(sparc) || defined(sparcv9) + /* +@@ -50,14 +51,11 @@ Please note that the bulk of the functionality is from + adds Pgrab__ and some missing stuff. We hide the difference b/w live process and core + file by this interface. + +-1. pthread_id unique in both NPTL & BsdThreads. We store this in +-OSThread::_pthread_id in JVM code. ++1. pthread_id is unique. We store this in OSThread::_pthread_id in JVM code. + +-2. All threads see the same pid when they call getpid() under NPTL. +-Threads receive different pid under BsdThreads. We used to save the result of +-::getpid() call in OSThread::_thread_id. This way uniqueness of OSThread::_thread_id +-was lost under NPTL. Now, we store the result of ::gettid() call in +-OSThread::_thread_id. Because gettid returns actual pid of thread (lwp id), this is ++2. All threads see the same pid when they call getpid(). ++We used to save the result of ::getpid() call in OSThread::_thread_id. ++Because gettid returns actual pid of thread (lwp id), this is + unique again. We therefore use OSThread::_thread_id as unique identifier. + + 3. There is a unique LWP id under both thread libraries. libthread_db maps pthread_id +@@ -74,20 +72,7 @@ combination of ptrace and /proc calls. + + *************************************************************************************/ + +-#ifdef ia64 +-struct user_regs_struct { +-/* copied from user.h which doesn't define this in a struct */ +- +-#define IA64_REG_COUNT (EF_SIZE/8+32) /* integer and fp regs */ +-unsigned long regs[IA64_REG_COUNT]; /* integer and fp regs */ +-}; +-#endif +- +-#if defined(sparc) || defined(sparcv9) +-#define user_regs_struct pt_regs +-#endif +- +-// This C bool type must be int for compatibility with Bsd calls and ++// This C bool type must be int for compatibility with BSD calls and + // it would be a mistake to equivalence it to C++ bool on many platforms + + typedef int bool; +@@ -118,7 +103,7 @@ int get_num_threads(struct ps_prochandle* ph); + lwpid_t get_lwp_id(struct ps_prochandle* ph, int index); + + // get regs for a given lwp +-bool get_lwp_regs(struct ps_prochandle* ph, lwpid_t lid, struct user_regs_struct* regs); ++bool get_lwp_regs(struct ps_prochandle* ph, lwpid_t lid, struct reg* regs); + + // get number of shared objects + int get_num_libs(struct ps_prochandle* ph); diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_c new file mode 100644 index 00000000000..9e7e727e32c --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_c @@ -0,0 +1,97 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_libproc_impl_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/libproc_impl.c.orig Tue Jun 2 13:04:27 2009 ++++ hotspot/agent/src/os/bsd/libproc_impl.c Tue Jun 2 13:04:34 2009 +@@ -178,6 +178,9 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, co + if (newlib->symtab == NULL) { + print_debug("symbol table build failed for %s\n", newlib->name); + } ++ else { ++ print_debug("built symbol table for %s\n", newlib->name); ++ } + + // even if symbol table building fails, we add the lib_info. + // This is because we may need to read from the ELF file for core file +@@ -272,7 +275,7 @@ static int thread_db_callback(const td_thrhandle_t *th + + print_debug("thread_db : pthread %d (lwp %d)\n", ti.ti_tid, ti.ti_lid); + +- if (ptr->callback(ptr->ph, ti.ti_tid, ti.ti_lid) != true) ++ if (ptr->callback(ptr->ph, (pthread_t)ti.ti_tid, ti.ti_lid) != true) + return TD_ERR; + + return TD_OK; +@@ -324,7 +327,7 @@ lwpid_t get_lwp_id(struct ps_prochandle* ph, int index + } + + // get regs for a given lwp +-bool get_lwp_regs(struct ps_prochandle* ph, lwpid_t lwp_id, struct user_regs_struct* regs) { ++bool get_lwp_regs(struct ps_prochandle* ph, lwpid_t lwp_id, struct reg* regs) { + return ph->ops->get_lwp_regs(ph, lwp_id, regs); + } + +@@ -375,11 +378,6 @@ bool find_lib(struct ps_prochandle* ph, const char *li + //-------------------------------------------------------------------------- + // proc service functions + +-// get process id +-pid_t ps_getpid(struct ps_prochandle *ph) { +- return ph->pid; +-} +- + // ps_pglobal_lookup() looks up the symbol sym_name in the symbol table + // of the load object object_name in the target process identified by ph. + // It returns the symbol's value as an address in the target process in +@@ -392,17 +390,33 @@ ps_err_e ps_pglobal_lookup(struct ps_prochandle *ph, c + } + + // read "size" bytes info "buf" from address "addr" +-ps_err_e ps_pdread(struct ps_prochandle *ph, psaddr_t addr, +- void *buf, size_t size) { ++ps_err_e ps_pread(struct ps_prochandle *ph, psaddr_t addr, ++ void *buf, size_t size) { + return ph->ops->p_pread(ph, (uintptr_t) addr, buf, size)? PS_OK: PS_ERR; + } + + // write "size" bytes of data to debuggee at address "addr" +-ps_err_e ps_pdwrite(struct ps_prochandle *ph, psaddr_t addr, +- const void *buf, size_t size) { ++ps_err_e ps_pwrite(struct ps_prochandle *ph, psaddr_t addr, ++ const void *buf, size_t size) { + return ph->ops->p_pwrite(ph, (uintptr_t)addr, buf, size)? PS_OK: PS_ERR; + } + ++// fill in ptrace_lwpinfo for lid ++ps_err_e ps_linfo(struct ps_prochandle *ph, lwpid_t lwp_id, void *linfo) { ++ return ph->ops->get_lwp_info(ph, lwp_id, linfo)? PS_OK: PS_ERR; ++} ++ ++// needed for when libthread_db is compiled with TD_DEBUG defined ++void ++ps_plog (const char *format, ...) ++{ ++ va_list alist; ++ ++ va_start(alist, format); ++ vfprintf(stderr, format, alist); ++ va_end(alist); ++} ++ + // ------------------------------------------------------------------------ + // Functions below this point are not yet implemented. They are here only + // to make the linker happy. +@@ -427,8 +441,12 @@ ps_err_e ps_lgetregs(struct ps_prochandle *ph, lwpid_t + return PS_OK; + } + +-// new libthread_db of NPTL seem to require this symbol +-ps_err_e ps_get_thread_area() { +- print_debug("ps_get_thread_area not implemented\n"); ++ps_err_e ps_lstop(struct ps_prochandle *ph, lwpid_t lid) { ++ print_debug("ps_lstop not implemented\n"); ++ return PS_OK; ++} ++ ++ps_err_e ps_pcontinue(struct ps_prochandle *ph) { ++ print_debug("ps_pcontinue not implemented\n"); + return PS_OK; + } diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_h b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_h new file mode 100644 index 00000000000..6bc933f3db2 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_libproc_impl_h @@ -0,0 +1,32 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_libproc_impl_h,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/libproc_impl.h.orig Tue Jun 2 13:04:50 2009 ++++ hotspot/agent/src/os/bsd/libproc_impl.h Tue Jun 2 13:04:58 2009 +@@ -47,7 +47,7 @@ typedef struct lib_info { + typedef struct thread_info { + lwpid_t lwp_id; + pthread_t pthread_id; // not used cores, always -1 +- struct user_regs_struct regs; // not for process, core uses for caching regset ++ struct reg regs; // not for process, core uses for caching regset + struct thread_info* next; + } thread_info; + +@@ -71,7 +71,9 @@ typedef struct ps_prochandle_ops { + bool (*p_pwrite)(struct ps_prochandle *ph, + uintptr_t addr, const char *buf , size_t size); + // get integer regset of a thread +- bool (*get_lwp_regs)(struct ps_prochandle* ph, lwpid_t lwp_id, struct user_regs_struct* regs); ++ bool (*get_lwp_regs)(struct ps_prochandle* ph, lwpid_t lwp_id, struct reg* regs); ++ // get info on thread ++ bool (*get_lwp_info)(struct ps_prochandle *ph, lwpid_t lwp_id, void *linfo); + } ps_prochandle_ops; + + // the ps_prochandle +@@ -79,7 +81,7 @@ typedef struct ps_prochandle_ops { + struct core_data { + int core_fd; // file descriptor of core file + int exec_fd; // file descriptor of exec file +- int interp_fd; // file descriptor of interpreter (ld-bsd.so.2) ++ int interp_fd; // file descriptor of interpreter (ld-elf.so.1) + // part of the class sharing workaround + int classes_jsa_fd; // file descriptor of class share archive + uintptr_t dynamic_addr; // address of dynamic section of a.out diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_mapfile b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_mapfile new file mode 100644 index 00000000000..a1b1b394f4f --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_mapfile @@ -0,0 +1,24 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_mapfile,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/mapfile.orig Tue Jun 2 13:05:13 2009 ++++ hotspot/agent/src/os/bsd/mapfile Tue Jun 2 13:05:19 2009 +@@ -43,13 +43,17 @@ SUNWprivate_1.1 { + # proc_service.h functions - to be used by libthread_db + ps_getpid; + ps_pglobal_lookup; +- ps_pdread; +- ps_pdwrite; ++ ps_pread; ++ ps_pwrite; + ps_lsetfpregs; + ps_lsetregs; + ps_lgetfpregs; + ps_lgetregs; +- ps_get_thread_area; ++ ps_lcontinue; ++ ps_lgetxmmregs; ++ ps_lsetxmmregs; ++ ps_lstop; ++ ps_linfo; + + # used by attach test program + init_libproc; diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_core_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_core_c new file mode 100644 index 00000000000..868aa38cd5f --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_core_c @@ -0,0 +1,300 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_ps_core_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/ps_core.c.orig Tue Jun 2 13:06:41 2009 ++++ hotspot/agent/src/os/bsd/ps_core.c Tue Jun 2 13:21:01 2009 +@@ -142,6 +142,7 @@ static map_info* add_class_share_map_info(struct ps_pr + + map->next = ph->core->class_share_maps; + ph->core->class_share_maps = map; ++ return map; + } + + // Return the map_info for the given virtual address. We keep a sorted +@@ -228,8 +229,8 @@ struct FileMapHeader { + + // 4991491 NOTICE These are C++ bool's in filemap.hpp and must match up with + // the C type matching the C++ bool type on any given platform. For +- // Hotspot on Bsd we assume the corresponding C type is char but +- // licensees on Bsd versions may need to adjust the type of these fields. ++ // Hotspot on BSD we assume the corresponding C type is char but ++ // licensees on BSD versions may need to adjust the type of these fields. + char _read_only; // read only space? + char _allow_exec; // executable code in space? + +@@ -240,7 +241,7 @@ struct FileMapHeader { + + static bool read_jboolean(struct ps_prochandle* ph, uintptr_t addr, jboolean* pvalue) { + jboolean i; +- if (ps_pdread(ph, (psaddr_t) addr, &i, sizeof(i)) == PS_OK) { ++ if (ps_pread(ph, (psaddr_t) addr, &i, sizeof(i)) == PS_OK) { + *pvalue = i; + return true; + } else { +@@ -250,7 +251,7 @@ static bool read_jboolean(struct ps_prochandle* ph, ui + + static bool read_pointer(struct ps_prochandle* ph, uintptr_t addr, uintptr_t* pvalue) { + uintptr_t uip; +- if (ps_pdread(ph, (psaddr_t) addr, &uip, sizeof(uip)) == PS_OK) { ++ if (ps_pread(ph, (psaddr_t) addr, &uip, sizeof(uip)) == PS_OK) { + *pvalue = uip; + return true; + } else { +@@ -264,7 +265,7 @@ static bool read_string(struct ps_prochandle* ph, uint + char c = ' '; + + while (c != '\0') { +- if (ps_pdread(ph, (psaddr_t) addr, &c, sizeof(char)) != PS_OK) ++ if (ps_pread(ph, (psaddr_t) addr, &c, sizeof(char)) != PS_OK) + return false; + if (i < size - 1) + buf[i] = c; +@@ -296,7 +297,6 @@ static bool init_classsharing_workaround(struct ps_pro + uintptr_t base = 0, useSharedSpacesAddr = 0; + uintptr_t sharedArchivePathAddrAddr = 0, sharedArchivePathAddr = 0; + jboolean useSharedSpaces = 0; +- map_info* mi = 0; + + memset(classes_jsa, 0, sizeof(classes_jsa)); + jvm_name = lib->name; +@@ -306,9 +306,9 @@ static bool init_classsharing_workaround(struct ps_pro + return false; + } + +- // Hotspot vm types are not exported to build this library. So +- // using equivalent type jboolean to read the value of +- // UseSharedSpaces which is same as hotspot type "bool". ++ // Hotspot vm types are not exported to build this library. So ++ // using equivalent type jboolean to read the value of ++ // UseSharedSpaces which is same as hotspot type "bool". + if (read_jboolean(ph, useSharedSpacesAddr, &useSharedSpaces) != true) { + print_debug("can't read the value of 'UseSharedSpaces' flag\n"); + return false; +@@ -507,12 +507,12 @@ static bool core_write_data(struct ps_prochandle* ph, + } + + static bool core_get_lwp_regs(struct ps_prochandle* ph, lwpid_t lwp_id, +- struct user_regs_struct* regs) { ++ struct reg* regs) { + // for core we have cached the lwp regs from NOTE section + thread_info* thr = ph->threads; + while (thr) { + if (thr->lwp_id == lwp_id) { +- memcpy(regs, &thr->regs, sizeof(struct user_regs_struct)); ++ memcpy(regs, &thr->regs, sizeof(struct reg)); + return true; + } + thr = thr->next; +@@ -520,11 +520,17 @@ static bool core_get_lwp_regs(struct ps_prochandle* ph + return false; + } + ++static bool core_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void *linfo) { ++ print_debug("core_get_lwp_info not implemented\n"); ++ return false; ++} ++ + static ps_prochandle_ops core_ops = { + .release= core_release, + .p_pread= core_read_data, + .p_pwrite= core_write_data, +- .get_lwp_regs= core_get_lwp_regs ++ .get_lwp_regs= core_get_lwp_regs, ++ .get_lwp_info= core_get_lwp_info + }; + + // read regs and create thread from NT_PRSTATUS entries from core file +@@ -539,52 +545,52 @@ static bool core_handle_prstatus(struct ps_prochandle* + return false; + + // copy regs +- memcpy(&newthr->regs, prstat->pr_reg, sizeof(struct user_regs_struct)); ++ memcpy(&newthr->regs, &prstat->pr_reg, sizeof(struct reg)); + + if (is_debug()) { + print_debug("integer regset\n"); + #ifdef i386 + // print the regset +- print_debug("\teax = 0x%x\n", newthr->regs.eax); +- print_debug("\tebx = 0x%x\n", newthr->regs.ebx); +- print_debug("\tecx = 0x%x\n", newthr->regs.ecx); +- print_debug("\tedx = 0x%x\n", newthr->regs.edx); +- print_debug("\tesp = 0x%x\n", newthr->regs.esp); +- print_debug("\tebp = 0x%x\n", newthr->regs.ebp); +- print_debug("\tesi = 0x%x\n", newthr->regs.esi); +- print_debug("\tedi = 0x%x\n", newthr->regs.edi); +- print_debug("\teip = 0x%x\n", newthr->regs.eip); ++ print_debug("\teax = 0x%x\n", newthr->regs.r_eax); ++ print_debug("\tebx = 0x%x\n", newthr->regs.r_ebx); ++ print_debug("\tecx = 0x%x\n", newthr->regs.r_ecx); ++ print_debug("\tedx = 0x%x\n", newthr->regs.r_edx); ++ print_debug("\tesp = 0x%x\n", newthr->regs.r_esp); ++ print_debug("\tebp = 0x%x\n", newthr->regs.r_ebp); ++ print_debug("\tesi = 0x%x\n", newthr->regs.r_esi); ++ print_debug("\tedi = 0x%x\n", newthr->regs.r_edi); ++ print_debug("\teip = 0x%x\n", newthr->regs.r_eip); + #endif + + #if defined(amd64) || defined(x86_64) + // print the regset +- print_debug("\tr15 = 0x%lx\n", newthr->regs.r15); +- print_debug("\tr14 = 0x%lx\n", newthr->regs.r14); +- print_debug("\tr13 = 0x%lx\n", newthr->regs.r13); +- print_debug("\tr12 = 0x%lx\n", newthr->regs.r12); +- print_debug("\trbp = 0x%lx\n", newthr->regs.rbp); +- print_debug("\trbx = 0x%lx\n", newthr->regs.rbx); +- print_debug("\tr11 = 0x%lx\n", newthr->regs.r11); +- print_debug("\tr10 = 0x%lx\n", newthr->regs.r10); +- print_debug("\tr9 = 0x%lx\n", newthr->regs.r9); +- print_debug("\tr8 = 0x%lx\n", newthr->regs.r8); +- print_debug("\trax = 0x%lx\n", newthr->regs.rax); +- print_debug("\trcx = 0x%lx\n", newthr->regs.rcx); +- print_debug("\trdx = 0x%lx\n", newthr->regs.rdx); +- print_debug("\trsi = 0x%lx\n", newthr->regs.rsi); +- print_debug("\trdi = 0x%lx\n", newthr->regs.rdi); +- print_debug("\torig_rax = 0x%lx\n", newthr->regs.orig_rax); +- print_debug("\trip = 0x%lx\n", newthr->regs.rip); +- print_debug("\tcs = 0x%lx\n", newthr->regs.cs); +- print_debug("\teflags = 0x%lx\n", newthr->regs.eflags); +- print_debug("\trsp = 0x%lx\n", newthr->regs.rsp); +- print_debug("\tss = 0x%lx\n", newthr->regs.ss); +- print_debug("\tfs_base = 0x%lx\n", newthr->regs.fs_base); +- print_debug("\tgs_base = 0x%lx\n", newthr->regs.gs_base); +- print_debug("\tds = 0x%lx\n", newthr->regs.ds); +- print_debug("\tes = 0x%lx\n", newthr->regs.es); +- print_debug("\tfs = 0x%lx\n", newthr->regs.fs); +- print_debug("\tgs = 0x%lx\n", newthr->regs.gs); ++ print_debug("\tr15 = 0x%lx\n", newthr->regs.r_r15); ++ print_debug("\tr14 = 0x%lx\n", newthr->regs.r_r14); ++ print_debug("\tr13 = 0x%lx\n", newthr->regs.r_r13); ++ print_debug("\tr12 = 0x%lx\n", newthr->regs.r_r12); ++ print_debug("\trbp = 0x%lx\n", newthr->regs.r_rbp); ++ print_debug("\trbx = 0x%lx\n", newthr->regs.r_rbx); ++ print_debug("\tr11 = 0x%lx\n", newthr->regs.r_r11); ++ print_debug("\tr10 = 0x%lx\n", newthr->regs.r_r10); ++ print_debug("\tr9 = 0x%lx\n", newthr->regs.r_r9); ++ print_debug("\tr8 = 0x%lx\n", newthr->regs.r_r8); ++ print_debug("\trax = 0x%lx\n", newthr->regs.r_rax); ++ print_debug("\trcx = 0x%lx\n", newthr->regs.r_rcx); ++ print_debug("\trdx = 0x%lx\n", newthr->regs.r_rdx); ++ print_debug("\trsi = 0x%lx\n", newthr->regs.r_rsi); ++ print_debug("\trdi = 0x%lx\n", newthr->regs.r_rdi); ++ //print_debug("\torig_rax = 0x%lx\n", newthr->regs.orig_rax); ++ print_debug("\trip = 0x%lx\n", newthr->regs.r_rip); ++ print_debug("\tcs = 0x%lx\n", newthr->regs.r_cs); ++ //print_debug("\teflags = 0x%lx\n", newthr->regs.eflags); ++ print_debug("\trsp = 0x%lx\n", newthr->regs.r_rsp); ++ print_debug("\tss = 0x%lx\n", newthr->regs.r_ss); ++ //print_debug("\tfs_base = 0x%lx\n", newthr->regs.fs_base); ++ //print_debug("\tgs_base = 0x%lx\n", newthr->regs.gs_base); ++ //print_debug("\tds = 0x%lx\n", newthr->regs.ds); ++ //print_debug("\tes = 0x%lx\n", newthr->regs.es); ++ //print_debug("\tfs = 0x%lx\n", newthr->regs.fs); ++ //print_debug("\tgs = 0x%lx\n", newthr->regs.gs); + #endif + } + +@@ -656,7 +662,7 @@ static bool read_core_segments(struct ps_prochandle* p + * contains a set of saved /proc structures), and PT_LOAD (which + * represents a memory mapping from the process's address space). + * +- * Difference b/w Solaris PT_NOTE and Bsd PT_NOTE: ++ * Difference b/w Solaris PT_NOTE and BSD PT_NOTE: + * + * In Solaris there are two PT_NOTE segments the first PT_NOTE (if present) + * contains /proc structs in the pre-2.6 unstructured /proc format. the last +@@ -666,10 +672,10 @@ static bool read_core_segments(struct ps_prochandle* p + * integer register set among other stuff. For each LWP, we have one lwpstatus + * entry that has integer regset for that LWP. + * +- * Bsd threads are actually 'clone'd processes. To support core analysis +- * of "multithreaded" process, Bsd creates more than one pstatus (called ++ * Linux threads are actually 'clone'd processes. To support core analysis ++ * of "multithreaded" process, Linux creates more than one pstatus (called + * "prstatus") entry in PT_NOTE. Each prstatus entry has integer regset for one +- * "thread". Please refer to Bsd kernel src file 'fs/binfmt_elf.c', in particular ++ * "thread". Please refer to Linux kernel src file 'fs/binfmt_elf.c', in particular + * function "elf_core_dump". + */ + +@@ -725,7 +731,7 @@ err: + return false; + } + +-// process segments from interpreter (ld.so or ld-bsd.so) ++// process segments from interpreter (ld-elf.so.1) + static bool read_interp_segments(struct ps_prochandle* ph) { + ELF_EHDR interp_ehdr; + +@@ -826,7 +832,7 @@ static bool read_shared_lib_info(struct ps_prochandle* + + dyn.d_tag = DT_NULL; + while (dyn.d_tag != DT_DEBUG) { +- if (ps_pdread(ph, (psaddr_t) addr, &dyn, sizeof(ELF_DYN)) != PS_OK) { ++ if (ps_pread(ph, (psaddr_t) addr, &dyn, sizeof(ELF_DYN)) != PS_OK) { + print_debug("can't read debug info from _DYNAMIC\n"); + return false; + } +@@ -836,23 +842,27 @@ static bool read_shared_lib_info(struct ps_prochandle* + // we have got Dyn entry with DT_DEBUG + debug_base = dyn.d_un.d_ptr; + // at debug_base we have struct r_debug. This has first link map in r_map field +- if (ps_pdread(ph, (psaddr_t) debug_base + FIRST_LINK_MAP_OFFSET, ++ if (ps_pread(ph, (psaddr_t) debug_base + FIRST_LINK_MAP_OFFSET, + &first_link_map_addr, sizeof(uintptr_t)) != PS_OK) { + print_debug("can't read first link map address\n"); + return false; + } + + // read ld_base address from struct r_debug +- if (ps_pdread(ph, (psaddr_t) debug_base + LD_BASE_OFFSET, &ld_base_addr, ++ // XXX: There is no r_ldbase member on BSD ++/* ++ if (ps_pread(ph, (psaddr_t) debug_base + LD_BASE_OFFSET, &ld_base_addr, + sizeof(uintptr_t)) != PS_OK) { + print_debug("can't read ld base address\n"); + return false; + } + ph->core->ld_base_addr = ld_base_addr; ++*/ ++ ph->core->ld_base_addr = 0; + + print_debug("interpreter base address is 0x%lx\n", ld_base_addr); + +- // now read segments from interp (i.e ld.so or ld-bsd.so) ++ // now read segments from interp (i.e ld-elf.so.1) + if (read_interp_segments(ph) != true) + return false; + +@@ -870,14 +880,14 @@ static bool read_shared_lib_info(struct ps_prochandle* + // address mentioned in shared object and the actual virtual base where runtime + // linker loaded it. We use "base diff" in read_lib_segments call below. + +- if (ps_pdread(ph, (psaddr_t) link_map_addr + LINK_MAP_ADDR_OFFSET, ++ if (ps_pread(ph, (psaddr_t) link_map_addr + LINK_MAP_ADDR_OFFSET, + &lib_base_diff, sizeof(uintptr_t)) != PS_OK) { + print_debug("can't read shared object base address diff\n"); + return false; + } + + // read address of the name +- if (ps_pdread(ph, (psaddr_t) link_map_addr + LINK_MAP_NAME_OFFSET, ++ if (ps_pread(ph, (psaddr_t) link_map_addr + LINK_MAP_NAME_OFFSET, + &lib_name_addr, sizeof(uintptr_t)) != PS_OK) { + print_debug("can't read address of shared object name\n"); + return false; +@@ -921,7 +931,7 @@ static bool read_shared_lib_info(struct ps_prochandle* + } + + // read next link_map address +- if (ps_pdread(ph, (psaddr_t) link_map_addr + LINK_MAP_NEXT_OFFSET, ++ if (ps_pread(ph, (psaddr_t) link_map_addr + LINK_MAP_NEXT_OFFSET, + &link_map_addr, sizeof(uintptr_t)) != PS_OK) { + print_debug("can't read next link in link_map\n"); + return false; +@@ -935,7 +945,6 @@ static bool read_shared_lib_info(struct ps_prochandle* + struct ps_prochandle* Pgrab_core(const char* exec_file, const char* core_file) { + ELF_EHDR core_ehdr; + ELF_EHDR exec_ehdr; +- ELF_EHDR lib_ehdr; + + struct ps_prochandle* ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle)); + if (ph == NULL) { diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_proc_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_proc_c new file mode 100644 index 00000000000..778c66b6bd2 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_ps_proc_c @@ -0,0 +1,563 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_ps_proc_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/ps_proc.c.orig Tue Jun 2 13:07:59 2009 ++++ hotspot/agent/src/os/bsd/ps_proc.c Tue Jun 2 13:20:36 2009 +@@ -22,21 +22,23 @@ + * + */ + ++#include + #include + #include + #include + #include ++#include ++#include + #include ++#include ++#include ++#include ++#include ++#include ++#include + #include "libproc_impl.h" ++#include "elfmacros.h" + +-#if defined(x86_64) && !defined(amd64) +-#define amd64 1 +-#endif +- +-#ifndef __WALL +-#define __WALL 0x40000000 // Copied from /usr/include/bsd/wait.h +-#endif +- + // This file has the libproc implementation specific to live process + // For core files, refer to ps_core.c + +@@ -50,251 +52,359 @@ static inline uintptr_t align(uintptr_t ptr, size_t si + + // read "size" bytes of data from "addr" within the target process. + // unlike the standard ptrace() function, process_read_data() can handle +-// unaligned address - alignment check, if required, should be done ++// unaligned address - alignment check, if required, should be done + // before calling process_read_data. + + static bool process_read_data(struct ps_prochandle* ph, uintptr_t addr, char *buf, size_t size) { +- long rslt; ++ int rslt; + size_t i, words; + uintptr_t end_addr = addr + size; +- uintptr_t aligned_addr = align(addr, sizeof(long)); ++ uintptr_t aligned_addr = align(addr, sizeof(int)); + + if (aligned_addr != addr) { + char *ptr = (char *)&rslt; + errno = 0; +- rslt = ptrace(PTRACE_PEEKDATA, ph->pid, aligned_addr, 0); ++ rslt = ptrace(PT_READ_D, ph->pid, (caddr_t) aligned_addr, 0); + if (errno) { +- print_debug("ptrace(PTRACE_PEEKDATA, ..) failed for %d bytes @ %lx\n", size, addr); ++ print_debug("ptrace(PT_READ_D, ..) failed for %d bytes @ %lx\n", size, addr); + return false; + } + for (; aligned_addr != addr; aligned_addr++, ptr++); +- for (; ((intptr_t)aligned_addr % sizeof(long)) && aligned_addr < end_addr; +- aligned_addr++) ++ for (; ((intptr_t)aligned_addr % sizeof(int)) && aligned_addr < end_addr; ++ aligned_addr++) + *(buf++) = *(ptr++); + } + +- words = (end_addr - aligned_addr) / sizeof(long); ++ words = (end_addr - aligned_addr) / sizeof(int); + +- // assert((intptr_t)aligned_addr % sizeof(long) == 0); ++ // assert((intptr_t)aligned_addr % sizeof(int) == 0); + for (i = 0; i < words; i++) { + errno = 0; +- rslt = ptrace(PTRACE_PEEKDATA, ph->pid, aligned_addr, 0); ++ rslt = ptrace(PT_READ_D, ph->pid, (caddr_t) aligned_addr, 0); + if (errno) { +- print_debug("ptrace(PTRACE_PEEKDATA, ..) failed for %d bytes @ %lx\n", size, addr); ++ print_debug("ptrace(PT_READ_D, ..) failed for %d bytes @ %lx\n", size, addr); + return false; + } +- *(long *)buf = rslt; +- buf += sizeof(long); +- aligned_addr += sizeof(long); ++ *(int *)buf = rslt; ++ buf += sizeof(int); ++ aligned_addr += sizeof(int); + } + + if (aligned_addr != end_addr) { + char *ptr = (char *)&rslt; + errno = 0; +- rslt = ptrace(PTRACE_PEEKDATA, ph->pid, aligned_addr, 0); ++ rslt = ptrace(PT_READ_D, ph->pid, (caddr_t) aligned_addr, 0); + if (errno) { +- print_debug("ptrace(PTRACE_PEEKDATA, ..) failed for %d bytes @ %lx\n", size, addr); ++ print_debug("ptrace(PT_READ_D, ..) failed for %d bytes @ %lx\n", size, addr); + return false; + } +- for (; aligned_addr != end_addr; aligned_addr++) ++ for (; aligned_addr != end_addr; aligned_addr++) + *(buf++) = *(ptr++); + } + return true; + } + + // null implementation for write +-static bool process_write_data(struct ps_prochandle* ph, ++static bool process_write_data(struct ps_prochandle* ph, + uintptr_t addr, const char *buf , size_t size) { + return false; + } + +-// "user" should be a pointer to a user_regs_struct +-static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct user_regs_struct *user) { ++// "user" should be a pointer to a reg ++static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct reg *user) { + // we have already attached to all thread 'pid's, just use ptrace call + // to get regset now. Note that we don't cache regset upfront for processes. +-// Bsd on x86 and sparc are different. On x86 ptrace(PTRACE_GETREGS, ...) +-// uses pointer from 4th argument and ignores 3rd argument. On sparc it uses +-// pointer from 3rd argument and ignores 4th argument +-#if defined(sparc) || defined(sparcv9) +-#define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, addr, data) +-#else +-#define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, data, addr) +-#endif +- +-#ifdef _LP64 +-#ifdef PTRACE_GETREGS64 +-#define PTRACE_GETREGS_REQ PTRACE_GETREGS64 +-#endif +-#else +-#if defined(PTRACE_GETREGS) || defined(PT_GETREGS) +-#define PTRACE_GETREGS_REQ PTRACE_GETREGS +-#endif +-#endif /* _LP64 */ +- +-#ifdef PTRACE_GETREGS_REQ +- if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) { ++ if (ptrace(PT_GETREGS, pid, (caddr_t) user, 0) < 0) { + print_debug("ptrace(PTRACE_GETREGS, ...) failed for lwp %d\n", pid); + return false; + } + return true; +-#else +- print_debug("ptrace(PTRACE_GETREGS, ...) not supported\n"); +- return false; +-#endif ++} + ++// fill in ptrace_lwpinfo for lid ++static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void *linfo) { ++ errno = 0; ++ ptrace(PT_LWPINFO, lwp_id, linfo, sizeof(struct ptrace_lwpinfo)); ++ ++ return (errno == 0)? true: false; + } + + // attach to a process/thread specified by "pid" + static bool ptrace_attach(pid_t pid) { +- if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) { ++ if (ptrace(PT_ATTACH, pid, NULL, 0) < 0) { + print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid); + return false; + } else { + int ret; + int status; + do { +- // Wait for debuggee to stop. ++ // Wait for debuggee to stop. + ret = waitpid(pid, &status, 0); +- if (ret == -1 && errno == ECHILD) { +- // try cloned process. +- ret = waitpid(pid, &status, __WALL); +- } + if (ret >= 0) { +- if (WIFSTOPPED(status)) { +- // Debuggee stopped. +- return true; ++ if (WIFSTOPPED(status)) { ++ // Debuggee stopped. ++ return true; + } else { +- print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status); +- return false; +- } ++ print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status); ++ return false; ++ } + } else { +- switch (errno) { +- case EINTR: ++ switch (errno) { ++ case EINTR: + continue; +- break; +- case ECHILD: +- print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid); +- break; +- case EINVAL: +- print_debug("waitpid() failed. Invalid options argument.\n"); +- break; +- default: +- print_debug("waitpid() failed. Unexpected error %d\n",errno); ++ break; ++ case ECHILD: ++ print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid); ++ break; ++ case EINVAL: ++ print_debug("waitpid() failed. Invalid options argument.\n"); ++ break; ++ default: ++ print_debug("waitpid() failed. Unexpected error %d\n",errno); + } + return false; +- } ++ } + } while(true); +- } +-} +- ++ } ++} ++ + // ------------------------------------------------------- + // functions for obtaining library information + // ------------------------------------------------------- + ++// callback for read_thread_info ++static bool add_new_thread(struct ps_prochandle* ph, pthread_t pthread_id, lwpid_t lwp_id) { ++ return add_thread_info(ph, pthread_id, lwp_id) != NULL; ++} ++ ++#if defined(__FreeBSD__) && __FreeBSD_version < 701000 + /* +- * splits a string _str_ into substrings with delimiter _delim_ by replacing old * delimiters with _new_delim_ (ideally, '\0'). the address of each substring +- * is stored in array _ptrs_ as the return value. the maximum capacity of _ptrs_ * array is specified by parameter _n_. +- * RETURN VALUE: total number of substrings (always <= _n_) +- * NOTE: string _str_ is modified if _delim_!=_new_delim_ ++ * TEXT_START_ADDR from binutils/ld/emulparams/.sh ++ * Not the most robust but good enough. + */ +-static int split_n_str(char * str, int n, char ** ptrs, char delim, char new_delim) +-{ +- int i; +- for(i = 0; i < n; i++) ptrs[i] = NULL; +- if (str == NULL || n < 1 ) return 0; + +- i = 0; ++#if defined(amd64) || defined(x86_64) ++#define TEXT_START_ADDR 0x400000 ++#elif defined(i386) ++#define TEXT_START_ADDR 0x8048000 ++#else ++#error TEXT_START_ADDR not defined ++#endif + +- // skipping leading blanks +- while(*str&&*str==delim) str++; ++#define BUF_SIZE (PATH_MAX + NAME_MAX + 1) + +- while(*str&&ip_type == PT_DYNAMIC) ++ break; ++ } ++ ++ if (i >= ehdr.e_phnum) { ++ print_debug("PT_DYNAMIC section not found!\n"); ++ free(phdrs); ++ return (0); ++ } ++ ++ /* allocate space and read in ELF_DYN headers */ ++ ++ dyn_addr = phdr->p_vaddr; ++ hdrs_size = phdr->p_memsz; ++ free(phdrs); ++ ++ if ((dyns = malloc(hdrs_size)) == NULL) ++ return (0); ++ ++ if (process_read_data(ph, dyn_addr, (char *)dyns, hdrs_size) != true) { ++ print_debug("process_read_data failed for dyn_addr %p\n", dyn_addr); ++ free(dyns); ++ return (0); ++ } ++ ++ /* find DT_DEBUG */ ++ ++ dyn = dyns; ++ while (dyn->d_tag != DT_DEBUG && dyn->d_tag != DT_NULL) { ++ dyn++; ++ } ++ ++ if (dyn->d_tag != DT_DEBUG) { ++ print_debug("failed to find DT_DEBUG\n"); ++ free(dyns); ++ return (0); ++ } ++ ++ /* read struct r_debug into dmap */ ++ ++ dmap_addr = (uintptr_t)dyn->d_un.d_ptr; ++ free(dyns); ++ ++ if (process_read_data(ph, dmap_addr, (char *)&dmap, sizeof(dmap)) != true) { ++ print_debug("process_read_data failed for dmap_addr %p\n", dmap_addr); ++ return (0); ++ } ++ ++ lmap_addr = (uintptr_t)dmap.r_map; ++ ++ return (lmap_addr); + } ++#endif // __FreeBSD__ && __FreeBSD_version < 701000 + + static bool read_lib_info(struct ps_prochandle* ph) { +- char fname[32]; +- char buf[256]; +- FILE *fp = NULL; ++#if defined(__FreeBSD__) && __FreeBSD_version >= 701000 ++ struct kinfo_vmentry *freep, *kve; ++ int i, cnt; + +- sprintf(fname, "/proc/%d/maps", ph->pid); +- fp = fopen(fname, "r"); +- if (fp == NULL) { +- print_debug("can't open /proc/%d/maps file\n", ph->pid); +- return false; ++ freep = kinfo_getvmmap(ph->pid, &cnt); ++ if (freep == NULL) { ++ print_debug("can't get vm map for pid\n", ph->pid); ++ return false; + } + +- while(fgets_no_cr(buf, 256, fp)){ +- char * word[6]; +- int nwords = split_n_str(buf, 6, word, ' ', '\0'); +- if (nwords > 5 && find_lib(ph, word[5]) == false) { +- intptr_t base; +- lib_info* lib; +- sscanf(word[0], "%lx", &base); +- if ((lib = add_lib_info(ph, word[5], (uintptr_t)base)) == NULL) ++ for (i = 0; i < cnt; i++) { ++ kve = &freep[i]; ++ if ((kve->kve_flags & KVME_FLAG_COW) && ++ kve->kve_path != NULL && ++ strlen(kve->kve_path) > 0) { ++ ++ if (find_lib(ph, kve->kve_path) == false) { ++ lib_info* lib; ++ if ((lib = add_lib_info(ph, kve->kve_path, ++ (uintptr_t) kve->kve_start)) == NULL) + continue; // ignore, add_lib_info prints error + +- // we don't need to keep the library open, symtab is already +- // built. Only for core dump we need to keep the fd open. +- close(lib->fd); +- lib->fd = -1; ++ // we don't need to keep the library open, symtab is already ++ // built. Only for core dump we need to keep the fd open. ++ close(lib->fd); ++ lib->fd = -1; ++ } + } + } +- fclose(fp); ++ ++ free(freep); ++ + return true; ++#else ++ char *l_name; ++ struct link_map *lmap; ++ uintptr_t lmap_addr; ++ ++ if ((l_name = malloc(BUF_SIZE)) == NULL) ++ return false; ++ ++ if ((lmap = malloc(sizeof(*lmap))) == NULL) { ++ free(l_name); ++ return false; ++ } ++ ++ lmap_addr = linkmap_addr(ph); ++ ++ if (lmap_addr == 0) { ++ free(l_name); ++ free(lmap); ++ return false; ++ } ++ ++ do { ++ if (process_read_data(ph, lmap_addr, (char *)lmap, sizeof(*lmap)) != true) { ++ print_debug("process_read_data failed for lmap_addr %p\n", lmap_addr); ++ free (l_name); ++ free (lmap); ++ return false; ++ } ++ ++ if (process_read_data(ph, (uintptr_t)lmap->l_name, l_name, ++ BUF_SIZE) != true) { ++ print_debug("process_read_data failed for lmap->l_name %p\n", ++ lmap->l_name); ++ free (l_name); ++ free (lmap); ++ return false; ++ } ++ ++ if (find_lib(ph, l_name) == false) { ++ lib_info* lib; ++ if ((lib = add_lib_info(ph, l_name, ++ (uintptr_t) lmap->l_addr)) == NULL) ++ continue; // ignore, add_lib_info prints error ++ ++ // we don't need to keep the library open, symtab is already ++ // built. Only for core dump we need to keep the fd open. ++ close(lib->fd); ++ lib->fd = -1; ++ } ++ lmap_addr = (uintptr_t)lmap->l_next; ++ } while (lmap->l_next != NULL); ++ ++ free (l_name); ++ free (lmap); ++ ++ return true; ++#endif + } + + // detach a given pid + static bool ptrace_detach(pid_t pid) { +- if (pid && ptrace(PTRACE_DETACH, pid, NULL, NULL) < 0) { ++ if (pid && ptrace(PT_DETACH, pid, (caddr_t)1, 0) < 0) { + print_debug("ptrace(PTRACE_DETACH, ..) failed for %d\n", pid); + return false; + } else { + return true; +- } ++ } + } + +-// detach all pids of a ps_prochandle +-static void detach_all_pids(struct ps_prochandle* ph) { +- thread_info* thr = ph->threads; +- while (thr) { +- ptrace_detach(thr->lwp_id); +- thr = thr->next; +- } +-} +- + static void process_cleanup(struct ps_prochandle* ph) { +- detach_all_pids(ph); ++ ptrace_detach(ph->pid); + } + + static ps_prochandle_ops process_ops = { + .release= process_cleanup, + .p_pread= process_read_data, + .p_pwrite= process_write_data, +- .get_lwp_regs= process_get_lwp_regs ++ .get_lwp_regs= process_get_lwp_regs, ++ .get_lwp_info= process_get_lwp_info + }; + + // attach to the process. One and only one exposed stuff +@@ -321,21 +431,14 @@ struct ps_prochandle* Pgrab(pid_t pid) { + // read library info and symbol tables, must do this before attaching threads, + // as the symbols in the pthread library will be used to figure out + // the list of threads within the same process. +- read_lib_info(ph); +- ++ if (read_lib_info(ph) != true) { ++ ptrace_detach(pid); ++ free(ph); ++ return NULL; ++ } ++ + // read thread info + read_thread_info(ph, add_new_thread); + +- // attach to the threads +- thr = ph->threads; +- while (thr) { +- // don't attach to the main thread again +- if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id) != true) { +- // even if one attach fails, we get return NULL +- Prelease(ph); +- return NULL; +- } +- thr = thr->next; +- } + return ph; + } diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_salibelf_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_salibelf_c new file mode 100644 index 00000000000..4ac518a7c48 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_salibelf_c @@ -0,0 +1,11 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_salibelf_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/salibelf.c.orig Tue Jun 2 13:08:38 2009 ++++ hotspot/agent/src/os/bsd/salibelf.c Tue Jun 2 13:08:43 2009 +@@ -25,6 +25,7 @@ + #include "salibelf.h" + #include + #include ++#include + + extern void print_debug(const char*,...); + diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_symtab_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_symtab_c new file mode 100644 index 00000000000..6c6ba9335c9 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_symtab_c @@ -0,0 +1,67 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_symtab_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/symtab.c.orig Tue Jun 2 13:08:54 2009 ++++ hotspot/agent/src/os/bsd/symtab.c Tue Jun 2 13:09:00 2009 +@@ -23,10 +23,10 @@ + */ + + #include +-#include + #include + #include + #include ++#include "hsearch_r.h" + #include "symtab.h" + #include "salibelf.h" + +@@ -56,7 +56,6 @@ typedef struct symtab { + // read symbol table from given fd. + struct symtab* build_symtab(int fd) { + ELF_EHDR ehdr; +- char *names = NULL; + struct symtab* symtab = NULL; + + // Reading of elf header +@@ -65,7 +64,9 @@ struct symtab* build_symtab(int fd) { + ELF_SHDR* shbuf = NULL; + ELF_SHDR* cursct = NULL; + ELF_PHDR* phbuf = NULL; +- ELF_PHDR* phdr = NULL; ++ int symtab_found = 0; ++ int dynsym_found = 0; ++ uint32_t symsection = SHT_SYMTAB; + + uintptr_t baseaddr = (uintptr_t)-1; + +@@ -90,18 +91,30 @@ struct symtab* build_symtab(int fd) { + + for (cursct = shbuf, cnt = 0; cnt < ehdr.e_shnum; cnt++) { + scn_cache[cnt].c_shdr = cursct; +- if (cursct->sh_type == SHT_SYMTAB || cursct->sh_type == SHT_STRTAB) { ++ if (cursct->sh_type == SHT_SYMTAB || ++ cursct->sh_type == SHT_STRTAB || ++ cursct->sh_type == SHT_DYNSYM) { + if ( (scn_cache[cnt].c_data = read_section_data(fd, &ehdr, cursct)) == NULL) { + goto quit; + } + } ++ ++ if (cursct->sh_type == SHT_SYMTAB) ++ symtab_found++; ++ ++ if (cursct->sh_type == SHT_DYNSYM) ++ dynsym_found++; ++ + cursct++; + } + ++ if (!symtab_found && dynsym_found) ++ symsection = SHT_DYNSYM; ++ + for (cnt = 1; cnt < ehdr.e_shnum; cnt++) { + ELF_SHDR *shdr = scn_cache[cnt].c_shdr; + +- if (shdr->sh_type == SHT_SYMTAB) { ++ if (shdr->sh_type == symsection) { + ELF_SYM *syms; + int j, n, rslt; + size_t size; diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_test_c b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_test_c new file mode 100644 index 00000000000..2818422abb2 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_os_bsd_test_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-hotspot_agent_src_os_bsd_test_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/os/bsd/test.c.orig Tue Jun 2 13:09:43 2009 ++++ hotspot/agent/src/os/bsd/test.c Tue Jun 2 13:09:50 2009 +@@ -44,7 +44,7 @@ int main(int argc, char** argv) { + } + + default: { +- printf("usage %s or %s \n"); ++ fprintf(stderr, "usage %s or %s \n", argv[0], argv[0]); + return 1; + } + } diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_HotSpotAgent_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_HotSpotAgent_java new file mode 100644 index 00000000000..6c72d14463e --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_HotSpotAgent_java @@ -0,0 +1,72 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_HotSpotAgent_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java.orig Tue Jun 2 12:33:16 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java Tue Jun 2 12:33:28 2009 +@@ -28,6 +28,7 @@ import java.io.PrintStream; + import java.net.*; + import java.rmi.*; + import sun.jvm.hotspot.debugger.*; ++import sun.jvm.hotspot.debugger.bsd.*; + import sun.jvm.hotspot.debugger.dbx.*; + import sun.jvm.hotspot.debugger.proc.*; + import sun.jvm.hotspot.debugger.remote.*; +@@ -337,6 +338,8 @@ public class HotSpotAgent { + setupDebuggerWin32(); + } else if (os.equals("linux")) { + setupDebuggerLinux(); ++ } else if (os.equals("bsd")) { ++ setupDebuggerBsd(); + } else { + // Add support for more operating systems here + throw new DebuggerException("Operating system " + os + " not yet supported"); +@@ -392,6 +395,10 @@ public class HotSpotAgent { + db = new HotSpotTypeDataBase(machDesc, + new LinuxVtblAccess(debugger, jvmLibNames), + debugger, jvmLibNames); ++ } else if (os.equals("bsd")) { ++ db = new HotSpotTypeDataBase(machDesc, ++ new BsdVtblAccess(debugger, jvmLibNames), ++ debugger, jvmLibNames); + } else { + throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess yet)"); + } +@@ -557,6 +564,8 @@ public class HotSpotAgent { + setupJVMLibNamesWin32(); + } else if (os.equals("linux")) { + setupJVMLibNamesLinux(); ++ } else if (os.equals("bsd")) { ++ setupJVMLibNamesBsd(); + } else { + throw new RuntimeException("Unknown OS type"); + } +@@ -635,6 +644,31 @@ public class HotSpotAgent { + } + + private void setupJVMLibNamesLinux() { ++ jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so" }; ++ } ++ ++ // ++ // BSD ++ // ++ ++ private void setupDebuggerBsd() { ++ setupJVMLibNamesBsd(); ++ ++ if (cpu.equals("x86")) { ++ machDesc = new MachineDescriptionIntelX86(); ++ } else if (cpu.equals("amd64")) { ++ machDesc = new MachineDescriptionAMD64(); ++ } else { ++ throw new DebuggerException("BSD only supported on x86/amd64"); ++ } ++ ++ BsdDebuggerLocal dbg = new BsdDebuggerLocal(machDesc, !isServer); ++ debugger = dbg; ++ ++ attachDebugger(); ++ } ++ ++ private void setupJVMLibNamesBsd() { + jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so" }; + } + diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_bugspot_BugSpotAgent_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_bugspot_BugSpotAgent_java new file mode 100644 index 00000000000..fdd80958bfe --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_bugspot_BugSpotAgent_java @@ -0,0 +1,74 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_bugspot_BugSpotAgent_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java.orig Tue Jun 2 12:34:28 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java Tue Jun 2 12:34:41 2009 +@@ -29,6 +29,7 @@ import java.net.*; + import java.rmi.*; + import sun.jvm.hotspot.*; + import sun.jvm.hotspot.debugger.*; ++import sun.jvm.hotspot.debugger.bsd.*; + import sun.jvm.hotspot.debugger.dbx.*; + import sun.jvm.hotspot.debugger.proc.*; + import sun.jvm.hotspot.debugger.cdbg.*; +@@ -516,6 +517,8 @@ public class BugSpotAgent { + setupDebuggerWin32(); + } else if (os.equals("linux")) { + setupDebuggerLinux(); ++ } else if (os.equals("bsd")) { ++ setupDebuggerBsd(); + } else { + // Add support for more operating systems here + throw new DebuggerException("Operating system " + os + " not yet supported"); +@@ -567,6 +570,9 @@ public class BugSpotAgent { + } else if (os.equals("linux")) { + db = new HotSpotTypeDataBase(machDesc, new LinuxVtblAccess(debugger, jvmLibNames), + debugger, jvmLibNames); ++ } else if (os.equals("bsd")) { ++ db = new HotSpotTypeDataBase(machDesc, new BsdVtblAccess(debugger, jvmLibNames), ++ debugger, jvmLibNames); + } else { + throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess implemented yet)"); + } +@@ -739,6 +745,8 @@ public class BugSpotAgent { + setupJVMLibNamesWin32(); + } else if (os.equals("linux")) { + setupJVMLibNamesLinux(); ++ } else if (os.equals("bsd")) { ++ setupJVMLibNamesBsd(); + } else { + throw new RuntimeException("Unknown OS type"); + } +@@ -818,6 +826,34 @@ public class BugSpotAgent { + } + + private void setupJVMLibNamesLinux() { ++ // same as solaris ++ setupJVMLibNamesSolaris(); ++ } ++ ++ // ++ // BSD ++ // ++ ++ private void setupDebuggerBsd() { ++ setupJVMLibNamesBsd(); ++ ++ if (cpu.equals("x86")) { ++ machDesc = new MachineDescriptionIntelX86(); ++ } else if (cpu.equals("amd64")) { ++ machDesc = new MachineDescriptionAMD64(); ++ } else { ++ throw new DebuggerException("Bsd only supported on x86/amd64"); ++ } ++ ++ // Note we do not use a cache for the local debugger in server ++ // mode; it will be taken care of on the client side (once remote ++ // debugging is implemented). ++ ++ debugger = new BsdDebuggerLocal(machDesc, !isServer); ++ attachDebugger(); ++ } ++ ++ private void setupJVMLibNamesBsd() { + // same as solaris + setupJVMLibNamesSolaris(); + } diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdCDebugger_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdCDebugger_java new file mode 100644 index 00000000000..831075cede4 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdCDebugger_java @@ -0,0 +1,28 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdCDebugger_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java.orig Tue Jun 2 13:10:15 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java Tue Jun 2 13:10:31 2009 +@@ -30,10 +30,8 @@ import sun.jvm.hotspot.debugger.*; + import sun.jvm.hotspot.debugger.cdbg.*; + import sun.jvm.hotspot.debugger.x86.*; + import sun.jvm.hotspot.debugger.amd64.*; +-import sun.jvm.hotspot.debugger.sparc.*; + import sun.jvm.hotspot.debugger.bsd.x86.*; + import sun.jvm.hotspot.debugger.bsd.amd64.*; +-import sun.jvm.hotspot.debugger.bsd.sparc.*; + import sun.jvm.hotspot.utilities.*; + + class BsdCDebugger implements CDebugger { +@@ -99,13 +97,6 @@ class BsdCDebugger implements CDebugger { + Address pc = context.getRegisterAsAddress(AMD64ThreadContext.RIP); + if (pc == null) return null; + return new BsdAMD64CFrame(dbg, rbp, pc); +- } else if (cpu.equals("sparc")) { +- SPARCThreadContext context = (SPARCThreadContext) thread.getContext(); +- Address sp = context.getRegisterAsAddress(SPARCThreadContext.R_SP); +- if (sp == null) return null; +- Address pc = context.getRegisterAsAddress(SPARCThreadContext.R_O7); +- if (pc == null) return null; +- return new BsdSPARCCFrame(dbg, sp, pc, BsdDebuggerLocal.getAddressSize()); + } else { + throw new DebuggerException(cpu + " is not yet supported"); + } diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdThreadContextFactory_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdThreadContextFactory_java new file mode 100644 index 00000000000..044019ac752 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdThreadContextFactory_java @@ -0,0 +1,24 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_debugger_bsd_BsdThreadContextFactory_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java.orig Tue Jun 2 13:10:53 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java Tue Jun 2 13:11:11 2009 +@@ -26,9 +26,7 @@ package sun.jvm.hotspot.debugger.bsd; + + import sun.jvm.hotspot.debugger.*; + import sun.jvm.hotspot.debugger.bsd.amd64.*; +-import sun.jvm.hotspot.debugger.bsd.ia64.*; + import sun.jvm.hotspot.debugger.bsd.x86.*; +-import sun.jvm.hotspot.debugger.bsd.sparc.*; + + class BsdThreadContextFactory { + static ThreadContext createThreadContext(BsdDebugger dbg) { +@@ -37,10 +35,6 @@ class BsdThreadContextFactory { + return new BsdX86ThreadContext(dbg); + } else if (cpu.equals("amd64")) { + return new BsdAMD64ThreadContext(dbg); +- } else if (cpu.equals("ia64")) { +- return new BsdIA64ThreadContext(dbg); +- } else if (cpu.equals("sparc")) { +- return new BsdSPARCThreadContext(dbg); + } else { + throw new RuntimeException("cpu " + cpu + " is not yet supported"); + } diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_Threads_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_Threads_java new file mode 100644 index 00000000000..acffbbbf2a2 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_Threads_java @@ -0,0 +1,26 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_Threads_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java.orig Tue Jun 2 12:35:39 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java Tue Jun 2 12:35:52 2009 +@@ -37,6 +37,8 @@ import sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaT + import sun.jvm.hotspot.runtime.linux_ia64.LinuxIA64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess; ++import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess; ++import sun.jvm.hotspot.runtime.bsd_amd64.BsdAMD64JavaThreadPDAccess; + import sun.jvm.hotspot.utilities.*; + + public class Threads { +@@ -90,7 +92,12 @@ public class Threads { + } else if (cpu.equals("sparc")) { + access = new LinuxSPARCJavaThreadPDAccess(); + } +- ++ } else if (os.equals("bsd")) { ++ if (cpu.equals("x86")) { ++ access = new BsdX86JavaThreadPDAccess(); ++ } else if (cpu.equals("amd64")) { ++ access = new BsdAMD64JavaThreadPDAccess(); ++ } + } + + if (access == null) { diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_BsdSignals_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_BsdSignals_java new file mode 100644 index 00000000000..a15287edb0f --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_BsdSignals_java @@ -0,0 +1,63 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_BsdSignals_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java.orig Tue Jun 2 13:11:43 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java Tue Jun 2 13:11:54 2009 +@@ -28,37 +28,36 @@ public class BsdSignals { + private static String[] signalNames = { + "", /* No signal 0 */ + "SIGHUP", /* hangup */ +- "SIGINT", /* interrupt (rubout) */ +- "SIGQUIT", /* quit (ASCII FS) */ +- "SIGILL", /* illegal instruction (not reset when caught) */ ++ "SIGINT", /* interrupt */ ++ "SIGQUIT", /* quit */ ++ "SIGILL", /* illegal instr. (not reset when caught) */ + "SIGTRAP", /* trace trap (not reset when caught) */ +- "SIGABRT", /* used by abort, replace SIGIOT in the future */ +- "SIGIOT", +- "SIGBUS", ++ "SIGABRT", /* abort() */ ++ "SIGEMT", /* EMT instruction */ + "SIGFPE", /* floating point exception */ + "SIGKILL", /* kill (cannot be caught or ignored) */ +- "SIGUSR1", /* user defined signal 1 */ ++ "SIGBUS", /* bus error */ + "SIGSEGV", /* segmentation violation */ +- "SIGUSR2", /* user defined signal 2 */ ++ "SIGSYS", /* non-existent system call invoked */ + "SIGPIPE", /* write on a pipe with no one to read it */ + "SIGALRM", /* alarm clock */ + "SIGTERM", /* software termination signal from kill */ +- "SIGSTKFLT", +- "SIGCHLD", /* child status change alias */ +- "SIGCONT", /* stopped process has been continued */ +- "SIGSTOP", /* stop (cannot be caught or ignored) */ +- "SIGTSTP", /* user stop requested from tty */ +- "SIGTTIN", /* background tty read attempted */ +- "SIGTTOU", /* background tty write attempted */ +- "SIGURG", /* urgent socket condition */ +- "SIGXCPU", /* exceeded cpu limit */ ++ "SIGURG", /* urgent condition on IO channel */ ++ "SIGSTOP", /* sendable stop signal not from tty */ ++ "SIGTSTP", /* stop signal from tty */ ++ "SIGCONT", /* continue a stopped process */ ++ "SIGCHLD", /* to parent on child stop or exit */ ++ "SIGTTIN", /* to readers pgrp upon background tty read */ ++ "SIGTTOU", /* like TTIN if (tp->t_local<OSTOP) */ ++ "SIGIO", /* input/output possible signal */ ++ "SIGXCPU", /* exceeded CPU time limit */ + "SIGXFSZ", /* exceeded file size limit */ +- "SIGVTALRM", /* virtual timer expired */ +- "SIGPROF", /* profiling timer expired */ +- "SIGWINCH", /* window size change */ +- "SIGPOLL", /* pollable event occured */ +- "SIGPWR", /* power-fail restart */ +- "SIGSYS" ++ "SIGVTALRM", /* virtual time alarm */ ++ "SIGPROF", /* profiling time alarm */ ++ "SIGWINCH", /* window size changes */ ++ "SIGINFO", /* information request */ ++ "SIGUSR1", /* user defined signal 1 */ ++ "SIGUSR2" /* user defined signal 2 */ + }; + + public static String getSignalName(int sigNum) { diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_x86_BsdSignals_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_x86_BsdSignals_java new file mode 100644 index 00000000000..67f822c3d38 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_x86_BsdSignals_java @@ -0,0 +1,63 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_runtime_bsd_x86_BsdSignals_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java.orig Tue Jun 2 13:12:16 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java Tue Jun 2 13:12:25 2009 +@@ -28,37 +28,36 @@ public class BsdSignals { + private static String[] signalNames = { + "", /* No signal 0 */ + "SIGHUP", /* hangup */ +- "SIGINT", /* interrupt (rubout) */ +- "SIGQUIT", /* quit (ASCII FS) */ +- "SIGILL", /* illegal instruction (not reset when caught) */ ++ "SIGINT", /* interrupt */ ++ "SIGQUIT", /* quit */ ++ "SIGILL", /* illegal instr. (not reset when caught) */ + "SIGTRAP", /* trace trap (not reset when caught) */ +- "SIGABRT", /* used by abort, replace SIGIOT in the future */ +- "SIGIOT", +- "SIGBUS", ++ "SIGABRT", /* abort() */ ++ "SIGEMT", /* EMT instruction */ + "SIGFPE", /* floating point exception */ + "SIGKILL", /* kill (cannot be caught or ignored) */ +- "SIGUSR1", /* user defined signal 1 */ ++ "SIGBUS", /* bus error */ + "SIGSEGV", /* segmentation violation */ +- "SIGUSR2", /* user defined signal 2 */ ++ "SIGSYS", /* non-existent system call invoked */ + "SIGPIPE", /* write on a pipe with no one to read it */ + "SIGALRM", /* alarm clock */ + "SIGTERM", /* software termination signal from kill */ +- "SIGSTKFLT", +- "SIGCHLD", /* child status change alias */ +- "SIGCONT", /* stopped process has been continued */ +- "SIGSTOP", /* stop (cannot be caught or ignored) */ +- "SIGTSTP", /* user stop requested from tty */ +- "SIGTTIN", /* background tty read attempted */ +- "SIGTTOU", /* background tty write attempted */ +- "SIGURG", /* urgent socket condition */ +- "SIGXCPU", /* exceeded cpu limit */ ++ "SIGURG", /* urgent condition on IO channel */ ++ "SIGSTOP", /* sendable stop signal not from tty */ ++ "SIGTSTP", /* stop signal from tty */ ++ "SIGCONT", /* continue a stopped process */ ++ "SIGCHLD", /* to parent on child stop or exit */ ++ "SIGTTIN", /* to readers pgrp upon background tty read */ ++ "SIGTTOU", /* like TTIN if (tp->t_local<OSTOP) */ ++ "SIGIO", /* input/output possible signal */ ++ "SIGXCPU", /* exceeded CPU time limit */ + "SIGXFSZ", /* exceeded file size limit */ +- "SIGVTALRM", /* virtual timer expired */ +- "SIGPROF", /* profiling timer expired */ +- "SIGWINCH", /* window size change */ +- "SIGPOLL", /* pollable event occured */ +- "SIGPWR", /* power-fail restart */ +- "SIGSYS" ++ "SIGVTALRM", /* virtual time alarm */ ++ "SIGPROF", /* profiling time alarm */ ++ "SIGWINCH", /* window size changes */ ++ "SIGINFO", /* information request */ ++ "SIGUSR1", /* user defined signal 1 */ ++ "SIGUSR2" /* user defined signal 2 */ + }; + + public static String getSignalName(int sigNum) { diff --git a/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_utilities_PlatformInfo_java b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_utilities_PlatformInfo_java new file mode 100644 index 00000000000..c96c70e59fd --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_utilities_PlatformInfo_java @@ -0,0 +1,18 @@ +$OpenBSD: patch-hotspot_agent_src_share_classes_sun_jvm_hotspot_utilities_PlatformInfo_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java.orig Tue Jun 2 12:36:27 2009 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java Tue Jun 2 12:36:38 2009 +@@ -37,6 +37,14 @@ public class PlatformInfo { + return "solaris"; + } else if (os.equals("Linux")) { + return "linux"; ++ } else if (os.equals("FreeBSD")) { ++ return "bsd"; ++ } else if (os.equals("NetBSD")) { ++ return "bsd"; ++ } else if (os.equals("OpenBSD")) { ++ return "bsd"; ++ } else if (os.equals("Darwin")) { ++ return "bsd"; + } else if (os.startsWith("Windows")) { + return "win32"; + } else { diff --git a/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_defs_make b/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_defs_make index 9716014f52a..85c6a5fb55e 100644 --- a/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_defs_make +++ b/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_defs_make @@ -1,6 +1,6 @@ -$OpenBSD: patch-hotspot_make_bsd_makefiles_defs_make,v 1.2 2009/05/23 03:03:24 kurt Exp $ ---- hotspot/make/bsd/makefiles/defs.make.orig Sat May 16 23:21:09 2009 -+++ hotspot/make/bsd/makefiles/defs.make Mon May 18 08:17:30 2009 +$OpenBSD: patch-hotspot_make_bsd_makefiles_defs_make,v 1.3 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/make/bsd/makefiles/defs.make.orig Sat May 30 11:21:10 2009 ++++ hotspot/make/bsd/makefiles/defs.make Tue Jun 2 12:37:10 2009 @@ -28,6 +28,14 @@ SLASH_JAVA ?= /java @@ -63,7 +63,7 @@ $OpenBSD: patch-hotspot_make_bsd_makefiles_defs_make,v 1.2 2009/05/23 03:03:24 k endif JDK_INCLUDE_SUBDIR=bsd -@@ -95,19 +113,11 @@ VM_DEBUG=jvmg +@@ -95,19 +113,13 @@ VM_DEBUG=jvmg EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt @@ -87,3 +87,5 @@ $OpenBSD: patch-hotspot_make_bsd_makefiles_defs_make,v 1.2 2009/05/23 03:03:24 k + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.$(LIBRARY_SUFFIX) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) endif ++EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) ++EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar diff --git a/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_launcher_make b/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_launcher_make new file mode 100644 index 00000000000..1fb35a8efe7 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_launcher_make @@ -0,0 +1,12 @@ +$OpenBSD: patch-hotspot_make_bsd_makefiles_launcher_make,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/make/bsd/makefiles/launcher.make.orig Tue Jun 2 12:37:33 2009 ++++ hotspot/make/bsd/makefiles/launcher.make Tue Jun 2 12:37:40 2009 +@@ -44,7 +44,7 @@ ifeq ($(LINK_INTO),AOUT) + LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) + else + LAUNCHER.o = launcher.o +- LFLAGS_LAUNCHER += -L `pwd` ++ LFLAGS_LAUNCHER += -L`pwd` + LIBS_LAUNCHER += -l$(JVM) $(LIBS) + endif + diff --git a/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_saproc_make b/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_saproc_make index ec34e5a2b5c..bb4420b2716 100644 --- a/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_saproc_make +++ b/devel/jdk/1.7/patches/patch-hotspot_make_bsd_makefiles_saproc_make @@ -1,7 +1,7 @@ -$OpenBSD: patch-hotspot_make_bsd_makefiles_saproc_make,v 1.2 2009/05/23 03:03:24 kurt Exp $ ---- hotspot/make/bsd/makefiles/saproc.make.orig Fri May 15 16:25:29 2009 -+++ hotspot/make/bsd/makefiles/saproc.make Fri May 15 17:08:59 2009 -@@ -26,8 +26,13 @@ +$OpenBSD: patch-hotspot_make_bsd_makefiles_saproc_make,v 1.3 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/make/bsd/makefiles/saproc.make.orig Sat May 30 11:21:11 2009 ++++ hotspot/make/bsd/makefiles/saproc.make Tue Jun 2 12:37:59 2009 +@@ -26,18 +26,30 @@ # libsaproc[_g].so: serviceability agent SAPROC = saproc$(G_SUFFIX) @@ -16,17 +16,46 @@ $OpenBSD: patch-hotspot_make_bsd_makefiles_saproc_make,v 1.2 2009/05/23 03:03:24 AGENT_DIR = $(GAMMADIR)/agent SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) -@@ -43,11 +48,11 @@ SAMAPFILE = $(SASRCDIR)/mapfile - DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) ++ifeq ($(OS_VENDOR), FreeBSD) + SASRCFILES = $(SASRCDIR)/salibelf.c \ + $(SASRCDIR)/symtab.c \ + $(SASRCDIR)/libproc_impl.c \ + $(SASRCDIR)/ps_proc.c \ + $(SASRCDIR)/ps_core.c \ ++ $(SASRCDIR)/hsearch_r.c \ + $(SASRCDIR)/BsdDebuggerLocal.c ++SALIBS = -lutil -lthread_db ++else ++SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c ++SALIBS = ++endif --# if $(AGENT_DIR) does not exist, we don't build SA -+# if $(SASRCDIR) does not exist, we don't build SA - # also, we don't build SA on Itanium. + SAMAPFILE = $(SASRCDIR)/mapfile - checkAndBuildSA: -- $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \ -+ $(QUIETLY) if [ -d $(SASRCDIR) -a "$(SRCARCH)" != "ia64" ] ; then \ +@@ -51,7 +63,10 @@ checkAndBuildSA: $(MAKE) -f vm.make $(LIBSAPROC); \ fi +-SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) ++ifneq ($(OS_VENDOR), Darwin) ++SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) ++endif ++SA_LFLAGS += $(LDFLAGS_HASH_STYLE) + + $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) + $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ +@@ -64,11 +79,11 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) + -I$(SASRCDIR) \ + -I$(GENERATED) \ + -I$(BOOT_JAVA_HOME)/include \ +- -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \ ++ -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") \ + $(SASRCFILES) \ + $(SA_LFLAGS) \ + -o $@ \ +- -lthread_db ++ $(SALIBS) + + install_saproc: checkAndBuildSA + $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ diff --git a/devel/jdk/1.7/patches/patch-hotspot_make_sa_files b/devel/jdk/1.7/patches/patch-hotspot_make_sa_files new file mode 100644 index 00000000000..dda803ae9d7 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-hotspot_make_sa_files @@ -0,0 +1,23 @@ +$OpenBSD: patch-hotspot_make_sa_files,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/make/sa.files.orig Tue Jun 2 12:38:13 2009 ++++ hotspot/make/sa.files Tue Jun 2 12:38:18 2009 +@@ -50,6 +50,9 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/code/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/compiler/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/amd64/*.java \ ++$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/*.java \ ++$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/amd64/*.java \ ++$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/x86/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \ +@@ -95,6 +98,9 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/oops/*.java + AGENT_FILES2 = \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/amd64/*.java \ ++$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd/*.java \ ++$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_amd64/*.java \ ++$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_x86/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/ia64/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux/*.java \ + $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_amd64/*.java \ diff --git a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp index 2bdabc666bd..9e09b1d845e 100644 --- a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp +++ b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp @@ -1,7 +1,7 @@ -$OpenBSD: patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp,v 1.3 2009/01/04 23:25:16 kurt Exp $ ---- hotspot/src/os/bsd/vm/hpi_bsd.hpp.orig Sat Aug 2 16:12:29 2008 -+++ hotspot/src/os/bsd/vm/hpi_bsd.hpp Sat Aug 2 16:12:52 2008 -@@ -36,26 +36,22 @@ +$OpenBSD: patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp,v 1.4 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/src/os/bsd/vm/hpi_bsd.hpp.orig Tue Jun 2 13:44:43 2009 ++++ hotspot/src/os/bsd/vm/hpi_bsd.hpp Wed Jun 3 16:06:36 2009 +@@ -36,7 +36,7 @@ // HPI_FileInterface inline int hpi::close(int fd) { @@ -10,20 +10,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp,v 1.3 2009/01/04 23:25:16 kurt } inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) { -- size_t res; -- RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res); -- return res; -+ INTERRUPTIBLE_RETURN_INT(::read(fd, buf, (size_t) nBytes), os::Bsd::clear_interrupted); - } - - inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) { -- size_t res; -- RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res); -- return res; -+ INTERRUPTIBLE_RETURN_INT(::write(fd, buf, (size_t) nBytes), os::Bsd::clear_interrupted); - } - - +@@ -55,7 +55,7 @@ inline size_t hpi::write(int fd, const void *buf, unsi // HPI_SocketInterface inline int hpi::socket_close(int fd) { @@ -32,82 +19,19 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp,v 1.3 2009/01/04 23:25:16 kurt } inline int hpi::socket(int domain, int type, int protocol) { -@@ -63,11 +59,11 @@ inline int hpi::socket(int domain, int type, int proto - } - - inline int hpi::recv(int fd, char *buf, int nBytes, int flags) { -- RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags)); -+ INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags), os::Bsd::clear_interrupted); - } - - inline int hpi::send(int fd, char *buf, int nBytes, int flags) { -- RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags)); -+ INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags), os::Bsd::clear_interrupted); - } - - inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) { -@@ -83,11 +79,12 @@ inline int hpi::timeout(int fd, long timeout) { - - for(;;) { - struct pollfd pfd; -+ int res; - - pfd.fd = fd; - pfd.events = POLLIN | POLLERR; - -- int res = ::poll(&pfd, 1, timeout); -+ INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Bsd::clear_interrupted); - - if (res == OS_ERR && errno == EINTR) { - -@@ -111,7 +108,26 @@ inline int hpi::listen(int fd, int count) { - } - - inline int hpi::connect(int fd, struct sockaddr *him, int len) { -- RESTARTABLE_RETURN_INT(::connect(fd, him, len)); -+ do { -+ int _result; -+ INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result, -+ os::Bsd::clear_interrupted); -+ -+ // Depending on when thread interruption is reset, _result could be -+ // one of two values when errno == EINTR -+ -+ if (((_result == OS_INTRPT) || (_result == OS_ERR)) && (errno == EINTR)) { -+ /* restarting a connect() changes its errno semantics */ -+ INTERRUPTIBLE(::connect(fd, him, len), _result, -+ os::Bsd::clear_interrupted); -+ /* undo these changes */ -+ if (_result == OS_ERR) { -+ if (errno == EALREADY) errno = EINPROGRESS; /* fall through */ -+ else if (errno == EISCONN) { errno = 0; return OS_OK; } -+ } -+ } -+ return _result; -+ } while(false); - } - - inline int hpi::accept(int fd, struct sockaddr *him, int *len) { -@@ -122,26 +138,32 @@ inline int hpi::accept(int fd, struct sockaddr *him, i +@@ -120,9 +120,9 @@ inline int hpi::accept(int fd, struct sockaddr *him, i + // fetch it's value, this cast is safe for now. The java.net group + // may need and want to change this interface someday if socklen_t goes // to 64 bits on some platform that we support. - // Bsd doc says this can't return EINTR, unlike accept() on Solaris +- // Bsd doc says this can't return EINTR, unlike accept() on Solaris ++ // At least OpenBSD and FreeBSD can return EINTR from accept. - return ::accept(fd, him, (socklen_t *)len); -+ if (fd < 0) -+ return OS_ERR; -+ INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him, (socklen_t*) len), os::Bsd::clear_interrupted); ++ RESTARTABLE_RETURN_INT(::accept(fd, him, (socklen_t *)len)); } inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags, - sockaddr *from, int *fromlen) { -- RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen)); -+ INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen), os::Bsd::clear_interrupted); - } - - inline int hpi::sendto(int fd, char *buf, int len, int flags, - struct sockaddr *to, int tolen) { -- RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen)); -+ INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, (unsigned int) flags, to, tolen),os::Bsd::clear_interrupted); +@@ -136,12 +136,16 @@ inline int hpi::sendto(int fd, char *buf, int len, int } inline int hpi::socket_available(int fd, jint *pbytes) { @@ -127,12 +51,3 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_hpi_bsd_hpp,v 1.3 2009/01/04 23:25:16 kurt } -@@ -168,7 +190,7 @@ HPIDECL(bind, "bind", _socket, Bind, - (fd, him, len)); - */ - inline int hpi::bind(int fd, struct sockaddr *him, int len){ -- return ::bind(fd, him, len); -+ INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),os::Bsd::clear_interrupted); - } - - /* diff --git a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_osThread_bsd_hpp b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_osThread_bsd_hpp index 23bd1b42366..c5b5a3cc5ad 100644 --- a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_osThread_bsd_hpp +++ b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_osThread_bsd_hpp @@ -1,6 +1,6 @@ -$OpenBSD: patch-hotspot_src_os_bsd_vm_osThread_bsd_hpp,v 1.3 2008/03/19 18:05:43 kurt Exp $ ---- hotspot/src/os/bsd/vm/osThread_bsd.hpp.orig Wed Nov 7 12:41:29 2007 -+++ hotspot/src/os/bsd/vm/osThread_bsd.hpp Wed Nov 7 12:41:35 2007 +$OpenBSD: patch-hotspot_src_os_bsd_vm_osThread_bsd_hpp,v 1.4 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/src/os/bsd/vm/osThread_bsd.hpp.orig Sat May 30 10:11:57 2009 ++++ hotspot/src/os/bsd/vm/osThread_bsd.hpp Sat May 30 10:14:49 2009 @@ -36,6 +36,12 @@ private: @@ -58,24 +58,3 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_osThread_bsd_hpp,v 1.3 2008/03/19 18:05:43 pthread_t pthread_id() const { return _pthread_id; } -@@ -120,12 +139,20 @@ - - private: - Monitor* _startThread_lock; // sync parent and child in thread creation -+#ifdef _ALLBSD_SOURCE -+ JavaThreadState _saved_interrupt_thread_state; // the thread state before a system call -- restored afterward -+#endif - - public: - - Monitor* startThread_lock() const { - return _startThread_lock; - } -+ -+#ifdef _ALLBSD_SOURCE -+ JavaThreadState saved_interrupt_thread_state() { return _saved_interrupt_thread_state; } -+ void set_saved_interrupt_thread_state(JavaThreadState state) { _saved_interrupt_thread_state = state; } -+#endif - - // *************************************************************** - // Platform dependent initialization and cleanup diff --git a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_cpp b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_cpp index 342c775198b..06b0894a301 100644 --- a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_cpp +++ b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_cpp @@ -1,6 +1,6 @@ -$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt Exp $ ---- hotspot/src/os/bsd/vm/os_bsd.cpp.orig Wed May 20 17:42:24 2009 -+++ hotspot/src/os/bsd/vm/os_bsd.cpp Wed May 20 18:24:46 2009 +$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.11 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig Sat May 30 10:11:57 2009 ++++ hotspot/src/os/bsd/vm/os_bsd.cpp Sat May 30 10:15:08 2009 @@ -42,18 +42,40 @@ # include # include @@ -68,86 +68,16 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt static jlong initial_time_count=0; -@@ -94,9 +122,76 @@ static pid_t _initial_pid = 0; +@@ -94,8 +122,6 @@ static pid_t _initial_pid = 0; static int SR_signum = SIGUSR2; sigset_t SR_sigset; -/* Used to protect dlsym() calls */ -static pthread_mutex_t dl_mutex; -+#ifdef _ALLBSD_SOURCE -+// XXXBSD: ported from solaris version -+// interruptible infrastructure -+// setup_interruptible saves the thread state before going into an -+// interruptible system call. -+// The saved state is used to restore the thread to -+// its former state whether or not an interrupt is received. -+// Used by classloader os::read -+// hpi calls skip this layer and stay in _thread_in_native -+ -+void os::Bsd::setup_interruptible(JavaThread* thread) { -+ -+ JavaThreadState thread_state = thread->thread_state(); -+ -+ assert(thread_state != _thread_blocked, "Coming from the wrong thread"); -+ assert(thread_state != _thread_in_native, "Native threads skip setup_interruptible"); -+ OSThread* osthread = thread->osthread(); -+ osthread->set_saved_interrupt_thread_state(thread_state); -+ thread->frame_anchor()->make_walkable(thread); -+ ThreadStateTransition::transition(thread, thread_state, _thread_blocked); -+} -+ -+// Version of setup_interruptible() for threads that are already in -+// _thread_blocked. Used by os_sleep(). -+void os::Bsd::setup_interruptible_already_blocked(JavaThread* thread) { -+ thread->frame_anchor()->make_walkable(thread); -+} -+ -+JavaThread* os::Bsd::setup_interruptible() { -+ JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread(); -+ setup_interruptible(thread); -+ return thread; -+} -+ -+#ifdef ASSERT -+ -+JavaThread* os::Bsd::setup_interruptible_native() { -+ JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread(); -+ JavaThreadState thread_state = thread->thread_state(); -+ assert(thread_state == _thread_in_native, "Assumed thread_in_native"); -+ return thread; -+} -+ -+void os::Bsd::cleanup_interruptible_native(JavaThread* thread) { -+ JavaThreadState thread_state = thread->thread_state(); -+ assert(thread_state == _thread_in_native, "Assumed thread_in_native"); -+} -+#endif -+ -+// cleanup_interruptible reverses the effects of setup_interruptible -+// setup_interruptible_already_blocked() does not need any cleanup. -+ -+void os::Bsd::cleanup_interruptible(JavaThread* thread) { -+ OSThread* osthread = thread->osthread(); -+ -+ ThreadStateTransition::transition(thread, _thread_blocked, osthread->saved_interrupt_thread_state()); -+} -+ -+// I/O interruption related counters called in _INTERRUPTIBLE -+ -+void os::Bsd::bump_interrupted_before_count() { -+ RuntimeService::record_interrupted_before_count(); -+} -+ -+void os::Bsd::bump_interrupted_during_count() { -+ RuntimeService::record_interrupted_during_count(); -+} -+#endif -+ //////////////////////////////////////////////////////////////////////////////// // utility functions - -@@ -108,11 +203,16 @@ julong os::available_memory() { +@@ -108,11 +134,16 @@ julong os::available_memory() { } julong os::Bsd::available_memory() { @@ -164,7 +94,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } julong os::physical_memory() { -@@ -160,6 +260,7 @@ bool os::have_special_privileges() { +@@ -160,6 +191,7 @@ bool os::have_special_privileges() { } @@ -172,7 +102,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt #ifndef SYS_gettid // i386: 224, ia64: 1105, amd64: 186, sparc 143 #ifdef __ia64__ -@@ -174,6 +275,7 @@ bool os::have_special_privileges() { +@@ -174,6 +206,7 @@ bool os::have_special_privileges() { #error define gettid for the arch #endif #endif @@ -180,7 +110,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // Cpu architecture string #if defined(IA64) -@@ -193,6 +295,7 @@ static char cpu_arch[] = "sparc"; +@@ -193,6 +226,7 @@ static char cpu_arch[] = "sparc"; #endif @@ -188,7 +118,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // pid_t gettid() // // Returns the kernel thread id of the currently running thread. Kernel -@@ -219,8 +322,48 @@ static bool unsafe_chroot_detected = false; +@@ -219,8 +253,48 @@ static bool unsafe_chroot_detected = false; static const char *unstable_chroot_error = "/proc file system not found.\n" "Java may be unstable running multithreaded in a chroot " "environment on Bsd when /proc filesystem is not mounted."; @@ -237,7 +167,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt _processor_count = sysconf(_SC_NPROCESSORS_CONF); if (_processor_count == 1) { pid_t pid = os::Bsd::gettid(); -@@ -236,6 +379,7 @@ void os::Bsd::initialize_system_info() { +@@ -236,6 +310,7 @@ void os::Bsd::initialize_system_info() { _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); assert(_processor_count > 0, "bsd error"); } @@ -245,7 +175,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt void os::init_system_properties_values() { // char arch[12]; -@@ -279,9 +423,7 @@ void os::init_system_properties_values() { +@@ -279,9 +354,7 @@ void os::init_system_properties_values() { * ... * 7: The default directories, normally /lib and /usr/lib. */ @@ -256,7 +186,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt #define DEFAULT_LIBPATH "/lib:/usr/lib" #endif -@@ -360,7 +502,11 @@ void os::init_system_properties_values() { +@@ -360,7 +433,11 @@ void os::init_system_properties_values() { * should always exist (until the legacy problem cited above is * addressed). */ @@ -268,7 +198,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (v != NULL) { char *t = ld_library_path; /* That's +1 for the colon and +1 for the trailing '\0' */ -@@ -519,6 +665,7 @@ void os::Bsd::hotspot_sigmask(Thread* thread) { +@@ -519,6 +596,7 @@ void os::Bsd::hotspot_sigmask(Thread* thread) { } } @@ -276,7 +206,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt ////////////////////////////////////////////////////////////////////////////// // detecting pthread library -@@ -682,6 +829,7 @@ bool os::Bsd::manually_expand_stack(JavaThread * t, ad +@@ -682,6 +760,7 @@ bool os::Bsd::manually_expand_stack(JavaThread * t, ad } return false; } @@ -284,7 +214,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt ////////////////////////////////////////////////////////////////////////////// // create new thread -@@ -690,6 +838,9 @@ static address highest_vm_reserved_address(); +@@ -690,6 +769,9 @@ static address highest_vm_reserved_address(); // check if it's safe to start a new thread static bool _thread_safety_check(Thread* thread) { @@ -294,7 +224,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (os::Bsd::is_BsdThreads() && !os::Bsd::is_floating_stack()) { // Fixed stack BsdThreads (SuSE Bsd/x86, and some versions of Redhat) // Heap is mmap'ed at lower end of memory space. Thread stacks are -@@ -723,6 +874,7 @@ static bool _thread_safety_check(Thread* thread) { +@@ -723,6 +805,7 @@ static bool _thread_safety_check(Thread* thread) { // here, that means enough space has been reserved for stack. return true; } @@ -302,7 +232,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } // Thread start routine for all newly created threads -@@ -750,6 +902,10 @@ static void *java_start(Thread *thread) { +@@ -750,6 +833,10 @@ static void *java_start(Thread *thread) { return NULL; } @@ -313,7 +243,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // thread_id is kernel thread id (similar to Solaris LWP id) osthread->set_thread_id(os::Bsd::gettid()); -@@ -759,6 +915,7 @@ static void *java_start(Thread *thread) { +@@ -759,6 +846,7 @@ static void *java_start(Thread *thread) { thread->set_lgrp_id(lgrp_id); } } @@ -321,7 +251,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // initialize signal mask for this thread os::Bsd::hotspot_sigmask(thread); -@@ -839,17 +996,22 @@ bool os::create_thread(Thread* thread, ThreadType thr_ +@@ -839,17 +927,22 @@ bool os::create_thread(Thread* thread, ThreadType thr_ // let pthread_create() pick the default value. } @@ -344,7 +274,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt pthread_t tid; int ret = pthread_create(&tid, &attr, (void* (*)(void*)) java_start, thread); -@@ -863,7 +1025,9 @@ bool os::create_thread(Thread* thread, ThreadType thr_ +@@ -863,7 +956,9 @@ bool os::create_thread(Thread* thread, ThreadType thr_ // Need to clean up stuff we've allocated so far thread->set_osthread(NULL); delete osthread; @@ -354,7 +284,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt return false; } -@@ -879,9 +1043,11 @@ bool os::create_thread(Thread* thread, ThreadType thr_ +@@ -879,9 +974,11 @@ bool os::create_thread(Thread* thread, ThreadType thr_ } } @@ -366,7 +296,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } // Aborted due to thread limit being reached -@@ -919,7 +1085,11 @@ bool os::create_attached_thread(JavaThread* thread) { +@@ -919,7 +1016,11 @@ bool os::create_attached_thread(JavaThread* thread) { } // Store pthread info into the OSThread @@ -378,7 +308,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt osthread->set_pthread_id(::pthread_self()); // initialize floating point control register -@@ -930,6 +1100,7 @@ bool os::create_attached_thread(JavaThread* thread) { +@@ -930,6 +1031,7 @@ bool os::create_attached_thread(JavaThread* thread) { thread->set_osthread(osthread); @@ -386,7 +316,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (UseNUMA) { int lgrp_id = os::numa_get_group_id(); if (lgrp_id != -1) { -@@ -956,6 +1127,7 @@ bool os::create_attached_thread(JavaThread* thread) { +@@ -956,6 +1058,7 @@ bool os::create_attached_thread(JavaThread* thread) { os::Bsd::manually_expand_stack(jt, addr); osthread->clear_expanding_stack(); } @@ -394,7 +324,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // initialize signal mask for this thread // and save the caller's signal mask -@@ -1014,6 +1186,7 @@ extern "C" Thread* get_thread() { +@@ -1014,6 +1117,7 @@ extern "C" Thread* get_thread() { ////////////////////////////////////////////////////////////////////////////// // initial thread @@ -402,7 +332,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // Check if current thread is the initial thread, similar to Solaris thr_main. bool os::Bsd::is_initial_thread(void) { char dummy; -@@ -1247,6 +1420,7 @@ void os::Bsd::capture_initial_stack(size_t max_size) { +@@ -1247,6 +1351,7 @@ void os::Bsd::capture_initial_stack(size_t max_size) { _initial_thread_stack_size = align_size_down(_initial_thread_stack_size, page_size()); _initial_thread_stack_bottom = (address)stack_top - _initial_thread_stack_size; } @@ -410,7 +340,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt //////////////////////////////////////////////////////////////////////////////// // time support -@@ -1268,9 +1442,7 @@ jlong os::elapsed_frequency() { +@@ -1268,9 +1373,7 @@ jlong os::elapsed_frequency() { return (1000 * 1000); } @@ -421,7 +351,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt bool os::supports_vtime() { return false; } bool os::enable_vtime() { return false; } bool os::vtime_enabled() { return false; } -@@ -1290,7 +1462,22 @@ jlong os::javaTimeMillis() { +@@ -1290,7 +1393,22 @@ jlong os::javaTimeMillis() { #define CLOCK_MONOTONIC (1) #endif @@ -444,7 +374,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // we do dlopen's in this particular order due to bug in bsd // dynamical loader (see 6348968) leading to crash on exit void* handle = dlopen("librt.so.1", RTLD_LAZY); -@@ -1325,7 +1512,9 @@ void os::Bsd::clock_init() { +@@ -1325,7 +1443,9 @@ void os::Bsd::clock_init() { } } } @@ -454,7 +384,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt #ifndef SYS_clock_getres #if defined(IA32) || defined(AMD64) -@@ -1364,6 +1553,7 @@ void os::Bsd::fast_thread_clock_init() { +@@ -1364,6 +1484,7 @@ void os::Bsd::fast_thread_clock_init() { _pthread_getcpuclockid = pthread_getcpuclockid_func; } } @@ -462,7 +392,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt jlong os::javaTimeNanos() { if (Bsd::supports_monotonic_clock()) { -@@ -1514,8 +1704,15 @@ int os::current_process_id() { +@@ -1514,8 +1635,15 @@ int os::current_process_id() { // DLL functions @@ -479,7 +409,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt const char* os::get_temp_directory() { return "/tmp/"; } static bool file_exists(const char* filename) { -@@ -1532,13 +1729,13 @@ void os::dll_build_name(char* buffer, size_t buflen, +@@ -1532,13 +1660,13 @@ void os::dll_build_name(char* buffer, size_t buflen, const size_t pnamelen = pname ? strlen(pname) : 0; // Quietly truncate on buffer overflow. Should be an error. @@ -495,7 +425,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } else if (strchr(pname, *os::path_separator()) != NULL) { int n; char** pelements = split_path(pname, &n); -@@ -1547,7 +1744,8 @@ void os::dll_build_name(char* buffer, size_t buflen, +@@ -1547,7 +1675,8 @@ void os::dll_build_name(char* buffer, size_t buflen, if (pelements[i] == NULL || strlen(pelements[i]) == 0) { continue; // skip the empty path values } @@ -505,7 +435,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (file_exists(buffer)) { break; } -@@ -1562,7 +1760,7 @@ void os::dll_build_name(char* buffer, size_t buflen, +@@ -1562,7 +1691,7 @@ void os::dll_build_name(char* buffer, size_t buflen, FREE_C_HEAP_ARRAY(char*, pelements); } } else { @@ -514,7 +444,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } } -@@ -1603,6 +1801,23 @@ bool os::dll_address_to_function_name(address addr, ch +@@ -1603,6 +1732,23 @@ bool os::dll_address_to_function_name(address addr, ch } } @@ -538,7 +468,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt struct _address_to_library_name { address addr; // input : memory address size_t buflen; // size of fname -@@ -1677,11 +1892,27 @@ bool os::dll_address_to_library_name(address addr, cha +@@ -1677,11 +1823,27 @@ bool os::dll_address_to_library_name(address addr, cha return false; } } @@ -566,7 +496,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { void * result= ::dlopen(filename, RTLD_LAZY); -@@ -1734,6 +1965,18 @@ void * os::dll_load(const char *filename, char *ebuf, +@@ -1734,6 +1896,18 @@ void * os::dll_load(const char *filename, char *ebuf, #define EM_486 6 /* Intel 80486 */ #endif @@ -585,7 +515,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt static const arch_t arch_array[]={ {EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, {EM_486, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, -@@ -1814,17 +2057,11 @@ void * os::dll_load(const char *filename, char *ebuf, +@@ -1814,17 +1988,11 @@ void * os::dll_load(const char *filename, char *ebuf, return NULL; } @@ -606,7 +536,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } -@@ -1847,7 +2084,51 @@ bool _print_ascii_file(const char* filename, outputStr +@@ -1847,7 +2015,51 @@ bool _print_ascii_file(const char* filename, outputStr void os::print_dll_info(outputStream *st) { st->print_cr("Dynamic libraries:"); @@ -658,7 +588,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt char fname[32]; pid_t pid = os::Bsd::gettid(); -@@ -1856,6 +2137,7 @@ void os::print_dll_info(outputStream *st) { +@@ -1856,6 +2068,7 @@ void os::print_dll_info(outputStream *st) { if (!_print_ascii_file(fname, st)) { st->print("Can not get library information for pid = %d\n", pid); } @@ -666,7 +596,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } -@@ -1888,6 +2170,7 @@ void os::print_os_info(outputStream* st) { +@@ -1888,6 +2101,7 @@ void os::print_os_info(outputStream* st) { st->print(name.machine); st->cr(); @@ -674,7 +604,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // Print warning if unsafe chroot environment detected if (unsafe_chroot_detected) { st->print("WARNING!! "); -@@ -1902,6 +2185,7 @@ void os::print_os_info(outputStream* st) { +@@ -1902,6 +2116,7 @@ void os::print_os_info(outputStream* st) { st->print("(%s stack)", os::Bsd::is_floating_stack() ? "floating" : "fixed"); } st->cr(); @@ -682,7 +612,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // rlimit st->print("rlimit:"); -@@ -1927,6 +2211,7 @@ void os::print_os_info(outputStream* st) { +@@ -1927,6 +2142,7 @@ void os::print_os_info(outputStream* st) { if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); else st->print("%d", rlim.rlim_cur); @@ -690,7 +620,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt st->print(", AS "); getrlimit(RLIMIT_AS, &rlim); if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); -@@ -1939,6 +2224,7 @@ void os::print_os_info(outputStream* st) { +@@ -1939,6 +2155,7 @@ void os::print_os_info(outputStream* st) { os::loadavg(loadavg, 3); st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]); st->cr(); @@ -698,7 +628,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } void os::print_memory_info(outputStream* st) { -@@ -1946,18 +2232,22 @@ void os::print_memory_info(outputStream* st) { +@@ -1946,18 +2163,22 @@ void os::print_memory_info(outputStream* st) { st->print("Memory:"); st->print(" %dk page", os::vm_page_size()>>10); @@ -721,7 +651,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt st->cr(); } -@@ -2184,19 +2474,29 @@ int os::sigexitnum_pd() { +@@ -2184,19 +2405,29 @@ int os::sigexitnum_pd() { static volatile jint pending_signals[NSIG+1] = { 0 }; // Bsd(POSIX) specific hand shaking semaphore. @@ -753,7 +683,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } static int check_pending_signals(bool wait) { -@@ -2218,7 +2518,7 @@ static int check_pending_signals(bool wait) { +@@ -2218,7 +2449,7 @@ static int check_pending_signals(bool wait) { do { thread->set_suspend_equivalent(); // cleared by handle_special_suspend_equivalent_condition() or java_suspend_self() @@ -762,7 +692,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // were we externally suspended while we were waiting? threadIsSuspended = thread->handle_special_suspend_equivalent_condition(); -@@ -2229,7 +2529,7 @@ static int check_pending_signals(bool wait) { +@@ -2229,7 +2460,7 @@ static int check_pending_signals(bool wait) { // while suspended because that would surprise the thread that // suspended us. // @@ -771,7 +701,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt thread->java_suspend_self(); } -@@ -2301,9 +2601,14 @@ void bsd_wrap_code(char* base, size_t size) { +@@ -2301,9 +2532,14 @@ void bsd_wrap_code(char* base, size_t size) { // problem. bool os::commit_memory(char* addr, size_t size, bool exec) { int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE; @@ -786,7 +716,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } bool os::commit_memory(char* addr, size_t size, size_t alignment_hint, -@@ -2319,36 +2624,27 @@ void os::free_memory(char *addr, size_t bytes) { +@@ -2319,36 +2555,27 @@ void os::free_memory(char *addr, size_t bytes) { } void os::numa_make_global(char *addr, size_t bytes) { @@ -828,7 +758,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } bool os::get_page_info(char *start, page_info* info) { -@@ -2359,6 +2655,7 @@ char *os::scan_pages(char *start, char* end, page_info +@@ -2359,6 +2586,7 @@ char *os::scan_pages(char *start, char* end, page_info return end; } @@ -836,7 +766,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt extern "C" void numa_warn(int number, char *where, ...) { } extern "C" void numa_error(char *where) { } -@@ -2460,11 +2757,18 @@ os::Bsd::numa_available_func_t os::Bsd::_numa_availabl +@@ -2460,11 +2688,18 @@ os::Bsd::numa_available_func_t os::Bsd::_numa_availabl os::Bsd::numa_tonode_memory_func_t os::Bsd::_numa_tonode_memory; os::Bsd::numa_interleave_memory_func_t os::Bsd::_numa_interleave_memory; unsigned long* os::Bsd::_numa_all_nodes; @@ -856,7 +786,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } static address _highest_vm_reserved_address = NULL; -@@ -2568,6 +2872,9 @@ bool os::unguard_memory(char* addr, size_t size) { +@@ -2568,6 +2803,9 @@ bool os::unguard_memory(char* addr, size_t size) { static size_t _large_page_size = 0; bool os::large_page_init() { @@ -866,7 +796,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (!UseLargePages) return false; if (LargePageSizeInBytes) { -@@ -2622,6 +2929,7 @@ bool os::large_page_init() { +@@ -2622,6 +2860,7 @@ bool os::large_page_init() { // We optimistically assume the support is available. If later it turns out // not true, VM will automatically switch to use regular page size. return true; @@ -874,16 +804,16 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } #ifndef SHM_HUGETLB -@@ -2798,7 +3106,7 @@ char* os::attempt_reserve_memory_at(size_t bytes, char +@@ -2798,7 +3037,7 @@ char* os::attempt_reserve_memory_at(size_t bytes, char } size_t os::read(int fd, void *buf, unsigned int nBytes) { - return ::read(fd, buf, nBytes); -+ INTERRUPTIBLE_RETURN_INT_VM(::read(fd, buf, nBytes), os::Bsd::clear_interrupted); ++ RESTARTABLE_RETURN_INT(::read(fd, buf, nBytes)); } // TODO-FIXME: reconcile Solaris' os::sleep with the bsd variation. -@@ -2934,9 +3242,47 @@ void os::loop_breaker(int attempts) { +@@ -2934,9 +3173,47 @@ void os::loop_breaker(int attempts) { // this reason, the code should not be used as default (ThreadPriorityPolicy=0). // It is only used when ThreadPriorityPolicy=1 and requires root privilege. @@ -931,7 +861,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt 4, // 1 MinPriority 3, // 2 2, // 3 -@@ -2951,6 +3297,7 @@ int os::java_to_os_priority[MaxPriority + 1] = { +@@ -2951,6 +3228,7 @@ int os::java_to_os_priority[MaxPriority + 1] = { -5 // 10 MaxPriority }; @@ -939,7 +869,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt static int prio_init() { if (ThreadPriorityPolicy == 1) { -@@ -2970,8 +3317,28 @@ static int prio_init() { +@@ -2970,8 +3248,28 @@ static int prio_init() { OSReturn os::set_native_priority(Thread* thread, int newpri) { if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) return OS_OK; @@ -968,7 +898,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) { -@@ -2981,7 +3348,17 @@ OSReturn os::get_native_priority(const Thread* const t +@@ -2981,7 +3279,17 @@ OSReturn os::get_native_priority(const Thread* const t } errno = 0; @@ -986,7 +916,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt return (*priority_ptr != -1 || errno == 0 ? OS_OK : OS_ERR); } -@@ -3091,7 +3468,7 @@ static int SR_initialize() { +@@ -3091,7 +3399,7 @@ static int SR_initialize() { /* Get signal number to use for suspend/resume */ if ((s = ::getenv("_JAVA_SR_SIGNUM")) != 0) { int sig = ::strtol(s, 0, 10); @@ -995,7 +925,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt SR_signum = sig; } } -@@ -3434,6 +3811,28 @@ void os::Bsd::install_signal_handlers() { +@@ -3434,6 +3742,28 @@ void os::Bsd::install_signal_handlers() { set_signal_handler(SIGFPE, true); set_signal_handler(SIGXFSZ, true); @@ -1024,7 +954,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (libjsig_is_loaded) { // Tell libjsig jvm finishes setting signal handlers (*end_signal_setting)(); -@@ -3454,6 +3853,7 @@ void os::Bsd::install_signal_handlers() { +@@ -3454,6 +3784,7 @@ void os::Bsd::install_signal_handlers() { } } @@ -1032,7 +962,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // This is the fastest way to get thread cpu time on Bsd. // Returns cpu time (user+sys) for any thread, not only for current. // POSIX compliant clocks are implemented in the kernels 2.6.16+. -@@ -3468,6 +3868,7 @@ jlong os::Bsd::fast_thread_cpu_time(clockid_t clockid) +@@ -3468,6 +3799,7 @@ jlong os::Bsd::fast_thread_cpu_time(clockid_t clockid) return (tp.tv_sec * SEC_IN_NANOSECS) + tp.tv_nsec; } @@ -1040,7 +970,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt ///// // glibc on Bsd platform uses non-documented flag -@@ -3689,13 +4090,13 @@ void os::init(void) { +@@ -3689,13 +4021,13 @@ void os::init(void) { _initial_pid = (java_launcher_pid > 0) ? java_launcher_pid : getpid(); @@ -1056,7 +986,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (Bsd::page_size() == -1) { fatal1("os_bsd.cpp: os::init: sysconf failed (%s)", strerror(errno)); } -@@ -3708,7 +4109,16 @@ void os::init(void) { +@@ -3708,7 +4040,16 @@ void os::init(void) { Bsd::clock_init(); initial_time_count = os::elapsed_counter(); @@ -1074,7 +1004,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } // To install functions for atexit system call -@@ -3721,7 +4131,9 @@ extern "C" { +@@ -3721,7 +4062,9 @@ extern "C" { // this is called _after_ the global arguments have been parsed jint os::init_2(void) { @@ -1084,7 +1014,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // Allocate a single page and mark it as readable for safepoint polling address polling_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); -@@ -3770,6 +4182,7 @@ jint os::init_2(void) +@@ -3770,6 +4113,7 @@ jint os::init_2(void) JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes, vm_page_size())); @@ -1092,7 +1022,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt Bsd::capture_initial_stack(JavaThread::stack_size_at_create()); Bsd::libpthread_init(); -@@ -3792,6 +4205,7 @@ jint os::init_2(void) +@@ -3792,6 +4136,7 @@ jint os::init_2(void) UseNUMA = true; } } @@ -1100,7 +1030,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (MaxFDLimit) { // set the number of file descriptors to max. print out error -@@ -3803,6 +4217,14 @@ jint os::init_2(void) +@@ -3803,6 +4148,14 @@ jint os::init_2(void) perror("os::init_2 getrlimit failed"); } else { nbr_files.rlim_cur = nbr_files.rlim_max; @@ -1115,7 +1045,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt status = setrlimit(RLIMIT_NOFILE, &nbr_files); if (status != 0) { if (PrintMiscellaneous && (Verbose || WizardMode)) -@@ -3811,8 +4233,10 @@ jint os::init_2(void) +@@ -3811,8 +4164,10 @@ jint os::init_2(void) } } @@ -1126,7 +1056,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // Initialize HPI. jint hpi_result = hpi::initialize(); -@@ -3860,11 +4284,15 @@ void os::make_polling_page_readable(void) { +@@ -3860,11 +4215,15 @@ void os::make_polling_page_readable(void) { }; int os::active_processor_count() { @@ -1142,7 +1072,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } bool os::distribute_processes(uint length, uint* distribution) { -@@ -3906,6 +4334,9 @@ ExtendedPC os::get_thread_pc(Thread* thread) { +@@ -3906,6 +4265,9 @@ ExtendedPC os::get_thread_pc(Thread* thread) { int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime) { @@ -1152,7 +1082,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (is_NPTL()) { return pthread_cond_timedwait(_cond, _mutex, _abstime); } else { -@@ -3921,6 +4352,7 @@ int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond +@@ -3921,6 +4283,7 @@ int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond #endif // IA64 return status; } @@ -1160,7 +1090,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } //////////////////////////////////////////////////////////////////////////////// -@@ -4056,17 +4488,17 @@ int os::create_binary_file(const char* path, bool rewr +@@ -4056,17 +4419,17 @@ int os::create_binary_file(const char* path, bool rewr if (!rewrite_existing) { oflags |= O_EXCL; } @@ -1181,7 +1111,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } // Map a block of memory. -@@ -4116,6 +4548,7 @@ bool os::unmap_memory(char* addr, size_t bytes) { +@@ -4116,6 +4479,7 @@ bool os::unmap_memory(char* addr, size_t bytes) { return munmap(addr, bytes) == 0; } @@ -1189,7 +1119,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time); static clockid_t thread_cpu_clockid(Thread* thread) { -@@ -4127,6 +4560,7 @@ static clockid_t thread_cpu_clockid(Thread* thread) { +@@ -4127,6 +4491,7 @@ static clockid_t thread_cpu_clockid(Thread* thread) { assert(rc == 0, "pthread_getcpuclockid is expected to return 0 code"); return clockid; } @@ -1197,7 +1127,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // current_thread_cpu_time(bool) and thread_cpu_time(Thread*, bool) // are used by JVM M&M and JVMTI to get user+sys or user CPU time -@@ -4136,39 +4570,71 @@ static clockid_t thread_cpu_clockid(Thread* thread) { +@@ -4136,39 +4501,71 @@ static clockid_t thread_cpu_clockid(Thread* thread) { // the fast estimate available on the platform. jlong os::current_thread_cpu_time() { @@ -1269,7 +1199,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // // -1 on error. // -@@ -4257,6 +4723,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool +@@ -4257,6 +4654,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool return (jlong)user_time * (1000000000 / clock_tics_per_sec); } } @@ -1277,7 +1207,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) { info_ptr->max_value = ALL_64_BITS; // will not wrap in less than 64 bits -@@ -4273,7 +4740,13 @@ void os::thread_cpu_time_info(jvmtiTimerInfo *info_ptr +@@ -4273,7 +4671,13 @@ void os::thread_cpu_time_info(jvmtiTimerInfo *info_ptr } bool os::is_thread_cpu_time_supported() { @@ -1291,7 +1221,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt } // System loadavg support. Returns -1 if load average cannot be obtained. -@@ -4406,7 +4879,7 @@ jdk_pthread_sigmask(int how , const sigset_t* newmask, +@@ -4406,7 +4810,7 @@ jdk_pthread_sigmask(int how , const sigset_t* newmask, // abstime will be the absolute timeout time // TODO: replace compute_abstime() with unpackTime() @@ -1300,7 +1230,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (millis < 0) millis = 0; struct timeval now; int status = gettimeofday(&now, NULL); -@@ -4458,7 +4931,7 @@ void os::PlatformEvent::park() { // AKA "down()" +@@ -4458,7 +4862,7 @@ void os::PlatformEvent::park() { // AKA "down()" status = pthread_cond_wait(_cond, _mutex); // for some reason, under 2.7 lwp_cond_wait() may return ETIME ... // Treat this the same as if the wait was interrupted @@ -1309,7 +1239,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt assert_status(status == 0 || status == EINTR, status, "cond_wait"); } -- _nParked ; -@@ -4516,10 +4989,10 @@ int os::PlatformEvent::park(jlong millis) { +@@ -4516,10 +4920,10 @@ int os::PlatformEvent::park(jlong millis) { pthread_cond_init (_cond, NULL) ; } assert_status(status == 0 || status == EINTR || @@ -1322,7 +1252,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // We consume and ignore EINTR and spurious wakeups. } --_nParked ; -@@ -4611,7 +5084,7 @@ void os::PlatformEvent::unpark() { +@@ -4611,7 +5015,7 @@ void os::PlatformEvent::unpark() { * years from "now". */ @@ -1331,7 +1261,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt assert (time > 0, "convertTime"); struct timeval now; -@@ -4670,7 +5143,7 @@ void Parker::park(bool isAbsolute, jlong time) { +@@ -4670,7 +5074,7 @@ void Parker::park(bool isAbsolute, jlong time) { } // Next, demultiplex/decode time arguments @@ -1340,7 +1270,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (time < 0) { // don't wait at all return; } -@@ -4723,7 +5196,7 @@ void Parker::park(bool isAbsolute, jlong time) { +@@ -4723,7 +5127,7 @@ void Parker::park(bool isAbsolute, jlong time) { } } assert_status(status == 0 || status == EINTR || @@ -1349,7 +1279,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt status, "cond_timedwait"); #ifdef ASSERT -@@ -4765,16 +5238,14 @@ void Parker::unpark() { +@@ -4765,16 +5169,14 @@ void Parker::unpark() { } @@ -1371,7 +1301,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt // Run the specified command in a separate process. Return its exit value, // or -1 on failure (e.g. can't fork a new process). // Unlike system(), this function can be called from signal handler. It -@@ -4787,8 +5258,7 @@ int os::fork_and_exec(char* cmd) { +@@ -4787,8 +5189,7 @@ int os::fork_and_exec(char* cmd) { // separate process to execve. Make a direct syscall to fork process. // On IA64 there's no fork syscall, we have to use fork() and hope for // the best... @@ -1381,7 +1311,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_cpp,v 1.10 2009/05/23 03:03:24 kurt if (pid < 0) { // fork failed -@@ -4804,8 +5274,7 @@ int os::fork_and_exec(char* cmd) { +@@ -4804,8 +5205,7 @@ int os::fork_and_exec(char* cmd) { // in the new process, so make a system call directly. // IA64 should use normal execve() from glibc to match the glibc fork() // above. diff --git a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_hpp b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_hpp index c94ebe16e13..42196c63079 100644 --- a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_hpp +++ b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_hpp @@ -1,6 +1,6 @@ -$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt Exp $ ---- hotspot/src/os/bsd/vm/os_bsd.hpp.orig Wed May 20 17:42:24 2009 -+++ hotspot/src/os/bsd/vm/os_bsd.hpp Wed May 20 19:02:42 2009 +$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.6 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/src/os/bsd/vm/os_bsd.hpp.orig Sat May 30 10:11:57 2009 ++++ hotspot/src/os/bsd/vm/os_bsd.hpp Sat May 30 10:15:17 2009 @@ -27,6 +27,12 @@ /* pthread_getattr_np comes with BsdThreads-0.9-7 on RedHat 7.1 */ typedef int (*pthread_getattr_func_type) (pthread_t, pthread_attr_t *); @@ -30,7 +30,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt static GrowableArray* _cpu_to_node; -@@ -65,38 +73,73 @@ class Bsd { +@@ -65,38 +73,52 @@ class Bsd { static julong _physical_memory; static pthread_t _main_thread; @@ -59,27 +59,6 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt static void rebuild_cpu_to_node_map(); static GrowableArray* cpu_to_node() { return _cpu_to_node; } public: -+#ifdef _ALLBSD_SOURCE -+//XXXBSD: ported from solaris version -+ enum { -+ clear_interrupted = true -+ }; -+ static void setup_interruptible(JavaThread* thread); -+ static void setup_interruptible_already_blocked(JavaThread* thread); -+ static JavaThread* setup_interruptible(); -+ static void cleanup_interruptible(JavaThread* thread); -+ -+ // perf counter incrementers used by _INTERRUPTIBLE -+ -+ static void bump_interrupted_before_count(); -+ static void bump_interrupted_during_count(); -+ -+#ifdef ASSERT -+ static JavaThread* setup_interruptible_native(); -+ static void cleanup_interruptible_native(JavaThread* thread); -+#endif -+ -+#endif + static void init_thread_fpu_state(); +#ifndef _ALLBSD_SOURCE @@ -104,7 +83,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt static bool is_initial_thread(void); static int page_size(void) { return _page_size; } -@@ -133,6 +176,7 @@ class Bsd { +@@ -133,6 +155,7 @@ class Bsd { static struct sigaction *get_chained_signal_action(int sig); static bool chained_handler(int sig, siginfo_t* siginfo, void* context); @@ -112,7 +91,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt // GNU libc and libpthread version strings static const char *glibc_version() { return _glibc_version; } static const char *libpthread_version() { return _libpthread_version; } -@@ -148,6 +192,7 @@ class Bsd { +@@ -148,6 +171,7 @@ class Bsd { static void libpthread_init(); static bool libnuma_init(); static void* libnuma_dlsym(void* handle, const char* name); @@ -120,7 +99,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt // Minimum stack size a thread can be created with (allowing // the VM to completely create the thread and enter user code) static size_t min_stack_allowed; -@@ -156,17 +201,21 @@ class Bsd { +@@ -156,17 +180,21 @@ class Bsd { static size_t default_stack_size(os::ThreadType thr_type); static size_t default_guard_size(os::ThreadType thr_type); @@ -142,7 +121,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt static bool supports_monotonic_clock() { return _clock_gettime != NULL; -@@ -176,6 +225,7 @@ class Bsd { +@@ -176,6 +204,7 @@ class Bsd { return _clock_gettime ? _clock_gettime(clock_id, tp) : -1; } @@ -150,7 +129,7 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_hpp,v 1.5 2009/05/23 03:03:24 kurt static int pthread_getcpuclockid(pthread_t tid, clockid_t *clock_id) { return _pthread_getcpuclockid ? _pthread_getcpuclockid(tid, clock_id) : -1; } -@@ -185,6 +235,7 @@ class Bsd { +@@ -185,6 +214,7 @@ class Bsd { } static jlong fast_thread_cpu_time(clockid_t clockid); diff --git a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp index e52f785d19b..e1813ed0193 100644 --- a/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp +++ b/devel/jdk/1.7/patches/patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp @@ -1,6 +1,6 @@ -$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp,v 1.2 2008/03/19 18:05:43 kurt Exp $ ---- hotspot/src/os/bsd/vm/os_bsd.inline.hpp.orig Wed Nov 7 12:41:29 2007 -+++ hotspot/src/os/bsd/vm/os_bsd.inline.hpp Wed Nov 7 12:41:35 2007 +$OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp,v 1.3 2009/06/10 19:01:09 kurt Exp $ +--- hotspot/src/os/bsd/vm/os_bsd.inline.hpp.orig Sat May 30 10:11:57 2009 ++++ hotspot/src/os/bsd/vm/os_bsd.inline.hpp Sat May 30 10:15:39 2009 @@ -61,7 +61,15 @@ inline bool os::uses_stack_guard_pages() { inline bool os::allocate_stack_guard_pages() { @@ -17,111 +17,3 @@ $OpenBSD: patch-hotspot_src_os_bsd_vm_os_bsd_inline_hpp,v 1.2 2008/03/19 18:05:4 } -@@ -108,6 +116,107 @@ inline int os::closedir(DIR *dirp) - assert(dirp != NULL, "just checking"); - return ::closedir(dirp); - } -+ -+//XXXBSD: ported from solaris version -+////////////////////////////////////////////////////////////////////////////// -+//////////////////////////////////////////////////////////////////////////////// -+ -+// macros for interruptible io and system calls and system call restarting -+ -+#define _INTERRUPTIBLE(_setup, _cmd, _result, _thread, _clear, _before, _after, _int_enable) \ -+do { \ -+ _setup; \ -+ _before; \ -+ OSThread* _osthread = _thread->osthread(); \ -+ if (_int_enable && _thread->has_last_Java_frame()) { \ -+ /* this is java interruptible io stuff */ \ -+ if (os::is_interrupted(_thread, _clear)) { \ -+ os::Bsd::bump_interrupted_before_count(); \ -+ _result = OS_INTRPT; \ -+ } else { \ -+ /* _cmd always expands to an assignment to _result */ \ -+ if ((_cmd) < 0 && errno == EINTR \ -+ && os::is_interrupted(_thread, _clear)) { \ -+ os::Bsd::bump_interrupted_during_count(); \ -+ _result = OS_INTRPT; \ -+ } \ -+ } \ -+ } else { \ -+ /* this is normal blocking io stuff */ \ -+ _cmd; \ -+ } \ -+ _after; \ -+} while(false) -+ -+// Interruptible io support + restarting of interrupted system calls -+ -+#ifndef ASSERT -+ -+#define INTERRUPTIBLE(_cmd, _result, _clear) do { \ -+ _INTERRUPTIBLE( JavaThread* _thread = (JavaThread*)ThreadLocalStorage::thread(),_result = _cmd, _result, _thread, _clear, , , UseVMInterruptibleIO); \ -+} while((_result == OS_ERR) && (errno == EINTR)) -+ -+#else -+ -+// This adds an assertion that it is only called from thread_in_native -+// The call overhead is skipped for performance in product mode -+#define INTERRUPTIBLE(_cmd, _result, _clear) do { \ -+ _INTERRUPTIBLE(JavaThread* _thread = os::Bsd::setup_interruptible_native(), _result = _cmd, _result, _thread, _clear, , os::Bsd::cleanup_interruptible_native(_thread), UseVMInterruptibleIO ); \ -+} while((_result == OS_ERR) && (errno == EINTR)) -+ -+#endif -+ -+// Used for calls from _thread_in_vm, not from _thread_in_native -+#define INTERRUPTIBLE_VM(_cmd, _result, _clear) do { \ -+ _INTERRUPTIBLE(JavaThread* _thread = os::Bsd::setup_interruptible(), _result = _cmd, _result, _thread, _clear, , os::Bsd::cleanup_interruptible(_thread), UseVMInterruptibleIO ); \ -+} while((_result == OS_ERR) && (errno == EINTR)) -+ -+/* Use NORESTART when the system call cannot return EINTR, when something other -+ than a system call is being invoked, or when the caller must do EINTR -+ handling. */ -+ -+#ifndef ASSERT -+ -+#define INTERRUPTIBLE_NORESTART(_cmd, _result, _clear) \ -+ _INTERRUPTIBLE( JavaThread* _thread = (JavaThread*)ThreadLocalStorage::thread(),_result = _cmd, _result, _thread, _clear, , , UseVMInterruptibleIO) -+ -+#else -+ -+// This adds an assertion that it is only called from thread_in_native -+// The call overhead is skipped for performance in product mode -+#define INTERRUPTIBLE_NORESTART(_cmd, _result, _clear) \ -+ _INTERRUPTIBLE(JavaThread* _thread = os::Bsd::setup_interruptible_native(), _result = _cmd, _result, _thread, _clear, , os::Bsd::cleanup_interruptible_native(_thread), UseVMInterruptibleIO ) -+ -+#endif -+ -+// Don't attend to UseVMInterruptibleIO. Always allow interruption. -+// Also assumes that it is called from the _thread_blocked state. -+// Used by os_sleep(). -+ -+#define INTERRUPTIBLE_NORESTART_VM_ALWAYS(_cmd, _result, _thread, _clear) \ -+ _INTERRUPTIBLE(os::Bsd::setup_interruptible_already_blocked(_thread), _result = _cmd, _result, _thread, _clear, , , true ) -+ -+#define INTERRUPTIBLE_RETURN_INT(_cmd, _clear) do { \ -+ int _result; \ -+ do { \ -+ INTERRUPTIBLE(_cmd, _result, _clear); \ -+ } while((_result == OS_ERR) && (errno == EINTR)); \ -+ return _result; \ -+} while(false) -+ -+#define INTERRUPTIBLE_RETURN_INT_VM(_cmd, _clear) do { \ -+ int _result; \ -+ do { \ -+ INTERRUPTIBLE_VM(_cmd, _result, _clear); \ -+ } while((_result == OS_ERR) && (errno == EINTR)); \ -+ return _result; \ -+} while(false) -+ -+#define INTERRUPTIBLE_RETURN_INT_NORESTART(_cmd, _clear) do { \ -+ int _result; \ -+ INTERRUPTIBLE_NORESTART(_cmd, _result, _clear); \ -+ return _result; \ -+} while(false) - - // macros for restartable system calls - diff --git a/devel/jdk/1.7/patches/patch-jdk_make_common_Defs-bsd_gmk b/devel/jdk/1.7/patches/patch-jdk_make_common_Defs-bsd_gmk index 8ec8279352c..9cc809d94c1 100644 --- a/devel/jdk/1.7/patches/patch-jdk_make_common_Defs-bsd_gmk +++ b/devel/jdk/1.7/patches/patch-jdk_make_common_Defs-bsd_gmk @@ -1,6 +1,6 @@ -$OpenBSD: patch-jdk_make_common_Defs-bsd_gmk,v 1.4 2009/05/23 03:03:25 kurt Exp $ ---- jdk/make/common/Defs-bsd.gmk.orig Mon May 18 10:55:28 2009 -+++ jdk/make/common/Defs-bsd.gmk Mon May 18 11:08:55 2009 +$OpenBSD: patch-jdk_make_common_Defs-bsd_gmk,v 1.5 2009/06/10 19:01:09 kurt Exp $ +--- jdk/make/common/Defs-bsd.gmk.orig Sat May 30 10:12:02 2009 ++++ jdk/make/common/Defs-bsd.gmk Sat May 30 10:16:07 2009 @@ -43,12 +43,6 @@ # Get shared JDK settings include $(JDK_MAKE_SHARED_DIR)/Defs.gmk @@ -125,16 +125,14 @@ $OpenBSD: patch-jdk_make_common_Defs-bsd_gmk,v 1.4 2009/05/23 03:03:25 kurt Exp override LEX_LIBRARY = -lfl ifeq ($(STATIC_CXX),true) override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic -@@ -296,13 +276,9 @@ override LIBPOSIX4 = - override LIBSOCKET = +@@ -297,12 +277,8 @@ override LIBSOCKET = override LIBTHREAD = override MOOT_PRIORITIES = true --override NO_INTERRUPTIBLE_IO = true + override NO_INTERRUPTIBLE_IO = true -override OPENWIN_HOME = /usr/X11R6 -ifeq ($(ARCH), amd64) -override OPENWIN_LIB = $(OPENWIN_HOME)/lib64 -else -+override NO_INTERRUPTIBLE_IO = false +override OPENWIN_HOME = $(X11_PATH) override OPENWIN_LIB = $(OPENWIN_HOME)/lib -endif diff --git a/devel/jdk/1.7/patches/patch-jdk_make_common_shared_Platform_gmk b/devel/jdk/1.7/patches/patch-jdk_make_common_shared_Platform_gmk index fe67b07d5c4..542de094168 100644 --- a/devel/jdk/1.7/patches/patch-jdk_make_common_shared_Platform_gmk +++ b/devel/jdk/1.7/patches/patch-jdk_make_common_shared_Platform_gmk @@ -1,6 +1,6 @@ -$OpenBSD: patch-jdk_make_common_shared_Platform_gmk,v 1.4 2009/05/23 03:03:25 kurt Exp $ ---- jdk/make/common/shared/Platform.gmk.orig Fri May 8 03:34:14 2009 -+++ jdk/make/common/shared/Platform.gmk Tue May 19 08:31:38 2009 +$OpenBSD: patch-jdk_make_common_shared_Platform_gmk,v 1.5 2009/06/10 19:01:09 kurt Exp $ +--- jdk/make/common/shared/Platform.gmk.orig Thu May 14 03:29:40 2009 ++++ jdk/make/common/shared/Platform.gmk Wed Jun 3 16:15:54 2009 @@ -82,7 +82,7 @@ SYSTEM_UNAME := $(shell uname) SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files .hgignore .hgtags # When changing SCM_DIRs also change SCM_DIRS_rexp and SCM_DIRS_prune: @@ -10,7 +10,7 @@ $OpenBSD: patch-jdk_make_common_shared_Platform_gmk,v 1.4 2009/05/23 03:03:25 ku # Don't define this unless it's not defined ifndef VARIANT -@@ -211,6 +211,85 @@ ifeq ($(SYSTEM_UNAME), Linux) +@@ -211,6 +211,89 @@ ifeq ($(SYSTEM_UNAME), Linux) MB_OF_MEMORY := $(shell free -m | fgrep Mem: | awk '{print $$2;}' ) endif @@ -90,13 +90,17 @@ $OpenBSD: patch-jdk_make_common_shared_Platform_gmk,v 1.4 2009/05/23 03:03:25 ku + # a fully built workspace. + REQUIRED_FREE_SPACE=1500000 + # How much RAM does this machine have: -+ MB_OF_MEMORY=$(shell sysctl -n hw.physmem | awk '{print int($$NF / 1048576); }' ) ++ ifeq ($(OS_VENDOR), OpenBSD) ++ MB_OF_MEMORY=$(shell sysctl -n hw.physmem | awk '{print int($$NF / 1048576); }' ) ++ else ++ MB_OF_MEMORY=$(shell (sysctl -n hw.physmem64 2> /dev/null || sysctl -n hw.physmem) | awk '{print int($$NF / 1048576); }' ) ++ endif +endif + # Windows with and without CYGWIN will be slightly different ifeq ($(SYSTEM_UNAME), Windows_NT) PLATFORM = windows -@@ -376,11 +455,26 @@ ifneq ($(PLATFORM), windows) +@@ -376,11 +459,26 @@ ifneq ($(PLATFORM), windows) ARCH_VM_SUBDIR=jre/lib/$(LIBARCH) endif @@ -123,7 +127,7 @@ $OpenBSD: patch-jdk_make_common_shared_Platform_gmk,v 1.4 2009/05/23 03:03:25 ku ifeq ($(JDK_HAS_MEM_INFO),) JDK_HAS_MEM_INFO=true export JDK_HAS_MEM_INFO -@@ -395,7 +489,7 @@ ifeq ($(JDK_HAS_MEM_INFO),) +@@ -395,7 +493,7 @@ ifeq ($(JDK_HAS_MEM_INFO),) if [ $(MB_OF_MEMORY) -le 1024 ] ; then \ expr $(MB_OF_MEMORY) '-' 128 2> $(DEV_NULL) ; \ else \ diff --git a/devel/jdk/1.7/patches/patch-jdk_make_java_hpi_native_Makefile b/devel/jdk/1.7/patches/patch-jdk_make_java_hpi_native_Makefile index e24ea720429..20aa26842f4 100644 --- a/devel/jdk/1.7/patches/patch-jdk_make_java_hpi_native_Makefile +++ b/devel/jdk/1.7/patches/patch-jdk_make_java_hpi_native_Makefile @@ -1,7 +1,7 @@ -$OpenBSD: patch-jdk_make_java_hpi_native_Makefile,v 1.1 2008/03/19 18:05:45 kurt Exp $ ---- jdk/make/java/hpi/native/Makefile.orig Tue Oct 30 05:04:22 2007 -+++ jdk/make/java/hpi/native/Makefile Wed Nov 7 18:01:59 2007 -@@ -72,11 +72,18 @@ OTHER_CPPFLAGS += -DUSE_PTHREADS +$OpenBSD: patch-jdk_make_java_hpi_native_Makefile,v 1.2 2009/06/10 19:01:09 kurt Exp $ +--- jdk/make/java/hpi/native/Makefile.orig Thu May 14 03:29:40 2009 ++++ jdk/make/java/hpi/native/Makefile Tue Jun 2 12:12:03 2009 +@@ -72,16 +72,25 @@ OTHER_CPPFLAGS += -DUSE_PTHREADS ifeq ($(MOOT_PRIORITIES),true) OTHER_CPPFLAGS += -DMOOT_PRIORITIES endif @@ -20,3 +20,10 @@ $OpenBSD: patch-jdk_make_java_hpi_native_Makefile,v 1.1 2008/03/19 18:05:45 kurt ifeq ($(HAVE_GETHRVTIME),true) OTHER_CPPFLAGS += -DHAVE_GETHRVTIME endif + ++ifneq ($(OS_VENDOR), OpenBSD) + HAVE_FILIOH=true ++endif + ifeq ($(HAVE_FILIOH),true) + OTHER_CPPFLAGS += -DHAVE_FILIOH + endif diff --git a/devel/jdk/1.7/patches/patch-jdk_make_java_nio_Makefile b/devel/jdk/1.7/patches/patch-jdk_make_java_nio_Makefile index 48073a1e6f9..5ce4b7a9bed 100644 --- a/devel/jdk/1.7/patches/patch-jdk_make_java_nio_Makefile +++ b/devel/jdk/1.7/patches/patch-jdk_make_java_nio_Makefile @@ -1,7 +1,7 @@ -$OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.4 2009/05/23 03:03:25 kurt Exp $ ---- jdk/make/java/nio/Makefile.orig Fri May 8 03:34:15 2009 -+++ jdk/make/java/nio/Makefile Tue May 19 11:48:56 2009 -@@ -260,6 +260,66 @@ FILES_gen += \ +$OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.5 2009/06/10 19:01:09 kurt Exp $ +--- jdk/make/java/nio/Makefile.orig Thu May 14 03:29:41 2009 ++++ jdk/make/java/nio/Makefile Tue Jun 2 12:12:32 2009 +@@ -260,6 +260,69 @@ FILES_gen += \ sun/nio/fs/UnixConstants.java endif # PLATFORM = linux @@ -20,6 +20,7 @@ $OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.4 2009/05/23 03:03:25 kurt Exp $ + sun/nio/fs/BsdFileStore.java \ + sun/nio/fs/BsdFileSystem.java \ + sun/nio/fs/BsdFileSystemProvider.java \ ++ sun/nio/fs/BsdNativeDispatcher.java \ + sun/nio/fs/PollingWatchService.java \ + sun/nio/fs/UnixChannelFactory.java \ + sun/nio/fs/UnixCopyFile.java \ @@ -48,6 +49,7 @@ $OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.4 2009/05/23 03:03:25 kurt Exp $ + UnixAsynchronousSocketChannelImpl.c \ + \ + GnomeFileTypeDetector.c \ ++ BsdNativeDispatcher.c \ + UnixCopyFile.c \ + UnixNativeDispatcher.c + @@ -58,6 +60,7 @@ $OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.4 2009/05/23 03:03:25 kurt Exp $ + sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \ + \ + sun/nio/fs/GnomeFileTypeDetector.java \ ++ sun/nio/fs/BsdNativeDispatcher.java \ + sun/nio/fs/UnixCopyFile.java \ + sun/nio/fs/UnixNativeDispatcher.java + @@ -68,7 +71,7 @@ $OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.4 2009/05/23 03:03:25 kurt Exp $ # # Find platform-specific C source files # -@@ -284,6 +344,11 @@ OTHER_INCLUDES += \ +@@ -284,6 +347,11 @@ OTHER_INCLUDES += \ -I$(PLATFORM_SRC)/native/java/net \ -I$(CLASSHDRDIR)/../../../java.lang/java/CClassHeaders @@ -80,7 +83,7 @@ $OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.4 2009/05/23 03:03:25 kurt Exp $ ifeq ($(PLATFORM),windows) OTHER_LDLIBS += $(JVMLIB) ws2_32.lib \ -libpath:$(LIBDIR) java.lib \ -@@ -294,6 +359,9 @@ endif +@@ -294,6 +362,9 @@ endif ifeq ($(PLATFORM), linux) OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl endif @@ -90,7 +93,7 @@ $OpenBSD: patch-jdk_make_java_nio_Makefile,v 1.4 2009/05/23 03:03:25 kurt Exp $ ifeq ($(PLATFORM), solaris) OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 -ldl \ -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -@@ -315,6 +383,9 @@ FILES_m = mapfile-solaris +@@ -315,6 +386,9 @@ FILES_m = mapfile-solaris endif ifeq ($(PLATFORM), linux) FILES_m = mapfile-linux diff --git a/devel/jdk/1.7/patches/patch-jdk_make_java_nio_mapfile-bsd b/devel/jdk/1.7/patches/patch-jdk_make_java_nio_mapfile-bsd new file mode 100644 index 00000000000..470b58ea125 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-jdk_make_java_nio_mapfile-bsd @@ -0,0 +1,60 @@ +$OpenBSD: patch-jdk_make_java_nio_mapfile-bsd,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- jdk/make/java/nio/mapfile-bsd.orig Tue Jun 2 12:13:16 2009 ++++ jdk/make/java/nio/mapfile-bsd Tue Jun 2 12:13:24 2009 +@@ -36,25 +36,6 @@ SUNWprivate_1.1 { + Java_sun_nio_ch_DatagramDispatcher_readv0; + Java_sun_nio_ch_DatagramDispatcher_write0; + Java_sun_nio_ch_DatagramDispatcher_writev0; +- Java_sun_nio_ch_EPollArrayWrapper_epollCreate; +- Java_sun_nio_ch_EPollArrayWrapper_epollCtl; +- Java_sun_nio_ch_EPollArrayWrapper_epollWait; +- Java_sun_nio_ch_EPollArrayWrapper_fdLimit; +- Java_sun_nio_ch_EPollArrayWrapper_init; +- Java_sun_nio_ch_EPollArrayWrapper_interrupt; +- Java_sun_nio_ch_EPollArrayWrapper_offsetofData; +- Java_sun_nio_ch_EPollArrayWrapper_sizeofEPollEvent; +- Java_sun_nio_ch_EPoll_init; +- Java_sun_nio_ch_EPoll_eventSize; +- Java_sun_nio_ch_EPoll_eventsOffset; +- Java_sun_nio_ch_EPoll_dataOffset; +- Java_sun_nio_ch_EPoll_epollCreate; +- Java_sun_nio_ch_EPoll_epollCtl; +- Java_sun_nio_ch_EPoll_epollWait; +- Java_sun_nio_ch_EPollPort_close0; +- Java_sun_nio_ch_EPollPort_drain1; +- Java_sun_nio_ch_EPollPort_interrupt; +- Java_sun_nio_ch_EPollPort_socketpair; + Java_sun_nio_ch_FileChannelImpl_close0; + Java_sun_nio_ch_FileChannelImpl_initIDs; + Java_sun_nio_ch_FileChannelImpl_map0; +@@ -122,26 +103,14 @@ SUNWprivate_1.1 { + Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_accept0; + Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_initIDs; + Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect; ++ Java_sun_nio_fs_BsdNativeDispatcher_initIDs; ++ Java_sun_nio_fs_BsdNativeDispatcher_getfsstat; ++ Java_sun_nio_fs_BsdNativeDispatcher_fsstatEntry; ++ Java_sun_nio_fs_BsdNativeDispatcher_endfsstat; + Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio; + Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio; + Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs; + Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs; +- Java_sun_nio_fs_BsdWatchService_init; +- Java_sun_nio_fs_BsdWatchService_eventSize; +- Java_sun_nio_fs_BsdWatchService_eventOffsets; +- Java_sun_nio_fs_BsdWatchService_inotifyInit; +- Java_sun_nio_fs_BsdWatchService_inotifyAddWatch; +- Java_sun_nio_fs_BsdWatchService_inotifyRmWatch; +- Java_sun_nio_fs_BsdWatchService_configureBlocking; +- Java_sun_nio_fs_BsdWatchService_socketpair; +- Java_sun_nio_fs_BsdWatchService_poll; +- Java_sun_nio_fs_BsdNativeDispatcher_init; +- Java_sun_nio_fs_BsdNativeDispatcher_fgetxattr0; +- Java_sun_nio_fs_BsdNativeDispatcher_flistxattr; +- Java_sun_nio_fs_BsdNativeDispatcher_fsetxattr0; +- Java_sun_nio_fs_BsdNativeDispatcher_fremovexattr0; +- Java_sun_nio_fs_BsdNativeDispatcher_setmntent0; +- Java_sun_nio_fs_BsdNativeDispatcher_endmntent; + Java_sun_nio_fs_UnixNativeDispatcher_initIDs; + Java_sun_nio_fs_UnixNativeDispatcher_getcwd; + Java_sun_nio_fs_UnixNativeDispatcher_strerror; diff --git a/devel/jdk/1.7/patches/patch-jdk_make_java_redist_Makefile b/devel/jdk/1.7/patches/patch-jdk_make_java_redist_Makefile index 8f479df7587..38f2c0bd69f 100644 --- a/devel/jdk/1.7/patches/patch-jdk_make_java_redist_Makefile +++ b/devel/jdk/1.7/patches/patch-jdk_make_java_redist_Makefile @@ -1,19 +1,7 @@ -$OpenBSD: patch-jdk_make_java_redist_Makefile,v 1.3 2009/05/23 03:03:25 kurt Exp $ ---- jdk/make/java/redist/Makefile.orig Fri May 8 03:34:15 2009 -+++ jdk/make/java/redist/Makefile Mon May 18 13:01:01 2009 -@@ -85,6 +85,11 @@ ifeq ($(SA_EXISTS), false) - INCLUDE_SA := false - endif - -+# FIXME: Remove when the build of libsaproc is fixed. -+ifeq ($(PLATFORM), bsd) -+ INCLUDE_SA := false -+endif -+ - ifeq ($(INCLUDE_SA), true) - IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \ - $(LIB_LOCATION)/$(SALIB_NAME) -@@ -311,7 +316,7 @@ $(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/% +$OpenBSD: patch-jdk_make_java_redist_Makefile,v 1.4 2009/06/10 19:01:09 kurt Exp $ +--- jdk/make/java/redist/Makefile.orig Thu May 14 03:29:41 2009 ++++ jdk/make/java/redist/Makefile Tue Jun 2 12:13:48 2009 +@@ -311,7 +311,7 @@ $(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/% $(FONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.fonts.dir $(install-file) @@ -22,7 +10,7 @@ $OpenBSD: patch-jdk_make_java_redist_Makefile,v 1.3 2009/05/23 03:03:25 kurt Exp # The oblique fonts are only needed/wanted on Linux. -@@ -325,7 +330,7 @@ $(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_SRC)/share/lib +@@ -325,7 +325,7 @@ $(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_SRC)/share/lib $(OBLFONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.oblique-fonts.dir $(install-file) diff --git a/devel/jdk/1.7/patches/patch-jdk_src_share_bin_java_c b/devel/jdk/1.7/patches/patch-jdk_src_share_bin_java_c index 28fc6063a35..7b46b2182b5 100644 --- a/devel/jdk/1.7/patches/patch-jdk_src_share_bin_java_c +++ b/devel/jdk/1.7/patches/patch-jdk_src_share_bin_java_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-jdk_src_share_bin_java_c,v 1.1 2009/05/23 03:03:25 kurt Exp $ ---- jdk/src/share/bin/java.c.orig Mon May 18 13:32:27 2009 -+++ jdk/src/share/bin/java.c Mon May 18 13:32:35 2009 +$OpenBSD: patch-jdk_src_share_bin_java_c,v 1.2 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/share/bin/java.c.orig Thu May 14 03:29:45 2009 ++++ jdk/src/share/bin/java.c Tue Jun 2 12:14:00 2009 @@ -68,6 +68,10 @@ static jboolean showVersion = JNI_FALSE; /* print but static jboolean printUsage = JNI_FALSE; /* print and exit*/ static jboolean printXUsage = JNI_FALSE; /* print and exit*/ @@ -42,18 +42,20 @@ $OpenBSD: patch-jdk_src_share_bin_java_c,v 1.1 2009/05/23 03:03:25 kurt Exp $ } #define CHECK_EXCEPTION_NULL_LEAVE(e) \ -@@ -969,6 +984,10 @@ ParseArguments(int *pargc, char ***pargv, char **pjarf +@@ -969,6 +984,12 @@ ParseArguments(int *pargc, char ***pargv, char **pjarf } else if (JLI_StrCmp(arg, "-X") == 0) { printXUsage = JNI_TRUE; return JNI_TRUE; +#ifdef __APPLE__ + } else if (JLI_StrCmp(arg, "-XstartOnFirstThread") == 0) { + continueInSameThread = JNI_TRUE; ++ } else if (JLI_StrCCmp(arg, "-Xdock:") == 0) { ++ // XXXDARWIN: Apple VM supports configuration of Dock icon and name via -Xdock: +#endif /* * The following case provide backward compatibility with old-style * command line options. -@@ -1855,6 +1874,44 @@ ContinueInNewThread(InvocationFunctions* ifn, int argc +@@ -1855,6 +1876,44 @@ ContinueInNewThread(InvocationFunctions* ifn, int argc return (ret != 0) ? ret : rslt; } } diff --git a/devel/jdk/1.7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp b/devel/jdk/1.7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp index a3d5baf0f88..ff20f2e0b00 100644 --- a/devel/jdk/1.7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp +++ b/devel/jdk/1.7/patches/patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp @@ -1,15 +1,19 @@ -$OpenBSD: patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp,v 1.2 2009/01/04 23:25:16 kurt Exp $ ---- jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp.orig Thu Nov 20 03:44:48 2008 -+++ jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp Tue Dec 23 17:49:46 2008 -@@ -22,6 +22,7 @@ +$OpenBSD: patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp,v 1.3 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp.orig Thu May 14 03:30:18 2009 ++++ jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp Tue Jun 2 12:14:34 2009 +@@ -22,6 +22,11 @@ * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ ++#ifdef _ALLBSD_SOURCE ++#include ++#else +#include ++#endif #include #include -@@ -35,7 +36,7 @@ +@@ -35,7 +40,7 @@ #if defined(unix) && !defined(PRODUCT) #include "pthread.h" @@ -18,7 +22,7 @@ $OpenBSD: patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp,v 1.2 2 #endif #include "defines.h" -@@ -58,9 +59,9 @@ int main(int argc, char **argv) { +@@ -58,9 +63,9 @@ int main(int argc, char **argv) { // Single-threaded, implementation, not reentrant. // Includes a weak error check against MT access. #ifndef THREAD_SELF @@ -30,7 +34,7 @@ $OpenBSD: patch-jdk_src_share_native_com_sun_java_util_jar_pack_main_cpp,v 1.2 2 unpacker* unpacker::non_mt_current = null; unpacker* unpacker::current() { -@@ -69,7 +70,7 @@ unpacker* unpacker::current() { +@@ -69,7 +74,7 @@ unpacker* unpacker::current() { } static void set_current_unpacker(unpacker* u) { unpacker::non_mt_current = u; diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java b/devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java index 0a01b37e316..40c0b7ee690 100644 --- a/devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java +++ b/devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java @@ -1,12 +1,11 @@ -$OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java,v 1.1 2009/05/23 03:03:25 kurt Exp $ ---- jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java.orig Tue May 19 11:45:57 2009 -+++ jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java Tue May 19 16:41:08 2009 -@@ -31,55 +31,24 @@ import java.io.IOException; +$OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java,v 1.2 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java.orig Sat May 30 11:21:14 2009 ++++ jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java Tue Jun 2 12:15:02 2009 +@@ -31,55 +31,23 @@ import java.io.IOException; import java.util.*; import java.security.AccessController; import sun.security.action.GetPropertyAction; -import static sun.nio.fs.BsdNativeDispatcher.*; -+import static sun.nio.fs.UnixNativeDispatcher.*; /** * Bsd implementation of FileSystem @@ -60,7 +59,7 @@ $OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java,v 1.1 2009 } @Override -@@ -88,10 +57,6 @@ class BsdFileSystem extends UnixFileSystem { +@@ -88,10 +56,6 @@ class BsdFileSystem extends UnixFileSystem { UnixPath file, LinkOption... options) { @@ -71,7 +70,7 @@ $OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java,v 1.1 2009 return super.newFileAttributeView(view, file, options); } -@@ -101,10 +66,6 @@ class BsdFileSystem extends UnixFileSystem { +@@ -101,10 +65,6 @@ class BsdFileSystem extends UnixFileSystem { UnixPath file, LinkOption... options) { @@ -82,7 +81,7 @@ $OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java,v 1.1 2009 return super.newFileAttributeView(name, file, options); } -@@ -115,9 +76,6 @@ class BsdFileSystem extends UnixFileSystem { +@@ -115,9 +75,6 @@ class BsdFileSystem extends UnixFileSystem { private static Set supportedFileAttributeViews() { Set result = new HashSet(); result.addAll(UnixFileSystem.standardFileAttributeViews()); @@ -92,7 +91,7 @@ $OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java,v 1.1 2009 return Collections.unmodifiableSet(result); } } -@@ -129,22 +87,22 @@ class BsdFileSystem extends UnixFileSystem { +@@ -129,32 +86,31 @@ class BsdFileSystem extends UnixFileSystem { @Override void copyNonPosixAttributes(int ofd, int nfd) { @@ -107,24 +106,26 @@ $OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystem_java,v 1.1 2009 /** - * Returns object to iterate over entries in /etc/mtab -+ * Returns object to iterate over entries in /etc/fstab ++ * Returns object to iterate over mount entries */ @Override Iterable getMountEntries() { ArrayList entries = new ArrayList(); try { - long fp = setmntent("/etc/mtab".getBytes(), "r".getBytes()); -+ UnixPath fstab = new UnixPath(this, "/etc/fstab"); -+ long fp = fopen(fstab, "r"); ++ long iter = BsdNativeDispatcher.getfsstat(); try { for (;;) { UnixMountEntry entry = new UnixMountEntry(); -@@ -154,7 +112,7 @@ class BsdFileSystem extends UnixFileSystem { +- int res = getextmntent(fp, entry); ++ int res = BsdNativeDispatcher.fsstatEntry(iter, entry); + if (res < 0) + break; entries.add(entry); } } finally { - endmntent(fp); -+ fclose(fp); ++ BsdNativeDispatcher.endfsstat(iter); } } catch (UnixException x) { diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdNativeDispatcher_java b/devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdNativeDispatcher_java new file mode 100644 index 00000000000..31a5ec9d0a6 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-jdk_src_solaris_classes_sun_nio_fs_BsdNativeDispatcher_java @@ -0,0 +1,113 @@ +$OpenBSD: patch-jdk_src_solaris_classes_sun_nio_fs_BsdNativeDispatcher_java,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java.orig Tue Jun 2 13:13:56 2009 ++++ jdk/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java Tue Jun 2 13:14:02 2009 +@@ -1,5 +1,5 @@ + /* +- * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. ++ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -36,84 +36,23 @@ class BsdNativeDispatcher extends UnixNativeDispatcher + private BsdNativeDispatcher() { } + + /** +- * FILE *setmntent(const char *filename, const char *type); ++ * struct fsstat_iter *getfsstat(); + */ +- static long setmntent(byte[] filename, byte[] type) throws UnixException { +- NativeBuffer pathBuffer = NativeBuffers.asNativeBuffer(filename); +- NativeBuffer typeBuffer = NativeBuffers.asNativeBuffer(type); +- try { +- return setmntent0(pathBuffer.address(), typeBuffer.address()); +- } finally { +- typeBuffer.release(); +- pathBuffer.release(); +- } +- } +- private static native long setmntent0(long pathAddress, long typeAddress) +- throws UnixException; ++ static native long getfsstat() throws UnixException; + + /** +- * int endmntent(FILE* filep); ++ * int fsstatEntry(struct fsstat_iter * iter, UnixMountEntry entry); + */ +- static native void endmntent(long stream) throws UnixException; +- +- /** +- * ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size); +- */ +- static int fgetxattr(int filedes, byte[] name, long valueAddress, +- int valueLen) throws UnixException +- { +- NativeBuffer buffer = NativeBuffers.asNativeBuffer(name); +- try { +- return fgetxattr0(filedes, buffer.address(), valueAddress, valueLen); +- } finally { +- buffer.release(); +- } +- } +- +- private static native int fgetxattr0(int filedes, long nameAddress, +- long valueAdddress, int valueLen) throws UnixException; +- +- /** +- * fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags); +- */ +- static void fsetxattr(int filedes, byte[] name, long valueAddress, +- int valueLen) throws UnixException +- { +- NativeBuffer buffer = NativeBuffers.asNativeBuffer(name); +- try { +- fsetxattr0(filedes, buffer.address(), valueAddress, valueLen); +- } finally { +- buffer.release(); +- } +- } +- +- private static native void fsetxattr0(int filedes, long nameAddress, +- long valueAdddress, int valueLen) throws UnixException; +- +- +- /** +- * fremovexattr(int filedes, const char *name); +- */ +- static void fremovexattr(int filedes, byte[] name) throws UnixException { +- NativeBuffer buffer = NativeBuffers.asNativeBuffer(name); +- try { +- fremovexattr0(filedes, buffer.address()); +- } finally { +- buffer.release(); +- } +- } +- +- private static native void fremovexattr0(int filedes, long nameAddress) ++ static native int fsstatEntry(long iter, UnixMountEntry entry) + throws UnixException; + +- /** +- * size_t flistxattr(int filedes, const char *list, size_t size) +- */ +- static native int flistxattr(int filedes, long listAddress, int size) +- throws UnixException; ++ /** ++ * void endfsstat(struct fsstat_iter * iter); ++ */ ++ static native void endfsstat(long iter) throws UnixException; + +- // initialize +- private static native void init(); ++ // initialize field IDs ++ private static native void initIDs(); + + static { + AccessController.doPrivileged(new PrivilegedAction() { +@@ -121,6 +60,6 @@ class BsdNativeDispatcher extends UnixNativeDispatcher + System.loadLibrary("nio"); + return null; + }}); +- init(); ++ initIDs(); + } + } diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_hpi_native_threads_src_sys_api_td_c b/devel/jdk/1.7/patches/patch-jdk_src_solaris_hpi_native_threads_src_sys_api_td_c deleted file mode 100644 index ce2fb91dcd2..00000000000 --- a/devel/jdk/1.7/patches/patch-jdk_src_solaris_hpi_native_threads_src_sys_api_td_c +++ /dev/null @@ -1,25 +0,0 @@ -$OpenBSD: patch-jdk_src_solaris_hpi_native_threads_src_sys_api_td_c,v 1.1 2008/03/19 18:05:46 kurt Exp $ ---- jdk/src/solaris/hpi/native_threads/src/sys_api_td.c.orig Tue Oct 30 05:04:03 2007 -+++ jdk/src/solaris/hpi/native_threads/src/sys_api_td.c Wed Nov 7 18:16:19 2007 -@@ -39,6 +39,10 @@ - #include - #endif - -+#ifdef __OpenBSD__ -+#include -+#endif -+ - #include - #include - #include -@@ -54,6 +58,10 @@ - #include "mutex_md.h" - - #if defined(__solaris__) && defined(NO_INTERRUPTIBLE_IO) -+#error If there was no policy change, this could be a makefile error. -+#endif -+ -+#if defined(_ALLBSD_SOURCE) && defined(NO_INTERRUPTIBLE_IO) - #error If there was no policy change, this could be a makefile error. - #endif - diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpChannelImpl_c b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpChannelImpl_c new file mode 100644 index 00000000000..88fcceb8416 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpChannelImpl_c @@ -0,0 +1,17 @@ +$OpenBSD: patch-jdk_src_solaris_native_sun_nio_ch_SctpChannelImpl_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c.orig Tue Jun 2 12:18:28 2009 ++++ jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c Tue Jun 2 12:18:37 2009 +@@ -338,11 +338,11 @@ void handlePeerAddrChange + break; + case SCTP_ADDR_MADE_PRIM : + event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_MADE_PRIM; +-#ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */ ++#ifndef __solaris__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */ + break; + case SCTP_ADDR_CONFIRMED : + event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_CONFIRMED; +-#endif /* __linux__ */ ++#endif /* __solaris__ */ + } + + addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr); diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpNet_c b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpNet_c new file mode 100644 index 00000000000..056d77ff3be --- /dev/null +++ b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_SctpNet_c @@ -0,0 +1,19 @@ +$OpenBSD: patch-jdk_src_solaris_native_sun_nio_ch_SctpNet_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/solaris/native/sun/nio/ch/SctpNet.c.orig Tue Jun 2 12:18:58 2009 ++++ jdk/src/solaris/native/sun/nio/ch/SctpNet.c Tue Jun 2 12:19:06 2009 +@@ -55,6 +55,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad + */ + jboolean loadSocketExtensionFuncs + (JNIEnv* env) { ++#if !defined(__FreeBSD__) || __FreeBSD__ < 7 /* On FreeBSD 7.x these functions are in libc */ + if (dlopen(nativeSctpLib, RTLD_GLOBAL | RTLD_LAZY) == NULL) { + JNU_ThrowByName(env, "java/lang/UnsupportedOperationException", + dlerror()); +@@ -95,6 +96,7 @@ jboolean loadSocketExtensionFuncs + dlerror()); + return JNI_FALSE; + } ++#endif /* __FreeBSD__ */ + + funcsLoaded = JNI_TRUE; + return JNI_TRUE; diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_Sctp_h b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_Sctp_h new file mode 100644 index 00000000000..1b9db360b72 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_ch_Sctp_h @@ -0,0 +1,47 @@ +$OpenBSD: patch-jdk_src_solaris_native_sun_nio_ch_Sctp_h,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/solaris/native/sun/nio/ch/Sctp.h.orig Tue Jun 2 12:17:54 2009 ++++ jdk/src/solaris/native/sun/nio/ch/Sctp.h Tue Jun 2 12:18:02 2009 +@@ -65,7 +65,7 @@ typedef int sctp_freepaddrs_func(void *addrs); + typedef int sctp_bindx_func(int sock, void *addrs, int addrcnt, int flags); + + +-#else /* __linux__ */ ++#elif __linux__ + #include + #include + #include +@@ -316,13 +316,34 @@ typedef int sctp_getpaddrs_func(int sd, sctp_assoc_t i + typedef int sctp_freepaddrs_func(struct sockaddr *addrs); + typedef int sctp_bindx_func(int sd, struct sockaddr *addrs, int addrcnt, int flags); + ++#elif defined(__FreeBSD__) && __FreeBSD__ >= 7 ++ ++#include ++#include ++#include ++#include ++#include ++#include "jni.h" ++ + #endif /* __linux__ */ + ++#if !defined(__FreeBSD__) || __FreeBSD__ < 7 ++ + sctp_getladdrs_func* nio_sctp_getladdrs; + sctp_freeladdrs_func* nio_sctp_freeladdrs; + sctp_getpaddrs_func* nio_sctp_getpaddrs; + sctp_freepaddrs_func* nio_sctp_freepaddrs; + sctp_bindx_func* nio_sctp_bindx; ++ ++#else ++ ++#define nio_sctp_getladdrs sctp_getladdrs ++#define nio_sctp_freeladdrs sctp_freeladdrs ++#define nio_sctp_getpaddrs sctp_getpaddrs ++#define nio_sctp_freepaddrs sctp_freepaddrs ++#define nio_sctp_bindx sctp_bindx ++ ++#endif + + jboolean loadSocketExtensionFuncs(JNIEnv* env); + diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_BsdNativeDispatcher_c b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_BsdNativeDispatcher_c new file mode 100644 index 00000000000..9a3bf509663 --- /dev/null +++ b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_BsdNativeDispatcher_c @@ -0,0 +1,286 @@ +$OpenBSD: patch-jdk_src_solaris_native_sun_nio_fs_BsdNativeDispatcher_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c.orig Tue Jun 2 13:44:48 2009 ++++ jdk/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c Wed Jun 3 16:14:03 2009 +@@ -1,5 +1,5 @@ + /* +- * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. ++ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -28,23 +28,35 @@ + #include "jvm.h" + #include "jlong.h" + +-#include +-#include +-#include +-#include ++#include ++#include ++#ifdef ST_RDONLY ++#define statfs statvfs ++#define getfsstat getvfsstat ++#define f_flags f_flag ++#define ISREADONLY ST_RDONLY ++#else ++#define ISREADONLY MNT_RDONLY ++#endif + +-#include "sun_nio_fs_BsdNativeDispatcher.h" ++#include ++#include + +-typedef size_t fgetxattr_func(int fd, const char* name, void* value, size_t size); +-typedef int fsetxattr_func(int fd, const char* name, void* value, size_t size, int flags); +-typedef int fremovexattr_func(int fd, const char* name); +-typedef int flistxattr_func(int fd, char* list, size_t size); ++static jfieldID entry_name; ++static jfieldID entry_dir; ++static jfieldID entry_fstype; ++static jfieldID entry_options; ++static jfieldID entry_dev; + +-fgetxattr_func* my_fgetxattr_func = NULL; +-fsetxattr_func* my_fsetxattr_func = NULL; +-fremovexattr_func* my_fremovexattr_func = NULL; +-flistxattr_func* my_flistxattr_func = NULL; + ++struct fsstat_iter { ++ struct statfs *buf; ++ int pos; ++ int nentries; ++}; ++ ++#include "sun_nio_fs_BsdNativeDispatcher.h" ++ + static void throwUnixException(JNIEnv* env, int errnum) { + jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException", + "(I)V", errnum); +@@ -53,108 +65,146 @@ static void throwUnixException(JNIEnv* env, int errnum + } + } + ++/** ++ * Initialize jfieldIDs ++ */ + JNIEXPORT void JNICALL +-Java_sun_nio_fs_BsdNativeDispatcher_init(JNIEnv *env, jclass clazz) ++Java_sun_nio_fs_BsdNativeDispatcher_initIDs(JNIEnv* env, jclass this) + { +- my_fgetxattr_func = (fgetxattr_func*)dlsym(RTLD_DEFAULT, "fgetxattr"); +- my_fsetxattr_func = (fsetxattr_func*)dlsym(RTLD_DEFAULT, "fsetxattr"); +- my_fremovexattr_func = (fremovexattr_func*)dlsym(RTLD_DEFAULT, "fremovexattr"); +- my_flistxattr_func = (flistxattr_func*)dlsym(RTLD_DEFAULT, "flistxattr"); +-} ++ jclass clazz; + +-JNIEXPORT jint JNICALL +-Java_sun_nio_fs_BsdNativeDispatcher_fgetxattr0(JNIEnv* env, jclass clazz, +- jint fd, jlong nameAddress, jlong valueAddress, jint valueLen) +-{ +- size_t res = -1; +- const char* name = jlong_to_ptr(nameAddress); +- void* value = jlong_to_ptr(valueAddress); +- +- if (my_fgetxattr_func == NULL) { +- errno = ENOTSUP; +- } else { +- /* EINTR not documented */ +- res = (*my_fgetxattr_func)(fd, name, value, valueLen); ++ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry"); ++ if (clazz == NULL) { ++ return; + } +- if (res == (size_t)-1) +- throwUnixException(env, errno); +- return (jint)res; ++ entry_name = (*env)->GetFieldID(env, clazz, "name", "[B"); ++ entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B"); ++ entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B"); ++ entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B"); ++ entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J"); + } + +-JNIEXPORT void JNICALL +-Java_sun_nio_fs_BsdNativeDispatcher_fsetxattr0(JNIEnv* env, jclass clazz, +- jint fd, jlong nameAddress, jlong valueAddress, jint valueLen) ++JNIEXPORT jlong JNICALL ++Java_sun_nio_fs_BsdNativeDispatcher_getfsstat(JNIEnv* env, jclass this) + { +- int res = -1; +- const char* name = jlong_to_ptr(nameAddress); +- void* value = jlong_to_ptr(valueAddress); ++ int nentries; ++ size_t bufsize; ++ struct fsstat_iter *iter = malloc(sizeof(*iter)); + +- if (my_fsetxattr_func == NULL) { +- errno = ENOTSUP; +- } else { +- /* EINTR not documented */ +- res = (*my_fsetxattr_func)(fd, name, value, valueLen, 0); ++ if (iter == NULL) { ++ JNU_ThrowOutOfMemoryError(env, "native heap"); ++ return 0; + } +- if (res == -1) ++ ++ iter->pos = 0; ++ iter->nentries = 0; ++ iter->buf = NULL; ++ ++ nentries = getfsstat(NULL, 0, MNT_NOWAIT); ++ ++ if (nentries <= 0) { ++ free(iter); + throwUnixException(env, errno); +-} ++ return 0; ++ } + +-JNIEXPORT void JNICALL +-Java_sun_nio_fs_BsdNativeDispatcher_fremovexattr0(JNIEnv* env, jclass clazz, +- jint fd, jlong nameAddress) +-{ +- int res = -1; +- const char* name = jlong_to_ptr(nameAddress); ++ // It's possible that a new filesystem gets mounted between ++ // the first getfsstat and the second so loop until consistant + +- if (my_fremovexattr_func == NULL) { +- errno = ENOTSUP; +- } else { +- /* EINTR not documented */ +- res = (*my_fremovexattr_func)(fd, name); ++ while (nentries != iter->nentries) { ++ if (iter->buf != NULL) ++ free(iter->buf); ++ ++ bufsize = nentries * sizeof(struct statfs); ++ iter->nentries = nentries; ++ ++ iter->buf = malloc(bufsize); ++ if (iter->buf == NULL) { ++ free(iter); ++ JNU_ThrowOutOfMemoryError(env, "native heap"); ++ return 0; ++ } ++ ++ nentries = getfsstat(iter->buf, bufsize, MNT_WAIT); ++ if (nentries <= 0) { ++ free(iter->buf); ++ free(iter); ++ throwUnixException(env, errno); ++ return 0; ++ } + } +- if (res == -1) +- throwUnixException(env, errno); ++ ++ return (jlong)iter; + } + + JNIEXPORT jint JNICALL +-Java_sun_nio_fs_BsdNativeDispatcher_flistxattr(JNIEnv* env, jclass clazz, +- jint fd, jlong listAddress, jint size) ++Java_sun_nio_fs_BsdNativeDispatcher_fsstatEntry(JNIEnv* env, jclass this, ++ jlong value, jobject entry) + { +- size_t res = -1; +- char* list = jlong_to_ptr(listAddress); ++ struct fsstat_iter *iter = jlong_to_ptr(value); ++ jsize len; ++ jbyteArray bytes; ++ char* name; ++ char* dir; ++ char* fstype; ++ char* options; ++ dev_t dev; + +- if (my_flistxattr_func == NULL) { +- errno = ENOTSUP; +- } else { +- /* EINTR not documented */ +- res = (*my_flistxattr_func)(fd, list, (size_t)size); +- } +- if (res == (size_t)-1) +- throwUnixException(env, errno); +- return (jint)res; +-} ++ if (iter == NULL || iter->pos >= iter->nentries) ++ return -1; + +-JNIEXPORT jlong JNICALL +-Java_sun_nio_fs_BsdNativeDispatcher_setmntent0(JNIEnv* env, jclass this, jlong pathAddress, +- jlong modeAddress) +-{ +- FILE* fp = NULL; +- const char* path = (const char*)jlong_to_ptr(pathAddress); +- const char* mode = (const char*)jlong_to_ptr(modeAddress); ++ name = iter->buf[iter->pos].f_mntfromname; ++ dir = iter->buf[iter->pos].f_mntonname; ++ fstype = iter->buf[iter->pos].f_fstypename; ++ if (iter->buf[iter->pos].f_flags & ISREADONLY) ++ options="ro"; ++ else ++ options=""; ++ dev = 0; + +- do { +- fp = setmntent(path, mode); +- } while (fp == NULL && errno == EINTR); +- if (fp == NULL) { +- throwUnixException(env, errno); +- } +- return ptr_to_jlong(fp); ++ iter->pos++; ++ ++ len = strlen(name); ++ bytes = (*env)->NewByteArray(env, len); ++ if (bytes == NULL) ++ return -1; ++ (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)name); ++ (*env)->SetObjectField(env, entry, entry_name, bytes); ++ ++ len = strlen(dir); ++ bytes = (*env)->NewByteArray(env, len); ++ if (bytes == NULL) ++ return -1; ++ (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)dir); ++ (*env)->SetObjectField(env, entry, entry_dir, bytes); ++ ++ len = strlen(fstype); ++ bytes = (*env)->NewByteArray(env, len); ++ if (bytes == NULL) ++ return -1; ++ (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)fstype); ++ (*env)->SetObjectField(env, entry, entry_fstype, bytes); ++ ++ len = strlen(options); ++ bytes = (*env)->NewByteArray(env, len); ++ if (bytes == NULL) ++ return -1; ++ (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte*)options); ++ (*env)->SetObjectField(env, entry, entry_options, bytes); ++ ++ if (dev != 0) ++ (*env)->SetLongField(env, entry, entry_dev, (jlong)dev); ++ ++ return 0; + } + + JNIEXPORT void JNICALL +-Java_sun_nio_fs_BsdNativeDispatcher_endmntent(JNIEnv* env, jclass this, jlong stream) ++Java_sun_nio_fs_BsdNativeDispatcher_endfsstat(JNIEnv* env, jclass this, jlong value) + { +- FILE* fp = jlong_to_ptr(stream); +- /* FIXME - man page doesn't explain how errors are returned */ +- endmntent(fp); ++ struct fsstat_iter *iter = jlong_to_ptr(value); ++ ++ if (iter != NULL) { ++ free(iter->buf); ++ free(iter); ++ } + } diff --git a/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_GnomeFileTypeDetector_c b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_GnomeFileTypeDetector_c new file mode 100644 index 00000000000..c94f7d2b6ab --- /dev/null +++ b/devel/jdk/1.7/patches/patch-jdk_src_solaris_native_sun_nio_fs_GnomeFileTypeDetector_c @@ -0,0 +1,13 @@ +$OpenBSD: patch-jdk_src_solaris_native_sun_nio_fs_GnomeFileTypeDetector_c,v 1.1 2009/06/10 19:01:09 kurt Exp $ +--- jdk/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c.orig Tue Jun 2 12:19:48 2009 ++++ jdk/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c Tue Jun 2 12:19:56 2009 +@@ -30,7 +30,9 @@ + + #include + #include ++#ifndef __APPLE__ + #include ++#endif + + #ifdef __solaris__ + #include diff --git a/devel/jdk/1.7/pkg/PLIST-main b/devel/jdk/1.7/pkg/PLIST-main index ce56ac00697..f8e8192ac9f 100644 --- a/devel/jdk/1.7/pkg/PLIST-main +++ b/devel/jdk/1.7/pkg/PLIST-main @@ -1,4 +1,4 @@ -@comment $OpenBSD: PLIST-main,v 1.5 2009/05/23 03:03:25 kurt Exp $ +@comment $OpenBSD: PLIST-main,v 1.6 2009/06/10 19:01:09 kurt Exp $ @option no-default-conflict @conflict jdk->=1.7,<1.8 ${JDKHOME}/ @@ -464,6 +464,7 @@ ${JDKHOME}/jre/lib/${MACHINE_ARCH}/libnet.so ${JDKHOME}/jre/lib/${MACHINE_ARCH}/libnio.so ${JDKHOME}/jre/lib/${MACHINE_ARCH}/libnpt.so ${JDKHOME}/jre/lib/${MACHINE_ARCH}/librmi.so +${JDKHOME}/jre/lib/${MACHINE_ARCH}/libsaproc.so ${JDKHOME}/jre/lib/${MACHINE_ARCH}/libsplashscreen.so ${JDKHOME}/jre/lib/${MACHINE_ARCH}/libunpack.so ${JDKHOME}/jre/lib/${MACHINE_ARCH}/libverify.so @@ -978,6 +979,7 @@ ${JDKHOME}/lib/dt.jar ${JDKHOME}/lib/ir.idl ${JDKHOME}/lib/jconsole.jar ${JDKHOME}/lib/orb.idl +${JDKHOME}/lib/sa-jdi.jar ${JDKHOME}/lib/tools.jar @mandir ${JDKHOME}/man/ ${JDKHOME}/man/man1/