diff options
author | glewis <glewis@FreeBSD.org> | 2012-05-28 02:48:14 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2012-05-28 02:48:14 +0800 |
commit | 4e0db0c645a47dbb913e13d5cf142b81be05b7db (patch) | |
tree | 6efd37418c4ef8abfdb8a1f0d116f102f4cb5845 /java | |
parent | 06985c92446185290f609ad6477b8ec1ec01bce3 (diff) | |
download | freebsd-ports-gnome-4e0db0c645a47dbb913e13d5cf142b81be05b7db.tar.gz freebsd-ports-gnome-4e0db0c645a47dbb913e13d5cf142b81be05b7db.tar.zst freebsd-ports-gnome-4e0db0c645a47dbb913e13d5cf142b81be05b7db.zip |
. Update to 7u4. This was a fairly significant merge, so please report
any regressions in functionality that might have been missed. Biggest
news is that partial BSD support is now in the official source
distribution through the OS X port's inclusion.
Partly obtained from Kurt Miller <kurt@intricatesoftware.com>
Diffstat (limited to 'java')
-rw-r--r-- | java/openjdk7/Makefile | 29 | ||||
-rw-r--r-- | java/openjdk7/distinfo | 4 | ||||
-rw-r--r-- | java/openjdk7/files/patch-set | 30721 | ||||
-rw-r--r-- | java/openjdk7/files/patch-u3 | 4326 | ||||
-rw-r--r-- | java/openjdk7/files/patch-zzz-nio-kqueue | 1227 |
5 files changed, 4773 insertions, 31534 deletions
diff --git a/java/openjdk7/Makefile b/java/openjdk7/Makefile index 1456eb13a7ef..eea9d41b003b 100644 --- a/java/openjdk7/Makefile +++ b/java/openjdk7/Makefile @@ -6,10 +6,9 @@ # PORTNAME= openjdk -PORTVERSION= ${JDK_MAJOR_VERSION}.${PORT_MINOR_VERSION}.${PORT_BUILD_NUMBER} -PORTREVISION= 1 +PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_BUILD_NUMBER} CATEGORIES= java devel -MASTER_SITES= http://download.java.net/openjdk/jdk7u2/promoted/b${JDK_BUILD_NUMBER}/ \ +MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}u${JDK_MINOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/ \ http://download.java.net/jaxp/1.4.5/:jaxp \ http://icedtea.classpath.org/download/drops/:jaxp \ http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7/:jaxws \ @@ -39,11 +38,9 @@ OPTIONS= POLICY "Install the Unlimited Strength Policy Files" on \ TZUPDATE "Update the time zone data" on JDK_MAJOR_VERSION= 7 -JDK_MINOR_VERSION= 2 -PORT_MINOR_VERSION= 3 -JDK_BUILD_NUMBER= 13 -PORT_BUILD_NUMBER= 04 -JDK_BUILD_DATE= 17_nov_2011 +JDK_MINOR_VERSION= 4 +JDK_BUILD_NUMBER= 22 +JDK_BUILD_DATE= 02_may_2012 JDK_SRC_DISTFILE= ${PORTNAME}-${JDK_MAJOR_VERSION}u${JDK_MINOR_VERSION}-fcs-src-b${JDK_BUILD_NUMBER}-${JDK_BUILD_DATE} # Use our own version of ant to avoid circular dependencies @@ -135,22 +132,6 @@ BOOTSTRAPJDKDIR?= ${LOCALBASE}/diablo-jdk1.6.0 BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/diablo-jdk16 .endif -post-extract: - @for dir in `${FIND} ${WRKSRC} -name '*[Ll][Ii][Nn][Uu][Xx]*' -type d`; do \ - ${MKDIR} `echo $$dir | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \ - for subdir in `${FIND} $$dir -type d`; do \ - ${MKDIR} `echo $$subdir | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \ - done; \ - for file in `${FIND} $$dir -type f`; do \ - newfile=`echo $$file | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \ - ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g' $$file > $$newfile; \ - done; \ - done - @for file in `${FIND} ${WRKSRC} -name '*[Ll][Ii][Nn][Uu][Xx]*' -type f | ${GREP} -v '\/[^/]*[Ll][Ii][Nn][Uu][Xx][^/]*\/'`; do \ - newfile=`echo $$file | ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g'`; \ - ${SED} -e 's/linux/bsd/g' -e 's/Linux/Bsd/g' -e 's/LINUX/BSD/g' $$file > $$newfile; \ - done - post-patch: @${REINPLACE_CMD} "s|%%LOCALBASE%%|${LOCALBASE}|" \ ${WRKSRC}/hotspot/src/os/bsd/vm/os_bsd.cpp diff --git a/java/openjdk7/distinfo b/java/openjdk7/distinfo index c701191653e1..eb3fea433289 100644 --- a/java/openjdk7/distinfo +++ b/java/openjdk7/distinfo @@ -1,5 +1,5 @@ -SHA256 (openjdk-7u2-fcs-src-b13-17_nov_2011.zip) = 6b13dde9efb0a8d6cd4d909239d633657c2aeef8f6ba806465d0cc691d681841 -SIZE (openjdk-7u2-fcs-src-b13-17_nov_2011.zip) = 87754846 +SHA256 (openjdk-7u4-fcs-src-b22-02_may_2012.zip) = ed89f8e21c18bf2ff6e6711a351d06b08961a22f3dae6f8c9b4d3683b172a1af +SIZE (openjdk-7u4-fcs-src-b22-02_may_2012.zip) = 97155994 SHA256 (jaxp145_01.zip) = c5924c6188988e2e8397ee5143bd8eaa062569d052567afd2ac9326a54a848cb SIZE (jaxp145_01.zip) = 6389175 SHA256 (jdk7-jaxws2_2_4-b04-2011_06_01.zip) = 6a8734d37553103da47715ebd74077d5397cae4730775b09fa2ab679650aa824 diff --git a/java/openjdk7/files/patch-set b/java/openjdk7/files/patch-set index b2a7f0cf743c..4381a9da6cb8 100644 --- a/java/openjdk7/files/patch-set +++ b/java/openjdk7/files/patch-set @@ -1,2419 +1,47 @@ ---- ./.hgtags 2011-11-17 21:30:05.000000000 -0800 -+++ ./.hgtags 2012-02-26 13:57:18.000000000 -0800 -@@ -139,3 +139,5 @@ - bfc196b6a292af7d917fadc410fd703d11b71478 jdk7u1-b08 - be12d8ef36d1d75fe6476d61f921036ba49186b4 jdk7u2-b11 - b2deaf5bde5ec455a06786e8e2aea2e673be13aa jdk7u2-b12 -+c95558e566ac3605c480a3d070b1102088dab07f jdk7u2-b13 -+e30fd289f0019700575593ee4e1635fbc5c9a484 jdk7u2-b21 ---- ./corba/.hgtags 2011-11-17 21:31:10.000000000 -0800 -+++ ./corba/.hgtags 2012-02-26 13:57:58.000000000 -0800 -@@ -139,3 +139,5 @@ - 49aecdae2fba1730b5eda4f249e194881f2ffa63 jdk7u1-b08 - 82330ae1ba8b29384644db0e3385cab88aae59c2 jdk7u2-b11 - 56b02f8ef70391a67c9fa71157a8faafbdff4b74 jdk7u2-b12 -+456ff1f14b14ef8cfe47cef95c8094f8443fa092 jdk7u2-b13 -+62b846b0c3259cae732e75df50a1b180a2541178 jdk7u2-b21 ---- ./corba/make/common/Defs-bsd.gmk 2012-03-04 16:33:49.000000000 -0800 -+++ ./corba/make/common/Defs-bsd.gmk 2011-04-22 22:20:45.000000000 -0700 -@@ -25,9 +25,18 @@ - - # - # Makefile to specify compiler flags for programs and libraries --# targeted to Bsd. Should not contain any rules. -+# targeted to BSD. Should not contain any rules. - # - -+# Warning: the following variables are overriden by Defs.gmk. Set -+# values will be silently ignored: -+# CFLAGS (set $(OTHER_CFLAGS) instead) -+# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) -+# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) -+# LDFLAGS (set $(OTHER_LDFAGS) instead) -+# LDLIBS (set $(EXTRA_LIBS) instead) -+# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) -+ - # Get shared JDK settings - include $(BUILDDIR)/common/shared/Defs.gmk - ---- ./corba/make/common/Defs.gmk 2011-11-17 21:31:14.000000000 -0800 -+++ ./corba/make/common/Defs.gmk 2011-04-22 22:20:45.000000000 -0700 -@@ -53,6 +53,28 @@ - - _OUTPUTDIR=$(TOPDIR)/build/$(PLATFORM)-$(ARCH) - -+ifneq ($(PLATFORM), windows) -+ ifdef ALT_X11_PATH -+ X11_PATH = $(ALT_X11_PATH) -+ else -+ X11_PATH = /usr/X11R6 -+ endif -+ -+ ifdef ALT_PACKAGE_PATH -+ PACKAGE_PATH = $(ALT_PACKAGE_PATH) -+ else -+ ifeq ($(PLATFORM), linux) -+ PACKAGE_PATH = /usr -+ else -+ ifeq ($(OS_VENDOR), Apple) -+ PACKAGE_PATH = /opt/local -+ else -+ PACKAGE_PATH = /usr/local -+ endif -+ endif -+ endif -+endif -+ - # - # Get platform definitions - # ---- ./corba/make/common/shared/Defs-bsd.gmk 2012-03-04 16:33:49.000000000 -0800 -+++ ./corba/make/common/shared/Defs-bsd.gmk 2011-04-22 22:20:45.000000000 -0700 -@@ -54,7 +54,7 @@ - endef - - # Location on system where jdk installs might be --USRJDKINSTANCES_PATH =/opt/java -+USRJDKINSTANCES_PATH =$(PACKAGE_PATH) - - # UNIXCOMMAND_PATH: path to where the most common Unix commands are. - # NOTE: Must end with / so that it could be empty, allowing PATH usage. -@@ -99,7 +99,7 @@ - ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined" - DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH)) - else -- DEVTOOLS_PATH =/usr/bin/ -+ DEVTOOLS_PATH =$(PACKAGE_PATH)/bin/ - endif - - # _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK. ---- ./corba/make/common/shared/Defs-utils.gmk 2011-11-17 21:31:14.000000000 -0800 -+++ ./corba/make/common/shared/Defs-utils.gmk 2011-04-22 22:20:45.000000000 -0700 -@@ -53,6 +53,13 @@ - UTILS_DEVTOOL_PATH=$(USRBIN_PATH) - endif - -+ifeq ($(PLATFORM),bsd) -+ UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) -+ UTILS_USR_BIN_PATH=$(USRBIN_PATH) -+ UTILS_CCS_BIN_PATH=$(USRBIN_PATH) -+ UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH) -+endif -+ - ifeq ($(PLATFORM),solaris) - UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) - UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH) -@@ -198,3 +205,34 @@ - ECHO = /usr/bin/echo - endif - -+# BSD specific -+ifeq ($(PLATFORM),bsd) -+ BASENAME = $(UTILS_USR_BIN_PATH)basename -+ EGREP = $(UTILS_USR_BIN_PATH)egrep -+ EXPR = $(UTILS_COMMAND_PATH)expr -+ FMT = $(UTILS_USR_BIN_PATH)fmt -+ GREP = $(UTILS_USR_BIN_PATH)grep -+ GUNZIP = $(UTILS_USR_BIN_PATH)gunzip -+ ID = $(UTILS_USR_BIN_PATH)id -+ MSGFMT = $(UTILS_DEVTOOL_PATH)msgfmt -+ SED = $(UTILS_USR_BIN_PATH)sed -+ SORT = $(UTILS_USR_BIN_PATH)sort -+ TEST = $(UTILS_COMMAND_PATH)test -+ TOUCH = $(UTILS_USR_BIN_PATH)touch -+ TRUE = $(UTILS_USR_BIN_PATH)true -+ UNAME = $(UTILS_USR_BIN_PATH)uname -+ # BSD OS_VENDOR specific -+ ifeq ($(OS_VENDOR), Apple) -+ NAWK = $(UTILS_USR_BIN_PATH)awk -+ UNZIPSFX = $(UTILS_USR_BIN_PATH)unzipsfx -+ ZIPEXE = $(UTILS_USR_BIN_PATH)zip -+ else -+ UNZIP = $(UTILS_DEVTOOL_PATH)unzip -+ endif -+ ifeq ($(OS_VENDOR), OpenBSD) -+ NAWK = $(UTILS_USR_BIN_PATH)awk -+ else -+ CPIO = $(UTILS_USR_BIN_PATH)cpio -+ TAR = $(UTILS_USR_BIN_PATH)tar -+ endif -+endif ---- ./corba/make/common/shared/Platform.gmk 2011-11-17 21:31:15.000000000 -0800 -+++ ./corba/make/common/shared/Platform.gmk 2012-02-12 13:05:33.000000000 -0800 -@@ -231,6 +231,101 @@ - MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2) - endif - -+ifeq ($(SYSTEM_UNAME), FreeBSD) -+ PLATFORM = bsd -+ OS_NAME = freebsd -+ OS_VENDOR = FreeBSD -+ REQUIRED_OS_VERSION = 6.0 -+endif -+ -+ifeq ($(SYSTEM_UNAME), Darwin) -+ PLATFORM = bsd -+ OS_NAME = darwin -+ OS_VENDOR = Apple -+ REQUIRED_OS_VERSION = 8.0 -+endif -+ -+ifeq ($(SYSTEM_UNAME), NetBSD) -+ PLATFORM = bsd -+ OS_NAME = netbsd -+ OS_VENDOR = NetBSD -+ REQUIRED_OS_VERSION = 3.0 -+endif -+ -+ifeq ($(SYSTEM_UNAME), OpenBSD) -+ PLATFORM = bsd -+ OS_NAME = openbsd -+ OS_VENDOR = OpenBSD -+ REQUIRED_OS_VERSION = 4.9 -+endif -+ -+# Platform settings specific to BSD -+ifeq ($(PLATFORM), bsd) -+ OS_VERSION := $(shell uname -r) -+ # Arch and OS name/version -+ mach := $(shell uname -m) -+ archExpr = case "$(mach)" in \ -+ i[3-9]86) \ -+ echo i586 \ -+ ;; \ -+ sparc64) \ -+ echo sparcv9 \ -+ ;; \ -+ sparc*) \ -+ echo sparc \ -+ ;; \ -+ x86_64) \ -+ echo amd64 \ -+ ;; \ -+ "Power Macintosh") \ -+ echo ppc \ -+ ;; \ -+ *) \ -+ echo $(mach) \ -+ ;; \ -+ esac -+ ARCH := $(shell $(archExpr) ) -+ ARCH_FAMILY := $(ARCH) -+ -+ # Darwin builds may be 32-bit or 64-bit data model. -+ ifeq ($(SYSTEM_UNAME), Darwin) -+ ifeq ($(ARCH), i586) -+ ifeq ($(ARCH_DATA_MODEL), 64) -+ ARCH=amd64 -+ endif -+ endif -+ endif -+ -+ # i586, sparc, and ppc are 32 bit, amd64 and sparc64 are 64 -+ ifneq (,$(findstring $(ARCH), i586 sparc ppc)) -+ ARCH_DATA_MODEL=32 -+ else -+ ARCH_DATA_MODEL=64 -+ endif -+ -+ # Need to maintain the jre/lib/i386 location for 32-bit Intel -+ ifeq ($(ARCH), i586) -+ LIBARCH = i386 -+ else -+ LIBARCH = $(ARCH) -+ endif -+ -+ # Value of Java os.arch property -+ ARCHPROP = $(LIBARCH) -+ -+ # Suffix for file bundles used in previous release -+ BUNDLE_FILE_SUFFIX=.tar.gz -+ # Minimum disk space needed as determined by running 'du -sk' on -+ # a fully built workspace. -+ REQUIRED_FREE_SPACE=1500000 -+ # How much RAM does this machine have: -+ 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 ---- ./hotspot/.hgtags 2011-11-17 21:35:50.000000000 -0800 -+++ ./hotspot/.hgtags 2012-02-26 13:59:18.000000000 -0800 -@@ -206,3 +206,5 @@ - c8abdaa56b471195aefbac6ee385d7d35b8aec74 hs22-b09 - 4061b13e3e6be63b6f157ef773f374f2355fdb48 jdk7u2-b12 - 3ba0bb2e7c8ddac172f5b995aae57329cdd2dafa hs22-b10 -+f17fe2f4b6aacc19cbb8ee39476f2f13a1c4d3cd jdk7u2-b13 -+0744602f85c6fe62255326df595785eb2b32166d jdk7u2-b21 ---- ./hotspot/agent/make/Makefile 2011-11-17 21:35:51.000000000 -0800 -+++ ./hotspot/agent/make/Makefile 2012-02-26 13:59:18.000000000 -0800 -@@ -53,6 +53,9 @@ - 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.prims \ - 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 \ -@@ -144,6 +150,8 @@ - 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 \ ---- ./hotspot/agent/src/os/bsd/BsdDebuggerLocal.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/BsdDebuggerLocal.c 2011-04-22 22:28:31.000000000 -0700 -@@ -22,6 +22,7 @@ - * - */ - -+#include <stdlib.h> - #include <jni.h> - #include "libproc.h" - -@@ -73,7 +74,7 @@ - (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 @@ - 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 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 @@ - #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 @@ - #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 */ - ---- ./hotspot/agent/src/os/bsd/Makefile 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/Makefile 2012-02-12 13:05:32.000000000 -0800 -@@ -22,7 +22,7 @@ - # - # - --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,24 @@ - libproc_impl.c \ - ps_proc.c \ - ps_core.c \ -- BsdDebuggerLocal.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 +59,19 @@ - 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) - ---- ./hotspot/agent/src/os/bsd/StubDebuggerLocal.c 1969-12-31 16:00:00.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/StubDebuggerLocal.c 2011-04-22 22:28:31.000000000 -0700 -@@ -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 <stdlib.h> -+#include <jni.h> -+ -+#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; -+} ---- ./hotspot/agent/src/os/bsd/elfmacros.h 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/elfmacros.h 2011-04-22 22:28:31.000000000 -0700 -@@ -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 - ---- ./hotspot/agent/src/os/bsd/libproc.h 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/libproc.h 2011-04-22 22:28:31.000000000 -0700 -@@ -27,7 +27,8 @@ - - #include <unistd.h> - #include <stdint.h> --#include "proc_service.h" -+#include <machine/reg.h> -+#include <proc_service.h> - - #if defined(sparc) || defined(sparcv9) - /* -@@ -50,14 +51,11 @@ - 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 @@ - - *************************************************************************************/ - --#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 @@ - 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); ---- ./hotspot/agent/src/os/bsd/libproc_impl.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/libproc_impl.c 2011-04-22 22:28:31.000000000 -0700 -@@ -174,10 +174,13 @@ - return NULL; - } - -- newlib->symtab = build_symtab(newlib->fd, libname); -+ newlib->symtab = build_symtab(newlib->fd); - 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 @@ - - 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 @@ - } - - // 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 @@ - //-------------------------------------------------------------------------- - // 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 @@ - } - - // 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 @@ - 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; - } ---- ./hotspot/agent/src/os/bsd/libproc_impl.h 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/libproc_impl.h 2011-04-22 22:28:31.000000000 -0700 -@@ -47,7 +47,7 @@ - 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 @@ - 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 @@ - 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 ---- ./hotspot/agent/src/os/bsd/mapfile 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/mapfile 2011-04-22 22:28:31.000000000 -0700 -@@ -43,13 +43,17 @@ - # 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; ---- ./hotspot/agent/src/os/bsd/proc_service.h 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/proc_service.h 1969-12-31 16:00:00.000000000 -0800 -@@ -1,76 +0,0 @@ --/* -- * Copyright (c) 2003, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef _PROC_SERVICE_H_ --#define _PROC_SERVICE_H_ -- --#include <stdio.h> --#include <thread_db.h> -- --// Bsd does not have the proc service library, though it does provide the --// thread_db library which can be used to manipulate threads without having --// to know the details of BsdThreads or NPTL -- --// copied from Solaris "proc_service.h" --typedef enum { -- PS_OK, /* generic "call succeeded" */ -- PS_ERR, /* generic error */ -- PS_BADPID, /* bad process handle */ -- PS_BADLID, /* bad lwp identifier */ -- PS_BADADDR, /* bad address */ -- PS_NOSYM, /* p_lookup() could not find given symbol */ -- PS_NOFREGS /* FPU register set not available for given lwp */ --} ps_err_e; -- --// ps_getpid() is only defined on Bsd to return a thread's process ID --pid_t ps_getpid(struct ps_prochandle *ph); -- --// 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 --// *sym_addr. -- --ps_err_e ps_pglobal_lookup(struct ps_prochandle *ph, const char *object_name, -- const char *sym_name, psaddr_t *sym_addr); -- --// read "size" bytes of data from debuggee at address "addr" --ps_err_e ps_pdread(struct ps_prochandle *ph, psaddr_t addr, -- void *buf, size_t size); -- --// 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_lsetfpregs(struct ps_prochandle *ph, lwpid_t lid, const prfpregset_t *fpregs); -- --ps_err_e ps_lsetregs(struct ps_prochandle *ph, lwpid_t lid, const prgregset_t gregset); -- --ps_err_e ps_lgetfpregs(struct ps_prochandle *ph, lwpid_t lid, prfpregset_t *fpregs); -- --ps_err_e ps_lgetregs(struct ps_prochandle *ph, lwpid_t lid, prgregset_t gregset); -- --// new libthread_db of NPTL seem to require this symbol --ps_err_e ps_get_thread_area(); -- --#endif /* _PROC_SERVICE_H_ */ ---- ./hotspot/agent/src/os/bsd/ps_core.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/ps_core.c 2011-04-22 22:28:31.000000000 -0700 -@@ -142,6 +142,7 @@ - - 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 @@ - - // 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 @@ - - 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_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 @@ - 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 @@ - 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 @@ - 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_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 @@ - 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 @@ - 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 @@ - * 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 @@ - * 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 @@ - 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 @@ - - 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 @@ - // 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,26 +880,23 @@ - // 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; - } - - // read name of the shared object -- lib_name[0] = '\0'; -- if (lib_name_addr != 0 && -- read_string(ph, (uintptr_t) lib_name_addr, lib_name, sizeof(lib_name)) != true) { -+ if (read_string(ph, (uintptr_t) lib_name_addr, lib_name, sizeof(lib_name)) != true) { - print_debug("can't read shared object name\n"); -- // don't let failure to read the name stop opening the file. If something is really wrong -- // it will fail later. -+ return false; - } - - if (lib_name[0] != '\0') { -@@ -924,7 +931,7 @@ - } - - // 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; -@@ -938,7 +945,6 @@ - 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) { ---- ./hotspot/agent/src/os/bsd/ps_proc.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/ps_proc.c 2011-04-22 22:28:31.000000000 -0700 -@@ -22,20 +22,22 @@ - * - */ - -+#include <limits.h> - #include <stdio.h> - #include <stdlib.h> - #include <string.h> - #include <errno.h> -+#include <sys/types.h> -+#include <sys/wait.h> - #include <sys/ptrace.h> -+#include <sys/param.h> -+#include <sys/user.h> -+#include <elf.h> -+#include <sys/elf_common.h> -+#include <sys/link_elf.h> -+#include <libutil.h> - #include "libproc_impl.h" -- --#if defined(x86_64) && !defined(amd64) --#define amd64 1 --#endif -- --#ifndef __WALL --#define __WALL 0x40000000 // Copied from /usr/include/bsd/wait.h --#endif -+#include "elfmacros.h" - - // This file has the libproc implementation specific to live process - // For core files, refer to ps_core.c -@@ -50,253 +52,359 @@ - - // 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 -- --#if defined(_LP64) && defined(PTRACE_GETREGS64) --#define PTRACE_GETREGS_REQ PTRACE_GETREGS64 --#elif defined(PTRACE_GETREGS) --#define PTRACE_GETREGS_REQ PTRACE_GETREGS --#elif defined(PT_GETREGS) --#define PTRACE_GETREGS_REQ PT_GETREGS --#endif -- --#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 - // ------------------------------------------------------- - --/* -- * 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_ -- */ --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; -- -- // skipping leading blanks -- while(*str&&*str==delim) str++; -- -- while(*str&&i<n){ -- ptrs[i++] = str; -- while(*str&&*str!=delim) str++; -- while(*str&&*str==delim) *(str++) = new_delim; -- } -- -- return i; -+// 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 - /* -- * fgets without storing '\n' at the end of the string -+ * TEXT_START_ADDR from binutils/ld/emulparams/<arch_spec>.sh -+ * Not the most robust but good enough. - */ --static char * fgets_no_cr(char * buf, int n, FILE *fp) --{ -- char * rslt = fgets(buf, n, fp); -- if (rslt && buf && *buf){ -- char *p = strchr(buf, '\0'); -- if (*--p=='\n') *p='\0'; -- } -- return rslt; --} - --// 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(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 -+ -+#define BUF_SIZE (PATH_MAX + NAME_MAX + 1) -+ -+uintptr_t linkmap_addr(struct ps_prochandle *ph) { -+ uintptr_t ehdr_addr, phdr_addr, dyn_addr, dmap_addr, lmap_addr; -+ ELF_EHDR ehdr; -+ ELF_PHDR *phdrs, *phdr; -+ ELF_DYN *dyns, *dyn; -+ struct r_debug dmap; -+ unsigned long hdrs_size; -+ unsigned int i; -+ -+ /* read ELF_EHDR at TEXT_START_ADDR and validate */ -+ -+ ehdr_addr = (uintptr_t)TEXT_START_ADDR; -+ -+ if (process_read_data(ph, ehdr_addr, (char *)&ehdr, sizeof(ehdr)) != true) { -+ print_debug("process_read_data failed for ehdr_addr %p\n", ehdr_addr); -+ return (0); -+ } -+ -+ if (!IS_ELF(ehdr) || -+ ehdr.e_ident[EI_CLASS] != ELF_TARG_CLASS || -+ ehdr.e_ident[EI_DATA] != ELF_TARG_DATA || -+ ehdr.e_ident[EI_VERSION] != EV_CURRENT || -+ ehdr.e_phentsize != sizeof(ELF_PHDR) || -+ ehdr.e_version != ELF_TARG_VER || -+ ehdr.e_machine != ELF_TARG_MACH) { -+ print_debug("not an ELF_EHDR at %p\n", ehdr_addr); -+ return (0); -+ } -+ -+ /* allocate space for all ELF_PHDR's and read */ -+ -+ phdr_addr = ehdr_addr + ehdr.e_phoff; -+ hdrs_size = ehdr.e_phnum * sizeof(ELF_PHDR); -+ -+ if ((phdrs = malloc(hdrs_size)) == NULL) -+ return (0); -+ -+ if (process_read_data(ph, phdr_addr, (char *)phdrs, hdrs_size) != true) { -+ print_debug("process_read_data failed for phdr_addr %p\n", phdr_addr); -+ return (0); -+ } -+ -+ /* find PT_DYNAMIC section */ -+ -+ for (i = 0, phdr = phdrs; i < ehdr.e_phnum; i++, phdr++) { -+ if (phdr->p_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; -- -- 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; -+#if defined(__FreeBSD__) && __FreeBSD_version >= 701000 -+ struct kinfo_vmentry *freep, *kve; -+ int i, cnt; -+ -+ 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; --#ifdef _LP64 -- sscanf(word[0], "%lx", &base); --#else -- sscanf(word[0], "%x", &base); --#endif -- 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 -@@ -323,21 +431,14 @@ - // 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; - } ---- ./hotspot/agent/src/os/bsd/salibelf.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/salibelf.c 2011-04-22 22:28:31.000000000 -0700 -@@ -25,6 +25,7 @@ - #include "salibelf.h" - #include <stdlib.h> - #include <unistd.h> -+#include <string.h> - - extern void print_debug(const char*,...); - ---- ./hotspot/agent/src/os/bsd/symtab.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/symtab.c 2012-02-12 13:05:32.000000000 -0800 -@@ -23,10 +23,11 @@ - */ - - #include <unistd.h> --#include <sys/procfs.h> - #include <search.h> - #include <stdlib.h> - #include <string.h> -+#include <db.h> -+#include <fcntl.h> - #include "symtab.h" - #include "salibelf.h" - -@@ -50,279 +51,12 @@ - char *strs; - size_t num_symbols; - struct elf_symbol *symbols; -- struct hsearch_data *hash_table; -+ DB* hash_table; - } symtab_t; - -- --// Directory that contains global debuginfo files. In theory it --// should be possible to change this, but in a Java environment there --// is no obvious place to put a user interface to do it. Maybe this --// could be set with an environment variable. --static const char debug_file_directory[] = "/usr/lib/debug"; -- --/* The CRC used in gnu_debuglink, retrieved from -- http://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html#Separate-Debug-Files. */ --unsigned int gnu_debuglink_crc32 (unsigned int crc, -- unsigned char *buf, size_t len) --{ -- static const unsigned int crc32_table[256] = -- { -- 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, -- 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, -- 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, -- 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, -- 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, -- 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, -- 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, -- 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, -- 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, -- 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, -- 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, -- 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, -- 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, -- 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, -- 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, -- 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, -- 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, -- 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, -- 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, -- 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, -- 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, -- 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, -- 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, -- 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, -- 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, -- 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, -- 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, -- 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, -- 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, -- 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, -- 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, -- 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, -- 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, -- 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, -- 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, -- 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, -- 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, -- 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, -- 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, -- 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, -- 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, -- 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, -- 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, -- 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, -- 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, -- 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, -- 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, -- 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, -- 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, -- 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, -- 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, -- 0x2d02ef8d -- }; -- unsigned char *end; -- -- crc = ~crc & 0xffffffff; -- for (end = buf + len; buf < end; ++buf) -- crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); -- return ~crc & 0xffffffff; --} -- --/* Open a debuginfo file and check its CRC. If it exists and the CRC -- matches return its fd. */ --static int --open_debug_file (const char *pathname, unsigned int crc) --{ -- unsigned int file_crc = 0; -- unsigned char buffer[8 * 1024]; -- -- int fd = pathmap_open(pathname); -- -- if (fd < 0) -- return -1; -- -- lseek(fd, 0, SEEK_SET); -- -- for (;;) { -- int len = read(fd, buffer, sizeof buffer); -- if (len <= 0) -- break; -- file_crc = gnu_debuglink_crc32(file_crc, buffer, len); -- } -- -- if (crc == file_crc) -- return fd; -- else { -- close(fd); -- return -1; -- } --} -- --/* Find an ELF section. */ --static struct elf_section *find_section_by_name(char *name, -- int fd, -- ELF_EHDR *ehdr, -- ELF_SHDR *shbuf, -- struct elf_section *scn_cache) --{ -- ELF_SHDR* cursct = NULL; -- char *strtab; -- int cnt; -- -- if (scn_cache[ehdr->e_shstrndx].c_data == NULL) { -- if ((scn_cache[ehdr->e_shstrndx].c_data -- = read_section_data(fd, ehdr, cursct)) == NULL) { -- return NULL; -- } -- } -- -- strtab = scn_cache[ehdr->e_shstrndx].c_data; -- -- for (cursct = shbuf, cnt = 0; -- cnt < ehdr->e_shnum; -- cnt++, cursct++) { -- if (strcmp(cursct->sh_name + strtab, name) == 0) { -- scn_cache[cnt].c_data = read_section_data(fd, ehdr, cursct); -- return &scn_cache[cnt]; -- } -- } -- -- return NULL; --} -- --/* Look for a ".gnu_debuglink" section. If one exists, try to open a -- suitable debuginfo file. */ --static int open_file_from_debug_link(const char *name, -- int fd, -- ELF_EHDR *ehdr, -- ELF_SHDR *shbuf, -- struct elf_section *scn_cache) --{ -- int debug_fd; -- struct elf_section *debug_link = find_section_by_name(".gnu_debuglink", fd, ehdr, -- shbuf, scn_cache); -- if (debug_link == NULL) -- return -1; -- char *debug_filename = debug_link->c_data; -- int offset = (strlen(debug_filename) + 4) >> 2; -- static unsigned int crc; -- crc = ((unsigned int*)debug_link->c_data)[offset]; -- char *debug_pathname = malloc(strlen(debug_filename) -- + strlen(name) -- + strlen(".debug/") -- + strlen(debug_file_directory) -- + 2); -- strcpy(debug_pathname, name); -- char *last_slash = strrchr(debug_pathname, '/'); -- if (last_slash == NULL) -- return -1; -- -- /* Look in the same directory as the object. */ -- strcpy(last_slash+1, debug_filename); -- -- debug_fd = open_debug_file(debug_pathname, crc); -- if (debug_fd >= 0) { -- free(debug_pathname); -- return debug_fd; -- } -- -- /* Look in a subdirectory named ".debug". */ -- strcpy(last_slash+1, ".debug/"); -- strcat(last_slash, debug_filename); -- -- debug_fd = open_debug_file(debug_pathname, crc); -- if (debug_fd >= 0) { -- free(debug_pathname); -- return debug_fd; -- } -- -- /* Look in /usr/lib/debug + the full pathname. */ -- strcpy(debug_pathname, debug_file_directory); -- strcat(debug_pathname, name); -- last_slash = strrchr(debug_pathname, '/'); -- strcpy(last_slash+1, debug_filename); -- -- debug_fd = open_debug_file(debug_pathname, crc); -- if (debug_fd >= 0) { -- free(debug_pathname); -- return debug_fd; -- } -- -- free(debug_pathname); -- return -1; --} -- --static struct symtab* build_symtab_internal(int fd, const char *filename, bool try_debuginfo); -- --/* Look for a ".gnu_debuglink" section. If one exists, try to open a -- suitable debuginfo file and read a symbol table from it. */ --static struct symtab *build_symtab_from_debug_link(const char *name, -- int fd, -- ELF_EHDR *ehdr, -- ELF_SHDR *shbuf, -- struct elf_section *scn_cache) --{ -- fd = open_file_from_debug_link(name, fd, ehdr, shbuf, scn_cache); -- -- if (fd >= 0) { -- struct symtab *symtab = build_symtab_internal(fd, NULL, /* try_debuginfo */ false); -- close(fd); -- return symtab; -- } -- -- return NULL; --} -- --// Given a build_id, find the associated debuginfo file --static char * --build_id_to_debug_filename (size_t size, unsigned char *data) --{ -- char *filename, *s; -- -- filename = malloc(strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1 -- + 2 * size + (sizeof ".debug" - 1) + 1); -- s = filename + sprintf (filename, "%s/.build-id/", debug_file_directory); -- if (size > 0) -- { -- size--; -- s += sprintf (s, "%02x", *data++); -- } -- if (size > 0) -- *s++ = '/'; -- while (size-- > 0) -- s += sprintf (s, "%02x", *data++); -- strcpy (s, ".debug"); -- -- return filename; --} -- --// Read a build ID note. Try to open any associated debuginfo file --// and return its symtab --static struct symtab* build_symtab_from_build_id(Elf64_Nhdr *note) --{ -- int fd; -- struct symtab *symtab = NULL; -- -- unsigned char *bytes -- = (unsigned char*)(note+1) + note->n_namesz; -- unsigned char *filename -- = (build_id_to_debug_filename (note->n_descsz, bytes)); -- -- fd = pathmap_open(filename); -- if (fd >= 0) { -- symtab = build_symtab_internal(fd, NULL, /* try_debuginfo */ false); -- close(fd); -- } -- free(filename); -- -- return symtab; --} -- --// read symbol table from given fd. If try_debuginfo) is true, also --// try to open an associated debuginfo file --static struct symtab* build_symtab_internal(int fd, const char *filename, bool try_debuginfo) { -+// 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 -@@ -331,8 +65,9 @@ - ELF_SHDR* shbuf = NULL; - ELF_SHDR* cursct = NULL; - ELF_PHDR* phbuf = NULL; -- ELF_PHDR* phdr = NULL; -- int sym_section = SHT_DYNSYM; -+ int symtab_found = 0; -+ int dynsym_found = 0; -+ uint32_t symsection = SHT_SYMTAB; - - uintptr_t baseaddr = (uintptr_t)-1; - -@@ -349,33 +84,39 @@ - - baseaddr = find_base_address(fd, &ehdr); - -- scn_cache = (struct elf_section *) -- calloc(ehdr.e_shnum * sizeof(struct elf_section), 1); -+ scn_cache = calloc(ehdr.e_shnum, sizeof(*scn_cache)); - if (scn_cache == NULL) { - goto quit; - } - - 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 -- || cursct->sh_type == SHT_NOTE || cursct->sh_type == SHT_DYNSYM) { +--- .hgtags 2012-05-26 23:29:10.000000000 -0700 ++++ .hgtags 2012-05-15 19:58:20.000000000 -0700 +@@ -123,6 +123,7 @@ + 2d38c2a79c144c30cd04d143d83ee7ec6af40771 jdk7-b146 + 3ac30b3852876ccad6bd61697b5f9efa91ca7bc6 jdk7u1-b01 + d91364304d7c4ecd34caffdba2b840aeb0d10b51 jdk7-b147 ++00b623147f23ef8a92a25c4c28ef8681dc1d1b52 7u0 + 34451dc0580d5c95d97b95a564e6198f36545d68 jdk7u1-b02 + bf735d852f79bdbb3373c777eec3ff27e035e7ba jdk7u1-b03 + f66a2bada589f4157789e6f66472954d2f1c114e jdk7u1-b04 +--- corba/.hgtags 2012-05-26 23:29:10.000000000 -0700 ++++ corba/.hgtags 2012-05-15 20:07:03.000000000 -0700 +@@ -123,6 +123,7 @@ + 770227a4087e4e401fe87ccd19738440111c3948 jdk7-b146 + 36f0efbc66ef8ace3cca8aa8d0c88f3334080f8a jdk7u1-b01 + 73323cb3396260d93e0ab731fd2d431096ceed0f jdk7-b147 ++578c4d2c534cc761f5f5cc0d8360471bb8d5f94f 7u0 + 9515a2d034b4727c11aeea36354a549fbc469c4f jdk7u1-b02 + dd71cb354c573c1addcda269a7dd9144bfce9587 jdk7u1-b03 + eaee830124aa453627591d8f9eccb39d7e040876 jdk7u1-b04 +--- hotspot/.hgtags 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/.hgtags 2012-05-16 19:03:30.000000000 -0700 +@@ -182,6 +182,7 @@ + 38fa55e5e79232d48f1bb8cf27d88bc094c9375a hs21-b16 + 81d815b05abb564aa1f4100ae13491c949b9a07e jdk7-b147 + 81d815b05abb564aa1f4100ae13491c949b9a07e hs21-b17 ++f1a18ada5853af49fce54d43dd5a5b67dc291470 7u0 + 9b0ca45cd756d538c4c30afab280a91868eee1a5 jdk7u2-b01 + 0cc8a70952c368e06de2adab1f2649a408f5e577 jdk8-b01 + 31e253c1da429124bb87570ab095d9bc89850d0a jdk8-b02 +--- hotspot/agent/src/os/bsd/symtab.c 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/agent/src/os/bsd/symtab.c 2012-05-16 19:16:01.000000000 -0700 +@@ -94,7 +94,7 @@ + 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) { -+ 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) { -- // Full symbol table available so use that -- sym_section = cursct->sh_type; -- } -+ -+ 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 == sym_section) { -+ if (shdr->sh_type == symsection) { - ELF_SYM *syms; -- int j, n, rslt; -+ int j, n; - size_t size; - - // FIXME: there could be multiple data buffers associated with the -@@ -383,7 +124,7 @@ - // for elf_getdata on Solaris. - - // guarantee(symtab == NULL, "multiple symtab"); -- symtab = (struct symtab*)calloc(1, sizeof(struct symtab)); -+ symtab = calloc(1, sizeof(*symtab)); - if (symtab == NULL) { - goto quit; - } -@@ -393,27 +134,32 @@ - // number of symbols - n = shdr->sh_size / shdr->sh_entsize; - -- // create hash table, we use hcreate_r, hsearch_r and hdestroy_r to -+ // create hash table, we use berkeley db to - // manipulate the hash table. -- symtab->hash_table = (struct hsearch_data*) calloc(1, sizeof(struct hsearch_data)); -- rslt = hcreate_r(n, symtab->hash_table); -- // guarantee(rslt, "unexpected failure: hcreate_r"); -+ symtab->hash_table = dbopen(NULL, O_CREAT | O_RDWR, 0600, DB_HASH, NULL); -+ // guarantee(symtab->hash_table, "unexpected failure: dbopen"); -+ if (symtab->hash_table == NULL) -+ goto bad; - - // shdr->sh_link points to the section that contains the actual strings - // for symbol names. the st_name field in ELF_SYM is just the - // string table index. we make a copy of the string table so the - // strings will not be destroyed by elf_end. - size = scn_cache[shdr->sh_link].c_shdr->sh_size; -- symtab->strs = (char *)malloc(size); -+ symtab->strs = malloc(size); -+ if (symtab->strs == NULL) -+ goto bad; - memcpy(symtab->strs, scn_cache[shdr->sh_link].c_data, size); - - // allocate memory for storing symbol offset and size; - symtab->num_symbols = n; -- symtab->symbols = (struct elf_symbol *)calloc(n , sizeof(struct elf_symbol)); -+ symtab->symbols = calloc(n , sizeof(*symtab->symbols)); -+ if (symtab->symbols == NULL) -+ goto bad; - - // copy symbols info our symtab and enter them info the hash table - for (j = 0; j < n; j++, syms++) { -- ENTRY item, *ret; -+ DBT key, value; - char *sym_name = symtab->strs + syms->st_name; - - // skip non-object and non-function symbols -@@ -427,52 +173,19 @@ - symtab->symbols[j].offset = syms->st_value - baseaddr; - symtab->symbols[j].size = syms->st_size; - -- item.key = sym_name; -- item.data = (void *)&(symtab->symbols[j]); -- -- hsearch_r(item, ENTER, &ret, symtab->hash_table); -+ key.data = sym_name; -+ key.size = strlen(sym_name) + 1; -+ value.data = &(symtab->symbols[j]); -+ value.size = sizeof(void *); -+ (*symtab->hash_table->put)(symtab->hash_table, &key, &value, 0); - } - } - } -+ goto quit; - -- // Look for a separate debuginfo file. -- if (try_debuginfo) { -- -- // We prefer a debug symtab to an object's own symtab, so look in -- // the debuginfo file. We stash a copy of the old symtab in case -- // there is no debuginfo. -- struct symtab* prev_symtab = symtab; -- symtab = NULL; -- --#ifdef NT_GNU_BUILD_ID -- // First we look for a Build ID -- for (cursct = shbuf, cnt = 0; -- symtab == NULL && cnt < ehdr.e_shnum; -- cnt++) { -- if (cursct->sh_type == SHT_NOTE) { -- Elf64_Nhdr *note = (Elf64_Nhdr *)scn_cache[cnt].c_data; -- if (note->n_type == NT_GNU_BUILD_ID) { -- symtab = build_symtab_from_build_id(note); -- } -- } -- cursct++; -- } --#endif -- -- // Then, if that doesn't work, the debug link -- if (symtab == NULL) { -- symtab = build_symtab_from_debug_link(filename, fd, &ehdr, shbuf, -- scn_cache); -- } -- -- // If we still haven't found a symtab, use the object's own symtab. -- if (symtab != NULL) { -- if (prev_symtab != NULL) -- destroy_symtab(prev_symtab); -- } else { -- symtab = prev_symtab; -- } -- } -+bad: -+ destroy_symtab(symtab); -+ symtab = NULL; - - quit: - if (shbuf) free(shbuf); -@@ -488,44 +201,36 @@ - return symtab; - } - --struct symtab* build_symtab(int fd, const char *filename) { -- return build_symtab_internal(fd, filename, /* try_debuginfo */ true); --} -- -- - void destroy_symtab(struct symtab* symtab) { - if (!symtab) return; - if (symtab->strs) free(symtab->strs); - if (symtab->symbols) free(symtab->symbols); - if (symtab->hash_table) { -- hdestroy_r(symtab->hash_table); -- free(symtab->hash_table); -+ (*symtab->hash_table->close)(symtab->hash_table); - } - free(symtab); - } - - uintptr_t search_symbol(struct symtab* symtab, uintptr_t base, - const char *sym_name, int *sym_size) { -- ENTRY item; -- ENTRY* ret = NULL; -+ DBT key, value; -+ int ret; - - // library does not have symbol table - if (!symtab || !symtab->hash_table) -- return (uintptr_t)NULL; -+ return 0; - -- item.key = (char*) strdup(sym_name); -- hsearch_r(item, FIND, &ret, symtab->hash_table); -- if (ret) { -- struct elf_symbol * sym = (struct elf_symbol *)(ret->data); -+ key.data = (char*)(uintptr_t)sym_name; -+ key.size = strlen(sym_name) + 1; -+ ret = (*symtab->hash_table->get)(symtab->hash_table, &key, &value, 0); -+ if (ret == 0) { -+ struct elf_symbol *sym = value.data; - uintptr_t rslt = (uintptr_t) ((char*)base + sym->offset); - if (sym_size) *sym_size = sym->size; -- free(item.key); - return rslt; - } - --quit: -- free(item.key); -- return (uintptr_t) NULL; -+ return 0; - } - - const char* nearest_symbol(struct symtab* symtab, uintptr_t offset, -@@ -533,12 +238,12 @@ - int n = 0; - if (!symtab) return NULL; - for (; n < symtab->num_symbols; n++) { -- struct elf_symbol* sym = &(symtab->symbols[n]); -- if (sym->name != NULL && -- offset >= sym->offset && offset < sym->offset + sym->size) { -- if (poffset) *poffset = (offset - sym->offset); -- return sym->name; -- } -+ struct elf_symbol* sym = &symtab->symbols[n]; -+ if (sym->name != NULL && -+ offset >= sym->offset && offset < sym->offset + sym->size) { -+ if (poffset) *poffset = (offset - sym->offset); -+ return sym->name; -+ } - } - return NULL; - } ---- ./hotspot/agent/src/os/bsd/symtab.h 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/symtab.h 2011-04-22 22:28:31.000000000 -0700 -@@ -32,7 +32,7 @@ - struct symtab; - - // build symbol table for a given ELF file descriptor --struct symtab* build_symtab(int fd, const char *filename); -+struct symtab* build_symtab(int fd); - - // destroy the symbol table - void destroy_symtab(struct symtab* symtab); ---- ./hotspot/agent/src/os/bsd/test.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/os/bsd/test.c 2011-04-22 22:28:31.000000000 -0700 -@@ -44,7 +44,7 @@ - } - - default: { -- printf("usage %s <pid> or %s <exec file> <core file>\n"); -+ fprintf(stderr, "usage %s <pid> or %s <exec file> <core file>\n", argv[0], argv[0]); - return 1; - } - } ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2011-11-17 21:35:59.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2012-02-26 15:32:26.000000000 -0800 -@@ -32,6 +32,7 @@ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2012-05-16 19:03:30.000000000 -0700 +@@ -33,6 +33,7 @@ import sun.jvm.hotspot.debugger.remote.*; import sun.jvm.hotspot.debugger.windbg.*; import sun.jvm.hotspot.debugger.linux.*; @@ -2421,70 +49,9 @@ import sun.jvm.hotspot.memory.*; import sun.jvm.hotspot.oops.*; import sun.jvm.hotspot.runtime.*; -@@ -335,6 +336,8 @@ - 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"); -@@ -390,6 +393,10 @@ - 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)"); - } -@@ -477,6 +484,8 @@ - setupJVMLibNamesWin32(); - } else if (os.equals("linux")) { - setupJVMLibNamesLinux(); -+ } else if (os.equals("bsd")) { -+ setupJVMLibNamesBsd(); - } else { - throw new RuntimeException("Unknown OS type"); - } -@@ -554,6 +563,31 @@ - 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" }; -+ } -+ - /** Convenience routine which should be called by per-platform - debugger setup. Should not be called when startupMode is - REMOTE_MODE. */ ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java 2011-11-17 21:36:06.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java 2012-02-26 15:33:13.000000000 -0800 -@@ -34,6 +34,7 @@ +--- hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java 2012-05-16 19:03:30.000000000 -0700 +@@ -35,6 +35,7 @@ import sun.jvm.hotspot.debugger.windbg.*; import sun.jvm.hotspot.debugger.linux.*; import sun.jvm.hotspot.debugger.sparc.*; @@ -2492,1937 +59,103 @@ import sun.jvm.hotspot.debugger.remote.*; import sun.jvm.hotspot.livejvm.*; import sun.jvm.hotspot.memory.*; -@@ -514,6 +515,8 @@ - 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"); -@@ -565,6 +568,9 @@ - } 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)"); - } -@@ -666,6 +672,8 @@ - setupJVMLibNamesWin32(); - } else if (os.equals("linux")) { - setupJVMLibNamesLinux(); -+ } else if (os.equals("bsd")) { -+ setupJVMLibNamesBsd(); - } else { - throw new RuntimeException("Unknown OS type"); - } -@@ -745,6 +753,34 @@ - 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(); -+ } -+ - /** Convenience routine which should be called by per-platform - debugger setup. Should not be called when startupMode is - REMOTE_MODE. */ ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java 2011-04-22 22:28:32.000000000 -0700 -@@ -30,10 +30,8 @@ - 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 @@ - 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"); - } ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java 2011-04-22 22:28:32.000000000 -0700 -@@ -26,9 +26,7 @@ - - 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 @@ - 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"); - } ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/ia64/BsdIA64ThreadContext.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/ia64/BsdIA64ThreadContext.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,46 +0,0 @@ --/* -- * Copyright (c) 2003, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --package sun.jvm.hotspot.debugger.bsd.ia64; -- --import sun.jvm.hotspot.debugger.*; --import sun.jvm.hotspot.debugger.ia64.*; --import sun.jvm.hotspot.debugger.bsd.*; -- --public class BsdIA64ThreadContext extends IA64ThreadContext { -- private BsdDebugger debugger; -- -- public BsdIA64ThreadContext(BsdDebugger debugger) { -- super(); -- this.debugger = debugger; -- } -- -- public void setRegisterAsAddress(int index, Address value) { -- setRegister(index, debugger.getAddressValue(value)); -- } -- -- public Address getRegisterAsAddress(int index) { -- return debugger.newAddress(getRegister(index)); -- } --} ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/sparc/BsdSPARCCFrame.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/sparc/BsdSPARCCFrame.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,81 +0,0 @@ --/* -- * Copyright (c) 2006, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --package sun.jvm.hotspot.debugger.bsd.sparc; -- --import sun.jvm.hotspot.debugger.*; --import sun.jvm.hotspot.debugger.sparc.*; --import sun.jvm.hotspot.debugger.bsd.*; --import sun.jvm.hotspot.debugger.cdbg.*; --import sun.jvm.hotspot.debugger.cdbg.basic.*; -- --final public class BsdSPARCCFrame extends BasicCFrame { -- // package/class internals only -- -- public BsdSPARCCFrame(BsdDebugger dbg, Address sp, Address pc, int address_size) { -- super(dbg.getCDebugger()); -- this.sp = sp; -- this.pc = pc; -- this.dbg = dbg; -- this.address_size=address_size; -- if (address_size==8) SPARC_STACK_BIAS = 0x7ff; -- else SPARC_STACK_BIAS = 0x0; -- } -- -- // override base class impl to avoid ELF parsing -- public ClosestSymbol closestSymbolToPC() { -- // try native lookup in debugger. -- return dbg.lookup(dbg.getAddressValue(pc())); -- } -- -- public Address pc() { -- return pc; -- } -- -- public Address localVariableBase() { -- return sp; -- } -- -- public CFrame sender() { -- if (sp == null) { -- return null; -- } -- -- Address nextSP = sp.getAddressAt( SPARCThreadContext.R_SP * address_size + SPARC_STACK_BIAS); -- if (nextSP == null) { -- return null; -- } -- Address nextPC = sp.getAddressAt(SPARCThreadContext.R_O7 * address_size + SPARC_STACK_BIAS); -- if (nextPC == null) { -- return null; -- } -- return new BsdSPARCCFrame(dbg, nextSP, nextPC,address_size); -- } -- -- public static int SPARC_STACK_BIAS; -- private static int address_size; -- private Address pc; -- private Address sp; -- private BsdDebugger dbg; --} ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/sparc/BsdSPARCThreadContext.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/sparc/BsdSPARCThreadContext.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,46 +0,0 @@ --/* -- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --package sun.jvm.hotspot.debugger.bsd.sparc; -- --import sun.jvm.hotspot.debugger.*; --import sun.jvm.hotspot.debugger.sparc.*; --import sun.jvm.hotspot.debugger.bsd.*; -- --public class BsdSPARCThreadContext extends SPARCThreadContext { -- private BsdDebugger debugger; -- -- public BsdSPARCThreadContext(BsdDebugger debugger) { -- super(); -- this.debugger = debugger; -- } -- -- public void setRegisterAsAddress(int index, Address value) { -- setRegister(index, debugger.getAddressValue(value)); -- } -- -- public Address getRegisterAsAddress(int index) { -- return debugger.newAddress(getRegister(index)); -- } --} ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java 2011-11-17 21:36:30.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java 2011-04-22 22:28:32.000000000 -0700 -@@ -37,6 +37,8 @@ - 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 @@ - } 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) { ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java 2011-04-22 22:28:32.000000000 -0700 -@@ -28,37 +28,36 @@ - 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) { ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_ia64/BsdIA64JavaThreadPDAccess.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_ia64/BsdIA64JavaThreadPDAccess.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,137 +0,0 @@ --/* -- * Copyright (c) 2003, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --package sun.jvm.hotspot.runtime.bsd_ia64; -- --import java.io.*; --import java.util.*; --import sun.jvm.hotspot.debugger.*; --import sun.jvm.hotspot.debugger.ia64.*; --import sun.jvm.hotspot.runtime.*; --import sun.jvm.hotspot.runtime.ia64.*; --import sun.jvm.hotspot.types.*; --import sun.jvm.hotspot.utilities.*; -- --public class BsdIA64JavaThreadPDAccess implements JavaThreadPDAccess { -- // private static AddressField lastJavaPCField; -- // private static AddressField lastJavaFPField; -- private static AddressField lastJavaIFrameField; -- private static AddressField osThreadField; -- -- // Field from OSThread -- private static CIntegerField osThreadPThreadIDField; -- -- // This is currently unneeded but is being kept in case we change -- // the currentFrameGuess algorithm -- private static final long GUESS_SCAN_RANGE = 128 * 1024; -- -- static { -- VM.registerVMInitializedObserver(new Observer() { -- public void update(Observable o, Object data) { -- initialize(VM.getVM().getTypeDataBase()); -- } -- }); -- } -- -- private static synchronized void initialize(TypeDataBase db) { -- Type type = db.lookupType("JavaThread"); -- -- lastJavaIFrameField = type.getAddressField("_last_Java_iframe"); -- osThreadField = type.getAddressField("_osthread"); -- -- type = db.lookupType("OSThread"); -- osThreadPThreadIDField = type.getCIntegerField("_pthread_id"); -- } -- -- public Address getLastJavaIFrame(Address addr) { -- return lastJavaIFrameField.getValue(addr); -- } -- -- -- public Address getBaseOfStackPointer(Address addr) { -- return null; -- } -- -- public Address getLastJavaFP(Address addr) { -- return null; // Not in 1.4.1 -- } -- -- public Address getLastJavaPC(Address addr) { -- return null; // Not in 1.4.1 -- } -- -- public boolean isInterpretedFrame() { -- -- // In 1.4.1 there are only interpreted frames -- // and there is no pc -- return true; -- } -- -- public Frame getLastFramePD(JavaThread thread, Address addr) { -- // The thread is the JavaThread that contains "this" -- // so we don't need any new accessor at the JavaThread level -- Address iframe = getLastJavaIFrame(addr); -- Address pc = thread.getLastJavaPC(); -- if (iframe == null) { -- return null; // no information -- } -- return new IA64Frame(thread.getLastJavaSP(), iframe, pc); -- } -- -- public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) { -- return new IA64RegisterMap(thread, updateMap); -- } -- -- public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { -- return getLastFramePD(thread, addr); -- } -- -- public void printThreadIDOn(Address addr, PrintStream tty) { -- tty.print(getThreadProxy(addr)); -- } -- -- public void printInfoOn(Address threadAddr, PrintStream tty) { -- tty.print("Thread id: "); -- printThreadIDOn(threadAddr, tty); -- tty.println("\nLastJavaIFrame: " + getLastJavaIFrame(threadAddr)); -- } -- -- public Address getLastSP(Address addr) { -- ThreadProxy t = getThreadProxy(addr); -- IA64ThreadContext context = (IA64ThreadContext) t.getContext(); -- return context.getRegisterAsAddress(IA64ThreadContext.SP); -- } -- -- public ThreadProxy getThreadProxy(Address addr) { -- // Addr is the address of the JavaThread. -- // Fetch the OSThread (for now and for simplicity, not making a -- // separate "OSThread" class in this package) -- Address osThreadAddr = osThreadField.getValue(addr); -- // Get the address of the _pthread_id from the OSThread -- Address pthreadIdAddr = osThreadAddr.addOffsetTo(osThreadPThreadIDField.getOffset()); -- -- JVMDebugger debugger = VM.getVM().getDebugger(); -- return debugger.getThreadForIdentifierAddress(pthreadIdAddr); -- } --} ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_sparc/BsdSPARCJavaThreadPDAccess.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_sparc/BsdSPARCJavaThreadPDAccess.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,165 +0,0 @@ --/* -- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --package sun.jvm.hotspot.runtime.bsd_sparc; -- --import java.io.*; --import java.util.*; --import sun.jvm.hotspot.debugger.*; --import sun.jvm.hotspot.debugger.sparc.*; --import sun.jvm.hotspot.runtime.*; --import sun.jvm.hotspot.runtime.sparc.*; --import sun.jvm.hotspot.types.*; --import sun.jvm.hotspot.utilities.*; -- --public class BsdSPARCJavaThreadPDAccess implements JavaThreadPDAccess { -- private static AddressField baseOfStackPointerField; -- private static AddressField postJavaStateField; -- private static AddressField osThreadField; -- private static int isPC; -- private static int hasFlushed; -- -- // Field from OSThread -- private static CIntegerField osThreadThreadIDField; -- -- static { -- VM.registerVMInitializedObserver(new Observer() { -- public void update(Observable o, Object data) { -- initialize(VM.getVM().getTypeDataBase()); -- } -- }); -- } -- -- private static synchronized void initialize(TypeDataBase db) { -- Type type = db.lookupType("JavaThread"); -- Type anchorType = db.lookupType("JavaFrameAnchor"); -- -- osThreadField = type.getAddressField("_osthread"); -- hasFlushed = db.lookupIntConstant("JavaFrameAnchor::flushed").intValue(); -- -- type = db.lookupType("OSThread"); -- osThreadThreadIDField = type.getCIntegerField("_thread_id"); -- } -- -- public Address getLastJavaFP(Address addr) { -- return null; -- -- } -- -- public Address getLastJavaPC(Address addr) { -- return null; -- } -- -- public Address getBaseOfStackPointer(Address addr) { -- return baseOfStackPointerField.getValue(addr); -- } -- -- public Frame getLastFramePD(JavaThread thread, Address addr) { -- -- // This assert doesn't work in the debugging case for threads -- // which are running Java code and which haven't re-entered the -- // runtime (e.g., through a Method.invoke() or otherwise). They -- // haven't yet "decached" their last Java stack pointer to the -- // thread. -- -- // if (Assert.ASSERTS_ENABLED) { -- // Assert.that(hasLastJavaFrame(), "must have last_Java_sp() when suspended"); -- // // FIXME: add assertion about flushing register windows for runtime system -- // // (not appropriate for debugging system, though, unless at safepoin t) -- // } -- -- // FIXME: I don't think this is necessary, but might be useful -- // while debugging -- if (thread.getLastJavaSP() == null) { -- return null; -- } -- -- // sparc does a lazy window flush. The _flags field of the JavaFrameAnchor -- // encodes whether the windows have flushed. Whenever the windows have flushed -- // there will be a last_Java_pc. -- // In a relective system we'd have to do something to force the thread to flush -- // its windows and give us the pc (or the younger_sp so we can find it ourselves) -- // In a debugger situation (process or core) the flush should have happened and -- // so if we don't have the younger sp we can find it -- // -- if (thread.getLastJavaPC() != null) { -- return new SPARCFrame(SPARCFrame.biasSP(thread.getLastJavaSP()), thread.getLastJavaPC()); -- } else { -- Frame top = getCurrentFrameGuess(thread, addr); -- return new SPARCFrame(SPARCFrame.biasSP(thread.getLastJavaSP()), -- SPARCFrame.biasSP(SPARCFrame.findYoungerSP(top.getSP(), thread.getLastJavaSP())), -- false); -- } -- -- -- } -- -- public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) { -- return new SPARCRegisterMap(thread, updateMap); -- } -- -- public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { -- ThreadProxy t = getThreadProxy(addr); -- SPARCThreadContext context = (SPARCThreadContext) t.getContext(); -- // For now, let's see what happens if we do a similar thing to -- // what the runtime code does. I suspect this may cause us to lose -- // the top frame from the stack. -- Address sp = context.getRegisterAsAddress(SPARCThreadContext.R_SP); -- Address pc = context.getRegisterAsAddress(SPARCThreadContext.R_PC); -- -- if ((sp == null) || (pc == null)) { -- // Problems (have not hit this case so far, but would be bad to continue if we did) -- return null; -- } -- -- return new SPARCFrame(sp, pc); -- } -- -- -- public void printThreadIDOn(Address addr, PrintStream tty) { -- tty.print(getThreadProxy(addr)); -- } -- -- public Address getLastSP(Address addr) { -- ThreadProxy t = getThreadProxy(addr); -- SPARCThreadContext context = (SPARCThreadContext) t.getContext(); -- return SPARCFrame.unBiasSP(context.getRegisterAsAddress(SPARCThreadContext.R_SP)); -- } -- -- public void printInfoOn(Address threadAddr, PrintStream tty) { -- } -- -- public ThreadProxy getThreadProxy(Address addr) { -- // Fetch the OSThread (for now and for simplicity, not making a -- // separate "OSThread" class in this package) -- Address osThreadAddr = osThreadField.getValue(addr); -- // Get the address of the thread ID from the OSThread -- Address tidAddr = osThreadAddr.addOffsetTo(osThreadThreadIDField.getOffset()); -- -- JVMDebugger debugger = VM.getVM().getDebugger(); -- return debugger.getThreadForIdentifierAddress(tidAddr); -- } -- -- --} ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java 2011-04-22 22:28:32.000000000 -0700 -@@ -28,37 +28,36 @@ - 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) { ---- ./hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java 2011-11-17 21:36:36.000000000 -0800 -+++ ./hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java 2011-04-22 22:28:33.000000000 -0700 -@@ -37,6 +37,14 @@ - 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 { ---- ./hotspot/make/Makefile 2011-11-17 21:36:44.000000000 -0800 -+++ ./hotspot/make/Makefile 2012-02-26 13:59:18.000000000 -0800 -@@ -323,28 +323,28 @@ - ifneq ($(OSNAME),windows) - ifeq ($(ZERO_BUILD), true) - ifeq ($(SHARK_BUILD), true) --$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(SHARK_DIR)/%.so -+$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) --$(EXPORT_SERVER_DIR)/%.so: $(SHARK_DIR)/%.so -+$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) - else --$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so -+$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) --$(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so -+$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) - endif - else --$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so -+$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) --$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so -+$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) --$(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so -+$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) --$(EXPORT_CLIENT_DIR)/64/%.so: $(C1_DIR)/%.so -+$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) --$(EXPORT_SERVER_DIR)/%.so: $(C2_DIR)/%.so -+$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) --$(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so -+$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) - $(install-file) - - # Debug info for shared library ---- ./hotspot/make/bsd/Makefile 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/Makefile 2012-03-03 21:34:36.000000000 -0800 -@@ -39,11 +39,11 @@ - # One can set ALT_BOOTDIR or BOOTDIR to point to a jdk that runs on - # an architecture that differs from the target architecture, as long - # as the bootstrap jdk runs under the same flavor of OS as the target --# (i.e., if the target is bsd, point to a jdk that runs on a bsd -+# (i.e., if the target is linux, point to a jdk that runs on a linux - # box). In order to use such a bootstrap jdk, set the make variable - # REMOTE to the desired remote command mechanism, e.g., - # --# make REMOTE="rsh -l me myotherbsdbox" -+# make REMOTE="rsh -l me myotherlinuxbox" - - # Along with VM, Serviceability Agent (SA) is built for SA/JDI binding. - # JDI binding on SA produces two binaries: -@@ -94,7 +94,7 @@ - # - # We only do this on SunOS variants, for a couple of reasons: - # * It is extremely rare that source trees exist on other systems --# * It has been claimed that the Bsd automounter is flakey, so -+# * It has been claimed that the Linux automounter is flakey, so - # changing GAMMADIR in a way that exercises the automounter could - # prove to be a source of unreliability in the build process. - # Obviously, this Makefile is only relevant on SunOS boxes to begin -@@ -227,11 +227,12 @@ - - checks: check_os_version check_j2se_version - --# We do not want people accidentally building on old systems (e.g. Bsd 2.2.x, -+# We do not want people accidentally building on old systems (e.g. Linux 2.2.x, - # Solaris 2.5.1, 2.6). - # Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok. - --SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% -+#SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% -+DISABLE_HOTSPOT_OS_VERSION_CHECK = ok - OS_VERSION := $(shell uname -r) - EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION)) - ---- ./hotspot/make/bsd/makefiles/buildtree.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/buildtree.make 2012-03-03 19:50:46.000000000 -0800 -@@ -325,10 +325,11 @@ - [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \ - { \ - echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \ -+ echo "DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \ - echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ - } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ - echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ -- echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ -+ echo "export JAVA_HOME LD_LIBRARY_PATH DYLD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ - ) > $@ - - env.csh: env.sh -@@ -393,6 +394,7 @@ - echo '#!/bin/sh'; \ - $(BUILDTREE_COMMENT); \ - echo '. ./env.sh'; \ -+ echo "exit 0;"; \ - echo "if [ \"$(CROSS_COMPILE_ARCH)\" != \"\" ]; then { $(CROSS_COMPILING_MSG); exit 0; }; fi"; \ - echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ - echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ ---- ./hotspot/make/bsd/makefiles/cscope.make 1969-12-31 16:00:00.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/cscope.make 2011-04-22 22:28:33.000000000 -0700 -@@ -0,0 +1,160 @@ -+# -+# Copyright (c) 2005, 2008, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+# or visit www.oracle.com if you need additional information or have any -+# questions. -+# -+# -+ -+# -+# The cscope.out file is made in the current directory and spans the entire -+# source tree. -+# -+# Things to note: -+# 1. We use relative names for cscope. -+# 2. We *don't* remove the old cscope.out file, because cscope is smart -+# enough to only build what has changed. It can be confused, however, -+# if files are renamed or removed, so it may be necessary to manually -+# remove cscope.out if a lot of reorganization has occurred. -+# -+ -+include $(GAMMADIR)/make/scm.make -+ -+NAWK = awk -+RM = rm -f -+HG = hg -+CS_TOP = ../.. -+ -+CSDIRS = $(CS_TOP)/src $(CS_TOP)/build -+CSINCS = $(CSDIRS:%=-I%) -+ -+CSCOPE = cscope -+CSCOPE_FLAGS = -b -+ -+# Allow .java files to be added from the environment (CSCLASSES=yes). -+ifdef CSCLASSES -+ADDCLASSES= -o -name '*.java' -+endif -+ -+# Adding CClassHeaders also pushes the file count of a full workspace up about -+# 200 files (these files also don't exist in a new workspace, and thus will -+# cause the recreation of the database as they get created, which might seem -+# a little confusing). Thus allow these files to be added from the environment -+# (CSHEADERS=yes). -+ifndef CSHEADERS -+RMCCHEADERS= -o -name CClassHeaders -+endif -+ -+# Use CS_GENERATED=x to include auto-generated files in the build directories. -+ifdef CS_GENERATED -+CS_ADD_GENERATED = -o -name '*.incl' -+else -+CS_PRUNE_GENERATED = -o -name '${OS}_*_core' -o -name '${OS}_*_compiler?' -+endif -+ -+# OS-specific files for other systems are excluded by default. Use CS_OS=yes -+# to include platform-specific files for other platforms. -+ifndef CS_OS -+CS_OS = linux macos solaris win32 bsd -+CS_PRUNE_OS = $(patsubst %,-o -name '*%*',$(filter-out ${OS},${CS_OS})) -+endif -+ -+# Processor-specific files for other processors are excluded by default. Use -+# CS_CPU=x to include platform-specific files for other platforms. -+ifndef CS_CPU -+CS_CPU = i486 sparc amd64 ia64 -+CS_PRUNE_CPU = $(patsubst %,-o -name '*%*',$(filter-out ${SRCARCH},${CS_CPU})) -+endif -+ -+# What files should we include? A simple rule might be just those files under -+# SCCS control, however this would miss files we create like the opcodes and -+# CClassHeaders. The following attempts to find everything that is *useful*. -+# (.del files are created by sccsrm, demo directories contain many .java files -+# that probably aren't useful for development, and the pkgarchive may contain -+# duplicates of files within the source hierarchy). -+ -+# Directories to exclude. -+CS_PRUNE_STD = $(SCM_DIRS) \ -+ -o -name '.del-*' \ -+ -o -name '*demo' \ -+ -o -name pkgarchive -+ -+CS_PRUNE = $(CS_PRUNE_STD) \ -+ $(CS_PRUNE_OS) \ -+ $(CS_PRUNE_CPU) \ -+ $(CS_PRUNE_GENERATED) \ -+ $(RMCCHEADERS) -+ -+# File names to include. -+CSFILENAMES = -name '*.[ch]pp' \ -+ -o -name '*.[Ccshlxy]' \ -+ $(CS_ADD_GENERATED) \ -+ -o -name '*.il' \ -+ -o -name '*.cc' \ -+ -o -name '*[Mm]akefile*' \ -+ -o -name '*.gmk' \ -+ -o -name '*.make' \ -+ -o -name '*.ad' \ -+ $(ADDCLASSES) -+ -+.PRECIOUS: cscope.out -+ -+cscope cscope.out: cscope.files FORCE -+ $(CSCOPE) $(CSCOPE_FLAGS) -+ -+# The .raw file is reordered here in an attempt to make cscope display the most -+# relevant files first. -+cscope.files: .cscope.files.raw -+ echo "$(CSINCS)" > $@ -+ -egrep -v "\.java|\/make\/" $< >> $@ -+ -fgrep ".java" $< >> $@ -+ -fgrep "/make/" $< >> $@ -+ -+.cscope.files.raw: .nametable.files -+ -find $(CSDIRS) -type d \( $(CS_PRUNE) \) -prune -o \ -+ -type f \( $(CSFILENAMES) \) -print > $@ -+ -+cscope.clean: nametable.clean -+ -$(RM) cscope.out cscope.files .cscope.files.raw -+ -+TAGS: cscope.files FORCE -+ egrep -v '^-|^$$' $< | etags --members - -+ -+TAGS.clean: nametable.clean -+ -$(RM) TAGS -+ -+# .nametable.files and .nametable.files.tmp are used to determine if any files -+# were added to/deleted from/renamed in the workspace. If not, then there's -+# normally no need to rebuild the cscope database. To force a rebuild of -+# the cscope database: gmake nametable.clean. -+.nametable.files: .nametable.files.tmp -+ ( cmp -s $@ $< ) || ( cp $< $@ ) -+ -$(RM) $< -+ -+# `hg status' is slightly faster than `hg fstatus'. Both are -+# quite a bit slower on an NFS mounted file system, so this is -+# really geared towards repos on local file systems. -+.nametable.files.tmp: -+ -$(HG) fstatus -acmn > $@ -+nametable.clean: -+ -$(RM) .nametable.files .nametable.files.tmp -+ -+FORCE: -+ -+.PHONY: cscope cscope.clean TAGS.clean nametable.clean FORCE ---- ./hotspot/make/bsd/makefiles/defs.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/defs.make 2012-03-03 21:33:09.000000000 -0800 -@@ -72,8 +72,8 @@ - HS_ARCH = sparc - endif - --# x86_64 --ifeq ($(ARCH), x86_64) -+# amd64 -+ifeq ($(ARCH), amd64) - ifeq ($(ARCH_DATA_MODEL), 64) - ARCH_DATA_MODEL = 64 - MAKE_ARGS += LP64=1 -@@ -85,17 +85,27 @@ - PLATFORM = bsd-i586 - VM_PLATFORM = bsd_i486 - HS_ARCH = x86 -- # We have to reset ARCH to i686 since SRCARCH relies on it -- ARCH = i686 -+ # We have to reset ARCH to i386 since SRCARCH relies on it -+ ARCH = i386 - endif - endif - --# i686 --ifeq ($(ARCH), i686) -- ARCH_DATA_MODEL = 32 -- PLATFORM = bsd-i586 -- VM_PLATFORM = bsd_i486 -- HS_ARCH = x86 -+# i386 -+ifeq ($(ARCH), i386) -+ ifeq ($(ARCH_DATA_MODEL), 64) -+ ARCH_DATA_MODEL = 64 -+ MAKE_ARGS += LP64=1 -+ PLATFORM = bsd-amd64 -+ VM_PLATFORM = bsd_amd64 -+ HS_ARCH = x86 -+ # We have to reset ARCH to amd64 since SRCARCH relies on it -+ ARCH = amd64 -+ else -+ ARCH_DATA_MODEL = 32 -+ PLATFORM = bsd-i586 -+ VM_PLATFORM = bsd_i486 -+ HS_ARCH = x86 -+ endif - endif - - # ARM -@@ -177,13 +187,21 @@ - - JDK_INCLUDE_SUBDIR=bsd - -+# Library suffix -+OS_VENDOR:=$(shell uname -s) -+ifeq ($(OS_VENDOR),Darwin) -+ LIBRARY_SUFFIX=dylib -+else -+ LIBRARY_SUFFIX=so -+endif -+ - # FIXUP: The subdirectory for a debug build is NOT the same on all platforms - VM_DEBUG=jvmg - - EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html - - # client and server subdirectories have symbolic links to ../libjsig.so --EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so -+EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo - endif -@@ -193,7 +211,7 @@ - - ifndef BUILD_CLIENT_ONLY - EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt --EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so -+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo - endif -@@ -202,7 +220,7 @@ - ifneq ($(ZERO_BUILD), true) - ifeq ($(ARCH_DATA_MODEL), 32) - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so -+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo - endif -@@ -211,19 +229,17 @@ - - # Serviceability Binaries - # No SA Support for PPC, IA64, ARM or zero --ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \ -- $(EXPORT_LIB_DIR)/sa-jdi.jar --ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \ -- $(EXPORT_LIB_DIR)/sa-jdi.jar -+ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ -+ $(EXPORT_LIB_DIR)/sa-jdi.jar -+ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ -+ $(EXPORT_LIB_DIR)/sa-jdi.jar - ifneq ($(OBJCOPY),) - ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo - ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo - endif --ADD_SA_BINARIES/ppc = --ADD_SA_BINARIES/ia64 = --ADD_SA_BINARIES/arm = --ADD_SA_BINARIES/zero = -+ADD_SA_BINARIES/ppc = -+ADD_SA_BINARIES/ia64 = -+ADD_SA_BINARIES/arm = -+ADD_SA_BINARIES/zero = - - EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH)) -- -- ---- ./hotspot/make/bsd/makefiles/gcc.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/gcc.make 2012-03-03 19:50:46.000000000 -0800 -@@ -22,24 +22,28 @@ - # - # - -+OS_VENDOR = $(shell uname -s) -+ - #------------------------------------------------------------------------ - # CC, CPP & AS - - # When cross-compiling the ALT_COMPILER_PATH points - # to the cross-compilation toolset - ifdef CROSS_COMPILE_ARCH -+CXX = $(ALT_COMPILER_PATH)/g++ - CPP = $(ALT_COMPILER_PATH)/g++ - CC = $(ALT_COMPILER_PATH)/gcc - HOSTCPP = g++ - HOSTCC = gcc - else --CPP = g++ --CC = gcc -+CXX ?= g++ -+CPP = $(CXX) -+CC ?= gcc - HOSTCPP = $(CPP) --HOSTCC = $(CC) -+HOSTCC = $(CPP) - endif - --AS = $(CC) -c -+AS = $(CC) -c -x assembler-with-cpp - - # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only - # prints the numbers (e.g. "2.95", "3.2.1") -@@ -77,7 +81,7 @@ - CFLAGS += $(VM_PICFLAG) - CFLAGS += -fno-rtti - CFLAGS += -fno-exceptions --CFLAGS += -D_REENTRANT -+CFLAGS += -pthread - CFLAGS += -fcheck-new - # version 4 and above support fvisibility=hidden (matches jni_x86.h file) - # except 4.1.2 gives pointless warnings that can't be disabled (afaik) -@@ -91,10 +95,12 @@ - ARCHFLAG/ia64 = - ARCHFLAG/sparc = -m32 -mcpu=v9 - ARCHFLAG/sparcv9 = -m64 -mcpu=v9 --ARCHFLAG/arm = -fsigned-char - ARCHFLAG/zero = $(ZERO_ARCHFLAG) --ifndef E500V2 --ARCHFLAG/ppc = -mcpu=powerpc -+ -+# Darwin-specific build flags -+ifeq ($(OS_VENDOR), Darwin) -+ # Ineffecient 16-byte stack re-alignment on Darwin/IA32 -+ ARCHFLAG/i486 += -mstackrealign - endif - - CFLAGS += $(ARCHFLAG) -@@ -139,6 +145,11 @@ - CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) - # Special cases - CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) -+# XXXDARWIN: for _dyld_bind_fully_image_containing_address -+ifeq ($(OS_VENDOR), Darwin) -+ CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations -+endif -+ - - # The flags to use for an Optimized g++ build - OPT_CFLAGS += -O3 -@@ -184,28 +195,40 @@ - LFLAGS += -Wl,-relax - endif - --# Enable linker optimization --LFLAGS += -Xlinker -O1 -- --# 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 += $(LDFLAGS_HASH_STYLE) -- - # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. - MAPFLAG = -Xlinker --version-script=FILENAME - --# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj --SONAMEFLAG = -Xlinker -soname=SONAME -+# -+# Shared Library -+# -+ifeq ($(OS_VENDOR), Darwin) -+ # Standard linker flags -+ LFLAGS += -+ -+ # Darwin doesn't use ELF and doesn't support version scripts -+ LDNOMAP = true -+ -+ # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj -+ SONAMEFLAG = -+ -+ # Build shared library -+ SHARED_FLAG = -dynamiclib $(VM_PICFLAG) - --# Build shared library --SHARED_FLAG = -shared -+ # Keep symbols even they are not used -+ #AOUT_FLAGS += -Xlinker -export-dynamic -+else -+ # Enable linker optimization -+ LFLAGS += -Xlinker -O1 -+ -+ # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj -+ SONAMEFLAG = -Xlinker -soname=SONAME - --# Keep symbols even they are not used --AOUT_FLAGS += -Xlinker -export-dynamic -+ # Build shared library -+ SHARED_FLAG = -shared $(VM_PICFLAG) -+ -+ # Keep symbols even they are not used -+ AOUT_FLAGS += -Xlinker -export-dynamic -+endif - - #------------------------------------------------------------------------ - # Debug flags ---- ./hotspot/make/bsd/makefiles/jsig.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/jsig.make 2012-03-03 19:50:46.000000000 -0800 -@@ -25,11 +25,16 @@ - # Rules to build signal interposition library, used by vm.make - - # libjsig[_g].so: signal interposition library --JSIG = jsig --LIBJSIG = lib$(JSIG).so -+JSIG = jsig -+JSIG_G = $(JSIG)$(G_SUFFIX) - --JSIG_G = $(JSIG)$(G_SUFFIX) --LIBJSIG_G = lib$(JSIG_G).so -+ifeq ($(OS_VENDOR), Darwin) -+ LIBJSIG = lib$(JSIG).dylib -+ LIBJSIG_G = lib$(JSIG_G).dylib -+else -+ LIBJSIG = lib$(JSIG).so -+ LIBJSIG_G = lib$(JSIG_G).so -+endif - - LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo - LIBJSIG_G_DEBUGINFO = lib$(JSIG_G).debuginfo -@@ -46,7 +51,7 @@ - # cause problems with interposing. See CR: 6466665 - # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) - --LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) -+LFLAGS_JSIG += -D_GNU_SOURCE -pthread $(LDFLAGS_HASH_STYLE) - - # DEBUG_BINARIES overrides everything, use full -g debug information - ifeq ($(DEBUG_BINARIES), true) -@@ -56,7 +61,7 @@ - $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) - @echo Making signal interposition lib... - $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ -- $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl -+ $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< - $(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); } - ifneq ($(OBJCOPY),) - $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) ---- ./hotspot/make/bsd/makefiles/launcher.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/launcher.make 2011-04-22 22:28:33.000000000 -0700 +--- hotspot/make/bsd/makefiles/launcher.make 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/make/bsd/makefiles/launcher.make 2012-05-16 20:03:48.000000000 -0700 @@ -50,7 +50,7 @@ LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) else LAUNCHER.o = launcher.o -- LFLAGS_LAUNCHER += -L `pwd` +- LFLAGS_LAUNCHER += -L`pwd` + LFLAGS_LAUNCHER += -L`pwd` - LIBS_LAUNCHER += -l$(JVM) $(LIBS) - endif - ---- ./hotspot/make/bsd/makefiles/sa.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/sa.make 2011-04-23 12:15:44.000000000 -0700 -@@ -45,8 +45,8 @@ - - # gnumake 3.78.1 does not accept the *s that - # are in AGENT_FILES1 and AGENT_FILES2, so use the shell to expand them --AGENT_FILES1 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES1)) --AGENT_FILES2 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES2)) -+AGENT_FILES1 := $(shell /bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES1)) -+AGENT_FILES2 := $(shell /bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES2)) - - AGENT_FILES1_LIST := $(GENERATED)/agent1.classes.list - AGENT_FILES2_LIST := $(GENERATED)/agent2.classes.list ---- ./hotspot/make/bsd/makefiles/saproc.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/saproc.make 2012-03-03 19:50:46.000000000 -0800 -@@ -25,12 +25,16 @@ - # Rules to build serviceability agent library, used by vm.make - - # libsaproc[_g].so: serviceability agent -- --SAPROC = saproc --LIBSAPROC = lib$(SAPROC).so -- -+SAPROC = saproc - SAPROC_G = $(SAPROC)$(G_SUFFIX) --LIBSAPROC_G = lib$(SAPROC_G).so -+ -+ifeq ($(OS_VENDOR), Darwin) -+ LIBSAPROC = lib$(SAPROC).dylib -+ LIBSAPROC_G = lib$(SAPROC_G).dylib -+else -+ LIBSAPROC = lib$(SAPROC).so -+ LIBSAPROC_G = lib$(SAPROC_G).so -+endif - - LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo - LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo -@@ -39,12 +43,18 @@ - - SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) - -+ifeq ($(OS_VENDOR), FreeBSD) - SASRCFILES = $(SASRCDIR)/salibelf.c \ - $(SASRCDIR)/symtab.c \ - $(SASRCDIR)/libproc_impl.c \ - $(SASRCDIR)/ps_proc.c \ - $(SASRCDIR)/ps_core.c \ - $(SASRCDIR)/BsdDebuggerLocal.c -+SALIBS = -lutil -lthread_db -+else -+SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c -+SALIBS = -+endif - - SAMAPFILE = $(SASRCDIR)/mapfile -@@ -66,7 +76,10 @@ - endif - - --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 \ -@@ -79,12 +92,12 @@ - -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) \ - $(SA_DEBUG_CFLAGS) \ - -o $@ \ -- -lthread_db -+ $(SALIBS) - $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } - ifneq ($(OBJCOPY),) - $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) ---- ./hotspot/make/bsd/makefiles/vm.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/vm.make 2012-03-03 19:50:46.000000000 -0800 -@@ -98,6 +98,10 @@ - ${JRE_VERSION} \ - ${VM_DISTRO} - -+ifdef DEFAULT_LIBPATH -+CPPFLAGS += -DDEFAULT_LIBPATH="\"$(DEFAULT_LIBPATH)\"" -+endif -+ - # CFLAGS_WARN holds compiler options to suppress/enable warnings. - CFLAGS += $(CFLAGS_WARN/BYFILE) - -@@ -110,9 +114,11 @@ - - # Don't set excutable bit on stack segment - # the same could be done by separate execstack command -+ifneq ($(OS_VENDOR), Darwin) - LFLAGS += -Xlinker -z -Xlinker noexecstack -+endif - --LIBS += -lm -ldl -lpthread -+LIBS += -lm -pthread - - # By default, link the *.o into the library, not the executable. - LINK_INTO$(LINK_INTO) = LIBJVM -@@ -126,9 +132,15 @@ - #---------------------------------------------------------------------- - # JVM - --JVM = jvm --LIBJVM = lib$(JVM).so --LIBJVM_G = lib$(JVM)$(G_SUFFIX).so -+JVM = jvm -+ifeq ($(OS_VENDOR), Darwin) -+ LIBJVM = lib$(JVM).dylib -+ LIBJVM_G = lib$(JVM)$(G_SUFFIX).dylib -+ CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -+else -+ LIBJVM = lib$(JVM).so -+ LIBJVM_G = lib$(JVM)$(G_SUFFIX).so -+endif - - LIBJVM_DEBUGINFO = lib$(JVM).debuginfo - LIBJVM_G_DEBUGINFO = lib$(JVM)$(G_SUFFIX).debuginfo -@@ -222,15 +234,7 @@ - vm.def: $(Res_Files) $(Obj_Files) - sh $(GAMMADIR)/make/bsd/makefiles/build_vm_def.sh *.o > $@ - --ifeq ($(SHARK_BUILD), true) -- STATIC_CXX = false --else -- ifeq ($(ZERO_LIBARCH), ppc64) -- STATIC_CXX = false -- else -- STATIC_CXX = true -- endif --endif -+STATIC_CXX = false - - ifeq ($(LINK_INTO),AOUT) - LIBJVM.o = -@@ -242,14 +246,21 @@ - LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE)) - LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM)) - -+ ifeq ($(OS_VENDOR), Darwin) -+ LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/. -+ LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/.. -+ LFLAGS_VM += -Xlinker -install_name -Xlinker @rpath/$(@F) -+ endif -+ - # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to - # get around library dependency and compatibility issues. Must use gcc not - # g++ to link. - ifeq ($(STATIC_CXX), true) - LFLAGS_VM += $(STATIC_LIBGCC) - LIBS_VM += $(STATIC_STDCXX) -+ LINK_VM = $(LINK_LIB.c) - else -- LIBS_VM += -lstdc++ -+ LINK_VM = $(LINK_LIB.CC) - endif - - LIBS_VM += $(LIBS) -@@ -262,7 +273,6 @@ - LIBS_VM += $(LLVM_LIBS) - endif - --LINK_VM = $(LINK_LIB.c) - - # rule for building precompiled header - $(PRECOMPILED_HEADER): -@@ -290,11 +300,6 @@ - LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT) - endif - --# With more recent Redhat releases (or the cutting edge version Fedora), if --# SEBsd is configured to be enabled, the runtime linker will fail to apply --# the text relocation to libjvm.so considering that it is built as a non-PIC --# DSO. To workaround that, we run chcon to libjvm.so after it is built. See --# details in bug 6538311. - $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) - $(QUIETLY) { \ - echo Linking vm...; \ -@@ -304,17 +309,6 @@ - $(LINK_LIB.CC/POST_HOOK) \ - rm -f $@.1; ln -s $@ $@.1; \ - [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \ -- if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then \ -- if [ -x /usr/sbin/sebsdenabled ] ; then \ -- /usr/sbin/sebsdenabled; \ -- if [ $$? = 0 ] ; then \ -- /usr/bin/chcon -t textrel_shlib_t $@; \ -- if [ $$? != 0 ]; then \ -- echo "ERROR: Cannot chcon $@"; \ -- fi \ -- fi \ -- fi \ -- fi \ - } - ifeq ($(CROSS_COMPILE_ARCH),) - ifneq ($(OBJCOPY),) ---- ./hotspot/make/bsd/makefiles/zeroshark.make 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/makefiles/zeroshark.make 2011-04-22 22:28:33.000000000 -0700 -@@ -40,4 +40,23 @@ - CFLAGS += -D_LP64=1 - endif - -+# Specify the path to the FFI headers -+ifdef ALT_PACKAGE_PATH -+ PACKAGE_PATH = $(ALT_PACKAGE_PATH) -+else -+ ifeq ($(OS_VENDOR),Apple) -+ PACKAGE_PATH = /opt/local -+ else -+ ifeq ($(OS_VENDOR),NetBSD) -+ PACKAGE_PATH = /usr/pkg -+ LIBS += -Wl,-R${PACKAGE_PATH}/lib -+ else -+ PACKAGE_PATH = /usr/local -+ endif -+ endif -+endif -+ -+CFLAGS += -I$(PACKAGE_PATH)/include -+LIBS += -L$(PACKAGE_PATH)/lib -lffi -+ - OPT_CFLAGS/compactingPermGenGen.o = -O1 ---- ./hotspot/make/bsd/platform_amd64 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_amd64 2011-04-22 22:28:33.000000000 -0700 -@@ -12,4 +12,4 @@ - - compiler = gcc - --sysdefs = -DBSD -D_GNU_SOURCE -DAMD64 -+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 ---- ./hotspot/make/bsd/platform_amd64.suncc 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_amd64.suncc 2011-04-22 22:28:33.000000000 -0700 -@@ -14,4 +14,4 @@ - - gnu_dis_arch = amd64 - --sysdefs = -DBSD -DSPARC_WORKS -D_GNU_SOURCE -DAMD64 -+sysdefs = -D_ALLBSD_SOURCE -DSPARC_WORKS -D_GNU_SOURCE -DAMD64 ---- ./hotspot/make/bsd/platform_arm 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_arm 1969-12-31 16:00:00.000000000 -0800 -@@ -1,17 +0,0 @@ --os_family = bsd -- --arch = arm -- --arch_model = arm -- --os_arch = bsd_arm -- --os_arch_model = bsd_arm -- --lib_arch = arm -- --compiler = gcc -- --gnu_dis_arch = arm -- --sysdefs = -DBSD -D_GNU_SOURCE -DARM ---- ./hotspot/make/bsd/platform_i486 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_i486 2011-04-22 22:28:33.000000000 -0700 -@@ -12,4 +12,4 @@ - - compiler = gcc - --sysdefs = -DBSD -D_GNU_SOURCE -DIA32 -+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DIA32 ---- ./hotspot/make/bsd/platform_i486.suncc 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_i486.suncc 2011-04-22 22:28:33.000000000 -0700 -@@ -14,4 +14,4 @@ - - gnu_dis_arch = i386 - --sysdefs = -DBSD -DSPARC_WORKS -D_GNU_SOURCE -DIA32 -+sysdefs = -D_ALLBSD_SOURCE -DSPARC_WORKS -D_GNU_SOURCE -DIA32 ---- ./hotspot/make/bsd/platform_ia64 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_ia64 2011-04-22 22:28:33.000000000 -0700 -@@ -10,6 +10,6 @@ - - gnu_dis_arch = ia64 - --sysdefs = -DBSD -D_GNU_SOURCE -DIA64 -DCC_INTERP -+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DIA64 -DCC_INTERP - - mark_style = alignment ---- ./hotspot/make/bsd/platform_ppc 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_ppc 1969-12-31 16:00:00.000000000 -0800 -@@ -1,17 +0,0 @@ --os_family = bsd -- --arch = ppc -- --arch_model = ppc -- --os_arch = bsd_ppc -- --os_arch_model = bsd_ppc -- --lib_arch = ppc -- --compiler = gcc -- --gnu_dis_arch = ppc -- --sysdefs = -DBSD -D_GNU_SOURCE -DPPC ---- ./hotspot/make/bsd/platform_sparc 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_sparc 2011-04-22 22:28:33.000000000 -0700 -@@ -12,4 +12,4 @@ - - compiler = gcc - --sysdefs = -DBSD -D_GNU_SOURCE -DSPARC -+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DSPARC ---- ./hotspot/make/bsd/platform_sparcv9 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_sparcv9 2011-04-22 22:28:33.000000000 -0700 -@@ -12,4 +12,4 @@ - - compiler = gcc - --sysdefs = -DBSD -D_GNU_SOURCE -DSPARC -+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DSPARC ---- ./hotspot/make/bsd/platform_zero.in 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/make/bsd/platform_zero.in 2011-04-22 22:28:33.000000000 -0700 -@@ -14,4 +14,4 @@ - - gnu_dis_arch = zero - --sysdefs = -DBSD -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\" -+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\" ---- ./hotspot/make/cscope.make 2011-11-17 21:36:44.000000000 -0800 -+++ ./hotspot/make/cscope.make 2011-05-07 23:28:29.000000000 -0700 -@@ -63,7 +63,7 @@ - # space-separated list of identifiers to include only those systems. - ifdef CS_OS - CS_PRUNE_OS = $(patsubst %,-o -name '*%*',\ -- $(filter-out ${CS_OS},linux macos solaris windows)) -+ $(filter-out ${CS_OS},bsd linux macos solaris windows)) - endif - - # CPU-specific files for all processors are included by default. Set CS_CPU ---- ./hotspot/make/defs.make 2011-11-17 21:36:44.000000000 -0800 -+++ ./hotspot/make/defs.make 2011-04-22 22:28:33.000000000 -0700 -@@ -118,13 +118,23 @@ - # Windows should have OS predefined - ifeq ($(OS),) - OS := $(shell uname -s) -+ ifneq ($(findstring BSD,$(OS)),) -+ OS=bsd -+ endif -+ ifeq ($(OS), Darwin) -+ OS=bsd -+ endif - HOST := $(shell uname -n) - endif - --# If not SunOS and not Linux, assume Windows -+# If not SunOS, not Linux and not BSD, assume Windows - ifneq ($(OS), Linux) - ifneq ($(OS), SunOS) -- OSNAME=windows -+ ifneq ($(OS), bsd) -+ OSNAME=windows -+ else -+ OSNAME=bsd -+ endif - else - OSNAME=solaris - endif ---- ./hotspot/make/linux/makefiles/defs.make 2011-11-17 21:36:44.000000000 -0800 -+++ ./hotspot/make/linux/makefiles/defs.make 2012-02-26 15:34:17.000000000 -0800 -@@ -177,13 +177,16 @@ - - JDK_INCLUDE_SUBDIR=linux - -+# Library suffix -+LIBRARY_SUFFIX=so -+ - # FIXUP: The subdirectory for a debug build is NOT the same on all platforms - VM_DEBUG=jvmg - - EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html - - # client and server subdirectories have symbolic links to ../libjsig.so --EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so -+EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo - endif -@@ -193,7 +196,7 @@ - - ifndef BUILD_CLIENT_ONLY - EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt --EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so -+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo - endif -@@ -202,7 +205,7 @@ - ifneq ($(ZERO_BUILD), true) - ifeq ($(ARCH_DATA_MODEL), 32) - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so -+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo - endif -@@ -211,9 +214,9 @@ - - # Serviceability Binaries - # No SA Support for PPC, IA64, ARM or zero --ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \ -+ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ - $(EXPORT_LIB_DIR)/sa-jdi.jar --ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \ -+ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ - $(EXPORT_LIB_DIR)/sa-jdi.jar - ifneq ($(OBJCOPY),) - ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo ---- ./hotspot/make/sa.files 2011-11-17 21:36:45.000000000 -0800 -+++ ./hotspot/make/sa.files 2012-02-26 13:59:18.000000000 -0800 -@@ -51,6 +51,9 @@ - $(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_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 \ ---- ./hotspot/make/solaris/makefiles/defs.make 2011-11-17 21:36:47.000000000 -0800 -+++ ./hotspot/make/solaris/makefiles/defs.make 2012-02-26 15:35:23.000000000 -0800 -@@ -134,13 +134,16 @@ - - JDK_INCLUDE_SUBDIR=solaris - -+# Library suffix -+LIBRARY_SUFFIX=so -+ - # FIXUP: The subdirectory for a debug build is NOT the same on all platforms - VM_DEBUG=jvmg - - EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html - --# client and server subdirectories have symbolic links to ../libjsig.so --EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so -+# client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX) -+EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo - endif -@@ -150,9 +153,9 @@ - - ifneq ($(BUILD_CLIENT_ONLY),true) - EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt --EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so --EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.so --EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.so -+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) -+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.$(LIBRARY_SUFFIX) -+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo - EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.debuginfo -@@ -161,11 +164,11 @@ + # The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a + # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting +--- hotspot/make/bsd/makefiles/mapfile-vers-debug 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/make/bsd/makefiles/mapfile-vers-debug 2012-05-19 10:35:54.000000000 -0700 +@@ -221,6 +221,7 @@ + JVM_SetArrayElement; + JVM_SetClassSigners; + JVM_SetLength; ++ JVM_SetNativeThreadName; + JVM_SetPrimitiveArrayElement; + JVM_SetProtectionDomain; + JVM_SetSockOpt; +@@ -244,24 +245,6 @@ + JVM_Yield; + JVM_handle_bsd_signal; + +- # Old reflection routines +- # These do not need to be present in the product build in JDK 1.4 +- # but their code has not been removed yet because there will not +- # be a substantial code savings until JVM_InvokeMethod and +- # JVM_NewInstanceFromConstructor can also be removed; see +- # reflectionCompat.hpp. +- JVM_GetClassConstructor; +- JVM_GetClassConstructors; +- JVM_GetClassField; +- JVM_GetClassFields; +- JVM_GetClassMethod; +- JVM_GetClassMethods; +- JVM_GetField; +- JVM_GetPrimitiveField; +- JVM_NewInstance; +- JVM_SetField; +- JVM_SetPrimitiveField; +- + # debug JVM + JVM_AccessVMBooleanFlag; + JVM_AccessVMIntFlag; +--- hotspot/make/bsd/makefiles/mapfile-vers-product 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/make/bsd/makefiles/mapfile-vers-product 2012-05-19 10:36:22.000000000 -0700 +@@ -221,6 +221,7 @@ + JVM_SetArrayElement; + JVM_SetClassSigners; + JVM_SetLength; ++ JVM_SetNativeThreadName; + JVM_SetPrimitiveArrayElement; + JVM_SetProtectionDomain; + JVM_SetSockOpt; +@@ -244,24 +245,6 @@ + JVM_Yield; + JVM_handle_bsd_signal; + +- # Old reflection routines +- # These do not need to be present in the product build in JDK 1.4 +- # but their code has not been removed yet because there will not +- # be a substantial code savings until JVM_InvokeMethod and +- # JVM_NewInstanceFromConstructor can also be removed; see +- # reflectionCompat.hpp. +- JVM_GetClassConstructor; +- JVM_GetClassConstructors; +- JVM_GetClassField; +- JVM_GetClassFields; +- JVM_GetClassMethod; +- JVM_GetClassMethods; +- JVM_GetField; +- JVM_GetPrimitiveField; +- JVM_NewInstance; +- JVM_SetField; +- JVM_SetPrimitiveField; +- + # miscellaneous functions + jio_fprintf; + jio_printf; +--- hotspot/make/solaris/makefiles/defs.make 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/make/solaris/makefiles/defs.make 2012-05-17 14:53:53.000000000 -0700 +@@ -164,8 +164,8 @@ endif ifeq ($(ARCH_DATA_MODEL), 32) EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.so -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.so -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.so +- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) +- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.$(LIBRARY_SUFFIX) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.$(LIBRARY_SUFFIX) -+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX) -+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX) -+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.debuginfo -@@ -174,8 +177,8 @@ - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.debuginfo - endif - ifneq ($(BUILD_CLIENT_ONLY), true) -- EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.so -- EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.so -+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX) -+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.debuginfo - EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.debuginfo -@@ -183,7 +186,7 @@ - endif - endif - --EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so -+EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) - ifneq ($(OBJCOPY),) - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo - endif ---- ./hotspot/make/templates/bsd-header 2011-11-17 21:36:51.000000000 -0800 -+++ ./hotspot/make/templates/bsd-header 1969-12-31 16:00:00.000000000 -0800 -@@ -1,28 +0,0 @@ --Copyright (c) %YEARS%, Oracle and/or its affiliates. All rights reserved. -- --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions --are met: -- -- - Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- -- - Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- - Neither the name of Oracle nor the names of its -- contributors may be used to endorse or promote products derived -- from this software without specific prior written permission. -- --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS --IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, --THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR --PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR --CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, --EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, --PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---- ./hotspot/make/windows/makefiles/defs.make 2011-11-17 21:36:52.000000000 -0800 -+++ ./hotspot/make/windows/makefiles/defs.make 2012-02-26 13:59:19.000000000 -0800 -@@ -109,6 +109,9 @@ - - JDK_INCLUDE_SUBDIR=win32 - -+# Library suffix -+LIBRARY_SUFFIX=dll -+ - # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined - # and added to MAKE_ARGS list in $(GAMMADIR)/make/defs.make. - -@@ -175,24 +178,24 @@ - EXPORT_KERNEL_DIR = $(EXPORT_JRE_BIN_DIR)/kernel - - EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt --EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.dll -+EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX) - EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.pdb - EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map - EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib - ifeq ($(ARCH_DATA_MODEL), 32) - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt -- EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.dll -+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX) - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.pdb - EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map - # kernel vm - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/Xusage.txt -- EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.dll -+ EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.$(LIBRARY_SUFFIX) - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.pdb - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.map - endif - - ifeq ($(BUILD_WIN_SA), 1) -- EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.dll -+ EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX) - EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb - EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map - EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar ---- ./hotspot/src/cpu/sparc/vm/globals_sparc.hpp 2011-11-17 21:36:57.000000000 -0800 -+++ ./hotspot/src/cpu/sparc/vm/globals_sparc.hpp 2011-04-22 22:28:33.000000000 -0700 -@@ -70,7 +70,11 @@ + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX) +--- hotspot/src/cpu/sparc/vm/globals_sparc.hpp 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/src/cpu/sparc/vm/globals_sparc.hpp 2012-05-16 19:03:31.000000000 -0700 +@@ -71,7 +71,11 @@ define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); @@ -4434,6285 +167,171 @@ // GC Ergo Flags define_pd_global(intx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread ---- ./hotspot/src/cpu/x86/vm/bytes_x86.hpp 2011-11-17 21:37:00.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/bytes_x86.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -81,6 +81,9 @@ - #ifdef TARGET_OS_ARCH_windows_x86 - # include "bytes_windows_x86.inline.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "bytes_bsd_x86.inline.hpp" -+#endif - - - #endif // CPU_X86_VM_BYTES_X86_HPP ---- ./hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2011-11-17 21:37:00.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -427,8 +427,8 @@ - // Fetch the exception from TLS and clear out exception related thread state - __ get_thread(rsi); - __ movptr(rax, Address(rsi, JavaThread::exception_oop_offset())); -- __ movptr(Address(rsi, JavaThread::exception_oop_offset()), (int32_t)NULL_WORD); -- __ movptr(Address(rsi, JavaThread::exception_pc_offset()), (int32_t)NULL_WORD); -+ __ movptr(Address(rsi, JavaThread::exception_oop_offset()), (intptr_t)NULL_WORD); -+ __ movptr(Address(rsi, JavaThread::exception_pc_offset()), (intptr_t)NULL_WORD); - - __ bind(_unwind_handler_entry); - __ verify_not_null_oop(rax); ---- ./hotspot/src/cpu/x86/vm/copy_x86.hpp 2011-11-17 21:37:01.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/copy_x86.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_ARCH_windows_x86 - # include "copy_windows_x86.inline.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "copy_bsd_x86.inline.hpp" -+#endif - - - static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) { ---- ./hotspot/src/cpu/x86/vm/globals_x86.hpp 2011-11-17 21:37:01.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/globals_x86.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -70,7 +70,11 @@ - define_pd_global(bool, RewriteBytecodes, true); - define_pd_global(bool, RewriteFrequentPairs, true); - -+#ifdef _ALLBSD_SOURCE -+define_pd_global(bool, UseMembar, true); -+#else - define_pd_global(bool, UseMembar, false); -+#endif - - // GC Ergo Flags - define_pd_global(intx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread ---- ./hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp 2011-11-17 21:37:01.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -45,6 +45,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - // Implementation of InterpreterMacroAssembler -@@ -1158,7 +1161,7 @@ - int recvr_offset = in_bytes(VirtualCallData::receiver_offset(start_row)); - set_mdp_data_at(mdp, recvr_offset, receiver); - int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row)); -- movptr(reg2, (int32_t)DataLayout::counter_increment); -+ movptr(reg2, (intptr_t)DataLayout::counter_increment); - set_mdp_data_at(mdp, count_offset, reg2); - if (start_row > 0) { - jmp(done); -@@ -1301,7 +1304,7 @@ - test_method_data_pointer(mdp, profile_continue); - - // Build the base (index * per_case_size_in_bytes()) + case_array_offset_in_bytes() -- movptr(reg2, (int32_t)in_bytes(MultiBranchData::per_case_size())); -+ movptr(reg2, (intptr_t)in_bytes(MultiBranchData::per_case_size())); - // index is positive and so should have correct value if this code were - // used on 64bits - imulptr(index, reg2); ---- ./hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp 2011-11-17 21:37:01.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -45,6 +45,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - // Implementation of InterpreterMacroAssembler ---- ./hotspot/src/cpu/x86/vm/jni_x86.h 2011-11-17 21:37:02.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/jni_x86.h 2011-04-22 22:28:34.000000000 -0700 -@@ -26,7 +26,7 @@ - #ifndef _JAVASOFT_JNI_MD_H_ - #define _JAVASOFT_JNI_MD_H_ - --#if defined(SOLARIS) || defined(LINUX) -+#if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE) - - #if defined(__GNUC__) && (__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2) - #define JNIEXPORT __attribute__((visibility("default"))) ---- ./hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp 2011-11-17 21:37:03.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -47,6 +47,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifdef COMPILER2 - #include "opto/runtime.hpp" - #endif ---- ./hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp 2011-11-17 21:37:03.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -47,6 +47,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifdef COMPILER2 - #include "opto/runtime.hpp" - #endif ---- ./hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp 2011-11-17 21:37:03.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // Implementation of the platform-specific part of StubRoutines - for - // a description of how to extend it, see the stubRoutines.hpp file. ---- ./hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp 2011-11-17 21:37:03.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // Implementation of the platform-specific part of StubRoutines - for - // a description of how to extend it, see the stubRoutines.hpp file. ---- ./hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2011-11-17 21:37:05.000000000 -0800 -+++ ./hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - - int VM_Version::_cpu; ---- ./hotspot/src/cpu/zero/vm/bytes_zero.hpp 2011-11-17 21:37:07.000000000 -0800 -+++ ./hotspot/src/cpu/zero/vm/bytes_zero.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -168,6 +168,9 @@ - #ifdef TARGET_OS_ARCH_linux_zero - # include "bytes_linux_zero.inline.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "bytes_bsd_zero.inline.hpp" -+#endif - - #endif // VM_LITTLE_ENDIAN - ---- ./hotspot/src/cpu/zero/vm/globals_zero.hpp 2011-11-17 21:37:08.000000000 -0800 -+++ ./hotspot/src/cpu/zero/vm/globals_zero.hpp 2011-04-23 12:09:38.000000000 -0700 -@@ -52,7 +52,11 @@ - define_pd_global(bool, RewriteBytecodes, true); - define_pd_global(bool, RewriteFrequentPairs, true); - -+#ifdef _ALLBSD_SOURCE -+define_pd_global(bool, UseMembar, true); -+#else - define_pd_global(bool, UseMembar, false); -+#endif - - // GC Ergo Flags - define_pd_global(intx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread ---- ./hotspot/src/cpu/zero/vm/interp_masm_zero.cpp 2011-11-17 21:37:09.000000000 -0800 -+++ ./hotspot/src/cpu/zero/vm/interp_masm_zero.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -40,5 +40,8 @@ - #ifdef TARGET_OS_FAMILY_linux - # include "thread_linux.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // This file is intentionally empty ---- ./hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp 2011-11-17 21:37:10.000000000 -0800 -+++ ./hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -43,6 +43,9 @@ - #ifdef TARGET_OS_FAMILY_linux - # include "thread_linux.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifdef COMPILER2 - #include "opto/runtime.hpp" - #endif ---- ./hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp 2011-11-17 21:37:10.000000000 -0800 -+++ ./hotspot/src/cpu/zero/vm/stubRoutines_zero.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -30,3 +30,6 @@ - #ifdef TARGET_OS_FAMILY_linux - # include "thread_linux.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif ---- ./hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2011-11-17 21:37:10.000000000 -0800 -+++ ./hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -32,5 +32,8 @@ - #ifdef TARGET_OS_FAMILY_linux - # include "os_linux.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - // This file is intentionally empty ---- ./hotspot/src/os/bsd/vm/attachListener_bsd.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/attachListener_bsd.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -337,6 +337,15 @@ - - // get the credentials of the peer and check the effective uid/guid - // - check with jeff on this. -+#ifdef _ALLBSD_SOURCE -+ uid_t puid; -+ gid_t pgid; -+ if (::getpeereid(s, &puid, &pgid) != 0) { -+ int res; -+ RESTARTABLE(::close(s), res); -+ continue; -+ } -+#else - struct ucred cred_info; - socklen_t optlen = sizeof(cred_info); - if (::getsockopt(s, SOL_SOCKET, SO_PEERCRED, (void*)&cred_info, &optlen) == -1) { -@@ -344,10 +353,13 @@ - RESTARTABLE(::close(s), res); - continue; - } -+ uid_t puid = cred_info.uid; -+ gid_t pgid = cred_info.gid; -+#endif - uid_t euid = geteuid(); - gid_t egid = getegid(); - -- if (cred_info.uid != euid || cred_info.gid != egid) { -+ if (puid != euid || pgid != egid) { - int res; - RESTARTABLE(::close(s), res); - continue; -@@ -467,16 +479,13 @@ - if (init_at_startup() || is_initialized()) { - return false; // initialized at startup or already initialized - } -- char fn[PATH_MAX+1]; -- sprintf(fn, ".attach_pid%d", os::current_process_id()); -+ char path[PATH_MAX + 1]; - int ret; -- struct stat64 st; -- RESTARTABLE(::stat64(fn, &st), ret); -- if (ret == -1) { -- snprintf(fn, sizeof(fn), "%s/.attach_pid%d", -- os::get_temp_directory(), os::current_process_id()); -- RESTARTABLE(::stat64(fn, &st), ret); -- } -+ struct stat st; -+ -+ snprintf(path, PATH_MAX + 1, "%s/.attach_pid%d", -+ os::get_temp_directory(), os::current_process_id()); -+ RESTARTABLE(::stat(path, &st), ret); - if (ret == 0) { - // simple check to avoid starting the attach mechanism when - // a bogus user creates the file ---- ./hotspot/src/os/bsd/vm/globals_bsd.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/globals_bsd.hpp 2011-05-13 21:09:51.000000000 -0700 -@@ -47,7 +47,7 @@ - // Defines Bsd-specific default values. The flags are available on all - // platforms, but they may have different default values on other platforms. - // --define_pd_global(bool, UseLargePages, true); -+define_pd_global(bool, UseLargePages, false); - define_pd_global(bool, UseLargePagesIndividualAllocation, false); - define_pd_global(bool, UseOSErrorReporting, false); - define_pd_global(bool, UseThreadPriorities, true) ; ---- ./hotspot/src/os/bsd/vm/jsig.c 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/jsig.c 2011-04-22 22:28:34.000000000 -0700 -@@ -35,10 +35,7 @@ - #include <pthread.h> - #include <stdio.h> - #include <stdlib.h> -- --#define bool int --#define true 1 --#define false 0 -+#include <stdbool.h> - - #define MAXSIGNUM 32 - #define MASK(sig) ((unsigned int)1 << sig) -@@ -143,7 +140,8 @@ - } - - sa_handler_t sigset(int sig, sa_handler_t disp) { -- return set_signal(sig, disp, true); -+ printf("sigset() is not supported by BSD"); -+ exit(0); - } - - static int call_os_sigaction(int sig, const struct sigaction *act, ---- ./hotspot/src/os/bsd/vm/jvm_bsd.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/jvm_bsd.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -141,38 +141,31 @@ - "ILL", SIGILL, /* Illegal instruction (ANSI). */ - "TRAP", SIGTRAP, /* Trace trap (POSIX). */ - "ABRT", SIGABRT, /* Abort (ANSI). */ -- "IOT", SIGIOT, /* IOT trap (4.2 BSD). */ -- "BUS", SIGBUS, /* BUS error (4.2 BSD). */ -+ "EMT", SIGEMT, /* EMT trap */ - "FPE", SIGFPE, /* Floating-point exception (ANSI). */ - "KILL", SIGKILL, /* Kill, unblockable (POSIX). */ -- "USR1", SIGUSR1, /* User-defined signal 1 (POSIX). */ -+ "BUS", SIGBUS, /* BUS error (4.2 BSD). */ - "SEGV", SIGSEGV, /* Segmentation violation (ANSI). */ -- "USR2", SIGUSR2, /* User-defined signal 2 (POSIX). */ -+ "SYS", SIGSYS, /* Bad system call. Only on some Bsden! */ - "PIPE", SIGPIPE, /* Broken pipe (POSIX). */ - "ALRM", SIGALRM, /* Alarm clock (POSIX). */ - "TERM", SIGTERM, /* Termination (ANSI). */ --#ifdef SIGSTKFLT -- "STKFLT", SIGSTKFLT, /* Stack fault. */ --#endif -- "CLD", SIGCLD, /* Same as SIGCHLD (System V). */ -- "CHLD", SIGCHLD, /* Child status has changed (POSIX). */ -- "CONT", SIGCONT, /* Continue (POSIX). */ -+ "URG", SIGURG, /* Urgent condition on socket (4.2 BSD). */ - "STOP", SIGSTOP, /* Stop, unblockable (POSIX). */ - "TSTP", SIGTSTP, /* Keyboard stop (POSIX). */ -+ "CONT", SIGCONT, /* Continue (POSIX). */ -+ "CHLD", SIGCHLD, /* Child status has changed (POSIX). */ - "TTIN", SIGTTIN, /* Background read from tty (POSIX). */ - "TTOU", SIGTTOU, /* Background write to tty (POSIX). */ -- "URG", SIGURG, /* Urgent condition on socket (4.2 BSD). */ -+ "IO", SIGIO, /* I/O now possible (4.2 BSD). */ - "XCPU", SIGXCPU, /* CPU limit exceeded (4.2 BSD). */ - "XFSZ", SIGXFSZ, /* File size limit exceeded (4.2 BSD). */ - "VTALRM", SIGVTALRM, /* Virtual alarm clock (4.2 BSD). */ - "PROF", SIGPROF, /* Profiling alarm clock (4.2 BSD). */ - "WINCH", SIGWINCH, /* Window size change (4.3 BSD, Sun). */ -- "POLL", SIGPOLL, /* Pollable event occurred (System V). */ -- "IO", SIGIO, /* I/O now possible (4.2 BSD). */ -- "PWR", SIGPWR, /* Power failure restart (System V). */ --#ifdef SIGSYS -- "SYS", SIGSYS /* Bad system call. Only on some Bsden! */ --#endif -+ "INFO", SIGINFO, /* Information request. */ -+ "USR1", SIGUSR1, /* User-defined signal 1 (POSIX). */ -+ "USR2", SIGUSR2 /* User-defined signal 2 (POSIX). */ - }; - - JVM_ENTRY_NO_ENV(jint, JVM_FindSignal(const char *name)) ---- ./hotspot/src/os/bsd/vm/jvm_bsd.h 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/jvm_bsd.h 2012-02-12 13:05:32.000000000 -0800 -@@ -41,6 +41,21 @@ - * This file is currently collecting system-specific dregs for the - * JNI conversion, which should be sorted out later. - */ -+#ifdef __NetBSD__ +--- hotspot/src/os/bsd/vm/decoder_bsd.cpp 1969-12-31 16:00:00.000000000 -0800 ++++ hotspot/src/os/bsd/vm/decoder_bsd.cpp 2012-05-25 00:08:53.000000000 -0700 +@@ -0,0 +1,46 @@ +/* -+ * Since we are compiling with c++, we need the following to make c macros -+ * visible. ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * + */ -+# if !defined(__STDC_LIMIT_MACROS) -+# define __STDC_LIMIT_MACROS 1 -+# endif -+# if !defined(__STDC_CONSTANT_MACROS) -+# define __STDC_CONSTANT_MACROS 1 -+# endif -+# if !defined(__STDC_FORMAT_MACROS) -+# define __STDC_FORMAT_MACROS 1 -+# endif -+#endif - - #include <dirent.h> /* For DIR */ - #include <sys/param.h> /* For MAXPATHLEN */ -@@ -54,7 +69,11 @@ - #define AGENT_ONATTACH_SYMBOLS {"Agent_OnAttach"} - - #define JNI_LIB_PREFIX "lib" -+#ifdef __APPLE__ -+#define JNI_LIB_SUFFIX ".dylib" -+#else - #define JNI_LIB_SUFFIX ".so" -+#endif - - // Hack: MAXPATHLEN is 4095 on some Bsd and 4096 on others. This may - // cause problems if JVM and the rest of JDK are built on different -@@ -93,6 +112,20 @@ - #define SHUTDOWN2_SIGNAL SIGINT - #define SHUTDOWN3_SIGNAL SIGTERM - -+#ifndef SIGRTMIN -+#ifdef __OpenBSD__ -+#define SIGRTMIN 1 -+#else -+#define SIGRTMIN 33 -+#endif -+#endif -+#ifndef SIGRTMAX -+#ifdef __OpenBSD__ -+#define SIGRTMAX 31 -+#else -+#define SIGRTMAX 63 -+#endif -+#endif - #endif /* JVM_MD_H */ - - // Reconciliation History ---- ./hotspot/src/os/bsd/vm/osThread_bsd.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/osThread_bsd.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -49,8 +49,8 @@ - - void OSThread::pd_initialize() { - assert(this != NULL, "check"); -- _thread_id = 0; -- _pthread_id = 0; -+ _thread_id = NULL; -+ _pthread_id = NULL; - _siginfo = NULL; - _ucontext = NULL; - _expanding_stack = 0; ---- ./hotspot/src/os/bsd/vm/osThread_bsd.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/osThread_bsd.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -39,6 +39,12 @@ - - private: - -+#ifdef _ALLBSD_SOURCE -+ // _thread_id and _pthread_id are the same on BSD -+ // keep both to minimize code divergence in os_bsd.cpp -+ pthread_t _thread_id; -+ pthread_t _pthread_id; -+#else - // _thread_id is kernel thread id (similar to LWP id on Solaris). Each - // thread has a unique thread_id (BsdThreads or NPTL). It can be used - // to access /proc. -@@ -47,6 +53,7 @@ - // _pthread_id is the pthread id, which is used by library calls - // (e.g. pthread_kill). - pthread_t _pthread_id; -+#endif - - sigset_t _caller_sigmask; // Caller's signal mask - -@@ -56,12 +63,18 @@ - sigset_t caller_sigmask() const { return _caller_sigmask; } - void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } - -+#ifdef _ALLBSD_SOURCE -+ pthread_t thread_id() const { -+ return _thread_id; -+ } -+#else - pid_t thread_id() const { - return _thread_id; - } -+#endif - #ifndef PRODUCT - // Used for debugging, return a unique integer for each thread. -- int thread_identifier() const { return _thread_id; } -+ intptr_t thread_identifier() const { return (intptr_t)_pthread_id; } - #endif - #ifdef ASSERT - // We expect no reposition failures so kill vm if we get one. -@@ -70,9 +83,15 @@ - return false; - } - #endif // ASSERT -+#ifdef _ALLBSD_SOURCE -+ void set_thread_id(pthread_t id) { -+ _thread_id = id; -+ } -+#else - void set_thread_id(pid_t id) { - _thread_id = id; - } -+#endif - pthread_t pthread_id() const { - return _pthread_id; - } ---- ./hotspot/src/os/bsd/vm/os_bsd.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/os_bsd.cpp 2012-03-03 21:57:22.000000000 -0800 -@@ -22,8 +22,6 @@ - * - */ - --# define __STDC_FORMAT_MACROS -- - // no precompiled headers - #include "classfile/classLoader.hpp" - #include "classfile/systemDictionary.hpp" -@@ -110,21 +108,42 @@ - # include <sys/utsname.h> - # include <sys/socket.h> - # include <sys/wait.h> -+# include <time.h> - # include <pwd.h> - # include <poll.h> - # include <semaphore.h> - # include <fcntl.h> - # include <string.h> -+#ifdef _ALLBSD_SOURCE -+# include <sys/param.h> -+# include <sys/sysctl.h> -+#else - # include <syscall.h> - # include <sys/sysinfo.h> - # include <gnu/libc-version.h> -+#endif - # include <sys/ipc.h> - # include <sys/shm.h> -+#ifndef __APPLE__ - # include <link.h> -+#endif - # include <stdint.h> - # include <inttypes.h> - # include <sys/ioctl.h> - -+#if defined(__FreeBSD__) || defined(__NetBSD__) -+# include <elf.h> -+#endif -+ -+#ifdef __APPLE__ -+#include <mach/mach.h> // semaphore_* API -+#include <mach-o/dyld.h> -+#endif -+ -+#ifndef MAP_ANONYMOUS -+#define MAP_ANONYMOUS MAP_ANON -+#endif -+ - #define MAX_PATH (2 * K) - - // for timer info max values which include all bits -@@ -136,19 +155,25 @@ - // global variables - julong os::Bsd::_physical_memory = 0; - -+#ifndef _ALLBSD_SOURCE - address os::Bsd::_initial_thread_stack_bottom = NULL; - uintptr_t os::Bsd::_initial_thread_stack_size = 0; -+#endif - - int (*os::Bsd::_clock_gettime)(clockid_t, struct timespec *) = NULL; -+#ifndef _ALLBSD_SOURCE - int (*os::Bsd::_pthread_getcpuclockid)(pthread_t, clockid_t *) = NULL; - Mutex* os::Bsd::_createThread_lock = NULL; -+#endif - pthread_t os::Bsd::_main_thread; - int os::Bsd::_page_size = -1; -+#ifndef _ALLBSD_SOURCE - bool os::Bsd::_is_floating_stack = false; - bool os::Bsd::_is_NPTL = false; - bool os::Bsd::_supports_fast_thread_cpu_time = false; - const char * os::Bsd::_glibc_version = NULL; - const char * os::Bsd::_libpthread_version = NULL; -+#endif - - static jlong initial_time_count=0; - -@@ -166,8 +191,6 @@ - static int SR_signum = SIGUSR2; - sigset_t SR_sigset; - --/* Used to protect dlsym() calls */ --static pthread_mutex_t dl_mutex; - - #ifdef JAVASE_EMBEDDED - class MemNotifyThread: public Thread { -@@ -208,11 +231,16 @@ - } - - julong os::Bsd::available_memory() { -+#ifdef _ALLBSD_SOURCE -+ // XXXBSD: this is just a stopgap implementation -+ return physical_memory() >> 2; -+#else - // values in struct sysinfo are "unsigned long" - struct sysinfo si; - sysinfo(&si); - - return (julong)si.freeram * si.mem_unit; -+#endif - } - - julong os::physical_memory() { -@@ -260,6 +288,7 @@ - } - - -+#ifndef _ALLBSD_SOURCE - #ifndef SYS_gettid - // i386: 224, ia64: 1105, amd64: 186, sparc 143 - #ifdef __ia64__ -@@ -274,6 +303,7 @@ - #error define gettid for the arch - #endif - #endif -+#endif - - // Cpu architecture string - #if defined(ZERO) -@@ -299,6 +329,7 @@ - #endif - - -+#ifndef _ALLBSD_SOURCE - // pid_t gettid() - // - // Returns the kernel thread id of the currently running thread. Kernel -@@ -325,7 +356,48 @@ - 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."; -+#endif -+ -+#ifdef _ALLBSD_SOURCE -+void os::Bsd::initialize_system_info() { -+ int mib[2]; -+ size_t len; -+ int cpu_val; -+ u_long mem_val; -+ -+ /* get processors count via hw.ncpus sysctl */ -+ mib[0] = CTL_HW; -+ mib[1] = HW_NCPU; -+ len = sizeof(cpu_val); -+ if (sysctl(mib, 2, &cpu_val, &len, NULL, 0) != -1 && cpu_val >= 1) { -+ set_processor_count(cpu_val); -+ } -+ else { -+ set_processor_count(1); // fallback -+ } - -+ /* get physical memory via hw.usermem sysctl (hw.usermem is used -+ * instead of hw.physmem because we need size of allocatable memory -+ */ -+ mib[0] = CTL_HW; -+ mib[1] = HW_USERMEM; -+ len = sizeof(mem_val); -+ if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) -+ _physical_memory = mem_val; -+ else -+ _physical_memory = 256*1024*1024; // fallback (XXXBSD?) -+ -+#ifdef __OpenBSD__ -+ { -+ // limit _physical_memory memory view on OpenBSD since -+ // datasize rlimit restricts us anyway. -+ struct rlimit limits; -+ getrlimit(RLIMIT_DATA, &limits); -+ _physical_memory = MIN2(_physical_memory, (julong)limits.rlim_cur); -+ } -+#endif -+} -+#else - void os::Bsd::initialize_system_info() { - set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); - if (processor_count() == 1) { -@@ -342,6 +414,7 @@ - _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); - assert(processor_count() > 0, "bsd error"); - } -+#endif - - void os::init_system_properties_values() { - // char arch[12]; -@@ -385,9 +458,7 @@ - * ... - * 7: The default directories, normally /lib and /usr/lib. - */ --#if defined(AMD64) || defined(_LP64) && (defined(SPARC) || defined(PPC) || defined(S390)) --#define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib" --#else -+#ifndef DEFAULT_LIBPATH - #define DEFAULT_LIBPATH "/lib:/usr/lib" - #endif - -@@ -466,7 +537,11 @@ - * should always exist (until the legacy problem cited above is - * addressed). - */ -+#ifdef __APPLE__ -+ char *v = getenv("DYLD_LIBRARY_PATH"); -+#else - char *v = getenv("LD_LIBRARY_PATH"); -+#endif - if (v != NULL) { - char *t = ld_library_path; - /* That's +1 for the colon and +1 for the trailing '\0' */ -@@ -625,6 +700,7 @@ - } - } - -+#ifndef _ALLBSD_SOURCE - ////////////////////////////////////////////////////////////////////////////// - // detecting pthread library - -@@ -788,6 +864,7 @@ - } - return false; - } -+#endif - - ////////////////////////////////////////////////////////////////////////////// - // create new thread -@@ -796,6 +873,9 @@ - - // check if it's safe to start a new thread - static bool _thread_safety_check(Thread* thread) { -+#ifdef _ALLBSD_SOURCE -+ return true; -+#else - 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 -@@ -829,6 +909,7 @@ - // here, that means enough space has been reserved for stack. - return true; - } -+#endif - } - - // Thread start routine for all newly created threads -@@ -856,6 +937,10 @@ - return NULL; - } - -+#ifdef _ALLBSD_SOURCE -+ // thread_id is pthread_id on BSD -+ osthread->set_thread_id(::pthread_self()); -+#else - // thread_id is kernel thread id (similar to Solaris LWP id) - osthread->set_thread_id(os::Bsd::gettid()); - -@@ -865,6 +950,7 @@ - thread->set_lgrp_id(lgrp_id); - } - } -+#endif - // initialize signal mask for this thread - os::Bsd::hotspot_sigmask(thread); - -@@ -947,17 +1033,22 @@ - // let pthread_create() pick the default value. - } - -+#ifndef _ALLBSD_SOURCE - // glibc guard page - pthread_attr_setguardsize(&attr, os::Bsd::default_guard_size(thr_type)); -+#endif - - ThreadState state; - - { + -+#ifndef _ALLBSD_SOURCE - // Serialize thread creation if we are running with fixed stack BsdThreads - bool lock = os::Bsd::is_BsdThreads() && !os::Bsd::is_floating_stack(); - if (lock) { - os::Bsd::createThread_lock()->lock_without_safepoint_check(); - } -+#endif - - pthread_t tid; - int ret = pthread_create(&tid, &attr, (void* (*)(void*)) java_start, thread); -@@ -971,7 +1062,9 @@ - // Need to clean up stuff we've allocated so far - thread->set_osthread(NULL); - delete osthread; -+#ifndef _ALLBSD_SOURCE - if (lock) os::Bsd::createThread_lock()->unlock(); -+#endif - return false; - } - -@@ -987,9 +1080,11 @@ - } - } - -+#ifndef _ALLBSD_SOURCE - if (lock) { - os::Bsd::createThread_lock()->unlock(); - } -+#endif - } - - // Aborted due to thread limit being reached -@@ -1027,7 +1122,11 @@ - } - - // Store pthread info into the OSThread -+#ifdef _ALLBSD_SOURCE -+ osthread->set_thread_id(::pthread_self()); -+#else - osthread->set_thread_id(os::Bsd::gettid()); -+#endif - osthread->set_pthread_id(::pthread_self()); - - // initialize floating point control register -@@ -1038,6 +1137,7 @@ - - thread->set_osthread(osthread); - -+#ifndef _ALLBSD_SOURCE - if (UseNUMA) { - int lgrp_id = os::numa_get_group_id(); - if (lgrp_id != -1) { -@@ -1064,6 +1164,7 @@ - os::Bsd::manually_expand_stack(jt, addr); - osthread->clear_expanding_stack(); - } -+#endif - - // initialize signal mask for this thread - // and save the caller's signal mask -@@ -1122,6 +1223,7 @@ - ////////////////////////////////////////////////////////////////////////////// - // initial thread - -+#ifndef _ALLBSD_SOURCE - // Check if current thread is the initial thread, similar to Solaris thr_main. - bool os::Bsd::is_initial_thread(void) { - char dummy; -@@ -1358,6 +1460,7 @@ - _initial_thread_stack_size = align_size_down(_initial_thread_stack_size, page_size()); - _initial_thread_stack_bottom = (address)stack_top - _initial_thread_stack_size; - } -+#endif - - //////////////////////////////////////////////////////////////////////////////// - // time support -@@ -1379,9 +1482,7 @@ - return (1000 * 1000); - } - --// For now, we say that bsd does not support vtime. I have no idea --// whether it can actually be made to (DLD, 9/13/05). -- -+// XXX: For now, code this as if BSD does not support vtime. - bool os::supports_vtime() { return false; } - bool os::enable_vtime() { return false; } - bool os::vtime_enabled() { return false; } -@@ -1401,6 +1502,21 @@ - #define CLOCK_MONOTONIC (1) - #endif - -+#ifdef __APPLE__ -+void os::Bsd::clock_init() { -+ // XXXDARWIN: Investigate replacement monotonic clock -+} -+#elif defined(_ALLBSD_SOURCE) -+void os::Bsd::clock_init() { -+ struct timespec res; -+ struct timespec tp; -+ if (::clock_getres(CLOCK_MONOTONIC, &res) == 0 && -+ ::clock_gettime(CLOCK_MONOTONIC, &tp) == 0) { -+ // yes, monotonic clock is supported -+ _clock_gettime = ::clock_gettime; -+ } -+} -+#else - void os::Bsd::clock_init() { - // we do dlopen's in this particular order due to bug in bsd - // dynamical loader (see 6348968) leading to crash on exit -@@ -1436,7 +1552,9 @@ - } - } - } -+#endif - -+#ifndef _ALLBSD_SOURCE - #ifndef SYS_clock_getres - - #if defined(IA32) || defined(AMD64) -@@ -1477,6 +1595,7 @@ - _pthread_getcpuclockid = pthread_getcpuclockid_func; - } - } -+#endif - - jlong os::javaTimeNanos() { - if (Bsd::supports_monotonic_clock()) { -@@ -1645,7 +1764,14 @@ - - // DLL functions - --const char* os::dll_file_extension() { return ".so"; } -+#define JNI_LIB_PREFIX "lib" -+#ifdef __APPLE__ -+#define JNI_LIB_SUFFIX ".dylib" -+#else -+#define JNI_LIB_SUFFIX ".so" -+#endif -+ -+const char* os::dll_file_extension() { return JNI_LIB_SUFFIX; } - - // This must be hard coded because it's the system's temporary - // directory not the java application's temp directory, ala java.io.tmpdir. -@@ -1665,13 +1791,13 @@ - const size_t pnamelen = pname ? strlen(pname) : 0; - - // Quietly truncate on buffer overflow. Should be an error. -- if (pnamelen + strlen(fname) + 10 > (size_t) buflen) { -+ if (pnamelen + strlen(fname) + strlen(JNI_LIB_PREFIX) + strlen(JNI_LIB_SUFFIX) + 2 > buflen) { - *buffer = '\0'; - return; - } - - if (pnamelen == 0) { -- snprintf(buffer, buflen, "lib%s.so", fname); -+ snprintf(buffer, buflen, JNI_LIB_PREFIX "%s" JNI_LIB_SUFFIX, fname); - } else if (strchr(pname, *os::path_separator()) != NULL) { - int n; - char** pelements = split_path(pname, &n); -@@ -1680,7 +1806,8 @@ - if (pelements[i] == NULL || strlen(pelements[i]) == 0) { - continue; // skip the empty path values - } -- snprintf(buffer, buflen, "%s/lib%s.so", pelements[i], fname); -+ snprintf(buffer, buflen, "%s/" JNI_LIB_PREFIX "%s" JNI_LIB_SUFFIX, -+ pelements[i], fname); - if (file_exists(buffer)) { - break; - } -@@ -1695,7 +1822,7 @@ - FREE_C_HEAP_ARRAY(char*, pelements); - } - } else { -- snprintf(buffer, buflen, "%s/lib%s.so", pname, fname); -+ snprintf(buffer, buflen, "%s/" JNI_LIB_PREFIX "%s" JNI_LIB_SUFFIX, pname, fname); - } - } - -@@ -1745,6 +1872,23 @@ - return false; - } - -+#ifdef _ALLBSD_SOURCE -+// ported from solaris version -+bool os::dll_address_to_library_name(address addr, char* buf, -+ int buflen, int* offset) { -+ Dl_info dlinfo; -+ -+ if (dladdr((void*)addr, &dlinfo)){ -+ if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname); -+ if (offset) *offset = addr - (address)dlinfo.dli_fbase; -+ return true; -+ } else { -+ if (buf) buf[0] = '\0'; -+ if (offset) *offset = -1; -+ return false; -+ } -+} -+#else - struct _address_to_library_name { - address addr; // input : memory address - size_t buflen; // size of fname -@@ -1819,11 +1963,27 @@ - return false; - } - } -+#endif - - // Loads .dll/.so and - // in case of error it checks if .dll/.so was built for the - // same architecture as Hotspot is running on -+ -+#ifdef __APPLE__ -+void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { -+ void * result= ::dlopen(filename, RTLD_LAZY); -+ if (result != NULL) { -+ // Successful loading -+ return result; -+ } -+ -+ // Read system error message into ebuf -+ ::strncpy(ebuf, ::dlerror(), ebuflen-1); -+ ebuf[ebuflen-1]='\0'; - -+ return NULL; -+} -+#else - void * os::dll_load(const char *filename, char *ebuf, int ebuflen) - { - void * result= ::dlopen(filename, RTLD_LAZY); -@@ -1876,6 +2036,26 @@ - #define EM_486 6 /* Intel 80486 */ - #endif - -+ #ifndef EM_MIPS_RS3_LE -+ #define EM_MIPS_RS3_LE 10 /* MIPS */ -+ #endif ++#include "prims/jvm.h" ++#include "utilities/decoder_elf.hpp" + -+ #ifndef EM_PPC64 -+ #define EM_PPC64 21 /* PowerPC64 */ -+ #endif ++#include <cxxabi.h> + -+ #ifndef EM_S390 -+ #define EM_S390 22 /* IBM System/390 */ -+ #endif ++bool ElfDecoder::demangle(const char* symbol, char *buf, int buflen) { ++ int status; ++ char* result; ++ size_t size = (size_t)buflen; + -+ #ifndef EM_IA_64 -+ #define EM_IA_64 50 /* HP/Intel IA-64 */ -+ #endif -+ -+ #ifndef EM_X86_64 -+ #define EM_X86_64 62 /* AMD x86-64 */ -+ #endif -+ - static const arch_t arch_array[]={ - {EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, - {EM_486, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, -@@ -1979,17 +2159,11 @@ - - return NULL; - } -+#endif /* !__APPLE__ */ - --/* -- * glibc-2.0 libdl is not MT safe. If you are building with any glibc, -- * chances are you might want to run the generated bits against glibc-2.0 -- * libdl.so, so always use locking for any version of glibc. -- */ -+// XXX: Do we need a lock around this as per Linux? - void* os::dll_lookup(void* handle, const char* name) { -- pthread_mutex_lock(&dl_mutex); -- void* res = dlsym(handle, name); -- pthread_mutex_unlock(&dl_mutex); -- return res; -+ return dlsym(handle, name); - } - - -@@ -2012,7 +2186,51 @@ - - void os::print_dll_info(outputStream *st) { - st->print_cr("Dynamic libraries:"); -- -+#ifdef _ALLBSD_SOURCE -+#ifdef RTLD_DI_LINKMAP -+ Dl_info dli; -+ void *handle; -+ Link_map *map; -+ Link_map *p; -+ -+ if (!dladdr(CAST_FROM_FN_PTR(void *, os::print_dll_info), &dli)) { -+ st->print_cr("Error: Cannot print dynamic libraries."); -+ return; -+ } -+ handle = dlopen(dli.dli_fname, RTLD_LAZY); -+ if (handle == NULL) { -+ st->print_cr("Error: Cannot print dynamic libraries."); -+ return; -+ } -+ dlinfo(handle, RTLD_DI_LINKMAP, &map); -+ if (map == NULL) { -+ st->print_cr("Error: Cannot print dynamic libraries."); -+ return; -+ } -+ -+ while (map->l_prev != NULL) -+ map = map->l_prev; -+ -+ while (map != NULL) { -+ st->print_cr(PTR_FORMAT " \t%s", map->l_addr, map->l_name); -+ map = map->l_next; -+ } -+ -+ dlclose(handle); -+#elif defined(__APPLE__) -+ uint32_t count; -+ uint32_t i; -+ -+ count = _dyld_image_count(); -+ for (i = 1; i < count; i++) { -+ const char *name = _dyld_get_image_name(i); -+ intptr_t slide = _dyld_get_image_vmaddr_slide(i); -+ st->print_cr(PTR_FORMAT " \t%s", slide, name); -+ } -+#else -+ st->print_cr("Error: Cannot print dynamic libraries."); -+#endif -+#else - char fname[32]; - pid_t pid = os::Bsd::gettid(); - -@@ -2021,6 +2239,7 @@ - if (!_print_ascii_file(fname, st)) { - st->print("Can not get library information for pid = %d\n", pid); - } -+#endif - } - - -@@ -2055,6 +2274,7 @@ - st->print(name.machine); - st->cr(); - -+#ifndef _ALLBSD_SOURCE - // Print warning if unsafe chroot environment detected - if (unsafe_chroot_detected) { - st->print("WARNING!! "); -@@ -2069,6 +2289,7 @@ - st->print("(%s stack)", os::Bsd::is_floating_stack() ? "floating" : "fixed"); - } - st->cr(); -+#endif - - // rlimit - st->print("rlimit:"); -@@ -2094,6 +2315,7 @@ - if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); - else st->print("%d", rlim.rlim_cur); - -+#ifndef _ALLBSD_SOURCE - st->print(", AS "); - getrlimit(RLIMIT_AS, &rlim); - if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); -@@ -2106,11 +2328,7 @@ - os::loadavg(loadavg, 3); - st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]); - st->cr(); -- -- // meminfo -- st->print("\n/proc/meminfo:\n"); -- _print_ascii_file("/proc/meminfo", st); -- st->cr(); -+#endif - } - - void os::pd_print_cpu_info(outputStream* st) { -@@ -2126,18 +2344,27 @@ - st->print("Memory:"); - st->print(" %dk page", os::vm_page_size()>>10); - -+#ifndef _ALLBSD_SOURCE - // values in struct sysinfo are "unsigned long" - struct sysinfo si; - sysinfo(&si); -+#endif - - st->print(", physical " UINT64_FORMAT "k", - os::physical_memory() >> 10); - st->print("(" UINT64_FORMAT "k free)", - os::available_memory() >> 10); -+#ifndef _ALLBSD_SOURCE - st->print(", swap " UINT64_FORMAT "k", - ((jlong)si.totalswap * si.mem_unit) >> 10); - st->print("(" UINT64_FORMAT "k free)", - ((jlong)si.freeswap * si.mem_unit) >> 10); -+#endif -+ st->cr(); -+ -+ // meminfo -+ st->print("\n/proc/meminfo:\n"); -+ _print_ascii_file("/proc/meminfo", st); - st->cr(); - } - -@@ -2378,19 +2605,29 @@ - static volatile jint pending_signals[NSIG+1] = { 0 }; - - // Bsd(POSIX) specific hand shaking semaphore. -+#ifdef __APPLE__ -+static semaphore_t sig_sem; -+#define SEM_INIT(sem, value) semaphore_create(mach_task_self(), &sem, SYNC_POLICY_FIFO, value) -+#define SEM_WAIT(sem) semaphore_wait(sem); -+#define SEM_POST(sem) semaphore_signal(sem); -+#else - static sem_t sig_sem; -+#define SEM_INIT(sem, value) sem_init(&sem, 0, value) -+#define SEM_WAIT(sem) sem_wait(&sem); -+#define SEM_POST(sem) sem_post(&sem); -+#endif - - void os::signal_init_pd() { - // Initialize signal structures - ::memset((void*)pending_signals, 0, sizeof(pending_signals)); - - // Initialize signal semaphore -- ::sem_init(&sig_sem, 0, 0); -+ ::SEM_INIT(sig_sem, 0); - } - - void os::signal_notify(int sig) { - Atomic::inc(&pending_signals[sig]); -- ::sem_post(&sig_sem); -+ ::SEM_POST(sig_sem); - } - - static int check_pending_signals(bool wait) { -@@ -2412,7 +2649,7 @@ - do { - thread->set_suspend_equivalent(); - // cleared by handle_special_suspend_equivalent_condition() or java_suspend_self() -- ::sem_wait(&sig_sem); -+ ::SEM_WAIT(sig_sem); - - // were we externally suspended while we were waiting? - threadIsSuspended = thread->handle_special_suspend_equivalent_condition(); -@@ -2423,7 +2660,7 @@ - // while suspended because that would surprise the thread that - // suspended us. - // -- ::sem_post(&sig_sem); -+ ::SEM_POST(sig_sem); - - thread->java_suspend_self(); - } -@@ -2467,10 +2704,10 @@ - return; - } - -- char buf[PATH_MAX+1]; -+ char buf[PATH_MAX + 1]; - int num = Atomic::add(1, &cnt); - -- snprintf(buf, sizeof(buf), "%s/hs-vm-%d-%d", -+ snprintf(buf, PATH_MAX + 1, "%s/hs-vm-%d-%d", - os::get_temp_directory(), os::current_process_id(), num); - unlink(buf); - -@@ -2496,6 +2733,10 @@ - // 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; -+#ifdef __OpenBSD__ -+ // XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD -+ return ::mprotect(addr, size, prot) == 0; -+#else - uintptr_t res = (uintptr_t) ::mmap(addr, size, prot, - MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0); - if (res != (uintptr_t) MAP_FAILED) { -@@ -2505,8 +2746,10 @@ - return true; - } - return false; -+#endif - } - -+#ifndef _ALLBSD_SOURCE - // Define MAP_HUGETLB here so we can build HotSpot on old systems. - #ifndef MAP_HUGETLB - #define MAP_HUGETLB 0x40000 -@@ -2516,9 +2759,11 @@ - #ifndef MADV_HUGEPAGE - #define MADV_HUGEPAGE 14 - #endif -+#endif - - bool os::commit_memory(char* addr, size_t size, size_t alignment_hint, - bool exec) { -+#ifndef _ALLBSD_SOURCE - if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) { - int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE; - uintptr_t res = -@@ -2533,6 +2778,7 @@ - } - // Fall through and try to use small pages - } -+#endif - - if (commit_memory(addr, size, exec)) { - realign_memory(addr, size, alignment_hint); -@@ -2542,11 +2788,13 @@ - } - - void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { -+#ifndef _ALLBSD_SOURCE - if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) { - // We don't check the return value: madvise(MADV_HUGEPAGE) may not - // be supported or the memory may already be backed by huge pages. - ::madvise(addr, bytes, MADV_HUGEPAGE); - } -+#endif - } - - void os::free_memory(char *addr, size_t bytes) { -@@ -2554,36 +2802,27 @@ - } - - void os::numa_make_global(char *addr, size_t bytes) { -- Bsd::numa_interleave_memory(addr, bytes); - } - - void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { -- Bsd::numa_tonode_memory(addr, bytes, lgrp_hint); - } - - bool os::numa_topology_changed() { return false; } - - size_t os::numa_get_groups_num() { -- int max_node = Bsd::numa_max_node(); -- return max_node > 0 ? max_node + 1 : 1; -+ return 1; - } - - int os::numa_get_group_id() { -- int cpu_id = Bsd::sched_getcpu(); -- if (cpu_id != -1) { -- int lgrp_id = Bsd::get_node_by_cpu(cpu_id); -- if (lgrp_id != -1) { -- return lgrp_id; -- } -- } - return 0; - } - - size_t os::numa_get_leaf_groups(int *ids, size_t size) { -- for (size_t i = 0; i < size; i++) { -- ids[i] = i; -+ if (size > 0) { -+ ids[0] = 0; -+ return 1; - } -- return size; -+ return 0; - } - - bool os::get_page_info(char *start, page_info* info) { -@@ -2594,7 +2833,7 @@ - return end; - } - -- -+#ifndef _ALLBSD_SOURCE - int os::Bsd::sched_getcpu_syscall(void) { - unsigned int cpu; - int retval = -1; -@@ -2610,7 +2849,8 @@ - # define __NR_vgetcpu 2 - # define VSYSCALL_START (-10UL << 20) - # define VSYSCALL_SIZE 1024 --# define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr)) -+# define VSYSCALL_ADDR(vsyscall_nr) -+(VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr)) - typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache); - vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); - retval = vgetcpu(&cpu, NULL, NULL); -@@ -2726,98 +2966,26 @@ - 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; -+#endif - - bool os::uncommit_memory(char* addr, size_t size) { -+#ifdef __OpenBSD__ -+ // XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD -+ return ::mprotect(addr, size, PROT_NONE) == 0; -+#else - uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE, - MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0); - return res != (uintptr_t) MAP_FAILED; -+#endif - } - --// Bsd uses a growable mapping for the stack, and if the mapping for --// the stack guard pages is not removed when we detach a thread the --// stack cannot grow beyond the pages where the stack guard was --// mapped. If at some point later in the process the stack expands to --// that point, the Bsd kernel cannot expand the stack any further --// because the guard pages are in the way, and a segfault occurs. --// --// However, it's essential not to split the stack region by unmapping --// a region (leaving a hole) that's already part of the stack mapping, --// so if the stack mapping has already grown beyond the guard pages at --// the time we create them, we have to truncate the stack mapping. --// So, we need to know the extent of the stack mapping when --// create_stack_guard_pages() is called. -- --// Find the bounds of the stack mapping. Return true for success. --// --// We only need this for stacks that are growable: at the time of --// writing thread stacks don't use growable mappings (i.e. those --// creeated with MAP_GROWSDOWN), and aren't marked "[stack]", so this --// only applies to the main thread. -- --static --bool get_stack_bounds(uintptr_t *bottom, uintptr_t *top) { -- -- char buf[128]; -- int fd, sz; -- -- if ((fd = ::open("/proc/self/maps", O_RDONLY)) < 0) { -- return false; -- } -- -- const char kw[] = "[stack]"; -- const int kwlen = sizeof(kw)-1; -- -- // Address part of /proc/self/maps couldn't be more than 128 bytes -- while ((sz = os::get_line_chars(fd, buf, sizeof(buf))) > 0) { -- if (sz > kwlen && ::memcmp(buf+sz-kwlen, kw, kwlen) == 0) { -- // Extract addresses -- if (sscanf(buf, "%" SCNxPTR "-%" SCNxPTR, bottom, top) == 2) { -- uintptr_t sp = (uintptr_t) __builtin_frame_address(0); -- if (sp >= *bottom && sp <= *top) { -- ::close(fd); -- return true; -- } -- } -- } -- } -- -- ::close(fd); -- return false; --} -- -- --// If the (growable) stack mapping already extends beyond the point --// where we're going to put our guard pages, truncate the mapping at --// that point by munmap()ping it. This ensures that when we later --// munmap() the guard pages we don't leave a hole in the stack --// mapping. This only affects the main/initial thread, but guard --// against future OS changes - bool os::create_stack_guard_pages(char* addr, size_t size) { -- uintptr_t stack_extent, stack_base; -- bool chk_bounds = NOT_DEBUG(os::Bsd::is_initial_thread()) DEBUG_ONLY(true); -- if (chk_bounds && get_stack_bounds(&stack_extent, &stack_base)) { -- assert(os::Bsd::is_initial_thread(), -- "growable stack in non-initial thread"); -- if (stack_extent < (uintptr_t)addr) -- ::munmap((void*)stack_extent, (uintptr_t)addr - stack_extent); -- } -- - return os::commit_memory(addr, size); - } - - // If this is a growable mapping, remove the guard pages entirely by --// munmap()ping them. If not, just call uncommit_memory(). This only --// affects the main/initial thread, but guard against future OS changes -+// munmap()ping them. If not, just call uncommit_memory(). - bool os::remove_stack_guard_pages(char* addr, size_t size) { -- uintptr_t stack_extent, stack_base; -- bool chk_bounds = NOT_DEBUG(os::Bsd::is_initial_thread()) DEBUG_ONLY(true); -- if (chk_bounds && get_stack_bounds(&stack_extent, &stack_base)) { -- assert(os::Bsd::is_initial_thread(), -- "growable stack in non-initial thread"); -- -- return ::munmap(addr, size) == 0; -- } -- - return os::uncommit_memory(addr, size); - } - -@@ -2919,6 +3087,7 @@ - - bool os::Bsd::hugetlbfs_sanity_check(bool warn, size_t page_size) { - bool result = false; -+#ifndef _ALLBSD_SOURCE - void *p = mmap (NULL, page_size, PROT_READ|PROT_WRITE, - MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB, - -1, 0); -@@ -2950,6 +3119,7 @@ - if (warn) { - warning("HugeTLBFS is not supported by the operating system."); - } -+#endif - - return result; - } -@@ -2996,6 +3166,7 @@ - static size_t _large_page_size = 0; - - void os::large_page_init() { -+#ifndef _ALLBSD_SOURCE - if (!UseLargePages) { - UseHugeTLBFS = false; - UseSHM = false; -@@ -3073,11 +3244,14 @@ - UseLargePages = UseHugeTLBFS || UseSHM; - - set_coredump_filter(); -+#endif - } - -+#ifndef _ALLBSD_SOURCE - #ifndef SHM_HUGETLB - #define SHM_HUGETLB 04000 - #endif -+#endif - - char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) { - // "exec" is passed in but not used. Creating the shared image for -@@ -3095,7 +3269,11 @@ - - // Create a large shared memory region to attach to based on size. - // Currently, size is the total size of the heap -+#ifndef _ALLBSD_SOURCE - int shmid = shmget(key, bytes, SHM_HUGETLB|IPC_CREAT|SHM_R|SHM_W); -+#else -+ int shmid = shmget(key, bytes, IPC_CREAT|SHM_R|SHM_W); -+#endif - if (shmid == -1) { - // Possible reasons for shmget failure: - // 1. shmmax is too small for Java heap. -@@ -3252,7 +3430,7 @@ - } - - size_t os::read(int fd, void *buf, unsigned int nBytes) { -- return ::read(fd, buf, nBytes); -+ RESTARTABLE_RETURN_INT(::read(fd, buf, nBytes)); - } - - // TODO-FIXME: reconcile Solaris' os::sleep with the bsd variation. -@@ -3388,6 +3566,44 @@ - // this reason, the code should not be used as default (ThreadPriorityPolicy=0). - // It is only used when ThreadPriorityPolicy=1 and requires root privilege. - -+#if defined(_ALLBSD_SOURCE) && !defined(__APPLE__) -+int os::java_to_os_priority[MaxPriority + 1] = { -+ 19, // 0 Entry should never be used -+ -+ 0, // 1 MinPriority -+ 3, // 2 -+ 6, // 3 -+ -+ 10, // 4 -+ 15, // 5 NormPriority -+ 18, // 6 -+ -+ 21, // 7 -+ 25, // 8 -+ 28, // 9 NearMaxPriority -+ -+ 31 // 10 MaxPriority -+}; -+#elif defined(__APPLE__) -+/* Using Mach high-level priority assignments */ -+int os::java_to_os_priority[MaxPriority + 1] = { -+ 0, // 0 Entry should never be used (MINPRI_USER) -+ -+ 27, // 1 MinPriority -+ 28, // 2 -+ 29, // 3 -+ -+ 30, // 4 -+ 31, // 5 NormPriority (BASEPRI_DEFAULT) -+ 32, // 6 -+ -+ 33, // 7 -+ 34, // 8 -+ 35, // 9 NearMaxPriority -+ -+ 36 // 10 MaxPriority -+}; -+#else - int os::java_to_os_priority[MaxPriority + 1] = { - 19, // 0 Entry should never be used - -@@ -3405,6 +3621,7 @@ - - -5 // 10 MaxPriority - }; -+#endif - - static int prio_init() { - if (ThreadPriorityPolicy == 1) { -@@ -3424,8 +3641,28 @@ - OSReturn os::set_native_priority(Thread* thread, int newpri) { - if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) return OS_OK; - -+#ifdef __OpenBSD__ -+ // OpenBSD pthread_setprio starves low priority threads -+ return OS_OK; -+#elif defined(__FreeBSD__) -+ int ret = pthread_setprio(thread->osthread()->pthread_id(), newpri); -+#elif defined(__APPLE__) || defined(__NetBSD__) -+ struct sched_param sp; -+ int policy; -+ pthread_t self = pthread_self(); -+ -+ if (pthread_getschedparam(self, &policy, &sp) != 0) -+ return OS_ERR; -+ -+ sp.sched_priority = newpri; -+ if (pthread_setschedparam(self, policy, &sp) != 0) -+ return OS_ERR; -+ -+ return OS_OK; -+#else - int ret = setpriority(PRIO_PROCESS, thread->osthread()->thread_id(), newpri); - return (ret == 0) ? OS_OK : OS_ERR; -+#endif - } - - OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) { -@@ -3435,7 +3672,17 @@ - } - - errno = 0; -+#if defined(__OpenBSD__) || defined(__FreeBSD__) -+ *priority_ptr = pthread_getprio(thread->osthread()->pthread_id()); -+#elif defined(__APPLE__) || defined(__NetBSD__) -+ int policy; -+ struct sched_param sp; -+ -+ pthread_getschedparam(pthread_self(), &policy, &sp); -+ *priority_ptr = sp.sched_priority; -+#else - *priority_ptr = getpriority(PRIO_PROCESS, thread->osthread()->thread_id()); -+#endif - return (*priority_ptr != -1 || errno == 0 ? OS_OK : OS_ERR); - } - -@@ -3545,7 +3792,7 @@ - /* Get signal number to use for suspend/resume */ - if ((s = ::getenv("_JAVA_SR_SIGNUM")) != 0) { - int sig = ::strtol(s, 0, 10); -- if (sig > 0 || sig < _NSIG) { -+ if (sig > 0 || sig < NSIG) { - SR_signum = sig; - } - } -@@ -3889,6 +4136,28 @@ - set_signal_handler(SIGFPE, true); - set_signal_handler(SIGXFSZ, true); - -+#if defined(__APPLE__) -+ // In Mac OS X 10.4, CrashReporter will write a crash log for all 'fatal' signals, including -+ // signals caught and handled by the JVM. To work around this, we reset the mach task -+ // signal handler that's placed on our process by CrashReporter. This disables -+ // CrashReporter-based reporting. -+ // -+ // This work-around is not necessary for 10.5+, as CrashReporter no longer intercedes -+ // on caught fatal signals. -+ // -+ // Additionally, gdb installs both standard BSD signal handlers, and mach exception -+ // handlers. By replacing the existing task exception handler, we disable gdb's mach -+ // exception handling, while leaving the standard BSD signal handlers functional. -+ kern_return_t kr; -+ kr = task_set_exception_ports(mach_task_self(), -+ EXC_MASK_BAD_ACCESS | EXC_MASK_ARITHMETIC, -+ MACH_PORT_NULL, -+ EXCEPTION_STATE_IDENTITY, -+ MACHINE_THREAD_STATE); -+ -+ assert(kr == KERN_SUCCESS, "could not set mach task signal handler"); -+#endif -+ - if (libjsig_is_loaded) { - // Tell libjsig jvm finishes setting signal handlers - (*end_signal_setting)(); -@@ -3909,6 +4178,7 @@ - } - } - -+#ifndef _ALLBSD_SOURCE - // 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+. -@@ -3923,6 +4193,7 @@ - - return (tp.tv_sec * SEC_IN_NANOSECS) + tp.tv_nsec; - } -+#endif - - ///// - // glibc on Bsd platform uses non-documented flag -@@ -4144,13 +4415,13 @@ - - _initial_pid = (java_launcher_pid > 0) ? java_launcher_pid : getpid(); - -- clock_tics_per_sec = sysconf(_SC_CLK_TCK); -+ clock_tics_per_sec = CLK_TCK; - - init_random(1234567); - - ThreadCritical::initialize(); - -- Bsd::set_page_size(sysconf(_SC_PAGESIZE)); -+ Bsd::set_page_size(getpagesize()); - if (Bsd::page_size() == -1) { - fatal(err_msg("os_bsd.cpp: os::init: sysconf failed (%s)", - strerror(errno))); -@@ -4164,7 +4435,16 @@ - - Bsd::clock_init(); - initial_time_count = os::elapsed_counter(); -- pthread_mutex_init(&dl_mutex, NULL); -+ -+#ifdef __APPLE__ -+ // XXXDARWIN -+ // Work around the unaligned VM callbacks in hotspot's -+ // sharedRuntime. The callbacks don't use SSE2 instructions, and work on -+ // Linux, Solaris, and FreeBSD. On Mac OS X, dyld (rightly so) enforces -+ // alignment when doing symbol lookup. To work around this, we force early -+ // binding of all symbols now, thus binding when alignment is known-good. -+ _dyld_bind_fully_image_containing_address((const void *) &os::init); -+#endif - } - - // To install functions for atexit system call -@@ -4177,7 +4457,9 @@ - // this is called _after_ the global arguments have been parsed - jint os::init_2(void) - { -+#ifndef _ALLBSD_SOURCE - Bsd::fast_thread_clock_init(); -+#endif - - // 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); -@@ -4235,6 +4517,7 @@ - JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes, - vm_page_size())); - -+#ifndef _ALLBSD_SOURCE - Bsd::capture_initial_stack(JavaThread::stack_size_at_create()); - - Bsd::libpthread_init(); -@@ -4274,6 +4557,7 @@ - UseNUMA = true; - } - } -+#endif - - if (MaxFDLimit) { - // set the number of file descriptors to max. print out error -@@ -4285,6 +4569,14 @@ - perror("os::init_2 getrlimit failed"); - } else { - nbr_files.rlim_cur = nbr_files.rlim_max; -+ -+#ifdef __APPLE__ -+ // Darwin returns RLIM_INFINITY for rlim_max, but fails with EINVAL if -+ // you attempt to use RLIM_INFINITY. As per setrlimit(2), OPEN_MAX must -+ // be used instead -+ nbr_files.rlim_cur = MIN(OPEN_MAX, nbr_files.rlim_cur); -+#endif -+ - status = setrlimit(RLIMIT_NOFILE, &nbr_files); - if (status != 0) { - if (PrintMiscellaneous && (Verbose || WizardMode)) -@@ -4293,8 +4585,10 @@ - } - } - -+#ifndef _ALLBSD_SOURCE - // Initialize lock used to serialize thread creation (see os::create_thread) - Bsd::set_createThread_lock(new Mutex(Mutex::leaf, "createThread_lock", false)); -+#endif - - // at-exit methods are called in the reverse order of their registration. - // atexit functions are called on return from main or as a result of a -@@ -4347,11 +4641,15 @@ - }; - - int os::active_processor_count() { -+#ifdef _ALLBSD_SOURCE -+ return _processor_count; -+#else - // Bsd doesn't yet have a (official) notion of processor sets, - // so just return the number of online processors. - int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN); - assert(online_cpus > 0 && online_cpus <= processor_count(), "sanity check"); - return online_cpus; -+#endif - } - - bool os::distribute_processes(uint length, uint* distribution) { -@@ -4393,6 +4691,9 @@ - - int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime) - { -+#ifdef _ALLBSD_SOURCE -+ return pthread_cond_timedwait(_cond, _mutex, _abstime); -+#else - if (is_NPTL()) { - return pthread_cond_timedwait(_cond, _mutex, _abstime); - } else { -@@ -4408,6 +4709,7 @@ - #endif // IA64 - return status; - } -+#endif - } - - //////////////////////////////////////////////////////////////////////////////// -@@ -4555,14 +4857,14 @@ - int o_delete = (oflag & O_DELETE); - oflag = oflag & ~O_DELETE; - -- fd = ::open64(path, oflag, mode); -+ fd = ::open(path, oflag, mode); - if (fd == -1) return -1; - - //If the open succeeded, the file might still be a directory - { -- struct stat64 buf64; -- int ret = ::fstat64(fd, &buf64); -- int st_mode = buf64.st_mode; -+ struct stat buf; -+ int ret = ::fstat(fd, &buf); -+ int st_mode = buf.st_mode; - - if (ret != -1) { - if ((st_mode & S_IFMT) == S_IFDIR) { -@@ -4619,17 +4921,17 @@ - if (!rewrite_existing) { - oflags |= O_EXCL; - } -- return ::open64(path, oflags, S_IREAD | S_IWRITE); -+ return ::open(path, oflags, S_IREAD | S_IWRITE); - } - - // return current position of file pointer - jlong os::current_file_offset(int fd) { -- return (jlong)::lseek64(fd, (off64_t)0, SEEK_CUR); -+ return (jlong)::lseek(fd, (off_t)0, SEEK_CUR); - } - - // move file pointer to the specified offset - jlong os::seek_to_file_offset(int fd, jlong offset) { -- return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET); -+ return (jlong)::lseek(fd, (off_t)offset, SEEK_SET); - } - - // This code originates from JDK's sysAvailable -@@ -4638,10 +4940,10 @@ - int os::available(int fd, jlong *bytes) { - jlong cur, end; - int mode; -- struct stat64 buf64; -+ struct stat buf; - -- if (::fstat64(fd, &buf64) >= 0) { -- mode = buf64.st_mode; -+ if (::fstat(fd, &buf) >= 0) { -+ mode = buf.st_mode; - if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { - /* - * XXX: is the following call interruptible? If so, this might -@@ -4655,11 +4957,11 @@ - } - } - } -- if ((cur = ::lseek64(fd, 0L, SEEK_CUR)) == -1) { -+ if ((cur = ::lseek(fd, 0L, SEEK_CUR)) == -1) { - return 0; -- } else if ((end = ::lseek64(fd, 0L, SEEK_END)) == -1) { -+ } else if ((end = ::lseek(fd, 0L, SEEK_END)) == -1) { - return 0; -- } else if (::lseek64(fd, cur, SEEK_SET) == -1) { -+ } else if (::lseek(fd, cur, SEEK_SET) == -1) { - return 0; - } - *bytes = end - cur; -@@ -4667,12 +4969,17 @@ - } - - int os::socket_available(int fd, jint *pbytes) { -- // Bsd doc says EINTR not returned, unlike Solaris -- int ret = ::ioctl(fd, FIONREAD, pbytes); -+ if (fd < 0) -+ return OS_OK; -+ -+ int ret; - -- //%% note ioctl can return 0 when successful, JVM_SocketAvailable -- // is expected to return 0 on failure and 1 on success to the jdk. -- return (ret < 0) ? 0 : 1; -+ RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret); -+ -+ //%% note ioctl can return 0 when successful, JVM_SocketAvailable -+ // is expected to return 0 on failure and 1 on success to the jdk. -+ -+ return (ret == OS_ERR) ? 0 : 1; - } - - // Map a block of memory. -@@ -4722,6 +5029,7 @@ - return munmap(addr, bytes) == 0; - } - -+#ifndef _ALLBSD_SOURCE - static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time); - - static clockid_t thread_cpu_clockid(Thread* thread) { -@@ -4733,6 +5041,7 @@ - assert(rc == 0, "pthread_getcpuclockid is expected to return 0 code"); - return clockid; - } -+#endif - - // 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 -@@ -4742,39 +5051,71 @@ - // the fast estimate available on the platform. - - jlong os::current_thread_cpu_time() { -+#ifdef __APPLE__ -+ return os::thread_cpu_time(Thread::current(), true /* user + sys */); -+#elif !defined(_ALLBSD_SOURCE) - if (os::Bsd::supports_fast_thread_cpu_time()) { - return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID); - } else { - // return user + sys since the cost is the same - return slow_thread_cpu_time(Thread::current(), true /* user + sys */); - } -+#endif - } - - jlong os::thread_cpu_time(Thread* thread) { -+#ifndef _ALLBSD_SOURCE - // consistent with what current_thread_cpu_time() returns - if (os::Bsd::supports_fast_thread_cpu_time()) { - return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread)); - } else { - return slow_thread_cpu_time(thread, true /* user + sys */); - } -+#endif - } - - jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { -+#ifdef __APPLE__ -+ return os::thread_cpu_time(Thread::current(), user_sys_cpu_time); -+#elif !defined(_ALLBSD_SOURCE) - if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) { - return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID); - } else { - return slow_thread_cpu_time(Thread::current(), user_sys_cpu_time); - } -+#endif - } - - jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { -+#ifdef __APPLE__ -+ struct thread_basic_info tinfo; -+ mach_msg_type_number_t tcount = THREAD_INFO_MAX; -+ kern_return_t kr; -+ mach_port_t mach_thread; -+ -+ mach_thread = pthread_mach_thread_np(thread->osthread()->thread_id()); -+ kr = thread_info(mach_thread, THREAD_BASIC_INFO, (thread_info_t)&tinfo, &tcount); -+ if (kr != KERN_SUCCESS) -+ return -1; -+ -+ if (user_sys_cpu_time) { -+ jlong nanos; -+ nanos = ((jlong) tinfo.system_time.seconds + tinfo.user_time.seconds) * (jlong)1000000000; -+ nanos += ((jlong) tinfo.system_time.microseconds + (jlong) tinfo.user_time.microseconds) * (jlong)1000; -+ return nanos; -+ } else { -+ return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000); ++ // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small, ++ // __cxa_demangle will call system "realloc" for additional memory, which ++ // may use different malloc/realloc mechanism that allocates 'buf'. ++ if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) { ++ jio_snprintf(buf, buflen, "%s", result); ++ // call c library's free ++ ::free(result); ++ return true; + } -+#elif !defined(_ALLBSD_SOURCE) - if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) { - return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread)); - } else { - return slow_thread_cpu_time(thread, user_sys_cpu_time); - } -+#endif - } - -+#ifndef _ALLBSD_SOURCE - // - // -1 on error. - // -@@ -4864,6 +5205,7 @@ - return (jlong)user_time * (1000000000 / clock_tics_per_sec); - } - } -+#endif - - 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 -@@ -4880,7 +5222,13 @@ - } - - bool os::is_thread_cpu_time_supported() { -+#ifdef __APPLE__ -+ return true; -+#elif defined(_ALLBSD_SOURCE) + return false; -+#else - return true; -+#endif - } - - // System loadavg support. Returns -1 if load average cannot be obtained. -@@ -4975,7 +5323,7 @@ - // abstime will be the absolute timeout time - // TODO: replace compute_abstime() with unpackTime() - --static struct timespec* compute_abstime(timespec* abstime, jlong millis) { -+static struct timespec* compute_abstime(struct timespec* abstime, jlong millis) { - if (millis < 0) millis = 0; - struct timeval now; - int status = gettimeofday(&now, NULL); -@@ -5027,7 +5375,7 @@ - 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 -- if (status == ETIME) { status = EINTR; } -+ if (status == ETIMEDOUT) { status = EINTR; } - assert_status(status == 0 || status == EINTR, status, "cond_wait"); - } - -- _nParked ; -@@ -5085,10 +5433,10 @@ - pthread_cond_init (_cond, NULL) ; - } - assert_status(status == 0 || status == EINTR || -- status == ETIME || status == ETIMEDOUT, -+ status == ETIMEDOUT, - status, "cond_timedwait"); - if (!FilterSpuriousWakeups) break ; // previous semantics -- if (status == ETIME || status == ETIMEDOUT) break ; -+ if (status == ETIMEDOUT) break ; - // We consume and ignore EINTR and spurious wakeups. - } - --_nParked ; -@@ -5180,7 +5528,7 @@ - * years from "now". - */ - --static void unpackTime(timespec* absTime, bool isAbsolute, jlong time) { -+static void unpackTime(struct timespec* absTime, bool isAbsolute, jlong time) { - assert (time > 0, "convertTime"); - - struct timeval now; -@@ -5240,7 +5588,7 @@ - } - - // Next, demultiplex/decode time arguments -- timespec absTime; -+ struct timespec absTime; - if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all - return; - } -@@ -5294,7 +5642,7 @@ - } - } - assert_status(status == 0 || status == EINTR || -- status == ETIME || status == ETIMEDOUT, -+ status == ETIMEDOUT, - status, "cond_timedwait"); - - #ifdef ASSERT -@@ -5337,14 +5685,12 @@ - } - - -+/* Darwin has no "environ" in a dynamic library. */ -+#ifdef __APPLE__ -+#include <crt_externs.h> -+#define environ (*_NSGetEnviron()) -+#else - extern char** environ; -- --#ifndef __NR_fork --#define __NR_fork IA32_ONLY(2) IA64_ONLY(not defined) AMD64_ONLY(57) --#endif -- --#ifndef __NR_execve --#define __NR_execve IA32_ONLY(11) IA64_ONLY(1033) AMD64_ONLY(59) - #endif - - // Run the specified command in a separate process. Return its exit value, -@@ -5359,8 +5705,7 @@ - // 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... -- pid_t pid = NOT_IA64(syscall(__NR_fork);) -- IA64_ONLY(fork();) -+ pid_t pid = fork(); - - if (pid < 0) { - // fork failed -@@ -5376,8 +5721,7 @@ - // in the new process, so make a system call directly. - // IA64 should use normal execve() from glibc to match the glibc fork() - // above. -- NOT_IA64(syscall(__NR_execve, "/bin/sh", argv, environ);) -- IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);) -+ execve("/bin/sh", (char* const*)argv, environ); - - // execve failed - _exit(-1); ---- ./hotspot/src/os/bsd/vm/os_bsd.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/os_bsd.hpp 2012-03-03 19:50:46.000000000 -0800 -@@ -30,6 +30,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 *); - -+#ifdef __APPLE__ -+// Mac OS X doesn't support clock_gettime. Stub out the type, it is -+// unused -+typedef int clockid_t; -+#endif -+ - class Bsd { - friend class os; - -@@ -50,6 +56,7 @@ - static int sigflags[MAXSIGNUM]; - - static int (*_clock_gettime)(clockid_t, struct timespec *); -+#ifndef _ALLBSD_SOURCE - static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *); - - static address _initial_thread_stack_bottom; -@@ -61,6 +68,7 @@ - static bool _is_floating_stack; - static bool _is_NPTL; - static bool _supports_fast_thread_cpu_time; -+#endif - - static GrowableArray<int>* _cpu_to_node; - -@@ -68,21 +76,27 @@ - - static julong _physical_memory; - static pthread_t _main_thread; -+#ifndef _ALLBSD_SOURCE - static Mutex* _createThread_lock; -+#endif - static int _page_size; - - static julong available_memory(); - static julong physical_memory() { return _physical_memory; } - static void initialize_system_info(); - -+#ifndef _ALLBSD_SOURCE - static void set_glibc_version(const char *s) { _glibc_version = s; } - static void set_libpthread_version(const char *s) { _libpthread_version = s; } -+#endif - - static bool supports_variable_stack_size(); - -+#ifndef _ALLBSD_SOURCE - static void set_is_NPTL() { _is_NPTL = true; } - static void set_is_BsdThreads() { _is_NPTL = false; } - static void set_is_floating_stack() { _is_floating_stack = true; } -+#endif - - static void rebuild_cpu_to_node_map(); - static GrowableArray<int>* cpu_to_node() { return _cpu_to_node; } -@@ -90,19 +104,27 @@ - static bool hugetlbfs_sanity_check(bool warn, size_t page_size); - - public: -+ - static void init_thread_fpu_state(); -+#ifndef _ALLBSD_SOURCE - static int get_fpu_control_word(); - static void set_fpu_control_word(int fpu_control); -+#endif - static pthread_t main_thread(void) { return _main_thread; } -+ -+#ifndef _ALLBSD_SOURCE - // returns kernel thread id (similar to LWP id on Solaris), which can be - // used to access /proc - static pid_t gettid(); - static void set_createThread_lock(Mutex* lk) { _createThread_lock = lk; } - static Mutex* createThread_lock(void) { return _createThread_lock; } -+#endif - static void hotspot_sigmask(Thread* thread); - -+#ifndef _ALLBSD_SOURCE - static address initial_thread_stack_bottom(void) { return _initial_thread_stack_bottom; } - static uintptr_t initial_thread_stack_size(void) { return _initial_thread_stack_size; } -+#endif - static bool is_initial_thread(void); - - static int page_size(void) { return _page_size; } -@@ -139,6 +161,7 @@ - static struct sigaction *get_chained_signal_action(int sig); - static bool chained_handler(int sig, siginfo_t* siginfo, void* context); - -+#ifndef _ALLBSD_SOURCE - // GNU libc and libpthread version strings - static const char *glibc_version() { return _glibc_version; } - static const char *libpthread_version() { return _libpthread_version; } -@@ -154,6 +177,7 @@ - static void libpthread_init(); - static bool libnuma_init(); - static void* libnuma_dlsym(void* handle, const char* name); -+#endif - // 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; -@@ -162,17 +186,21 @@ - static size_t default_stack_size(os::ThreadType thr_type); - static size_t default_guard_size(os::ThreadType thr_type); - -+#ifndef _ALLBSD_SOURCE - static void capture_initial_stack(size_t max_size); - - // Stack overflow handling - static bool manually_expand_stack(JavaThread * t, address addr); - static int max_register_window_saves_before_flushing(); -+#endif - - // Real-time clock functions - static void clock_init(void); - -+#ifndef _ALLBSD_SOURCE - // fast POSIX clocks support - static void fast_thread_clock_init(void); -+#endif - - static bool supports_monotonic_clock() { - return _clock_gettime != NULL; -@@ -182,6 +210,7 @@ - return _clock_gettime ? _clock_gettime(clock_id, tp) : -1; - } - -+#ifndef _ALLBSD_SOURCE - static int pthread_getcpuclockid(pthread_t tid, clockid_t *clock_id) { - return _pthread_getcpuclockid ? _pthread_getcpuclockid(tid, clock_id) : -1; - } -@@ -191,6 +220,7 @@ - } - - static jlong fast_thread_cpu_time(clockid_t clockid); -+#endif - - // Stack repair handling - ---- ./hotspot/src/os/bsd/vm/os_bsd.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/os_bsd.inline.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -94,7 +94,15 @@ - - inline bool os::allocate_stack_guard_pages() { - assert(uses_stack_guard_pages(), "sanity check"); -+#if !defined(__FreeBSD__) || __FreeBSD__ < 5 -+ // Since FreeBSD 4 uses malloc() for allocating the thread stack -+ // there is no need to do anything extra to allocate the guard pages -+ return false; -+#else -+ // FreeBSD 5+ uses mmap MAP_STACK for allocating the thread stacks. -+ // Must 'allocate' them or guard pages are ignored. - return true; -+#endif - } - - -@@ -126,7 +134,7 @@ - } - - inline jlong os::lseek(int fd, jlong offset, int whence) { -- return (jlong) ::lseek64(fd, offset, whence); -+ return (jlong) ::lseek(fd, offset, whence); - } - - inline int os::fsync(int fd) { -@@ -138,7 +146,7 @@ - } - - inline int os::ftruncate(int fd, jlong length) { -- return ::ftruncate64(fd, length); -+ return ::ftruncate(fd, length); - } - - inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) -@@ -191,11 +199,11 @@ - } - - inline int os::close(int fd) { -- return ::close(fd); -+ RESTARTABLE_RETURN_INT(::close(fd)); - } - - inline int os::socket_close(int fd) { -- return ::close(fd); -+ RESTARTABLE_RETURN_INT(::close(fd)); - } - - inline int os::socket(int domain, int type, int protocol) { -@@ -260,9 +268,9 @@ - // 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 - -- return ::accept(fd, him, (socklen_t *)len); -+ // At least OpenBSD and FreeBSD can return EINTR from accept. -+ RESTARTABLE_RETURN_INT(::accept(fd, him, (socklen_t *)len)); - } - - inline int os::recvfrom(int fd, char *buf, int nBytes, int flags, ---- ./hotspot/src/os/bsd/vm/perfMemory_bsd.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os/bsd/vm/perfMemory_bsd.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -248,7 +248,7 @@ - - char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize); - -- // POSIX interface to getpwuid_r is used on BSD -+ // POSIX interface to getpwuid_r is used on LINUX - struct passwd* p; - int result = getpwuid_r(uid, &pwent, pwbuf, (size_t)bufsize, &p); - ---- ./hotspot/src/os/linux/vm/os_linux.cpp 2011-11-17 21:37:12.000000000 -0800 -+++ ./hotspot/src/os/linux/vm/os_linux.cpp 2012-02-26 13:59:19.000000000 -0800 -@@ -22,8 +22,6 @@ - * - */ - --# define __STDC_FORMAT_MACROS -- - // no precompiled headers - #include "classfile/classLoader.hpp" - #include "classfile/systemDictionary.hpp" ---- ./hotspot/src/os/posix/launcher/java_md.c 2011-11-17 21:37:12.000000000 -0800 -+++ ./hotspot/src/os/posix/launcher/java_md.c 2011-07-07 19:49:18.000000000 -0700 -@@ -41,14 +41,21 @@ - #include "version_comp.h" - #endif - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #include <pthread.h> - #else - #include <thread.h> - #endif - -+#ifdef __APPLE__ -+#define JVM_DLL "libjvm.dylib" -+#define JAVA_DLL "libjava.dylib" -+#define LD_LIBRARY_PATH "DYLD_LIBRARY_PATH" -+#else - #define JVM_DLL "libjvm.so" - #define JAVA_DLL "libjava.so" -+#define LD_LIBRARY_PATH "LD_LIBRARY_PATH" -+#endif - - #ifndef GAMMA /* launcher.make defines ARCH */ - /* -@@ -423,10 +430,10 @@ - * If not on Solaris, assume only a single LD_LIBRARY_PATH - * variable. - */ -- runpath = getenv("LD_LIBRARY_PATH"); -+ runpath = getenv(LD_LIBRARY_PATH); - #endif /* __sun */ - --#ifdef __linux -+#if defined(__linux) - /* - * On linux, if a binary is running as sgid or suid, glibc sets - * LD_LIBRARY_PATH to the empty string for security purposes. (In -@@ -442,6 +449,22 @@ - if((getgid() != getegid()) || (getuid() != geteuid()) ) { - return; - } -+#elif defined(_ALLBSD_SOURCE) -+ /* -+ * On BSD, if a binary is running as sgid or suid, libc sets -+ * LD_LIBRARY_PATH to the empty string for security purposes. (In -+ * contrast, on Solaris the LD_LIBRARY_PATH variable for a -+ * privileged binary does not lose its settings; but the dynamic -+ * linker does apply more scrutiny to the path.) The launcher uses -+ * the value of LD_LIBRARY_PATH to prevent an exec loop. -+ * Therefore, if we are running sgid or suid, this function's -+ * setting of LD_LIBRARY_PATH will be ineffective and we should -+ * return from the function now. Getting the right libraries to -+ * be found must be handled through other mechanisms. -+ */ -+ if(issetugid()) { -+ return; -+ } - #endif - - /* runpath contains current effective LD_LIBRARY_PATH setting */ -@@ -450,7 +473,7 @@ - new_runpath = JLI_MemAlloc( ((runpath!=NULL)?strlen(runpath):0) + - 2*strlen(jrepath) + 2*strlen(arch) + - strlen(jvmpath) + 52); -- newpath = new_runpath + strlen("LD_LIBRARY_PATH="); -+ newpath = new_runpath + strlen(LD_LIBRARY_PATH "="); - - - /* -@@ -465,7 +488,7 @@ - - /* jvmpath, ((running != wanted)?((wanted==64)?"/"LIBARCH64NAME:"/.."):""), */ - -- sprintf(new_runpath, "LD_LIBRARY_PATH=" -+ sprintf(new_runpath, LD_LIBRARY_PATH "=" - "%s:" - "%s/lib/%s:" - "%s/../lib/%s", -@@ -792,7 +815,7 @@ - jboolean - GetApplicationHome(char *buf, jint bufsize) - { --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - char *execname = GetExecname(); - if (execname) { - strncpy(buf, execname, bufsize-1); -@@ -1175,7 +1198,7 @@ - - #endif /* __sun && i586 */ - --#if defined(__linux__) && defined(i586) -+#if (defined(__linux__) || defined(_ALLBSD_SOURCE)) && defined(i586) - - /* - * A utility method for asking the CPU about itself. -@@ -1452,6 +1475,39 @@ - - #endif /* __linux__ && i586 */ - -+#if defined(_ALLBSD_SOURCE) && defined(i586) -+ -+/* The definition of a server-class machine for bsd-i586 */ -+jboolean -+bsd_i586_ServerClassMachine(void) { -+ jboolean result = JNI_FALSE; -+ /* How big is a server class machine? */ -+ const unsigned long server_processors = 2UL; -+ const uint64_t server_memory = 2UL * GB; -+ /* -+ * We seem not to get our full complement of memory. -+ * We allow some part (1/8?) of the memory to be "missing", -+ * based on the sizes of DIMMs, and maybe graphics cards. -+ */ -+ const uint64_t missing_memory = 256UL * MB; -+ const uint64_t actual_memory = physical_memory(); -+ -+ /* Is this a server class machine? */ -+ if (actual_memory >= (server_memory - missing_memory)) { -+ const unsigned long actual_processors = physical_processors(); -+ if (actual_processors >= server_processors) { -+ result = JNI_TRUE; -+ } -+ } -+ if (_launcher_debug) { -+ printf("linux_" LIBARCHNAME "_ServerClassMachine: %s\n", -+ (result == JNI_TRUE ? "true" : "false")); -+ } -+ return result; +} + -+#endif /* _ALLBSD_SOURCE && i586 */ -+ - /* Dispatch to the platform-specific definition of "server-class" */ - jboolean - ServerClassMachine(void) { -@@ -1466,6 +1522,8 @@ - result = solaris_i586_ServerClassMachine(); - #elif defined(__linux__) && defined(i586) - result = linux_i586_ServerClassMachine(); -+#elif defined(_ALLBSD_SOURCE) && defined(i586) -+ result = bsd_i586_ServerClassMachine(); - #else - if (_launcher_debug) { - printf("ServerClassMachine: returns default value of %s\n", -@@ -1821,7 +1879,7 @@ - int - ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { - int rslt; --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - pthread_t tid; - pthread_attr_t attr; - pthread_attr_init(&attr); ---- ./hotspot/src/os/posix/launcher/launcher.script 2011-11-17 21:37:12.000000000 -0800 -+++ ./hotspot/src/os/posix/launcher/launcher.script 2011-04-22 22:28:34.000000000 -0700 -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/bin/sh - - # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ---- ./hotspot/src/os_cpu/bsd_sparc/vm/assembler_bsd_sparc.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/assembler_bsd_sparc.cpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,48 +0,0 @@ --/* -- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#include "precompiled.hpp" --#include "asm/assembler.hpp" --#include "assembler_sparc.inline.hpp" --#include "runtime/os.hpp" --#include "runtime/threadLocalStorage.hpp" -- --#include <asm-sparc/traps.h> -- --void MacroAssembler::read_ccr_trap(Register ccr_save) { -- // No implementation -- breakpoint_trap(); --} -- --void MacroAssembler::write_ccr_trap(Register ccr_save, Register scratch1, Register scratch2) { -- // No implementation -- breakpoint_trap(); --} -- --void MacroAssembler::flush_windows_trap() { trap(SP_TRAP_FWIN); } --void MacroAssembler::clean_windows_trap() { trap(SP_TRAP_CWIN); } -- --// Use software breakpoint trap until we figure out how to do this on Bsd --void MacroAssembler::get_psr_trap() { trap(SP_TRAP_SBPT); } --void MacroAssembler::set_psr_trap() { trap(SP_TRAP_SBPT); } ---- ./hotspot/src/os_cpu/bsd_sparc/vm/atomic_bsd_sparc.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/atomic_bsd_sparc.inline.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,218 +0,0 @@ --/* -- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_ATOMIC_BSD_SPARC_INLINE_HPP --#define OS_CPU_BSD_SPARC_VM_ATOMIC_BSD_SPARC_INLINE_HPP -- --#include "orderAccess_bsd_sparc.inline.hpp" --#include "runtime/atomic.hpp" --#include "runtime/os.hpp" --#include "vm_version_sparc.hpp" -- --// Implementation of class atomic -- --inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } --inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; } --inline void Atomic::store (jint store_value, jint* dest) { *dest = store_value; } --inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; } --inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; } --inline void Atomic::store_ptr(void* store_value, void* dest) { *(void**)dest = store_value; } -- --inline void Atomic::store (jbyte store_value, volatile jbyte* dest) { *dest = store_value; } --inline void Atomic::store (jshort store_value, volatile jshort* dest) { *dest = store_value; } --inline void Atomic::store (jint store_value, volatile jint* dest) { *dest = store_value; } --inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; } --inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; } --inline void Atomic::store_ptr(void* store_value, volatile void* dest) { *(void* volatile *)dest = store_value; } -- --inline void Atomic::inc (volatile jint* dest) { (void)add (1, dest); } --inline void Atomic::inc_ptr(volatile intptr_t* dest) { (void)add_ptr(1, dest); } --inline void Atomic::inc_ptr(volatile void* dest) { (void)add_ptr(1, dest); } -- --inline void Atomic::dec (volatile jint* dest) { (void)add (-1, dest); } --inline void Atomic::dec_ptr(volatile intptr_t* dest) { (void)add_ptr(-1, dest); } --inline void Atomic::dec_ptr(volatile void* dest) { (void)add_ptr(-1, dest); } -- --inline jlong Atomic::load(volatile jlong* src) { return *src; } -- --inline jint Atomic::add (jint add_value, volatile jint* dest) { -- intptr_t rv; -- __asm__ volatile( -- "1: \n\t" -- " ld [%2], %%o2\n\t" -- " add %1, %%o2, %%o3\n\t" -- " cas [%2], %%o2, %%o3\n\t" -- " cmp %%o2, %%o3\n\t" -- " bne 1b\n\t" -- " nop\n\t" -- " add %1, %%o2, %0\n\t" -- : "=r" (rv) -- : "r" (add_value), "r" (dest) -- : "memory", "o2", "o3"); -- return rv; --} -- --inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) { -- intptr_t rv; --#ifdef _LP64 -- __asm__ volatile( -- "1: \n\t" -- " ldx [%2], %%o2\n\t" -- " add %0, %%o2, %%o3\n\t" -- " casx [%2], %%o2, %%o3\n\t" -- " cmp %%o2, %%o3\n\t" -- " bne %%xcc, 1b\n\t" -- " nop\n\t" -- " add %0, %%o2, %0\n\t" -- : "=r" (rv) -- : "r" (add_value), "r" (dest) -- : "memory", "o2", "o3"); --#else -- __asm__ volatile( -- "1: \n\t" -- " ld [%2], %%o2\n\t" -- " add %1, %%o2, %%o3\n\t" -- " cas [%2], %%o2, %%o3\n\t" -- " cmp %%o2, %%o3\n\t" -- " bne 1b\n\t" -- " nop\n\t" -- " add %1, %%o2, %0\n\t" -- : "=r" (rv) -- : "r" (add_value), "r" (dest) -- : "memory", "o2", "o3"); --#endif // _LP64 -- return rv; --} -- --inline void* Atomic::add_ptr(intptr_t add_value, volatile void* dest) { -- return (void*)add_ptr((intptr_t)add_value, (volatile intptr_t*)dest); --} -- -- --inline jint Atomic::xchg (jint exchange_value, volatile jint* dest) { -- intptr_t rv = exchange_value; -- __asm__ volatile( -- " swap [%2],%1\n\t" -- : "=r" (rv) -- : "0" (exchange_value) /* we use same register as for return value */, "r" (dest) -- : "memory"); -- return rv; --} -- --inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest) { -- intptr_t rv = exchange_value; --#ifdef _LP64 -- __asm__ volatile( -- "1:\n\t" -- " mov %1, %%o3\n\t" -- " ldx [%2], %%o2\n\t" -- " casx [%2], %%o2, %%o3\n\t" -- " cmp %%o2, %%o3\n\t" -- " bne %%xcc, 1b\n\t" -- " nop\n\t" -- " mov %%o2, %0\n\t" -- : "=r" (rv) -- : "r" (exchange_value), "r" (dest) -- : "memory", "o2", "o3"); --#else -- __asm__ volatile( -- "swap [%2],%1\n\t" -- : "=r" (rv) -- : "0" (exchange_value) /* we use same register as for return value */, "r" (dest) -- : "memory"); --#endif // _LP64 -- return rv; --} -- --inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { -- return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); --} -- -- --inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) { -- jint rv; -- __asm__ volatile( -- " cas [%2], %3, %0" -- : "=r" (rv) -- : "0" (exchange_value), "r" (dest), "r" (compare_value) -- : "memory"); -- return rv; --} -- --inline jlong Atomic::cmpxchg (jlong exchange_value, volatile jlong* dest, jlong compare_value) { --#ifdef _LP64 -- jlong rv; -- __asm__ volatile( -- " casx [%2], %3, %0" -- : "=r" (rv) -- : "0" (exchange_value), "r" (dest), "r" (compare_value) -- : "memory"); -- return rv; --#else -- assert(VM_Version::v9_instructions_work(), "cas only supported on v9"); -- volatile jlong_accessor evl, cvl, rv; -- evl.long_value = exchange_value; -- cvl.long_value = compare_value; -- -- __asm__ volatile( -- " sllx %2, 32, %2\n\t" -- " srl %3, 0, %3\n\t" -- " or %2, %3, %2\n\t" -- " sllx %5, 32, %5\n\t" -- " srl %6, 0, %6\n\t" -- " or %5, %6, %5\n\t" -- " casx [%4], %5, %2\n\t" -- " srl %2, 0, %1\n\t" -- " srlx %2, 32, %0\n\t" -- : "=r" (rv.words[0]), "=r" (rv.words[1]) -- : "r" (evl.words[0]), "r" (evl.words[1]), "r" (dest), "r" (cvl.words[0]), "r" (cvl.words[1]) -- : "memory"); -- -- return rv.long_value; --#endif --} -- --inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value) { -- intptr_t rv; --#ifdef _LP64 -- __asm__ volatile( -- " casx [%2], %3, %0" -- : "=r" (rv) -- : "0" (exchange_value), "r" (dest), "r" (compare_value) -- : "memory"); --#else -- __asm__ volatile( -- " cas [%2], %3, %0" -- : "=r" (rv) -- : "0" (exchange_value), "r" (dest), "r" (compare_value) -- : "memory"); --#endif // _LP64 -- return rv; --} -- --inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) { -- return (void*)cmpxchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest, (intptr_t)compare_value); --} -- --#endif // OS_CPU_BSD_SPARC_VM_ATOMIC_BSD_SPARC_INLINE_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/bsd_sparc.ad 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/bsd_sparc.ad 1969-12-31 16:00:00.000000000 -0800 -@@ -1,27 +0,0 @@ --// --// Copyright (c) 1999, 2008, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA --// or visit www.oracle.com if you need additional information or have any --// questions. --// -- --// --// -- --// SPARC Bsd Architecture Description File ---- ./hotspot/src/os_cpu/bsd_sparc/vm/bsd_sparc.s 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/bsd_sparc.s 1969-12-31 16:00:00.000000000 -0800 -@@ -1,105 +0,0 @@ --# --# Copyright (c) 2005, 2008, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA --# or visit www.oracle.com if you need additional information or have any --# questions. --# -- -- # Prototype: int SafeFetch32 (int * adr, int ErrValue) -- # The "ld" at Fetch32 is potentially faulting instruction. -- # If the instruction traps the trap handler will arrange -- # for control to resume at Fetch32Resume. -- # By convention with the trap handler we ensure there is a non-CTI -- # instruction in the trap shadow. -- -- -- .globl SafeFetch32, Fetch32PFI, Fetch32Resume -- .globl SafeFetchN -- .align 32 -- .type SafeFetch32,@function --SafeFetch32: -- mov %o0, %g1 -- mov %o1, %o0 --Fetch32PFI: -- # <-- Potentially faulting instruction -- ld [%g1], %o0 --Fetch32Resume: -- nop -- retl -- nop -- -- .globl SafeFetchN, FetchNPFI, FetchNResume -- .type SafeFetchN,@function -- .align 32 --SafeFetchN: -- mov %o0, %g1 -- mov %o1, %o0 --FetchNPFI: -- ldn [%g1], %o0 --FetchNResume: -- nop -- retl -- nop -- -- # Possibilities: -- # -- membar -- # -- CAS (SP + BIAS, G0, G0) -- # -- wr %g0, %asi -- -- .globl SpinPause -- .type SpinPause,@function -- .align 32 --SpinPause: -- retl -- mov %g0, %o0 -- -- .globl _Copy_conjoint_jlongs_atomic -- .type _Copy_conjoint_jlongs_atomic,@function --_Copy_conjoint_jlongs_atomic: -- cmp %o0, %o1 -- bleu 4f -- sll %o2, 3, %o4 -- ba 2f -- 1: -- subcc %o4, 8, %o4 -- std %o2, [%o1] -- add %o0, 8, %o0 -- add %o1, 8, %o1 -- 2: -- bge,a 1b -- ldd [%o0], %o2 -- ba 5f -- nop -- 3: -- std %o2, [%o1+%o4] -- 4: -- subcc %o4, 8, %o4 -- bge,a 3b -- ldd [%o0+%o4], %o2 -- 5: -- retl -- nop -- -- -- .globl _flush_reg_windows -- .align 32 -- _flush_reg_windows: -- ta 0x03 -- retl -- mov %fp, %o0 ---- ./hotspot/src/os_cpu/bsd_sparc/vm/globals_bsd_sparc.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/globals_bsd_sparc.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,41 +0,0 @@ --/* -- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_GLOBALS_BSD_SPARC_HPP --#define OS_CPU_BSD_SPARC_VM_GLOBALS_BSD_SPARC_HPP -- --// --// Sets the default values for platform dependent flags used by the --// runtime system. (see globals.hpp) --// -- --define_pd_global(uintx, JVMInvokeMethodSlack, 12288); --define_pd_global(intx, CompilerThreadStackSize, 0); -- --// Only used on 64 bit platforms --define_pd_global(uintx, HeapBaseMinAddress, 4*G); --// Only used on 64 bit Windows platforms --define_pd_global(bool, UseVectoredExceptions, false); -- --#endif // OS_CPU_BSD_SPARC_VM_GLOBALS_BSD_SPARC_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/orderAccess_bsd_sparc.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/orderAccess_bsd_sparc.inline.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,110 +0,0 @@ --/* -- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_ORDERACCESS_BSD_SPARC_INLINE_HPP --#define OS_CPU_BSD_SPARC_VM_ORDERACCESS_BSD_SPARC_INLINE_HPP -- --#include "runtime/orderAccess.hpp" --#include "vm_version_sparc.hpp" -- --// Implementation of class OrderAccess. -- --// Assume TSO. -- --inline void OrderAccess::loadload() { acquire(); } --inline void OrderAccess::storestore() { release(); } --inline void OrderAccess::loadstore() { acquire(); } --inline void OrderAccess::storeload() { fence(); } -- --inline void OrderAccess::acquire() { -- __asm__ volatile ("nop" : : :); --} -- --inline void OrderAccess::release() { -- jint* local_dummy = (jint*)&local_dummy; -- __asm__ volatile("stw %%g0, [%0]" : : "r" (local_dummy) : "memory"); --} -- --inline void OrderAccess::fence() { -- __asm__ volatile ("membar #StoreLoad" : : :); --} -- --inline jbyte OrderAccess::load_acquire(volatile jbyte* p) { return *p; } --inline jshort OrderAccess::load_acquire(volatile jshort* p) { return *p; } --inline jint OrderAccess::load_acquire(volatile jint* p) { return *p; } --inline jlong OrderAccess::load_acquire(volatile jlong* p) { return *p; } --inline jubyte OrderAccess::load_acquire(volatile jubyte* p) { return *p; } --inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; } --inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; } --inline julong OrderAccess::load_acquire(volatile julong* p) { return *p; } --inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; } --inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return *p; } -- --inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t* p) { return *p; } --inline void* OrderAccess::load_ptr_acquire(volatile void* p) { return *(void* volatile *)p; } --inline void* OrderAccess::load_ptr_acquire(const volatile void* p) { return *(void* const volatile *)p; } -- --inline void OrderAccess::release_store(volatile jbyte* p, jbyte v) { *p = v; } --inline void OrderAccess::release_store(volatile jshort* p, jshort v) { *p = v; } --inline void OrderAccess::release_store(volatile jint* p, jint v) { *p = v; } --inline void OrderAccess::release_store(volatile jlong* p, jlong v) { *p = v; } --inline void OrderAccess::release_store(volatile jubyte* p, jubyte v) { *p = v; } --inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p = v; } --inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; } --inline void OrderAccess::release_store(volatile julong* p, julong v) { *p = v; } --inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; } --inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; } -- --inline void OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; } --inline void OrderAccess::release_store_ptr(volatile void* p, void* v) { *(void* volatile *)p = v; } -- --inline void OrderAccess::store_fence(jbyte* p, jbyte v) { *p = v; fence(); } --inline void OrderAccess::store_fence(jshort* p, jshort v) { *p = v; fence(); } --inline void OrderAccess::store_fence(jint* p, jint v) { *p = v; fence(); } --inline void OrderAccess::store_fence(jlong* p, jlong v) { *p = v; fence(); } --inline void OrderAccess::store_fence(jubyte* p, jubyte v) { *p = v; fence(); } --inline void OrderAccess::store_fence(jushort* p, jushort v) { *p = v; fence(); } --inline void OrderAccess::store_fence(juint* p, juint v) { *p = v; fence(); } --inline void OrderAccess::store_fence(julong* p, julong v) { *p = v; fence(); } --inline void OrderAccess::store_fence(jfloat* p, jfloat v) { *p = v; fence(); } --inline void OrderAccess::store_fence(jdouble* p, jdouble v) { *p = v; fence(); } -- --inline void OrderAccess::store_ptr_fence(intptr_t* p, intptr_t v) { *p = v; fence(); } --inline void OrderAccess::store_ptr_fence(void** p, void* v) { *p = v; fence(); } -- --inline void OrderAccess::release_store_fence(volatile jbyte* p, jbyte v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile jshort* p, jshort v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile jint* p, jint v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile jubyte* p, jubyte v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile jushort* p, jushort v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile juint* p, juint v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile julong* p, julong v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile jfloat* p, jfloat v) { *p = v; fence(); } --inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); } -- --inline void OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); } --inline void OrderAccess::release_store_ptr_fence(volatile void* p, void* v) { *(void* volatile *)p = v; fence(); } -- --#endif // OS_CPU_BSD_SPARC_VM_ORDERACCESS_BSD_SPARC_INLINE_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/os_bsd_sparc.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/os_bsd_sparc.cpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,758 +0,0 @@ --/* -- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --// no precompiled headers --#include "assembler_sparc.inline.hpp" --#include "classfile/classLoader.hpp" --#include "classfile/systemDictionary.hpp" --#include "classfile/vmSymbols.hpp" --#include "code/icBuffer.hpp" --#include "code/vtableStubs.hpp" --#include "interpreter/interpreter.hpp" --#include "jvm_bsd.h" --#include "memory/allocation.inline.hpp" --#include "mutex_bsd.inline.hpp" --#include "nativeInst_sparc.hpp" --#include "os_share_bsd.hpp" --#include "prims/jniFastGetField.hpp" --#include "prims/jvm.h" --#include "prims/jvm_misc.hpp" --#include "runtime/arguments.hpp" --#include "runtime/extendedPC.hpp" --#include "runtime/frame.inline.hpp" --#include "runtime/interfaceSupport.hpp" --#include "runtime/java.hpp" --#include "runtime/javaCalls.hpp" --#include "runtime/mutexLocker.hpp" --#include "runtime/osThread.hpp" --#include "runtime/sharedRuntime.hpp" --#include "runtime/stubRoutines.hpp" --#include "runtime/timer.hpp" --#include "thread_bsd.inline.hpp" --#include "utilities/events.hpp" --#include "utilities/vmError.hpp" --#ifdef COMPILER1 --#include "c1/c1_Runtime1.hpp" --#endif --#ifdef COMPILER2 --#include "opto/runtime.hpp" --#endif -- -- --// Bsd/Sparc has rather obscure naming of registers in sigcontext --// different between 32 and 64 bits --#ifdef _LP64 --#define SIG_PC(x) ((x)->sigc_regs.tpc) --#define SIG_NPC(x) ((x)->sigc_regs.tnpc) --#define SIG_REGS(x) ((x)->sigc_regs) --#else --#define SIG_PC(x) ((x)->si_regs.pc) --#define SIG_NPC(x) ((x)->si_regs.npc) --#define SIG_REGS(x) ((x)->si_regs) --#endif -- --// those are to reference registers in sigcontext --enum { -- CON_G0 = 0, -- CON_G1, -- CON_G2, -- CON_G3, -- CON_G4, -- CON_G5, -- CON_G6, -- CON_G7, -- CON_O0, -- CON_O1, -- CON_O2, -- CON_O3, -- CON_O4, -- CON_O5, -- CON_O6, -- CON_O7, --}; -- --static inline void set_cont_address(sigcontext* ctx, address addr) { -- SIG_PC(ctx) = (intptr_t)addr; -- SIG_NPC(ctx) = (intptr_t)(addr+4); --} -- --// For Forte Analyzer AsyncGetCallTrace profiling support - thread is --// currently interrupted by SIGPROF. --// os::Solaris::fetch_frame_from_ucontext() tries to skip nested --// signal frames. Currently we don't do that on Bsd, so it's the --// same as os::fetch_frame_from_context(). --ExtendedPC os::Bsd::fetch_frame_from_ucontext(Thread* thread, -- ucontext_t* uc, -- intptr_t** ret_sp, -- intptr_t** ret_fp) { -- assert(thread != NULL, "just checking"); -- assert(ret_sp != NULL, "just checking"); -- assert(ret_fp != NULL, "just checking"); -- -- return os::fetch_frame_from_context(uc, ret_sp, ret_fp); --} -- --ExtendedPC os::fetch_frame_from_context(void* ucVoid, -- intptr_t** ret_sp, -- intptr_t** ret_fp) { -- ucontext_t* uc = (ucontext_t*) ucVoid; -- ExtendedPC epc; -- -- if (uc != NULL) { -- epc = ExtendedPC(os::Bsd::ucontext_get_pc(uc)); -- if (ret_sp) { -- *ret_sp = os::Bsd::ucontext_get_sp(uc); -- } -- if (ret_fp) { -- *ret_fp = os::Bsd::ucontext_get_fp(uc); -- } -- } else { -- // construct empty ExtendedPC for return value checking -- epc = ExtendedPC(NULL); -- if (ret_sp) { -- *ret_sp = (intptr_t*) NULL; -- } -- if (ret_fp) { -- *ret_fp = (intptr_t*) NULL; -- } -- } -- -- return epc; --} -- --frame os::fetch_frame_from_context(void* ucVoid) { -- intptr_t* sp; -- intptr_t* fp; -- ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp); -- return frame(sp, fp, epc.pc()); --} -- --frame os::get_sender_for_C_frame(frame* fr) { -- return frame(fr->sender_sp(), fr->link(), fr->sender_pc()); --} -- --frame os::current_frame() { -- fprintf(stderr, "current_frame()"); -- -- intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()(); -- frame myframe(sp, frame::unpatchable, -- CAST_FROM_FN_PTR(address, os::current_frame)); -- if (os::is_first_C_frame(&myframe)) { -- // stack is not walkable -- return frame(NULL, frame::unpatchable, NULL); -- } else { -- return os::get_sender_for_C_frame(&myframe); -- } --} -- --address os::current_stack_pointer() { -- register void *sp __asm__ ("sp"); -- return (address)sp; --} -- --static void current_stack_region(address* bottom, size_t* size) { -- if (os::Bsd::is_initial_thread()) { -- // initial thread needs special handling because pthread_getattr_np() -- // may return bogus value. -- *bottom = os::Bsd::initial_thread_stack_bottom(); -- *size = os::Bsd::initial_thread_stack_size(); -- } else { -- pthread_attr_t attr; -- -- int rslt = pthread_getattr_np(pthread_self(), &attr); -- -- // JVM needs to know exact stack location, abort if it fails -- if (rslt != 0) { -- if (rslt == ENOMEM) { -- vm_exit_out_of_memory(0, "pthread_getattr_np"); -- } else { -- fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt)); -- } -- } -- -- if (pthread_attr_getstack(&attr, (void**)bottom, size) != 0) { -- fatal("Can not locate current stack attributes!"); -- } -- -- pthread_attr_destroy(&attr); -- } -- assert(os::current_stack_pointer() >= *bottom && -- os::current_stack_pointer() < *bottom + *size, "just checking"); --} -- --address os::current_stack_base() { -- address bottom; -- size_t size; -- current_stack_region(&bottom, &size); -- return bottom + size; --} -- --size_t os::current_stack_size() { -- // stack size includes normal stack and HotSpot guard pages -- address bottom; -- size_t size; -- current_stack_region(&bottom, &size); -- return size; --} -- --char* os::non_memory_address_word() { -- // Must never look like an address returned by reserve_memory, -- // even in its subfields (as defined by the CPU immediate fields, -- // if the CPU splits constants across multiple instructions). -- // On SPARC, 0 != %hi(any real address), because there is no -- // allocation in the first 1Kb of the virtual address space. -- return (char*) 0; --} -- --void os::initialize_thread() {} -- --void os::print_context(outputStream *st, void *context) { -- if (context == NULL) return; -- -- ucontext_t* uc = (ucontext_t*)context; -- sigcontext* sc = (sigcontext*)context; -- st->print_cr("Registers:"); -- -- st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT -- " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT, -- SIG_REGS(sc).u_regs[CON_G1], -- SIG_REGS(sc).u_regs[CON_G2], -- SIG_REGS(sc).u_regs[CON_G3], -- SIG_REGS(sc).u_regs[CON_G4]); -- st->print_cr(" G5=" INTPTR_FORMAT " G6=" INTPTR_FORMAT -- " G7=" INTPTR_FORMAT " Y=" INTPTR_FORMAT, -- SIG_REGS(sc).u_regs[CON_G5], -- SIG_REGS(sc).u_regs[CON_G6], -- SIG_REGS(sc).u_regs[CON_G7], -- SIG_REGS(sc).y); -- st->print_cr(" O0=" INTPTR_FORMAT " O1=" INTPTR_FORMAT -- " O2=" INTPTR_FORMAT " O3=" INTPTR_FORMAT, -- SIG_REGS(sc).u_regs[CON_O0], -- SIG_REGS(sc).u_regs[CON_O1], -- SIG_REGS(sc).u_regs[CON_O2], -- SIG_REGS(sc).u_regs[CON_O3]); -- st->print_cr(" O4=" INTPTR_FORMAT " O5=" INTPTR_FORMAT -- " O6=" INTPTR_FORMAT " O7=" INTPTR_FORMAT, -- SIG_REGS(sc).u_regs[CON_O4], -- SIG_REGS(sc).u_regs[CON_O5], -- SIG_REGS(sc).u_regs[CON_O6], -- SIG_REGS(sc).u_regs[CON_O7]); -- -- -- intptr_t *sp = (intptr_t *)os::Bsd::ucontext_get_sp(uc); -- st->print_cr(" L0=" INTPTR_FORMAT " L1=" INTPTR_FORMAT -- " L2=" INTPTR_FORMAT " L3=" INTPTR_FORMAT, -- sp[L0->sp_offset_in_saved_window()], -- sp[L1->sp_offset_in_saved_window()], -- sp[L2->sp_offset_in_saved_window()], -- sp[L3->sp_offset_in_saved_window()]); -- st->print_cr(" L4=" INTPTR_FORMAT " L5=" INTPTR_FORMAT -- " L6=" INTPTR_FORMAT " L7=" INTPTR_FORMAT, -- sp[L4->sp_offset_in_saved_window()], -- sp[L5->sp_offset_in_saved_window()], -- sp[L6->sp_offset_in_saved_window()], -- sp[L7->sp_offset_in_saved_window()]); -- st->print_cr(" I0=" INTPTR_FORMAT " I1=" INTPTR_FORMAT -- " I2=" INTPTR_FORMAT " I3=" INTPTR_FORMAT, -- sp[I0->sp_offset_in_saved_window()], -- sp[I1->sp_offset_in_saved_window()], -- sp[I2->sp_offset_in_saved_window()], -- sp[I3->sp_offset_in_saved_window()]); -- st->print_cr(" I4=" INTPTR_FORMAT " I5=" INTPTR_FORMAT -- " I6=" INTPTR_FORMAT " I7=" INTPTR_FORMAT, -- sp[I4->sp_offset_in_saved_window()], -- sp[I5->sp_offset_in_saved_window()], -- sp[I6->sp_offset_in_saved_window()], -- sp[I7->sp_offset_in_saved_window()]); -- -- st->print_cr(" PC=" INTPTR_FORMAT " nPC=" INTPTR_FORMAT, -- SIG_PC(sc), -- SIG_NPC(sc)); -- st->cr(); -- st->cr(); -- -- st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp); -- print_hex_dump(st, (address)sp, (address)(sp + 32), sizeof(intptr_t)); -- st->cr(); -- -- // Note: it may be unsafe to inspect memory near pc. For example, pc may -- // point to garbage if entry point in an nmethod is corrupted. Leave -- // this at the end, and hope for the best. -- address pc = os::Bsd::ucontext_get_pc(uc); -- st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc); -- print_hex_dump(st, pc - 32, pc + 32, sizeof(char)); --} -- -- --void os::print_register_info(outputStream *st, void *context) { -- if (context == NULL) return; -- -- ucontext_t *uc = (ucontext_t*)context; -- intptr_t *sp = (intptr_t *)os::Bsd::ucontext_get_sp(uc); -- -- st->print_cr("Register to memory mapping:"); -- st->cr(); -- -- // this is only for the "general purpose" registers -- st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON__G1]); -- st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON__G2]); -- st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON__G3]); -- st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON__G4]); -- st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON__G5]); -- st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON__G6]); -- st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON__G7]); -- st->cr(); -- -- st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON__O0]); -- st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON__O1]); -- st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON__O2]); -- st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON__O3]); -- st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON__O4]); -- st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON__O5]); -- st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON__O6]); -- st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON__O7]); -- st->cr(); -- -- st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]); -- st->print("L1="); print_location(st, sp[L1->sp_offset_in_saved_window()]); -- st->print("L2="); print_location(st, sp[L2->sp_offset_in_saved_window()]); -- st->print("L3="); print_location(st, sp[L3->sp_offset_in_saved_window()]); -- st->print("L4="); print_location(st, sp[L4->sp_offset_in_saved_window()]); -- st->print("L5="); print_location(st, sp[L5->sp_offset_in_saved_window()]); -- st->print("L6="); print_location(st, sp[L6->sp_offset_in_saved_window()]); -- st->print("L7="); print_location(st, sp[L7->sp_offset_in_saved_window()]); -- st->cr(); -- -- st->print("I0="); print_location(st, sp[I0->sp_offset_in_saved_window()]); -- st->print("I1="); print_location(st, sp[I1->sp_offset_in_saved_window()]); -- st->print("I2="); print_location(st, sp[I2->sp_offset_in_saved_window()]); -- st->print("I3="); print_location(st, sp[I3->sp_offset_in_saved_window()]); -- st->print("I4="); print_location(st, sp[I4->sp_offset_in_saved_window()]); -- st->print("I5="); print_location(st, sp[I5->sp_offset_in_saved_window()]); -- st->print("I6="); print_location(st, sp[I6->sp_offset_in_saved_window()]); -- st->print("I7="); print_location(st, sp[I7->sp_offset_in_saved_window()]); -- st->cr(); --} -- -- --address os::Bsd::ucontext_get_pc(ucontext_t* uc) { -- return (address) SIG_PC((sigcontext*)uc); --} -- --intptr_t* os::Bsd::ucontext_get_sp(ucontext_t *uc) { -- return (intptr_t*) -- ((intptr_t)SIG_REGS((sigcontext*)uc).u_regs[CON_O6] + STACK_BIAS); --} -- --// not used on Sparc --intptr_t* os::Bsd::ucontext_get_fp(ucontext_t *uc) { -- ShouldNotReachHere(); -- return NULL; --} -- --// Utility functions -- --extern "C" void Fetch32PFI(); --extern "C" void Fetch32Resume(); --extern "C" void FetchNPFI(); --extern "C" void FetchNResume(); -- --inline static bool checkPrefetch(sigcontext* uc, address pc) { -- if (pc == (address) Fetch32PFI) { -- set_cont_address(uc, address(Fetch32Resume)); -- return true; -- } -- if (pc == (address) FetchNPFI) { -- set_cont_address(uc, address(FetchNResume)); -- return true; -- } -- return false; --} -- --inline static bool checkOverflow(sigcontext* uc, -- address pc, -- address addr, -- JavaThread* thread, -- address* stub) { -- // check if fault address is within thread stack -- if (addr < thread->stack_base() && -- addr >= thread->stack_base() - thread->stack_size()) { -- // stack overflow -- if (thread->in_stack_yellow_zone(addr)) { -- thread->disable_stack_yellow_zone(); -- if (thread->thread_state() == _thread_in_Java) { -- // Throw a stack overflow exception. Guard pages will be reenabled -- // while unwinding the stack. -- *stub = -- SharedRuntime::continuation_for_implicit_exception(thread, -- pc, -- SharedRuntime::STACK_OVERFLOW); -- } else { -- // Thread was in the vm or native code. Return and try to finish. -- return true; -- } -- } else if (thread->in_stack_red_zone(addr)) { -- // Fatal red zone violation. Disable the guard pages and fall through -- // to handle_unexpected_exception way down below. -- thread->disable_stack_red_zone(); -- tty->print_raw_cr("An irrecoverable stack overflow has occurred."); -- } else { -- // Accessing stack address below sp may cause SEGV if current -- // thread has MAP_GROWSDOWN stack. This should only happen when -- // current thread was created by user code with MAP_GROWSDOWN flag -- // and then attached to VM. See notes in os_bsd.cpp. -- if (thread->osthread()->expanding_stack() == 0) { -- thread->osthread()->set_expanding_stack(); -- if (os::Bsd::manually_expand_stack(thread, addr)) { -- thread->osthread()->clear_expanding_stack(); -- return true; -- } -- thread->osthread()->clear_expanding_stack(); -- } else { -- fatal("recursive segv. expanding stack."); -- } -- } -- } -- return false; --} -- --inline static bool checkPollingPage(address pc, address fault, address* stub) { -- if (fault == os::get_polling_page()) { -- *stub = SharedRuntime::get_poll_stub(pc); -- return true; -- } -- return false; --} -- --inline static bool checkByteBuffer(address pc, address* stub) { -- // BugId 4454115: A read from a MappedByteBuffer can fault -- // here if the underlying file has been truncated. -- // Do not crash the VM in such a case. -- CodeBlob* cb = CodeCache::find_blob_unsafe(pc); -- nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL; -- if (nm != NULL && nm->has_unsafe_access()) { -- *stub = StubRoutines::handler_for_unsafe_access(); -- return true; -- } -- return false; --} -- --inline static bool checkVerifyOops(address pc, address fault, address* stub) { -- if (pc >= MacroAssembler::_verify_oop_implicit_branch[0] -- && pc < MacroAssembler::_verify_oop_implicit_branch[1] ) { -- *stub = MacroAssembler::_verify_oop_implicit_branch[2]; -- warning("fixed up memory fault in +VerifyOops at address " -- INTPTR_FORMAT, fault); -- return true; -- } -- return false; --} -- --inline static bool checkFPFault(address pc, int code, -- JavaThread* thread, address* stub) { -- if (code == FPE_INTDIV || code == FPE_FLTDIV) { -- *stub = -- SharedRuntime:: -- continuation_for_implicit_exception(thread, -- pc, -- SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO); -- return true; -- } -- return false; --} -- --inline static bool checkNullPointer(address pc, intptr_t fault, -- JavaThread* thread, address* stub) { -- if (!MacroAssembler::needs_explicit_null_check(fault)) { -- // Determination of interpreter/vtable stub/compiled code null -- // exception -- *stub = -- SharedRuntime:: -- continuation_for_implicit_exception(thread, pc, -- SharedRuntime::IMPLICIT_NULL); -- return true; -- } -- return false; --} -- --inline static bool checkFastJNIAccess(address pc, address* stub) { -- address addr = JNI_FastGetField::find_slowcase_pc(pc); -- if (addr != (address)-1) { -- *stub = addr; -- return true; -- } -- return false; --} -- --inline static bool checkSerializePage(JavaThread* thread, address addr) { -- return os::is_memory_serialize_page(thread, addr); --} -- --inline static bool checkZombie(sigcontext* uc, address* pc, address* stub) { -- if (nativeInstruction_at(*pc)->is_zombie()) { -- // zombie method (ld [%g0],%o7 instruction) -- *stub = SharedRuntime::get_handle_wrong_method_stub(); -- -- // At the stub it needs to look like a call from the caller of this -- // method (not a call from the segv site). -- *pc = (address)SIG_REGS(uc).u_regs[CON_O7]; -- return true; -- } -- return false; --} -- --inline static bool checkICMiss(sigcontext* uc, address* pc, address* stub) { --#ifdef COMPILER2 -- if (nativeInstruction_at(*pc)->is_ic_miss_trap()) { --#ifdef ASSERT --#ifdef TIERED -- CodeBlob* cb = CodeCache::find_blob_unsafe(pc); -- assert(cb->is_compiled_by_c2(), "Wrong compiler"); --#endif // TIERED --#endif // ASSERT -- // Inline cache missed and user trap "Tne G0+ST_RESERVED_FOR_USER_0+2" taken. -- *stub = SharedRuntime::get_ic_miss_stub(); -- // At the stub it needs to look like a call from the caller of this -- // method (not a call from the segv site). -- *pc = (address)SIG_REGS(uc).u_regs[CON_O7]; -- return true; -- } --#endif // COMPILER2 -- return false; --} -- --extern "C" JNIEXPORT int --JVM_handle_bsd_signal(int sig, -- siginfo_t* info, -- void* ucVoid, -- int abort_if_unrecognized) { -- // in fact this isn't ucontext_t* at all, but struct sigcontext* -- // but Bsd porting layer uses ucontext_t, so to minimize code change -- // we cast as needed -- ucontext_t* ucFake = (ucontext_t*) ucVoid; -- sigcontext* uc = (sigcontext*)ucVoid; -- -- Thread* t = ThreadLocalStorage::get_thread_slow(); -- -- SignalHandlerMark shm(t); -- -- // Note: it's not uncommon that JNI code uses signal/sigset to install -- // then restore certain signal handler (e.g. to temporarily block SIGPIPE, -- // or have a SIGILL handler when detecting CPU type). When that happens, -- // JVM_handle_bsd_signal() might be invoked with junk info/ucVoid. To -- // avoid unnecessary crash when libjsig is not preloaded, try handle signals -- // that do not require siginfo/ucontext first. -- -- if (sig == SIGPIPE || sig == SIGXFSZ) { -- // allow chained handler to go first -- if (os::Bsd::chained_handler(sig, info, ucVoid)) { -- return true; -- } else { -- if (PrintMiscellaneous && (WizardMode || Verbose)) { -- char buf[64]; -- warning("Ignoring %s - see bugs 4229104 or 646499219", -- os::exception_name(sig, buf, sizeof(buf))); -- } -- return true; -- } -- } -- -- JavaThread* thread = NULL; -- VMThread* vmthread = NULL; -- if (os::Bsd::signal_handlers_are_installed) { -- if (t != NULL ){ -- if(t->is_Java_thread()) { -- thread = (JavaThread*)t; -- } -- else if(t->is_VM_thread()){ -- vmthread = (VMThread *)t; -- } -- } -- } -- -- // decide if this trap can be handled by a stub -- address stub = NULL; -- address pc = NULL; -- address npc = NULL; -- -- //%note os_trap_1 -- if (info != NULL && uc != NULL && thread != NULL) { -- pc = address(SIG_PC(uc)); -- npc = address(SIG_NPC(uc)); -- -- // Check to see if we caught the safepoint code in the -- // process of write protecting the memory serialization page. -- // It write enables the page immediately after protecting it -- // so we can just return to retry the write. -- if ((sig == SIGSEGV) && checkSerializePage(thread, (address)info->si_addr)) { -- // Block current thread until the memory serialize page permission restored. -- os::block_on_serialize_page_trap(); -- return 1; -- } -- -- if (checkPrefetch(uc, pc)) { -- return 1; -- } -- -- // Handle ALL stack overflow variations here -- if (sig == SIGSEGV) { -- if (checkOverflow(uc, pc, (address)info->si_addr, thread, &stub)) { -- return 1; -- } -- } -- -- if (sig == SIGBUS && -- thread->thread_state() == _thread_in_vm && -- thread->doing_unsafe_access()) { -- stub = StubRoutines::handler_for_unsafe_access(); -- } -- -- if (thread->thread_state() == _thread_in_Java) { -- do { -- // Java thread running in Java code => find exception handler if any -- // a fault inside compiled code, the interpreter, or a stub -- -- if ((sig == SIGSEGV) && checkPollingPage(pc, (address)info->si_addr, &stub)) { -- break; -- } -- -- if ((sig == SIGBUS) && checkByteBuffer(pc, &stub)) { -- break; -- } -- -- if ((sig == SIGSEGV || sig == SIGBUS) && -- checkVerifyOops(pc, (address)info->si_addr, &stub)) { -- break; -- } -- -- if ((sig == SIGSEGV) && checkZombie(uc, &pc, &stub)) { -- break; -- } -- -- if ((sig == SIGILL) && checkICMiss(uc, &pc, &stub)) { -- break; -- } -- -- if ((sig == SIGFPE) && checkFPFault(pc, info->si_code, thread, &stub)) { -- break; -- } -- -- if ((sig == SIGSEGV) && -- checkNullPointer(pc, (intptr_t)info->si_addr, thread, &stub)) { -- break; -- } -- } while (0); -- -- // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in -- // and the heap gets shrunk before the field access. -- if ((sig == SIGSEGV) || (sig == SIGBUS)) { -- checkFastJNIAccess(pc, &stub); -- } -- } -- -- if (stub != NULL) { -- // save all thread context in case we need to restore it -- thread->set_saved_exception_pc(pc); -- thread->set_saved_exception_npc(npc); -- set_cont_address(uc, stub); -- return true; -- } -- } -- -- // signal-chaining -- if (os::Bsd::chained_handler(sig, info, ucVoid)) { -- return true; -- } -- -- if (!abort_if_unrecognized) { -- // caller wants another chance, so give it to him -- return false; -- } -- -- if (pc == NULL && uc != NULL) { -- pc = os::Bsd::ucontext_get_pc((ucontext_t*)uc); -- } -- -- // unmask current signal -- sigset_t newset; -- sigemptyset(&newset); -- sigaddset(&newset, sig); -- sigprocmask(SIG_UNBLOCK, &newset, NULL); -- -- VMError err(t, sig, pc, info, ucVoid); -- err.report_and_die(); -- -- ShouldNotReachHere(); --} -- --void os::Bsd::init_thread_fpu_state(void) { -- // Nothing to do --} -- --int os::Bsd::get_fpu_control_word() { -- return 0; --} -- --void os::Bsd::set_fpu_control_word(int fpu) { -- // nothing --} -- --bool os::is_allocatable(size_t bytes) { --#ifdef _LP64 -- return true; --#else -- if (bytes < 2 * G) { -- return true; -- } -- -- char* addr = reserve_memory(bytes, NULL); -- -- if (addr != NULL) { -- release_memory(addr, bytes); -- } -- -- return addr != NULL; --#endif // _LP64 --} -- --/////////////////////////////////////////////////////////////////////////////// --// thread stack -- --size_t os::Bsd::min_stack_allowed = 128 * K; -- --// pthread on Ubuntu is always in floating stack mode --bool os::Bsd::supports_variable_stack_size() { return true; } -- --// return default stack size for thr_type --size_t os::Bsd::default_stack_size(os::ThreadType thr_type) { -- // default stack size (compiler thread needs larger stack) -- size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M); -- return s; --} -- --size_t os::Bsd::default_guard_size(os::ThreadType thr_type) { -- // Creating guard page is very expensive. Java thread has HotSpot -- // guard page, only enable glibc guard page for non-Java threads. -- return (thr_type == java_thread ? 0 : page_size()); --} ---- ./hotspot/src/os_cpu/bsd_sparc/vm/os_bsd_sparc.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/os_bsd_sparc.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,49 +0,0 @@ --/* -- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_OS_BSD_SPARC_HPP --#define OS_CPU_BSD_SPARC_VM_OS_BSD_SPARC_HPP -- -- // -- // NOTE: we are back in class os here, not Bsd -- // -- static jint (*atomic_xchg_func) (jint, volatile jint*); -- static jint (*atomic_cmpxchg_func) (jint, volatile jint*, jint); -- static jlong (*atomic_cmpxchg_long_func)(jlong, volatile jlong*, jlong); -- static jint (*atomic_add_func) (jint, volatile jint*); -- -- static jint atomic_xchg_bootstrap (jint, volatile jint*); -- static jint atomic_cmpxchg_bootstrap (jint, volatile jint*, jint); -- static jlong atomic_cmpxchg_long_bootstrap(jlong, volatile jlong*, jlong); -- static jint atomic_add_bootstrap (jint, volatile jint*); -- -- static void setup_fpu() {} -- -- static bool is_allocatable(size_t bytes); -- -- // Used to register dynamic code cache area with the OS -- // Note: Currently only used in 64 bit Windows implementations -- static bool register_code_area(char *low, char *high) { return true; } -- --#endif // OS_CPU_BSD_SPARC_VM_OS_BSD_SPARC_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/prefetch_bsd_sparc.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/prefetch_bsd_sparc.inline.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,47 +0,0 @@ --/* -- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_PREFETCH_BSD_SPARC_INLINE_HPP --#define OS_CPU_BSD_SPARC_VM_PREFETCH_BSD_SPARC_INLINE_HPP -- --#include "runtime/prefetch.hpp" -- --#if defined(COMPILER2) || defined(_LP64) -- --inline void Prefetch::read(void *loc, intx interval) { -- __asm__ volatile("prefetch [%0+%1], 0" : : "r" (loc), "r" (interval) : "memory" ); --} -- --inline void Prefetch::write(void *loc, intx interval) { -- __asm__ volatile("prefetch [%0+%1], 2" : : "r" (loc), "r" (interval) : "memory" ); --} -- --#else -- --inline void Prefetch::read (void *loc, intx interval) {} --inline void Prefetch::write(void *loc, intx interval) {} -- --#endif -- --#endif // OS_CPU_BSD_SPARC_VM_PREFETCH_BSD_SPARC_INLINE_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/threadLS_bsd_sparc.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/threadLS_bsd_sparc.cpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,38 +0,0 @@ --/* -- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#include "precompiled.hpp" --#include "runtime/threadLocalStorage.hpp" --#include "thread_bsd.inline.hpp" -- --void ThreadLocalStorage::generate_code_for_get_thread() { --} -- --void ThreadLocalStorage::pd_init() { -- // Nothing to do --} -- --void ThreadLocalStorage::pd_set_thread(Thread* thread) { -- os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); --} ---- ./hotspot/src/os_cpu/bsd_sparc/vm/threadLS_bsd_sparc.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/threadLS_bsd_sparc.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,33 +0,0 @@ --/* -- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_THREADLS_BSD_SPARC_HPP --#define OS_CPU_BSD_SPARC_VM_THREADLS_BSD_SPARC_HPP -- --public: -- static Thread* thread() { -- return (Thread*) os::thread_local_storage_at(thread_index()); -- } -- --#endif // OS_CPU_BSD_SPARC_VM_THREADLS_BSD_SPARC_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/thread_bsd_sparc.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/thread_bsd_sparc.cpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,111 +0,0 @@ --/* -- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#include "precompiled.hpp" --#include "runtime/frame.inline.hpp" --#include "thread_bsd.inline.hpp" -- --// For Forte Analyzer AsyncGetCallTrace profiling support - thread is --// currently interrupted by SIGPROF --bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, -- void* ucontext, -- bool isInJava) { -- assert(Thread::current() == this, "caller must be current thread"); -- assert(this->is_Java_thread(), "must be JavaThread"); -- -- JavaThread* jt = (JavaThread *)this; -- -- if (!isInJava) { -- // make_walkable flushes register windows and grabs last_Java_pc -- // which can not be done if the ucontext sp matches last_Java_sp -- // stack walking utilities assume last_Java_pc set if marked flushed -- jt->frame_anchor()->make_walkable(jt); -- } -- -- // If we have a walkable last_Java_frame, then we should use it -- // even if isInJava == true. It should be more reliable than -- // ucontext info. -- if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { -- *fr_addr = jt->pd_last_frame(); -- return true; -- } -- -- ucontext_t* uc = (ucontext_t*) ucontext; -- -- // At this point, we don't have a walkable last_Java_frame, so -- // we try to glean some information out of the ucontext. -- intptr_t* ret_sp; -- ExtendedPC addr = -- os::fetch_frame_from_context(uc, &ret_sp, -- NULL /* ret_fp only used on X86 */); -- if (addr.pc() == NULL || ret_sp == NULL) { -- // ucontext wasn't useful -- return false; -- } -- -- // we were running Java code when SIGPROF came in -- if (isInJava) { -- // If we have a last_Java_sp, then the SIGPROF signal caught us -- // right when we were transitioning from _thread_in_Java to a new -- // JavaThreadState. We use last_Java_sp instead of the sp from -- // the ucontext since it should be more reliable. -- if (jt->has_last_Java_frame()) { -- ret_sp = jt->last_Java_sp(); -- } -- // Implied else: we don't have a last_Java_sp so we use what we -- // got from the ucontext. -- -- frame ret_frame(ret_sp, frame::unpatchable, addr.pc()); -- if (!ret_frame.safe_for_sender(jt)) { -- // nothing else to try if the frame isn't good -- return false; -- } -- *fr_addr = ret_frame; -- return true; -- } -- -- // At this point, we know we weren't running Java code. We might -- // have a last_Java_sp, but we don't have a walkable frame. -- // However, we might still be able to construct something useful -- // if the thread was running native code. -- if (jt->has_last_Java_frame()) { -- assert(!jt->frame_anchor()->walkable(), "case covered above"); -- -- if (jt->thread_state() == _thread_in_native) { -- frame ret_frame(jt->last_Java_sp(), frame::unpatchable, addr.pc()); -- if (!ret_frame.safe_for_sender(jt)) { -- // nothing else to try if the frame isn't good -- return false; -- } -- *fr_addr = ret_frame; -- return true; -- } -- } -- -- // nothing else to try -- return false; --} -- --void JavaThread::cache_global_variables() { } -- ---- ./hotspot/src/os_cpu/bsd_sparc/vm/thread_bsd_sparc.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/thread_bsd_sparc.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,103 +0,0 @@ --/* -- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_THREAD_BSD_SPARC_HPP --#define OS_CPU_BSD_SPARC_VM_THREAD_BSD_SPARC_HPP -- --private: -- -- void pd_initialize() { -- _anchor.clear(); -- _base_of_stack_pointer = NULL; -- } -- -- frame pd_last_frame() { -- assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); -- assert(_anchor.walkable(), "thread has not dumped its register windows yet"); -- -- assert(_anchor.last_Java_pc() != NULL, "Ack no pc!"); -- return frame(last_Java_sp(), frame::unpatchable, _anchor.last_Java_pc()); -- } -- -- // Sometimes the trap handler needs to record both PC and NPC. -- // This is a SPARC-specific companion to Thread::set_saved_exception_pc. -- address _saved_exception_npc; -- -- // In polling_page_safepoint_handler_blob(s) we have to tail call other -- // blobs without blowing any registers. A tail call requires some -- // register to jump with and we can't blow any registers, so it must -- // be restored in the delay slot. 'restore' cannot be used as it -- // will chop the heads off of 64-bit %o registers in the 32-bit -- // build. Instead we reload the registers using G2_thread and this -- // location. Must be 64bits in the 32-bit LION build. -- jdouble _o_reg_temps[6]; -- -- // a stack pointer older than any java frame stack pointer. It is -- // used to validate stack pointers in frame::next_younger_sp (it -- // provides the upper bound in the range check). This is necessary -- // on Solaris/SPARC since the ucontext passed to a signal handler is -- // sometimes corrupt and we need a way to check the extracted sp. -- intptr_t* _base_of_stack_pointer; -- --public: -- -- static int o_reg_temps_offset_in_bytes() { return offset_of(JavaThread, _o_reg_temps); } -- --#ifndef _LP64 -- address o_reg_temps(int i) { return (address)&_o_reg_temps[i]; } --#endif -- -- static int saved_exception_npc_offset_in_bytes() { return offset_of(JavaThread,_saved_exception_npc); } -- -- address saved_exception_npc() { return _saved_exception_npc; } -- void set_saved_exception_npc(address a) { _saved_exception_npc = a; } -- -- --public: -- -- intptr_t* base_of_stack_pointer() { return _base_of_stack_pointer; } -- -- void set_base_of_stack_pointer(intptr_t* base_sp) { -- _base_of_stack_pointer = base_sp; -- } -- -- void record_base_of_stack_pointer() { -- intptr_t *sp = (intptr_t *)(((intptr_t)StubRoutines::Sparc::flush_callers_register_windows_func()())); -- intptr_t *ysp; -- while((ysp = (intptr_t*)sp[FP->sp_offset_in_saved_window()]) != NULL) { -- sp = (intptr_t *)((intptr_t)ysp + STACK_BIAS); -- } -- _base_of_stack_pointer = sp; -- } -- -- bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, -- bool isInJava); -- -- // These routines are only used on cpu architectures that -- // have separate register stacks (Itanium). -- static bool register_stack_overflow() { return false; } -- static void enable_register_stack_guard() {} -- static void disable_register_stack_guard() {} -- --#endif // OS_CPU_BSD_SPARC_VM_THREAD_BSD_SPARC_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/vmStructs_bsd_sparc.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/vmStructs_bsd_sparc.hpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,74 +0,0 @@ --/* -- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#ifndef OS_CPU_BSD_SPARC_VM_VMSTRUCTS_BSD_SPARC_HPP --#define OS_CPU_BSD_SPARC_VM_VMSTRUCTS_BSD_SPARC_HPP -- --// These are the OS and CPU-specific fields, types and integer --// constants required by the Serviceability Agent. This file is --// referenced by vmStructs.cpp. -- --#define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \ -- \ -- /******************************/ \ -- /* Threads (NOTE: incomplete) */ \ -- /******************************/ \ -- \ -- nonstatic_field(JavaThread, _base_of_stack_pointer, intptr_t*) \ -- nonstatic_field(OSThread, _thread_id, pid_t) \ -- nonstatic_field(OSThread, _pthread_id, pthread_t) \ -- /* This must be the last entry, and must be present */ \ -- last_entry() -- -- --#define VM_TYPES_OS_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type, last_entry) \ -- \ -- /**********************/ \ -- /* POSIX Thread IDs */ \ -- /**********************/ \ -- \ -- declare_integer_type(pid_t) \ -- declare_unsigned_integer_type(pthread_t) \ -- \ -- /* This must be the last entry, and must be present */ \ -- last_entry() -- -- --#define VM_INT_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \ -- \ -- /************************/ \ -- /* JavaThread constants */ \ -- /************************/ \ -- \ -- declare_constant(JavaFrameAnchor::flushed) \ -- \ -- /* This must be the last entry, and must be present */ \ -- last_entry() -- --#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \ -- \ -- /* This must be the last entry, and must be present */ \ -- last_entry() -- --#endif // OS_CPU_BSD_SPARC_VM_VMSTRUCTS_BSD_SPARC_HPP ---- ./hotspot/src/os_cpu/bsd_sparc/vm/vm_version_bsd_sparc.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_sparc/vm/vm_version_bsd_sparc.cpp 1969-12-31 16:00:00.000000000 -0800 -@@ -1,62 +0,0 @@ --/* -- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- * -- */ -- --#include "precompiled.hpp" --#include "runtime/os.hpp" --#include "vm_version_sparc.hpp" -- --static bool detect_niagara() { -- char cpu[128]; -- bool rv = false; -- -- FILE* fp = fopen("/proc/cpuinfo", "r"); -- if (fp == NULL) { -- return rv; -- } -- -- while (!feof(fp)) { -- if (fscanf(fp, "cpu\t\t: %100[^\n]", &cpu) == 1) { -- if (strstr(cpu, "Niagara") != NULL) { -- rv = true; -- } -- break; -- } -- } -- -- fclose(fp); -- -- return rv; --} -- --int VM_Version::platform_features(int features) { -- // Default to generic v9 -- features = generic_v9_m; -- -- if (detect_niagara()) { -- NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Detected Bsd on Niagara");) -- features = niagara1_m; -- } -- -- return features; --} ---- ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s 2011-04-22 22:28:34.000000000 -0700 -@@ -21,6 +21,17 @@ - # questions. - # - -+ -+#ifdef __APPLE__ -+# Darwin uses _ prefixed global symbols -+#define SYMBOL(s) _ ## s -+#define ELF_TYPE(name, description) -+#else -+#define SYMBOL(s) s -+#define ELF_TYPE(name, description) .type name,description -+#endif -+ -+ .globl SYMBOL(fixcw) - - # NOTE WELL! The _Copy functions are called directly - # from server-compiler-generated code via CallLeafNoFP, -@@ -28,42 +39,62 @@ - # point or use it in the same manner as does the server - # compiler. - -- .globl _Copy_conjoint_bytes -- .globl _Copy_arrayof_conjoint_bytes -- .globl _Copy_conjoint_jshorts_atomic -- .globl _Copy_arrayof_conjoint_jshorts -- .globl _Copy_conjoint_jints_atomic -- .globl _Copy_arrayof_conjoint_jints -- .globl _Copy_conjoint_jlongs_atomic -- .globl _mmx_Copy_arrayof_conjoint_jshorts -+ .globl SYMBOL(_Copy_conjoint_bytes) -+ .globl SYMBOL(_Copy_arrayof_conjoint_bytes) -+ .globl SYMBOL(_Copy_conjoint_jshorts_atomic) -+ .globl SYMBOL(_Copy_arrayof_conjoint_jshorts) -+ .globl SYMBOL(_Copy_conjoint_jints_atomic) -+ .globl SYMBOL(_Copy_arrayof_conjoint_jints) -+ .globl SYMBOL(_Copy_conjoint_jlongs_atomic) -+ .globl SYMBOL(_mmx_Copy_arrayof_conjoint_jshorts) - -- .globl _Atomic_cmpxchg_long -- .globl _Atomic_move_long -+ .globl SYMBOL(_Atomic_cmpxchg_long) -+ .globl SYMBOL(_Atomic_move_long) - - .text - -- .globl SafeFetch32, Fetch32PFI, Fetch32Resume -- .globl SafeFetchN -+# Support for void os::Solaris::init_thread_fpu_state() in os_solaris_i486.cpp -+# Set fpu to 53 bit precision. This happens too early to use a stub. -+# ported from solaris_x86_32.s -+#ifdef __APPLE__ -+ .align 4 -+#else -+ .align 16 -+#endif -+SYMBOL(fixcw): -+ pushl $0x27f -+ fldcw 0(%esp) -+ popl %eax -+ ret -+ -+#ifdef __APPLE__ -+ .align 4 -+#else -+ .align 16 -+#endif -+ -+ .globl SYMBOL(SafeFetch32), SYMBOL(Fetch32PFI), SYMBOL(Fetch32Resume) -+ .globl SYMBOL(SafeFetchN) - ## TODO: avoid exposing Fetch32PFI and Fetch32Resume. - ## Instead, the signal handler would call a new SafeFetchTriage(FaultingEIP) - ## routine to vet the address. If the address is the faulting LD then - ## SafeFetchTriage() would return the resume-at EIP, otherwise null. -- .type SafeFetch32,@function -+ ELF_TYPE(SafeFetch32,@function) - .p2align 4,,15 --SafeFetch32: --SafeFetchN: -+SYMBOL(SafeFetch32): -+SYMBOL(SafeFetchN): - movl 0x8(%esp), %eax - movl 0x4(%esp), %ecx --Fetch32PFI: -+SYMBOL(Fetch32PFI): - movl (%ecx), %eax --Fetch32Resume: -+SYMBOL(Fetch32Resume): - ret - - -- .globl SpinPause -- .type SpinPause,@function -+ .globl SYMBOL(SpinPause) -+ ELF_TYPE(SpinPause,@function) - .p2align 4,,15 --SpinPause: -+SYMBOL(SpinPause): - rep - nop - movl $1, %eax -@@ -73,8 +104,8 @@ - # void* to, - # size_t count) - .p2align 4,,15 -- .type _Copy_conjoint_bytes,@function --_Copy_conjoint_bytes: -+ ELF_TYPE(_Copy_conjoint_bytes,@function) -+SYMBOL(_Copy_conjoint_bytes): - pushl %esi - movl 4+12(%esp),%ecx # count - pushl %edi -@@ -181,8 +212,8 @@ - # - # Same as _Copy_conjoint_bytes, except no source alignment check. - .p2align 4,,15 -- .type _Copy_arrayof_conjoint_bytes,@function --_Copy_arrayof_conjoint_bytes: -+ ELF_TYPE(_Copy_arrayof_conjoint_bytes,@function) -+SYMBOL(_Copy_arrayof_conjoint_bytes): - pushl %esi - movl 4+12(%esp),%ecx # count - pushl %edi -@@ -269,8 +300,8 @@ - # void* to, - # size_t count) - .p2align 4,,15 -- .type _Copy_conjoint_jshorts_atomic,@function --_Copy_conjoint_jshorts_atomic: -+ ELF_TYPE(_Copy_conjoint_jshorts_atomic,@function) -+SYMBOL(_Copy_conjoint_jshorts_atomic): - pushl %esi - movl 4+12(%esp),%ecx # count - pushl %edi -@@ -356,8 +387,8 @@ - # void* to, - # size_t count) - .p2align 4,,15 -- .type _Copy_arrayof_conjoint_jshorts,@function --_Copy_arrayof_conjoint_jshorts: -+ ELF_TYPE(_Copy_arrayof_conjoint_jshorts,@function) -+SYMBOL(_Copy_arrayof_conjoint_jshorts): - pushl %esi - movl 4+12(%esp),%ecx # count - pushl %edi -@@ -433,10 +464,10 @@ - # Equivalent to - # arrayof_conjoint_jints - .p2align 4,,15 -- .type _Copy_conjoint_jints_atomic,@function -- .type _Copy_arrayof_conjoint_jints,@function --_Copy_conjoint_jints_atomic: --_Copy_arrayof_conjoint_jints: -+ ELF_TYPE(_Copy_conjoint_jints_atomic,@function) -+ ELF_TYPE(_Copy_arrayof_conjoint_jints,@function) -+SYMBOL(_Copy_conjoint_jints_atomic): -+SYMBOL(_Copy_arrayof_conjoint_jints): - pushl %esi - movl 4+12(%esp),%ecx # count - pushl %edi -@@ -498,7 +529,7 @@ - # - # count treated as signed - # -- # if (from > to) { -+ # // if (from > to) { - # while (--count >= 0) { - # *to++ = *from++; - # } -@@ -508,8 +539,8 @@ - # } - # } - .p2align 4,,15 -- .type _Copy_conjoint_jlongs_atomic,@function --_Copy_conjoint_jlongs_atomic: -+ ELF_TYPE(_Copy_conjoint_jlongs_atomic,@function) -+SYMBOL(_Copy_conjoint_jlongs_atomic): - movl 4+8(%esp),%ecx # count - movl 4+0(%esp),%eax # from - movl 4+4(%esp),%edx # to -@@ -537,8 +568,8 @@ - # void* to, - # size_t count) - .p2align 4,,15 -- .type _mmx_Copy_arrayof_conjoint_jshorts,@function --_mmx_Copy_arrayof_conjoint_jshorts: -+ ELF_TYPE(_mmx_Copy_arrayof_conjoint_jshorts,@function) -+SYMBOL(_mmx_Copy_arrayof_conjoint_jshorts): - pushl %esi - movl 4+12(%esp),%ecx - pushl %edi -@@ -636,8 +667,8 @@ - # bool is_MP) - # - .p2align 4,,15 -- .type _Atomic_cmpxchg_long,@function --_Atomic_cmpxchg_long: -+ ELF_TYPE(_Atomic_cmpxchg_long,@function) -+SYMBOL(_Atomic_cmpxchg_long): - # 8(%esp) : return PC - pushl %ebx # 4(%esp) : old %ebx - pushl %edi # 0(%esp) : old %edi ---- ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s 2011-04-22 22:28:34.000000000 -0700 -@@ -21,6 +21,14 @@ - # questions. - # - -+#ifdef __APPLE__ -+# Darwin uses _ prefixed global symbols -+#define SYMBOL(s) _ ## s -+#define ELF_TYPE(name, description) -+#else -+#define SYMBOL(s) s -+#define ELF_TYPE(name, description) .type name,description -+#endif - - # NOTE WELL! The _Copy functions are called directly - # from server-compiler-generated code via CallLeafNoFP, -@@ -28,42 +36,54 @@ - # point or use it in the same manner as does the server - # compiler. - -- .globl _Copy_arrayof_conjoint_bytes -- .globl _Copy_arrayof_conjoint_jshorts -- .globl _Copy_conjoint_jshorts_atomic -- .globl _Copy_arrayof_conjoint_jints -- .globl _Copy_conjoint_jints_atomic -- .globl _Copy_arrayof_conjoint_jlongs -- .globl _Copy_conjoint_jlongs_atomic -+ .globl SYMBOL(_Copy_arrayof_conjoint_bytes) -+ .globl SYMBOL(_Copy_arrayof_conjoint_jshorts) -+ .globl SYMBOL(_Copy_conjoint_jshorts_atomic) -+ .globl SYMBOL(_Copy_arrayof_conjoint_jints) -+ .globl SYMBOL(_Copy_conjoint_jints_atomic) -+ .globl SYMBOL(_Copy_arrayof_conjoint_jlongs) -+ .globl SYMBOL(_Copy_conjoint_jlongs_atomic) - - .text - -- .globl SafeFetch32, Fetch32PFI, Fetch32Resume -+ .globl SYMBOL(SafeFetch32), SYMBOL(Fetch32PFI), SYMBOL(Fetch32Resume) -+#ifdef __APPLE__ -+ .align 4 -+#else - .align 16 -- .type SafeFetch32,@function -+#endif -+ ELF_TYPE(SafeFetch32,@function) - // Prototype: int SafeFetch32 (int * Adr, int ErrValue) --SafeFetch32: -+SYMBOL(SafeFetch32): - movl %esi, %eax --Fetch32PFI: -+SYMBOL(Fetch32PFI): - movl (%rdi), %eax --Fetch32Resume: -+SYMBOL(Fetch32Resume): - ret - -- .globl SafeFetchN, FetchNPFI, FetchNResume -+ .globl SYMBOL(SafeFetchN), SYMBOL(FetchNPFI), SYMBOL(FetchNResume) -+#ifdef __APPLE__ -+ .align 4 -+#else - .align 16 -- .type SafeFetchN,@function -+#endif -+ ELF_TYPE(SafeFetchN,@function) - // Prototype: intptr_t SafeFetchN (intptr_t * Adr, intptr_t ErrValue) --SafeFetchN: -+SYMBOL(SafeFetchN): - movq %rsi, %rax --FetchNPFI: -+SYMBOL(FetchNPFI): - movq (%rdi), %rax --FetchNResume: -+SYMBOL(FetchNResume): - ret - -- .globl SpinPause -- .align 16 -- .type SpinPause,@function --SpinPause: -+ .globl SYMBOL(SpinPause) -+#ifdef __APPLE__ -+ .align 4 -+#else -+ .align 16 -+#endif -+ ELF_TYPE(SpinPause,@function) -+SYMBOL(SpinPause): - rep - nop - movq $1, %rax -@@ -77,8 +97,8 @@ - # rdx - count, treated as ssize_t - # - .p2align 4,,15 -- .type _Copy_arrayof_conjoint_bytes,@function --_Copy_arrayof_conjoint_bytes: -+ ELF_TYPE(_Copy_arrayof_conjoint_bytes,@function) -+SYMBOL(_Copy_arrayof_conjoint_bytes): - movq %rdx,%r8 # byte count - shrq $3,%rdx # qword count - cmpq %rdi,%rsi -@@ -179,10 +199,10 @@ - # rdx - count, treated as ssize_t - # - .p2align 4,,15 -- .type _Copy_arrayof_conjoint_jshorts,@function -- .type _Copy_conjoint_jshorts_atomic,@function --_Copy_arrayof_conjoint_jshorts: --_Copy_conjoint_jshorts_atomic: -+ ELF_TYPE(_Copy_arrayof_conjoint_jshorts,@function) -+ ELF_TYPE(_Copy_conjoint_jshorts_atomic,@function) -+SYMBOL(_Copy_arrayof_conjoint_jshorts): -+SYMBOL(_Copy_conjoint_jshorts_atomic): - movq %rdx,%r8 # word count - shrq $2,%rdx # qword count - cmpq %rdi,%rsi -@@ -269,10 +289,10 @@ - # rdx - count, treated as ssize_t - # - .p2align 4,,15 -- .type _Copy_arrayof_conjoint_jints,@function -- .type _Copy_conjoint_jints_atomic,@function --_Copy_arrayof_conjoint_jints: --_Copy_conjoint_jints_atomic: -+ ELF_TYPE(_Copy_arrayof_conjoint_jints,@function) -+ ELF_TYPE(_Copy_conjoint_jints_atomic,@function) -+SYMBOL(_Copy_arrayof_conjoint_jints): -+SYMBOL(_Copy_conjoint_jints_atomic): - movq %rdx,%r8 # dword count - shrq %rdx # qword count - cmpq %rdi,%rsi -@@ -348,10 +368,10 @@ - # rdx - count, treated as ssize_t - # - .p2align 4,,15 -- .type _Copy_arrayof_conjoint_jlongs,@function -- .type _Copy_conjoint_jlongs_atomic,@function --_Copy_arrayof_conjoint_jlongs: --_Copy_conjoint_jlongs_atomic: -+ ELF_TYPE(_Copy_arrayof_conjoint_jlongs,@function) -+ ELF_TYPE(_Copy_conjoint_jlongs_atomic,@function) -+SYMBOL(_Copy_arrayof_conjoint_jlongs): -+SYMBOL(_Copy_conjoint_jlongs_atomic): - cmpq %rdi,%rsi - leaq -8(%rdi,%rdx,8),%rax # from + count*8 - 8 - jbe acl_CopyRight ---- ./hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -25,7 +25,33 @@ - #ifndef OS_CPU_BSD_X86_VM_BYTES_BSD_X86_INLINE_HPP - #define OS_CPU_BSD_X86_VM_BYTES_BSD_X86_INLINE_HPP - -+#ifndef _ALLBSD_SOURCE - #include <byteswap.h> -+#endif -+ -+#ifdef __APPLE__ -+#include <libkern/OSByteOrder.h> -+#endif -+ -+#if defined(AMD64) -+# if defined(__APPLE__) -+# define bswap_16(x) OSSwapInt16(x) -+# define bswap_32(x) OSSwapInt32(x) -+# define bswap_64(x) OSSwapInt64(x) -+# elif defined(__OpenBSD__) -+# define bswap_16(x) swap16(x) -+# define bswap_32(x) swap32(x) -+# define bswap_64(x) swap64(x) -+# elif defined(__NetBSD__) -+# define bswap_16(x) bswap16(x) -+# define bswap_32(x) bswap32(x) -+# define bswap_64(x) bswap64(x) -+# else -+# define bswap_16(x) __bswap16(x) -+# define bswap_32(x) __bswap32(x) -+# define bswap_64(x) __bswap64(x) -+# endif -+#endif - - // Efficient swapping of data bytes from Java byte - // ordering to native byte ordering and vice versa. ---- ./hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -25,9 +25,10 @@ - #ifndef OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP - #define OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP - -+// - // Sets the default values for platform dependent flags used by the runtime system. - // (see globals.hpp) -- -+// - define_pd_global(bool, DontYieldALot, false); - #ifdef AMD64 - define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default -@@ -41,11 +42,12 @@ - #endif // AMD64 - - define_pd_global(intx, CompilerThreadStackSize, 0); -+define_pd_global(intx, SurvivorRatio, 8); - --define_pd_global(uintx,JVMInvokeMethodSlack, 8192); -+define_pd_global(uintx, JVMInvokeMethodSlack, 8192); - - // Only used on 64 bit platforms --define_pd_global(uintx,HeapBaseMinAddress, 2*G); -+define_pd_global(uintx, HeapBaseMinAddress, 2*G); - // Only used on 64 bit Windows platforms - define_pd_global(bool, UseVectoredExceptions, false); - ---- ./hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp 2011-04-22 22:28:34.000000000 -0700 -@@ -78,23 +78,202 @@ - # include <sys/wait.h> - # include <pwd.h> - # include <poll.h> -+#ifndef __OpenBSD__ - # include <ucontext.h> --# include <fpu_control.h> -+#endif -+ -+#if defined(_ALLBSD_SOURCE) && !defined(__APPLE__) && !defined(__NetBSD__) -+# include <pthread_np.h> -+#endif - - #ifdef AMD64 --#define REG_SP REG_RSP --#define REG_PC REG_RIP --#define REG_FP REG_RBP - #define SPELL_REG_SP "rsp" - #define SPELL_REG_FP "rbp" - #else --#define REG_SP REG_UESP --#define REG_PC REG_EIP --#define REG_FP REG_EBP - #define SPELL_REG_SP "esp" - #define SPELL_REG_FP "ebp" - #endif // AMD64 - -+#ifdef __FreeBSD__ -+# define context_trapno uc_mcontext.mc_trapno -+# ifdef AMD64 -+# define context_pc uc_mcontext.mc_rip -+# define context_sp uc_mcontext.mc_rsp -+# define context_fp uc_mcontext.mc_rbp -+# define context_rip uc_mcontext.mc_rip -+# define context_rsp uc_mcontext.mc_rsp -+# define context_rbp uc_mcontext.mc_rbp -+# define context_rax uc_mcontext.mc_rax -+# define context_rbx uc_mcontext.mc_rbx -+# define context_rcx uc_mcontext.mc_rcx -+# define context_rdx uc_mcontext.mc_rdx -+# define context_rsi uc_mcontext.mc_rsi -+# define context_rdi uc_mcontext.mc_rdi -+# define context_r8 uc_mcontext.mc_r8 -+# define context_r9 uc_mcontext.mc_r9 -+# define context_r10 uc_mcontext.mc_r10 -+# define context_r11 uc_mcontext.mc_r11 -+# define context_r12 uc_mcontext.mc_r12 -+# define context_r13 uc_mcontext.mc_r13 -+# define context_r14 uc_mcontext.mc_r14 -+# define context_r15 uc_mcontext.mc_r15 -+# define context_flags uc_mcontext.mc_flags -+# define context_err uc_mcontext.mc_err -+# else -+# define context_pc uc_mcontext.mc_eip -+# define context_sp uc_mcontext.mc_esp -+# define context_fp uc_mcontext.mc_ebp -+# define context_eip uc_mcontext.mc_eip -+# define context_esp uc_mcontext.mc_esp -+# define context_eax uc_mcontext.mc_eax -+# define context_ebx uc_mcontext.mc_ebx -+# define context_ecx uc_mcontext.mc_ecx -+# define context_edx uc_mcontext.mc_edx -+# define context_ebp uc_mcontext.mc_ebp -+# define context_esi uc_mcontext.mc_esi -+# define context_edi uc_mcontext.mc_edi -+# define context_eflags uc_mcontext.mc_eflags -+# define context_trapno uc_mcontext.mc_trapno -+# endif -+#endif -+ -+#ifdef __APPLE__ -+# if __DARWIN_UNIX03 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) -+ // 10.5 UNIX03 member name prefixes -+ #define DU3_PREFIX(s, m) __ ## s.__ ## m -+# else -+ #define DU3_PREFIX(s, m) s ## . ## m -+# endif -+ -+# ifdef AMD64 -+# define context_pc context_rip -+# define context_sp context_rsp -+# define context_fp context_rbp -+# define context_rip uc_mcontext->DU3_PREFIX(ss,rip) -+# define context_rsp uc_mcontext->DU3_PREFIX(ss,rsp) -+# define context_rax uc_mcontext->DU3_PREFIX(ss,rax) -+# define context_rbx uc_mcontext->DU3_PREFIX(ss,rbx) -+# define context_rcx uc_mcontext->DU3_PREFIX(ss,rcx) -+# define context_rdx uc_mcontext->DU3_PREFIX(ss,rdx) -+# define context_rbp uc_mcontext->DU3_PREFIX(ss,rbp) -+# define context_rsi uc_mcontext->DU3_PREFIX(ss,rsi) -+# define context_rdi uc_mcontext->DU3_PREFIX(ss,rdi) -+# define context_r8 uc_mcontext->DU3_PREFIX(ss,r8) -+# define context_r9 uc_mcontext->DU3_PREFIX(ss,r9) -+# define context_r10 uc_mcontext->DU3_PREFIX(ss,r10) -+# define context_r11 uc_mcontext->DU3_PREFIX(ss,r11) -+# define context_r12 uc_mcontext->DU3_PREFIX(ss,r12) -+# define context_r13 uc_mcontext->DU3_PREFIX(ss,r13) -+# define context_r14 uc_mcontext->DU3_PREFIX(ss,r14) -+# define context_r15 uc_mcontext->DU3_PREFIX(ss,r15) -+# define context_flags uc_mcontext->DU3_PREFIX(ss,rflags) -+# define context_trapno uc_mcontext->DU3_PREFIX(es,trapno) -+# define context_err uc_mcontext->DU3_PREFIX(es,err) -+# else -+# define context_pc context_eip -+# define context_sp context_esp -+# define context_fp context_ebp -+# define context_eip uc_mcontext->DU3_PREFIX(ss,eip) -+# define context_esp uc_mcontext->DU3_PREFIX(ss,esp) -+# define context_eax uc_mcontext->DU3_PREFIX(ss,eax) -+# define context_ebx uc_mcontext->DU3_PREFIX(ss,ebx) -+# define context_ecx uc_mcontext->DU3_PREFIX(ss,ecx) -+# define context_edx uc_mcontext->DU3_PREFIX(ss,edx) -+# define context_ebp uc_mcontext->DU3_PREFIX(ss,ebp) -+# define context_esi uc_mcontext->DU3_PREFIX(ss,esi) -+# define context_edi uc_mcontext->DU3_PREFIX(ss,edi) -+# define context_eflags uc_mcontext->DU3_PREFIX(ss,eflags) -+# define context_trapno uc_mcontext->DU3_PREFIX(es,trapno) -+# endif -+#endif -+ -+#ifdef __OpenBSD__ -+# define context_trapno sc_trapno -+# ifdef AMD64 -+# define context_pc sc_rip -+# define context_sp sc_rsp -+# define context_fp sc_rbp -+# define context_rip sc_rip -+# define context_rsp sc_rsp -+# define context_rbp sc_rbp -+# define context_rax sc_rax -+# define context_rbx sc_rbx -+# define context_rcx sc_rcx -+# define context_rdx sc_rdx -+# define context_rsi sc_rsi -+# define context_rdi sc_rdi -+# define context_r8 sc_r8 -+# define context_r9 sc_r9 -+# define context_r10 sc_r10 -+# define context_r11 sc_r11 -+# define context_r12 sc_r12 -+# define context_r13 sc_r13 -+# define context_r14 sc_r14 -+# define context_r15 sc_r15 -+# define context_flags sc_rflags -+# define context_err sc_err -+# else -+# define context_pc sc_eip -+# define context_sp sc_esp -+# define context_fp sc_ebp -+# define context_eip sc_eip -+# define context_esp sc_esp -+# define context_eax sc_eax -+# define context_ebx sc_ebx -+# define context_ecx sc_ecx -+# define context_edx sc_edx -+# define context_ebp sc_ebp -+# define context_esi sc_esi -+# define context_edi sc_edi -+# define context_eflags sc_eflags -+# define context_trapno sc_trapno -+# endif -+#endif -+ -+#ifdef __NetBSD__ -+# define context_trapno uc_mcontext.__gregs[_REG_TRAPNO] -+# ifdef AMD64 -+# define __register_t __greg_t -+# define context_pc uc_mcontext.__gregs[_REG_RIP] -+# define context_sp uc_mcontext.__gregs[_REG_URSP] -+# define context_fp uc_mcontext.__gregs[_REG_RBP] -+# define context_rip uc_mcontext.__gregs[_REG_RIP] -+# define context_rsp uc_mcontext.__gregs[_REG_URSP] -+# define context_rax uc_mcontext.__gregs[_REG_RAX] -+# define context_rbx uc_mcontext.__gregs[_REG_RBX] -+# define context_rcx uc_mcontext.__gregs[_REG_RCX] -+# define context_rdx uc_mcontext.__gregs[_REG_RDX] -+# define context_rbp uc_mcontext.__gregs[_REG_RBP] -+# define context_rsi uc_mcontext.__gregs[_REG_RSI] -+# define context_rdi uc_mcontext.__gregs[_REG_RDI] -+# define context_r8 uc_mcontext.__gregs[_REG_R8] -+# define context_r9 uc_mcontext.__gregs[_REG_R9] -+# define context_r10 uc_mcontext.__gregs[_REG_R10] -+# define context_r11 uc_mcontext.__gregs[_REG_R11] -+# define context_r12 uc_mcontext.__gregs[_REG_R12] -+# define context_r13 uc_mcontext.__gregs[_REG_R13] -+# define context_r14 uc_mcontext.__gregs[_REG_R14] -+# define context_r15 uc_mcontext.__gregs[_REG_R15] -+# define context_flags uc_mcontext.__gregs[_REG_RFL] -+# define context_err uc_mcontext.__gregs[_REG_ERR] -+# else -+# define context_pc uc_mcontext.__gregs[_REG_EIP] -+# define context_sp uc_mcontext.__gregs[_REG_UESP] -+# define context_fp uc_mcontext.__gregs[_REG_EBP] -+# define context_eip uc_mcontext.__gregs[_REG_EIP] -+# define context_esp uc_mcontext.__gregs[_REG_UESP] -+# define context_eax uc_mcontext.__gregs[_REG_EAX] -+# define context_ebx uc_mcontext.__gregs[_REG_EBX] -+# define context_ecx uc_mcontext.__gregs[_REG_ECX] -+# define context_edx uc_mcontext.__gregs[_REG_EDX] -+# define context_ebp uc_mcontext.__gregs[_REG_EBP] -+# define context_esi uc_mcontext.__gregs[_REG_ESI] -+# define context_edi uc_mcontext.__gregs[_REG_EDI] -+# define context_eflags uc_mcontext.__gregs[_REG_EFL] -+# define context_trapno uc_mcontext.__gregs[_REG_TRAPNO] -+# endif -+#endif -+ - address os::current_stack_pointer() { - #ifdef SPARC_WORKS - register void *esp; -@@ -119,15 +298,15 @@ - } - - address os::Bsd::ucontext_get_pc(ucontext_t * uc) { -- return (address)uc->uc_mcontext.gregs[REG_PC]; -+ return (address)uc->context_pc; - } - - intptr_t* os::Bsd::ucontext_get_sp(ucontext_t * uc) { -- return (intptr_t*)uc->uc_mcontext.gregs[REG_SP]; -+ return (intptr_t*)uc->context_sp; - } - - intptr_t* os::Bsd::ucontext_get_fp(ucontext_t * uc) { -- return (intptr_t*)uc->uc_mcontext.gregs[REG_FP]; -+ return (intptr_t*)uc->context_fp; - } +--- hotspot/src/os/bsd/vm/os_bsd.cpp 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/src/os/bsd/vm/os_bsd.cpp 2012-05-19 10:38:46.000000000 -0700 +@@ -2589,6 +2589,25 @@ + len = strlen(buf); + jrelib_p = buf + len; - // For Forte Analyzer AsyncGetCallTrace profiling support - thread -@@ -279,18 +458,18 @@ - pc = (address) os::Bsd::ucontext_get_pc(uc); - - if (pc == (address) Fetch32PFI) { -- uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ; -+ uc->context_pc = intptr_t(Fetch32Resume) ; - return 1 ; - } - #ifdef AMD64 - if (pc == (address) FetchNPFI) { -- uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ; -+ uc->context_pc = intptr_t (FetchNResume) ; - return 1 ; - } - #endif // AMD64 - - // Handle ALL stack overflow variations here -- if (sig == SIGSEGV) { -+ if (sig == SIGSEGV || sig == SIGBUS) { - address addr = (address) info->si_addr; - - // check if fault address is within thread stack -@@ -312,6 +491,7 @@ - // to handle_unexpected_exception way down below. - thread->disable_stack_red_zone(); - tty->print_raw_cr("An irrecoverable stack overflow has occurred."); -+#ifndef _ALLBSD_SOURCE - } else { - // Accessing stack address below sp may cause SEGV if current - // thread has MAP_GROWSDOWN stack. This should only happen when -@@ -327,6 +507,7 @@ - } else { - fatal("recursive segv. expanding stack."); - } -+#endif - } - } - } -@@ -335,9 +516,16 @@ - // Java thread running in Java code => find exception handler if any - // a fault inside compiled code, the interpreter, or a stub - -- if (sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) { -+ if ((sig == SIGSEGV || sig == SIGBUS) && os::is_poll_address((address)info->si_addr)) { - stub = SharedRuntime::get_poll_stub(pc); -+#if defined(__APPLE__) && !defined(AMD64) -+ // 32-bit Darwin reports a SIGBUS for nearly all memory access exceptions. -+ // Catching SIGBUS here prevents the implicit SIGBUS NULL check below from -+ // being called, so only do so if the implicit NULL check is not necessary. -+ } else if (sig == SIGBUS && MacroAssembler::needs_explicit_null_check((int)info->si_addr)) { -+#else - } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) { -+#endif - // BugId 4454115: A read from a MappedByteBuffer can fault - // here if the underlying file has been truncated. - // Do not crash the VM in such a case. -@@ -358,6 +546,28 @@ - pc, - SharedRuntime:: - IMPLICIT_DIVIDE_BY_ZERO); -+#ifdef __APPLE__ -+ } else if (sig == SIGFPE && info->si_code == FPE_NOOP) { -+ int op = pc[0]; -+ -+ // Skip REX -+ if ((pc[0] & 0xf0) == 0x40) { -+ op = pc[1]; -+ } else { -+ op = pc[0]; ++#ifndef __APPLE__ ++ snprintf(jrelib_p, buflen-len, "/jre/lib/%s", cpu_arch); ++ if (0 != access(buf, F_OK)) { ++ snprintf(jrelib_p, buflen-len, "/lib/%s", cpu_arch); + } + -+ // Check for IDIV -+ if (op == 0xF7) { -+ stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime:: IMPLICIT_DIVIDE_BY_ZERO); ++ if (0 == access(buf, F_OK)) { ++ // Use current module name "libjvm[_g].so" instead of ++ // "libjvm"debug_only("_g")".so" since for fastdebug version ++ // we should have "libjvm.so" but debug_only("_g") adds "_g"! ++ len = strlen(buf); ++ snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p); + } else { -+ // TODO: handle more cases if we are using other x86 instructions -+ // that can generate SIGFPE signal. -+ tty->print_cr("unknown opcode 0x%X with SIGFPE.", op); -+ fatal("please update this code."); ++ // Go back to path of .so ++ rp = realpath(dli_fname, buf); ++ if (rp == NULL) ++ return; + } -+#endif /* __APPLE__ */ -+ - #else - if (sig == SIGFPE /* && info->si_code == FPE_INTDIV */) { - // HACK: si_code does not work on bsd 2.2.12-20!!! -@@ -385,7 +595,7 @@ - fatal("please update this code."); - } - #endif // AMD64 -- } else if (sig == SIGSEGV && -+ } else if ((sig == SIGSEGV || sig == SIGBUS) && - !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) { - // Determination of interpreter/vtable stub/compiled code null exception - stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); -@@ -409,7 +619,7 @@ - // process of write protecting the memory serialization page. - // It write enables the page immediately after protecting it - // so we can just return to retry the write. -- if ((sig == SIGSEGV) && -+ if ((sig == SIGSEGV || sig == SIGBUS) && - os::is_memory_serialize_page(thread, (address) info->si_addr)) { - // Block current thread until the memory serialize page permission restored. - os::block_on_serialize_page_trap(); -@@ -430,7 +640,7 @@ - // Furthermore, a false-positive should be harmless. - if (UnguardOnExecutionViolation > 0 && - (sig == SIGSEGV || sig == SIGBUS) && -- uc->uc_mcontext.gregs[REG_TRAPNO] == trap_page_fault) { -+ uc->context_trapno == trap_page_fault) { - int page_size = os::vm_page_size(); - address addr = (address) info->si_addr; - address pc = os::Bsd::ucontext_get_pc(uc); -@@ -500,7 +710,7 @@ - // save all thread context in case we need to restore it - if (thread != NULL) thread->set_saved_exception_pc(pc); - -- uc->uc_mcontext.gregs[REG_PC] = (greg_t)stub; -+ uc->context_pc = (intptr_t)stub; - return true; - } - -@@ -530,13 +740,24 @@ - ShouldNotReachHere(); - } - -+#ifdef _ALLBSD_SOURCE -+// From solaris_i486.s ported to bsd_i486.s -+extern "C" void fixcw(); -+#endif -+ - void os::Bsd::init_thread_fpu_state(void) { - #ifndef AMD64 -+# ifdef _ALLBSD_SOURCE -+ // Set fpu to 53 bit precision. This happens too early to use a stub. -+ fixcw(); -+# else - // set fpu to 53 bit precision - set_fpu_control_word(0x27f); -+# endif - #endif // !AMD64 - } - -+#ifndef _ALLBSD_SOURCE - int os::Bsd::get_fpu_control_word(void) { - #ifdef AMD64 - return 0; -@@ -552,11 +773,12 @@ - _FPU_SETCW(fpu_control); - #endif // !AMD64 - } -+#endif - - // Check that the bsd kernel version is 2.4 or higher since earlier - // versions do not support SSE without patches. - bool os::supports_sse() { --#ifdef AMD64 -+#if defined(AMD64) || defined(_ALLBSD_SOURCE) - return true; - #else - struct utsname uts; -@@ -610,6 +832,9 @@ - #define GET_GS() ({int gs; __asm__ volatile("movw %%gs, %w0":"=q"(gs)); gs&0xffff;}) - #endif - -+#ifdef _ALLBSD_SOURCE -+bool os::Bsd::supports_variable_stack_size() { return true; } -+#else - // Test if pthread library can support variable thread stack size. BsdThreads - // in fixed stack mode allocates 2M fixed slot for each thread. BsdThreads - // in floating stack mode and NPTL support variable stack size. -@@ -646,6 +871,7 @@ - #endif - } - } -+#endif - #endif // AMD64 - - // return default stack size for thr_type -@@ -699,6 +925,41 @@ - // pthread_attr_getstack() - - static void current_stack_region(address * bottom, size_t * size) { -+#ifdef __APPLE__ -+ pthread_t self = pthread_self(); -+ void *stacktop = pthread_get_stackaddr_np(self); -+ *size = pthread_get_stacksize_np(self); -+ *bottom = (address) stacktop - *size; -+#elif defined(__OpenBSD__) -+ stack_t ss; -+ int rslt = pthread_stackseg_np(pthread_self(), &ss); -+ -+ if (rslt != 0) -+ fatal(err_msg("pthread_stackseg_np failed with err = %d", rslt)); -+ -+ *bottom = (address)((char *)ss.ss_sp - ss.ss_size); -+ *size = ss.ss_size; -+#elif defined(_ALLBSD_SOURCE) -+ pthread_attr_t attr; -+ -+ int rslt = pthread_attr_init(&attr); -+ -+ // JVM needs to know exact stack location, abort if it fails -+ if (rslt != 0) -+ fatal(err_msg("pthread_attr_init failed with err = %d", rslt)); -+ -+ rslt = pthread_attr_get_np(pthread_self(), &attr); -+ -+ if (rslt != 0) -+ fatal(err_msg("pthread_attr_get_np failed with err = %d", rslt)); -+ -+ if (pthread_attr_getstackaddr(&attr, (void **)bottom) != 0 || -+ pthread_attr_getstacksize(&attr, size) != 0) { -+ fatal("Can not locate current stack attributes!"); -+ } -+ -+ pthread_attr_destroy(&attr); +#else - if (os::Bsd::is_initial_thread()) { - // initial thread needs special handling because pthread_getattr_np() - // may return bogus value. -@@ -725,6 +986,7 @@ - pthread_attr_destroy(&attr); - - } -+#endif - assert(os::current_stack_pointer() >= *bottom && - os::current_stack_pointer() < *bottom + *size, "just checking"); - } -@@ -753,46 +1015,44 @@ - ucontext_t *uc = (ucontext_t*)context; - st->print_cr("Registers:"); - #ifdef AMD64 -- st->print( "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]); -- st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]); -- st->print(", RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]); -- st->print(", RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]); -- st->cr(); -- st->print( "RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]); -- st->print(", RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]); -- st->print(", RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]); -- st->print(", RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]); -- st->cr(); -- st->print( "R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]); -- st->print(", R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]); -- st->print(", R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]); -- st->print(", R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]); -- st->cr(); -- st->print( "R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]); -- st->print(", R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]); -- st->print(", R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]); -- st->print(", R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]); -- st->cr(); -- st->print( "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]); -- st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]); -- st->print(", CSGSFS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_CSGSFS]); -- st->print(", ERR=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ERR]); -- st->cr(); -- st->print(" TRAPNO=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_TRAPNO]); --#else -- st->print( "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]); -- st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]); -- st->print(", ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]); -- st->print(", EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]); -- st->cr(); -- st->print( "ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_UESP]); -- st->print(", EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBP]); -- st->print(", ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESI]); -- st->print(", EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]); -- st->cr(); -- st->print( "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]); -- st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]); -- st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2); -+ st->print( "RAX=" INTPTR_FORMAT, uc->context_rax); -+ st->print(", RBX=" INTPTR_FORMAT, uc->context_rbx); -+ st->print(", RCX=" INTPTR_FORMAT, uc->context_rcx); -+ st->print(", RDX=" INTPTR_FORMAT, uc->context_rdx); -+ st->cr(); -+ st->print( "RSP=" INTPTR_FORMAT, uc->context_rsp); -+ st->print(", RBP=" INTPTR_FORMAT, uc->context_rbp); -+ st->print(", RSI=" INTPTR_FORMAT, uc->context_rsi); -+ st->print(", RDI=" INTPTR_FORMAT, uc->context_rdi); -+ st->cr(); -+ st->print( "R8 =" INTPTR_FORMAT, uc->context_r8); -+ st->print(", R9 =" INTPTR_FORMAT, uc->context_r9); -+ st->print(", R10=" INTPTR_FORMAT, uc->context_r10); -+ st->print(", R11=" INTPTR_FORMAT, uc->context_r11); -+ st->cr(); -+ st->print( "R12=" INTPTR_FORMAT, uc->context_r12); -+ st->print(", R13=" INTPTR_FORMAT, uc->context_r13); -+ st->print(", R14=" INTPTR_FORMAT, uc->context_r14); -+ st->print(", R15=" INTPTR_FORMAT, uc->context_r15); -+ st->cr(); -+ st->print( "RIP=" INTPTR_FORMAT, uc->context_rip); -+ st->print(", EFLAGS=" INTPTR_FORMAT, uc->context_flags); -+ st->print(", ERR=" INTPTR_FORMAT, uc->context_err); -+ st->cr(); -+ st->print(" TRAPNO=" INTPTR_FORMAT, uc->context_trapno); -+#else -+ st->print( "EAX=" INTPTR_FORMAT, uc->context_eax); -+ st->print(", EBX=" INTPTR_FORMAT, uc->context_ebx); -+ st->print(", ECX=" INTPTR_FORMAT, uc->context_ecx); -+ st->print(", EDX=" INTPTR_FORMAT, uc->context_edx); -+ st->cr(); -+ st->print( "ESP=" INTPTR_FORMAT, uc->context_esp); -+ st->print(", EBP=" INTPTR_FORMAT, uc->context_ebp); -+ st->print(", ESI=" INTPTR_FORMAT, uc->context_esi); -+ st->print(", EDI=" INTPTR_FORMAT, uc->context_edi); -+ st->cr(); -+ st->print( "EIP=" INTPTR_FORMAT, uc->context_eip); -+ st->print(", EFLAGS=" INTPTR_FORMAT, uc->context_eflags); - #endif // AMD64 - st->cr(); - st->cr(); -@@ -825,31 +1085,31 @@ - // this is only for the "general purpose" registers - - #ifdef AMD64 -- st->print("RAX="); print_location(st, uc->uc_mcontext.gregs[REG_RAX]); -- st->print("RBX="); print_location(st, uc->uc_mcontext.gregs[REG_RBX]); -- st->print("RCX="); print_location(st, uc->uc_mcontext.gregs[REG_RCX]); -- st->print("RDX="); print_location(st, uc->uc_mcontext.gregs[REG_RDX]); -- st->print("RSP="); print_location(st, uc->uc_mcontext.gregs[REG_RSP]); -- st->print("RBP="); print_location(st, uc->uc_mcontext.gregs[REG_RBP]); -- st->print("RSI="); print_location(st, uc->uc_mcontext.gregs[REG_RSI]); -- st->print("RDI="); print_location(st, uc->uc_mcontext.gregs[REG_RDI]); -- st->print("R8 ="); print_location(st, uc->uc_mcontext.gregs[REG_R8]); -- st->print("R9 ="); print_location(st, uc->uc_mcontext.gregs[REG_R9]); -- st->print("R10="); print_location(st, uc->uc_mcontext.gregs[REG_R10]); -- st->print("R11="); print_location(st, uc->uc_mcontext.gregs[REG_R11]); -- st->print("R12="); print_location(st, uc->uc_mcontext.gregs[REG_R12]); -- st->print("R13="); print_location(st, uc->uc_mcontext.gregs[REG_R13]); -- st->print("R14="); print_location(st, uc->uc_mcontext.gregs[REG_R14]); -- st->print("R15="); print_location(st, uc->uc_mcontext.gregs[REG_R15]); --#else -- st->print("EAX="); print_location(st, uc->uc_mcontext.gregs[REG_EAX]); -- st->print("EBX="); print_location(st, uc->uc_mcontext.gregs[REG_EBX]); -- st->print("ECX="); print_location(st, uc->uc_mcontext.gregs[REG_ECX]); -- st->print("EDX="); print_location(st, uc->uc_mcontext.gregs[REG_EDX]); -- st->print("ESP="); print_location(st, uc->uc_mcontext.gregs[REG_ESP]); -- st->print("EBP="); print_location(st, uc->uc_mcontext.gregs[REG_EBP]); -- st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[REG_ESI]); -- st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[REG_EDI]); -+ st->print("RAX="); print_location(st, uc->context_rax); -+ st->print("RBX="); print_location(st, uc->context_rbx); -+ st->print("RCX="); print_location(st, uc->context_rcx); -+ st->print("RDX="); print_location(st, uc->context_rdx); -+ st->print("RSP="); print_location(st, uc->context_rsp); -+ st->print("RBP="); print_location(st, uc->context_rbp); -+ st->print("RSI="); print_location(st, uc->context_rsi); -+ st->print("RDI="); print_location(st, uc->context_rdi); -+ st->print("R8 ="); print_location(st, uc->context_r8); -+ st->print("R9 ="); print_location(st, uc->context_r9); -+ st->print("R10="); print_location(st, uc->context_r10); -+ st->print("R11="); print_location(st, uc->context_r11); -+ st->print("R12="); print_location(st, uc->context_r12); -+ st->print("R13="); print_location(st, uc->context_r13); -+ st->print("R14="); print_location(st, uc->context_r14); -+ st->print("R15="); print_location(st, uc->context_r15); -+#else -+ st->print("EAX="); print_location(st, uc->context_eax); -+ st->print("EBX="); print_location(st, uc->context_ebx); -+ st->print("ECX="); print_location(st, uc->context_ecx); -+ st->print("EDX="); print_location(st, uc->context_edx); -+ st->print("ESP="); print_location(st, uc->context_esp); -+ st->print("EBP="); print_location(st, uc->context_ebp); -+ st->print("ESI="); print_location(st, uc->context_esi); -+ st->print("EDI="); print_location(st, uc->context_edi); - #endif // AMD64 - - st->cr(); ---- ./hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp 2012-03-03 21:41:06.000000000 -0800 -@@ -31,8 +31,10 @@ - - // map stack pointer to thread pointer - see notes in threadLS_bsd_x86.cpp - #define SP_BITLENGTH 32 -+#ifndef PAGE_SHIFT - #define PAGE_SHIFT 12 - #define PAGE_SIZE (1UL << PAGE_SHIFT) -+#endif - static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; - - public: ---- ./hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp 2011-04-22 22:28:34.000000000 -0700 -@@ -34,7 +34,7 @@ - /******************************/ \ - /* Threads (NOTE: incomplete) */ \ - /******************************/ \ -- nonstatic_field(OSThread, _thread_id, pid_t) \ -+ nonstatic_field(OSThread, _thread_id, pthread_t) \ - nonstatic_field(OSThread, _pthread_id, pthread_t) \ - /* This must be the last entry, and must be present */ \ - last_entry() ---- ./hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp 2012-02-12 13:05:32.000000000 -0800 -@@ -163,10 +163,16 @@ - #endif // ARM - - inline void Atomic::store(jint store_value, volatile jint* dest) { -+#if !defined(ARM) && !defined(M68K) -+ __sync_synchronize(); -+#endif - *dest = store_value; - } - - inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { -+#if !defined(ARM) && !defined(M68K) -+ __sync_synchronize(); -+#endif - *dest = store_value; - } - ---- ./hotspot/src/os_cpu/bsd_zero/vm/bytes_bsd_zero.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_zero/vm/bytes_bsd_zero.inline.hpp 2012-02-12 13:05:32.000000000 -0800 -@@ -28,7 +28,29 @@ - // Efficient swapping of data bytes from Java byte - // ordering to native byte ordering and vice versa. - --#include <byteswap.h> -+#ifdef __APPLE__ -+# include <libkern/OSByteOrder.h> -+#else -+# include <sys/endian.h> -+#endif -+ -+#if defined(__APPLE__) -+# define bswap_16(x) OSSwapInt16(x) -+# define bswap_32(x) OSSwapInt32(x) -+# define bswap_64(x) OSSwapInt64(x) -+#elif defined(__OpenBSD__) -+# define bswap_16(x) swap16(x) -+# define bswap_32(x) swap32(x) -+# define bswap_64(x) swap64(x) -+#elif defined(__NetBSD__) -+# define bswap_16(x) bswap16(x) -+# define bswap_32(x) bswap32(x) -+# define bswap_64(x) bswap64(x) -+#else -+# define bswap_16(x) __bswap16(x) -+# define bswap_32(x) __bswap32(x) -+# define bswap_64(x) __bswap64(x) -+#endif - - inline u2 Bytes::swap_u2(u2 x) { - return bswap_16(x); ---- ./hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp 2012-02-12 13:05:32.000000000 -0800 -@@ -50,10 +50,11 @@ - - #ifdef PPC - --#define READ_MEM_BARRIER __asm __volatile ("isync":::"memory") - #ifdef __NO_LWSYNC__ -+#define READ_MEM_BARRIER __asm __volatile ("sync":::"memory") - #define WRITE_MEM_BARRIER __asm __volatile ("sync":::"memory") - #else -+#define READ_MEM_BARRIER __asm __volatile ("lwsync":::"memory") - #define WRITE_MEM_BARRIER __asm __volatile ("lwsync":::"memory") - #endif - ---- ./hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp 2012-03-04 16:33:48.000000000 -0800 -+++ ./hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp 2012-02-12 13:05:32.000000000 -0800 -@@ -23,6 +23,11 @@ - * - */ - -+#if defined(_ALLBSD_SOURCE) && !defined(__APPLE__) && !defined(__NetBSD__) -+# include <pthread.h> -+# include <pthread_np.h> /* For pthread_attr_get_np */ -+#endif -+ - // no precompiled headers - #include "assembler_zero.inline.hpp" - #include "classfile/classLoader.hpp" -@@ -164,7 +169,7 @@ - - if (info != NULL && thread != NULL) { - // Handle ALL stack overflow variations here -- if (sig == SIGSEGV) { -+ if (sig == SIGSEGV || sig == SIGBUS) { - address addr = (address) info->si_addr; - - // check if fault address is within thread stack -@@ -179,6 +184,7 @@ - thread->disable_stack_red_zone(); - ShouldNotCallThis(); - } -+#ifndef _ALLBSD_SOURCE - else { - // Accessing stack address below sp may cause SEGV if - // current thread has MAP_GROWSDOWN stack. This should -@@ -197,6 +203,7 @@ - fatal("recursive segv. expanding stack."); - } + // Add the appropriate library subdir + snprintf(jrelib_p, buflen-len, "/jre/lib"); + if (0 != access(buf, F_OK)) { +@@ -2618,6 +2637,7 @@ + if (rp == NULL) + return; } +#endif } } - -@@ -221,7 +228,7 @@ - // of write protecting the memory serialization page. It write - // enables the page immediately after protecting it so we can - // just return to retry the write. -- if (sig == SIGSEGV && -+ if ((sig == SIGSEGV || sig == SIGBUS) && - os::is_memory_serialize_page(thread, (address) info->si_addr)) { - // Block current thread until permission is restored. - os::block_on_serialize_page_trap(); -@@ -253,10 +260,10 @@ } - #endif // !PRODUCT - -- const char *fmt = "caught unhandled signal %d"; -- char buf[64]; -+ const char *fmt = "caught unhandled signal %d at address %p"; -+ char buf[128]; - -- sprintf(buf, fmt, sig); -+ sprintf(buf, fmt, sig, info->si_addr); - fatal(buf); +@@ -2874,7 +2894,11 @@ } -@@ -264,6 +271,7 @@ - // Nothing to do - } - -+#ifndef _ALLBSD_SOURCE - int os::Bsd::get_fpu_control_word() { - ShouldNotCallThis(); - } -@@ -271,6 +279,7 @@ - void os::Bsd::set_fpu_control_word(int fpu) { - ShouldNotCallThis(); - } + void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) { ++#if !defined(__APPLE__) && !defined(__FreeBSD__) ++ commit_memory(addr, bytes, alignment_hint, false); ++#else + ::madvise(addr, bytes, MADV_DONTNEED); +#endif - - bool os::is_allocatable(size_t bytes) { - #ifdef _LP64 -@@ -315,6 +324,48 @@ } - static void current_stack_region(address *bottom, size_t *size) { -+ address stack_bottom; -+ address stack_top; -+ size_t stack_bytes; -+ -+#ifdef __APPLE__ -+ pthread_t self = pthread_self(); -+ stack_top = (address) pthread_get_stackaddr_np(self); -+ stack_bytes = pthread_get_stacksize_np(self); -+ stack_bottom = stack_top - stack_bytes; -+#elif defined(__OpenBSD__) -+ stack_t ss; -+ int rslt = pthread_stackseg_np(pthread_self(), &ss); -+ -+ if (rslt != 0) -+ fatal(err_msg("pthread_stackseg_np failed with err = %d", rslt)); -+ -+ stack_top = (address) ss.ss_sp; -+ stack_bytes = ss.ss_size; -+ stack_bottom = stack_top - stack_bytes; -+#elif defined(_ALLBSD_SOURCE) -+ pthread_attr_t attr; -+ -+ int rslt = pthread_attr_init(&attr); -+ -+ // JVM needs to know exact stack location, abort if it fails -+ if (rslt != 0) -+ fatal(err_msg("pthread_attr_init failed with err = %d", rslt)); -+ -+ rslt = pthread_attr_get_np(pthread_self(), &attr); -+ -+ if (rslt != 0) -+ fatal(err_msg("pthread_attr_get_np failed with err = %d", rslt)); -+ -+ if (pthread_attr_getstackaddr(&attr, (void **) &stack_bottom) != 0 || -+ pthread_attr_getstacksize(&attr, &stack_bytes) != 0) { -+ fatal("Can not locate current stack attributes!"); -+ } -+ -+ pthread_attr_destroy(&attr); -+ -+ stack_top = stack_bottom + stack_bytes; -+#else /* Linux */ - pthread_attr_t attr; - int res = pthread_getattr_np(pthread_self(), &attr); - if (res != 0) { -@@ -326,13 +377,11 @@ - } - } - -- address stack_bottom; -- size_t stack_bytes; - res = pthread_attr_getstack(&attr, (void **) &stack_bottom, &stack_bytes); - if (res != 0) { - fatal(err_msg("pthread_attr_getstack failed with errno = %d", res)); - } -- address stack_top = stack_bottom + stack_bytes; -+ stack_top = stack_bottom + stack_bytes; - - // The block of memory returned by pthread_attr_getstack() includes - // guard pages where present. We need to trim these off. -@@ -374,6 +423,7 @@ - - stack_bottom = stack_top - stack_bytes; - } -+#endif - - assert(os::current_stack_pointer() >= stack_bottom, "should do"); - assert(os::current_stack_pointer() < stack_top, "should do"); ---- ./hotspot/src/share/vm/adlc/adlc.hpp 2011-11-17 21:37:58.000000000 -0800 -+++ ./hotspot/src/share/vm/adlc/adlc.hpp 2011-04-22 22:28:35.000000000 -0700 -@@ -67,9 +67,9 @@ - #endif - #endif // _WIN32 - --#ifdef LINUX -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - #include <inttypes.h> --#endif // LINUX -+#endif // LINUX || _ALLBSD_SOURCE - - // Macros - #define uint32 unsigned int ---- ./hotspot/src/share/vm/c1/c1_globals.hpp 2011-11-17 21:38:04.000000000 -0800 -+++ ./hotspot/src/share/vm/c1/c1_globals.hpp 2012-02-26 13:59:20.000000000 -0800 -@@ -47,6 +47,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "c1_globals_windows.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "c1_globals_bsd.hpp" -+#endif - - // - // Defines all global flags used by the client compiler. ---- ./hotspot/src/share/vm/classfile/classLoader.cpp 2011-11-17 21:38:07.000000000 -0800 -+++ ./hotspot/src/share/vm/classfile/classLoader.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -68,6 +68,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - - // Entry points in zip.dll for loading zip/jar file entries ---- ./hotspot/src/share/vm/classfile/javaClasses.cpp 2011-11-17 21:38:07.000000000 -0800 -+++ ./hotspot/src/share/vm/classfile/javaClasses.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -58,6 +58,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - #define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java) \ - klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum); -@@ -1145,7 +1148,7 @@ - } - nmethod* nm = method->code(); - if (WizardMode && nm != NULL) { -- sprintf(buf + (int)strlen(buf), "(nmethod " PTR_FORMAT ")", (intptr_t)nm); -+ sprintf(buf + (int)strlen(buf), "(nmethod " INTPTR_FORMAT ")", (intptr_t)nm); - } - } - ---- ./hotspot/src/share/vm/code/stubs.hpp 2011-11-17 21:38:09.000000000 -0800 -+++ ./hotspot/src/share/vm/code/stubs.hpp 2011-04-22 22:28:36.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - // The classes in this file provide a simple framework for the - // management of little pieces of machine code - or stubs - ---- ./hotspot/src/share/vm/compiler/disassembler.hpp 2011-11-17 21:38:09.000000000 -0800 -+++ ./hotspot/src/share/vm/compiler/disassembler.hpp 2011-04-22 22:28:36.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - class decode_env; - ---- ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp 2011-11-17 21:38:10.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - elapsedTimer CMSAdaptiveSizePolicy::_concurrent_timer; - elapsedTimer CMSAdaptiveSizePolicy::_STW_timer; - ---- ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp 2011-11-17 21:38:10.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -50,6 +50,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // - // ConcurrentMarkSweepPolicy methods ---- ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp 2011-11-17 21:38:10.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp 2011-04-22 22:28:36.000000000 -0700 -@@ -36,6 +36,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - class ConcurrentMarkSweepGeneration; - class CMSCollector; ---- ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp 2011-11-17 21:38:10.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -33,6 +33,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - #ifndef PRODUCT - Mutex* FreeBlockDictionary::par_lock() const { ---- ./hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp 2011-11-17 21:38:11.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -39,6 +39,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - bool DirtyCardQueue::apply_closure(CardTableEntryClosure* cl, - bool consume, ---- ./hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp 2011-11-17 21:38:12.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp 2011-05-07 21:53:41.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, - int max_covered_regions) : ---- ./hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp 2011-11-17 21:38:12.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - PtrQueue::PtrQueue(PtrQueueSet* qset, bool perm, bool active) : - _qset(qset), _buf(NULL), _index(0), _active(active), ---- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2011-11-17 21:38:14.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -38,6 +38,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - bool - ParMarkBitMap::initialize(MemRegion covered_region) ---- ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp 2011-11-17 21:38:15.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - // PSVirtualSpace - ---- ./hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp 2011-11-17 21:38:16.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) { ---- ./hotspot/src/share/vm/gc_interface/collectedHeap.cpp 2011-11-17 21:38:16.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_interface/collectedHeap.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -39,6 +39,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - #ifdef ASSERT ---- ./hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp 2011-11-17 21:38:16.000000000 -0800 -+++ ./hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp 2012-02-26 13:59:20.000000000 -0800 -@@ -43,6 +43,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // Inline allocation implementations. - ---- ./hotspot/src/share/vm/interpreter/abstractInterpreter.hpp 2011-11-17 21:38:16.000000000 -0800 -+++ ./hotspot/src/share/vm/interpreter/abstractInterpreter.hpp 2011-05-20 20:03:59.000000000 -0700 -@@ -56,6 +56,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // This file contains the platform-independent parts - // of the abstract interpreter and the abstract interpreter generator. ---- ./hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp 2011-11-17 21:38:17.000000000 -0800 -+++ ./hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp 2011-04-23 12:09:38.000000000 -0700 -@@ -65,6 +65,12 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "orderAccess_linux_ppc.inline.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "orderAccess_bsd_x86.inline.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "orderAccess_bsd_zero.inline.hpp" -+#endif - - - // no precompiled headers ---- ./hotspot/src/share/vm/interpreter/bytecodeTracer.cpp 2011-11-17 21:38:17.000000000 -0800 -+++ ./hotspot/src/share/vm/interpreter/bytecodeTracer.cpp 2011-05-27 00:00:43.000000000 -0700 -@@ -92,7 +92,7 @@ - // the incoming method. We could lose a line of trace output. - // This is acceptable in a debug-only feature. - st->cr(); -- st->print("[%d] ", (int) Thread::current()->osthread()->thread_id()); -+ st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id()); - method->print_name(st); - st->cr(); - _current_method = method(); -@@ -106,7 +106,7 @@ - } - _code = code; - int bci = bcp - method->code_base(); -- st->print("[%d] ", (int) Thread::current()->osthread()->thread_id()); -+ st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id()); - if (Verbose) { - st->print("%8d %4d " INTPTR_FORMAT " " INTPTR_FORMAT " %s", - BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code)); ---- ./hotspot/src/share/vm/interpreter/interpreterRuntime.hpp 2011-11-17 21:38:17.000000000 -0800 -+++ ./hotspot/src/share/vm/interpreter/interpreterRuntime.hpp 2012-02-26 13:59:20.000000000 -0800 -@@ -41,6 +41,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // The InterpreterRuntime is called by the interpreter for everything - // that cannot/should not be dealt with in assembly and needs C support. ---- ./hotspot/src/share/vm/interpreter/linkResolver.cpp 2011-11-17 21:38:17.000000000 -0800 -+++ ./hotspot/src/share/vm/interpreter/linkResolver.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -52,6 +52,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - //------------------------------------------------------------------------------------------------------------------------ - // Implementation of FieldAccessInfo ---- ./hotspot/src/share/vm/memory/allocation.cpp 2011-11-17 21:38:18.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/allocation.cpp 2011-05-12 20:54:44.000000000 -0700 -@@ -39,6 +39,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - void* CHeapObj::operator new(size_t size){ - return (void *) AllocateHeap(size, "CHeapObj-new"); ---- ./hotspot/src/share/vm/memory/collectorPolicy.cpp 2011-11-17 21:38:18.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/collectorPolicy.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -47,6 +47,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" - #include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" ---- ./hotspot/src/share/vm/memory/defNewGeneration.cpp 2011-11-17 21:38:18.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/defNewGeneration.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -48,6 +48,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // - // DefNewGeneration functions. ---- ./hotspot/src/share/vm/memory/gcLocker.hpp 2011-11-17 21:38:19.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/gcLocker.hpp 2011-04-22 22:28:36.000000000 -0700 -@@ -41,6 +41,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - // The direct lock/unlock calls do not force a collection if an unlock - // decrements the count to zero. Avoid calling these if at all possible. ---- ./hotspot/src/share/vm/memory/genMarkSweep.cpp 2011-11-17 21:38:19.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/genMarkSweep.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -55,6 +55,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, - bool clear_all_softrefs) { ---- ./hotspot/src/share/vm/memory/resourceArea.cpp 2011-11-17 21:38:19.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/resourceArea.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - //------------------------------ResourceMark----------------------------------- - debug_only(int ResourceArea::_warned;) // to suppress multiple warnings ---- ./hotspot/src/share/vm/memory/resourceArea.hpp 2011-11-17 21:38:19.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/resourceArea.hpp 2012-02-26 13:59:20.000000000 -0800 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // The resource area holds temporary data structures in the VM. - // The actual allocation areas are thread local. Typical usage: ---- ./hotspot/src/share/vm/memory/space.hpp 2011-11-17 21:38:19.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/space.hpp 2011-04-22 22:28:36.000000000 -0700 -@@ -44,6 +44,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - // A space is an abstraction for the "storage units" backing - // up the generation abstraction. It includes specific ---- ./hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp 2011-11-17 21:38:20.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -38,6 +38,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // Thread-Local Edens support - ---- ./hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp 2011-11-17 21:38:20.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp 2012-03-04 14:12:44.000000000 -0800 -@@ -28,6 +28,21 @@ - #include "gc_implementation/shared/gcUtil.hpp" - #include "oops/typeArrayOop.hpp" - #include "runtime/perfData.hpp" -+#ifdef TARGET_ARCH_x86 -+# include "vm_version_x86.hpp" -+#endif -+#ifdef TARGET_ARCH_sparc -+# include "vm_version_sparc.hpp" -+#endif -+#ifdef TARGET_ARCH_zero -+# include "vm_version_zero.hpp" -+#endif -+#ifdef TARGET_ARCH_arm -+# include "vm_version_arm.hpp" -+#endif -+#ifdef TARGET_ARCH_ppc -+# include "vm_version_ppc.hpp" -+#endif - - class GlobalTLABStats; - ---- ./hotspot/src/share/vm/memory/universe.cpp 2011-11-17 21:38:20.000000000 -0800 -+++ ./hotspot/src/share/vm/memory/universe.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -89,6 +89,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" - #include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp" ---- ./hotspot/src/share/vm/oops/constantPoolKlass.cpp 2011-11-17 21:38:20.000000000 -0800 -+++ ./hotspot/src/share/vm/oops/constantPoolKlass.cpp 2011-06-27 22:08:04.000000000 -0700 -@@ -44,6 +44,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/parNew/parOopClosures.inline.hpp" - #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" ---- ./hotspot/src/share/vm/oops/constantPoolOop.cpp 2011-11-17 21:38:20.000000000 -0800 -+++ ./hotspot/src/share/vm/oops/constantPoolOop.cpp 2011-06-27 22:08:04.000000000 -0700 -@@ -1355,7 +1355,7 @@ - } - case JVM_CONSTANT_Long: { - u8 val = Bytes::get_Java_u8(bytes); -- printf("long "INT64_FORMAT, *(jlong *) &val); -+ printf("long "INT64_FORMAT, (int64_t) *(jlong *) &val); - ent_size = 8; - idx++; // Long takes two cpool slots - break; ---- ./hotspot/src/share/vm/oops/instanceKlass.cpp 2011-11-17 21:38:21.000000000 -0800 -+++ ./hotspot/src/share/vm/oops/instanceKlass.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -61,6 +61,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" - #include "gc_implementation/g1/g1OopClosures.inline.hpp" ---- ./hotspot/src/share/vm/oops/markOop.cpp 2011-11-17 21:38:21.000000000 -0800 -+++ ./hotspot/src/share/vm/oops/markOop.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -33,6 +33,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - void markOopDesc::print_on(outputStream* st) const { ---- ./hotspot/src/share/vm/oops/oop.cpp 2011-11-17 21:38:22.000000000 -0800 -+++ ./hotspot/src/share/vm/oops/oop.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -36,6 +36,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - bool always_do_update_barrier = false; - ---- ./hotspot/src/share/vm/oops/oopsHierarchy.cpp 2011-11-17 21:38:22.000000000 -0800 -+++ ./hotspot/src/share/vm/oops/oopsHierarchy.cpp 2011-04-22 22:28:36.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" + void os::numa_make_global(char *addr, size_t bytes) { +--- hotspot/src/os/bsd/vm/os_bsd.inline.hpp 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/src/os/bsd/vm/os_bsd.inline.hpp 2012-05-17 15:05:10.000000000 -0700 +@@ -31,10 +31,22 @@ + # include "atomic_bsd_x86.inline.hpp" + # include "orderAccess_bsd_x86.inline.hpp" #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" ++#ifdef TARGET_OS_ARCH_bsd_sparc ++# include "atomic_bsd_sparc.inline.hpp" ++# include "orderAccess_bsd_sparc.inline.hpp" +#endif - - #ifdef CHECK_UNHANDLED_OOPS - ---- ./hotspot/src/share/vm/opto/c2_globals.hpp 2011-11-17 21:38:22.000000000 -0800 -+++ ./hotspot/src/share/vm/opto/c2_globals.hpp 2011-05-12 20:54:44.000000000 -0700 -@@ -44,6 +44,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "c2_globals_windows.hpp" + #ifdef TARGET_OS_ARCH_bsd_zero + # include "atomic_bsd_zero.inline.hpp" + # include "orderAccess_bsd_zero.inline.hpp" #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "c2_globals_bsd.hpp" -+#endif - - // - // Defines all globals flags used by the server compiler. ---- ./hotspot/src/share/vm/opto/connode.cpp 2011-11-17 21:38:23.000000000 -0800 -+++ ./hotspot/src/share/vm/opto/connode.cpp 2012-02-12 13:05:33.000000000 -0800 -@@ -716,6 +716,9 @@ - - //============================================================================= - //------------------------------Value------------------------------------------ -+#ifdef IA64 -+static double ia64_double_zero = 0.0; ++#ifdef TARGET_OS_ARCH_bsd_arm ++# include "atomic_bsd_arm.inline.hpp" ++# include "orderAccess_bsd_arm.inline.hpp" +#endif - const Type *ConvF2DNode::Value( PhaseTransform *phase ) const { - const Type *t = phase->type( in(1) ); - if( t == Type::TOP ) return Type::TOP; ---- ./hotspot/src/share/vm/prims/forte.cpp 2011-11-17 21:38:29.000000000 -0800 -+++ ./hotspot/src/share/vm/prims/forte.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -621,6 +621,11 @@ - // Method to let libcollector know about a dynamically loaded function. - // Because it is weakly bound, the calls become NOP's when the library - // isn't present. -+#ifdef __APPLE__ -+// XXXDARWIN: Link errors occur even when __attribute__((weak_import)) -+// is added -+#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) -+#else - void collector_func_load(char* name, - void* null_argument_1, - void* null_argument_2, -@@ -631,6 +636,7 @@ - #pragma weak collector_func_load - #define collector_func_load(x0,x1,x2,x3,x4,x5,x6) \ - ( collector_func_load ? collector_func_load(x0,x1,x2,x3,x4,x5,x6),0 : 0 ) -+#endif // __APPLE__ - #endif // !_WINDOWS - - } // end extern "C" ---- ./hotspot/src/share/vm/prims/jni.cpp 2011-11-17 21:38:29.000000000 -0800 -+++ ./hotspot/src/share/vm/prims/jni.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -82,6 +82,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" ++#ifdef TARGET_OS_ARCH_bsd_ppc ++# include "atomic_bsd_ppc.inline.hpp" ++# include "orderAccess_bsd_ppc.inline.hpp" +#endif - static jint CurrentVersion = JNI_VERSION_1_6; + // System includes ---- ./hotspot/src/share/vm/prims/jvm.cpp 2011-11-17 21:38:30.000000000 -0800 -+++ ./hotspot/src/share/vm/prims/jvm.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -73,6 +73,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "jvm_windows.h" +--- hotspot/src/os/bsd/vm/thread_bsd.inline.hpp 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/src/os/bsd/vm/thread_bsd.inline.hpp 2012-05-17 15:05:32.000000000 -0700 +@@ -34,11 +34,26 @@ + # include "orderAccess_bsd_x86.inline.hpp" + # include "prefetch_bsd_x86.inline.hpp" #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "jvm_bsd.h" ++#ifdef TARGET_OS_ARCH_bsd_sparc ++# include "atomic_bsd_sparc.inline.hpp" ++# include "orderAccess_bsd_sparc.inline.hpp" ++# include "prefetch_bsd_sparc.inline.hpp" +#endif - - #include <errno.h> - ---- ./hotspot/src/share/vm/prims/jvm.h 2011-11-17 21:38:30.000000000 -0800 -+++ ./hotspot/src/share/vm/prims/jvm.h 2012-02-26 13:59:20.000000000 -0800 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "jvm_windows.h" + #ifdef TARGET_OS_ARCH_bsd_zero + # include "atomic_bsd_zero.inline.hpp" + # include "orderAccess_bsd_zero.inline.hpp" + # include "prefetch_bsd_zero.inline.hpp" #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "jvm_bsd.h" ++#ifdef TARGET_OS_ARCH_bsd_arm ++# include "atomic_bsd_arm.inline.hpp" ++# include "orderAccess_bsd_arm.inline.hpp" ++# include "prefetch_bsd_arm.inline.hpp" +#endif - - #ifndef _JAVASOFT_JVM_H_ - #define _JAVASOFT_JVM_H_ ---- ./hotspot/src/share/vm/prims/jvmtiEnv.cpp 2011-11-17 21:38:31.000000000 -0800 -+++ ./hotspot/src/share/vm/prims/jvmtiEnv.cpp 2012-02-26 13:59:20.000000000 -0800 -@@ -68,6 +68,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" ++#ifdef TARGET_OS_ARCH_bsd_ppc ++# include "atomic_bsd_ppc.inline.hpp" ++# include "orderAccess_bsd_ppc.inline.hpp" ++# include "prefetch_bsd_ppc.inline.hpp" +#endif + // Contains inlined functions for class Thread and ThreadLocalStorage +--- hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp 2012-05-17 16:05:49.000000000 -0700 +@@ -24,7 +24,7 @@ + */ ---- ./hotspot/src/share/vm/prims/jvmtiImpl.cpp 2011-11-17 21:38:33.000000000 -0800 -+++ ./hotspot/src/share/vm/prims/jvmtiImpl.cpp 2011-05-12 20:54:44.000000000 -0700 -@@ -54,6 +54,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // - // class JvmtiAgentThread ---- ./hotspot/src/share/vm/prims/nativeLookup.cpp 2011-11-17 21:38:35.000000000 -0800 -+++ ./hotspot/src/share/vm/prims/nativeLookup.cpp 2011-04-23 12:09:39.000000000 -0700 -@@ -49,6 +49,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" + #if defined(_ALLBSD_SOURCE) && !defined(__APPLE__) && !defined(__NetBSD__) +-#include <pthread.h> ++# include <pthread.h> + # include <pthread_np.h> /* For pthread_attr_get_np */ #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - static void mangle_name_on(outputStream* st, Symbol* name, int begin, int end) { ---- ./hotspot/src/share/vm/runtime/arguments.cpp 2011-11-17 21:38:36.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/arguments.cpp 2012-02-26 13:59:21.000000000 -0800 -@@ -46,6 +46,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" - #endif ---- ./hotspot/src/share/vm/runtime/atomic.cpp 2011-11-17 21:38:36.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/atomic.cpp 2012-03-03 22:22:18.000000000 -0800 -@@ -33,6 +33,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - #ifdef TARGET_OS_ARCH_linux_x86 - # include "atomic_linux_x86.inline.hpp" - #endif -@@ -51,6 +54,12 @@ +--- hotspot/src/share/vm/runtime/atomic.cpp 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/src/share/vm/runtime/atomic.cpp 2012-05-16 19:03:34.000000000 -0700 +@@ -54,6 +54,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "atomic_windows_x86.inline.hpp" #endif @@ -10725,277 +344,8 @@ #ifdef TARGET_OS_ARCH_linux_arm # include "atomic_linux_arm.inline.hpp" #endif ---- ./hotspot/src/share/vm/runtime/fprofiler.hpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/fprofiler.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // a simple flat profiler for Java - ---- ./hotspot/src/share/vm/runtime/globals.hpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/globals.hpp 2012-02-26 13:59:21.000000000 -0800 -@@ -50,6 +50,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "globals_windows.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "globals_bsd.hpp" -+#endif - #ifdef TARGET_OS_ARCH_linux_x86 - # include "globals_linux_x86.hpp" - #endif -@@ -74,6 +77,12 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "globals_linux_ppc.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "globals_bsd_x86.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "globals_bsd_zero.hpp" -+#endif - #ifdef COMPILER1 - #ifdef TARGET_ARCH_x86 - # include "c1_globals_x86.hpp" -@@ -96,6 +105,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "c1_globals_windows.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "c1_globals_bsd.hpp" -+#endif - #endif - #ifdef COMPILER2 - #ifdef TARGET_ARCH_x86 -@@ -116,6 +128,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "c2_globals_windows.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "c2_globals_bsd.hpp" -+#endif - #endif - #ifdef SHARK - #ifdef TARGET_ARCH_zero ---- ./hotspot/src/share/vm/runtime/handles.cpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/handles.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -38,6 +38,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - #ifdef ASSERT - oop* HandleArea::allocate_handle(oop obj) { ---- ./hotspot/src/share/vm/runtime/handles.inline.hpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/handles.inline.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // these inline functions are in a separate file to break an include cycle - // between Thread and Handle ---- ./hotspot/src/share/vm/runtime/interfaceSupport.hpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/interfaceSupport.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -44,6 +44,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // Wrapper for all entry points to the virtual machine. - // The HandleMarkCleaner is a faster version of HandleMark. -@@ -115,6 +118,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "interfaceSupport_windows.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "interfaceSupport_bsd.hpp" -+#endif - - }; - ---- ./hotspot/src/share/vm/runtime/java.cpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/java.cpp 2012-02-26 13:59:21.000000000 -0800 -@@ -85,6 +85,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" - #include "gc_implementation/parallelScavenge/psScavenge.hpp" ---- ./hotspot/src/share/vm/runtime/javaCalls.cpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/javaCalls.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -48,6 +48,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // ----------------------------------------------------- - // Implementation of JavaCallWrapper ---- ./hotspot/src/share/vm/runtime/javaCalls.hpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/javaCalls.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -54,6 +54,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. - // Its purpose is to allocate/deallocate a new handle block and to save/restore the last ---- ./hotspot/src/share/vm/runtime/javaFrameAnchor.hpp 2011-11-17 21:38:38.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/javaFrameAnchor.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -50,6 +50,13 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "orderAccess_linux_ppc.inline.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "orderAccess_bsd_x86.inline.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "orderAccess_bsd_zero.inline.hpp" -+#endif -+ - // - // An object for encapsulating the machine/os dependent part of a JavaThread frame state - // ---- ./hotspot/src/share/vm/runtime/jniHandles.cpp 2011-11-17 21:38:39.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/jniHandles.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - JNIHandleBlock* JNIHandles::_global_handles = NULL; ---- ./hotspot/src/share/vm/runtime/memprofiler.cpp 2011-11-17 21:38:39.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/memprofiler.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -46,6 +46,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - #ifndef PRODUCT - ---- ./hotspot/src/share/vm/runtime/mutex.cpp 2011-11-17 21:38:39.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/mutex.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -39,6 +39,10 @@ - # include "mutex_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "mutex_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - // o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o - // ---- ./hotspot/src/share/vm/runtime/mutexLocker.cpp 2011-11-17 21:38:39.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/mutexLocker.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -36,6 +36,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // Mutexes used in the VM (see comment in mutexLocker.hpp): - // ---- ./hotspot/src/share/vm/runtime/mutexLocker.hpp 2011-11-17 21:38:39.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/mutexLocker.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -36,6 +36,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - // Mutexes used in the VM. - ---- ./hotspot/src/share/vm/runtime/objectMonitor.cpp 2011-11-17 21:38:39.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/objectMonitor.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -50,6 +50,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - #if defined(__GNUC__) && !defined(IA64) - // Need to inhibit inlining for older versions of GCC to avoid build-time failures ---- ./hotspot/src/share/vm/runtime/os.cpp 2011-11-17 21:38:40.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/os.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -60,6 +60,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - # include <signal.h> - -@@ -116,7 +120,11 @@ - assert(false, "Failed localtime_pd"); - return NULL; - } -+#if defined(_ALLBSD_SOURCE) -+ const time_t zone = (time_t) time_struct.tm_gmtoff; -+#else - const time_t zone = timezone; -+#endif - - // If daylight savings time is in effect, - // we are 1 hour East of our time zone -@@ -384,6 +392,13 @@ - if (_native_java_library == NULL) { - vm_exit_during_initialization("Unable to load native library", ebuf); - } -+ -+#if defined(__OpenBSD__) -+ // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so -+ // ignore errors -+ dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "net"); -+ dll_load(buffer, ebuf, sizeof(ebuf)); -+#endif - } - static jboolean onLoaded = JNI_FALSE; - if (onLoaded) { ---- ./hotspot/src/share/vm/runtime/os.hpp 2011-11-17 21:38:40.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/os.hpp 2012-02-26 13:59:22.000000000 -0800 +--- hotspot/src/share/vm/runtime/os.hpp 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/src/share/vm/runtime/os.hpp 2012-05-16 19:03:34.000000000 -0700 @@ -30,6 +30,9 @@ #include "runtime/extendedPC.hpp" #include "runtime/handles.hpp" @@ -11006,3285 +356,8 @@ #ifdef TARGET_OS_FAMILY_linux # include "jvm_linux.h" #endif -@@ -39,6 +42,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "jvm_windows.h" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "jvm_bsd.h" -+#endif - - // os defines the interface to operating system; this includes traditional - // OS services (time, I/O) as well as other functionality with system- -@@ -675,6 +681,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.hpp" -+#endif - #ifdef TARGET_OS_ARCH_linux_x86 - # include "os_linux_x86.hpp" - #endif -@@ -699,6 +708,12 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "os_linux_ppc.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "os_bsd_x86.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "os_bsd_zero.hpp" -+#endif - - - // debugging support (mostly used by debug.cpp but also fatal error handler) ---- ./hotspot/src/share/vm/runtime/osThread.hpp 2011-11-17 21:38:40.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/osThread.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -109,6 +109,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "osThread_windows.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "osThread_bsd.hpp" -+#endif - - }; - ---- ./hotspot/src/share/vm/runtime/safepoint.cpp 2011-11-17 21:38:40.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/safepoint.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -78,6 +78,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" - #include "gc_implementation/shared/concurrentGCThread.hpp" ---- ./hotspot/src/share/vm/runtime/synchronizer.cpp 2011-11-17 21:38:42.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/synchronizer.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -51,6 +51,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - #if defined(__GNUC__) && !defined(IA64) - // Need to inhibit inlining for older versions of GCC to avoid build-time failures ---- ./hotspot/src/share/vm/runtime/task.cpp 2011-11-17 21:38:42.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/task.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -39,6 +39,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - int PeriodicTask::_num_tasks = 0; - PeriodicTask* PeriodicTask::_tasks[PeriodicTask::max_tasks]; ---- ./hotspot/src/share/vm/runtime/thread.cpp 2011-11-17 21:38:42.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/thread.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -89,6 +89,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" - #include "gc_implementation/g1/concurrentMarkThread.inline.hpp" ---- ./hotspot/src/share/vm/runtime/thread.hpp 2011-11-17 21:38:42.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/thread.hpp 2012-02-26 13:59:22.000000000 -0800 -@@ -1607,6 +1607,12 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "thread_linux_ppc.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "thread_bsd_x86.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "thread_bsd_zero.hpp" -+#endif - - - public: ---- ./hotspot/src/share/vm/runtime/threadLocalStorage.cpp 2011-11-17 21:38:42.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/threadLocalStorage.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -36,6 +36,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - // static member initialization - int ThreadLocalStorage::_thread_index = -1; ---- ./hotspot/src/share/vm/runtime/threadLocalStorage.hpp 2011-11-17 21:38:42.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/threadLocalStorage.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -68,6 +68,12 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "threadLS_linux_ppc.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "threadLS_bsd_x86.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "threadLS_bsd_zero.hpp" -+#endif - - - public: ---- ./hotspot/src/share/vm/runtime/timer.cpp 2011-11-17 21:38:42.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/timer.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - - void elapsedTimer::add(elapsedTimer t) { ---- ./hotspot/src/share/vm/runtime/virtualspace.cpp 2011-11-17 21:38:43.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/virtualspace.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - - // ReservedSpace ---- ./hotspot/src/share/vm/runtime/vmStructs.cpp 2011-11-17 21:38:43.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/vmStructs.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -133,6 +133,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifdef TARGET_OS_ARCH_linux_x86 - # include "vmStructs_linux_x86.hpp" - #endif -@@ -157,6 +160,12 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "vmStructs_linux_ppc.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "vmStructs_bsd_x86.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "vmStructs_bsd_zero.hpp" -+#endif - #ifndef SERIALGC - #include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp" - #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" ---- ./hotspot/src/share/vm/runtime/vmThread.cpp 2011-11-17 21:38:44.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/vmThread.cpp 2011-05-07 21:53:42.000000000 -0700 -@@ -46,6 +46,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - HS_DTRACE_PROBE_DECL3(hotspot, vmops__request, char *, uintptr_t, int); - HS_DTRACE_PROBE_DECL3(hotspot, vmops__begin, char *, uintptr_t, int); ---- ./hotspot/src/share/vm/runtime/vmThread.hpp 2011-11-17 21:38:44.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/vmThread.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -36,6 +36,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // - // Prioritized queue of VM operations. ---- ./hotspot/src/share/vm/runtime/vm_operations.cpp 2011-11-17 21:38:44.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/vm_operations.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -45,6 +45,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - #define VM_OP_NAME_INITIALIZE(name) #name, - ---- ./hotspot/src/share/vm/runtime/vm_version.cpp 2011-11-17 21:38:44.000000000 -0800 -+++ ./hotspot/src/share/vm/runtime/vm_version.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -167,7 +167,8 @@ - - #define OS LINUX_ONLY("linux") \ - WINDOWS_ONLY("windows") \ -- SOLARIS_ONLY("solaris") -+ SOLARIS_ONLY("solaris") \ -+ BSD_ONLY("bsd") - - #ifdef ZERO - #define CPU ZERO_LIBARCH ---- ./hotspot/src/share/vm/utilities/accessFlags.cpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/accessFlags.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -34,6 +34,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - - void AccessFlags::atomic_set_bits(jint bits) { ---- ./hotspot/src/share/vm/utilities/array.cpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/array.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -34,6 +34,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - #ifdef ASSERT ---- ./hotspot/src/share/vm/utilities/bitMap.cpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/bitMap.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - - BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) : ---- ./hotspot/src/share/vm/utilities/debug.cpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/debug.cpp 2011-05-12 20:54:45.000000000 -0700 -@@ -62,6 +62,10 @@ - # include "os_windows.inline.hpp" - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+# include "thread_bsd.inline.hpp" -+#endif - - #ifndef ASSERT - # ifdef _DEBUG ---- ./hotspot/src/share/vm/utilities/elf.hpp 1969-12-31 16:00:00.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/elf.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -0,0 +1,2605 @@ -+/* This file defines standard ELF types, structures, and macros. -+ Copyright (C) 1995-2003,2004,2005,2006 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 __ELF_HPP -+#define __ELF_HPP 1 -+ -+__BEGIN_DECLS -+ -+/* Standard ELF types. */ -+ -+#include <stdint.h> -+ -+/* Type for a 16-bit quantity. */ -+typedef uint16_t Elf32_Half; -+typedef uint16_t Elf64_Half; -+ -+/* Types for signed and unsigned 32-bit quantities. */ -+typedef uint32_t Elf32_Word; -+typedef int32_t Elf32_Sword; -+typedef uint32_t Elf64_Word; -+typedef int32_t Elf64_Sword; -+ -+/* Types for signed and unsigned 64-bit quantities. */ -+typedef uint64_t Elf32_Xword; -+typedef int64_t Elf32_Sxword; -+typedef uint64_t Elf64_Xword; -+typedef int64_t Elf64_Sxword; -+ -+/* Type of addresses. */ -+typedef uint32_t Elf32_Addr; -+typedef uint64_t Elf64_Addr; -+ -+/* Type of file offsets. */ -+typedef uint32_t Elf32_Off; -+typedef uint64_t Elf64_Off; -+ -+/* Type for section indices, which are 16-bit quantities. */ -+typedef uint16_t Elf32_Section; -+typedef uint16_t Elf64_Section; -+ -+/* Type for version symbol information. */ -+typedef Elf32_Half Elf32_Versym; -+typedef Elf64_Half Elf64_Versym; -+ -+ -+/* The ELF file header. This appears at the start of every ELF file. */ -+ -+#define EI_NIDENT (16) -+ -+typedef struct -+{ -+ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ -+ Elf32_Half e_type; /* Object file type */ -+ Elf32_Half e_machine; /* Architecture */ -+ Elf32_Word e_version; /* Object file version */ -+ Elf32_Addr e_entry; /* Entry point virtual address */ -+ Elf32_Off e_phoff; /* Program header table file offset */ -+ Elf32_Off e_shoff; /* Section header table file offset */ -+ Elf32_Word e_flags; /* Processor-specific flags */ -+ Elf32_Half e_ehsize; /* ELF header size in bytes */ -+ Elf32_Half e_phentsize; /* Program header table entry size */ -+ Elf32_Half e_phnum; /* Program header table entry count */ -+ Elf32_Half e_shentsize; /* Section header table entry size */ -+ Elf32_Half e_shnum; /* Section header table entry count */ -+ Elf32_Half e_shstrndx; /* Section header string table index */ -+} Elf32_Ehdr; -+ -+typedef struct -+{ -+ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ -+ Elf64_Half e_type; /* Object file type */ -+ Elf64_Half e_machine; /* Architecture */ -+ Elf64_Word e_version; /* Object file version */ -+ Elf64_Addr e_entry; /* Entry point virtual address */ -+ Elf64_Off e_phoff; /* Program header table file offset */ -+ Elf64_Off e_shoff; /* Section header table file offset */ -+ Elf64_Word e_flags; /* Processor-specific flags */ -+ Elf64_Half e_ehsize; /* ELF header size in bytes */ -+ Elf64_Half e_phentsize; /* Program header table entry size */ -+ Elf64_Half e_phnum; /* Program header table entry count */ -+ Elf64_Half e_shentsize; /* Section header table entry size */ -+ Elf64_Half e_shnum; /* Section header table entry count */ -+ Elf64_Half e_shstrndx; /* Section header string table index */ -+} Elf64_Ehdr; -+ -+/* Fields in the e_ident array. The EI_* macros are indices into the -+ array. The macros under each EI_* macro are the values the byte -+ may have. */ -+ -+#define EI_MAG0 0 /* File identification byte 0 index */ -+#define ELFMAG0 0x7f /* Magic number byte 0 */ -+ -+#define EI_MAG1 1 /* File identification byte 1 index */ -+#define ELFMAG1 'E' /* Magic number byte 1 */ -+ -+#define EI_MAG2 2 /* File identification byte 2 index */ -+#define ELFMAG2 'L' /* Magic number byte 2 */ -+ -+#define EI_MAG3 3 /* File identification byte 3 index */ -+#define ELFMAG3 'F' /* Magic number byte 3 */ -+ -+/* Conglomeration of the identification bytes, for easy testing as a word. */ -+#define ELFMAG "\177ELF" -+#define SELFMAG 4 -+ -+#define EI_CLASS 4 /* File class byte index */ -+#define ELFCLASSNONE 0 /* Invalid class */ -+#define ELFCLASS32 1 /* 32-bit objects */ -+#define ELFCLASS64 2 /* 64-bit objects */ -+#define ELFCLASSNUM 3 -+ -+#define EI_DATA 5 /* Data encoding byte index */ -+#define ELFDATANONE 0 /* Invalid data encoding */ -+#define ELFDATA2LSB 1 /* 2's complement, little endian */ -+#define ELFDATA2MSB 2 /* 2's complement, big endian */ -+#define ELFDATANUM 3 -+ -+#define EI_VERSION 6 /* File version byte index */ -+ /* Value must be EV_CURRENT */ -+ -+#define EI_OSABI 7 /* OS ABI identification */ -+#define ELFOSABI_NONE 0 /* UNIX System V ABI */ -+#define ELFOSABI_SYSV 0 /* Alias. */ -+#define ELFOSABI_HPUX 1 /* HP-UX */ -+#define ELFOSABI_NETBSD 2 /* NetBSD. */ -+#define ELFOSABI_LINUX 3 /* Linux. */ -+#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */ -+#define ELFOSABI_AIX 7 /* IBM AIX. */ -+#define ELFOSABI_IRIX 8 /* SGI Irix. */ -+#define ELFOSABI_FREEBSD 9 /* FreeBSD. */ -+#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */ -+#define ELFOSABI_MODESTO 11 /* Novell Modesto. */ -+#define ELFOSABI_OPENBSD 12 /* OpenBSD. */ -+#define ELFOSABI_ARM 97 /* ARM */ -+#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ -+ -+#define EI_ABIVERSION 8 /* ABI version */ -+ -+#define EI_PAD 9 /* Byte index of padding bytes */ -+ -+/* Legal values for e_type (object file type). */ -+ -+#define ET_NONE 0 /* No file type */ -+#define ET_REL 1 /* Relocatable file */ -+#define ET_EXEC 2 /* Executable file */ -+#define ET_DYN 3 /* Shared object file */ -+#define ET_CORE 4 /* Core file */ -+#define ET_NUM 5 /* Number of defined types */ -+#define ET_LOOS 0xfe00 /* OS-specific range start */ -+#define ET_HIOS 0xfeff /* OS-specific range end */ -+#define ET_LOPROC 0xff00 /* Processor-specific range start */ -+#define ET_HIPROC 0xffff /* Processor-specific range end */ -+ -+/* Legal values for e_machine (architecture). */ -+ -+#define EM_NONE 0 /* No machine */ -+#define EM_M32 1 /* AT&T WE 32100 */ -+#define EM_SPARC 2 /* SUN SPARC */ -+#define EM_386 3 /* Intel 80386 */ -+#define EM_68K 4 /* Motorola m68k family */ -+#define EM_88K 5 /* Motorola m88k family */ -+#define EM_860 7 /* Intel 80860 */ -+#define EM_MIPS 8 /* MIPS R3000 big-endian */ -+#define EM_S370 9 /* IBM System/370 */ -+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ -+ -+#define EM_PARISC 15 /* HPPA */ -+#define EM_VPP500 17 /* Fujitsu VPP500 */ -+#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ -+#define EM_960 19 /* Intel 80960 */ -+#define EM_PPC 20 /* PowerPC */ -+#define EM_PPC64 21 /* PowerPC 64-bit */ -+#define EM_S390 22 /* IBM S390 */ -+ -+#define EM_V800 36 /* NEC V800 series */ -+#define EM_FR20 37 /* Fujitsu FR20 */ -+#define EM_RH32 38 /* TRW RH-32 */ -+#define EM_RCE 39 /* Motorola RCE */ -+#define EM_ARM 40 /* ARM */ -+#define EM_FAKE_ALPHA 41 /* Digital Alpha */ -+#define EM_SH 42 /* Hitachi SH */ -+#define EM_SPARCV9 43 /* SPARC v9 64-bit */ -+#define EM_TRICORE 44 /* Siemens Tricore */ -+#define EM_ARC 45 /* Argonaut RISC Core */ -+#define EM_H8_300 46 /* Hitachi H8/300 */ -+#define EM_H8_300H 47 /* Hitachi H8/300H */ -+#define EM_H8S 48 /* Hitachi H8S */ -+#define EM_H8_500 49 /* Hitachi H8/500 */ -+#define EM_IA_64 50 /* Intel Merced */ -+#define EM_MIPS_X 51 /* Stanford MIPS-X */ -+#define EM_COLDFIRE 52 /* Motorola Coldfire */ -+#define EM_68HC12 53 /* Motorola M68HC12 */ -+#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ -+#define EM_PCP 55 /* Siemens PCP */ -+#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ -+#define EM_NDR1 57 /* Denso NDR1 microprocessor */ -+#define EM_STARCORE 58 /* Motorola Start*Core processor */ -+#define EM_ME16 59 /* Toyota ME16 processor */ -+#define EM_ST100 60 /* STMicroelectronic ST100 processor */ -+#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ -+#define EM_X86_64 62 /* AMD x86-64 architecture */ -+#define EM_PDSP 63 /* Sony DSP Processor */ -+ -+#define EM_FX66 66 /* Siemens FX66 microcontroller */ -+#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ -+#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ -+#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ -+#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ -+#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ -+#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ -+#define EM_SVX 73 /* Silicon Graphics SVx */ -+#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */ -+#define EM_VAX 75 /* Digital VAX */ -+#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ -+#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */ -+#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ -+#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ -+#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ -+#define EM_HUANY 81 /* Harvard University machine-independent object files */ -+#define EM_PRISM 82 /* SiTera Prism */ -+#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ -+#define EM_FR30 84 /* Fujitsu FR30 */ -+#define EM_D10V 85 /* Mitsubishi D10V */ -+#define EM_D30V 86 /* Mitsubishi D30V */ -+#define EM_V850 87 /* NEC v850 */ -+#define EM_M32R 88 /* Mitsubishi M32R */ -+#define EM_MN10300 89 /* Matsushita MN10300 */ -+#define EM_MN10200 90 /* Matsushita MN10200 */ -+#define EM_PJ 91 /* picoJava */ -+#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ -+#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ -+#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ -+#define EM_NUM 95 -+ -+/* If it is necessary to assign new unofficial EM_* values, please -+ pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the -+ chances of collision with official or non-GNU unofficial values. */ -+ -+#define EM_ALPHA 0x9026 -+ -+/* Legal values for e_version (version). */ -+ -+#define EV_NONE 0 /* Invalid ELF version */ -+#define EV_CURRENT 1 /* Current version */ -+#define EV_NUM 2 -+ -+/* Section header. */ -+ -+typedef struct -+{ -+ Elf32_Word sh_name; /* Section name (string tbl index) */ -+ Elf32_Word sh_type; /* Section type */ -+ Elf32_Word sh_flags; /* Section flags */ -+ Elf32_Addr sh_addr; /* Section virtual addr at execution */ -+ Elf32_Off sh_offset; /* Section file offset */ -+ Elf32_Word sh_size; /* Section size in bytes */ -+ Elf32_Word sh_link; /* Link to another section */ -+ Elf32_Word sh_info; /* Additional section information */ -+ Elf32_Word sh_addralign; /* Section alignment */ -+ Elf32_Word sh_entsize; /* Entry size if section holds table */ -+} Elf32_Shdr; -+ -+typedef struct -+{ -+ Elf64_Word sh_name; /* Section name (string tbl index) */ -+ Elf64_Word sh_type; /* Section type */ -+ Elf64_Xword sh_flags; /* Section flags */ -+ Elf64_Addr sh_addr; /* Section virtual addr at execution */ -+ Elf64_Off sh_offset; /* Section file offset */ -+ Elf64_Xword sh_size; /* Section size in bytes */ -+ Elf64_Word sh_link; /* Link to another section */ -+ Elf64_Word sh_info; /* Additional section information */ -+ Elf64_Xword sh_addralign; /* Section alignment */ -+ Elf64_Xword sh_entsize; /* Entry size if section holds table */ -+} Elf64_Shdr; -+ -+/* Special section indices. */ -+ -+#define SHN_UNDEF 0 /* Undefined section */ -+#define SHN_LORESERVE 0xff00 /* Start of reserved indices */ -+#define SHN_LOPROC 0xff00 /* Start of processor-specific */ -+#define SHN_BEFORE 0xff00 /* Order section before all others -+ (Solaris). */ -+#define SHN_AFTER 0xff01 /* Order section after all others -+ (Solaris). */ -+#define SHN_HIPROC 0xff1f /* End of processor-specific */ -+#define SHN_LOOS 0xff20 /* Start of OS-specific */ -+#define SHN_HIOS 0xff3f /* End of OS-specific */ -+#define SHN_ABS 0xfff1 /* Associated symbol is absolute */ -+#define SHN_COMMON 0xfff2 /* Associated symbol is common */ -+#define SHN_XINDEX 0xffff /* Index is in extra table. */ -+#define SHN_HIRESERVE 0xffff /* End of reserved indices */ -+ -+/* Legal values for sh_type (section type). */ -+ -+#define SHT_NULL 0 /* Section header table entry unused */ -+#define SHT_PROGBITS 1 /* Program data */ -+#define SHT_SYMTAB 2 /* Symbol table */ -+#define SHT_STRTAB 3 /* String table */ -+#define SHT_RELA 4 /* Relocation entries with addends */ -+#define SHT_HASH 5 /* Symbol hash table */ -+#define SHT_DYNAMIC 6 /* Dynamic linking information */ -+#define SHT_NOTE 7 /* Notes */ -+#define SHT_NOBITS 8 /* Program space with no data (bss) */ -+#define SHT_REL 9 /* Relocation entries, no addends */ -+#define SHT_SHLIB 10 /* Reserved */ -+#define SHT_DYNSYM 11 /* Dynamic linker symbol table */ -+#define SHT_INIT_ARRAY 14 /* Array of constructors */ -+#define SHT_FINI_ARRAY 15 /* Array of destructors */ -+#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ -+#define SHT_GROUP 17 /* Section group */ -+#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ -+#define SHT_NUM 19 /* Number of defined types. */ -+#define SHT_LOOS 0x60000000 /* Start OS-specific. */ -+#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ -+#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */ -+#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */ -+#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */ -+#define SHT_SUNW_move 0x6ffffffa -+#define SHT_SUNW_COMDAT 0x6ffffffb -+#define SHT_SUNW_syminfo 0x6ffffffc -+#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */ -+#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */ -+#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */ -+#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */ -+#define SHT_HIOS 0x6fffffff /* End OS-specific type */ -+#define SHT_LOPROC 0x70000000 /* Start of processor-specific */ -+#define SHT_HIPROC 0x7fffffff /* End of processor-specific */ -+#define SHT_LOUSER 0x80000000 /* Start of application-specific */ -+#define SHT_HIUSER 0x8fffffff /* End of application-specific */ -+ -+/* Legal values for sh_flags (section flags). */ -+ -+#define SHF_WRITE (1 << 0) /* Writable */ -+#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */ -+#define SHF_EXECINSTR (1 << 2) /* Executable */ -+#define SHF_MERGE (1 << 4) /* Might be merged */ -+#define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */ -+#define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */ -+#define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */ -+#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling -+ required */ -+#define SHF_GROUP (1 << 9) /* Section is member of a group. */ -+#define SHF_TLS (1 << 10) /* Section hold thread-local data. */ -+#define SHF_MASKOS 0x0ff00000 /* OS-specific. */ -+#define SHF_MASKPROC 0xf0000000 /* Processor-specific */ -+#define SHF_ORDERED (1 << 30) /* Special ordering requirement -+ (Solaris). */ -+#define SHF_EXCLUDE (1 << 31) /* Section is excluded unless -+ referenced or allocated (Solaris).*/ -+ -+/* Section group handling. */ -+#define GRP_COMDAT 0x1 /* Mark group as COMDAT. */ -+ -+/* Symbol table entry. */ -+ -+typedef struct -+{ -+ Elf32_Word st_name; /* Symbol name (string tbl index) */ -+ Elf32_Addr st_value; /* Symbol value */ -+ Elf32_Word st_size; /* Symbol size */ -+ unsigned char st_info; /* Symbol type and binding */ -+ unsigned char st_other; /* Symbol visibility */ -+ Elf32_Section st_shndx; /* Section index */ -+} Elf32_Sym; -+ -+typedef struct -+{ -+ Elf64_Word st_name; /* Symbol name (string tbl index) */ -+ unsigned char st_info; /* Symbol type and binding */ -+ unsigned char st_other; /* Symbol visibility */ -+ Elf64_Section st_shndx; /* Section index */ -+ Elf64_Addr st_value; /* Symbol value */ -+ Elf64_Xword st_size; /* Symbol size */ -+} Elf64_Sym; -+ -+/* The syminfo section if available contains additional information about -+ every dynamic symbol. */ -+ -+typedef struct -+{ -+ Elf32_Half si_boundto; /* Direct bindings, symbol bound to */ -+ Elf32_Half si_flags; /* Per symbol flags */ -+} Elf32_Syminfo; -+ -+typedef struct -+{ -+ Elf64_Half si_boundto; /* Direct bindings, symbol bound to */ -+ Elf64_Half si_flags; /* Per symbol flags */ -+} Elf64_Syminfo; -+ -+/* Possible values for si_boundto. */ -+#define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */ -+#define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */ -+#define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */ -+ -+/* Possible bitmasks for si_flags. */ -+#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */ -+#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */ -+#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */ -+#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy -+ loaded */ -+/* Syminfo version values. */ -+#define SYMINFO_NONE 0 -+#define SYMINFO_CURRENT 1 -+#define SYMINFO_NUM 2 -+ -+ -+/* How to extract and insert information held in the st_info field. */ -+ -+#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) -+#define ELF32_ST_TYPE(val) ((val) & 0xf) -+#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) -+ -+/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */ -+#define ELF64_ST_BIND(val) ELF32_ST_BIND (val) -+#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) -+#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type)) -+ -+/* Legal values for ST_BIND subfield of st_info (symbol binding). */ -+ -+#define STB_LOCAL 0 /* Local symbol */ -+#define STB_GLOBAL 1 /* Global symbol */ -+#define STB_WEAK 2 /* Weak symbol */ -+#define STB_NUM 3 /* Number of defined types. */ -+#define STB_LOOS 10 /* Start of OS-specific */ -+#define STB_HIOS 12 /* End of OS-specific */ -+#define STB_LOPROC 13 /* Start of processor-specific */ -+#define STB_HIPROC 15 /* End of processor-specific */ -+ -+/* Legal values for ST_TYPE subfield of st_info (symbol type). */ -+ -+#define STT_NOTYPE 0 /* Symbol type is unspecified */ -+#define STT_OBJECT 1 /* Symbol is a data object */ -+#define STT_FUNC 2 /* Symbol is a code object */ -+#define STT_SECTION 3 /* Symbol associated with a section */ -+#define STT_FILE 4 /* Symbol's name is file name */ -+#define STT_COMMON 5 /* Symbol is a common data object */ -+#define STT_TLS 6 /* Symbol is thread-local data object*/ -+#define STT_NUM 7 /* Number of defined types. */ -+#define STT_LOOS 10 /* Start of OS-specific */ -+#define STT_HIOS 12 /* End of OS-specific */ -+#define STT_LOPROC 13 /* Start of processor-specific */ -+#define STT_HIPROC 15 /* End of processor-specific */ -+ -+ -+/* Symbol table indices are found in the hash buckets and chain table -+ of a symbol hash table section. This special index value indicates -+ the end of a chain, meaning no further symbols are found in that bucket. */ -+ -+#define STN_UNDEF 0 /* End of a chain. */ -+ -+ -+/* How to extract and insert information held in the st_other field. */ -+ -+#define ELF32_ST_VISIBILITY(o) ((o) & 0x03) -+ -+/* For ELF64 the definitions are the same. */ -+#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o) -+ -+/* Symbol visibility specification encoded in the st_other field. */ -+#define STV_DEFAULT 0 /* Default symbol visibility rules */ -+#define STV_INTERNAL 1 /* Processor specific hidden class */ -+#define STV_HIDDEN 2 /* Sym unavailable in other modules */ -+#define STV_PROTECTED 3 /* Not preemptible, not exported */ -+ -+ -+/* Relocation table entry without addend (in section of type SHT_REL). */ -+ -+typedef struct -+{ -+ Elf32_Addr r_offset; /* Address */ -+ Elf32_Word r_info; /* Relocation type and symbol index */ -+} Elf32_Rel; -+ -+/* I have seen two different definitions of the Elf64_Rel and -+ Elf64_Rela structures, so we'll leave them out until Novell (or -+ whoever) gets their act together. */ -+/* The following, at least, is used on Sparc v9, MIPS, and Alpha. */ -+ -+typedef struct -+{ -+ Elf64_Addr r_offset; /* Address */ -+ Elf64_Xword r_info; /* Relocation type and symbol index */ -+} Elf64_Rel; -+ -+/* Relocation table entry with addend (in section of type SHT_RELA). */ -+ -+typedef struct -+{ -+ Elf32_Addr r_offset; /* Address */ -+ Elf32_Word r_info; /* Relocation type and symbol index */ -+ Elf32_Sword r_addend; /* Addend */ -+} Elf32_Rela; -+ -+typedef struct -+{ -+ Elf64_Addr r_offset; /* Address */ -+ Elf64_Xword r_info; /* Relocation type and symbol index */ -+ Elf64_Sxword r_addend; /* Addend */ -+} Elf64_Rela; -+ -+/* How to extract and insert information held in the r_info field. */ -+ -+#define ELF32_R_SYM(val) ((val) >> 8) -+#define ELF32_R_TYPE(val) ((val) & 0xff) -+#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff)) -+ -+#define ELF64_R_SYM(i) ((i) >> 32) -+#define ELF64_R_TYPE(i) ((i) & 0xffffffff) -+#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type)) -+ -+/* Program segment header. */ -+ -+typedef struct -+{ -+ Elf32_Word p_type; /* Segment type */ -+ Elf32_Off p_offset; /* Segment file offset */ -+ Elf32_Addr p_vaddr; /* Segment virtual address */ -+ Elf32_Addr p_paddr; /* Segment physical address */ -+ Elf32_Word p_filesz; /* Segment size in file */ -+ Elf32_Word p_memsz; /* Segment size in memory */ -+ Elf32_Word p_flags; /* Segment flags */ -+ Elf32_Word p_align; /* Segment alignment */ -+} Elf32_Phdr; -+ -+typedef struct -+{ -+ Elf64_Word p_type; /* Segment type */ -+ Elf64_Word p_flags; /* Segment flags */ -+ Elf64_Off p_offset; /* Segment file offset */ -+ Elf64_Addr p_vaddr; /* Segment virtual address */ -+ Elf64_Addr p_paddr; /* Segment physical address */ -+ Elf64_Xword p_filesz; /* Segment size in file */ -+ Elf64_Xword p_memsz; /* Segment size in memory */ -+ Elf64_Xword p_align; /* Segment alignment */ -+} Elf64_Phdr; -+ -+/* Legal values for p_type (segment type). */ -+ -+#define PT_NULL 0 /* Program header table entry unused */ -+#define PT_LOAD 1 /* Loadable program segment */ -+#define PT_DYNAMIC 2 /* Dynamic linking information */ -+#define PT_INTERP 3 /* Program interpreter */ -+#define PT_NOTE 4 /* Auxiliary information */ -+#define PT_SHLIB 5 /* Reserved */ -+#define PT_PHDR 6 /* Entry for header table itself */ -+#define PT_TLS 7 /* Thread-local storage segment */ -+#define PT_NUM 8 /* Number of defined types */ -+#define PT_LOOS 0x60000000 /* Start of OS-specific */ -+#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ -+#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ -+#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ -+#define PT_LOSUNW 0x6ffffffa -+#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ -+#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ -+#define PT_HISUNW 0x6fffffff -+#define PT_HIOS 0x6fffffff /* End of OS-specific */ -+#define PT_LOPROC 0x70000000 /* Start of processor-specific */ -+#define PT_HIPROC 0x7fffffff /* End of processor-specific */ -+ -+/* Legal values for p_flags (segment flags). */ -+ -+#define PF_X (1 << 0) /* Segment is executable */ -+#define PF_W (1 << 1) /* Segment is writable */ -+#define PF_R (1 << 2) /* Segment is readable */ -+#define PF_MASKOS 0x0ff00000 /* OS-specific */ -+#define PF_MASKPROC 0xf0000000 /* Processor-specific */ -+ -+/* Legal values for note segment descriptor types for core files. */ -+ -+#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */ -+#define NT_FPREGSET 2 /* Contains copy of fpregset struct */ -+#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ -+#define NT_PRXREG 4 /* Contains copy of prxregset struct */ -+#define NT_TASKSTRUCT 4 /* Contains copy of task structure */ -+#define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */ -+#define NT_AUXV 6 /* Contains copy of auxv array */ -+#define NT_GWINDOWS 7 /* Contains copy of gwindows struct */ -+#define NT_ASRS 8 /* Contains copy of asrset struct */ -+#define NT_PSTATUS 10 /* Contains copy of pstatus struct */ -+#define NT_PSINFO 13 /* Contains copy of psinfo struct */ -+#define NT_PRCRED 14 /* Contains copy of prcred struct */ -+#define NT_UTSNAME 15 /* Contains copy of utsname struct */ -+#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */ -+#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */ -+#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct*/ -+ -+/* Legal values for the note segment descriptor types for object files. */ -+ -+#define NT_VERSION 1 /* Contains a version string. */ -+ -+ -+/* Dynamic section entry. */ -+ -+typedef struct -+{ -+ Elf32_Sword d_tag; /* Dynamic entry type */ -+ union -+ { -+ Elf32_Word d_val; /* Integer value */ -+ Elf32_Addr d_ptr; /* Address value */ -+ } d_un; -+} Elf32_Dyn; -+ -+typedef struct -+{ -+ Elf64_Sxword d_tag; /* Dynamic entry type */ -+ union -+ { -+ Elf64_Xword d_val; /* Integer value */ -+ Elf64_Addr d_ptr; /* Address value */ -+ } d_un; -+} Elf64_Dyn; -+ -+/* Legal values for d_tag (dynamic entry type). */ -+ -+#define DT_NULL 0 /* Marks end of dynamic section */ -+#define DT_NEEDED 1 /* Name of needed library */ -+#define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */ -+#define DT_PLTGOT 3 /* Processor defined value */ -+#define DT_HASH 4 /* Address of symbol hash table */ -+#define DT_STRTAB 5 /* Address of string table */ -+#define DT_SYMTAB 6 /* Address of symbol table */ -+#define DT_RELA 7 /* Address of Rela relocs */ -+#define DT_RELASZ 8 /* Total size of Rela relocs */ -+#define DT_RELAENT 9 /* Size of one Rela reloc */ -+#define DT_STRSZ 10 /* Size of string table */ -+#define DT_SYMENT 11 /* Size of one symbol table entry */ -+#define DT_INIT 12 /* Address of init function */ -+#define DT_FINI 13 /* Address of termination function */ -+#define DT_SONAME 14 /* Name of shared object */ -+#define DT_RPATH 15 /* Library search path (deprecated) */ -+#define DT_SYMBOLIC 16 /* Start symbol search here */ -+#define DT_REL 17 /* Address of Rel relocs */ -+#define DT_RELSZ 18 /* Total size of Rel relocs */ -+#define DT_RELENT 19 /* Size of one Rel reloc */ -+#define DT_PLTREL 20 /* Type of reloc in PLT */ -+#define DT_DEBUG 21 /* For debugging; unspecified */ -+#define DT_TEXTREL 22 /* Reloc might modify .text */ -+#define DT_JMPREL 23 /* Address of PLT relocs */ -+#define DT_BIND_NOW 24 /* Process relocations of object */ -+#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */ -+#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */ -+#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */ -+#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */ -+#define DT_RUNPATH 29 /* Library search path */ -+#define DT_FLAGS 30 /* Flags for the object being loaded */ -+#define DT_ENCODING 32 /* Start of encoded range */ -+#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ -+#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ -+#define DT_NUM 34 /* Number used */ -+#define DT_LOOS 0x6000000d /* Start of OS-specific */ -+#define DT_HIOS 0x6ffff000 /* End of OS-specific */ -+#define DT_LOPROC 0x70000000 /* Start of processor-specific */ -+#define DT_HIPROC 0x7fffffff /* End of processor-specific */ -+#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */ -+ -+/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the -+ Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's -+ approach. */ -+#define DT_VALRNGLO 0x6ffffd00 -+#define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */ -+#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */ -+#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */ -+#define DT_CHECKSUM 0x6ffffdf8 -+#define DT_PLTPADSZ 0x6ffffdf9 -+#define DT_MOVEENT 0x6ffffdfa -+#define DT_MOVESZ 0x6ffffdfb -+#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */ -+#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting -+ the following DT_* entry. */ -+#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */ -+#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */ -+#define DT_VALRNGHI 0x6ffffdff -+#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */ -+#define DT_VALNUM 12 -+ -+/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the -+ Dyn.d_un.d_ptr field of the Elf*_Dyn structure. -+ -+ If any adjustment is made to the ELF object after it has been -+ built these entries will need to be adjusted. */ -+#define DT_ADDRRNGLO 0x6ffffe00 -+#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */ -+#define DT_TLSDESC_PLT 0x6ffffef6 -+#define DT_TLSDESC_GOT 0x6ffffef7 -+#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */ -+#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */ -+#define DT_CONFIG 0x6ffffefa /* Configuration information. */ -+#define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */ -+#define DT_AUDIT 0x6ffffefc /* Object auditing. */ -+#define DT_PLTPAD 0x6ffffefd /* PLT padding. */ -+#define DT_MOVETAB 0x6ffffefe /* Move table. */ -+#define DT_SYMINFO 0x6ffffeff /* Syminfo table. */ -+#define DT_ADDRRNGHI 0x6ffffeff -+#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */ -+#define DT_ADDRNUM 11 -+ -+/* The versioning entry types. The next are defined as part of the -+ GNU extension. */ -+#define DT_VERSYM 0x6ffffff0 -+ -+#define DT_RELACOUNT 0x6ffffff9 -+#define DT_RELCOUNT 0x6ffffffa -+ -+/* These were chosen by Sun. */ -+#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */ -+#define DT_VERDEF 0x6ffffffc /* Address of version definition -+ table */ -+#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */ -+#define DT_VERNEED 0x6ffffffe /* Address of table with needed -+ versions */ -+#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */ -+#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ -+#define DT_VERSIONTAGNUM 16 -+ -+/* Sun added these machine-independent extensions in the "processor-specific" -+ range. Be compatible. */ -+#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */ -+#define DT_FILTER 0x7fffffff /* Shared object to get values from */ -+#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1) -+#define DT_EXTRANUM 3 -+ -+/* Values of `d_un.d_val' in the DT_FLAGS entry. */ -+#define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */ -+#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */ -+#define DF_TEXTREL 0x00000004 /* Object contains text relocations */ -+#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */ -+#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */ -+ -+/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 -+ entry in the dynamic section. */ -+#define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */ -+#define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */ -+#define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */ -+#define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/ -+#define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/ -+#define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/ -+#define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */ -+#define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */ -+#define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */ -+#define DF_1_TRANS 0x00000200 -+#define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */ -+#define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */ -+#define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */ -+#define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/ -+#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */ -+#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */ -+#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */ -+ -+/* Flags for the feature selection in DT_FEATURE_1. */ -+#define DTF_1_PARINIT 0x00000001 -+#define DTF_1_CONFEXP 0x00000002 -+ -+/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */ -+#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */ -+#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not -+ generally available. */ -+ -+/* Version definition sections. */ -+ -+typedef struct -+{ -+ Elf32_Half vd_version; /* Version revision */ -+ Elf32_Half vd_flags; /* Version information */ -+ Elf32_Half vd_ndx; /* Version Index */ -+ Elf32_Half vd_cnt; /* Number of associated aux entries */ -+ Elf32_Word vd_hash; /* Version name hash value */ -+ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */ -+ Elf32_Word vd_next; /* Offset in bytes to next verdef -+ entry */ -+} Elf32_Verdef; -+ -+typedef struct -+{ -+ Elf64_Half vd_version; /* Version revision */ -+ Elf64_Half vd_flags; /* Version information */ -+ Elf64_Half vd_ndx; /* Version Index */ -+ Elf64_Half vd_cnt; /* Number of associated aux entries */ -+ Elf64_Word vd_hash; /* Version name hash value */ -+ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */ -+ Elf64_Word vd_next; /* Offset in bytes to next verdef -+ entry */ -+} Elf64_Verdef; -+ -+ -+/* Legal values for vd_version (version revision). */ -+#define VER_DEF_NONE 0 /* No version */ -+#define VER_DEF_CURRENT 1 /* Current version */ -+#define VER_DEF_NUM 2 /* Given version number */ -+ -+/* Legal values for vd_flags (version information flags). */ -+#define VER_FLG_BASE 0x1 /* Version definition of file itself */ -+#define VER_FLG_WEAK 0x2 /* Weak version identifier */ -+ -+/* Versym symbol index values. */ -+#define VER_NDX_LOCAL 0 /* Symbol is local. */ -+#define VER_NDX_GLOBAL 1 /* Symbol is global. */ -+#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */ -+#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */ -+ -+/* Auxialiary version information. */ -+ -+typedef struct -+{ -+ Elf32_Word vda_name; /* Version or dependency names */ -+ Elf32_Word vda_next; /* Offset in bytes to next verdaux -+ entry */ -+} Elf32_Verdaux; -+ -+typedef struct -+{ -+ Elf64_Word vda_name; /* Version or dependency names */ -+ Elf64_Word vda_next; /* Offset in bytes to next verdaux -+ entry */ -+} Elf64_Verdaux; -+ -+ -+/* Version dependency section. */ -+ -+typedef struct -+{ -+ Elf32_Half vn_version; /* Version of structure */ -+ Elf32_Half vn_cnt; /* Number of associated aux entries */ -+ Elf32_Word vn_file; /* Offset of filename for this -+ dependency */ -+ Elf32_Word vn_aux; /* Offset in bytes to vernaux array */ -+ Elf32_Word vn_next; /* Offset in bytes to next verneed -+ entry */ -+} Elf32_Verneed; -+ -+typedef struct -+{ -+ Elf64_Half vn_version; /* Version of structure */ -+ Elf64_Half vn_cnt; /* Number of associated aux entries */ -+ Elf64_Word vn_file; /* Offset of filename for this -+ dependency */ -+ Elf64_Word vn_aux; /* Offset in bytes to vernaux array */ -+ Elf64_Word vn_next; /* Offset in bytes to next verneed -+ entry */ -+} Elf64_Verneed; -+ -+ -+/* Legal values for vn_version (version revision). */ -+#define VER_NEED_NONE 0 /* No version */ -+#define VER_NEED_CURRENT 1 /* Current version */ -+#define VER_NEED_NUM 2 /* Given version number */ -+ -+/* Auxiliary needed version information. */ -+ -+typedef struct -+{ -+ Elf32_Word vna_hash; /* Hash value of dependency name */ -+ Elf32_Half vna_flags; /* Dependency specific information */ -+ Elf32_Half vna_other; /* Unused */ -+ Elf32_Word vna_name; /* Dependency name string offset */ -+ Elf32_Word vna_next; /* Offset in bytes to next vernaux -+ entry */ -+} Elf32_Vernaux; -+ -+typedef struct -+{ -+ Elf64_Word vna_hash; /* Hash value of dependency name */ -+ Elf64_Half vna_flags; /* Dependency specific information */ -+ Elf64_Half vna_other; /* Unused */ -+ Elf64_Word vna_name; /* Dependency name string offset */ -+ Elf64_Word vna_next; /* Offset in bytes to next vernaux -+ entry */ -+} Elf64_Vernaux; -+ -+ -+/* Legal values for vna_flags. */ -+#define VER_FLG_WEAK 0x2 /* Weak version identifier */ -+ -+ -+/* Auxiliary vector. */ -+ -+/* This vector is normally only used by the program interpreter. The -+ usual definition in an ABI supplement uses the name auxv_t. The -+ vector is not usually defined in a standard <elf.h> file, but it -+ can't hurt. We rename it to avoid conflicts. The sizes of these -+ types are an arrangement between the exec server and the program -+ interpreter, so we don't fully specify them here. */ -+ -+typedef struct -+{ -+ uint32_t a_type; /* Entry type */ -+ union -+ { -+ uint32_t a_val; /* Integer value */ -+ /* We use to have pointer elements added here. We cannot do that, -+ though, since it does not work when using 32-bit definitions -+ on 64-bit platforms and vice versa. */ -+ } a_un; -+} Elf32_auxv_t; -+ -+typedef struct -+{ -+ uint64_t a_type; /* Entry type */ -+ union -+ { -+ uint64_t a_val; /* Integer value */ -+ /* We use to have pointer elements added here. We cannot do that, -+ though, since it does not work when using 32-bit definitions -+ on 64-bit platforms and vice versa. */ -+ } a_un; -+} Elf64_auxv_t; -+ -+/* Legal values for a_type (entry type). */ -+ -+#define AT_NULL 0 /* End of vector */ -+#define AT_IGNORE 1 /* Entry should be ignored */ -+#define AT_EXECFD 2 /* File descriptor of program */ -+#define AT_PHDR 3 /* Program headers for program */ -+#define AT_PHENT 4 /* Size of program header entry */ -+#define AT_PHNUM 5 /* Number of program headers */ -+#define AT_PAGESZ 6 /* System page size */ -+#define AT_BASE 7 /* Base address of interpreter */ -+#define AT_FLAGS 8 /* Flags */ -+#define AT_ENTRY 9 /* Entry point of program */ -+#define AT_NOTELF 10 /* Program is not ELF */ -+#define AT_UID 11 /* Real uid */ -+#define AT_EUID 12 /* Effective uid */ -+#define AT_GID 13 /* Real gid */ -+#define AT_EGID 14 /* Effective gid */ -+#define AT_CLKTCK 17 /* Frequency of times() */ -+ -+/* Some more special a_type values describing the hardware. */ -+#define AT_PLATFORM 15 /* String identifying platform. */ -+#define AT_HWCAP 16 /* Machine dependent hints about -+ processor capabilities. */ -+ -+/* This entry gives some information about the FPU initialization -+ performed by the kernel. */ -+#define AT_FPUCW 18 /* Used FPU control word. */ -+ -+/* Cache block sizes. */ -+#define AT_DCACHEBSIZE 19 /* Data cache block size. */ -+#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */ -+#define AT_UCACHEBSIZE 21 /* Unified cache block size. */ -+ -+/* A special ignored value for PPC, used by the kernel to control the -+ interpretation of the AUXV. Must be > 16. */ -+#define AT_IGNOREPPC 22 /* Entry should be ignored. */ -+ -+#define AT_SECURE 23 /* Boolean, was exec setuid-like? */ -+ -+/* Pointer to the global system page used for system calls and other -+ nice things. */ -+#define AT_SYSINFO 32 -+#define AT_SYSINFO_EHDR 33 -+ -+/* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains -+ log2 of line size; mask those to get cache size. */ -+#define AT_L1I_CACHESHAPE 34 -+#define AT_L1D_CACHESHAPE 35 -+#define AT_L2_CACHESHAPE 36 -+#define AT_L3_CACHESHAPE 37 -+ -+/* Note section contents. Each entry in the note section begins with -+ a header of a fixed form. */ -+ -+typedef struct -+{ -+ Elf32_Word n_namesz; /* Length of the note's name. */ -+ Elf32_Word n_descsz; /* Length of the note's descriptor. */ -+ Elf32_Word n_type; /* Type of the note. */ -+} Elf32_Nhdr; -+ -+typedef struct -+{ -+ Elf64_Word n_namesz; /* Length of the note's name. */ -+ Elf64_Word n_descsz; /* Length of the note's descriptor. */ -+ Elf64_Word n_type; /* Type of the note. */ -+} Elf64_Nhdr; -+ -+/* Known names of notes. */ -+ -+/* Solaris entries in the note section have this name. */ -+#define ELF_NOTE_SOLARIS "SUNW Solaris" -+ -+/* Note entries for GNU systems have this name. */ -+#define ELF_NOTE_GNU "GNU" -+ -+ -+/* Defined types of notes for Solaris. */ -+ -+/* Value of descriptor (one word) is desired pagesize for the binary. */ -+#define ELF_NOTE_PAGESIZE_HINT 1 -+ -+ -+/* Defined note types for GNU systems. */ -+ -+/* ABI information. The descriptor consists of words: -+ word 0: OS descriptor -+ word 1: major version of the ABI -+ word 2: minor version of the ABI -+ word 3: subminor version of the ABI -+*/ -+#define ELF_NOTE_ABI 1 -+ -+/* Known OSes. These value can appear in word 0 of an ELF_NOTE_ABI -+ note section entry. */ -+#define ELF_NOTE_OS_LINUX 0 -+#define ELF_NOTE_OS_GNU 1 -+#define ELF_NOTE_OS_SOLARIS2 2 -+#define ELF_NOTE_OS_FREEBSD 3 -+ -+ -+/* Move records. */ -+typedef struct -+{ -+ Elf32_Xword m_value; /* Symbol value. */ -+ Elf32_Word m_info; /* Size and index. */ -+ Elf32_Word m_poffset; /* Symbol offset. */ -+ Elf32_Half m_repeat; /* Repeat count. */ -+ Elf32_Half m_stride; /* Stride info. */ -+} Elf32_Move; -+ -+typedef struct -+{ -+ Elf64_Xword m_value; /* Symbol value. */ -+ Elf64_Xword m_info; /* Size and index. */ -+ Elf64_Xword m_poffset; /* Symbol offset. */ -+ Elf64_Half m_repeat; /* Repeat count. */ -+ Elf64_Half m_stride; /* Stride info. */ -+} Elf64_Move; -+ -+/* Macro to construct move records. */ -+#define ELF32_M_SYM(info) ((info) >> 8) -+#define ELF32_M_SIZE(info) ((unsigned char) (info)) -+#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size)) -+ -+#define ELF64_M_SYM(info) ELF32_M_SYM (info) -+#define ELF64_M_SIZE(info) ELF32_M_SIZE (info) -+#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size) -+ -+ -+/* Motorola 68k specific definitions. */ -+ -+/* Values for Elf32_Ehdr.e_flags. */ -+#define EF_CPU32 0x00810000 -+ -+/* m68k relocs. */ -+ -+#define R_68K_NONE 0 /* No reloc */ -+#define R_68K_32 1 /* Direct 32 bit */ -+#define R_68K_16 2 /* Direct 16 bit */ -+#define R_68K_8 3 /* Direct 8 bit */ -+#define R_68K_PC32 4 /* PC relative 32 bit */ -+#define R_68K_PC16 5 /* PC relative 16 bit */ -+#define R_68K_PC8 6 /* PC relative 8 bit */ -+#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */ -+#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */ -+#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */ -+#define R_68K_GOT32O 10 /* 32 bit GOT offset */ -+#define R_68K_GOT16O 11 /* 16 bit GOT offset */ -+#define R_68K_GOT8O 12 /* 8 bit GOT offset */ -+#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */ -+#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */ -+#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */ -+#define R_68K_PLT32O 16 /* 32 bit PLT offset */ -+#define R_68K_PLT16O 17 /* 16 bit PLT offset */ -+#define R_68K_PLT8O 18 /* 8 bit PLT offset */ -+#define R_68K_COPY 19 /* Copy symbol at runtime */ -+#define R_68K_GLOB_DAT 20 /* Create GOT entry */ -+#define R_68K_JMP_SLOT 21 /* Create PLT entry */ -+#define R_68K_RELATIVE 22 /* Adjust by program base */ -+/* Keep this the last entry. */ -+#define R_68K_NUM 23 -+ -+/* Intel 80386 specific definitions. */ -+ -+/* i386 relocs. */ -+ -+#define R_386_NONE 0 /* No reloc */ -+#define R_386_32 1 /* Direct 32 bit */ -+#define R_386_PC32 2 /* PC relative 32 bit */ -+#define R_386_GOT32 3 /* 32 bit GOT entry */ -+#define R_386_PLT32 4 /* 32 bit PLT address */ -+#define R_386_COPY 5 /* Copy symbol at runtime */ -+#define R_386_GLOB_DAT 6 /* Create GOT entry */ -+#define R_386_JMP_SLOT 7 /* Create PLT entry */ -+#define R_386_RELATIVE 8 /* Adjust by program base */ -+#define R_386_GOTOFF 9 /* 32 bit offset to GOT */ -+#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */ -+#define R_386_32PLT 11 -+#define R_386_TLS_TPOFF 14 /* Offset in static TLS block */ -+#define R_386_TLS_IE 15 /* Address of GOT entry for static TLS -+ block offset */ -+#define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block -+ offset */ -+#define R_386_TLS_LE 17 /* Offset relative to static TLS -+ block */ -+#define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of -+ general dynamic thread local data */ -+#define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of -+ local dynamic thread local data -+ in LE code */ -+#define R_386_16 20 -+#define R_386_PC16 21 -+#define R_386_8 22 -+#define R_386_PC8 23 -+#define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic -+ thread local data */ -+#define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */ -+#define R_386_TLS_GD_CALL 26 /* Relocation for call to -+ __tls_get_addr() */ -+#define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */ -+#define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic -+ thread local data in LE code */ -+#define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */ -+#define R_386_TLS_LDM_CALL 30 /* Relocation for call to -+ __tls_get_addr() in LDM code */ -+#define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */ -+#define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */ -+#define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS -+ block offset */ -+#define R_386_TLS_LE_32 34 /* Negated offset relative to static -+ TLS block */ -+#define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */ -+#define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */ -+#define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */ -+/* Keep this the last entry. */ -+#define R_386_NUM 38 -+ -+/* SUN SPARC specific definitions. */ -+ -+/* Legal values for ST_TYPE subfield of st_info (symbol type). */ -+ -+#define STT_SPARC_REGISTER 13 /* Global register reserved to app. */ -+ -+/* Values for Elf64_Ehdr.e_flags. */ -+ -+#define EF_SPARCV9_MM 3 -+#define EF_SPARCV9_TSO 0 -+#define EF_SPARCV9_PSO 1 -+#define EF_SPARCV9_RMO 2 -+#define EF_SPARC_LEDATA 0x800000 /* little endian data */ -+#define EF_SPARC_EXT_MASK 0xFFFF00 -+#define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */ -+#define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */ -+#define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */ -+#define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */ -+ -+/* SPARC relocs. */ -+ -+#define R_SPARC_NONE 0 /* No reloc */ -+#define R_SPARC_8 1 /* Direct 8 bit */ -+#define R_SPARC_16 2 /* Direct 16 bit */ -+#define R_SPARC_32 3 /* Direct 32 bit */ -+#define R_SPARC_DISP8 4 /* PC relative 8 bit */ -+#define R_SPARC_DISP16 5 /* PC relative 16 bit */ -+#define R_SPARC_DISP32 6 /* PC relative 32 bit */ -+#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */ -+#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */ -+#define R_SPARC_HI22 9 /* High 22 bit */ -+#define R_SPARC_22 10 /* Direct 22 bit */ -+#define R_SPARC_13 11 /* Direct 13 bit */ -+#define R_SPARC_LO10 12 /* Truncated 10 bit */ -+#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */ -+#define R_SPARC_GOT13 14 /* 13 bit GOT entry */ -+#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */ -+#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */ -+#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */ -+#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */ -+#define R_SPARC_COPY 19 /* Copy symbol at runtime */ -+#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */ -+#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */ -+#define R_SPARC_RELATIVE 22 /* Adjust by program base */ -+#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */ -+ -+/* Additional Sparc64 relocs. */ -+ -+#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */ -+#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */ -+#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */ -+#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */ -+#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */ -+#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */ -+#define R_SPARC_10 30 /* Direct 10 bit */ -+#define R_SPARC_11 31 /* Direct 11 bit */ -+#define R_SPARC_64 32 /* Direct 64 bit */ -+#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */ -+#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */ -+#define R_SPARC_HM10 35 /* High middle 10 bits of ... */ -+#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */ -+#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */ -+#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */ -+#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */ -+#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */ -+#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */ -+#define R_SPARC_7 43 /* Direct 7 bit */ -+#define R_SPARC_5 44 /* Direct 5 bit */ -+#define R_SPARC_6 45 /* Direct 6 bit */ -+#define R_SPARC_DISP64 46 /* PC relative 64 bit */ -+#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */ -+#define R_SPARC_HIX22 48 /* High 22 bit complemented */ -+#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */ -+#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */ -+#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */ -+#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */ -+#define R_SPARC_REGISTER 53 /* Global register usage */ -+#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */ -+#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */ -+#define R_SPARC_TLS_GD_HI22 56 -+#define R_SPARC_TLS_GD_LO10 57 -+#define R_SPARC_TLS_GD_ADD 58 -+#define R_SPARC_TLS_GD_CALL 59 -+#define R_SPARC_TLS_LDM_HI22 60 -+#define R_SPARC_TLS_LDM_LO10 61 -+#define R_SPARC_TLS_LDM_ADD 62 -+#define R_SPARC_TLS_LDM_CALL 63 -+#define R_SPARC_TLS_LDO_HIX22 64 -+#define R_SPARC_TLS_LDO_LOX10 65 -+#define R_SPARC_TLS_LDO_ADD 66 -+#define R_SPARC_TLS_IE_HI22 67 -+#define R_SPARC_TLS_IE_LO10 68 -+#define R_SPARC_TLS_IE_LD 69 -+#define R_SPARC_TLS_IE_LDX 70 -+#define R_SPARC_TLS_IE_ADD 71 -+#define R_SPARC_TLS_LE_HIX22 72 -+#define R_SPARC_TLS_LE_LOX10 73 -+#define R_SPARC_TLS_DTPMOD32 74 -+#define R_SPARC_TLS_DTPMOD64 75 -+#define R_SPARC_TLS_DTPOFF32 76 -+#define R_SPARC_TLS_DTPOFF64 77 -+#define R_SPARC_TLS_TPOFF32 78 -+#define R_SPARC_TLS_TPOFF64 79 -+/* Keep this the last entry. */ -+#define R_SPARC_NUM 80 -+ -+/* For Sparc64, legal values for d_tag of Elf64_Dyn. */ -+ -+#define DT_SPARC_REGISTER 0x70000001 -+#define DT_SPARC_NUM 2 -+ -+/* Bits present in AT_HWCAP on SPARC. */ -+ -+#define HWCAP_SPARC_FLUSH 1 /* The CPU supports flush insn. */ -+#define HWCAP_SPARC_STBAR 2 -+#define HWCAP_SPARC_SWAP 4 -+#define HWCAP_SPARC_MULDIV 8 -+#define HWCAP_SPARC_V9 16 /* The CPU is v9, so v8plus is ok. */ -+#define HWCAP_SPARC_ULTRA3 32 -+#define HWCAP_SPARC_BLKINIT 64 /* Sun4v with block-init/load-twin. */ -+ -+/* MIPS R3000 specific definitions. */ -+ -+/* Legal values for e_flags field of Elf32_Ehdr. */ -+ -+#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */ -+#define EF_MIPS_PIC 2 /* Contains PIC code */ -+#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */ -+#define EF_MIPS_XGOT 8 -+#define EF_MIPS_64BIT_WHIRL 16 -+#define EF_MIPS_ABI2 32 -+#define EF_MIPS_ABI_ON32 64 -+#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */ -+ -+/* Legal values for MIPS architecture level. */ -+ -+#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ -+#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ -+#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ -+#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ -+#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ -+#define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ -+#define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ -+ -+/* The following are non-official names and should not be used. */ -+ -+#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ -+#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ -+#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ -+#define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ -+#define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ -+#define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ -+#define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ -+ -+/* Special section indices. */ -+ -+#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */ -+#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ -+#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ -+#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */ -+#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */ -+ -+/* Legal values for sh_type field of Elf32_Shdr. */ -+ -+#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */ -+#define SHT_MIPS_MSYM 0x70000001 -+#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */ -+#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */ -+#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */ -+#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/ -+#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */ -+#define SHT_MIPS_PACKAGE 0x70000007 -+#define SHT_MIPS_PACKSYM 0x70000008 -+#define SHT_MIPS_RELD 0x70000009 -+#define SHT_MIPS_IFACE 0x7000000b -+#define SHT_MIPS_CONTENT 0x7000000c -+#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */ -+#define SHT_MIPS_SHDR 0x70000010 -+#define SHT_MIPS_FDESC 0x70000011 -+#define SHT_MIPS_EXTSYM 0x70000012 -+#define SHT_MIPS_DENSE 0x70000013 -+#define SHT_MIPS_PDESC 0x70000014 -+#define SHT_MIPS_LOCSYM 0x70000015 -+#define SHT_MIPS_AUXSYM 0x70000016 -+#define SHT_MIPS_OPTSYM 0x70000017 -+#define SHT_MIPS_LOCSTR 0x70000018 -+#define SHT_MIPS_LINE 0x70000019 -+#define SHT_MIPS_RFDESC 0x7000001a -+#define SHT_MIPS_DELTASYM 0x7000001b -+#define SHT_MIPS_DELTAINST 0x7000001c -+#define SHT_MIPS_DELTACLASS 0x7000001d -+#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */ -+#define SHT_MIPS_DELTADECL 0x7000001f -+#define SHT_MIPS_SYMBOL_LIB 0x70000020 -+#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */ -+#define SHT_MIPS_TRANSLATE 0x70000022 -+#define SHT_MIPS_PIXIE 0x70000023 -+#define SHT_MIPS_XLATE 0x70000024 -+#define SHT_MIPS_XLATE_DEBUG 0x70000025 -+#define SHT_MIPS_WHIRL 0x70000026 -+#define SHT_MIPS_EH_REGION 0x70000027 -+#define SHT_MIPS_XLATE_OLD 0x70000028 -+#define SHT_MIPS_PDR_EXCEPTION 0x70000029 -+ -+/* Legal values for sh_flags field of Elf32_Shdr. */ -+ -+#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */ -+#define SHF_MIPS_MERGE 0x20000000 -+#define SHF_MIPS_ADDR 0x40000000 -+#define SHF_MIPS_STRINGS 0x80000000 -+#define SHF_MIPS_NOSTRIP 0x08000000 -+#define SHF_MIPS_LOCAL 0x04000000 -+#define SHF_MIPS_NAMES 0x02000000 -+#define SHF_MIPS_NODUPE 0x01000000 -+ -+ -+/* Symbol tables. */ -+ -+/* MIPS specific values for `st_other'. */ -+#define STO_MIPS_DEFAULT 0x0 -+#define STO_MIPS_INTERNAL 0x1 -+#define STO_MIPS_HIDDEN 0x2 -+#define STO_MIPS_PROTECTED 0x3 -+#define STO_MIPS_SC_ALIGN_UNUSED 0xff -+ -+/* MIPS specific values for `st_info'. */ -+#define STB_MIPS_SPLIT_COMMON 13 -+ -+/* Entries found in sections of type SHT_MIPS_GPTAB. */ -+ -+typedef union -+{ -+ struct -+ { -+ Elf32_Word gt_current_g_value; /* -G value used for compilation */ -+ Elf32_Word gt_unused; /* Not used */ -+ } gt_header; /* First entry in section */ -+ struct -+ { -+ Elf32_Word gt_g_value; /* If this value were used for -G */ -+ Elf32_Word gt_bytes; /* This many bytes would be used */ -+ } gt_entry; /* Subsequent entries in section */ -+} Elf32_gptab; -+ -+/* Entry found in sections of type SHT_MIPS_REGINFO. */ -+ -+typedef struct -+{ -+ Elf32_Word ri_gprmask; /* General registers used */ -+ Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */ -+ Elf32_Sword ri_gp_value; /* $gp register value */ -+} Elf32_RegInfo; -+ -+/* Entries found in sections of type SHT_MIPS_OPTIONS. */ -+ -+typedef struct -+{ -+ unsigned char kind; /* Determines interpretation of the -+ variable part of descriptor. */ -+ unsigned char size; /* Size of descriptor, including header. */ -+ Elf32_Section section; /* Section header index of section affected, -+ 0 for global options. */ -+ Elf32_Word info; /* Kind-specific information. */ -+} Elf_Options; -+ -+/* Values for `kind' field in Elf_Options. */ -+ -+#define ODK_NULL 0 /* Undefined. */ -+#define ODK_REGINFO 1 /* Register usage information. */ -+#define ODK_EXCEPTIONS 2 /* Exception processing options. */ -+#define ODK_PAD 3 /* Section padding options. */ -+#define ODK_HWPATCH 4 /* Hardware workarounds performed */ -+#define ODK_FILL 5 /* record the fill value used by the linker. */ -+#define ODK_TAGS 6 /* reserve space for desktop tools to write. */ -+#define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */ -+#define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */ -+ -+/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */ -+ -+#define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */ -+#define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */ -+#define OEX_PAGE0 0x10000 /* page zero must be mapped. */ -+#define OEX_SMM 0x20000 /* Force sequential memory mode? */ -+#define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */ -+#define OEX_PRECISEFP OEX_FPDBUG -+#define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */ -+ -+#define OEX_FPU_INVAL 0x10 -+#define OEX_FPU_DIV0 0x08 -+#define OEX_FPU_OFLO 0x04 -+#define OEX_FPU_UFLO 0x02 -+#define OEX_FPU_INEX 0x01 -+ -+/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */ -+ -+#define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */ -+#define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */ -+#define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */ -+#define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */ -+ -+#define OPAD_PREFIX 0x1 -+#define OPAD_POSTFIX 0x2 -+#define OPAD_SYMBOL 0x4 -+ -+/* Entry found in `.options' section. */ -+ -+typedef struct -+{ -+ Elf32_Word hwp_flags1; /* Extra flags. */ -+ Elf32_Word hwp_flags2; /* Extra flags. */ -+} Elf_Options_Hw; -+ -+/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */ -+ -+#define OHWA0_R4KEOP_CHECKED 0x00000001 -+#define OHWA1_R4KEOP_CLEAN 0x00000002 -+ -+/* MIPS relocs. */ -+ -+#define R_MIPS_NONE 0 /* No reloc */ -+#define R_MIPS_16 1 /* Direct 16 bit */ -+#define R_MIPS_32 2 /* Direct 32 bit */ -+#define R_MIPS_REL32 3 /* PC relative 32 bit */ -+#define R_MIPS_26 4 /* Direct 26 bit shifted */ -+#define R_MIPS_HI16 5 /* High 16 bit */ -+#define R_MIPS_LO16 6 /* Low 16 bit */ -+#define R_MIPS_GPREL16 7 /* GP relative 16 bit */ -+#define R_MIPS_LITERAL 8 /* 16 bit literal entry */ -+#define R_MIPS_GOT16 9 /* 16 bit GOT entry */ -+#define R_MIPS_PC16 10 /* PC relative 16 bit */ -+#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ -+#define R_MIPS_GPREL32 12 /* GP relative 32 bit */ -+ -+#define R_MIPS_SHIFT5 16 -+#define R_MIPS_SHIFT6 17 -+#define R_MIPS_64 18 -+#define R_MIPS_GOT_DISP 19 -+#define R_MIPS_GOT_PAGE 20 -+#define R_MIPS_GOT_OFST 21 -+#define R_MIPS_GOT_HI16 22 -+#define R_MIPS_GOT_LO16 23 -+#define R_MIPS_SUB 24 -+#define R_MIPS_INSERT_A 25 -+#define R_MIPS_INSERT_B 26 -+#define R_MIPS_DELETE 27 -+#define R_MIPS_HIGHER 28 -+#define R_MIPS_HIGHEST 29 -+#define R_MIPS_CALL_HI16 30 -+#define R_MIPS_CALL_LO16 31 -+#define R_MIPS_SCN_DISP 32 -+#define R_MIPS_REL16 33 -+#define R_MIPS_ADD_IMMEDIATE 34 -+#define R_MIPS_PJUMP 35 -+#define R_MIPS_RELGOT 36 -+#define R_MIPS_JALR 37 -+#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */ -+#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */ -+#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */ -+#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */ -+#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */ -+#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */ -+#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */ -+#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */ -+#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */ -+#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */ -+#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */ -+#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ -+#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ -+/* Keep this the last entry. */ -+#define R_MIPS_NUM 51 -+ -+/* Legal values for p_type field of Elf32_Phdr. */ -+ -+#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */ -+#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */ -+#define PT_MIPS_OPTIONS 0x70000002 -+ -+/* Special program header types. */ -+ -+#define PF_MIPS_LOCAL 0x10000000 -+ -+/* Legal values for d_tag field of Elf32_Dyn. */ -+ -+#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */ -+#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */ -+#define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */ -+#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */ -+#define DT_MIPS_FLAGS 0x70000005 /* Flags */ -+#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */ -+#define DT_MIPS_MSYM 0x70000007 -+#define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */ -+#define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */ -+#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */ -+#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */ -+#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */ -+#define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */ -+#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */ -+#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */ -+#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ -+#define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */ -+#define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */ -+#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in -+ DT_MIPS_DELTA_CLASS. */ -+#define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */ -+#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in -+ DT_MIPS_DELTA_INSTANCE. */ -+#define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */ -+#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in -+ DT_MIPS_DELTA_RELOC. */ -+#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta -+ relocations refer to. */ -+#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in -+ DT_MIPS_DELTA_SYM. */ -+#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the -+ class declaration. */ -+#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in -+ DT_MIPS_DELTA_CLASSSYM. */ -+#define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */ -+#define DT_MIPS_PIXIE_INIT 0x70000023 -+#define DT_MIPS_SYMBOL_LIB 0x70000024 -+#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025 -+#define DT_MIPS_LOCAL_GOTIDX 0x70000026 -+#define DT_MIPS_HIDDEN_GOTIDX 0x70000027 -+#define DT_MIPS_PROTECTED_GOTIDX 0x70000028 -+#define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */ -+#define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */ -+#define DT_MIPS_DYNSTR_ALIGN 0x7000002b -+#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */ -+#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve -+ function stored in GOT. */ -+#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added -+ by rld on dlopen() calls. */ -+#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */ -+#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */ -+#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */ -+#define DT_MIPS_NUM 0x32 -+ -+/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */ -+ -+#define RHF_NONE 0 /* No flags */ -+#define RHF_QUICKSTART (1 << 0) /* Use quickstart */ -+#define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */ -+#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */ -+#define RHF_NO_MOVE (1 << 3) -+#define RHF_SGI_ONLY (1 << 4) -+#define RHF_GUARANTEE_INIT (1 << 5) -+#define RHF_DELTA_C_PLUS_PLUS (1 << 6) -+#define RHF_GUARANTEE_START_INIT (1 << 7) -+#define RHF_PIXIE (1 << 8) -+#define RHF_DEFAULT_DELAY_LOAD (1 << 9) -+#define RHF_REQUICKSTART (1 << 10) -+#define RHF_REQUICKSTARTED (1 << 11) -+#define RHF_CORD (1 << 12) -+#define RHF_NO_UNRES_UNDEF (1 << 13) -+#define RHF_RLD_ORDER_SAFE (1 << 14) -+ -+/* Entries found in sections of type SHT_MIPS_LIBLIST. */ -+ -+typedef struct -+{ -+ Elf32_Word l_name; /* Name (string table index) */ -+ Elf32_Word l_time_stamp; /* Timestamp */ -+ Elf32_Word l_checksum; /* Checksum */ -+ Elf32_Word l_version; /* Interface version */ -+ Elf32_Word l_flags; /* Flags */ -+} Elf32_Lib; -+ -+typedef struct -+{ -+ Elf64_Word l_name; /* Name (string table index) */ -+ Elf64_Word l_time_stamp; /* Timestamp */ -+ Elf64_Word l_checksum; /* Checksum */ -+ Elf64_Word l_version; /* Interface version */ -+ Elf64_Word l_flags; /* Flags */ -+} Elf64_Lib; -+ -+ -+/* Legal values for l_flags. */ -+ -+#define LL_NONE 0 -+#define LL_EXACT_MATCH (1 << 0) /* Require exact match */ -+#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */ -+#define LL_REQUIRE_MINOR (1 << 2) -+#define LL_EXPORTS (1 << 3) -+#define LL_DELAY_LOAD (1 << 4) -+#define LL_DELTA (1 << 5) -+ -+/* Entries found in sections of type SHT_MIPS_CONFLICT. */ -+ -+typedef Elf32_Addr Elf32_Conflict; -+ -+ -+/* HPPA specific definitions. */ -+ -+/* Legal values for e_flags field of Elf32_Ehdr. */ -+ -+#define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */ -+#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */ -+#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */ -+#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */ -+#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch -+ prediction. */ -+#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */ -+#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */ -+ -+/* Defined values for `e_flags & EF_PARISC_ARCH' are: */ -+ -+#define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */ -+#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */ -+#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */ -+ -+/* Additional section indeces. */ -+ -+#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared -+ symbols in ANSI C. */ -+#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */ -+ -+/* Legal values for sh_type field of Elf32_Shdr. */ -+ -+#define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */ -+#define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */ -+#define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */ -+ -+/* Legal values for sh_flags field of Elf32_Shdr. */ -+ -+#define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */ -+#define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */ -+#define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */ -+ -+/* Legal values for ST_TYPE subfield of st_info (symbol type). */ -+ -+#define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */ -+ -+#define STT_HP_OPAQUE (STT_LOOS + 0x1) -+#define STT_HP_STUB (STT_LOOS + 0x2) -+ -+/* HPPA relocs. */ -+ -+#define R_PARISC_NONE 0 /* No reloc. */ -+#define R_PARISC_DIR32 1 /* Direct 32-bit reference. */ -+#define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */ -+#define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */ -+#define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */ -+#define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */ -+#define R_PARISC_PCREL32 9 /* 32-bit rel. address. */ -+#define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */ -+#define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */ -+#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */ -+#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */ -+#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */ -+#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */ -+#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */ -+#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */ -+#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */ -+#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */ -+#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */ -+#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */ -+#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */ -+#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */ -+#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */ -+#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */ -+#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */ -+#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */ -+#define R_PARISC_FPTR64 64 /* 64 bits function address. */ -+#define R_PARISC_PLABEL32 65 /* 32 bits function address. */ -+#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */ -+#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */ -+#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */ -+#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */ -+#define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */ -+#define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */ -+#define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */ -+#define R_PARISC_DIR64 80 /* 64 bits of eff. address. */ -+#define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */ -+#define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */ -+#define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */ -+#define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */ -+#define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */ -+#define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */ -+#define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */ -+#define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */ -+#define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */ -+#define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */ -+#define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */ -+#define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */ -+#define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */ -+#define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */ -+#define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */ -+#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */ -+#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */ -+#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */ -+#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ -+#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ -+#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ -+#define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */ -+#define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */ -+#define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */ -+#define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */ -+#define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */ -+#define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */ -+#define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */ -+#define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */ -+#define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */ -+#define R_PARISC_LORESERVE 128 -+#define R_PARISC_COPY 128 /* Copy relocation. */ -+#define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */ -+#define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */ -+#define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */ -+#define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */ -+#define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */ -+#define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */ -+#define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/ -+#define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */ -+#define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */ -+#define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */ -+#define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */ -+#define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */ -+#define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */ -+#define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */ -+#define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */ -+#define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/ -+#define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/ -+#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */ -+#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */ -+#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */ -+#define R_PARISC_HIRESERVE 255 -+ -+/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ -+ -+#define PT_HP_TLS (PT_LOOS + 0x0) -+#define PT_HP_CORE_NONE (PT_LOOS + 0x1) -+#define PT_HP_CORE_VERSION (PT_LOOS + 0x2) -+#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3) -+#define PT_HP_CORE_COMM (PT_LOOS + 0x4) -+#define PT_HP_CORE_PROC (PT_LOOS + 0x5) -+#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6) -+#define PT_HP_CORE_STACK (PT_LOOS + 0x7) -+#define PT_HP_CORE_SHM (PT_LOOS + 0x8) -+#define PT_HP_CORE_MMF (PT_LOOS + 0x9) -+#define PT_HP_PARALLEL (PT_LOOS + 0x10) -+#define PT_HP_FASTBIND (PT_LOOS + 0x11) -+#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12) -+#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13) -+#define PT_HP_STACK (PT_LOOS + 0x14) -+ -+#define PT_PARISC_ARCHEXT 0x70000000 -+#define PT_PARISC_UNWIND 0x70000001 -+ -+/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */ -+ -+#define PF_PARISC_SBP 0x08000000 -+ -+#define PF_HP_PAGE_SIZE 0x00100000 -+#define PF_HP_FAR_SHARED 0x00200000 -+#define PF_HP_NEAR_SHARED 0x00400000 -+#define PF_HP_CODE 0x01000000 -+#define PF_HP_MODIFY 0x02000000 -+#define PF_HP_LAZYSWAP 0x04000000 -+#define PF_HP_SBP 0x08000000 -+ -+ -+/* Alpha specific definitions. */ -+ -+/* Legal values for e_flags field of Elf64_Ehdr. */ -+ -+#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */ -+#define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */ -+ -+/* Legal values for sh_type field of Elf64_Shdr. */ -+ -+/* These two are primerily concerned with ECOFF debugging info. */ -+#define SHT_ALPHA_DEBUG 0x70000001 -+#define SHT_ALPHA_REGINFO 0x70000002 -+ -+/* Legal values for sh_flags field of Elf64_Shdr. */ -+ -+#define SHF_ALPHA_GPREL 0x10000000 -+ -+/* Legal values for st_other field of Elf64_Sym. */ -+#define STO_ALPHA_NOPV 0x80 /* No PV required. */ -+#define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */ -+ -+/* Alpha relocs. */ -+ -+#define R_ALPHA_NONE 0 /* No reloc */ -+#define R_ALPHA_REFLONG 1 /* Direct 32 bit */ -+#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ -+#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ -+#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ -+#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ -+#define R_ALPHA_GPDISP 6 /* Add displacement to GP */ -+#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ -+#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ -+#define R_ALPHA_SREL16 9 /* PC relative 16 bit */ -+#define R_ALPHA_SREL32 10 /* PC relative 32 bit */ -+#define R_ALPHA_SREL64 11 /* PC relative 64 bit */ -+#define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */ -+#define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */ -+#define R_ALPHA_GPREL16 19 /* GP relative 16 bit */ -+#define R_ALPHA_COPY 24 /* Copy symbol at runtime */ -+#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ -+#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ -+#define R_ALPHA_RELATIVE 27 /* Adjust by program base */ -+#define R_ALPHA_TLS_GD_HI 28 -+#define R_ALPHA_TLSGD 29 -+#define R_ALPHA_TLS_LDM 30 -+#define R_ALPHA_DTPMOD64 31 -+#define R_ALPHA_GOTDTPREL 32 -+#define R_ALPHA_DTPREL64 33 -+#define R_ALPHA_DTPRELHI 34 -+#define R_ALPHA_DTPRELLO 35 -+#define R_ALPHA_DTPREL16 36 -+#define R_ALPHA_GOTTPREL 37 -+#define R_ALPHA_TPREL64 38 -+#define R_ALPHA_TPRELHI 39 -+#define R_ALPHA_TPRELLO 40 -+#define R_ALPHA_TPREL16 41 -+/* Keep this the last entry. */ -+#define R_ALPHA_NUM 46 -+ -+/* Magic values of the LITUSE relocation addend. */ -+#define LITUSE_ALPHA_ADDR 0 -+#define LITUSE_ALPHA_BASE 1 -+#define LITUSE_ALPHA_BYTOFF 2 -+#define LITUSE_ALPHA_JSR 3 -+#define LITUSE_ALPHA_TLS_GD 4 -+#define LITUSE_ALPHA_TLS_LDM 5 -+ -+/* Legal values for d_tag of Elf64_Dyn. */ -+#define DT_ALPHA_PLTRO (DT_LOPROC + 0) -+#define DT_ALPHA_NUM 1 -+ -+/* PowerPC specific declarations */ -+ -+/* Values for Elf32/64_Ehdr.e_flags. */ -+#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */ -+ -+/* Cygnus local bits below */ -+#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/ -+#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib -+ flag */ -+ -+/* PowerPC relocations defined by the ABIs */ -+#define R_PPC_NONE 0 -+#define R_PPC_ADDR32 1 /* 32bit absolute address */ -+#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ -+#define R_PPC_ADDR16 3 /* 16bit absolute address */ -+#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ -+#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ -+#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ -+#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ -+#define R_PPC_ADDR14_BRTAKEN 8 -+#define R_PPC_ADDR14_BRNTAKEN 9 -+#define R_PPC_REL24 10 /* PC relative 26 bit */ -+#define R_PPC_REL14 11 /* PC relative 16 bit */ -+#define R_PPC_REL14_BRTAKEN 12 -+#define R_PPC_REL14_BRNTAKEN 13 -+#define R_PPC_GOT16 14 -+#define R_PPC_GOT16_LO 15 -+#define R_PPC_GOT16_HI 16 -+#define R_PPC_GOT16_HA 17 -+#define R_PPC_PLTREL24 18 -+#define R_PPC_COPY 19 -+#define R_PPC_GLOB_DAT 20 -+#define R_PPC_JMP_SLOT 21 -+#define R_PPC_RELATIVE 22 -+#define R_PPC_LOCAL24PC 23 -+#define R_PPC_UADDR32 24 -+#define R_PPC_UADDR16 25 -+#define R_PPC_REL32 26 -+#define R_PPC_PLT32 27 -+#define R_PPC_PLTREL32 28 -+#define R_PPC_PLT16_LO 29 -+#define R_PPC_PLT16_HI 30 -+#define R_PPC_PLT16_HA 31 -+#define R_PPC_SDAREL16 32 -+#define R_PPC_SECTOFF 33 -+#define R_PPC_SECTOFF_LO 34 -+#define R_PPC_SECTOFF_HI 35 -+#define R_PPC_SECTOFF_HA 36 -+ -+/* PowerPC relocations defined for the TLS access ABI. */ -+#define R_PPC_TLS 67 /* none (sym+add)@tls */ -+#define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */ -+#define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */ -+#define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ -+#define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ -+#define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ -+#define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */ -+#define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */ -+#define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ -+#define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ -+#define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ -+#define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */ -+#define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ -+#define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ -+#define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ -+#define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ -+#define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ -+#define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ -+#define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ -+#define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ -+#define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */ -+#define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */ -+#define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ -+#define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ -+#define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */ -+#define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */ -+#define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ -+#define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ -+ -+/* Keep this the last entry. */ -+#define R_PPC_NUM 95 -+ -+/* The remaining relocs are from the Embedded ELF ABI, and are not -+ in the SVR4 ELF ABI. */ -+#define R_PPC_EMB_NADDR32 101 -+#define R_PPC_EMB_NADDR16 102 -+#define R_PPC_EMB_NADDR16_LO 103 -+#define R_PPC_EMB_NADDR16_HI 104 -+#define R_PPC_EMB_NADDR16_HA 105 -+#define R_PPC_EMB_SDAI16 106 -+#define R_PPC_EMB_SDA2I16 107 -+#define R_PPC_EMB_SDA2REL 108 -+#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ -+#define R_PPC_EMB_MRKREF 110 -+#define R_PPC_EMB_RELSEC16 111 -+#define R_PPC_EMB_RELST_LO 112 -+#define R_PPC_EMB_RELST_HI 113 -+#define R_PPC_EMB_RELST_HA 114 -+#define R_PPC_EMB_BIT_FLD 115 -+#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ -+ -+/* Diab tool relocations. */ -+#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ -+#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ -+#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ -+#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ -+#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ -+#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ -+ -+/* GNU relocs used in PIC code sequences. */ -+#define R_PPC_REL16 249 /* word32 (sym-.) */ -+#define R_PPC_REL16_LO 250 /* half16 (sym-.)@l */ -+#define R_PPC_REL16_HI 251 /* half16 (sym-.)@h */ -+#define R_PPC_REL16_HA 252 /* half16 (sym-.)@ha */ -+ -+/* This is a phony reloc to handle any old fashioned TOC16 references -+ that may still be in object files. */ -+#define R_PPC_TOC16 255 -+ -+/* PowerPC specific values for the Dyn d_tag field. */ -+#define DT_PPC_GOT (DT_LOPROC + 0) -+#define DT_PPC_NUM 1 -+ -+/* PowerPC64 relocations defined by the ABIs */ -+#define R_PPC64_NONE R_PPC_NONE -+#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */ -+#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */ -+#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */ -+#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */ -+#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */ -+#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */ -+#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */ -+#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN -+#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN -+#define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */ -+#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */ -+#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN -+#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN -+#define R_PPC64_GOT16 R_PPC_GOT16 -+#define R_PPC64_GOT16_LO R_PPC_GOT16_LO -+#define R_PPC64_GOT16_HI R_PPC_GOT16_HI -+#define R_PPC64_GOT16_HA R_PPC_GOT16_HA -+ -+#define R_PPC64_COPY R_PPC_COPY -+#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT -+#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT -+#define R_PPC64_RELATIVE R_PPC_RELATIVE -+ -+#define R_PPC64_UADDR32 R_PPC_UADDR32 -+#define R_PPC64_UADDR16 R_PPC_UADDR16 -+#define R_PPC64_REL32 R_PPC_REL32 -+#define R_PPC64_PLT32 R_PPC_PLT32 -+#define R_PPC64_PLTREL32 R_PPC_PLTREL32 -+#define R_PPC64_PLT16_LO R_PPC_PLT16_LO -+#define R_PPC64_PLT16_HI R_PPC_PLT16_HI -+#define R_PPC64_PLT16_HA R_PPC_PLT16_HA -+ -+#define R_PPC64_SECTOFF R_PPC_SECTOFF -+#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO -+#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI -+#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA -+#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */ -+#define R_PPC64_ADDR64 38 /* doubleword64 S + A */ -+#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */ -+#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */ -+#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */ -+#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */ -+#define R_PPC64_UADDR64 43 /* doubleword64 S + A */ -+#define R_PPC64_REL64 44 /* doubleword64 S + A - P */ -+#define R_PPC64_PLT64 45 /* doubleword64 L + A */ -+#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */ -+#define R_PPC64_TOC16 47 /* half16* S + A - .TOC */ -+#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */ -+#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */ -+#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */ -+#define R_PPC64_TOC 51 /* doubleword64 .TOC */ -+#define R_PPC64_PLTGOT16 52 /* half16* M + A */ -+#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */ -+#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */ -+#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */ -+ -+#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */ -+#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */ -+#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */ -+#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */ -+#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */ -+#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */ -+#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */ -+#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */ -+#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */ -+#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */ -+#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */ -+ -+/* PowerPC64 relocations defined for the TLS access ABI. */ -+#define R_PPC64_TLS 67 /* none (sym+add)@tls */ -+#define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */ -+#define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */ -+#define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ -+#define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ -+#define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ -+#define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */ -+#define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */ -+#define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ -+#define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ -+#define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ -+#define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */ -+#define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ -+#define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ -+#define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ -+#define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ -+#define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ -+#define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ -+#define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ -+#define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ -+#define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */ -+#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */ -+#define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ -+#define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ -+#define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */ -+#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */ -+#define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */ -+#define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */ -+#define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */ -+#define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */ -+#define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */ -+#define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */ -+#define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */ -+#define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */ -+#define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */ -+#define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */ -+#define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */ -+#define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */ -+#define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */ -+#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */ -+ -+/* Keep this the last entry. */ -+#define R_PPC64_NUM 107 -+ -+/* PowerPC64 specific values for the Dyn d_tag field. */ -+#define DT_PPC64_GLINK (DT_LOPROC + 0) -+#define DT_PPC64_OPD (DT_LOPROC + 1) -+#define DT_PPC64_OPDSZ (DT_LOPROC + 2) -+#define DT_PPC64_NUM 3 -+ -+ -+/* ARM specific declarations */ -+ -+/* Processor specific flags for the ELF header e_flags field. */ -+#define EF_ARM_RELEXEC 0x01 -+#define EF_ARM_HASENTRY 0x02 -+#define EF_ARM_INTERWORK 0x04 -+#define EF_ARM_APCS_26 0x08 -+#define EF_ARM_APCS_FLOAT 0x10 -+#define EF_ARM_PIC 0x20 -+#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */ -+#define EF_ARM_NEW_ABI 0x80 -+#define EF_ARM_OLD_ABI 0x100 -+ -+/* Other constants defined in the ARM ELF spec. version B-01. */ -+/* NB. These conflict with values defined above. */ -+#define EF_ARM_SYMSARESORTED 0x04 -+#define EF_ARM_DYNSYMSUSESEGIDX 0x08 -+#define EF_ARM_MAPSYMSFIRST 0x10 -+#define EF_ARM_EABIMASK 0XFF000000 -+ -+#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK) -+#define EF_ARM_EABI_UNKNOWN 0x00000000 -+#define EF_ARM_EABI_VER1 0x01000000 -+#define EF_ARM_EABI_VER2 0x02000000 -+ -+/* Additional symbol types for Thumb */ -+#define STT_ARM_TFUNC 0xd -+ -+/* ARM-specific values for sh_flags */ -+#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */ -+#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined -+ in the input to a link step */ -+ -+/* ARM-specific program header flags */ -+#define PF_ARM_SB 0x10000000 /* Segment contains the location -+ addressed by the static base */ -+ -+/* Processor specific values for the Phdr p_type field. */ -+#define PT_ARM_EXIDX 0x70000001 /* .ARM.exidx segment */ -+ -+/* ARM relocs. */ -+ -+#define R_ARM_NONE 0 /* No reloc */ -+#define R_ARM_PC24 1 /* PC relative 26 bit branch */ -+#define R_ARM_ABS32 2 /* Direct 32 bit */ -+#define R_ARM_REL32 3 /* PC relative 32 bit */ -+#define R_ARM_PC13 4 -+#define R_ARM_ABS16 5 /* Direct 16 bit */ -+#define R_ARM_ABS12 6 /* Direct 12 bit */ -+#define R_ARM_THM_ABS5 7 -+#define R_ARM_ABS8 8 /* Direct 8 bit */ -+#define R_ARM_SBREL32 9 -+#define R_ARM_THM_PC22 10 -+#define R_ARM_THM_PC8 11 -+#define R_ARM_AMP_VCALL9 12 -+#define R_ARM_SWI24 13 -+#define R_ARM_THM_SWI8 14 -+#define R_ARM_XPC25 15 -+#define R_ARM_THM_XPC22 16 -+#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ -+#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ -+#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ -+#define R_ARM_COPY 20 /* Copy symbol at runtime */ -+#define R_ARM_GLOB_DAT 21 /* Create GOT entry */ -+#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */ -+#define R_ARM_RELATIVE 23 /* Adjust by program base */ -+#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */ -+#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */ -+#define R_ARM_GOT32 26 /* 32 bit GOT entry */ -+#define R_ARM_PLT32 27 /* 32 bit PLT address */ -+#define R_ARM_ALU_PCREL_7_0 32 -+#define R_ARM_ALU_PCREL_15_8 33 -+#define R_ARM_ALU_PCREL_23_15 34 -+#define R_ARM_LDR_SBREL_11_0 35 -+#define R_ARM_ALU_SBREL_19_12 36 -+#define R_ARM_ALU_SBREL_27_20 37 -+#define R_ARM_GNU_VTENTRY 100 -+#define R_ARM_GNU_VTINHERIT 101 -+#define R_ARM_THM_PC11 102 /* thumb unconditional branch */ -+#define R_ARM_THM_PC9 103 /* thumb conditional branch */ -+#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic -+ thread local data */ -+#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic -+ thread local data */ -+#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS -+ block */ -+#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of -+ static TLS block offset */ -+#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static -+ TLS block */ -+#define R_ARM_RXPC25 249 -+#define R_ARM_RSBREL32 250 -+#define R_ARM_THM_RPC22 251 -+#define R_ARM_RREL32 252 -+#define R_ARM_RABS22 253 -+#define R_ARM_RPC24 254 -+#define R_ARM_RBASE 255 -+/* Keep this the last entry. */ -+#define R_ARM_NUM 256 -+ -+/* IA-64 specific declarations. */ -+ -+/* Processor specific flags for the Ehdr e_flags field. */ -+#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */ -+#define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */ -+#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */ -+ -+/* Processor specific values for the Phdr p_type field. */ -+#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ -+#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ -+#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12) -+#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13) -+#define PT_IA_64_HP_STACK (PT_LOOS + 0x14) -+ -+/* Processor specific flags for the Phdr p_flags field. */ -+#define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */ -+ -+/* Processor specific values for the Shdr sh_type field. */ -+#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ -+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ -+ -+/* Processor specific flags for the Shdr sh_flags field. */ -+#define SHF_IA_64_SHORT 0x10000000 /* section near gp */ -+#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */ -+ -+/* Processor specific values for the Dyn d_tag field. */ -+#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0) -+#define DT_IA_64_NUM 1 -+ -+/* IA-64 relocations. */ -+#define R_IA64_NONE 0x00 /* none */ -+#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */ -+#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */ -+#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */ -+#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */ -+#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */ -+#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */ -+#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */ -+#define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */ -+#define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */ -+#define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */ -+#define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */ -+#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */ -+#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */ -+#define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */ -+#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */ -+#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */ -+#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */ -+#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */ -+#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */ -+#define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */ -+#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */ -+#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */ -+#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */ -+#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */ -+#define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */ -+#define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */ -+#define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */ -+#define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */ -+#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */ -+#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */ -+#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */ -+#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */ -+#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */ -+#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */ -+#define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */ -+#define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */ -+#define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */ -+#define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */ -+#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */ -+#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */ -+#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */ -+#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */ -+#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */ -+#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */ -+#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */ -+#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */ -+#define R_IA64_REL32MSB 0x6c /* data 4 + REL */ -+#define R_IA64_REL32LSB 0x6d /* data 4 + REL */ -+#define R_IA64_REL64MSB 0x6e /* data 8 + REL */ -+#define R_IA64_REL64LSB 0x6f /* data 8 + REL */ -+#define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */ -+#define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */ -+#define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */ -+#define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */ -+#define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */ -+#define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */ -+#define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */ -+#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */ -+#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */ -+#define R_IA64_COPY 0x84 /* copy relocation */ -+#define R_IA64_SUB 0x85 /* Addend and symbol difference */ -+#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */ -+#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */ -+#define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */ -+#define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */ -+#define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */ -+#define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */ -+#define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */ -+#define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */ -+#define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */ -+#define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */ -+#define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */ -+#define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */ -+#define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */ -+#define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */ -+#define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */ -+#define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */ -+#define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */ -+#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */ -+#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */ -+ -+/* SH specific declarations */ -+ -+/* SH relocs. */ -+#define R_SH_NONE 0 -+#define R_SH_DIR32 1 -+#define R_SH_REL32 2 -+#define R_SH_DIR8WPN 3 -+#define R_SH_IND12W 4 -+#define R_SH_DIR8WPL 5 -+#define R_SH_DIR8WPZ 6 -+#define R_SH_DIR8BP 7 -+#define R_SH_DIR8W 8 -+#define R_SH_DIR8L 9 -+#define R_SH_SWITCH16 25 -+#define R_SH_SWITCH32 26 -+#define R_SH_USES 27 -+#define R_SH_COUNT 28 -+#define R_SH_ALIGN 29 -+#define R_SH_CODE 30 -+#define R_SH_DATA 31 -+#define R_SH_LABEL 32 -+#define R_SH_SWITCH8 33 -+#define R_SH_GNU_VTINHERIT 34 -+#define R_SH_GNU_VTENTRY 35 -+#define R_SH_TLS_GD_32 144 -+#define R_SH_TLS_LD_32 145 -+#define R_SH_TLS_LDO_32 146 -+#define R_SH_TLS_IE_32 147 -+#define R_SH_TLS_LE_32 148 -+#define R_SH_TLS_DTPMOD32 149 -+#define R_SH_TLS_DTPOFF32 150 -+#define R_SH_TLS_TPOFF32 151 -+#define R_SH_GOT32 160 -+#define R_SH_PLT32 161 -+#define R_SH_COPY 162 -+#define R_SH_GLOB_DAT 163 -+#define R_SH_JMP_SLOT 164 -+#define R_SH_RELATIVE 165 -+#define R_SH_GOTOFF 166 -+#define R_SH_GOTPC 167 -+/* Keep this the last entry. */ -+#define R_SH_NUM 256 -+ -+/* Additional s390 relocs */ -+ -+#define R_390_NONE 0 /* No reloc. */ -+#define R_390_8 1 /* Direct 8 bit. */ -+#define R_390_12 2 /* Direct 12 bit. */ -+#define R_390_16 3 /* Direct 16 bit. */ -+#define R_390_32 4 /* Direct 32 bit. */ -+#define R_390_PC32 5 /* PC relative 32 bit. */ -+#define R_390_GOT12 6 /* 12 bit GOT offset. */ -+#define R_390_GOT32 7 /* 32 bit GOT offset. */ -+#define R_390_PLT32 8 /* 32 bit PC relative PLT address. */ -+#define R_390_COPY 9 /* Copy symbol at runtime. */ -+#define R_390_GLOB_DAT 10 /* Create GOT entry. */ -+#define R_390_JMP_SLOT 11 /* Create PLT entry. */ -+#define R_390_RELATIVE 12 /* Adjust by program base. */ -+#define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */ -+#define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */ -+#define R_390_GOT16 15 /* 16 bit GOT offset. */ -+#define R_390_PC16 16 /* PC relative 16 bit. */ -+#define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */ -+#define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */ -+#define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */ -+#define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */ -+#define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */ -+#define R_390_64 22 /* Direct 64 bit. */ -+#define R_390_PC64 23 /* PC relative 64 bit. */ -+#define R_390_GOT64 24 /* 64 bit GOT offset. */ -+#define R_390_PLT64 25 /* 64 bit PC relative PLT address. */ -+#define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */ -+#define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */ -+#define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */ -+#define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */ -+#define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */ -+#define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */ -+#define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */ -+#define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */ -+#define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */ -+#define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */ -+#define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */ -+#define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */ -+#define R_390_TLS_GDCALL 38 /* Tag for function call in general -+ dynamic TLS code. */ -+#define R_390_TLS_LDCALL 39 /* Tag for function call in local -+ dynamic TLS code. */ -+#define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic -+ thread local data. */ -+#define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic -+ thread local data. */ -+#define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS -+ block offset. */ -+#define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS -+ block offset. */ -+#define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS -+ block offset. */ -+#define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic -+ thread local data in LE code. */ -+#define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic -+ thread local data in LE code. */ -+#define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for -+ negated static TLS block offset. */ -+#define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for -+ negated static TLS block offset. */ -+#define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for -+ negated static TLS block offset. */ -+#define R_390_TLS_LE32 50 /* 32 bit negated offset relative to -+ static TLS block. */ -+#define R_390_TLS_LE64 51 /* 64 bit negated offset relative to -+ static TLS block. */ -+#define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS -+ block. */ -+#define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS -+ block. */ -+#define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */ -+#define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */ -+#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS -+ block. */ -+#define R_390_20 57 /* Direct 20 bit. */ -+#define R_390_GOT20 58 /* 20 bit GOT offset. */ -+#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */ -+#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS -+ block offset. */ -+/* Keep this the last entry. */ -+#define R_390_NUM 61 -+ -+ -+/* CRIS relocations. */ -+#define R_CRIS_NONE 0 -+#define R_CRIS_8 1 -+#define R_CRIS_16 2 -+#define R_CRIS_32 3 -+#define R_CRIS_8_PCREL 4 -+#define R_CRIS_16_PCREL 5 -+#define R_CRIS_32_PCREL 6 -+#define R_CRIS_GNU_VTINHERIT 7 -+#define R_CRIS_GNU_VTENTRY 8 -+#define R_CRIS_COPY 9 -+#define R_CRIS_GLOB_DAT 10 -+#define R_CRIS_JUMP_SLOT 11 -+#define R_CRIS_RELATIVE 12 -+#define R_CRIS_16_GOT 13 -+#define R_CRIS_32_GOT 14 -+#define R_CRIS_16_GOTPLT 15 -+#define R_CRIS_32_GOTPLT 16 -+#define R_CRIS_32_GOTREL 17 -+#define R_CRIS_32_PLT_GOTREL 18 -+#define R_CRIS_32_PLT_PCREL 19 -+ -+#define R_CRIS_NUM 20 -+ -+ -+/* AMD x86-64 relocations. */ -+#define R_X86_64_NONE 0 /* No reloc */ -+#define R_X86_64_64 1 /* Direct 64 bit */ -+#define R_X86_64_PC32 2 /* PC relative 32 bit signed */ -+#define R_X86_64_GOT32 3 /* 32 bit GOT entry */ -+#define R_X86_64_PLT32 4 /* 32 bit PLT address */ -+#define R_X86_64_COPY 5 /* Copy symbol at runtime */ -+#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ -+#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ -+#define R_X86_64_RELATIVE 8 /* Adjust by program base */ -+#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative -+ offset to GOT */ -+#define R_X86_64_32 10 /* Direct 32 bit zero extended */ -+#define R_X86_64_32S 11 /* Direct 32 bit sign extended */ -+#define R_X86_64_16 12 /* Direct 16 bit zero extended */ -+#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ -+#define R_X86_64_8 14 /* Direct 8 bit sign extended */ -+#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ -+#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ -+#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */ -+#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */ -+#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset -+ to two GOT entries for GD symbol */ -+#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset -+ to two GOT entries for LD symbol */ -+#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ -+#define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset -+ to GOT entry for IE symbol */ -+#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */ -+ -+#define R_X86_64_NUM 24 -+ -+ -+/* AM33 relocations. */ -+#define R_MN10300_NONE 0 /* No reloc. */ -+#define R_MN10300_32 1 /* Direct 32 bit. */ -+#define R_MN10300_16 2 /* Direct 16 bit. */ -+#define R_MN10300_8 3 /* Direct 8 bit. */ -+#define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */ -+#define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */ -+#define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */ -+#define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */ -+#define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */ -+#define R_MN10300_24 9 /* Direct 24 bit. */ -+#define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */ -+#define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */ -+#define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */ -+#define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */ -+#define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */ -+#define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */ -+#define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */ -+#define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */ -+#define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */ -+#define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */ -+#define R_MN10300_COPY 20 /* Copy symbol at runtime. */ -+#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ -+#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ -+#define R_MN10300_RELATIVE 23 /* Adjust by program base. */ -+ -+#define R_MN10300_NUM 24 -+ -+ -+/* M32R relocs. */ -+#define R_M32R_NONE 0 /* No reloc. */ -+#define R_M32R_16 1 /* Direct 16 bit. */ -+#define R_M32R_32 2 /* Direct 32 bit. */ -+#define R_M32R_24 3 /* Direct 24 bit. */ -+#define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */ -+#define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */ -+#define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */ -+#define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */ -+#define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */ -+#define R_M32R_LO16 9 /* Low 16 bit. */ -+#define R_M32R_SDA16 10 /* 16 bit offset in SDA. */ -+#define R_M32R_GNU_VTINHERIT 11 -+#define R_M32R_GNU_VTENTRY 12 -+/* M32R relocs use SHT_RELA. */ -+#define R_M32R_16_RELA 33 /* Direct 16 bit. */ -+#define R_M32R_32_RELA 34 /* Direct 32 bit. */ -+#define R_M32R_24_RELA 35 /* Direct 24 bit. */ -+#define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */ -+#define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */ -+#define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */ -+#define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */ -+#define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */ -+#define R_M32R_LO16_RELA 41 /* Low 16 bit */ -+#define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */ -+#define R_M32R_RELA_GNU_VTINHERIT 43 -+#define R_M32R_RELA_GNU_VTENTRY 44 -+#define R_M32R_REL32 45 /* PC relative 32 bit. */ -+ -+#define R_M32R_GOT24 48 /* 24 bit GOT entry */ -+#define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */ -+#define R_M32R_COPY 50 /* Copy symbol at runtime */ -+#define R_M32R_GLOB_DAT 51 /* Create GOT entry */ -+#define R_M32R_JMP_SLOT 52 /* Create PLT entry */ -+#define R_M32R_RELATIVE 53 /* Adjust by program base */ -+#define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */ -+#define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */ -+#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned -+ low */ -+#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed -+ low */ -+#define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */ -+#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to -+ GOT with unsigned low */ -+#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to -+ GOT with signed low */ -+#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to -+ GOT */ -+#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT -+ with unsigned low */ -+#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT -+ with signed low */ -+#define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */ -+#define R_M32R_NUM 256 /* Keep this the last entry. */ -+ -+__END_DECLS -+ -+#endif /* elf.h */ ---- ./hotspot/src/share/vm/utilities/elfFile.hpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/elfFile.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -27,7 +27,13 @@ - - #ifndef _WINDOWS - -+#ifdef __APPLE__ -+#include "elf.hpp" -+#elif defined(__OpenBSD__) -+#include <sys/exec_elf.h> -+#else - #include <elf.h> -+#endif - #include <stdio.h> - - #ifdef _LP64 -@@ -41,7 +47,9 @@ - typedef Elf64_Shdr Elf_Shdr; - typedef Elf64_Sym Elf_Sym; - -+#if !defined(_ALLBSD_SOURCE) || defined(__APPLE__) - #define ELF_ST_TYPE ELF64_ST_TYPE -+#endif - - #else - -@@ -55,8 +63,10 @@ - typedef Elf32_Shdr Elf_Shdr; - typedef Elf32_Sym Elf_Sym; - -+#if !defined(_ALLBSD_SOURCE) || defined(__APPLE__) - #define ELF_ST_TYPE ELF32_ST_TYPE - #endif -+#endif - - #include "globalDefinitions.hpp" - #include "memory/allocation.hpp" ---- ./hotspot/src/share/vm/utilities/events.cpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/events.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -38,6 +38,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - #ifndef PRODUCT ---- ./hotspot/src/share/vm/utilities/exceptions.cpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/exceptions.cpp 2011-05-07 21:53:42.000000000 -0700 -@@ -42,6 +42,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - - // Implementation of ThreadShadow ---- ./hotspot/src/share/vm/utilities/globalDefinitions.hpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/globalDefinitions.hpp 2012-02-12 13:05:33.000000000 -0800 -@@ -25,6 +25,10 @@ - #ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP - #define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP - -+#ifndef __STDC_FORMAT_MACROS -+#define __STDC_FORMAT_MACROS -+#endif -+ - #ifdef TARGET_COMPILER_gcc - # include "utilities/globalDefinitions_gcc.hpp" - #endif -@@ -37,6 +41,8 @@ - - #include "utilities/macros.hpp" - -+#include <inttypes.h> -+ - // This file holds all globally used constants & types, class (forward) - // declarations and a few frequently used utility functions. - -@@ -1188,20 +1194,20 @@ - #define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false") - - // Format 32-bit quantities. --#define INT32_FORMAT "%d" --#define UINT32_FORMAT "%u" -+#define INT32_FORMAT "%" PRId32 -+#define UINT32_FORMAT "%" PRIu32 - #define INT32_FORMAT_W(width) "%" #width "d" - #define UINT32_FORMAT_W(width) "%" #width "u" - --#define PTR32_FORMAT "0x%08x" -+#define PTR32_FORMAT "0x%08" PRIx32 - - // Format 64-bit quantities. --#define INT64_FORMAT "%" FORMAT64_MODIFIER "d" --#define UINT64_FORMAT "%" FORMAT64_MODIFIER "u" --#define PTR64_FORMAT "0x%016" FORMAT64_MODIFIER "x" -+#define INT64_FORMAT "%" PRId64 -+#define UINT64_FORMAT "%" PRIu64 -+#define PTR64_FORMAT "0x%016" PRIx64 - --#define INT64_FORMAT_W(width) "%" #width FORMAT64_MODIFIER "d" --#define UINT64_FORMAT_W(width) "%" #width FORMAT64_MODIFIER "u" -+#define INT64_FORMAT_W(width) "%" #width PRId64 -+#define UINT64_FORMAT_W(width) "%" #width PRIu64 - - // Format macros that allow the field width to be specified. The width must be - // a string literal (e.g., "8") or a macro that evaluates to one. -@@ -1226,19 +1232,17 @@ - // using "%x". - #ifdef _LP64 - #define PTR_FORMAT PTR64_FORMAT --#define UINTX_FORMAT UINT64_FORMAT --#define INTX_FORMAT INT64_FORMAT - #define SIZE_FORMAT UINT64_FORMAT - #define SSIZE_FORMAT INT64_FORMAT - #else // !_LP64 - #define PTR_FORMAT PTR32_FORMAT --#define UINTX_FORMAT UINT32_FORMAT --#define INTX_FORMAT INT32_FORMAT - #define SIZE_FORMAT UINT32_FORMAT - #define SSIZE_FORMAT INT32_FORMAT - #endif // _LP64 -+#define UINTX_FORMAT "%" PRIuPTR -+#define INTX_FORMAT "%" PRIdPTR - --#define INTPTR_FORMAT PTR_FORMAT -+#define INTPTR_FORMAT "%" PRIdPTR - - // Enable zap-a-lot if in debug version. - ---- ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2011-04-23 12:13:39.000000000 -0700 -@@ -76,15 +76,28 @@ - # include <sys/procfs.h> - # endif - --#ifdef LINUX -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - #ifndef __STDC_LIMIT_MACROS - #define __STDC_LIMIT_MACROS - #endif // __STDC_LIMIT_MACROS - #include <inttypes.h> - #include <signal.h> -+#ifndef __OpenBSD__ - #include <ucontext.h> -+#endif -+#ifdef __APPLE__ -+ #include <AvailabilityMacros.h> -+ #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) -+ // Mac OS X 10.4 defines EFL_AC and EFL_ID, -+ // which conflict with hotspot variable names. -+ // -+ // This has been fixed in Mac OS X 10.5. -+ #undef EFL_AC -+ #undef EFL_ID -+ #endif -+#endif - #include <sys/time.h> --#endif // LINUX -+#endif // LINUX || _ALLBSD_SOURCE - - // 4810578: varargs unsafe on 32-bit integer/64-bit pointer architectures - // When __cplusplus is defined, NULL is defined as 0 (32-bit constant) in -@@ -120,7 +133,7 @@ - // pointer is stored as integer value. On some platforms, sizeof(intptr_t) > - // sizeof(void*), so here we want something which is integer type, but has the - // same size as a pointer. --#ifdef LINUX -+#ifdef __GNUC__ - #ifdef _LP64 - #define NULL_WORD 0L - #else -@@ -132,7 +145,7 @@ - #define NULL_WORD NULL - #endif - --#ifndef LINUX -+#if !defined(LINUX) && !defined(_ALLBSD_SOURCE) - // Compiler-specific primitive types - typedef unsigned short uint16_t; - #ifndef _UINT32_T -@@ -152,7 +165,7 @@ - // prior definition of intptr_t, and add "&& !defined(XXX)" above. - #endif // _SYS_INT_TYPES_H - --#endif // !LINUX -+#endif // !LINUX && !_ALLBSD_SOURCE - - // Additional Java basic types - -@@ -244,7 +257,9 @@ - inline int g_isnan(float f) { return isnand(f); } - #endif - inline int g_isnan(double f) { return isnand(f); } --#elif LINUX -+#elif defined(__APPLE__) -+inline int g_isnan(double f) { return isnan(f); } -+#elif defined(LINUX) || defined(_ALLBSD_SOURCE) - inline int g_isnan(float f) { return isnanf(f); } - inline int g_isnan(double f) { return isnan(f); } - #else ---- ./hotspot/src/share/vm/utilities/growableArray.cpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/growableArray.cpp 2011-04-22 22:28:37.000000000 -0700 -@@ -34,6 +34,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - #ifdef ASSERT - void GenericGrowableArray::set_nesting() { - if (on_stack()) { ---- ./hotspot/src/share/vm/utilities/histogram.hpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/histogram.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - // This class provides a framework for collecting various statistics. - // The current implementation is oriented towards counting invocations ---- ./hotspot/src/share/vm/utilities/macros.hpp 2011-11-17 21:38:47.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/macros.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -161,6 +161,14 @@ - #define NOT_WINDOWS(code) code - #endif - -+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) -+#define BSD_ONLY(code) code -+#define NOT_BSD(code) -+#else -+#define BSD_ONLY(code) -+#define NOT_BSD(code) code -+#endif -+ - #ifdef _WIN64 - #define WIN64_ONLY(code) code - #define NOT_WIN64(code) ---- ./hotspot/src/share/vm/utilities/ostream.cpp 2011-11-17 21:38:48.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/ostream.cpp 2012-02-26 13:59:22.000000000 -0800 -@@ -39,6 +39,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "os_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "os_bsd.inline.hpp" -+#endif - - extern "C" void jio_print(const char* s); // Declarationtion of jvm method - -@@ -992,7 +995,7 @@ - - #ifndef PRODUCT - --#if defined(SOLARIS) || defined(LINUX) -+#if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE) - #include <sys/types.h> - #include <sys/socket.h> - #include <netinet/in.h> ---- ./hotspot/src/share/vm/utilities/preserveException.hpp 2011-11-17 21:38:48.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/preserveException.hpp 2011-04-22 22:28:37.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // This file provides more support for exception handling; see also exceptions.hpp - class PreserveExceptionMark { ---- ./hotspot/src/share/vm/utilities/taskqueue.cpp 2011-11-17 21:38:49.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/taskqueue.cpp 2011-04-22 22:28:38.000000000 -0700 -@@ -37,6 +37,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - #ifdef TRACESPINNING - uint ParallelTaskTerminator::_total_yields = 0; ---- ./hotspot/src/share/vm/utilities/taskqueue.hpp 2011-11-17 21:38:49.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/taskqueue.hpp 2011-04-22 22:28:38.000000000 -0700 -@@ -53,6 +53,12 @@ - #ifdef TARGET_OS_ARCH_linux_ppc - # include "orderAccess_linux_ppc.inline.hpp" - #endif -+#ifdef TARGET_OS_ARCH_bsd_x86 -+# include "orderAccess_bsd_x86.inline.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_zero -+# include "orderAccess_bsd_zero.inline.hpp" -+#endif - - // Simple TaskQueue stats that are collected by default in debug builds. - ---- ./hotspot/src/share/vm/utilities/vmError.cpp 2011-11-17 21:38:49.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/vmError.cpp 2011-04-22 22:28:38.000000000 -0700 -@@ -45,13 +45,18 @@ - "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH", - "JAVA_COMPILER", "PATH", "USERNAME", - -- // Env variables that are defined on Solaris/Linux -+ // Env variables that are defined on Solaris/Linux/BSD - "LD_LIBRARY_PATH", "LD_PRELOAD", "SHELL", "DISPLAY", - "HOSTTYPE", "OSTYPE", "ARCH", "MACHTYPE", - - // defined on Linux - "LD_ASSUME_KERNEL", "_JAVA_SR_SIGNUM", - -+ // defined on Darwin -+ "DYLD_LIBRARY_PATH", "DYLD_FALLBACK_LIBRARY_PATH", -+ "DYLD_FRAMEWORK_PATH", "DYLD_FALLBACK_FRAMEWORK_PATH", -+ "DYLD_INSERT_LIBRARIES", -+ - // defined on Windows - "OS", "PROCESSOR_IDENTIFIER", "_ALT_JAVA_HOME_DIR", - -@@ -958,7 +963,7 @@ - const char* ptr = OnError; - while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){ - out.print_raw ("# Executing "); --#if defined(LINUX) -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - out.print_raw ("/bin/sh -c "); - #elif defined(SOLARIS) - out.print_raw ("/usr/bin/sh -c "); ---- ./hotspot/src/share/vm/utilities/workgroup.hpp 2011-11-17 21:38:49.000000000 -0800 -+++ ./hotspot/src/share/vm/utilities/workgroup.hpp 2011-04-22 22:28:38.000000000 -0700 -@@ -35,6 +35,9 @@ - #ifdef TARGET_OS_FAMILY_windows - # include "thread_windows.inline.hpp" - #endif -+#ifdef TARGET_OS_FAMILY_bsd -+# include "thread_bsd.inline.hpp" -+#endif - - // Task class hierarchy: - // AbstractGangTask ---- ./hotspot/test/Makefile 2011-11-17 21:38:50.000000000 -0800 -+++ ./hotspot/test/Makefile 2011-04-22 22:28:38.000000000 -0700 -@@ -44,6 +44,22 @@ - ARCH = i586 - endif - endif -+ifeq ($(OSNAME), Darwin) -+ PLATFORM = bsd -+ SLASH_JAVA = /java -+ ARCH = $(shell uname -m) -+ ifeq ($(ARCH), i386) -+ ARCH = i586 -+ endif -+endif -+ifeq ($(findstring BSD,$(OSNAME)), BSD) -+ PLATFORM = bsd -+ SLASH_JAVA = /java -+ ARCH = $(shell uname -m) -+ ifeq ($(ARCH), i386) -+ ARCH = i586 -+ endif -+endif - ifeq ($(OSNAME), Windows_NT) - PLATFORM = windows - SLASH_JAVA = J: -@@ -143,7 +159,7 @@ - endif - - # Expect JPRT to set TESTDIRS to the jtreg test dirs --JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof -+JTREG_TESTDIRS = compiler - ifdef TESTDIRS - JTREG_TESTDIRS = $(TESTDIRS) - endif ---- ./hotspot/test/compiler/5091921/Test7005594.sh 2011-11-17 21:38:50.000000000 -0800 -+++ ./hotspot/test/compiler/5091921/Test7005594.sh 2012-03-03 22:34:03.000000000 -0800 +--- hotspot/test/compiler/5091921/Test7005594.sh 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/test/compiler/5091921/Test7005594.sh 2012-03-03 22:34:03.000000000 -0800 @@ -71,6 +71,9 @@ # Windows/MKS MEM=`"$ROOTDIR/mksnt/sysinf" memory -v | grep "Total Physical Memory: " | sed 's/Total Physical Memory: *//g'` @@ -14295,8 +368,8 @@ else echo "Unable to determine amount of physical memory on the machine" fi ---- ./hotspot/test/gc/6941923/test6941923.sh 2011-11-17 21:39:01.000000000 -0800 -+++ ./hotspot/test/gc/6941923/test6941923.sh 2012-03-03 22:35:30.000000000 -0800 +--- hotspot/test/gc/6941923/test6941923.sh 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/test/gc/6941923/test6941923.sh 2012-03-03 22:35:30.000000000 -0800 @@ -9,7 +9,7 @@ ## skip on windows OS=`uname -s` @@ -14306,88 +379,8 @@ NULL=/dev/null PS=":" FS="/" ---- ./hotspot/test/jprt.config 2011-11-17 21:39:01.000000000 -0800 -+++ ./hotspot/test/jprt.config 2011-04-22 22:28:38.000000000 -0700 -@@ -75,8 +75,8 @@ - - # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. - osname=`uname -s` --if [ "${osname}" = SunOS ] ; then -- -+case "${osname}" in -+ SunOS ) - # SOLARIS: Sparc or X86 - osarch=`uname -p` - if [ "${osarch}" = sparc ] ; then -@@ -100,9 +100,9 @@ - - # File creation mask - umask 002 -+ ;; - --elif [ "${osname}" = Linux ] ; then -- -+ Linux | Darwin ) - # Add basic paths - path4sdk=/usr/bin:/bin:/usr/sbin:/sbin - -@@ -111,9 +111,31 @@ - fileMustExist "${make}" make - - umask 002 -+ ;; -+ -+ FreeBSD | OpenBSD ) -+ # Add basic paths -+ path4sdk=/usr/bin:/bin:/usr/sbin:/sbin -+ -+ # Find GNU make -+ make=/usr/local/bin/gmake -+ fileMustExist "${make}" make -+ -+ umask 002 -+ ;; - --else -+ NetBSD ) -+ # Add basic paths -+ path4sdk=/usr/bin:/bin:/usr/sbin:/sbin - -+ # Find GNU make -+ make=/usr/pkg/bin/gmake -+ fileMustExist "${make}" make -+ -+ umask 002 -+ ;; -+ -+ * ) - # Windows: Differs on CYGWIN vs. MKS. - - # We need to determine if we are running a CYGWIN shell or an MKS shell -@@ -154,8 +176,8 @@ - if [ "${unix_toolset}" = CYGWIN ] ; then - path4sdk="`/usr/bin/cygpath -p ${path4sdk}`" - fi -- --fi -+ ;; -+esac - - # Export PATH setting - PATH="${path4sdk}" ---- ./hotspot/test/runtime/6929067/Test6929067.sh 2011-11-17 21:39:01.000000000 -0800 -+++ ./hotspot/test/runtime/6929067/Test6929067.sh 2011-04-22 22:28:38.000000000 -0700 -@@ -29,7 +29,7 @@ - PS=":" - FS="/" - ;; -- SunOS | Windows_* ) -+ SunOS | Windows_* | *BSD) - NULL=NUL - PS=";" - FS="\\" ---- ./hotspot/test/runtime/7020373/Test7020373.sh 2011-11-17 21:39:01.000000000 -0800 -+++ ./hotspot/test/runtime/7020373/Test7020373.sh 2011-06-21 18:23:22.000000000 -0700 +--- hotspot/test/runtime/7020373/Test7020373.sh 2012-05-26 23:29:10.000000000 -0700 ++++ hotspot/test/runtime/7020373/Test7020373.sh 2011-06-21 18:23:22.000000000 -0700 @@ -32,7 +32,7 @@ # set platform-dependent variables OS=`uname -s` @@ -14397,84 +390,60 @@ NULL=/dev/null PS=":" FS="/" ---- ./jaxp/.hgtags 2011-11-17 21:40:18.000000000 -0800 -+++ ./jaxp/.hgtags 2012-02-26 13:58:25.000000000 -0800 -@@ -139,3 +139,5 @@ - 407177580b012f89df837094b45287b7d250c911 jdk7u1-b08 - 0c5c2b2462f104970eefa4a47b3c4428efd81cf0 jdk7u2-b11 - 0e61ef309edd2deb71f53f2bdaf6dcff1c80bfb8 jdk7u2-b12 -+d9ac427e5149d1db12c6f3e4aa4280587c06aed5 jdk7u2-b13 -+0efaf5c97fba2ee7864240efaa0df651a2635ae5 jdk7u2-b21 ---- ./jaxws/.hgtags 2011-11-17 21:41:46.000000000 -0800 -+++ ./jaxws/.hgtags 2012-02-26 13:58:41.000000000 -0800 -@@ -139,3 +139,5 @@ - 97365155cf6df7a7bed4d9e288eab8b7b58f72d7 jdk7u1-b08 - f3bb1066a71f2a64c7bcf45a7ba0a8de63657696 jdk7u2-b11 - 21131044a61353ac20e360bce52d8f480e08d7a2 jdk7u2-b12 -+9728fd833e01faa5e51484aeaf3c51d32d1175fb jdk7u2-b13 -+d6db86a7ca32e6d97844f633badc0d516e55694f jdk7u2-b21 ---- ./jdk/.hgtags 2011-11-17 21:55:30.000000000 -0800 -+++ ./jdk/.hgtags 2012-02-26 15:38:41.000000000 -0800 -@@ -139,3 +139,5 @@ - 50d739b0c45631b386af3f2cb6235f137c1a6e91 jdk7u1-b08 - b5090771e19b2b20670bef60a84de95797cb01be jdk7u2-b11 - 79c8c4608f60e1f981b17ba4077dfcaa2ed67be4 jdk7u2-b12 -+fb2980d7c9439e3d62ab12f40506a2a2db2df0f4 jdk7u2-b13 -+24e42f1f9029f9f5a9b1481d523facaf09452e5b jdk7u2-b21 ---- ./jdk/make/com/sun/java/pack/Makefile 2011-11-17 21:55:32.000000000 -0800 -+++ ./jdk/make/com/sun/java/pack/Makefile 2011-05-07 21:54:09.000000000 -0700 -@@ -57,6 +57,7 @@ - vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR) - - ifeq ($(STANDALONE),true) -+ ifneq ($(SYSTEM_ZLIB),true) - ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME) - - ZIPOBJS = $(ZIPOBJDIR)/zcrc32.$(OBJECT_SUFFIX) \ -@@ -73,6 +74,10 @@ - ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) - OTHER_CXXFLAGS += $(ZINCLUDE) - LDDFLAGS += $(ZIPOBJS) -+ else -+ LDDFLAGS += -lz -+ OTHER_CXXFLAGS += -DSYSTEM_ZLIB -+ endif - else - OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI - OTHER_LDLIBS += $(JVMLIB) -@@ -94,7 +99,11 @@ - RES = $(OBJDIR)/$(PGRM).res - else - LDOUTPUT = -o #Have a space -+ifeq ($(PLATFORM), bsd) -+ LDDFLAGS += -pthread -+else - LDDFLAGS += -lc -+endif - OTHER_LDLIBS += $(LIBCXX) - # setup the list of libraries to link in... - ifeq ($(PLATFORM), linux) ---- ./jdk/make/com/sun/nio/Makefile 2011-11-17 21:55:32.000000000 -0800 -+++ ./jdk/make/com/sun/nio/Makefile 2011-04-22 23:08:15.000000000 -0700 -@@ -30,7 +30,16 @@ - BUILDDIR = ../../.. +--- jaxp/.hgtags 2012-05-26 23:29:10.000000000 -0700 ++++ jaxp/.hgtags 2012-05-15 20:12:43.000000000 -0700 +@@ -123,6 +123,7 @@ + bcd31fa1e3c6f51b4fdd427ef905188cdac57164 jdk7-b146 + 067fb18071e3872698f6218724958bd0cebf30a3 jdk7u1-b01 + fc268cd1dd5d2e903ccd4b0275e1f9c2461ed30c jdk7-b147 ++3170972bd3928a331c4c64a5c0c9632077fb399a 7u0 + 104ca42e1e7ca66b074a4619ce6420f15d8f454d jdk7u1-b02 + 64e323faadf65018c1ffc8bb9c97f7b664e87347 jdk7u1-b03 + 2256c20e66857f80cacda14ffdbc0979c929d7f8 jdk7u1-b04 +--- jaxws/.hgtags 2012-05-26 23:29:10.000000000 -0700 ++++ jaxws/.hgtags 2012-05-15 20:13:50.000000000 -0700 +@@ -123,6 +123,7 @@ + 05469dd4c3662c454f8a019e492543add60795cc jdk7-b146 + c01bfd68d0528bc88348813c4d75d7f5c62bc4e2 jdk7u1-b01 + d13b1f877bb5ed8dceb2f7ec10365d1db5f70b2d jdk7-b147 ++ce6378e3c791c56b98cbf161804a07d0225b41c0 7u0 + 4c24f7019ce939a452154a83151294ad7da66a9d jdk7u1-b02 + 272778f529d11081f548f37fcd6a7aec0b11a8dd jdk7u1-b03 + 48b06a6e6f46e5bcd610f4bed57cd5067cf31f8c jdk7u1-b04 +--- jdk/.hgtags 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/.hgtags 2012-05-17 16:14:52.000000000 -0700 +@@ -123,6 +123,7 @@ + 539e576793a8e64aaf160e0d6ab0b9723cd0bef0 jdk7-b146 + 69e973991866c948cf1808b06884ef2d28b64fcb jdk7u1-b01 + f097ca2434b1412b12ab4a5c2397ce271bf681e7 jdk7-b147 ++0870207843e2a74816dff1e33a717ffaf6f0a919 7u0 + 2baf612764d215e6f3a5b48533f74c6924ac98d7 jdk7u1-b02 + a4781b6d9cfb6901452579adee17c9a17c1b584c jdk7u1-b03 + b223ed9a5fdf8ce3af42adfa8815975811d70eae jdk7u1-b04 +--- jdk/make/com/sun/nio/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/com/sun/nio/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -31,11 +31,18 @@ include $(BUILDDIR)/common/Defs.gmk -+ifneq ($(PLATFORM), bsd) + # MMM: disable for now +-ifneq ($(PLATFORM), macosx) ++ifeq (,$(findstring $(PLATFORM), bsd macosx)) + include $(BUILDDIR)/common/Subdirs.gmk SUBDIRS = sctp -+else + endif + +ifeq ($(OS_VENDOR), FreeBSD) +# FreeBSD 5.x and lower are unsupported, 6.x has no sctp support. +ifneq ($(call MajorVersion,$(shell uname -r)), 6) ++include $(BUILDDIR)/common/Subdirs.gmk +SUBDIRS = sctp +endif +endif -+endif - include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: ---- ./jdk/make/com/sun/nio/sctp/Makefile 2011-11-17 21:55:32.000000000 -0800 -+++ ./jdk/make/com/sun/nio/sctp/Makefile 2011-04-22 23:08:15.000000000 -0700 + $(SUBDIRS-loop) +--- jdk/make/com/sun/nio/sctp/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/com/sun/nio/sctp/Makefile 2011-04-22 23:08:15.000000000 -0700 @@ -59,15 +59,11 @@ -I$(PLATFORM_SRC)/native/java/net \ -I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders @@ -14493,293 +462,520 @@ else # windows include $(BUILDDIR)/common/Classes.gmk ---- ./jdk/make/com/sun/security/auth/module/Makefile 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/com/sun/security/auth/module/Makefile 2011-04-22 23:08:15.000000000 -0700 +--- jdk/make/com/sun/security/auth/module/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/com/sun/security/auth/module/Makefile 2012-05-17 16:18:00.000000000 -0700 @@ -67,7 +67,7 @@ include FILES_c_solaris.gmk endif # solaris --ifeq ($(PLATFORM), linux) -+ifneq (,$(findstring $(PLATFORM), linux bsd)) +-ifneq (,$(findstring $(PLATFORM), linux macosx)) ++ifneq (,$(findstring $(PLATFORM), linux bsd macosx)) LIBRARY = jaas_unix include FILES_export_unix.gmk include FILES_c_unix.gmk ---- ./jdk/make/com/sun/tools/attach/Exportedfiles.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/com/sun/tools/attach/Exportedfiles.gmk 2011-04-22 23:08:15.000000000 -0700 -@@ -43,5 +43,7 @@ +--- jdk/make/com/sun/tools/attach/Exportedfiles.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/com/sun/tools/attach/Exportedfiles.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -43,7 +43,7 @@ sun/tools/attach/LinuxVirtualMachine.java endif -- -- -+ifeq ($(PLATFORM), bsd) -+FILES_export = \ -+ sun/tools/attach/BsdVirtualMachine.java -+endif ---- ./jdk/make/com/sun/tools/attach/FILES_c.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/com/sun/tools/attach/FILES_c.gmk 2011-04-22 23:08:15.000000000 -0700 -@@ -39,4 +39,7 @@ +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + FILES_export = \ + sun/tools/attach/BsdVirtualMachine.java + endif +--- jdk/make/com/sun/tools/attach/FILES_c.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/com/sun/tools/attach/FILES_c.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -39,7 +39,7 @@ LinuxVirtualMachine.c endif -- -+ifeq ($(PLATFORM),bsd) -+FILES_c = \ -+ BsdVirtualMachine.c -+endif ---- ./jdk/make/com/sun/tools/attach/FILES_java.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/com/sun/tools/attach/FILES_java.gmk 2011-04-22 23:08:15.000000000 -0700 -@@ -43,6 +43,11 @@ +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + FILES_c = \ + BsdVirtualMachine.c + endif +--- jdk/make/com/sun/tools/attach/FILES_java.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/com/sun/tools/attach/FILES_java.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -43,7 +43,7 @@ sun/tools/attach/LinuxAttachProvider.java endif -+ifeq ($(PLATFORM), bsd) -+FILES_java += \ -+ sun/tools/attach/BsdAttachProvider.java -+endif -+ - # - # Files that need to be copied - # ---- ./jdk/make/com/sun/tools/attach/Makefile 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/com/sun/tools/attach/Makefile 2011-06-21 05:39:00.000000000 -0700 -@@ -36,6 +36,9 @@ +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + FILES_java += \ + sun/tools/attach/BsdAttachProvider.java + endif +--- jdk/make/com/sun/tools/attach/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/com/sun/tools/attach/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -36,7 +36,7 @@ ifeq ($(PLATFORM), linux) FILES_m = mapfile-linux endif -+ifeq ($(PLATFORM), bsd) -+FILES_m = mapfile-bsd -+endif +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + FILES_m = mapfile-bsd + endif include $(BUILDDIR)/common/Mapfile-vers.gmk - - # ---- ./jdk/make/com/sun/tools/attach/mapfile-bsd 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/make/com/sun/tools/attach/mapfile-bsd 2011-04-22 23:08:15.000000000 -0700 -@@ -30,14 +30,12 @@ - Java_sun_tools_attach_BsdVirtualMachine_checkPermissions; - Java_sun_tools_attach_BsdVirtualMachine_close; - Java_sun_tools_attach_BsdVirtualMachine_connect; -- Java_sun_tools_attach_BsdVirtualMachine_getBsdThreadsManager; -- Java_sun_tools_attach_BsdVirtualMachine_isBsdThreads; - Java_sun_tools_attach_BsdVirtualMachine_open; - Java_sun_tools_attach_BsdVirtualMachine_sendQuitTo; -- Java_sun_tools_attach_BsdVirtualMachine_sendQuitToChildrenOf; - Java_sun_tools_attach_BsdVirtualMachine_socket; - Java_sun_tools_attach_BsdVirtualMachine_read; - Java_sun_tools_attach_BsdVirtualMachine_write; -+ Java_sun_tools_attach_BsdVirtualMachine_createAttachFile; - local: - *; - }; ---- ./jdk/make/common/Defs-bsd.gmk 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/make/common/Defs-bsd.gmk 2012-03-03 18:32:21.000000000 -0800 -@@ -25,7 +25,7 @@ - - # - # Makefile to specify compiler flags for programs and libraries --# targeted to Bsd. Should not contain any rules. -+# targeted to BSD. Should not contain any rules. - # - # WARNING: This file is shared with other workspaces. - # So when it includes other files, it must use JDK_TOPDIR. -@@ -61,7 +61,7 @@ +@@ -55,7 +55,7 @@ + EXTRA_LIBS += psapi.lib endif - # platform specific include files --PLATFORM_INCLUDE_NAME = $(PLATFORM) +-ifeq ($PLATFORM), macosx) ++ifeq ($(PLATFORM), macosx) + vpath %.c $(call NativeSrcDirList,,native/sun/tools/attach) + else + vpath %.c $(PLATFORM_SRC)/native/sun/tools/attach +--- jdk/make/common/Defs-bsd.gmk 1969-12-31 16:00:00.000000000 -0800 ++++ jdk/make/common/Defs-bsd.gmk 2012-05-22 22:28:15.000000000 -0700 +@@ -0,0 +1,480 @@ ++# ++# Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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. Oracle designates this ++# particular file as subject to the "Classpath" exception as provided ++# by Oracle in the LICENSE file that accompanied this code. ++# ++# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++# or visit www.oracle.com if you need additional information or have any ++# questions. ++# ++ ++# ++# Makefile to specify compiler flags for programs and libraries ++# targeted to BSD. Should not contain any rules. ++# ++# WARNING: This file is shared with other workspaces. ++# So when it includes other files, it must use JDK_TOPDIR. ++# ++ ++# Warning: the following variables are overriden by Defs.gmk. Set ++# values will be silently ignored: ++# CFLAGS (set $(OTHER_CFLAGS) instead) ++# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) ++# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) ++# LDFLAGS (set $(OTHER_LDFAGS) instead) ++# LDLIBS (set $(EXTRA_LIBS) instead) ++# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) ++ ++# Get shared JDK settings ++include $(JDK_MAKE_SHARED_DIR)/Defs.gmk ++ ++# Part of INCREMENTAL_BUILD mechanism. ++# Compiler emits things like: path/file.o: file.h ++# We want something like: relative_path/file.o relative_path/file.d: file.h ++CC_DEPEND = -MM ++CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' ++ ++ifndef PLATFORM_SRC ++ PLATFORM_SRC = $(BUILDDIR)/../src/solaris ++endif # PLATFORM_SRC ++ ++# Location of the various .properties files specific to BSD platform ++ifndef PLATFORM_PROPERTIES ++ PLATFORM_PROPERTIES = $(BUILDDIR)/../src/solaris/lib ++endif # PLATFORM_SRC ++ ++# BSD build pulls its platform sources from the solaris tree. ++JAVA_SRCDIR_LIST = src/macosx src/solaris src/share ++NATIVE_SRCDIR_LIST = src/macosx src/solaris src/share ++ ++# Platform specific closed sources ++ifndef OPENJDK ++ ifndef CLOSED_PLATFORM_SRC ++ CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris ++ endif ++endif ++ ++# platform specific include files +PLATFORM_INCLUDE_NAME = $(OS_NAME) - PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) - - # suffix used for make dependencies files. -@@ -151,9 +151,11 @@ - # We need this frame pointer to make it easy to walk the stacks. - # This should be the default on X86, but ia64 and amd64 may not have this - # as the default. --CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN --CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN --CFLAGS_REQUIRED_ia64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN ++PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) ++ ++# suffix used for make dependencies files. ++DEPEND_SUFFIX = d ++# The suffix applied to the library name for FDLIBM ++FDDLIBM_SUFFIX = a ++# The suffix applied to scripts (.bat for windows, nothing for unix) ++SCRIPT_SUFFIX = ++# CC compiler object code output directive flag value ++CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! ++CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required! ++ ++# Default OBJCOPY comes from GNU Binutils on BSD: ++DEF_OBJCOPY=/usr/bin/objcopy ++ifdef CROSS_COMPILE_ARCH ++ # don't try to generate .debuginfo files when cross compiling ++ _JUNK_ := $(shell \ ++ echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \ ++ "skipping .debuginfo generation.") ++ OBJCOPY= ++else ++ OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) ++ ifneq ($(ALT_OBJCOPY),) ++ _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") ++ # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path ++ OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) ++ endif ++endif ++ ++ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS ++# The setting of OBJCOPY above enables the JDK build to import ++# .debuginfo files from the HotSpot build. However, adding FDS ++# support to the JDK build will occur in phases so a different ++# make variable is used to indicate that a particular library ++# supports FDS. ++ ++ifeq ($(OBJCOPY),) ++ _JUNK_ := $(shell \ ++ echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") ++else ++ _JUNK_ := $(shell \ ++ echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") ++ ++ # Library stripping policies for .debuginfo configs: ++ # all_strip - strips everything from the library ++ # min_strip - strips most stuff from the library; leaves minimum symbols ++ # no_strip - does not strip the library at all ++ # ++ # Oracle security policy requires "all_strip". A waiver was granted on ++ # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. ++ # ++ DEF_STRIP_POLICY="min_strip" ++ ifeq ($(ALT_STRIP_POLICY),) ++ STRIP_POLICY=$(DEF_STRIP_POLICY) ++ else ++ STRIP_POLICY=$(ALT_STRIP_POLICY) ++ endif ++ ++ _JUNK_ := $(shell \ ++ echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") ++endif ++endif ++ ++# ++# Default optimization ++# ++ ++ifndef OPTIMIZATION_LEVEL ++ ifeq ($(PRODUCT), java) ++ OPTIMIZATION_LEVEL = HIGHER ++ else ++ OPTIMIZATION_LEVEL = LOWER ++ endif ++endif ++ifndef FASTDEBUG_OPTIMIZATION_LEVEL ++ FASTDEBUG_OPTIMIZATION_LEVEL = LOWER ++endif ++ ++CC_OPT/NONE = ++CC_OPT/LOWER = -O2 ++CC_OPT/HIGHER = -O3 ++CC_OPT/HIGHEST = -O3 ++ ++CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL)) ++ ++# For all platforms, do not omit the frame pointer register usage. ++# We need this frame pointer to make it easy to walk the stacks. ++# This should be the default on X86, but ia64 and amd64 may not have this ++# as the default. +CFLAGS_REQUIRED_amd64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN +LDFLAGS_COMMON_amd64 += -m64 +CFLAGS_REQUIRED_i586 += -m32 -fno-omit-frame-pointer -D_LITTLE_ENDIAN +LDFLAGS_COMMON_i586 += -m32 +CFLAGS_REQUIRED_ia64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN - CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9 - LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9 - CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9 -@@ -170,9 +172,13 @@ - CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) - LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH)) - endif -+ifeq ($(OS_VENDOR),Apple) -+ # 16-byte stack re-alignment on 32-bit Darwin -+ CFLAGS_REQUIRED_i586 += -mstackrealign ++CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9 ++LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9 ++CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9 ++LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 ++CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN ++CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN ++ifeq ($(ZERO_BUILD), true) ++ CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) ++ ifeq ($(ZERO_ENDIANNESS), little) ++ CFLAGS_REQUIRED += -D_LITTLE_ENDIAN ++ endif ++ LDFLAGS_COMMON += $(ZERO_ARCHFLAG) ++else ++ CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) ++ LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH)) +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. ++ ++# If this is a --hash-style=gnu system, use --hash-style=both +# The gnu .hash section won't work on some Linux 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 -@@ -207,7 +213,7 @@ - CFLAGS_COMMON += -pipe - endif - --# Bsd 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1 ++_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu') ++ifneq ($(_HAS_HASH_STYLE_GNU),) ++ LDFLAGS_HASH_STYLE = -Wl,--hash-style=both ++endif ++LDFLAGS_COMMON += $(LDFLAGS_HASH_STYLE) ++ ++# ++# Selection of warning messages ++# ++GCC_INHIBIT = -Wno-unused -Wno-parentheses ++GCC_STYLE = ++GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT) ++ ++# ++# Treat compiler warnings as errors, if warnings not allowed ++# ++ifeq ($(COMPILER_WARNINGS_FATAL),true) ++ GCC_WARNINGS += -Werror ++endif ++ ++# ++# Misc compiler options ++# ++ifneq ($(ARCH),ppc) ++ CFLAGS_COMMON = -fno-strict-aliasing ++endif ++PIC_CODE_LARGE = -fPIC ++PIC_CODE_SMALL = -fpic ++GLOBAL_KPIC = $(PIC_CODE_LARGE) ++CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) ++ifeq ($(ARCH), amd64) ++ CFLAGS_COMMON += -pipe ++endif ++ +# BSD 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1 - DEBUG_FLAG = -g - ifeq ($(FASTDEBUG), true) - ifeq ($(ARCH_DATA_MODEL), 64) -@@ -244,8 +250,7 @@ - else - CPP_ARCH_FLAGS += -D_$(ARCH)_ - endif -- --CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DBSD $(VERSION_DEFINES) \ ++DEBUG_FLAG = -g ++ifeq ($(FASTDEBUG), true) ++ ifeq ($(ARCH_DATA_MODEL), 64) ++ DEBUG_FLAG = -g1 ++ endif ++endif ++ ++# DEBUG_BINARIES overrides everything, use full -g debug information ++ifeq ($(DEBUG_BINARIES), true) ++ DEBUG_FLAG = -g ++ CFLAGS_REQUIRED += $(DEBUG_FLAG) ++endif ++ ++CFLAGS_OPT = $(CC_OPT) ++CFLAGS_DBG = $(DEBUG_FLAG) ++CFLAGS_COMMON += $(CFLAGS_REQUIRED) ++ ++CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS) ++CXXFLAGS_OPT = $(CC_OPT) ++CXXFLAGS_DBG = $(DEBUG_FLAG) ++CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) ++ ++# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java ++ifeq ($(FASTDEBUG), true) ++ CFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) ++ CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) ++endif ++ ++CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"' ++ ++# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here) ++ifneq ($(ARCH),alpha) ++ CPP_ARCH_FLAGS += -D$(ARCH) ++else ++ CPP_ARCH_FLAGS += -D_$(ARCH)_ ++endif ++ +CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -D_ALLBSD_SOURCE $(VERSION_DEFINES) \ - -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT - - ifeq ($(ARCH_DATA_MODEL), 64) -@@ -258,44 +263,37 @@ - CPPFLAGS_DBG += -DLOGGING - endif - --ifdef LIBRARY -- # Libraries need to locate other libraries at runtime, and you can tell -- # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) -- # buried inside the .so. The $ORIGIN says to look relative to where -- # the library itself is and it can be followed with relative paths from -- # that. By default we always look in $ORIGIN, optionally we add relative -- # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths. -- # On Bsd we add a flag -z origin, not sure if this is necessary, but -- # doesn't seem to hurt. -- # The environment variable LD_LIBRARY_PATH will over-ride these runpaths. -- # Try: 'readelf -d lib*.so' to see these settings in a library. -- # -- Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin -- Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin -- Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin -- Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin -- Z_ORIGIN_FLAG/arm = -- Z_ORIGIN_FLAG/ppc = -- Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin -- -- LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY)) -- -- LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN -- LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%) -- ++ -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT ++ ++ifeq ($(ARCH_DATA_MODEL), 64) ++CPPFLAGS_COMMON += -D_LP64=1 ++endif ++ ++CPPFLAGS_OPT = -DNDEBUG ++CPPFLAGS_DBG = -DDEBUG ++ifneq ($(PRODUCT), java) ++ CPPFLAGS_DBG += -DLOGGING ++endif ++ +# Libraries need to locate other libraries at runtime, and you can tell +# a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) -+# buried inside the .{so,dylib}. The {$ORIGIN,@loader_path/} says to look -+# relative to where the library itself is and it can be followed -+# with relative paths from that. By default we always look in -+# {$ORIGIN,@loader_path/}, optionally we add relative paths if the Makefile -+# sets LD_RUNPATH_EXTRAS to those relative paths. -+# Except on MacOS X we add a flag -z origin, not sure if this is necessary, -+# but doesn't seem to hurt. ++# buried inside the .so. The $ORIGIN says to look relative to where ++# the library itself is and it can be followed with relative paths from ++# that. By default we always look in $ORIGIN, optionally we add relative ++# paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths. ++# On BSD we add a flag -z origin, not sure if this is necessary, but ++# doesn't seem to hurt. +# The environment variable LD_LIBRARY_PATH will over-ride these runpaths. -+# See 'man {dyld,rtld}' for more information. +# Try: 'readelf -d lib*.so' to see these settings in a library. +# -+ifeq ($(OS_VENDOR), Apple) -+ LDFLAGS_COMMON += -Xlinker -rpath -Xlinker @loader_path/. -+ LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -rpath -Xlinker @loader_path/%) -+ LDFLAGS_COMMON += -Xlinker -install_name -Xlinker @rpath/$(@F) -+else -+ LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN -+ LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%) - endif - --EXTRA_LIBS += -lc -- --LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs --LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) -- - # - # -L paths for finding and -ljava - # --LDFLAGS_OPT = -Xlinker -O1 - LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH) ++Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin ++Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin ++Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin ++Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin ++Z_ORIGIN_FLAG/arm = ++Z_ORIGIN_FLAG/ppc = ++Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin + -+ifneq ($(OS_VENDOR), Apple) ++LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY)) ++ ++LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN ++LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%) ++ ++# ++# -L paths for finding and -ljava ++# +LDFLAGS_OPT = -Xlinker -O1 - LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX) ++LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH) ++LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX) ++ ++# ++# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always ++# statically link libgcc but will print a warning with the flag. We don't ++# want the warning, so check gcc version first. ++# ++ifeq ($(CC_MAJORVER),3) ++ OTHER_LDFLAGS += -static-libgcc +endif - - # - # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always -@@ -316,9 +314,9 @@ - ifeq ($(VARIANT), OPT) - ifneq ($(NO_STRIP), true) - ifneq ($(DEBUG_BINARIES), true) -- # Debug 'strip -g' leaves local function Elf symbols (better stack ++ ++# Automatic precompiled header option to use (if COMPILE_APPROACH=batch) ++# (See Rules.gmk) The gcc 5 compiler might have an option for this? ++AUTOMATIC_PCH_OPTION = ++ ++# ++# Post Processing of libraries/executables ++# ++ifeq ($(VARIANT), OPT) ++ ifneq ($(NO_STRIP), true) ++ ifneq ($(DEBUG_BINARIES), true) + # Debug 'strip -S' leaves local function Elf symbols (better stack - # traces) -- POST_STRIP_PROCESS = $(STRIP) -g ++ # traces) + POST_STRIP_PROCESS = $(STRIP) -S - endif - endif - endif -@@ -337,6 +335,16 @@ - LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) - endif - -+# Darwin does not support linker map files. -+ifeq ($(OS_VENDOR), Apple) -+LDNOMAP=true ++ endif ++ endif ++endif ++ ++# ++# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o ++# ++LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker ++ ++# ++# Support for Quantify. ++# ++ifdef QUANTIFY ++QUANTIFY_CMD = quantify ++QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes ++LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) +endif ++ +# Using map files currently break compilation on FreeBSD during shared library +# checks for some of the AWT native libraries. +ifeq ($(OS_VENDOR), FreeBSD) +LDNOMAP=true +endif + - # - # Path and option to link against the VM, if you have to. Note that - # there are libraries that link against only -ljava, but they do get -@@ -344,7 +352,11 @@ - # the library itself should not. - # - VM_NAME = server -+ifeq ($(OS_VENDOR),Apple) - JVMLIB = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm -+else ++# ++# Path and option to link against the VM, if you have to. Note that ++# there are libraries that link against only -ljava, but they do get ++# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas ++# the library itself should not. ++# ++VM_NAME = server +JVMLIB = -Xlinker -rpath -Xlinker $(LIBDIR)/$(LIBARCH)/$(VM_NAME) -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm ++JAVALIB = -ljava $(JVMLIB) ++ ++# ++# We want to privatize JVM symbols on Solaris. This is so the user can ++# write a function called FindClass and this should not override the ++# FindClass that is inside the JVM. At this point in time we are not ++# concerned with other JNI libraries because we hope that there will ++# not be as many clashes there. ++# ++PRIVATIZE_JVM_SYMBOLS = false ++ ++USE_PTHREADS = true ++override ALT_CODESET_KEY = _NL_CTYPE_CODESET_NAME ++override AWT_RUNPATH = ++override HAVE_ALTZONE = false ++override HAVE_FILIOH = false ++override HAVE_GETHRTIME = false ++override HAVE_GETHRVTIME = false ++override LEX_LIBRARY = -lfl ++ifeq ($(STATIC_CXX),true) ++override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic ++else ++override LIBCXX = -lstdc++ +endif - JAVALIB = -ljava $(JVMLIB) - - # -@@ -363,7 +375,9 @@ - override HAVE_FILIOH = false - override HAVE_GETHRTIME = false - override HAVE_GETHRVTIME = false -+ifeq ($(OS_VENDOR),Apple) - override HAVE_SIGIGNORE = true -+endif - override LEX_LIBRARY = -lfl - ifeq ($(STATIC_CXX),true) - override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic -@@ -375,13 +389,11 @@ - override LIBNSL = - override LIBSCF = - override LIBTHREAD = ++override LIBPOSIX4 = ++override LIBSOCKET = ++override LIBNSL = ++override LIBSCF = ++override LIBTHREAD = +override LIBDL = - override MOOT_PRIORITIES = true - override NO_INTERRUPTIBLE_IO = true --ifeq ($(ARCH), amd64) --override OPENWIN_LIB = $(OPENWIN_HOME)/lib64 --else ++override MOOT_PRIORITIES = true ++override NO_INTERRUPTIBLE_IO = true +override OPENWIN_HOME = $(X11_PATH) - override OPENWIN_LIB = $(OPENWIN_HOME)/lib --endif - override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER - override SUN_CMM_SUBDIR = - override THREADS_FLAG = native -@@ -402,6 +414,14 @@ - # DPS (Displayable PostScript) is available on Solaris machines - HAVE_DPS = no - ++override OPENWIN_LIB = $(OPENWIN_HOME)/lib ++override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER ++override SUN_CMM_SUBDIR = ++override THREADS_FLAG = native ++override USE_GNU_M4 = true ++override USING_GNU_TAR = true ++override WRITE_LIBVERSION = false ++ ++ifdef ALT_X11_PATH ++ X11_PATH = $(ALT_X11_PATH) ++else ++ ifeq ($(OS_VENDOR), NetBSD) ++ X11_PATH = /usr/X11R7 ++ else ++ ifeq ($(OS_VENDOR), FreeBSD) ++ X11_PATH = /usr/local ++ else ++ X11_PATH = /usr/X11R6 ++ endif ++ endif ++endif ++ ++ifdef ALT_PACKAGE_PATH ++ PACKAGE_PATH = $(ALT_PACKAGE_PATH) ++else ++ ifeq ($(OS_VENDOR), NetBSD) ++ PACKAGE_PATH = /usr/pkg ++ else ++ PACKAGE_PATH = /usr/local ++ endif ++endif ++ ++# ALSA ++ifdef ALT_ALSA_LIB_PATH ++ ALSA_LIB_PATH = $(ALT_ALSA_LIB_PATH) ++else ++ ALSA_LIB_PATH = $(PACKAGE_PATH)/lib ++endif ++ ++ifdef ALT_ALSA_HEADERS_PATH ++ ALSA_HEADERS_PATH = $(ALT_ALSA_HEADERS_PATH) ++else ++ ALSA_HEADERS_PATH = $(PACKAGE_PATH)/include ++endif ++ ++# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the ++# resulting resolved absolute name of the executable in the environment ++# variable EXECNAME. That executable name is then used that to locate the ++# installation area. ++override USE_EXECNAME = true ++ ++# If your platform has DPS, it will have Type1 fonts too, in which case ++# it is best to enable DPS support until such time as 2D's rasteriser ++# can fully handle Type1 fonts in all cases. Default is "yes". ++# HAVE_DPS should only be "no" if the platform has no DPS headers or libs ++# DPS (Displayable PostScript) is available on Solaris machines ++HAVE_DPS = no ++ +ifeq ($(OS_VENDOR), FreeBSD) + SYSTEM_ZLIB = true +endif @@ -14788,34 +984,44 @@ + SYSTEM_ZLIB = true +endif + - # - # Japanese manpages - # -@@ -414,7 +434,7 @@ - SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo - - # The JDI - Serviceability Agent binding is not currently supported --# on Bsd-ia64. ++# ++# Japanese manpages ++# ++JA_SOURCE_ENCODING = eucJP ++JA_TARGET_ENCODINGS = UTF-8 ++ ++# Settings for the JDI - Serviceability Agent binding. ++HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH) ++SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX) ++SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo ++ ++# The JDI - Serviceability Agent binding is not currently supported +# on ia64. - ifeq ($(ARCH), ia64) - INCLUDE_SA = false - else ---- ./jdk/make/common/Defs-linux.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/common/Defs-linux.gmk 2012-02-26 15:38:41.000000000 -0800 -@@ -375,8 +375,10 @@ - override LIBNSL = - override LIBSCF = - override LIBTHREAD = -+override LIBDL = -ldl ++ifeq ($(ARCH), ia64) ++ INCLUDE_SA = false ++else ++ INCLUDE_SA = true ++endif ++ ++ifdef CROSS_COMPILE_ARCH ++ # X11 headers are not under /usr/include ++ OTHER_CFLAGS += -I$(OPENWIN_HOME)/include ++ OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include ++ OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include ++endif +--- jdk/make/common/Defs-linux.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/Defs-linux.gmk 2012-05-17 16:14:53.000000000 -0700 +@@ -383,6 +383,7 @@ + override LIBDL = -ldl override MOOT_PRIORITIES = true override NO_INTERRUPTIBLE_IO = true +override OPENWIN_HOME = $(X11_PATH) ifeq ($(ARCH), amd64) override OPENWIN_LIB = $(OPENWIN_HOME)/lib64 else ---- ./jdk/make/common/Defs-solaris.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/common/Defs-solaris.gmk 2012-02-26 15:39:30.000000000 -0800 -@@ -711,6 +711,9 @@ +--- jdk/make/common/Defs-solaris.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/Defs-solaris.gmk 2012-05-17 16:14:53.000000000 -0700 +@@ -716,6 +716,9 @@ # Network Services library LIBNSL = -lnsl @@ -14825,68 +1031,40 @@ # service configuration facility library LIBSCF = -lscf ---- ./jdk/make/common/Defs.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/common/Defs.gmk 2012-02-26 15:38:41.000000000 -0800 -@@ -109,6 +109,49 @@ - endif - endif - -+ifneq ($(PLATFORM), windows) -+ ifdef ALT_X11_PATH -+ X11_PATH = $(ALT_X11_PATH) -+ else -+ ifneq ($(OS_VENDOR), NetBSD) -+ X11_PATH = /usr/X11R6 -+ else -+ X11_PATH = /usr/X11R7 -+ endif -+ endif -+ -+ ifdef ALT_PACKAGE_PATH -+ PACKAGE_PATH = $(ALT_PACKAGE_PATH) -+ else -+ ifeq ($(PLATFORM), linux) -+ PACKAGE_PATH = /usr -+ else -+ ifeq ($(OS_VENDOR), Apple) -+ PACKAGE_PATH = /opt/local -+ else -+ ifeq ($(OS_NAME), netbsd) -+ PACKAGE_PATH = /usr/pkg -+ else -+ PACKAGE_PATH = /usr/local -+ endif -+ endif -+ endif -+ endif -+ -+ # ALSA -+ ifdef ALT_ALSA_LIB_PATH -+ ALSA_LIB_PATH = $(ALT_ALSA_LIB_PATH) -+ else -+ ALSA_LIB_PATH = $(PACKAGE_PATH)/lib -+ endif -+ -+ ifdef ALT_ALSA_HEADERS_PATH -+ ALSA_HEADERS_PATH = $(ALT_ALSA_HEADERS_PATH) -+ else -+ ALSA_HEADERS_PATH = $(PACKAGE_PATH)/include -+ endif -+endif -+ - # - # Get platform definitions - # -@@ -179,6 +222,7 @@ +--- jdk/make/common/Defs.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/Defs.gmk 2012-05-22 22:40:52.000000000 -0700 +@@ -179,15 +179,15 @@ ifdef ALT_FREETYPE_LIB_PATH FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH) -+ USING_SYSTEM_FT_LIB=true +- ifeq ($(PLATFORM), macosx) ++ ifneq (,$(findstring $(PLATFORM), bsd macosx)) + USING_SYSTEM_FT_LIB=true + endif else ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib -@@ -243,6 +287,10 @@ - LDLIBS_COMMON = -ldl + else +- ifeq ($(PLATFORM), macosx) +- FREETYPE_LIB_PATH = /usr/X11R6/lib ++ ifneq (,$(findstring $(PLATFORM), bsd macosx)) ++ FREETYPE_LIB_PATH = $(X11_PATH)/lib + else + FREETYPE_LIB_PATH = /usr/lib + endif +@@ -201,8 +201,8 @@ + ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) + FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include + else +- ifeq ($(PLATFORM), macosx) +- FREETYPE_HEADERS_PATH = /usr/X11R6/include ++ ifneq (,$(findstring $(PLATFORM), bsd macosx)) ++ FREETYPE_HEADERS_PATH = $(X11_PATH)/include + else + FREETYPE_HEADERS_PATH = /usr/include + endif +@@ -258,6 +258,10 @@ + LDLIBS_COMMON = -pthread endif + ifeq ($(PLATFORM), bsd) @@ -14896,8 +1074,17 @@ endif # PROGRAM LDLIBS_COMMON += $(EXTRA_LIBS) ---- ./jdk/make/common/Mapfile-vers.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/common/Mapfile-vers.gmk 2011-08-02 23:11:42.000000000 -0700 +@@ -398,7 +402,7 @@ + # We define an intermediate variable for Java files because + # we use its value later to help define $SOURCEPATH + +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + VPATH0.java = $(subst $(ONESPACE),:,$(GENSRCDIR) $(call JavaSrcDirList,,classes)) + else + VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes +--- jdk/make/common/Mapfile-vers.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/Mapfile-vers.gmk 2011-08-02 23:11:42.000000000 -0700 @@ -76,7 +76,7 @@ endif # PLATFORM @@ -14907,94 +1094,83 @@ ifeq ($(VARIANT), OPT) # OPT build MUST have a mapfile? ---- ./jdk/make/common/Program.gmk 2011-11-17 21:55:33.000000000 -0800 -+++ ./jdk/make/common/Program.gmk 2011-05-07 21:54:09.000000000 -0700 -@@ -73,11 +73,27 @@ - # Create a dependency on libjli (Java Launcher Infrastructure) - # - # On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to --# do this reliably on Linux takes a different syntax than Solaris. -+# do this reliably on Linux takes a different syntax than Solaris. BSD's -+# don't support $ORIGIN so build an archive instead. - # - # On Windows, this is done by using the same directory as the executable - # itself, as with all the Windows libraries. - # +--- jdk/make/common/Program.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/Program.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -95,6 +95,17 @@ + endif # SYSTEM_ZLIB + endif # PLATFORM + +ifeq ($(PLATFORM), bsd) -+ ifeq ($(OS_VENDOR), Apple) -+ LDFLAGS += -Wl,-all_load -+ LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a -+ else -+ LDFLAGS += -Wl,--whole-archive -+ LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a -+ LDFLAGS += -Wl,--no-whole-archive ++ LDFLAGS += -Wl,--whole-archive ++ LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a ++ LDFLAGS += -Wl,--no-whole-archive +# Work-around an dlsym(RTLD_DEFAULT) bug in at least FreeBSD & OpenBSD -+ LDFLAGS += -Wl,--export-dynamic -+ endif ++ LDFLAGS += -Wl,--export-dynamic + ifeq ($(SYSTEM_ZLIB),true) + OTHER_LDLIBS += -lz + endif -+endif - ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems - LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli - OTHER_LDLIBS += -ljli -@@ -183,6 +199,10 @@ - THREADLIBS = $(LIBTHREAD) - endif # USE_PTHREADS ++endif #PLATFORM ++ + ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems + LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli + OTHER_LDLIBS += -ljli +@@ -214,6 +225,11 @@ + INFO_PLIST_FILE= + endif # MACOSX -+ifeq ($(PLATFORM), bsd) -+THREADLIBS = -pthread -+endif ++ ifeq ($(PLATFORM), bsd) ++ THREADLIBS = -pthread ++ OTHER_CPPFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"' ++ endif + - # - # This rule only applies on unix. It supports quantify and its ilk. - # -@@ -239,15 +259,19 @@ + # + # This rule only applies on unix. It supports quantify and its ilk. + # +@@ -272,7 +288,9 @@ ifneq ($(PLATFORM), windows) -+ifneq ($(PLATFORM), bsd) - HAVE_GETHRTIME=true - endif -+endif +- HAVE_GETHRTIME=true ++ ifneq ($(PLATFORM), bsd) ++ HAVE_GETHRTIME=true ++ endif + endif #PLATFORM ifeq ($(HAVE_GETHRTIME),true) - OTHER_CPPFLAGS += -DHAVE_GETHRTIME - endif - +@@ -282,12 +300,10 @@ OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin -+ifneq ($(SYSTEM_ZLIB),true) - OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 -+endif + ifeq ($(PLATFORM), macosx) + OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)/bin +- ifneq ($(SYSTEM_ZLIB), true) +- OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 +- endif # SYSTEM_ZLIB +-else # PLATFORM !MACOSX ++endif # PLATFORM ++ifneq ($(SYSTEM_ZLIB), true) + OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 +-endif ++endif # SYSTEM_ZLIB - OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"' + OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"' VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"' ---- ./jdk/make/common/Release.gmk 2011-11-17 21:55:34.000000000 -0800 -+++ ./jdk/make/common/Release.gmk 2012-02-26 15:38:41.000000000 -0800 -@@ -132,7 +132,6 @@ - JDK_MAN_PAGES = \ - $(JRE_MAN_PAGES) \ - appletviewer.1 \ -- apt.1 \ - extcheck.1 \ - idlj.1 \ - jar.1 \ -@@ -171,6 +170,12 @@ +--- jdk/make/common/Release.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/Release.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -177,6 +177,12 @@ JA_DIRNAME=ja_JP.UTF-8 endif # linux +ifeq ($(PLATFORM), bsd) -+ MANBASEDIRS=$(JDK_TOPDIR)/src/bsd/doc $(IMPORTDOCDIR) -+ MAN1SUBDIR = man ++ MANBASEDIRS=$(JDK_TOPDIR)/src/linux/doc $(IMPORTDOCDIR) ++ MAN1SUBDIR=man + JA_DIRNAME=ja_JP.UTF-8 -+endif ++endif # linux + define copy-man-pages $(MKDIR) -p $1/man/man1 for manbase in $(MANBASEDIRS:%=%/$(MAN1SUBDIR)) ; do \ -@@ -304,6 +309,12 @@ - SOURCE_DIRS += $(CLOSED_SRC)/share/classes - endif +@@ -980,6 +986,12 @@ + FILES_launcher = $(wildcard $(SHARE_SRC)/bin/*) \ + $(wildcard $(PLATFORM_SRC)/bin/java_md*) +ifeq ($(OS_VENDOR), OpenBSD) + FILES_FROM_ARG=-I @@ -15002,19 +1178,19 @@ + FILES_FROM_ARG=-T +endif + - - # - # Specific files and directories that will be filtered out from above areas. -@@ -1003,7 +1014,7 @@ - @# generated by the more efficient solaris/windows method of copying files. + # Standard jdk image + initial-image-jdk:: initial-image-jdk-setup \ + initial-image-jdk-db \ +@@ -1067,7 +1079,7 @@ @# So for Linux, make use of the -T option (like Solaris' -I option) of @# obtaining the list of files from a file. MKS tar has no such option. -- ifeq ($(PLATFORM), linux) -+ ifneq (,$(findstring $(PLATFORM), linux bsd)) + +- ifneq (,$(findstring $(PLATFORM), linux macosx)) ++ ifneq (,$(findstring $(PLATFORM), linux macosx bsd)) for d in $(SOURCE_DIRS); do \ $(RM) $(ABS_TEMPDIR)/src-files.list; \ ($(CD) $$d && \ -@@ -1016,7 +1027,7 @@ +@@ -1080,7 +1092,7 @@ done ; \ ) ; \ if [ -f $(ABS_TEMPDIR)/src-files.list ] ; then \ @@ -15023,9 +1199,29 @@ | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \ fi; \ done ---- ./jdk/make/common/shared/Compiler-gcc.gmk 2011-11-17 21:55:34.000000000 -0800 -+++ ./jdk/make/common/shared/Compiler-gcc.gmk 2011-05-07 21:54:09.000000000 -0700 -@@ -72,6 +72,24 @@ +--- jdk/make/common/Rules.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/Rules.gmk 2012-05-20 10:20:11.000000000 -0700 +@@ -51,7 +51,7 @@ + # + # All source tree areas for java/properties files (a few may be closed) + # +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + ifdef OPENJDK + ALL_CLASSES_SRC = $(call JavaSrcDirList,,classes) + else +@@ -212,7 +212,7 @@ + $(CLASSDESTDIR)/%.class: $(GENSRCDIR)/%.java + @$(add-java-file) + +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + # TODO(cpc): need to document why this is necessary... + $(CLASSDESTDIR)/%.class: $(JDK_TOPDIR)/src/macosx/classes/%.java + @$(add-java-file) +--- jdk/make/common/shared/Compiler-gcc.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/shared/Compiler-gcc.gmk 2012-05-20 11:23:26.000000000 -0700 +@@ -72,6 +72,21 @@ endif @@ -15035,117 +1231,249 @@ + CC = $(COMPILER_PATH)gcc + CPP = $(COMPILER_PATH)gcc -E + CXX = $(COMPILER_PATH)g++ -+ REQUIRED_CC_VER = 3.2 + + # Option used to create a shared library -+ # Option used to create a shared library + ifeq ($(OS_VENDOR), Apple) + SHARED_LIBRARY_FLAG = -dynamiclib + else + SHARED_LIBRARY_FLAG = -shared + endif -+ SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 ) +endif + ifeq ($(PLATFORM), solaris) # Settings specific to Solaris ---- ./jdk/make/common/shared/Defs-bsd.gmk 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/make/common/shared/Defs-bsd.gmk 2011-07-15 21:28:12.000000000 -0700 -@@ -54,7 +54,7 @@ - endef - - # Location on system where jdk installs might be --USRJDKINSTANCES_PATH =/opt/java +--- jdk/make/common/shared/Defs-bsd.gmk 1969-12-31 16:00:00.000000000 -0800 ++++ jdk/make/common/shared/Defs-bsd.gmk 2012-05-22 19:42:36.000000000 -0700 +@@ -0,0 +1,225 @@ ++# ++# Copyright (c) 2005, 2011, Oracle and/or its affiliates. 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. Oracle designates this ++# particular file as subject to the "Classpath" exception as provided ++# by Oracle in the LICENSE file that accompanied this code. ++# ++# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++# or visit www.oracle.com if you need additional information or have any ++# questions. ++# ++ ++# ++# Definitions for BSD. ++# ++ ++# Default for COMPILER_WARNINGS_FATAL on BSD (C & C++ compiler warnings) ++ifndef COMPILER_WARNINGS_FATAL ++ COMPILER_WARNINGS_FATAL=false ++endif ++ ++# BSD should use parallel compilation for best build times ++ifndef COMPILE_APPROACH ++ COMPILE_APPROACH = parallel ++endif ++ ++# Indication that we are doing an incremental build. ++# This may trigger the creation of make depend files. ++ifndef INCREMENTAL_BUILD ++ INCREMENTAL_BUILD = false ++endif ++ ++# FullPath just makes sure it never ends with a / and no duplicates ++define FullPath ++$(shell cd $1 2> $(DEV_NULL) && pwd) ++endef ++ ++# OptFullPath: Absolute path name of a dir that might not initially exist. ++define OptFullPath ++$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi) ++endef ++ ++# Location on system where jdk installs might be +USRJDKINSTANCES_PATH = $(PACKAGE_PATH) - - # UNIXCOMMAND_PATH: path to where the most common Unix commands are. - # NOTE: Must end with / so that it could be empty, allowing PATH usage. -@@ -107,7 +107,7 @@ - ifneq ($(ALT_OPENWIN_HOME),) - OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME)) - else -- OPENWIN_HOME =/usr/X11R6/ ++ ++# UNIXCOMMAND_PATH: path to where the most common Unix commands are. ++# NOTE: Must end with / so that it could be empty, allowing PATH usage. ++ifneq "$(origin ALT_UNIXCOMMAND_PATH)" "undefined" ++ UNIXCOMMAND_PATH :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH)) ++else ++ UNIXCOMMAND_PATH = /bin/ ++endif ++ ++# USRBIN_PATH: path to where the most common Unix commands are. ++# NOTE: Must end with / so that it could be empty, allowing PATH usage. ++ifneq "$(origin ALT_USRBIN_PATH)" "undefined" ++ USRBIN_PATH :=$(call PrefixPath,$(ALT_USRBIN_PATH)) ++else ++ USRBIN_PATH = /usr/bin/ ++endif ++ ++# UNIXCCS_PATH: path to where the Solaris ported UNIX commands can be found ++# NOTE: Must end with / so that it could be empty, allowing PATH usage. ++ifneq "$(origin ALT_UNIXCCS_PATH)" "undefined" ++ UNIXCCS_PATH :=$(call PrefixPath,$(ALT_UNIXCCS_PATH)) ++else ++ UNIXCCS_PATH = /usr/ccs/bin/ ++endif ++ ++# SLASH_JAVA: location of all network accessable files ++ifdef ALT_SLASH_JAVA ++ SLASH_JAVA :=$(ALT_SLASH_JAVA) ++else ++ SLASH_JAVA := $(call DirExists,/java,/java,/NOT-SET) ++endif ++ ++# JDK_DEVTOOLS_DIR: common path for all the java devtools ++ifdef ALT_JDK_DEVTOOLS_DIR ++ JDK_DEVTOOLS_DIR =$(ALT_JDK_DEVTOOLS_DIR) ++else ++ JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools ++endif ++ ++# COMPILER_PATH: path to where the compiler and tools are installed. ++# NOTE: Must end with / so that it could be empty, allowing PATH usage. ++ifneq "$(origin ALT_COMPILER_PATH)" "undefined" ++ COMPILER_PATH :=$(call PrefixPath,$(ALT_COMPILER_PATH)) ++else ++ COMPILER_PATH =/usr/bin/ ++endif ++ ++# OPENWIN_HOME: path to where the X11 environment is installed. ++# NOTE: Must end with / so that it could be empty, allowing PATH usage. ++ifneq ($(ALT_OPENWIN_HOME),) ++ OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME)) ++else + OPENWIN_HOME =$(X11_PATH) - endif - - # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.) -@@ -115,7 +115,7 @@ - ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined" - DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH)) - else -- DEVTOOLS_PATH =/usr/bin/ ++endif ++ ++# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.) ++# NOTE: Must end with / so that it could be empty, allowing PATH usage. ++ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined" ++ DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH)) ++else + DEVTOOLS_PATH =$(PACKAGE_PATH)/bin/ - endif - - # _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK. -@@ -129,16 +129,12 @@ - BUILD_HEADLESS = true - LIBM=-lm - --# GCC29_COMPILER_PATH: is the path to where the gcc 2.9 compiler is installed --# NOTE: Must end with / so that it could be empty, allowing PATH usage. --ifdef ALT_GCC29_COMPILER_PATH -- GCC29_COMPILER_PATH :=$(call PrefixPath,$(ALT_GCC29_COMPILER_PATH)) -+ifeq ($(OS_VENDOR), Apple) -+ _CUPS_HEADERS_PATH=/usr/include - else -- GCC29_COMPILER_PATH = $(JDK_DEVTOOLS_DIR)/$(PLATFORM)/gcc29/usr/ -+ _CUPS_HEADERS_PATH=$(PACKAGE_PATH)/include - endif - --_CUPS_HEADERS_PATH=/usr/include -- - # Import JDK images allow for partial builds, components not built are - # imported (or copied from) these import areas when needed. - -@@ -196,6 +192,34 @@ - # Macro to check it's input file for banned dependencies and verify the - # binary built properly. Relies on process exit code. - ifndef CROSS_COMPILE_ARCH -+ifeq ($(OS_VENDOR), Apple) ++endif ++ ++# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK. ++# _BOOTDIR2: Second choice ++ifndef ALT_BOOTDIR ++ _BOOTDIR1 =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH) ++ _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION) ++endif ++ ++# Always build headless on BSD ++BUILD_HEADLESS = true ++LIBM=-lm ++ ++_CUPS_HEADERS_PATH=$(PACKAGE_PATH)/include ++ ++# Import JDK images allow for partial builds, components not built are ++# imported (or copied from) these import areas when needed. ++ ++# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for ++# multiple platforms, e.g. windows-i586, solaris-sparc, linux-586, etc. ++ifdef ALT_BUILD_JDK_IMPORT_PATH ++ BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH)) ++else ++ BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES) ++endif ++BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH) ++ ++# JDK_IMPORT_PATH: location of JDK install tree (this version) to import ++ifdef ALT_JDK_IMPORT_PATH ++ JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH)) ++else ++ JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT) ++endif ++JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH) ++ ++# HOTSPOT_IMPORT_PATH: location of hotspot pre-built files ++ifdef ALT_HOTSPOT_IMPORT_PATH ++ HOTSPOT_IMPORT_PATH :=$(call FullPath,$(ALT_HOTSPOT_IMPORT_PATH)) ++else ++ HOTSPOT_IMPORT_PATH =$(JDK_IMPORT_PATH) ++endif ++HOTSPOT_IMPORT_PATH:=$(call AltCheckValue,HOTSPOT_IMPORT_PATH) ++ ++# HOTSPOT_CLIENT_PATH: location of client jvm library file. ++ifeq ($(ARCH_DATA_MODEL), 32) ++ ifdef ALT_HOTSPOT_CLIENT_PATH ++ HOTSPOT_CLIENT_PATH :=$(call FullPath,$(ALT_HOTSPOT_CLIENT_PATH)) ++ else ++ HOTSPOT_CLIENT_PATH =$(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/client ++ endif ++ HOTSPOT_CLIENT_PATH:=$(call AltCheckValue,HOTSPOT_CLIENT_PATH) ++endif ++ ++# HOTSPOT_SERVER_PATH: location of server jvm library file. ++ifdef ALT_HOTSPOT_SERVER_PATH ++ HOTSPOT_SERVER_PATH :=$(call FullPath,$(ALT_HOTSPOT_SERVER_PATH)) ++else ++ HOTSPOT_SERVER_PATH =$(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/server ++endif ++HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH) ++ ++# Special define for checking the binaries ++ ++# Debug builds should downgrade warnings to just info ++MAPFILE_WARNING-DBG=INFO ++MAPFILE_WARNING-OPT=WARNING ++MAPFILE_WARNING-=WARNING ++MAPFILE_WARNING=$(MAPFILE_WARNING-$(VARIANT)) ++ ++# Macro to check it's input file for banned dependencies and verify the ++# binary built properly. Relies on process exit code. ++ifndef CROSS_COMPILE_ARCH ++ifeq ($(OS_VENDOR), OpenBSD) +define binary_file_verification # binary_file +( \ + $(ECHO) "Checking for mapfile use in: $1" && \ -+ if [ "`$(NM) -g $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \ -+ $(ECHO) "WARNING: File was not built with a mapfile: $1"; \ -+ fi && \ ++ if [ "`$(OBJDUMP) -T $1 | $(EGREP) '[0-9a-f]* g *DF \.text.*SUNWprivate'`" = "" ] ; then \ ++ $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \ ++ fi && \ + $(ECHO) "Library loads for: $1" && \ -+ $(OTOOL) -L $1 && \ ++ $(LDD) $1 && \ + $(ECHO) "RUNPATH for: $1" && \ -+ ( $(OTOOL) -l $1 | $(EGREP) 'path ' ) \ ++ ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \ +) || true +endef +else -+ifeq ($(OS_VENDOR), OpenBSD) +define binary_file_verification # binary_file +( \ + $(ECHO) "Checking for mapfile use in: $1" && \ -+ if [ "`$(OBJDUMP) -T $1 | $(EGREP) '[0-9a-f]* g *DF \.text.*SUNWprivate'`" = "" ] ; then \ ++ if [ "`$(NM) -D -g --defined-only $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \ + $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \ + fi && \ + $(ECHO) "Library loads for: $1" && \ + $(LDD) $1 && \ + $(ECHO) "RUNPATH for: $1" && \ + ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \ -+) || true ++) +endef ++endif +else - define binary_file_verification # binary_file - ( \ - $(ECHO) "Checking for mapfile use in: $1" && \ -@@ -208,6 +232,8 @@ - ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \ - ) - endef -+endif # OS_VENDOR == OpenBSD -+endif # OS_VENDOR == Apple - else - define binary_file_verification - ( \ ---- ./jdk/make/common/shared/Defs-utils.gmk 2011-11-17 21:55:34.000000000 -0800 -+++ ./jdk/make/common/shared/Defs-utils.gmk 2011-07-15 21:28:12.000000000 -0700 -@@ -67,6 +67,13 @@ ++define binary_file_verification ++( \ ++ $(ECHO) "Skipping binary file verification for cross-compile build" \ ++) ++endef ++endif ++ +--- jdk/make/common/shared/Defs-utils.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/shared/Defs-utils.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -74,6 +74,13 @@ UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH) endif @@ -15159,19 +1487,11 @@ # Utilities ifdef CROSS_COMPILE_ARCH AR = $(COMPILER_PATH)ar -@@ -126,6 +133,8 @@ - MSGFMT = $(UTILS_USR_BIN_PATH)msgfmt - MV = $(UTILS_COMMAND_PATH)mv - NAWK = $(UTILS_USR_BIN_PATH)nawk -+NM = $(UTILS_CCS_BIN_PATH)nm -+OTOOL = $(UTILS_USR_BIN_PATH)otool - PKGMK = $(UTILS_COMMAND_PATH)pkgmk - PRINTF = $(UTILS_USR_BIN_PATH)printf - PWD = $(UTILS_COMMAND_PATH)pwd -@@ -220,3 +229,40 @@ - ECHO = /usr/bin/echo +@@ -251,3 +258,35 @@ + # Builtin shell command, no -e option needed + ECHO = echo endif - ++ +# BSD specific +ifeq ($(PLATFORM),bsd) + BASENAME = $(UTILS_USR_BIN_PATH)basename @@ -15188,14 +1508,8 @@ + TOUCH = $(UTILS_USR_BIN_PATH)touch + TRUE = $(UTILS_USR_BIN_PATH)true + UNAME = $(UTILS_USR_BIN_PATH)uname ++ UNZIP = $(UTILS_DEVTOOL_PATH)unzip + # BSD OS_VENDOR specific -+ ifeq ($(OS_VENDOR), Apple) -+ NAWK = $(UTILS_USR_BIN_PATH)awk -+ UNZIPSFX = $(UTILS_USR_BIN_PATH)unzipsfx -+ ZIPEXE = $(UTILS_USR_BIN_PATH)zip -+ else -+ UNZIP = $(UTILS_DEVTOOL_PATH)unzip -+ endif + ifeq ($(OS_VENDOR), OpenBSD) + NAWK = $(UTILS_USR_BIN_PATH)awk + OBJDUMP = $(UTILS_USR_BIN_PATH)objdump @@ -15209,8 +1523,8 @@ + UNZIP = $(UTILS_DEVTOOL_PATH)unzip + endif +endif ---- ./jdk/make/common/shared/Defs-versions.gmk 2011-11-17 21:55:34.000000000 -0800 -+++ ./jdk/make/common/shared/Defs-versions.gmk 2011-05-07 21:54:09.000000000 -0700 +--- jdk/make/common/shared/Defs-versions.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/shared/Defs-versions.gmk 2012-05-17 16:18:00.000000000 -0700 @@ -44,6 +44,11 @@ override CC_VERSION = gcc endif @@ -15220,22 +1534,38 @@ + override CC_VERSION = gcc +endif + - ########################################################################## - # - # List of JDK official minimum, expected, or required versions: ---- ./jdk/make/common/shared/Platform.gmk 2011-11-17 21:55:35.000000000 -0800 -+++ ./jdk/make/common/shared/Platform.gmk 2011-07-15 21:28:12.000000000 -0700 -@@ -86,7 +86,7 @@ - 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: - SCM_DIRS_rexp = ".hg|.svn|CVS|RCS|SCCS|Codemgr_wsdata|deleted_files|.hgignore|.hgtags" --SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files -o -name .hgignore -o -name .hgtags \) -prune -+SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files -o -name .hgignore -o -name .hgtags -o -name \*.orig \) -prune - - # Don't define this unless it's not defined - ifndef VARIANT -@@ -224,6 +224,101 @@ - MB_OF_MEMORY := $(shell free -m | fgrep Mem: | awk '{print $$2;}' ) + # Mac OS X uses LLVM by default + ifeq ($(PLATFORM), macosx) + override CC_VERSION = llvm +@@ -169,6 +174,13 @@ + endif + endif + ++# BSD specific ++ifeq ($(PLATFORM), macosx) ++ REQUIRED_COMPILER_NAME = GCC4 ++ REQUIRED_COMPILER_VERSION = GCC4 ++ REQUIRED_CC_VER = 4.2.1 ++endif ++ + # Mac specific + ifeq ($(PLATFORM), macosx) + REQUIRED_OS_NAME = Darwin +--- jdk/make/common/shared/Defs.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/shared/Defs.gmk 2012-05-20 10:20:50.000000000 -0700 +@@ -181,7 +181,7 @@ + # platform and shared sources/headers. This is mainly useful for the + # Mac OS X build, which pulls its platform sources from the solaris and/or + # macosx trees, depending on the component. +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + define JavaSrcDirList + $(JAVA_SRCDIR_LIST:%=$1$(JDK_TOPDIR)/%/$2) + endef +--- jdk/make/common/shared/Platform.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/common/shared/Platform.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -298,6 +298,85 @@ + # How much RAM does this machine have: endif +ifeq ($(SYSTEM_UNAME), FreeBSD) @@ -15245,13 +1575,6 @@ + REQUIRED_OS_VERSION = 6.0 +endif + -+ifeq ($(SYSTEM_UNAME), Darwin) -+ PLATFORM = bsd -+ OS_NAME = darwin -+ OS_VENDOR = Apple -+ REQUIRED_OS_VERSION = 8.0 -+endif -+ +ifeq ($(SYSTEM_UNAME), NetBSD) + PLATFORM = bsd + OS_NAME = netbsd @@ -15294,15 +1617,6 @@ + ARCH := $(shell $(archExpr) ) + ARCH_FAMILY := $(ARCH) + -+ # Darwin builds may be 32-bit or 64-bit data model. -+ ifeq ($(SYSTEM_UNAME), Darwin) -+ ifeq ($(ARCH), i586) -+ ifeq ($(ARCH_DATA_MODEL), 64) -+ ARCH=amd64 -+ endif -+ endif -+ endif -+ + # i586, sparc, and ppc are 32 bit, amd64 and sparc64 are 64 + ifneq (,$(findstring $(ARCH), i586 sparc ppc)) + ARCH_DATA_MODEL=32 @@ -15322,7 +1636,7 @@ + + # Suffix for file bundles used in previous release + BUNDLE_FILE_SUFFIX=.tar.gz -+ # Minimum disk space needed as determined by running 'du -sk' on ++ # Minimum disk space needed as determined by running 'du -sk' on + # a fully built workspace. + REQUIRED_FREE_SPACE=1500000 + # How much RAM does this machine have: @@ -15336,54 +1650,8 @@ # Windows with and without CYGWIN will be slightly different ifeq ($(SYSTEM_UNAME), Windows_NT) PLATFORM = windows -@@ -425,6 +520,14 @@ - ARCH_VM_SUBDIR=jre/lib/$(LIBARCH) - endif - -+# Darwin-specific Overrides -+ifeq ($(SYSTEM_UNAME),Darwin) -+ # The suffix applied to runtime libraries -+ LIBRARY_SUFFIX = dylib -+ # The suffix applied to link libraries -+ LIB_SUFFIX = dylib -+endif -+ - # Machines with 512Mb or less of real memory are considered low memory - # build machines and adjustments will be made to prevent excessing - # system swapping during the build. ---- ./jdk/make/common/shared/Sanity.gmk 2011-11-17 21:55:35.000000000 -0800 -+++ ./jdk/make/common/shared/Sanity.gmk 2011-05-07 23:39:41.000000000 -0700 -@@ -140,6 +140,9 @@ - $(EGREP) "\#define" | $(NAWK) '{print $$3}') - endif - -+ifeq ($(PLATFORM), bsd) -+endif -+ - # Get the version numbers of what we are using - _MAKE_VER :=$(shell $(MAKE) --version 2>&1 | $(HEAD) -n 1) - _ZIP_VER :=$(shell $(ZIPEXE) -help 2>&1 | $(HEAD) -n 4 | $(EGREP) '^Zip') -@@ -839,8 +842,10 @@ - - ###################################################### - # Check for existence of DEVTOOLS_PATH -+# All needed tools come with base system on Apple - ###################################################### - sane-devtools_path: -+ifneq ($(OS_VENDOR), Apple) - @if [ "$(DEVTOOLS_PATH)" != "" -a ! -r "$(DEVTOOLS_PATH)" ]; then \ - $(ECHO) "ERROR: You do not have a valid DEVTOOLS_PATH setting. \n" \ - " Please check your access to \n" \ -@@ -848,6 +853,7 @@ - " and/or check your value of ALT_DEVTOOLS_PATH. \n" \ - "" >> $(ERROR_FILE) ; \ - fi -+endif - - ###################################################### - # Check for existence of MS_RUNTIME_LIBRARIES ---- ./jdk/make/java/Makefile 2011-11-17 21:55:35.000000000 -0800 -+++ ./jdk/make/java/Makefile 2011-04-22 23:08:15.000000000 -0700 +--- jdk/make/java/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/Makefile 2012-05-17 16:14:53.000000000 -0700 @@ -53,7 +53,7 @@ endif endif # PLATFORM @@ -15393,15 +1661,20 @@ SUBDIRS += jexec endif # PLATFORM ---- ./jdk/make/java/instrument/Makefile 2011-11-17 21:55:36.000000000 -0800 -+++ ./jdk/make/java/instrument/Makefile 2011-04-22 23:08:15.000000000 -0700 -@@ -102,9 +102,29 @@ +--- jdk/make/java/instrument/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/instrument/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -102,12 +102,24 @@ # equivalent of strcasecmp is stricmp on Windows CPPFLAGS_COMMON += -Dstrcasecmp=stricmp else -+ifeq ($(PLATFORM), bsd) +-ifneq (,$(findstring $(PLATFORM), macosx)) +- ifneq ($(ARCH), universal) +- LDFLAGS += -Wl,-all_load ++ifneq (,$(findstring $(PLATFORM), macosx bsd)) + ifeq ($(OS_VENDOR), Apple) -+ LDFLAGS += -Wl,-all_load ++ ifneq ($(ARCH), universal) ++ LDFLAGS += -Wl,-all_load ++ endif + LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a + OTHER_LDLIBS += -liconv + else @@ -15413,59 +1686,37 @@ + CPPFLAGS += -I$(PACKAGE_PATH)/include + OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv + endif -+ endif -+ -+ ifeq ($(SYSTEM_ZLIB), true) -+ OTHER_LDLIBS += -lz -+ endif -+else - LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli - OTHER_LDLIBS += -ljli -- OTHER_LDLIBS += -ldl -+ OTHER_LDLIBS += $(LIBDL) - ifeq ($(PLATFORM), solaris) - LDFLAGS += -R \$$ORIGIN/jli endif -@@ -114,6 +134,7 @@ - LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli +- LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a +- OTHER_LDLIBS += -liconv ++ + ifeq ($(SYSTEM_ZLIB), true) + OTHER_LDLIBS += -lz endif - endif -+endif - - # - # Library to compile. ---- ./jdk/make/java/java/Makefile 2011-11-17 21:55:36.000000000 -0800 -+++ ./jdk/make/java/java/Makefile 2012-02-26 15:40:15.000000000 -0800 -@@ -165,8 +165,10 @@ - # Is the altzone extern documented in ctime(3C) available? +--- jdk/make/java/java/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/java/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -175,9 +175,11 @@ # ifneq ($(PLATFORM), windows) + ifneq ($(PLATFORM), macosx) +ifneq ($(PLATFORM), bsd) HAVE_ALTZONE=true endif + endif +endif ifeq ($(HAVE_ALTZONE),true) OTHER_CPPFLAGS += -DHAVE_ALTZONE -@@ -205,7 +207,7 @@ - -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib \ - shell32.lib delayimp.lib /DELAYLOAD:shell32.dll - else --OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) $(LIBSCF) -ldl \ -+OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) $(LIBSCF) $(LIBDL) \ - -L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH) - endif - ---- ./jdk/make/java/java/genlocales.gmk 2011-11-17 21:55:36.000000000 -0800 -+++ ./jdk/make/java/java/genlocales.gmk 2011-04-22 23:08:15.000000000 -0700 -@@ -76,10 +76,14 @@ +--- jdk/make/java/java/genlocales.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/java/genlocales.gmk 2012-05-20 10:37:13.000000000 -0700 +@@ -82,10 +82,14 @@ $(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH) @$(RM) $@.tmp.euro $@.tmp.noneuro; @$(prep-target) -- @$(ECHO) $(subst .properties,'\n',$(Euro_Resources_properties)) > $@.tmp.euro; -- @$(ECHO) $(subst .java,'\n',$(Euro_Resources_java)) >> $@.tmp.euro; -- @$(ECHO) $(subst .properties,'\n',$(NonEuro_Resources_properties)) > $@.tmp.noneuro; -- @$(ECHO) $(subst .java,'\n',$(NonEuro_Resources_java)) >> $@.tmp.noneuro; +- @$(ECHO) $(Euro_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.euro; +- @$(ECHO) $(Euro_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.euro; +- @$(ECHO) $(NonEuro_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.noneuro; +- @$(ECHO) $(NonEuro_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.noneuro; + @$(ECHO) $(Euro_Resources_properties) | $(SED) -e s@.properties@'\ +'@g > $@.tmp.euro; + @$(ECHO) $(Euro_Resources_java) | $(SED) -e s@.java@'\ @@ -15477,341 +1728,120 @@ NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \ $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \ $@.tmp.noneuro $< $@ ---- ./jdk/make/java/java/localegen.sh 2011-11-17 21:55:36.000000000 -0800 -+++ ./jdk/make/java/java/localegen.sh 2011-04-22 23:08:15.000000000 -0700 -@@ -55,9 +55,9 @@ - for FILE in $RESOURCE_NAMES - do - getlocalelist $FILE $EURO_FILES_LIST -- sed_script=$sed_script"-e \"s/#"$FILE"_EuroLocales#/$localelist/g\" " -+ sed_script=$sed_script"-e \"s@#"$FILE"_EuroLocales#@$localelist@g\" " - getlocalelist $FILE $NONEURO_FILES_LIST -- sed_script=$sed_script"-e \"s/#"$FILE"_NonEuroLocales#/$localelist/g\" " -+ sed_script=$sed_script"-e \"s@#"$FILE"_NonEuroLocales#@$localelist@g\" " - done - - sed_script=$sed_script"$INPUT_FILE > $OUTPUT_FILE" ---- ./jdk/make/java/java_hprof_demo/Makefile 2011-11-17 21:55:38.000000000 -0800 -+++ ./jdk/make/java/java_hprof_demo/Makefile 2011-04-22 23:08:15.000000000 -0700 -@@ -83,7 +83,7 @@ - ifeq ($(PLATFORM), windows) - OTHER_LDLIBS += wsock32.lib winmm.lib - else -- OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl -+ OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) $(LIBDL) - endif - - # ---- ./jdk/make/java/jli/Makefile 2011-11-17 21:55:39.000000000 -0800 -+++ ./jdk/make/java/jli/Makefile 2011-04-22 23:08:15.000000000 -0700 -@@ -44,7 +44,9 @@ - - include $(BUILDDIR)/common/Defs.gmk - -+ifneq ($(SYSTEM_ZLIB),true) - ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) -+endif - LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin - LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin - -@@ -69,13 +71,17 @@ - parse_manifest.c \ - version_comp.c \ - wildcard.c \ -- jli_util.c \ -+ jli_util.c -+ -+ifneq ($(SYSTEM_ZLIB),true) -+FILES_c += \ - inflate.c \ - inftrees.c \ - inffast.c \ - zadler32.c \ - zcrc32.c \ - zutil.c -+endif - - ifneq ($(PLATFORM), windows) - FILES_c += ergo.c -@@ -96,7 +102,7 @@ +--- jdk/make/java/jli/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/jli/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -116,9 +116,9 @@ LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"' - endif - --OTHER_CPPFLAGS += $(LIBARCH_DEFINES) -+OTHER_CPPFLAGS += $(LIBARCH_DEFINES) -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" - - - ifneq ($(PLATFORM), windows) # UNIX systems -@@ -105,7 +111,7 @@ - # Note: its important to keep this order meaning -lc is the - # last library otherwise it could cause compatibility issues - # by pulling in SUNW_private symbols from libc -- LDLIBS = -ldl -lc -+ LDLIBS = $(LIBDL) -lc - ifeq ($(USE_PTHREADS),true) - LDLIBS += -lpthread - endif # USE_PTHREADS -@@ -129,7 +135,11 @@ - - OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC) - OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC) --OTHER_INCLUDES += -I$(ZIP_SRC) -+ifneq ($(SYSTEM_ZLIB),true) -+ OTHER_INCLUDES += -I$(ZIP_SRC) -+else -+ LDLIBS += -lz -+endif - - # - # Library to compile. -@@ -161,7 +171,28 @@ + endif # PLATFORM - endif # PLATFORM +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), macosx bsd)) + OTHER_CPPFLAGS += $(LIBARCH_DEFINES) -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" +-else # ! MACOSX ++else # ! MACOSX || BSD + OTHER_CPPFLAGS += $(LIBARCH_DEFINES) + endif #PLATFORM -+ifeq ($(PLATFORM), bsd) -+ -+STATIC_LIBRARY_DIR = $(OBJDIR)/static -+STATIC_LIBRARY_NAME = lib$(LIBRARY).a -+STATIC_LIBRARY = $(STATIC_LIBRARY_DIR)/$(STATIC_LIBRARY_NAME) -+ -+$(STATIC_LIBRARY_DIR): $(OBJDIR) -+ @$(MKDIR) $(STATIC_LIBRARY_DIR) -+ -+$(STATIC_LIBRARY): $(STATIC_LIBRARY_DIR) -+ @$(prep-target) -+ $(AR) -r $@ $(FILES_o) -+ -+library:: $(STATIC_LIBRARY) -+ -+endif # PLATFORM -+ - # - # Add to ambient vpath so we pick up the library files - # --vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC) -+vpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC) -+ifneq ($(SYSTEM_ZLIB),true) -+ vpath %.c $(ZIP_SRC) -+endif -+ ---- ./jdk/make/java/net/FILES_c.gmk 2011-11-17 21:55:42.000000000 -0800 -+++ ./jdk/make/java/net/FILES_c.gmk 2011-04-22 23:08:15.000000000 -0700 -@@ -43,6 +43,10 @@ - FILES_c += linux_close.c +@@ -131,7 +131,7 @@ + # Note: it is important to keep this order, meaning -lc as the + # last library, otherwise it could cause compatibility issues + # by pulling in SUNW_private symbols from libc +- LDLIBS = -ldl -lc ++ LDLIBS = $(LIBDL) -lc + ifeq ($(USE_PTHREADS),true) + LDLIBS += -lpthread + endif # USE_PTHREADS +--- jdk/make/java/net/FILES_c.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/net/FILES_c.gmk 2012-05-17 16:18:00.000000000 -0700 +@@ -47,6 +47,10 @@ + FILES_c += bsd_close.c endif +ifeq ($(OS_VENDOR), FreeBSD) -+ FILES_c += $(CTARGDIR)bsd_close.c ++ FILES_c += bsd_close.c +endif + ifeq ($(PLATFORM), windows) FILES_c += TwoStacksPlainSocketImpl.c FILES_c += DualStackPlainSocketImpl.c ---- ./jdk/make/java/net/Makefile 2011-11-17 21:55:42.000000000 -0800 -+++ ./jdk/make/java/net/Makefile 2011-04-22 23:08:15.000000000 -0700 -@@ -91,16 +91,23 @@ +--- jdk/make/java/net/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/net/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -91,7 +91,7 @@ include $(BUILDDIR)/common/Library.gmk -+ifeq ($(PLATFORM), bsd) -+ifdef DONT_ENABLE_IPV6 -+ OTHER_CFLAGS += -DDONT_ENABLE_IPV6 -+endif -+ OTHER_LDLIBS = $(JVMLIB) -pthread -+else - ifeq ($(PLATFORM), windows) - OTHER_LDLIBS = ws2_32.lib $(JVMLIB) \ - secur32.lib iphlpapi.lib delayimp.lib \ - /DELAYLOAD:secur32.dll /DELAYLOAD:iphlpapi.dll - else -- OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) -ldl $(JVMLIB) -+ OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) $(LIBDL) $(JVMLIB) - endif - ifeq ($(PLATFORM), linux) - OTHER_LDLIBS += -lpthread +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), macosx bsd)) + ifdef DONT_ENABLE_IPV6 + OTHER_CFLAGS += -DDONT_ENABLE_IPV6 endif -+endif # PLATFORM == bsd - - CLASSES.export += java.lang.Integer java.io.FileDescriptor java.net.InetAddressImplFactory java.net.Inet4AddressImpl java.net.Inet6AddressImpl - ---- ./jdk/make/java/nio/Makefile 2011-11-17 21:55:42.000000000 -0800 -+++ ./jdk/make/java/nio/Makefile 2012-02-26 15:38:41.000000000 -0800 -@@ -260,6 +260,69 @@ +--- jdk/make/java/nio/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/nio/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -260,7 +260,7 @@ sun/nio/fs/UnixConstants.java endif # PLATFORM = linux -+ifeq ($(PLATFORM), bsd) -+FILES_java += \ -+ sun/nio/ch/AbstractPollSelectorImpl.java \ -+ sun/nio/ch/InheritedChannel.java \ -+ sun/nio/ch/PollSelectorProvider.java \ -+ sun/nio/ch/PollSelectorImpl.java \ -+ sun/nio/ch/Port.java \ -+ sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \ -+ sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \ -+ sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \ -+ \ -+ sun/nio/fs/GnomeFileTypeDetector.java \ -+ 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 \ -+ sun/nio/fs/UnixDirectoryStream.java \ -+ sun/nio/fs/UnixException.java \ -+ sun/nio/fs/UnixFileAttributeViews.java \ -+ sun/nio/fs/UnixFileAttributes.java \ -+ sun/nio/fs/UnixFileKey.java \ -+ sun/nio/fs/UnixFileModeAttribute.java \ -+ sun/nio/fs/UnixFileStore.java \ -+ sun/nio/fs/UnixFileStoreAttributes.java \ -+ sun/nio/fs/UnixFileSystem.java \ -+ sun/nio/fs/UnixFileSystemProvider.java \ -+ sun/nio/fs/UnixMountEntry.java \ -+ sun/nio/fs/UnixNativeDispatcher.java \ -+ sun/nio/fs/UnixPath.java \ -+ sun/nio/fs/UnixSecureDirectoryStream.java \ -+ sun/nio/fs/UnixUriUtils.java \ -+ sun/nio/fs/UnixUserPrincipals.java -+ -+FILES_c += \ -+ InheritedChannel.c \ -+ NativeThread.c \ -+ PollArrayWrapper.c \ -+ UnixAsynchronousServerSocketChannelImpl.c \ -+ UnixAsynchronousSocketChannelImpl.c \ -+ \ -+ GnomeFileTypeDetector.c \ -+ BsdNativeDispatcher.c \ -+ UnixCopyFile.c \ -+ UnixNativeDispatcher.c -+ -+FILES_export += \ -+ sun/nio/ch/InheritedChannel.java \ -+ sun/nio/ch/NativeThread.java \ -+ sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \ -+ 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 -+ -+FILES_gen += \ -+ sun/nio/fs/UnixConstants.java -+endif # PLATFORM = bsd +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + FILES_java += \ + sun/nio/ch/AbstractPollSelectorImpl.java \ + sun/nio/ch/BsdAsynchronousChannelProvider.java \ +@@ -331,7 +331,7 @@ + sun/nio/fs/UnixConstants.java + endif # PLATFORM = bsd, macosx + +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + FILES_java += \ + sun/nio/ch/KQueueSelectorProvider.java \ + sun/nio/ch/KQueueSelectorImpl.java \ +@@ -339,6 +339,9 @@ + + FILES_c += \ + KQueueArrayWrapper.c ++endif # PLATFORM = bsd, macosx + - # - # Find platform-specific C source files - # -@@ -292,10 +355,13 @@ - $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/FileDescriptor_md.obj - endif ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + + vpath %.c $(call NativeSrcDirList,,native/sun/nio/fs) + vpath %.c $(call NativeSrcDirList,,native/sun/nio/ch) +@@ -381,7 +384,7 @@ ifeq ($(PLATFORM), linux) --OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl -+OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread $(LIBDL) -+endif -+ifeq ($(PLATFORM), bsd) -+OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -pthread + OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread $(LIBDL) + endif +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + OTHER_LDLIBS += -L$(LIBDIR) -ljava -lnet -pthread endif ifeq ($(PLATFORM), solaris) --OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 -ldl -lsendfile \ -+OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 $(LIBDL) -lsendfile \ - -L$(LIBDIR)/$(LIBARCH) -ljava -lnet - endif # PLATFORM - -@@ -316,6 +382,9 @@ +@@ -406,7 +409,7 @@ ifeq ($(PLATFORM), linux) FILES_m = mapfile-linux endif -+ifeq ($(PLATFORM), bsd) -+FILES_m = mapfile-bsd -+endif +-ifeq ($(PLATFORM), macosx) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + FILES_m = mapfile-bsd + endif include $(BUILDDIR)/common/Mapfile-vers.gmk - include $(BUILDDIR)/common/Library.gmk - ---- ./jdk/make/java/nio/mapfile-bsd 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/make/java/nio/mapfile-bsd 2011-05-12 20:59:33.000000000 -0700 -@@ -36,24 +36,6 @@ - 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_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; -@@ -124,25 +106,14 @@ - 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_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_init; - Java_sun_nio_fs_UnixNativeDispatcher_getcwd; - Java_sun_nio_fs_UnixNativeDispatcher_strerror; ---- ./jdk/make/java/npt/Makefile 2011-11-17 21:55:42.000000000 -0800 -+++ ./jdk/make/java/npt/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -67,6 +67,18 @@ - OTHER_LCF += -export:nptInitialize -export:nptTerminate +--- jdk/make/java/npt/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/npt/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -72,6 +72,14 @@ + OTHER_LDLIBS += -liconv endif +# Add location of iconv headers +ifeq ($(PLATFORM), bsd) -+ ifeq ($(OS_VENDOR), Apple) -+ OTHER_LDLIBS += -liconv -+ else -+ ifneq ($(OS_NAME), netbsd) -+ CPPFLAGS += -I$(PACKAGE_PATH)/include -+ OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv -+ endif ++ ifneq ($(OS_NAME), netbsd) ++ CPPFLAGS += -I$(PACKAGE_PATH)/include ++ OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv + endif +endif + # # Add to ambient vpath so we pick up the library files # ---- ./jdk/make/java/redist/fonts/Makefile 2011-11-17 21:55:43.000000000 -0800 -+++ ./jdk/make/java/redist/fonts/Makefile 2011-04-22 23:08:16.000000000 -0700 +--- jdk/make/java/redist/fonts/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/java/redist/fonts/Makefile 2011-04-22 23:08:16.000000000 -0700 @@ -42,7 +42,7 @@ $(LIBDIR)/fonts/LucidaSansRegular.ttf \ $(LIBDIR)/fonts/LucidaSansDemiBold.ttf \ @@ -15839,84 +1869,12 @@ all build : $(INTERNAL_IMPORT_LIST) ---- ./jdk/make/java/security/Makefile 2011-11-17 21:55:43.000000000 -0800 -+++ ./jdk/make/java/security/Makefile 2011-07-15 21:28:12.000000000 -0700 -@@ -47,7 +47,7 @@ - # Register Microsoft CryptoAPI provider only on Windows platform. - ifeq ($(PLATFORM), windows) - PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security-windows --endif -+endif # windows - endif # PLATFORM - - ---- ./jdk/make/java/zip/FILES_c.gmk 2011-11-17 21:55:44.000000000 -0800 -+++ ./jdk/make/java/zip/FILES_c.gmk 2011-04-22 23:08:16.000000000 -0700 -@@ -29,7 +29,10 @@ - Deflater.c \ - Inflater.c \ - ZipFile.c \ -- zip_util.c \ -+ zip_util.c -+ -+ifneq ($(SYSTEM_ZLIB),true) -+FILES_c += \ - compress.c \ - deflate.c \ - gzio.c \ -@@ -41,4 +44,5 @@ - uncompr.c \ - zadler32.c \ - zcrc32.c \ -- zutil.c -+ zutil.c -+endif ---- ./jdk/make/java/zip/Makefile 2011-11-17 21:55:44.000000000 -0800 -+++ ./jdk/make/java/zip/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -74,16 +74,24 @@ - CPPFLAGS += -UDEBUG - endif - --CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) - CPPFLAGS += -I$(SHARE_SRC)/native/java/io - CPPFLAGS += -I$(PLATFORM_SRC)/native/java/io - -+ifneq ($(SYSTEM_ZLIB),true) -+CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) -+ - # - # Add to ambient vpath so we pick up the library files - # - vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/zlib-$(ZLIB_VERSION) -+endif - - # - # Link to JVM library for JVM_Zip* functions - # -+ifeq ($(SYSTEM_ZLIB),true) -+OTHER_LDLIBS = -lz -+else - OTHER_LDLIBS = $(JVMLIB) -+endif -+ ---- ./jdk/make/javax/sound/FILES_c.gmk 2011-11-17 21:55:46.000000000 -0800 -+++ ./jdk/make/javax/sound/FILES_c.gmk 2011-04-22 23:08:16.000000000 -0700 -@@ -34,6 +34,8 @@ - - FILES_linux = - -+FILES_bsd = -+ - FILES_windows = \ - PLATFORM_API_WinOS_MidiIn.c \ - PLATFORM_API_WinOS_MidiOut.c \ ---- ./jdk/make/javax/sound/Makefile 2011-11-17 21:55:47.000000000 -0800 -+++ ./jdk/make/javax/sound/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -105,6 +105,22 @@ +--- jdk/make/javax/sound/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/javax/sound/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -111,6 +111,21 @@ #MXSPP_ADD = $(PLATFORM)-$(ARCH)/ endif # PLATFORM linux -+# XXXBSD: ??? +ifeq ($(PLATFORM), bsd) +ifeq ($(OS_VENDOR), FreeBSD) + # ALSA handles directaudio, ports, and MIDI @@ -15932,11 +1890,11 @@ +endif +endif # PLATFORM bsd + - ifeq ($(PLATFORM), solaris) - # build with ports and direct audio - CPPFLAGS += -DUSE_PORTS=TRUE \ ---- ./jdk/make/javax/sound/SoundDefs.gmk 2011-11-17 21:55:47.000000000 -0800 -+++ ./jdk/make/javax/sound/SoundDefs.gmk 2011-04-22 23:08:16.000000000 -0700 + ifeq ($(PLATFORM), macosx) + CPPFLAGS += -DUSE_PORTS=TRUE \ + -DUSE_DAUDIO=TRUE \ +--- jdk/make/javax/sound/SoundDefs.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/javax/sound/SoundDefs.gmk 2012-05-17 16:18:00.000000000 -0700 @@ -40,6 +40,10 @@ CPPFLAGS += -DX_PLATFORM=X_LINUX endif # PLATFORM linux @@ -15945,11 +1903,11 @@ + CPPFLAGS += -DX_PLATFORM=X_BSD +endif # PLATFORM bsd + - ifeq ($(PLATFORM), solaris) - CPPFLAGS += -DX_PLATFORM=X_SOLARIS - ---- ./jdk/make/javax/sound/jsoundalsa/Makefile 2011-11-17 21:55:47.000000000 -0800 -+++ ./jdk/make/javax/sound/jsoundalsa/Makefile 2011-04-22 23:08:16.000000000 -0700 + ifeq ($(PLATFORM), macosx) + CPPFLAGS += -DX_PLATFORM=X_MACOSX + endif # PLATFORM macosx +--- jdk/make/javax/sound/jsoundalsa/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/javax/sound/jsoundalsa/Makefile 2011-04-22 23:08:16.000000000 -0700 @@ -51,6 +51,7 @@ $(PORTFILES_c) @@ -16000,87 +1958,37 @@ # # Add to the ambient VPATH. ---- ./jdk/make/jpda/back/Makefile 2011-11-17 21:55:48.000000000 -0800 -+++ ./jdk/make/jpda/back/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -49,7 +49,7 @@ - -I$(GENNATIVESRCDIR)/jdwp - - ifneq ($(PLATFORM), windows) -- OTHER_LDLIBS += -ldl -+ OTHER_LDLIBS += $(LIBDL) - endif # PLATFORM +--- jdk/make/jpda/transport/socket/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/jpda/transport/socket/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -36,6 +36,11 @@ - # ---- ./jdk/make/jpda/transport/socket/Makefile 2011-11-17 21:55:49.000000000 -0800 -+++ ./jdk/make/jpda/transport/socket/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -40,6 +40,11 @@ - OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET) -lpthread - endif + include $(BUILDDIR)/common/Defs.gmk -+ifeq ($(PLATFORM), bsd) ++ifeq ($(PLATFORM), bsd)) + LIBSOCKET = + OTHER_LDLIBS += -pthread +endif + - ifeq ($(PLATFORM), solaris) - OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET) - endif ---- ./jdk/make/mkdemo/jvmti/hprof/Makefile 2011-11-17 21:55:54.000000000 -0800 -+++ ./jdk/make/mkdemo/jvmti/hprof/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -37,12 +37,11 @@ - - ifeq ($(PLATFORM), windows) - EXTRA_LIBS += wsock32.lib winmm.lib --endif --ifeq ($(PLATFORM), solaris) -- OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl --endif -+else -+ OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) $(LIBDL) ifeq ($(PLATFORM), linux) -- OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl -lpthread -+ OTHER_LDLIBS += -lpthread -+endif + OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET) -lpthread endif +--- jdk/make/sun/awt/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/sun/awt/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -125,6 +125,13 @@ + + FILES_c += initIDs.c - # ---- ./jdk/make/sun/awt/Makefile 2011-11-17 21:55:58.000000000 -0800 -+++ ./jdk/make/sun/awt/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -93,7 +93,7 @@ - ifeq ($(PLATFORM), solaris) - FILES_c = $(FILES_2D_c) - FILES_c += awt_LoadLibrary.c --OTHER_LDLIBS = $(JVMLIB) $(LIBM) -ldl -+OTHER_LDLIBS = $(JVMLIB) $(LIBM) $(LIBDL) - ifeq ($(CC_VER), 5.8) - ifndef REMOVE_ALL_WORKAROUNDS - ifeq ($(ARCH_FAMILY), i586) -@@ -120,7 +120,14 @@ - FILES_c = $(FILES_2D_c) - FILES_c += awt_LoadLibrary.c - OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH --OTHER_LDLIBS = $(JVMLIB) $(LIBM) -ldl -+OTHER_LDLIBS = $(JVMLIB) $(LIBM) $(LIBDL) -+endif -+ +ifeq ($(PLATFORM), bsd) +FILES_c = $(FILES_2D_c) +FILES_c += awt_LoadLibrary.c +OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH +OTHER_LDLIBS = $(JVMLIB) $(LIBM) - endif - - FILES_c += initIDs.c -@@ -240,7 +247,7 @@ - # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ WINDOWS - endif # PLATFORM - --ifeq ($(PLATFORM), linux) -+ifneq (,$(findstring $(PLATFORM), linux bsd)) - # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv LINUX - vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl - vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl -@@ -390,6 +397,19 @@ ++endif ++ + ifeq ($(PLATFORM), macosx) + FILES_c = $(FILES_2D_c) + FILES_c += awt_LoadLibrary.c +@@ -425,6 +432,17 @@ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SOLARIS endif # PLATFORM @@ -16089,28 +1997,26 @@ + +FONTCONFIGS_SRC = $(PLATFORM_SRC)/classes/sun/awt/fontconfigs +_FONTCONFIGS = \ -+ fontconfig.properties ++ fontconfig.properties + +FONTCONFIGS_SRC_PREFIX = $(PLATFORM). + +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BSD +endif # PLATFORM -+ -+ - FONTCONFIGS = $(_FONTCONFIGS:%=$(LIBDIR)/%.src) - BINARYFONTCONFIGS = $(_FONTCONFIGS:%.properties=$(LIBDIR)/%.bfc) -@@ -482,6 +502,9 @@ + ifeq ($(PLATFORM), macosx) + # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv MAC OS X +@@ -530,6 +548,9 @@ -I$(OPENWIN_HOME)/include/X11/extensions \ -I$(PLATFORM_SRC)/native/$(PKGDIR)/font endif +ifeq ($(PLATFORM), bsd) -+CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/font ++CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/font +endif CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \ -I$(SHARE_SRC)/native/$(PKGDIR)/../font \ -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \ -@@ -503,7 +526,13 @@ +@@ -551,7 +572,13 @@ -I$(PLATFORM_SRC)/native/$(PKGDIR) \ $(EVENT_MODEL) @@ -16118,33 +2024,24 @@ +# include these last so we don't pick up unintentional includes +ifeq ($(PLATFORM), bsd) +CPPFLAGS += -I$(OPENWIN_HOME)/include \ -+ -I$(OPENWIN_HOME)/include/X11/extensions ++ -I$(OPENWIN_HOME)/include/X11/extensions +endif + +ifneq (,$(findstring $(PLATFORM), linux bsd)) LDFLAGS += -L$(OPENWIN_LIB) endif ---- ./jdk/make/sun/awt/mawt.gmk 2011-11-17 21:55:58.000000000 -0800 -+++ ./jdk/make/sun/awt/mawt.gmk 2011-04-22 23:08:16.000000000 -0700 +--- jdk/make/sun/awt/mawt.gmk 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/sun/awt/mawt.gmk 2012-05-17 16:18:00.000000000 -0700 @@ -169,7 +169,7 @@ OTHER_LDLIBS = -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi endif --ifeq ($(PLATFORM), linux) -+ifneq (,$(findstring $(PLATFORM), linux bsd)) +-ifneq (,$(findstring $(PLATFORM), linux macosx)) ++ifneq (,$(findstring $(PLATFORM), bsd linux macosx)) OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH # XXX what is this define below? Isn't it motif-related? OTHER_CFLAGS += -DXMSTRINGDEFINES=1 -@@ -180,7 +180,7 @@ - # !HEADLESS - - OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \ -- -lawt $(LIBM) -ldl -+ -lawt $(LIBM) $(LIBDL) - - # - # Sun CC with -Xa misdefines __STDC__ to 0 (zero). @@ -198,6 +198,9 @@ ifndef HEADLESS CPPFLAGS += -I$(OPENWIN_HOME)/include @@ -16155,88 +2052,33 @@ endif # !HEADLESS -@@ -223,16 +226,33 @@ - -I$(PLATFORM_SRC)/native/$(PKGDIR) \ - $(EVENT_MODEL) - -+CPPFLAGS += -I$(CUPS_HEADERS_PATH) -+ -+ifndef HEADLESS -+CPPFLAGS += -I$(MOTIF_DIR)/include \ -+ -I$(OPENWIN_HOME)/include -+LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB) -+ -+endif # !HEADLESS -+ - ifeq ($(PLATFORM), linux) - # Checking for the X11/extensions headers at the additional location - CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \ +@@ -240,6 +243,12 @@ $(wildcard /usr/include/X11/extensions)) endif -+ifeq ($(PLATFORM), bsd) ++ifeq ($(PLATFORM), bsd)) + CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \ -+ -I$(OPENWIN_HOME)/include ++ -I$(OPENWIN_HOME)/include \ ++ -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" +endif + - ifeq ($(PLATFORM), solaris) - CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions - endif - -+ifneq ($(PLATFORM), windows) -+ CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" -+endif - - LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \ - $(AWT_RUNPATH) ---- ./jdk/make/sun/font/Makefile 2011-11-17 21:55:58.000000000 -0800 -+++ ./jdk/make/sun/font/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -172,6 +172,15 @@ + ifeq ($(PLATFORM), macosx)) + CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \ + -I$(OPENWIN_HOME)/include +--- jdk/make/sun/font/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/sun/font/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -172,7 +172,7 @@ # Libraries to link, and other C flags. # -+ifeq ($(PLATFORM), bsd) -+OTHER_INCLUDES += -I$(X11_PATH)/include -+OTHER_LDLIBS += -lawt $(LIBM) $(LIBCXX) -+ ifeq ($(OS_VENDOR),Apple) -+ # XXXDARWIN Match BSD/Linux behavior -- the mawt.dylib symbols will -+ # be available at runtime. -+ OTHER_LDLIBS += -flat_namespace -undefined suppress -+ endif -+else - ifeq ($(PLATFORM), solaris) - # Note that on Solaris, fontmanager is built against the headless library. - LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/headless -@@ -182,6 +191,7 @@ - OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic - endif - endif -+endif - - endif # PLATFORM - ---- ./jdk/make/sun/image/generic/Makefile 2011-11-17 21:55:59.000000000 -0800 -+++ ./jdk/make/sun/image/generic/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -70,6 +70,6 @@ - OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES - - ifneq ($(PLATFORM), windows) -- OTHER_LDLIBS = $(LIBM) -ldl -+ OTHER_LDLIBS = $(LIBM) $(LIBDL) - endif - ---- ./jdk/make/sun/image/vis/Makefile 2011-11-17 21:55:59.000000000 -0800 -+++ ./jdk/make/sun/image/vis/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -68,5 +68,5 @@ - CFLAGS += $(CFLAGS_$(ARCH)) $(INLINE) -I$(PLATFORM_SRC)/native/sun/awt/medialib -I$(SHARE_SRC)/native/sun/awt/medialib - - OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES --OTHER_LDLIBS = $(LIBM) -ldl -+OTHER_LDLIBS = $(LIBM) $(LIBDL) - ---- ./jdk/make/sun/jawt/Makefile 2011-11-17 21:56:00.000000000 -0800 -+++ ./jdk/make/sun/jawt/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -92,8 +92,7 @@ +-ifeq ($(PLATFORM), macosx)) ++ifneq (,$(findstring $(PLATFORM), bsd macosx)) + OTHER_INCLUDES += -I$(X11_PATH)/include + OTHER_LDLIBS += -lawt $(LIBM) $(LIBCXX) + ifeq ($(OS_VENDOR),Apple) +--- jdk/make/sun/jawt/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/sun/jawt/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -94,8 +94,7 @@ # # Other extra flags needed for compiling. # @@ -16246,15 +2088,15 @@ -I$(SHARE_SRC)/native/$(PKGDIR)/image \ -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \ -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \ -@@ -107,6 +106,7 @@ +@@ -109,6 +108,7 @@ -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \ -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \ -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \ -+ -I$(OPENWIN_HOME)/include \ ++ -I$(OPENWIN_HOME)/include \ $(EVENT_MODEL) + # - # Libraries to link in. -@@ -119,7 +119,7 @@ +@@ -122,7 +122,7 @@ endif endif # PLATFORM @@ -16263,27 +2105,8 @@ ifndef BUILD_HEADLESS_ONLY OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt else -@@ -130,7 +130,6 @@ - - endif # PLATFORM - -- - # - # Lets not remove any class files. - # ---- ./jdk/make/sun/jdga/Makefile 2011-11-17 21:56:00.000000000 -0800 -+++ ./jdk/make/sun/jdga/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -55,7 +55,7 @@ - vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR) - - ifneq ($(PLATFORM), windows) -- LDLIBS = -ldga -lX11 -ldl -lc -+ LDLIBS = -ldga -lX11 $(LIBDL) -lc - - CPPFLAGS += \ - -I$(SHARE_SRC)/javavm/export \ ---- ./jdk/make/sun/rmi/rmi/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/rmi/rmi/Makefile 2011-05-20 20:16:38.000000000 -0700 +--- jdk/make/sun/rmi/rmi/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/sun/rmi/rmi/Makefile 2011-05-20 20:16:38.000000000 -0700 @@ -97,6 +97,9 @@ BUILD_TARGETS += bin endif @@ -16294,170 +2117,36 @@ build: $(BUILD_TARGETS) ---- ./jdk/make/sun/security/ec/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/security/ec/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -192,7 +192,7 @@ - ifeq ($(PLATFORM), windows) - OTHER_LDLIBS += $(JVMLIB) - else -- OTHER_LDLIBS = -ldl $(JVMLIB) $(LIBCXX) -+ OTHER_LDLIBS = $(LIBDL) $(JVMLIB) $(LIBCXX) - endif - - include $(BUILDDIR)/common/Mapfile-vers.gmk ---- ./jdk/make/sun/security/jgss/wrapper/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/security/jgss/wrapper/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -71,6 +71,6 @@ - # - # Libraries to link - # --ifneq ($(PLATFORM), windows) -- OTHER_LDLIBS = -ldl $(JVMLIB) -+ifeq ($(PLATFORM), windows) -+OTHER_LDLIBS = $(LIBDL) $(JVMLIB) - endif ---- ./jdk/make/sun/security/krb5/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/security/krb5/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -75,7 +75,7 @@ - ifeq ($(PLATFORM), windows) - OTHER_LDLIBS = $(JVMLIB) - else -- OTHER_LDLIBS = -ldl $(JVMLIB) -+ OTHER_LDLIBS = $(LIBDL) $(JVMLIB) - endif - - build: ---- ./jdk/make/sun/security/pkcs11/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/security/pkcs11/Makefile 2011-06-21 05:39:00.000000000 -0700 -@@ -156,10 +156,10 @@ - # - # Libraries to link - # --ifeq ($(PLATFORM), windows) -+ifneq ($(PLATFORM), windows) - OTHER_LDLIBS = $(JVMLIB) - else -- OTHER_LDLIBS = -ldl $(JVMLIB) -+ OTHER_LDLIBS = $(LIBDL) $(JVMLIB) - endif - - # Other config files ---- ./jdk/make/sun/security/smartcardio/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/security/smartcardio/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -75,6 +75,6 @@ - ifeq ($(PLATFORM), windows) - OTHER_LDLIBS = $(JVMLIB) winscard.lib - else -- OTHER_LDLIBS = -ldl $(JVMLIB) -+ OTHER_LDLIBS = $(LIBDL) $(JVMLIB) - OTHER_CFLAGS = -D__sun_jdk - endif ---- ./jdk/make/sun/splashscreen/FILES_c.gmk 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/splashscreen/FILES_c.gmk 2011-04-22 23:08:16.000000000 -0700 -@@ -49,18 +49,6 @@ - dgif_lib.c \ - gif_err.c \ - gifalloc.c \ -- compress.c \ -- deflate.c \ -- gzio.c \ -- infback.c \ -- inffast.c \ -- inflate.c \ -- inftrees.c \ -- trees.c \ -- uncompr.c \ -- zadler32.c \ -- zcrc32.c \ -- zutil.c \ - jcomapi.c \ - jdapimin.c \ - jdapistd.c \ -@@ -106,3 +94,18 @@ - jfdctfst.c \ - jfdctint.c - -+ifneq ($(SYSTEM_ZLIB),true) -+ FILES_c += \ -+ compress.c \ -+ deflate.c \ -+ gzio.c \ -+ infback.c \ -+ inffast.c \ -+ inflate.c \ -+ inftrees.c \ -+ trees.c \ -+ uncompr.c \ -+ zadler32.c \ -+ zcrc32.c \ -+ zutil.c -+endif ---- ./jdk/make/sun/splashscreen/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/splashscreen/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -63,8 +63,24 @@ - - ifneq ($(PLATFORM), windows) +--- jdk/make/sun/splashscreen/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/sun/splashscreen/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -83,15 +83,16 @@ + -framework JavaNativeFoundation + else ifneq ($(PLATFORM), windows) CFLAGS += -DWITH_X11 -- CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions -- OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread -+ ifeq ($(PLATFORM), bsd) -+ ifeq ($(OS_VENDOR), Apple) -+ OTHER_LDLIBS += -liconv +- ifeq ($(PLATFORM), macosx)) +- OTHER_LDLIBS += -liconv +- CPPFLAGS += -I$(OPENWIN_HOME)/include \ +- -I$(OPENWIN_HOME)/include/X11/extensions +- OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -pthread +- else +- CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions +- OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread ++ ifeq ($(PLATFORM), bsd)) ++ ifeq ($(OS_NAME), netbsd) ++ OTHER_LDLIBS += -Wl,-R$(OPENWIN_LIB) + else -+ ifneq ($(OS_NAME), netbsd) -+ CPPFLAGS += -I$(PACKAGE_PATH)/include -+ OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv -+ else -+ OTHER_LDLIBS += -Wl,-R$(OPENWIN_LIB) -+ endif ++ CPPFLAGS += -I$(PACKAGE_PATH)/include ++ OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv + endif -+ CPPFLAGS += -I$(OPENWIN_HOME)/include \ -+ -I$(OPENWIN_HOME)/include/X11/extensions -+ OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -pthread -+ else -+ CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions -+ OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread -+ endif + endif ++ CPPFLAGS += -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions ++ OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread else # PLATFORM CFLAGS += -DWITH_WIN32 OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll -@@ -77,13 +93,20 @@ - vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/splashscreen - vpath %.c $(SHARE_SRC)/native/$(PKGDIR) - vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/giflib --vpath %.c $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) -+ifneq ($(SYSTEM_ZLIB),true) -+ vpath %.c $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) -+endif - vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/libpng - vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg - vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen - - CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen --CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) -+CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -+ifneq ($(SYSTEM_ZLIB),true) -+ CPPFLAGS += -I$(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION) -+else -+ OTHER_LDLIBS += -lz -+endif - - # Shun the less than portable MMX assembly code in pnggccrd.c, - # and use alternative implementations in C. ---- ./jdk/make/sun/tracing/dtrace/Makefile 2011-11-17 21:56:01.000000000 -0800 -+++ ./jdk/make/sun/tracing/dtrace/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -55,7 +55,7 @@ - FILES_export = $(FILES_java) - - ifeq ($(PLATFORM), linux) --OTHER_LDLIBS += -ldl -+OTHER_LDLIBS += $(LIBDL) - endif - - # ---- ./jdk/make/sun/xawt/Makefile 2011-11-17 21:56:02.000000000 -0800 -+++ ./jdk/make/sun/xawt/Makefile 2011-04-22 23:08:16.000000000 -0700 -@@ -47,6 +47,9 @@ +--- jdk/make/sun/xawt/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/sun/xawt/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -52,6 +52,9 @@ AUTO_JAVA_PRUNE = WrapperGenerator.java LDFLAGS += -L$(OPENWIN_LIB) @@ -16467,7 +2156,7 @@ # For Xrender extension. ifeq ($(PLATFORM), solaris) -@@ -58,6 +61,11 @@ +@@ -63,6 +66,11 @@ dummy := $(shell $(MKDIR) -p $(LIB_LOCATION)) endif @@ -16476,19 +2165,10 @@ +dummy := $(shell $(MKDIR) -p $(LIB_LOCATION)) +endif + - # Since this library will be living in a subdirectory below the other libraries - # we need to add an extra runpath so that libraries in the upper directory - # are found at runtime. -@@ -92,7 +100,7 @@ - vpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl - vpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11 - --OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \ -+OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) \ - $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi - - ifeq ($(PLATFORM), solaris) -@@ -100,8 +108,6 @@ + ifeq ($(PLATFORM), macosx)) + LDFLAGS += -pthread + dummy := $(shell $(MKDIR) -p $(LIB_LOCATION)) +@@ -110,8 +118,6 @@ dummy := $(shell $(MKDIR) -p $(LIB_LOCATION)) endif @@ -16497,7 +2177,7 @@ CPPFLAGS += -DXAWT -DXAWT_HACK \ -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \ -I$(PLATFORM_SRC)/native/sun/awt \ -@@ -128,12 +134,14 @@ +@@ -138,6 +144,8 @@ -I$(SHARE_SRC)/native/sun/awt \ -I$(PLATFORM_SRC)/native/sun/awt @@ -16506,1062 +2186,2371 @@ ifeq ($(PLATFORM), linux) ifndef CROSS_COMPILE_ARCH # Allows for builds on Debian GNU Linux, X11 is in a different place - # This should really be handled at a higher-level so we don't have to - # work-around this when cross-compiling -- CPPFLAGS += -I/usr/X11R6/include/X11/extensions \ -+ CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \ - -I/usr/include/X11/extensions \ - -I$(OPENWIN_HOME)/include - else -@@ -163,6 +171,14 @@ +@@ -173,6 +181,11 @@ endif endif +ifeq ($(PLATFORM), bsd) + CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions -I$(OPENWIN_HOME)/include -+endif -+ -+ifneq ($(PLATFORM), windows) + CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" +endif + - ifeq ($(MILESTONE), internal) - CPPFLAGS += -DINTERNAL_BUILD + ifeq ($(PLATFORM), macosx) + CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" endif ---- ./jdk/make/tools/freetypecheck/Makefile 2011-11-17 21:56:08.000000000 -0800 -+++ ./jdk/make/tools/freetypecheck/Makefile 2011-04-22 23:08:17.000000000 -0700 -@@ -49,8 +49,15 @@ - # Add runtime lib search path to ensure test will be runnable - ifeq ($(PLATFORM), solaris) - FT_LD_OPTIONS += -R $(FREETYPE_LIB_PATH) -lfreetype -- else #linux -+ else -+ ifeq ($(PLATFORM), bsd) -+ ifeq ($(OS_NAME), netbsd) -+ FT_LD_OPTIONS += -Wl,-R$(FREETYPE_LIB_PATH) +--- jdk/make/tools/freetypecheck/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/make/tools/freetypecheck/Makefile 2012-05-17 16:18:00.000000000 -0700 +@@ -52,8 +52,15 @@ + else + ifeq ($(PLATFORM), macosx) + FT_LD_OPTIONS += -lfreetype -lz +- else # linux +- FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) -lfreetype ++ else ++ ifeq ($(PLATFORM), bsd) ++ ifeq ($(OS_NAME), netbsd) ++ FT_LD_OPTIONS += -Wl,-R$(FREETYPE_LIB_PATH) ++ endif ++ FT_LD_OPTIONS += -lfreetype -lz ++ else # linux ++ FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) -lfreetype + endif -+ FT_LD_OPTIONS += -lfreetype -lz -+ else # linux - FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) -lfreetype -+ endif + endif endif endif - FT_OPTIONS += -I$(FREETYPE_HEADERS_PATH) ---- ./jdk/make/tools/reorder/Makefile 2011-11-17 21:56:09.000000000 -0800 -+++ ./jdk/make/tools/reorder/Makefile 2011-04-22 23:08:17.000000000 -0700 -@@ -185,11 +185,11 @@ - - # This library 'libmcount.so' also used by hotspot reordering. - $(OBJDIR)/libmcount.so : $(MCOUNT_OBJ) -- $(CC) -G -mt -zdefs -o $@ $^ -ldl -lelf $(EXTRA_LIBS) -+ $(CC) -G -mt -zdefs -o $@ $^ $(LIBDL) -lelf $(EXTRA_LIBS) - - # This library 'libmcount.so' also used by hotspot reordering. - $(OBJDIR)/remove_mcount : remove_mcount.c -- $(CC) -g -o $@ $^ -ldl -lelf $(EXTRA_LIBS) -+ $(CC) -g -o $@ $^ $(LIBDL) -lelf $(EXTRA_LIBS) - - - # Reorder libraries. ---- ./jdk/src/bsd/doc/man/ja/jvisualvm.1 2012-03-04 16:33:48.000000000 -0800 -+++ ./jdk/src/bsd/doc/man/ja/jvisualvm.1 1969-12-31 16:00:00.000000000 -0800 -@@ -1,126 +0,0 @@ --." Copyright (c) 2008, 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA --." or visit www.oracle.com if you need additional information or have any --." questions. --." --.TH jvisualvm 1 "07 May 2011" -- --.LP --.SH "̾Á°" --\f2jvisualvm\fP \- Java ²¾ÁÛ¥Þ¥·¥ó¤Î´Æ»ë¡¢¥È¥é¥Ö¥ë¥·¥å¡¼¥Æ¥£¥ó¥°¡¢¤ª¤è¤Ó¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¥Ä¡¼¥ë --.LP --.RS 3 --.TP 2 --o --·Á¼° --.TP 2 --o --¥Ñ¥é¥á¡¼¥¿ --.TP 2 --o --ÀâÌÀ --.TP 2 --o --¥ª¥×¥·¥ç¥ó --.TP 2 --o --»ÈÍÑÊýË¡ --.TP 2 --o --´ØÏ¢¹àÌÜ --.RE -- --.LP --.SH "·Á¼°" --.LP --.nf --\f3 --.fl -- \fP\f3jvisualvm\fP [ \f2options\fP ] --.fl --.fi -- --.LP --.SH "¥Ñ¥é¥á¡¼¥¿" --.LP --.LP --¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥³¥Þ¥ó¥É̾¤Îľ¸å¤Ëµ½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£¥ª¥×¥·¥ç¥ó¤Î»ØÄê½ç½ø¤Ë·è¤Þ¤ê¤Ï¤¢¤ê¤Þ¤»¤ó¡£ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤ËŬÍѤµ¤ì¤ë¥Ñ¥é¥á¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤³¤Î¤¢¤È¤Î¡Ö¥ª¥×¥·¥ç¥ó¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ --.LP --.SH " ÀâÌÀ" --.LP --.LP --Java VisualVM ¤Ï¡¢»ØÄꤵ¤ì¤¿ Java ²¾ÁÛ¥Þ¥·¥ó (JVM(*)) ¤Ç Java ¥Æ¥¯¥Î¥í¥¸¥Ù¡¼¥¹¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó (Java ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó) ¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¤È¤¤Ë¡¢¤½¤Î Java ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ê¾ðÊó¤òÄ󶡤¹¤ëľ´¶Åª¤Ê¥°¥é¥Õ¥£¥«¥ë¥æ¡¼¥¶¡¼¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¤¹¡£Java VisualVM ¤È¤¤¤¦Ì¾Á°¤Ï¡¢Java VisualVM ¤¬ JVM ¥½¥Õ¥È¥¦¥§¥¢¤Ë´Ø¤¹¤ë¾ðÊó¤ò¡Ö»ë³ÐŪ¤Ë¡×Ä󶡤¹¤ë¤È¤¤¤¦»ö¼Â¤ËͳÍ褷¤Æ¤¤¤Þ¤¹¡£ --.LP --.LP --Java VisualVM ¤Ï¡¢¤¤¤¯¤Ä¤«¤Î´Æ»ë¡¢¥È¥é¥Ö¥ë¥·¥å¡¼¥Æ¥£¥ó¥°¡¢¤ª¤è¤Ó¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤ò 1 ¤Ä¤Î¥Ä¡¼¥ë¤ËÅý¹ç¤·¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢¥¹¥¿¥ó¥É¥¢¥í¥ó¥Ä¡¼¥ë \f2jmap\fP¡¢ \f2jinfo\fP¡¢ \f2jstat\fP ¡¢¤ª¤è¤Ó \f2jstack\fP ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ëµ¡Ç½¤Î¤Û¤È¤ó¤É¤¬¡¢Java VisualVM ¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£JConsole ¥Ä¡¼¥ë¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤ë°ìÉô¤Îµ¡Ç½¤Ê¤É¡¢¤Û¤«¤Îµ¡Ç½¤Ï¥ª¥×¥·¥ç¥ó¤Î¥×¥é¥°¥¤¥ó¤È¤·¤ÆÄɲäǤ¤Þ¤¹¡£ --.LP --.SH "¥ª¥×¥·¥ç¥ó" --.LP --.LP --¼¡¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢Java VisualVM ¤òµ¯Æ°¤·¤¿¤È¤¤Ë¼Â¹Ô²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£ --.LP --.RS 3 --.TP 3 --\-J<jvm_option>\ --¤³¤Î \f2<jvm_option>\fP ¤ò JVM ¥½¥Õ¥È¥¦¥§¥¢¤ËÅϤ·¤Þ¤¹¡£ --.RE -- --.LP --.SH "»ÈÍÑÊýË¡" --.LP --.LP --Java VisualVM ¤Ï¡¢Java ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î³«È¯¼Ô¤¬¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥È¥é¥Ö¥ë¥·¥å¡¼¥Æ¥£¥ó¥°¤ò¹Ô¤Ê¤Ã¤¿¤ê¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò´Æ»ë¤ª¤è¤Ó²þÁ±¤·¤¿¤ê¤¹¤ë¤Î¤ËÌòΩ¤Á¤Þ¤¹¡£Java VisualVM ¤ò»ÈÍѤ¹¤ë¤È¡¢³«È¯¼Ô¤Ï¥Ò¡¼¥×¥À¥ó¥×¤ÎÀ¸À®¤ª¤è¤Ó²òÀÏ¡¢¥á¥â¥ê¡¼¥ê¡¼¥¯¤ÎÆÃÄê¡¢¥¬¥Ù¡¼¥¸¥³¥ì¥¯¥·¥ç¥ó¤Î¼Â¹Ô¤ª¤è¤Ó´Æ»ë¡¢¤ª¤è¤Ó¥á¥â¥ê¡¼¤È CPU ¤Î´Ê°×¥×¥í¥Õ¥¡¥¤¥ê¥ó¥°¤Î¼Â¹Ô¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£Java VisualVM ¤Îµ¡Ç½¤ò³ÈÄ¥¤¹¤ë¥×¥é¥°¥¤¥ó¤â¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢JConsole ¥Ä¡¼¥ë¤Î¤Û¤È¤ó¤É¤Îµ¡Ç½¤Ï¡¢MBeans ¥¿¥Ö¤ª¤è¤Ó JConsole Plug\-in Wrapper ¥×¥é¥°¥¤¥ó¤ò²ð¤·¤Æ»ÈÍѤǤ¤Þ¤¹¡£É¸½à¤Î Java VisualVM ¥×¥é¥°¥¤¥ó¤Î¥«¥¿¥í¥°¤«¤éÁªÂò¤¹¤ë¤Ë¤Ï¡¢Java VisualVM ¥á¥Ë¥å¡¼¤Î¡Ö¥Ä¡¼¥ë¡×>¡Ö¥×¥é¥°¥¤¥ó¡×¤òÁªÂò¤·¤Þ¤¹¡£ --.LP --.LP --Java VisualVM ¤òµ¯Æ°¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£ --.LP --.nf --\f3 --.fl --% jvisualvm \fP\f4<options>\fP\f3 --.fl --\fP --.fi -- --.LP --.SH "´ØÏ¢¹àÌÜ" --.LP --.LP --Java VisualVM ¤Î¾ÜºÙ¤Ï¡¢¼¡¤Î¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ --.LP --.RS 3 --.TP 2 --o --.na --\f2Java VisualVM ³«È¯¼Ô¤Î¥µ¥¤¥È\fP @ --.fi --http://visualvm.java.net --.TP 2 --o --.na --\f2Java SE ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Î Java VisualVM ¤Î¥É¥¥å¥á¥ó¥È\fP @ --.fi --http://java.sun.com/javase/6/docs/technotes/guides/visualvm/index.html --.RE -- --.LP --.LP --\f2(* ¡ÖJava ²¾ÁÛ¥Þ¥·¥ó¡×¤È¡ÖJVM¡×¤È¤¤¤¦ÍѸì¤Ï¡¢Java ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î²¾ÁÛ¥Þ¥·¥ó¤ò°ÕÌ£¤·¤Æ¤¤¤Þ¤¹¡£)\fP --.LP -- ---- ./jdk/src/bsd/doc/man/ja/kinit.1 1969-12-31 16:00:00.000000000 -0800 -+++ ./jdk/src/bsd/doc/man/ja/kinit.1 2011-04-22 23:08:18.000000000 -0700 -@@ -0,0 +1,159 @@ -+'\" t -+.\" -+.\" Copyright 2002-2004 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+.\" or visit www.oracle.com if you need additional information or have any -+.\" questions. -+.\" -+.\" -+.\" -+.TH kinit 1 "2004 ǯ 6 ·î 22 Æü" -+.SH "̾Á°" -+kinit \- kinit ¤Ï Kerberos ¥Á¥±¥Ã¥Èµö²Ä¥Á¥±¥Ã¥È¤ò¼èÆÀ¤ª¤è¤Ó¥¥ã¥Ã¥·¥å -+¤¹¤ë¤È¤¤Ë»ÈÍѤ·¤Þ¤¹¡£¤³¤Î¥Ä¡¼¥ë¤Ï¤Û¤«¤Î°ìÈÌŪ¤Ê Kerberos ¼ÂÁõ -+(SEAM ¤ä MIT ¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¼ÂÁõ¤Ê¤É) ¤Î kinit ¥Ä¡¼¥ë¤Èµ¡Ç½Åª¤Ë»÷¤Æ¤¤¤Þ¤¹¡£ -+.LP -+kinit ¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢kinit ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë Key Distribution Center -+(KDC) ¤ò»ÈÍѤ·¤Æ¥×¥ê¥ó¥·¥Ñ¥ë¤È¤·¤ÆÅÐÏ¿¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ -+.SH "·Á¼°" -+.B kinit -+[ -+.IR commands " ]" -+<principal name> -+.SH "µ¡Ç½ÀâÌÀ" -+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢UNIX ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¾ì¹ç¡¢/tmp/krb5cc_<uid> ¤È¤¤¤¦ -+̾Á°¤Î¥¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Þ¤¹¡£<uid> ¤Ï¡¢¥·¥¹¥Æ¥à¤Ë¥í¥°¥¤¥ó -+¤·¤¿¥æ¡¼¥¶¤Î¥æ¡¼¥¶¼±ÊÌÈÖ¹æ¤Ç¤¹¡£¤½¤Î¾¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¾ì¹ç¡¢ -+<USER_HOME>/krb5cc_<USER_NAME> ¤È¤¤¤¦Ì¾Á°¤Î¥¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë -+¤¬À¸À®¤µ¤ì¤Þ¤¹¡£ -+.LP -+<USER_HOME> ¤Ï -+.BR java.lang.System -+¥×¥í¥Ñ¥Æ¥£¤Î -+.BR user.home -+¤«¤é¼èÆÀ¤µ¤ì¤Þ¤¹¡£<USER_NAME> ¤Ï -+.BR java.lang.System -+¥×¥í¥Ñ¥Æ¥£¤Î -+.BR user.name -+¤«¤é¼èÆÀ¤µ¤ì¤Þ¤¹¡£<USER_HOME> ¤¬ null ¤Ç¤¢¤ë¾ì¹ç¡¢ -+¥¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤¿¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë³ÊǼ¤µ¤ì -+¤Þ¤¹¡£<USER_NAME> ¤Ï¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥í¥°¥¤¥ó¥æ¡¼¥¶Ì¾ -+¤Ç¤¹¡£¤³¤Î¥æ¡¼¥¶Ì¾¤Ï¥æ¡¼¥¶¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¤Ï°Û¤Ê¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£ -+¤¿¤È¤¨¤Ð Solaris ¤Ç¤Ï¡¢<USER_NAME> ¤¬ duke ¤Ç¤¢¤ê¡¢<USER_HOME> -+¤¬ /home/duke ¤Ç¤¢¤ë¾ì¹ç¡¢¥æ¡¼¥¶¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤Ï /home/duke/krb5cc_duke -+¤Ë¤Ê¤ê¤Þ¤¹¡£ -+.LP -+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥¡¼¥¿¥Ö̾¤Ï Kerberos ¹½À®¥Õ¥¡¥¤¥ë¤«¤é¼èÆÀ¤µ¤ì¤Þ¤¹¡£ -+¥¡¼¥¿¥Ö̾¤¬ Kerberos ¹½À®¥Õ¥¡¥¤¥ë¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥¡¼¥¿¥Ö̾¤Ï <USER_HOME>/krb5.keytab ¤Ë¤Ê¤ê¤Þ¤¹¡£ -+.LP -+¥³¥Þ¥ó¥É¹Ô¤Î password ¥ª¥×¥·¥ç¥ó¤Ç¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢ -+kinit ¤Ï¥Ñ¥¹¥ï¡¼¥É¤ÎÆþÎϤòµá¤á¤Þ¤¹¡£ -+.LP -+.B Ãí: -+¥³¥Þ¥ó¥É¹Ô¤Î password ¥ª¥×¥·¥ç¥ó¤Ï¥Æ¥¹¥È¤ÎÌÜŪ¤À¤±¤ËÄ󶡤µ¤ì¤Þ¤¹¡£ -+¥Ñ¥¹¥ï¡¼¥É¤ò¥¹¥¯¥ê¥×¥ÈÆâ¤Ë»ØÄꤷ¤¿¤ê¡¢¥³¥Þ¥ó¥É¹Ô¤Ë»ØÄꤷ¤¿¤ê¤·¤Ê¤¤¤Ç -+¤¯¤À¤µ¤¤¡£¤½¤¦¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Ñ¥¹¥ï¡¼¥É¤¬Ï³¤ì¤ë²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹¡£ -+.LP -+¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢kinit ´ØÏ¢¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -+.SH "¥³¥Þ¥ó¥É" -+.B kinit \-fp -+[ -+\-c <cache_name> ] -+[ -+\-k ] -+[ -+\-t <keytab_filename> ] -+[ -+<principal> ] -+[ -+<password> ] -+[ -+\-help ] -+.TP -+.BI \-f -+žÁ÷²Äǽ¤Ê¥Á¥±¥Ã¥È¤òȯ¹Ô¤·¤Þ¤¹¡£ -+.TP -+.BI \-p -+¥×¥í¥¥·²Äǽ¤Ê¥Á¥±¥Ã¥È¤òȯ¹Ô¤·¤Þ¤¹¡£ -+.TP -+.BI \-c -+<cache_name> -+¥¥ã¥Ã¥·¥å̾ (¤¿¤È¤¨¤Ð¡¢FILE:/temp/mykrb5cc)¡£ -+.TP -+.BI \-k -+¥¡¼¥¿¥Ö¤ò»ÈÍѤ·¤Þ¤¹¡£ -+.TP -+.BI \-t -+<keytab_filename> -+¥¡¼¥¿¥Ö̾ (¤¿¤È¤¨¤Ð¡¢/home/duke/krb5.keytab)¡£ -+.TP -+.BI <principal> -+¥×¥ê¥ó¥·¥Ñ¥ë̾ (¤¿¤È¤¨¤Ð¡¢duke@java.sun.com)¡£ -+.TP -+.BI <password> -+¥×¥ê¥ó¥·¥Ñ¥ë¤Î Kerberos ¥Ñ¥¹¥ï¡¼¥É (¥³¥Þ¥ó¥É¹Ô¤ä¥¹¥¯¥ê¥×¥È¤Ë¥Ñ¥¹¥ï¡¼¥É -+¤ò»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤)¡£ -+.TP -+.BI \-help -+¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£ -+.SH "»ÈÍÑÎã" -+ǧ¾Ú¤Ë͸ú¤Ê»ñ³Ê¤ò¸½ºß¤Î¥¯¥é¥¤¥¢¥ó¥È¥Û¥¹¥È¤«¤éÍ׵ᤷ¤Æ¡¢ -+¥Ç¥Õ¥©¥ë¥È¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Ë»ñ³Ê¤Î¥¥ã¥Ã¥·¥å¤ò¥Ç¥Õ¥©¥ë¥È¤Î¾ì½ê -+(/home/duke/krb5cc_duke) ¤Ë³ÊǼ¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+kinit duke@JAVA.SUN.COM -+.fi -+.ft 1 -+.LP -+°Û¤Ê¤ë¥×¥ê¥ó¥·¥Ñ¥ë¤Î¤¿¤á¤Ë¥×¥í¥¥·²Äǽ¤Ê»ñ³Ê¤òÍ׵ᤷ¤Æ¡¢¤³¤ì¤é¤Î»ñ³Ê¤ò -+»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥¥ã¥Ã¥·¥å¤Ë³ÊǼ¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+kinit \-p \-c FILE:/home/duke/credentials/krb5cc_cafebeef cafebeef@JAVA.SUN.COM -+.fi -+.ft 1 -+.LP -+°Û¤Ê¤ë¥×¥ê¥ó¥·¥Ñ¥ë¤Î¤¿¤á¤Ë¥×¥í¥¥·²Äǽ¤ÇžÁ÷²Äǽ¤Ê»ñ³Ê¤òÍ׵ᤷ¤Æ¡¢ -+¤³¤ì¤é¤Î»ñ³Ê¤ò»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥¥ã¥Ã¥·¥å¤Ë³ÊǼ¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+kinit \-f \-p \-c -+FILE:/home/duke/credentials/krb5cc_cafebeef cafebeef@JAVA.SUN.COM -+.fi -+.ft 1 -+.LP -+kinit ¤Î¥Ø¥ë¥×¥á¥Ë¥å¡¼¤òɽ¼¨¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+kinit \-help -+.fi -+.ft 1 -+.LP -+.SH "¥»¥¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ë·Ù¹ð" -+¥³¥Þ¥ó¥É¹Ô¤Î -+.BR password -+¥ª¥×¥·¥ç¥ó¤Ï¥Æ¥¹¥È¤ÎÌÜŪ¤À¤±¤ËÄ󶡤µ¤ì¤Þ¤¹¡£¥Ñ¥¹¥ï¡¼¥É¤ò¥³¥Þ¥ó¥É¹Ô¤Ë»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£ -+¤³¤ì¤Ï¥»¥¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ê¤ê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢UNIX ¤Î -+.BR ps -+¥³¥Þ¥ó¥É¤Î¼Â¹ÔÃæ¤Ë¡¢¹¶·â¼Ô¤Ï¥Ñ¥¹¥ï¡¼¥É¤ò¸¡½Ð¤¹¤ë¤³¤È¤¬¤Ç¤¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ---- ./jdk/src/bsd/doc/man/ja/klist.1 1969-12-31 16:00:00.000000000 -0800 -+++ ./jdk/src/bsd/doc/man/ja/klist.1 2011-04-22 23:08:18.000000000 -0700 -@@ -0,0 +1,110 @@ -+'\" t -+.\" -+.\" Copyright 2002-2004 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+.\" or visit www.oracle.com if you need additional information or have any -+.\" questions. -+.\" -+.\" -+.TH klist 1 "2004 ǯ 6 ·î 22 Æü" -+.SH "̾Á°" -+klist \- Kerberos ¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å¤È¥¡¼¥¿¥ÖÆâ¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤·¤Þ¤¹¡£ -+.LP -+.BR klist -+¤ò»ÈÍѤ¹¤ë¤È¡¢¥æ¡¼¥¶¤Ï¥í¡¼¥«¥ë¤Ë¤¢¤ë¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å¤È -+¥¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤Ç¤¤Þ¤¹¡£ -+.SH "·Á¼°" -+.B klist -+[ -+.IR commands " ]" -+.SH "µ¡Ç½ÀâÌÀ" -+.BR klist -+¤Ï¥í¡¼¥«¥ë¤Ë¤¢¤ë¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å¤È¥¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤·¤Þ¤¹¡£ -+¥æ¡¼¥¶¤¬ -+.BR kinit -+¤ò»ÈÍѤ·¤Æ¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å¤òÊѹ¹¤·¤¿¤ê¡¢ -+.BR ktab -+¤ò»ÈÍѤ·¤Æ¥¡¼¥¿¥Ö¤òÊѹ¹¤·¤¿¸å¡¢Êѹ¹¤ò³Îǧ¤¹¤ëÍ£°ì¤ÎÊýË¡¤Ï¡¢ -+.BR klist -+¤ò»ÈÍѤ·¤Æ¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å¤Þ¤¿¤Ï¥¡¼¥¿¥Ö¤ÎÆâÍƤòɽ¼¨¤¹¤ë¤³¤È¤Ç¤¹¡£ -+.BR klist -+¤Ï Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÊѹ¹¤·¤Þ¤»¤ó¡£ -+ -+.SH "¥³¥Þ¥ó¥É" -+.B klist -+[ -+\-c [\-fe]] -+[ -+\-k [\-tK]] -+[ -+<name>] -+[ -+\-help ] -+.TP -+.BI \-c -+ɽ¼¨¤·¤¿¤¤¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡£ -+.TP -+.BI \-k -+ɽ¼¨¤·¤¿¤¤¥¡¼¥¿¥Ö¤Î¥¨¥ó¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡£ -+.TP -+.BI <cache_name> -+¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å̾¤Þ¤¿¤Ï¥¡¼¥¿¥Ö̾¤ò»ØÄꤷ¤Þ¤¹¡£Ì¾Á°¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢ -+¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å̾¤Þ¤¿¤Ï¥¡¼¥¿¥Ö¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤ¬»ÈÍѤµ¤ì¤Þ¤¹¡£ -+¥¥ã¥Ã¥·¥å¤È¥¡¼¥¿¥Ö¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤˤĤ¤¤Æ¤Ï¡¢ -+.BR kinit -+¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -+.LP -+\-c ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥åÍѤΥª¥×¥·¥ç¥ó¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£ -+.TP -+.BI \-f -+¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥Õ¥é¥°¤òɽ¼¨¤·¤Þ¤¹¡£ -+.TP -+.BI \-e -+°Å¹æ²½¥¿¥¤¥×¤òɽ¼¨¤·¤Þ¤¹¡£ -+.LP -+\-k ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥¡¼¥¿¥ÖÍѤΥª¥×¥·¥ç¥ó¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£ -+.TP -+.BI \-t -+¥¡¼¥¿¥Ö¥¨¥ó¥È¥ê¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òɽ¼¨¤·¤Þ¤¹¡£ -+.TP -+.BI \-K -+¥¡¼¥¿¥Ö¥¨¥ó¥È¥ê¤Î DES ¥¡¼¤òɽ¼¨¤·¤Þ¤¹¡£ -+.LP -+.TP -+.BI \-help -+¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£ -+.SH "»ÈÍÑÎã" -+»ØÄꤷ¤¿¥¡¼¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤È¡¢¤½¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤È DES ¥¡¼ -+¤òɽ¼¨¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+klist \-k \-t \-K FILE:/temp/mykrb5cc -+.fi -+.ft 1 -+.LP -+»ØÄꤷ¤¿¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤È¡¢¤½¤Î¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥Õ¥é¥°¤È¥¢¥É¥ì¥¹¥ê¥¹¥È¤ò -+ɽ¼¨¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+klist \-c \-f FILE:/temp/mykrb5cc -+.fi -+.ft 1 -+.LP ---- ./jdk/src/bsd/doc/man/ja/ktab.1 1969-12-31 16:00:00.000000000 -0800 -+++ ./jdk/src/bsd/doc/man/ja/ktab.1 2011-04-22 23:08:18.000000000 -0700 -@@ -0,0 +1,125 @@ -+'\" t -+.\" -+.\" Copyright 2002-2004 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+.\" or visit www.oracle.com if you need additional information or have any -+.\" questions. -+.\" -+.\" -+.TH ktab 1 "2004 ǯ 6 ·î 22 Æü" -+.SH "̾Á°" -+ktab \- Kerberos ¥¡¼¥Æ¡¼¥Ö¥ë¥Þ¥Í¡¼¥¸¥ã -+.LP -+.BR ktab -+¤ò»ÈÍѤ¹¤ë¤È¡¢¥æ¡¼¥¶¤Ï¥í¡¼¥«¥ë¤Ë¤¢¤ë¥¡¼¥Æ¡¼¥Ö¥ë¤Ë³ÊǼ¤µ¤ì¤¿ -+¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¥µ¡¼¥Ó¥¹¥¡¼¤ò´ÉÍý¤Ç¤¤Þ¤¹¡£¥¡¼¥¿¥ÖÆâ¤Î¥×¥ê¥ó¥·¥Ñ¥ë -+¤È¥¡¼¥Ú¥¢¤Ï¡¢¥Û¥¹¥È¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤Ë¡¢¤½¤ì¤é¼«¿È¤ò -+Key Distribution Center (KDC) ¤Ëǧ¾Ú¤µ¤»¤Þ¤¹¡£¥µ¡¼¥Ð¤¬ Kerberos ¤ò -+»ÈÍѤǤ¤ë¤è¤¦¤ËÀßÄꤹ¤ë¤Ë¤Ï¡¢¤½¤ÎÁ°¤Ë¥æ¡¼¥¶¤Ï¥µ¡¼¥Ð¤¬Æ°ºî¤·¤Æ¤¤¤ë -+¥Û¥¹¥È¾å¤Ç¥¡¼¥¿¥Ö¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ktab ¤ò»ÈÍѤ·¤Æ¥¡¼¥¿¥Ö -+¤òÊѹ¹¤·¤Æ¤â¡¢Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ -+¤¤¡£¥¡¼¥¿¥ÖÆâ¤Î¥¡¼¤òÊѹ¹¤·¤¿¾ì¹ç¡¢Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤ÎÂбþ¤¹¤ë -+²Õ½ê¤âÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ -+.SH "·Á¼°" -+.B ktab -+[ -+.IR commands " ]" -+.SH "µ¡Ç½ÀâÌÀ" -+.BR ktab -+¤Ï¡¢¥¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¥¡¼¥Ú¥¢¤ò´ÉÍý¤·¤Þ¤¹¡£ -+.BR ktab -+¤ò»ÈÍѤ¹¤ë¤È¡¢¥æ¡¼¥¶¤Ï¥¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¥¡¼¥Ú¥¢¤ò -+°ìÍ÷ɽ¼¨¡¢Äɲᢹ¹¿·¡¢¤Þ¤¿¤Ïºï½ü¤Ç¤¤Þ¤¹¡£¤³¤ì¤é¤ÎÁàºî¤Ï¤¹¤Ù¤Æ¡¢ -+Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï±Æ¶Á¤·¤Þ¤»¤ó¡£ -+.LP -+.ft 3 -+.B ¥¡¼¥¿¥Ö -+.LP -+¥¡¼¥¿¥Ö¤È¤Ï¡¢¥Û¥¹¥È¤¬»ý¤Ä¼«Ê¬¼«¿È¤Î¥¡¼¥ê¥¹¥È¤Î¥³¥Ô¡¼¤Ç¤¢¤ê¡¢¥æ¡¼¥¶ -+¤Î¥Ñ¥¹¥ï¡¼¥É¤È»÷¤Æ¤¤¤Þ¤¹¡£¼«Ê¬¼«¿È¤ò Key Distribution Center (KDC) -+¤Ëǧ¾Ú¤µ¤»¤ëɬÍפ¬¤¢¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥µ¡¼¥Ð¤Ï¡¢¤½¤ì¼«¿È¤Î¥×¥ê¥ó¥·¥Ñ¥ë -+¤È¥¡¼¤ò´Þ¤à¥¡¼¥¿¥Ö¤ò»ý¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥æ¡¼¥¶¤¬¼«Ê¬¤Î -+¥Ñ¥¹¥ï¡¼¥É¤òÊݸ¤ë¤³¤È¤¬ÂçÀڤǤ¢¤ë¤Î¤ÈƱÍͤˡ¢¥Û¥¹¥È¤Ï¼«Ê¬¤Î¥¡¼¥¿¥Ö -+¤òÊݸ¤ë¤³¤È¤¬ÂçÀڤǤ¹¡£¥¡¼¥¿¥Ö¥Õ¥¡¥¤¥ë¤Ï¾ï¤Ë¥í¡¼¥«¥ë¥Ç¥£¥¹¥¯¤Ë -+³ÊǼ¤·¤Æ¡¢root °Ê³°¤Î¥æ¡¼¥¶¤¬Æɤá¤Ê¤¤¤è¤¦¤ËÀßÄꤷ¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ -+¥¡¼¥¿¥Ö¥Õ¥¡¥¤¥ë¤Ï°Å¹æ²½¤»¤º¤Ë¥Í¥Ã¥È¥ï¡¼¥¯¤ØÁ÷¿®¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£ -+.SH "¥³¥Þ¥ó¥É" -+»ÈÍÑË¡: ¥³¥Þ¥ó¥É¹Ô¥ª¥×¥·¥ç¥ó¤Ç¤ÏÂçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤·¤Þ¤»¤ó¡£ -+.LP -+.B ktab -+\-help -+.LP -+.B ktab -+\-l [\-k <keytab_name>] -+.LP -+.B ktab -+[\-a <principal_name> <password>] [\-k <keytab_name>] -+.LP -+.B ktab -+[\-d <principal_name>] [\-k <keytab_name>] -+.LP -+.TP -+.BI \-l -+¥¡¼¥¿¥Ö̾¤È¥¨¥ó¥È¥ê¤ò°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£ -+.TP -+.BI \-a -+<principal_name> <password> -+¥¨¥ó¥È¥ê¤ò¥¡¼¥¿¥Ö¤ËÄɲä·¤Þ¤¹¡£Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏÊѹ¹¤·¤Þ¤»¤ó -+(¥³¥Þ¥ó¥É¹Ô¤ä¥¹¥¯¥ê¥×¥È¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤)¡£ -+.TP -+.BI \-d -+<principal_name> -+¥¡¼¥¿¥Ö¤«¤é¥¨¥ó¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏÊѹ¹¤·¤Þ¤»¤ó¡£ -+.TP -+.BI \-k -+<keytab_name> -+¥¡¼¥¿¥Ö̾¤È¡¢ÀÜƬ¼ FILE: ¤Ç»Ï¤Þ¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ -+.TP -+.BI \-help -+¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£ -+.SH "»ÈÍÑÎã" -+¥Ç¥Õ¥©¥ë¥È¤Î¥¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤ò¤¹¤Ù¤Æɽ¼¨¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+ktab \-l -+.fi -+.ft 1 -+.LP -+¿·¤·¤¤¥×¥ê¥ó¥·¥Ñ¥ë¤ò¥¡¼¥Æ¡¼¥Ö¥ë¤ËÄɲä·¤Þ¤¹¡£¥Ñ¥¹¥ï¡¼¥É¤ÎÆþÎϤ¬µá¤á¤é¤ì¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+ktab \-a duke@java.sun.com -+.fi -+.ft 1 -+.LP -+¥¡¼¥Æ¡¼¥Ö¥ë¤«¤é¥×¥ê¥ó¥·¥Ñ¥ë¤òºï½ü¤·¤Þ¤¹¡£ -+.LP -+.ft 3 -+.nf -+ktab \-d duke@java.sun.com -+.fi -+.ft 1 -+.LP -+.SH "¥»¥¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ë·Ù¹ð" -+¥Ñ¥¹¥ï¡¼¥É¤ò¥³¥Þ¥ó¥É¹Ô¤Ë»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£¤³¤ì¤Ï¥»¥¥å¥ê¥Æ¥£¥Û¡¼¥ë -+¤Ë¤Ê¤ê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢UNIX ¤Î -+.BI ps -+¥³¥Þ¥ó¥É¤Î¼Â¹ÔÃæ¤Ë¡¢¹¶·â¼Ô¤Ï¥Ñ¥¹¥ï¡¼¥É¤ò¸¡½Ð¤¹¤ë¤³¤È¤¬¤Ç¤¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ---- ./jdk/src/bsd/doc/man/jvisualvm.1 2012-03-04 16:33:48.000000000 -0800 -+++ ./jdk/src/bsd/doc/man/jvisualvm.1 1969-12-31 16:00:00.000000000 -0800 -@@ -1,104 +0,0 @@ --." Copyright (c) 2008, 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA --." or visit www.oracle.com if you need additional information or have any --." questions. --." --.TH jvisualvm 1 "10 May 2011" -- --.LP --.SH "Name" --\f2jvisualvm\fP \- Java Virtual Machine Monitoring, Troubleshooting, and Profiling Tool --.LP --.SH "SYNOPSIS" --.LP --.nf --\f3 --.fl -- \fP\f3jvisualvm\fP [ \f2options\fP ] --.fl --.fi -- --.LP --.SH "PARAMETERS" --.LP --.LP --Options, if used, should follow immediately after the command name. Options may be in any order. For a discussion of parameters that apply to a specific option, see OPTIONS below. --.LP --.SH "DESCRIPTION" --.LP --.LP --Java VisualVM is an intuitive graphical user interface that provides detailed information about Java technology\-based applications (Java applications) while they are running on a given Java Virtual Machine (JVM(*)). The name Java VisualVM comes from the fact that Java VisualVM provides information about the JVM software \f2visually\fP. --.LP --.LP --Java VisualVM combines several monitoring, troubleshooting, and profiling utilities into a single tool. For example, most of the functionality offered by the standalone tools \f2jmap\fP, \f2jinfo\fP, \f2jstat\fP and \f2jstack\fP have been integrated into Java VisualVM. Other functionalities, such as some of those offered by the JConsole tool, can be added as optional plug\-ins. --.LP --.SH "OPTIONS" --.LP --.LP --The following option is possible when you launch Java VisualVM. --.LP --.RS 3 --.TP 3 --\-J<jvm_option>\ --Pass this \f2<jvm_option>\fP to the JVM software. --.RE -- --.LP --.SH "USAGE" --.LP --.LP --Java VisualVM is useful to Java application developers to troubleshoot applications and to monitor and improve the applications' performance. Java VisualVM can allow developers to generate and analyse heap dumps, track down memory leaks, perform and monitor garbage collection, and perform lightweight memory and CPU profiling. Plug\-ins also exist that expand the functionality of Java VisualVM. For example, most of the functionality of the JConsole tool is available via the MBeans Tab and JConsole Plug\-in Wrapper plug\-ins. You can choose from a catalog of standard Java VisualVM plug\-ins by selecting 'Tools' | 'Plugins' in the Java VisualVM menus. --.LP --.LP --Start Java VisualVM with the following command: --.LP --.nf --\f3 --.fl --% jvisualvm \fP\f4<options>\fP\f3 --.fl --\fP --.fi -- --.LP --.SH "SEE ALSO" --.LP --.LP --For more details about Java VisualVM see the following pages. --.LP --.RS 3 --.TP 2 --o --.na --\f2Java VisualVM developers' site\fP @ --.fi --http://visualvm.java.net --.TP 2 --o --.na --\f2Java VisualVM in Java SE platform documentation\fP @ --.fi --http://download.oracle.com/javase/7/docs/technotes/guides/visualvm/index.html --.RE -- --.LP --.LP --\f2(* The terms "Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java platform.)\fP --.LP -- ---- ./jdk/src/share/back/commonRef.c 2011-11-17 21:56:19.000000000 -0800 -+++ ./jdk/src/share/back/commonRef.c 2011-04-22 23:08:18.000000000 -0700 -@@ -23,6 +23,10 @@ - * questions. - */ - -+#if defined(_ALLBSD_SOURCE) -+#include <stdint.h> /* for uintptr_t */ -+#endif -+ - #include "util.h" - #include "commonRef.h" - ---- ./jdk/src/share/bin/java.c 2011-11-17 21:56:19.000000000 -0800 -+++ ./jdk/src/share/bin/java.c 2011-04-22 23:08:18.000000000 -0700 -@@ -70,6 +70,10 @@ - static jboolean printXUsage = JNI_FALSE; /* print and exit*/ - static char *showSettings = NULL; /* print but continue */ - -+#ifdef __APPLE__ -+static jboolean continueInSameThread = JNI_FALSE; /* start VM in current thread */ -+#endif -+ - static const char *_program_name; - static const char *_launcher_name; - static jboolean _is_java_args = JNI_FALSE; -@@ -120,6 +124,10 @@ - static void DumpState(); - static jboolean RemovableOption(char *option); - -+#ifdef __APPLE__ -+static int ContinueInSameThread(InvocationFunctions* ifn, int argc, char **argv, int mode, char *what, int ret); -+#endif -+ - /* Maximum supported entries from jvm.cfg. */ - #define INIT_MAX_KNOWN_VMS 10 - -@@ -315,7 +323,15 @@ - /* Show the splash screen if needed */ - ShowSplashScreen(); - -+#ifdef __APPLE__ -+ if (continueInSameThread == JNI_TRUE) { -+ return ContinueInSameThread(&ifn, argc, argv, mode, what, ret); -+ } else { -+ return ContinueInNewThread(&ifn, argc, argv, mode, what, ret); -+ } -+#else - return ContinueInNewThread(&ifn, argc, argv, mode, what, ret); -+#endif - - } - /* -@@ -1006,6 +1022,12 @@ - } 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 checks for -XshowSettings OR -XshowSetting:SUBOPT. - * In the latter case, any SUBOPT value not recognized will default to "all" -@@ -1897,6 +1919,44 @@ - } - } - -+#ifdef __APPLE__ -+static int -+ContinueInSameThread(InvocationFunctions* ifn, int argc, char **argv, -+ int mode, char *what, int ret) -+{ -+ -+ /* -+ * If user doesn't specify stack size, check if VM has a preference. -+ * Note that HotSpot no longer supports JNI_VERSION_1_1 but it will -+ * return its default stack size through the init args structure. -+ */ -+ if (threadStackSize == 0) { -+ struct JDK1_1InitArgs args1_1; -+ memset((void*)&args1_1, 0, sizeof(args1_1)); -+ args1_1.version = JNI_VERSION_1_1; -+ ifn->GetDefaultJavaVMInitArgs(&args1_1); /* ignore return value */ -+ if (args1_1.javaStackSize > 0) { -+ threadStackSize = args1_1.javaStackSize; -+ } -+ } -+ -+ { /* Create create JVM and invoke main method */ -+ JavaMainArgs args; -+ int rslt; -+ -+ args.argc = argc; -+ args.argv = argv; -+ args.mode = mode; -+ args.what = what; -+ args.ifn = *ifn; -+ -+ rslt = JavaMain((void*)&args); -+ -+ return (ret != 0) ? ret : rslt; -+ } -+} -+#endif -+ - static void - DumpState() - { ---- ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2011-11-17 21:56:27.000000000 -0800 -+++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2011-04-22 23:08:19.000000000 -0700 -@@ -477,6 +477,10 @@ - String[] dirs = new String[] { - userHome + sep + ".themes", - System.getProperty("swing.metacitythemedir"), -+ "/usr/X11R6/share/themes", -+ "/usr/X11R6/share/gnome/themes", -+ "/usr/local/share/themes", -+ "/usr/local/share/gnome/themes", - "/usr/share/themes", - "/usr/gnome/share/themes", // Debian/Redhat/Solaris - "/opt/gnome2/share/themes" // SuSE ---- ./jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java 2011-11-17 21:56:38.000000000 -0800 -+++ ./jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java 2011-04-22 23:08:19.000000000 -0700 -@@ -78,6 +78,9 @@ - */ - public long timeStamp ; - -+ // TODO: IcedTea: I am a stub. -+ static public int trapAuthenticationFailure = 0; -+ - - - /** ---- ./jdk/src/share/classes/com/sun/media/sound/services/bsd-i586/javax.sound.sampled.spi.MixerProvider 2012-03-04 16:33:48.000000000 -0800 -+++ ./jdk/src/share/classes/com/sun/media/sound/services/bsd-i586/javax.sound.sampled.spi.MixerProvider 1969-12-31 16:00:00.000000000 -0800 -@@ -1,6 +0,0 @@ --# service provider file for Bsd: with DirectAudioDeviceProvider --# last mixer is default mixer --com.sun.media.sound.PortMixerProvider --com.sun.media.sound.SimpleInputDeviceProvider --com.sun.media.sound.DirectAudioDeviceProvider --com.sun.media.sound.HeadspaceMixerProvider ---- ./jdk/src/share/classes/com/sun/servicetag/BsdSystemEnvironment.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/share/classes/com/sun/servicetag/BsdSystemEnvironment.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,193 +0,0 @@ --/* -- * Copyright (c) 2008, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --package com.sun.servicetag; -- --// This class is a copy of the com.sun.scn.servicetags.BsdSystemEnvironment --// class from the Sun Connection source. --// --// The Service Tags team maintains the latest version of the implementation --// for system environment data collection. JDK will include a copy of --// the most recent released version for a JDK release. We rename --// the package to com.sun.servicetag so that the Sun Connection --// product always uses the latest version from the com.sun.scn.servicetags --// package. JDK and users of the com.sun.servicetag API --// (e.g. NetBeans and SunStudio) will use the version in JDK. --// --// So we keep this class in src/share/classes instead of src/<os>/classes. -- --import java.io.*; -- --/** -- * Bsd implementation of the SystemEnvironment class. -- */ --class BsdSystemEnvironment extends SystemEnvironment { -- BsdSystemEnvironment() { -- setHostId(getBsdHostId()); -- setSystemModel(getCommandOutput("/bin/uname", "-i")); -- setSystemManufacturer(getBsdSystemManufacturer()); -- setCpuManufacturer(getBsdCpuManufacturer()); -- setSerialNumber(getBsdSN()); -- } -- private String dmiInfo = null; -- -- private static final int SN = 1; -- private static final int SYS = 2; -- private static final int CPU = 3; -- -- private String getBsdHostId() { -- String output = getCommandOutput("/usr/bin/hostid"); -- // trim off the leading 0x -- if (output.startsWith("0x")) { -- output = output.substring(2); -- } -- return output; -- } -- -- /** -- * Tries to obtain and return the cpu manufacturer. -- * @return The cpu manufacturer (an empty string if not found or an error occurred) -- */ -- private String getBsdCpuManufacturer() { -- String tmp = getBsdPSNInfo(CPU); -- if (tmp.length() > 0) { -- return tmp; -- } -- -- String contents = getFileContent("/proc/cpuinfo"); -- for (String line : contents.split("\n")) { -- if (line.contains("vendor_id")) { -- String[] ss = line.split(":", 2); -- if (ss.length > 1) { -- return ss[1].trim(); -- } -- } -- } -- -- // returns an empty string if it can't be found or an error happened -- return getBsdDMIInfo("dmi type 4", "manufacturer"); -- } -- -- -- /** -- * Tries to obtain and return the system manufacturer. -- * @return The system manufacturer (an empty string if not found or an error occurred) -- */ -- private String getBsdSystemManufacturer() { -- String tmp = getBsdPSNInfo(SYS); -- if (tmp.length() > 0) { -- return tmp; -- } -- -- // returns an empty string if it can't be found or an error happened -- return getBsdDMIInfo("dmi type 1", "manufacturer"); -- } -- -- /** -- * Tries to obtain and return the serial number of the system. -- * @return The serial number (an empty string if not found or an error occurred) -- */ -- private String getBsdSN() { -- String tmp = getBsdPSNInfo(SN); -- if (tmp.length() > 0) { -- return tmp; -- } -- -- // returns an empty string if it can't be found or an error happened -- return getBsdDMIInfo("dmi type 1", "serial number"); -- } -- -- private String getBsdPSNInfo(int target) { -- // try to read from the psn file if it exists -- String contents = getFileContent("/var/run/psn"); -- String[] ss = contents.split("\n"); -- if (target <= ss.length) { -- return ss[target-1]; -- } -- -- // default case is to return "" -- return ""; -- } -- -- // reads from dmidecode with the given type and target -- // returns an empty string if nothing was found or an error occurred -- // -- // Sample output segment: -- // Handle 0x0001 -- // DMI type 1, 25 bytes. -- // System Information -- // Manufacturer: System manufacturer -- // Product Name: System Product Name -- // Version: System Version -- // Serial Number: System Serial Number -- // UUID: 3091D719-B25B-D911-959D-6D1B12C7686E -- // Wake-up Type: Power Switch -- -- private synchronized String getBsdDMIInfo(String dmiType, String target) { -- // only try to get dmidecode information once, after that, we can -- // reuse the output -- if (dmiInfo == null) { -- Thread dmidecodeThread = new Thread() { -- public void run() { -- dmiInfo = getCommandOutput("/usr/sbin/dmidecode"); -- } -- }; -- dmidecodeThread.start(); -- -- try { -- dmidecodeThread.join(2000); -- if (dmidecodeThread.isAlive()) { -- dmidecodeThread.interrupt(); -- dmiInfo = ""; -- } -- } catch (InterruptedException ie) { -- dmidecodeThread.interrupt(); -- } -- } -- -- if (dmiInfo.length() == 0) { -- return ""; -- } -- boolean dmiFlag = false; -- for (String s : dmiInfo.split("\n")) { -- String line = s.toLowerCase(); -- if (dmiFlag) { -- if (line.contains(target)) { -- String key = target + ":"; -- int indx = line.indexOf(key) + key.length(); -- if (line.contains(key) && indx < line.length()) { -- return line.substring(indx).trim(); -- } -- String[] ss = line.split(":"); -- return ss[ss.length-1]; -- } -- } else if (line.contains(dmiType)) { -- dmiFlag = true; -- } -- } -- return ""; -- } -- --} ---- ./jdk/src/share/classes/java/awt/GraphicsEnvironment.java 2011-11-17 21:57:19.000000000 -0800 -+++ ./jdk/src/share/classes/java/awt/GraphicsEnvironment.java 2011-04-22 23:08:22.000000000 -0700 -@@ -172,7 +172,12 @@ - } else { - String osName = System.getProperty("os.name"); - headless = defaultHeadless = -- Boolean.valueOf(("Linux".equals(osName) || "SunOS".equals(osName)) && -+ Boolean.valueOf(("Linux".equals(osName) || -+ "SunOS".equals(osName) || -+ "FreeBSD".equals(osName) || -+ "NetBSD".equals(osName) || -+ "OpenBSD".equals(osName) || -+ "Darwin".equals(osName)) && - (System.getenv("DISPLAY") == null)); - } - } else if (nm.equals("true")) { ---- ./jdk/src/share/classes/java/util/TimeZone.java 2011-11-17 21:58:07.000000000 -0800 -+++ ./jdk/src/share/classes/java/util/TimeZone.java 2011-04-22 23:08:24.000000000 -0700 -@@ -849,15 +849,13 @@ +--- jdk/make/tools/sharing/classlist.bsd 1969-12-31 16:00:00.000000000 -0800 ++++ jdk/make/tools/sharing/classlist.bsd 2011-04-22 23:08:17.000000000 -0700 +@@ -0,0 +1,2327 @@ ++java/lang/Object ++java/lang/String ++java/io/Serializable ++java/lang/Comparable ++java/lang/CharSequence ++java/lang/Class ++java/lang/reflect/GenericDeclaration ++java/lang/reflect/Type ++java/lang/reflect/AnnotatedElement ++java/lang/Cloneable ++java/lang/ClassLoader ++java/lang/System ++java/lang/Throwable ++java/lang/Error ++java/lang/ThreadDeath ++java/lang/Exception ++java/lang/RuntimeException ++java/security/ProtectionDomain ++java/security/AccessControlContext ++java/lang/ClassNotFoundException ++java/lang/NoClassDefFoundError ++java/lang/LinkageError ++java/lang/ClassCastException ++java/lang/ArrayStoreException ++java/lang/VirtualMachineError ++java/lang/OutOfMemoryError ++java/lang/StackOverflowError ++java/lang/IllegalMonitorStateException ++java/lang/ref/Reference ++java/lang/ref/SoftReference ++java/lang/ref/WeakReference ++java/lang/ref/FinalReference ++java/lang/ref/PhantomReference ++java/lang/ref/Finalizer ++java/lang/Thread ++java/lang/Runnable ++java/lang/ThreadGroup ++java/lang/Thread$UncaughtExceptionHandler ++java/util/Properties ++java/util/Hashtable ++java/util/Map ++java/util/Dictionary ++java/lang/reflect/AccessibleObject ++java/lang/reflect/Field ++java/lang/reflect/Member ++java/lang/reflect/Method ++java/lang/reflect/Constructor ++sun/reflect/MagicAccessorImpl ++sun/reflect/MethodAccessorImpl ++sun/reflect/MethodAccessor ++sun/reflect/ConstructorAccessorImpl ++sun/reflect/ConstructorAccessor ++sun/reflect/DelegatingClassLoader ++sun/reflect/ConstantPool ++sun/reflect/UnsafeStaticFieldAccessorImpl ++sun/reflect/UnsafeFieldAccessorImpl ++sun/reflect/FieldAccessorImpl ++sun/reflect/FieldAccessor ++java/util/Vector ++java/util/List ++java/util/Collection ++java/lang/Iterable ++java/util/RandomAccess ++java/util/AbstractList ++java/util/AbstractCollection ++java/lang/StringBuffer ++java/lang/AbstractStringBuilder ++java/lang/Appendable ++java/lang/StackTraceElement ++java/nio/Buffer ++java/lang/Boolean ++java/lang/Character ++java/lang/Float ++java/lang/Number ++java/lang/Double ++java/lang/Byte ++java/lang/Short ++java/lang/Integer ++java/lang/Long ++java/lang/NullPointerException ++java/lang/ArithmeticException ++java/io/ObjectStreamField ++java/lang/String$CaseInsensitiveComparator ++java/util/Comparator ++java/lang/RuntimePermission ++java/security/BasicPermission ++java/security/Permission ++java/security/Guard ++sun/misc/SoftCache ++java/util/AbstractMap ++java/lang/ref/ReferenceQueue ++java/lang/ref/ReferenceQueue$Null ++java/lang/ref/ReferenceQueue$Lock ++java/util/HashMap ++java/lang/annotation/Annotation ++java/util/HashMap$Entry ++java/util/Map$Entry ++java/security/AccessController ++java/lang/reflect/ReflectPermission ++sun/reflect/ReflectionFactory$GetReflectionFactoryAction ++java/security/PrivilegedAction ++java/util/Stack ++sun/reflect/ReflectionFactory ++java/lang/ref/Reference$Lock ++java/lang/ref/Reference$ReferenceHandler ++java/lang/ref/Finalizer$FinalizerThread ++java/util/Enumeration ++java/util/Iterator ++java/util/Hashtable$Entry ++java/nio/charset/Charset ++sun/nio/cs/StandardCharsets ++sun/nio/cs/FastCharsetProvider ++java/nio/charset/spi/CharsetProvider ++sun/nio/cs/StandardCharsets$Aliases ++sun/util/PreHashedMap ++sun/nio/cs/StandardCharsets$Classes ++sun/nio/cs/StandardCharsets$Cache ++java/lang/ThreadLocal ++java/util/concurrent/atomic/AtomicInteger ++sun/misc/Unsafe ++java/lang/NoSuchMethodError ++java/lang/IncompatibleClassChangeError ++sun/reflect/Reflection ++java/util/Collections ++java/util/Collections$EmptySet ++java/util/AbstractSet ++java/util/Set ++java/util/Collections$EmptyList ++java/util/Collections$EmptyMap ++java/util/Collections$ReverseComparator ++java/util/Collections$SynchronizedMap ++java/lang/Class$3 ++java/lang/reflect/Modifier ++java/lang/reflect/ReflectAccess ++sun/reflect/LangReflectAccess ++java/util/Arrays ++java/lang/Math ++sun/nio/cs/US_ASCII ++sun/nio/cs/HistoricallyNamedCharset ++sun/misc/VM ++java/lang/StringCoding ++java/lang/ThreadLocal$ThreadLocalMap ++java/lang/ThreadLocal$ThreadLocalMap$Entry ++java/lang/StringCoding$StringDecoder ++sun/nio/cs/US_ASCII$Decoder ++java/nio/charset/CharsetDecoder ++java/nio/charset/CodingErrorAction ++java/nio/ByteBuffer ++java/nio/HeapByteBuffer ++java/nio/Bits ++java/nio/ByteOrder ++java/nio/CharBuffer ++java/lang/Readable ++java/nio/HeapCharBuffer ++java/nio/charset/CoderResult ++java/nio/charset/CoderResult$1 ++java/nio/charset/CoderResult$Cache ++java/nio/charset/CoderResult$2 ++sun/misc/Version ++java/io/FileInputStream ++java/io/InputStream ++java/io/Closeable ++java/io/FileDescriptor ++java/io/FileOutputStream ++java/io/OutputStream ++java/io/Flushable ++java/io/BufferedInputStream ++java/io/FilterInputStream ++java/util/concurrent/atomic/AtomicReferenceFieldUpdater ++java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl ++sun/reflect/misc/ReflectUtil ++java/io/PrintStream ++java/io/FilterOutputStream ++java/io/BufferedOutputStream ++java/io/OutputStreamWriter ++java/io/Writer ++sun/nio/cs/StreamEncoder ++sun/security/action/GetPropertyAction ++sun/nio/cs/US_ASCII$Encoder ++java/nio/charset/CharsetEncoder ++sun/nio/cs/Surrogate$Parser ++sun/nio/cs/Surrogate ++java/io/BufferedWriter ++java/lang/Runtime ++java/io/File ++java/io/FileSystem ++java/io/UnixFileSystem ++java/io/ExpiringCache ++java/io/ExpiringCache$1 ++java/util/LinkedHashMap ++java/util/LinkedHashMap$Entry ++java/lang/StringBuilder ++sun/misc/SharedSecrets ++java/lang/ClassLoader$3 ++java/lang/StringCoding$StringEncoder ++java/io/ExpiringCache$Entry ++java/lang/ClassLoader$NativeLibrary ++java/lang/Terminator ++java/lang/Terminator$1 ++sun/misc/SignalHandler ++sun/misc/Signal ++sun/misc/NativeSignalHandler ++java/io/Console ++java/io/Console$1 ++sun/misc/JavaIOAccess ++java/lang/Shutdown ++java/util/ArrayList ++java/lang/Shutdown$Lock ++java/lang/ApplicationShutdownHooks ++java/util/IdentityHashMap ++sun/misc/OSEnvironment ++java/lang/System$2 ++sun/misc/JavaLangAccess ++java/lang/Compiler ++java/lang/Compiler$1 ++sun/misc/Launcher ++sun/misc/Launcher$Factory ++java/net/URLStreamHandlerFactory ++sun/misc/Launcher$ExtClassLoader ++java/net/URLClassLoader ++java/security/SecureClassLoader ++sun/security/util/Debug ++java/net/URLClassLoader$7 ++sun/misc/JavaNetAccess ++java/util/StringTokenizer ++sun/misc/Launcher$ExtClassLoader$1 ++java/security/PrivilegedExceptionAction ++sun/misc/MetaIndex ++java/io/BufferedReader ++java/io/Reader ++java/io/FileReader ++java/io/InputStreamReader ++sun/nio/cs/StreamDecoder ++java/lang/reflect/Array ++sun/net/www/ParseUtil ++java/util/BitSet ++java/io/ObjectStreamClass ++java/net/URL ++java/util/Locale ++java/util/concurrent/ConcurrentHashMap ++java/util/concurrent/ConcurrentMap ++java/util/concurrent/ConcurrentHashMap$Segment ++java/util/concurrent/locks/ReentrantLock ++java/util/concurrent/locks/Lock ++java/util/concurrent/locks/ReentrantLock$NonfairSync ++java/util/concurrent/locks/ReentrantLock$Sync ++java/util/concurrent/locks/AbstractQueuedSynchronizer ++java/util/concurrent/locks/AbstractOwnableSynchronizer ++java/util/concurrent/locks/AbstractQueuedSynchronizer$Node ++java/util/concurrent/ConcurrentHashMap$HashEntry ++java/lang/CharacterDataLatin1 ++java/net/Parts ++sun/net/www/protocol/file/Handler ++java/net/URLStreamHandler ++java/lang/Class$1 ++sun/reflect/ReflectionFactory$1 ++sun/reflect/NativeConstructorAccessorImpl ++sun/reflect/DelegatingConstructorAccessorImpl ++java/util/HashSet ++sun/misc/URLClassPath ++sun/net/www/protocol/jar/Handler ++sun/misc/Launcher$AppClassLoader ++sun/misc/Launcher$AppClassLoader$1 ++java/lang/SystemClassLoaderAction ++java/net/URLClassLoader$1 ++sun/misc/URLClassPath$3 ++sun/misc/URLClassPath$JarLoader ++sun/misc/URLClassPath$Loader ++java/security/PrivilegedActionException ++sun/misc/URLClassPath$FileLoader ++sun/misc/URLClassPath$FileLoader$1 ++sun/misc/Resource ++sun/nio/ByteBuffered ++java/security/CodeSource ++java/security/Permissions ++java/security/PermissionCollection ++sun/net/www/protocol/file/FileURLConnection ++sun/net/www/URLConnection ++java/net/URLConnection ++java/net/UnknownContentHandler ++java/net/ContentHandler ++sun/net/www/MessageHeader ++java/io/FilePermission ++java/io/FilePermission$1 ++sun/security/provider/PolicyFile ++java/security/Policy ++java/security/Policy$UnsupportedEmptyCollection ++java/io/FilePermissionCollection ++java/security/AllPermission ++java/security/UnresolvedPermission ++java/security/BasicPermissionCollection ++java/security/Principal ++java/security/cert/Certificate ++java/util/AbstractList$Itr ++java/util/IdentityHashMap$KeySet ++java/util/IdentityHashMap$KeyIterator ++java/util/IdentityHashMap$IdentityHashMapIterator ++java/io/DeleteOnExitHook ++java/util/LinkedHashSet ++java/util/HashMap$KeySet ++java/util/LinkedHashMap$KeyIterator ++java/util/LinkedHashMap$LinkedHashIterator ++java/awt/Frame ++java/awt/MenuContainer ++java/awt/Window ++javax/accessibility/Accessible ++java/awt/Container ++java/awt/Component ++java/awt/image/ImageObserver ++java/lang/InterruptedException ++java/awt/Label ++java/util/logging/Logger ++java/util/logging/Handler ++java/util/logging/Level ++java/util/logging/LogManager ++java/util/logging/LogManager$1 ++java/beans/PropertyChangeSupport ++java/util/logging/LogManager$LogNode ++java/util/logging/LoggingPermission ++java/util/logging/LogManager$Cleaner ++java/util/logging/LogManager$RootLogger ++java/util/logging/LogManager$2 ++java/util/Properties$LineReader ++java/util/Hashtable$Enumerator ++java/beans/PropertyChangeEvent ++java/util/EventObject ++java/awt/Component$AWTTreeLock ++sun/awt/NativeLibLoader ++sun/security/action/LoadLibraryAction ++java/awt/GraphicsEnvironment ++java/awt/GraphicsEnvironment$1 ++java/lang/ProcessEnvironment ++java/lang/ProcessEnvironment$Variable ++java/lang/ProcessEnvironment$ExternalData ++java/lang/ProcessEnvironment$Value ++java/lang/ProcessEnvironment$StringEnvironment ++java/util/Collections$UnmodifiableMap ++java/awt/Toolkit ++java/awt/Toolkit$3 ++sun/util/CoreResourceBundleControl ++java/util/ResourceBundle$Control ++java/util/Arrays$ArrayList ++java/util/Collections$UnmodifiableRandomAccessList ++java/util/Collections$UnmodifiableList ++java/util/Collections$UnmodifiableCollection ++java/util/ResourceBundle ++java/util/ResourceBundle$1 ++java/util/ResourceBundle$RBClassLoader ++java/util/ResourceBundle$RBClassLoader$1 ++java/util/ResourceBundle$CacheKey ++java/util/ResourceBundle$LoaderReference ++java/util/ResourceBundle$CacheKeyReference ++java/util/ResourceBundle$SingleFormatControl ++sun/awt/resources/awt ++java/util/ListResourceBundle ++java/awt/Toolkit$1 ++java/io/FileNotFoundException ++java/io/IOException ++java/awt/event/KeyEvent ++java/awt/event/InputEvent ++java/awt/event/ComponentEvent ++java/awt/AWTEvent ++java/awt/event/NativeLibLoader ++java/util/WeakHashMap ++java/util/WeakHashMap$Entry ++java/awt/Component$DummyRequestFocusController ++sun/awt/RequestFocusController ++java/awt/LayoutManager ++java/awt/LightweightDispatcher ++java/awt/event/AWTEventListener ++java/util/EventListener ++java/awt/Dimension ++java/awt/geom/Dimension2D ++java/util/concurrent/atomic/AtomicBoolean ++java/awt/ComponentOrientation ++java/awt/Component$2 ++java/lang/NoSuchMethodException ++sun/awt/AppContext ++sun/awt/AppContext$1 ++sun/awt/AppContext$2 ++sun/awt/MostRecentKeyValue ++java/awt/Cursor ++sun/awt/X11GraphicsEnvironment ++sun/java2d/SunGraphicsEnvironment ++sun/java2d/FontSupport ++sun/awt/DisplayChangedListener ++java/io/FilenameFilter ++sun/awt/X11GraphicsEnvironment$1 ++sun/awt/SunToolkit ++sun/awt/WindowClosingSupport ++sun/awt/WindowClosingListener ++sun/awt/ComponentFactory ++sun/awt/InputMethodSupport ++java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject ++java/util/concurrent/locks/Condition ++sun/awt/AWTAutoShutdown ++sun/awt/SunToolkit$6 ++java/awt/Dialog$ModalExclusionType ++java/lang/Enum ++java/awt/Dialog ++java/awt/Dialog$ModalityType ++java/awt/ModalEventFilter ++java/awt/EventFilter ++sun/reflect/UnsafeFieldAccessorFactory ++sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl ++sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl ++sun/awt/SunDisplayChanger ++sun/java2d/SunGraphicsEnvironment$1 ++java/io/StreamTokenizer ++sun/font/FontManager ++sun/font/FileFont ++sun/font/PhysicalFont ++sun/font/Font2D ++sun/font/CompositeFont ++java/util/HashMap$Values ++java/util/HashMap$ValueIterator ++java/util/HashMap$HashIterator ++java/awt/Font ++java/awt/geom/AffineTransform ++sun/font/AttributeValues ++sun/font/EAttribute ++java/text/AttributedCharacterIterator$Attribute ++java/lang/Class$4 ++sun/reflect/NativeMethodAccessorImpl ++sun/reflect/DelegatingMethodAccessorImpl ++java/awt/font/TextAttribute ++java/lang/Integer$IntegerCache ++sun/font/TrueTypeFont ++java/awt/font/FontRenderContext ++java/awt/RenderingHints ++sun/awt/SunHints ++sun/awt/SunHints$Key ++java/awt/RenderingHints$Key ++sun/awt/SunHints$Value ++sun/awt/SunHints$LCDContrastKey ++sun/font/Type1Font ++java/awt/geom/Point2D$Float ++java/awt/geom/Point2D ++sun/font/StrikeMetrics ++java/awt/geom/Rectangle2D$Float ++java/awt/geom/Rectangle2D ++java/awt/geom/RectangularShape ++java/awt/Shape ++java/awt/geom/GeneralPath ++java/awt/geom/Path2D$Float ++java/awt/geom/Path2D ++sun/font/CharToGlyphMapper ++sun/font/PhysicalStrike ++sun/font/FontStrike ++sun/font/GlyphList ++sun/font/StrikeCache ++sun/java2d/Disposer ++sun/java2d/Disposer$1 ++sun/font/StrikeCache$1 ++sun/awt/motif/MFontConfiguration ++sun/awt/FontConfiguration ++sun/awt/FontDescriptor ++java/util/Scanner ++java/util/regex/Pattern ++java/util/regex/Pattern$Node ++java/util/regex/Pattern$LastNode ++java/util/regex/Pattern$GroupHead ++java/util/regex/Pattern$CharPropertyNames ++java/util/regex/Pattern$CharPropertyNames$1 ++java/util/regex/Pattern$CharPropertyNames$CharPropertyFactory ++java/util/regex/Pattern$CharPropertyNames$2 ++java/util/regex/Pattern$CharPropertyNames$5 ++java/util/regex/Pattern$CharPropertyNames$3 ++java/util/regex/Pattern$CharPropertyNames$6 ++java/util/regex/Pattern$CharPropertyNames$CloneableProperty ++java/util/regex/Pattern$CharProperty ++java/util/regex/Pattern$CharPropertyNames$4 ++java/util/regex/Pattern$CharPropertyNames$7 ++java/util/regex/Pattern$CharPropertyNames$8 ++java/util/regex/Pattern$CharPropertyNames$9 ++java/util/regex/Pattern$CharPropertyNames$10 ++java/util/regex/Pattern$CharPropertyNames$11 ++java/util/regex/Pattern$CharPropertyNames$12 ++java/util/regex/Pattern$CharPropertyNames$13 ++java/util/regex/Pattern$CharPropertyNames$14 ++java/util/regex/Pattern$CharPropertyNames$15 ++java/util/regex/Pattern$CharPropertyNames$16 ++java/util/regex/Pattern$CharPropertyNames$17 ++java/util/regex/Pattern$CharPropertyNames$18 ++java/util/regex/Pattern$CharPropertyNames$19 ++java/util/regex/Pattern$CharPropertyNames$20 ++java/util/regex/Pattern$CharPropertyNames$21 ++java/util/regex/Pattern$Curly ++java/util/regex/Pattern$Slice ++java/util/regex/Pattern$Begin ++java/util/regex/Pattern$First ++java/util/regex/Pattern$Start ++java/util/regex/Pattern$TreeInfo ++java/util/regex/Pattern$All ++java/util/regex/Pattern$BitClass ++java/util/regex/Pattern$BmpCharProperty ++java/util/regex/Pattern$6 ++java/util/regex/Pattern$CharProperty$1 ++sun/nio/ch/FileChannelImpl ++java/nio/channels/FileChannel ++java/nio/channels/ByteChannel ++java/nio/channels/ReadableByteChannel ++java/nio/channels/Channel ++java/nio/channels/WritableByteChannel ++java/nio/channels/GatheringByteChannel ++java/nio/channels/ScatteringByteChannel ++java/nio/channels/spi/AbstractInterruptibleChannel ++java/nio/channels/InterruptibleChannel ++sun/nio/ch/Util ++sun/nio/ch/IOUtil ++sun/nio/ch/FileDispatcher ++sun/nio/ch/NativeDispatcher ++sun/nio/ch/Reflect ++java/nio/MappedByteBuffer ++sun/nio/ch/Reflect$1 ++sun/nio/ch/NativeThreadSet ++java/nio/channels/Channels ++java/util/Scanner$1 ++sun/misc/LRUCache ++java/util/regex/Matcher ++java/util/regex/MatchResult ++java/text/NumberFormat ++java/text/Format ++java/text/spi/NumberFormatProvider ++java/util/spi/LocaleServiceProvider ++sun/util/LocaleServiceProviderPool ++sun/util/LocaleServiceProviderPool$1 ++java/util/ServiceLoader ++java/util/ServiceLoader$LazyIterator ++java/util/ServiceLoader$1 ++java/util/HashMap$EntrySet ++java/util/LinkedHashMap$EntryIterator ++sun/misc/Launcher$1 ++sun/misc/URLClassPath$2 ++java/lang/ClassLoader$2 ++sun/misc/URLClassPath$1 ++java/net/URLClassLoader$3 ++sun/misc/CompoundEnumeration ++sun/misc/URLClassPath$JarLoader$1 ++sun/misc/FileURLMapper ++java/net/URLClassLoader$3$1 ++sun/util/resources/LocaleData ++sun/util/resources/LocaleData$1 ++sun/util/resources/LocaleData$LocaleDataResourceBundleControl ++sun/util/LocaleDataMetaInfo ++sun/text/resources/FormatData ++java/util/ResourceBundle$BundleReference ++sun/text/resources/FormatData_en ++sun/text/resources/FormatData_en_US ++java/text/DecimalFormatSymbols ++java/text/spi/DecimalFormatSymbolsProvider ++java/util/Currency ++java/util/Currency$1 ++java/util/spi/CurrencyNameProvider ++sun/util/resources/CurrencyNames ++sun/util/resources/LocaleNamesBundle ++sun/util/resources/OpenListResourceBundle ++sun/util/resources/CurrencyNames_en_US ++java/text/DecimalFormat ++java/text/FieldPosition ++java/text/DigitList ++java/math/RoundingMode ++java/util/regex/Pattern$GroupTail ++java/util/regex/Pattern$Ctype ++java/util/regex/Pattern$Ques ++java/util/regex/Pattern$GroupCurly ++java/util/regex/Pattern$5 ++java/util/regex/Pattern$Loop ++java/util/regex/Pattern$Prolog ++java/util/regex/Pattern$BranchConn ++java/util/regex/Pattern$Branch ++java/nio/channels/spi/AbstractInterruptibleChannel$1 ++sun/nio/ch/Interruptible ++sun/nio/ch/NativeThread ++sun/nio/ch/DirectBuffer ++java/nio/DirectByteBuffer ++java/nio/DirectByteBuffer$Deallocator ++sun/misc/Cleaner ++sun/nio/ch/IOStatus ++java/util/regex/ASCII ++java/io/DataInputStream ++java/io/DataInput ++java/lang/Short$ShortCache ++java/util/HashMap$KeyIterator ++sun/font/CompositeFontDescriptor ++sun/font/Font2DHandle ++sun/font/FontFamily ++java/awt/GraphicsDevice ++sun/awt/X11GraphicsDevice ++sun/awt/X11GraphicsConfig ++java/awt/GraphicsConfiguration ++java/awt/ImageCapabilities ++sun/java2d/x11/X11SurfaceData ++sun/java2d/SurfaceData ++java/awt/Transparency ++sun/java2d/DisposerTarget ++sun/java2d/InvalidPipeException ++java/lang/IllegalStateException ++sun/java2d/NullSurfaceData ++sun/java2d/loops/SurfaceType ++sun/awt/image/PixelConverter ++sun/awt/image/PixelConverter$Xrgb ++sun/awt/image/PixelConverter$Argb ++sun/awt/image/PixelConverter$ArgbPre ++sun/awt/image/PixelConverter$Xbgr ++sun/awt/image/PixelConverter$Rgba ++sun/awt/image/PixelConverter$RgbaPre ++sun/awt/image/PixelConverter$Ushort565Rgb ++sun/awt/image/PixelConverter$Ushort555Rgb ++sun/awt/image/PixelConverter$Ushort555Rgbx ++sun/awt/image/PixelConverter$Ushort4444Argb ++sun/awt/image/PixelConverter$ByteGray ++sun/awt/image/PixelConverter$UshortGray ++sun/awt/image/PixelConverter$Rgbx ++sun/awt/image/PixelConverter$Bgrx ++sun/awt/image/PixelConverter$ArgbBm ++java/awt/image/ColorModel ++java/awt/image/DirectColorModel ++java/awt/image/PackedColorModel ++java/awt/color/ColorSpace ++java/awt/color/ICC_Profile ++java/awt/color/ICC_ProfileRGB ++java/awt/color/ICC_Profile$1 ++java/awt/color/ICC_ColorSpace ++sun/java2d/pipe/NullPipe ++sun/java2d/pipe/PixelDrawPipe ++sun/java2d/pipe/PixelFillPipe ++sun/java2d/pipe/ShapeDrawPipe ++sun/java2d/pipe/TextPipe ++sun/java2d/pipe/DrawImagePipe ++java/awt/image/IndexColorModel ++sun/java2d/pipe/LoopPipe ++sun/java2d/pipe/OutlineTextRenderer ++sun/java2d/pipe/SolidTextRenderer ++sun/java2d/pipe/GlyphListLoopPipe ++sun/java2d/pipe/GlyphListPipe ++sun/java2d/pipe/AATextRenderer ++sun/java2d/pipe/LCDTextRenderer ++sun/java2d/pipe/AlphaColorPipe ++sun/java2d/pipe/CompositePipe ++sun/java2d/pipe/PixelToShapeConverter ++sun/java2d/pipe/TextRenderer ++sun/java2d/pipe/SpanClipRenderer ++sun/java2d/pipe/Region ++sun/java2d/pipe/RegionIterator ++sun/java2d/pipe/AlphaPaintPipe ++sun/java2d/pipe/SpanShapeRenderer$Composite ++sun/java2d/pipe/SpanShapeRenderer ++sun/java2d/pipe/GeneralCompositePipe ++sun/java2d/pipe/DrawImage ++sun/java2d/loops/RenderCache ++sun/java2d/loops/RenderCache$Entry ++sun/java2d/loops/XORComposite ++java/awt/Composite ++sun/font/X11TextRenderer ++sun/java2d/loops/GraphicsPrimitive ++sun/java2d/x11/X11PMBlitLoops ++sun/java2d/loops/Blit ++sun/java2d/loops/GraphicsPrimitiveMgr ++sun/java2d/loops/CompositeType ++sun/java2d/SunGraphics2D ++sun/awt/ConstrainableGraphics ++java/awt/Graphics2D ++java/awt/Graphics ++java/awt/Color ++java/awt/Paint ++java/awt/AlphaComposite ++sun/java2d/loops/BlitBg ++sun/java2d/loops/ScaledBlit ++sun/java2d/loops/FillRect ++sun/java2d/loops/FillSpans ++sun/java2d/loops/DrawLine ++sun/java2d/loops/DrawRect ++sun/java2d/loops/DrawPolygons ++sun/java2d/loops/DrawPath ++sun/java2d/loops/FillPath ++sun/java2d/loops/MaskBlit ++sun/java2d/loops/MaskFill ++sun/java2d/loops/DrawGlyphList ++sun/java2d/loops/DrawGlyphListAA ++sun/java2d/loops/DrawGlyphListLCD ++sun/java2d/loops/TransformHelper ++java/awt/BasicStroke ++java/awt/Stroke ++sun/misc/PerformanceLogger ++sun/misc/PerformanceLogger$TimeData ++sun/java2d/pipe/ValidatePipe ++sun/java2d/loops/CustomComponent ++sun/java2d/loops/GraphicsPrimitiveProxy ++sun/java2d/loops/GeneralRenderer ++sun/java2d/loops/GraphicsPrimitiveMgr$1 ++sun/java2d/loops/GraphicsPrimitiveMgr$2 ++sun/java2d/x11/X11PMBlitLoops$DelegateBlitLoop ++sun/java2d/x11/X11PMBlitBgLoops ++sun/java2d/x11/X11SurfaceData$LazyPipe ++sun/awt/X11GraphicsConfig$X11GCDisposerRecord ++sun/java2d/DisposerRecord ++java/awt/BorderLayout ++java/awt/LayoutManager2 ++java/awt/Rectangle ++java/awt/Toolkit$2 ++sun/awt/X11/XToolkit ++sun/awt/X11/XConstants ++sun/awt/UNIXToolkit ++java/util/TreeMap ++java/util/NavigableMap ++java/util/SortedMap ++sun/awt/X11/XlibWrapper ++sun/awt/X11/XUtilConstants ++sun/awt/X11/XProtocolConstants ++sun/awt/X11/XCursorFontConstants ++sun/awt/X11/XlibWrapper$1 ++sun/awt/X11/XToolkit$4 ++sun/awt/X11/XModifierKeymap ++sun/awt/X11/XWrapperBase ++sun/awt/X11/Native ++sun/awt/X11/Native$1 ++java/awt/EventQueue ++java/util/EmptyStackException ++java/lang/reflect/InvocationTargetException ++java/awt/EventDispatchThread ++java/awt/event/PaintEvent ++java/awt/event/MouseEvent ++sun/awt/PeerEvent ++java/awt/event/InvocationEvent ++java/awt/ActiveEvent ++sun/awt/X11/XToolkit$1 ++sun/awt/X11/XEventDispatcher ++sun/awt/SunToolkit$ModalityListenerList ++sun/awt/ModalityListener ++sun/awt/SunToolkit$1 ++java/util/MissingResourceException ++java/awt/Queue ++sun/awt/PostEventQueue ++java/util/LinkedList ++java/util/Deque ++java/util/Queue ++java/util/AbstractSequentialList ++sun/awt/X11/AwtScreenData ++sun/awt/X11/XWM ++sun/awt/X11/MWMConstants ++sun/awt/X11/XAtom ++java/awt/Insets ++sun/awt/X11/XWM$1 ++sun/awt/X11/XSetWindowAttributes ++sun/awt/X11/XErrorEvent ++sun/awt/X11/XNETProtocol ++sun/awt/X11/XStateProtocol ++sun/awt/X11/XLayerProtocol ++sun/awt/X11/XProtocol ++sun/awt/X11/WindowPropertyGetter ++sun/awt/X11/UnsafeXDisposerRecord ++sun/awt/X11/XPropertyCache ++sun/awt/X11/XWINProtocol ++sun/awt/X11/XAtomList ++sun/awt/X11/XToolkit$3 ++sun/awt/X11/XAnyEvent ++java/awt/Window$WindowDisposerRecord ++java/awt/KeyboardFocusManager ++java/awt/KeyEventDispatcher ++java/awt/KeyEventPostProcessor ++java/awt/AWTKeyStroke ++java/awt/AWTKeyStroke$1 ++java/awt/DefaultKeyboardFocusManager ++java/awt/DefaultFocusTraversalPolicy ++java/awt/ContainerOrderFocusTraversalPolicy ++java/awt/FocusTraversalPolicy ++java/util/Collections$UnmodifiableSet ++sun/awt/HeadlessToolkit ++sun/awt/X11/XKeyboardFocusManagerPeer ++java/awt/peer/KeyboardFocusManagerPeer ++sun/awt/X11/XKeyboardFocusManagerPeer$1 ++sun/awt/X11/XFramePeer ++java/awt/peer/FramePeer ++java/awt/peer/WindowPeer ++java/awt/peer/ContainerPeer ++java/awt/peer/ComponentPeer ++sun/awt/X11/XDecoratedPeer ++sun/awt/X11/XWindowPeer ++sun/awt/X11/XPanelPeer ++java/awt/peer/PanelPeer ++sun/awt/X11/XCanvasPeer ++java/awt/peer/CanvasPeer ++sun/awt/X11/XComponentPeer ++java/awt/dnd/peer/DropTargetPeer ++sun/awt/X11/XWindow ++sun/awt/X11ComponentPeer ++sun/awt/X11/XBaseWindow ++sun/awt/X11/XCreateWindowParams ++java/lang/Long$LongCache ++sun/awt/X11/XBaseWindow$InitialiseState ++sun/awt/X11/XBaseWindow$StateLock ++sun/awt/X11/AwtGraphicsConfigData ++sun/awt/X11/XVisualInfo ++java/awt/SystemColor ++sun/awt/X11/MotifColorUtilities ++java/lang/StrictMath ++sun/awt/X11/XRepaintArea ++sun/awt/RepaintArea ++sun/awt/X11/XWindowAttributesData ++java/util/concurrent/locks/LockSupport ++sun/awt/X11/WindowDimensions ++java/awt/Point ++java/util/TreeMap$Entry ++sun/nio/cs/UTF_8 ++sun/nio/cs/Unicode ++sun/nio/cs/UTF_8$Encoder ++sun/nio/cs/UTF_8$Decoder ++sun/nio/cs/Surrogate$Generator ++sun/awt/X11/XPropertyEvent ++sun/awt/X11/XDropTargetEventProcessor ++sun/awt/X11/XDragSourceContextPeer ++sun/awt/X11/XDragSourceProtocolListener ++sun/awt/dnd/SunDragSourceContextPeer ++java/awt/dnd/peer/DragSourceContextPeer ++sun/awt/X11/XAwtState ++sun/awt/X11/XBaseWindow$1 ++sun/awt/X11/XRootWindow ++sun/nio/cs/ISO_8859_1 ++sun/nio/cs/ISO_8859_1$Encoder ++sun/nio/cs/ISO_8859_1$Decoder ++sun/java2d/x11/X11SurfaceData$X11WindowSurfaceData ++sun/java2d/loops/RenderLoops ++sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec ++sun/java2d/DefaultDisposerRecord ++sun/java2d/x11/X11Renderer ++sun/awt/X11/XGlobalCursorManager ++sun/awt/GlobalCursorManager ++java/awt/Cursor$CursorDisposer ++java/awt/AWTException ++java/awt/HeadlessException ++java/lang/UnsupportedOperationException ++sun/reflect/UnsafeLongFieldAccessorImpl ++sun/reflect/UnsafeIntegerFieldAccessorImpl ++sun/awt/X11/XClientMessageEvent ++sun/awt/X11/XIconInfo ++sun/awt/X11/XAWTIcon32_java_icon16_png ++sun/awt/X11/XAWTIcon32_java_icon24_png ++sun/awt/X11/XAWTIcon32_java_icon32_png ++sun/awt/X11/XAWTIcon32_java_icon48_png ++sun/awt/X11/XSizeHints ++sun/awt/X11/XContentWindow ++sun/awt/X11/XFocusProxyWindow ++sun/awt/X11/XWMHints ++java/util/LinkedList$ListItr ++java/util/ListIterator ++sun/awt/SunToolkit$2 ++java/awt/image/BufferStrategy ++java/awt/dnd/DropTarget ++java/awt/dnd/DropTargetListener ++java/awt/event/ComponentListener ++java/awt/event/FocusListener ++java/awt/event/HierarchyListener ++java/awt/event/HierarchyBoundsListener ++java/awt/event/KeyListener ++java/awt/event/MouseListener ++java/awt/event/MouseMotionListener ++java/awt/event/MouseWheelListener ++java/awt/event/InputMethodListener ++java/awt/event/ContainerListener ++javax/accessibility/AccessibleContext ++sun/reflect/UnsafeObjectFieldAccessorImpl ++java/awt/peer/LightweightPeer ++sun/awt/X11/XLabelPeer ++java/awt/peer/LabelPeer ++sun/awt/X11/XMapEvent ++sun/awt/X11/XQueryTree ++sun/awt/X11/XConfigureEvent ++sun/awt/X11/PropMwmHints ++sun/awt/GlobalCursorManager$NativeUpdater ++javax/swing/JFrame ++javax/swing/WindowConstants ++javax/swing/RootPaneContainer ++javax/swing/TransferHandler$HasGetTransferHandler ++javax/swing/JLabel ++javax/swing/SwingConstants ++javax/swing/JComponent ++javax/swing/JComponent$1 ++javax/swing/SwingUtilities ++javax/swing/JRootPane ++sun/security/action/GetBooleanAction ++javax/swing/event/EventListenerList ++javax/swing/JPanel ++java/awt/FlowLayout ++javax/swing/UIManager ++javax/swing/UIManager$LookAndFeelInfo ++sun/swing/SwingUtilities2 ++sun/swing/SwingUtilities2$LSBCacheEntry ++javax/swing/UIManager$LAFState ++javax/swing/UIDefaults ++javax/swing/MultiUIDefaults ++javax/swing/UIManager$1 ++javax/swing/plaf/metal/MetalLookAndFeel ++javax/swing/plaf/basic/BasicLookAndFeel ++javax/swing/LookAndFeel ++sun/swing/DefaultLookup ++javax/swing/plaf/metal/OceanTheme ++javax/swing/plaf/metal/DefaultMetalTheme ++javax/swing/plaf/metal/MetalTheme ++javax/swing/plaf/ColorUIResource ++javax/swing/plaf/UIResource ++sun/swing/PrintColorUIResource ++javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate ++javax/swing/plaf/FontUIResource ++sun/swing/SwingLazyValue ++javax/swing/UIDefaults$LazyValue ++javax/swing/UIDefaults$ActiveValue ++javax/swing/plaf/InsetsUIResource ++sun/swing/SwingUtilities2$2 ++javax/swing/plaf/basic/BasicLookAndFeel$2 ++javax/swing/plaf/DimensionUIResource ++javax/swing/UIDefaults$LazyInputMap ++java/lang/Character$CharacterCache ++javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue ++javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue ++java/awt/print/PrinterJob ++sun/swing/SwingUtilities2$AATextInfo ++sun/awt/X11/XAWTXSettings ++sun/awt/X11/XMSelectionListener ++sun/awt/XSettings ++sun/awt/X11/XMSelection ++sun/awt/X11/XMSelection$1 ++javax/swing/plaf/metal/MetalLookAndFeel$AATextListener ++java/beans/PropertyChangeListener ++java/beans/PropertyChangeListenerProxy ++java/util/EventListenerProxy ++sun/awt/EventListenerAggregate ++javax/swing/UIDefaults$ProxyLazyValue ++javax/swing/plaf/metal/OceanTheme$1 ++javax/swing/plaf/metal/OceanTheme$2 ++javax/swing/plaf/metal/OceanTheme$3 ++javax/swing/plaf/metal/OceanTheme$4 ++javax/swing/plaf/metal/OceanTheme$5 ++javax/swing/plaf/metal/OceanTheme$6 ++javax/swing/RepaintManager ++javax/swing/RepaintManager$DisplayChangedHandler ++javax/swing/SwingPaintEventDispatcher ++sun/awt/PaintEventDispatcher ++javax/swing/UIManager$2 ++java/awt/PopupMenu ++java/awt/Menu ++java/awt/MenuItem ++java/awt/MenuComponent ++java/io/ObjectOutputStream ++java/io/ObjectOutput ++java/io/DataOutput ++java/io/ObjectStreamConstants ++java/io/PrintWriter ++java/io/ObjectInputStream ++java/io/ObjectInput ++java/awt/Event ++java/awt/im/InputContext ++java/awt/event/MouseWheelEvent ++java/awt/BufferCapabilities ++sun/awt/CausedFocusEvent$Cause ++java/awt/PointerInfo ++java/awt/Component$BaselineResizeBehavior ++java/awt/FontMetrics ++java/awt/Image ++java/awt/image/ImageProducer ++java/awt/image/VolatileImage ++java/awt/im/InputMethodRequests ++java/awt/event/FocusEvent ++java/awt/event/InputMethodEvent ++java/awt/event/HierarchyEvent ++javax/accessibility/AccessibleStateSet ++com/sun/swing/internal/plaf/metal/resources/metal ++sun/util/ResourceBundleEnumeration ++com/sun/swing/internal/plaf/basic/resources/basic ++javax/swing/plaf/basic/BasicPanelUI ++javax/swing/plaf/PanelUI ++javax/swing/plaf/ComponentUI ++sun/reflect/misc/MethodUtil ++sun/reflect/misc/MethodUtil$1 ++java/util/jar/JarFile ++java/util/zip/ZipFile ++java/util/zip/ZipConstants ++java/util/jar/JavaUtilJarAccessImpl ++sun/misc/JavaUtilJarAccess ++sun/misc/JarIndex ++java/util/zip/ZipEntry ++java/util/jar/JarFile$JarFileEntry ++java/util/jar/JarEntry ++sun/misc/URLClassPath$JarLoader$2 ++sun/net/www/protocol/jar/JarURLConnection ++java/net/JarURLConnection ++sun/net/www/protocol/jar/JarFileFactory ++sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController ++java/net/HttpURLConnection ++sun/net/www/protocol/jar/URLJarFile ++sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry ++sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream ++java/util/zip/ZipFile$ZipFileInputStream ++java/security/AllPermissionCollection ++java/lang/IllegalAccessException ++javax/swing/JPasswordField ++javax/swing/JTextField ++javax/swing/text/JTextComponent ++javax/swing/Scrollable ++javax/swing/JLayeredPane ++javax/swing/JRootPane$1 ++javax/swing/ArrayTable ++javax/swing/JInternalFrame ++javax/swing/JRootPane$RootLayout ++javax/swing/BufferStrategyPaintManager ++javax/swing/RepaintManager$PaintManager ++javax/swing/plaf/metal/MetalRootPaneUI ++javax/swing/plaf/basic/BasicRootPaneUI ++javax/swing/plaf/RootPaneUI ++javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap ++javax/swing/plaf/ComponentInputMapUIResource ++javax/swing/ComponentInputMap ++javax/swing/InputMap ++javax/swing/plaf/InputMapUIResource ++javax/swing/KeyStroke ++java/awt/VKCollection ++sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl ++javax/swing/plaf/basic/LazyActionMap ++javax/swing/plaf/ActionMapUIResource ++javax/swing/ActionMap ++javax/swing/LayoutFocusTraversalPolicy ++javax/swing/SortingFocusTraversalPolicy ++javax/swing/InternalFrameFocusTraversalPolicy ++javax/swing/SwingContainerOrderFocusTraversalPolicy ++javax/swing/SwingDefaultFocusTraversalPolicy ++javax/swing/LayoutComparator ++javax/swing/plaf/metal/MetalLabelUI ++javax/swing/plaf/basic/BasicLabelUI ++javax/swing/plaf/LabelUI ++javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 ++javax/swing/plaf/basic/BasicHTML ++sun/awt/NullComponentPeer ++java/awt/event/WindowEvent ++java/awt/EventQueue$1 ++java/awt/EventDispatchThread$1 ++java/awt/Conditional ++java/awt/EventDispatchThread$HierarchyEventFilter ++java/awt/EventFilter$FilterAction ++sun/awt/dnd/SunDropTargetEvent ++java/awt/event/ActionEvent ++java/util/jar/Manifest ++java/io/ByteArrayInputStream ++java/util/jar/Attributes ++java/util/jar/Manifest$FastInputStream ++java/util/jar/Attributes$Name ++sun/misc/ASCIICaseInsensitiveComparator ++java/util/jar/JarVerifier ++java/io/ByteArrayOutputStream ++sun/misc/ExtensionDependency ++java/lang/Package ++sun/security/util/ManifestEntryVerifier ++java/security/Provider ++java/security/Provider$ServiceKey ++java/security/Provider$EngineDescription ++java/security/Security ++java/security/Security$1 ++sun/misc/FloatingDecimal ++sun/misc/FloatingDecimal$1 ++sun/security/provider/NativePRNG ++java/security/SecureRandomSpi ++sun/security/provider/NativePRNG$1 ++sun/security/provider/NativePRNG$RandomIO ++sun/misc/BASE64Decoder ++sun/misc/CharacterDecoder ++sun/security/util/SignatureFileVerifier ++java/awt/event/KeyAdapter ++java/lang/NumberFormatException ++java/lang/IllegalArgumentException ++java/io/FileWriter ++java/net/Authenticator ++java/net/MalformedURLException ++javax/swing/text/Element ++javax/swing/text/Document ++javax/swing/text/PlainDocument ++javax/swing/text/AbstractDocument ++javax/swing/text/GapContent ++javax/swing/text/AbstractDocument$Content ++javax/swing/text/GapVector ++javax/swing/text/GapContent$MarkVector ++javax/swing/text/GapContent$MarkData ++javax/swing/text/StyleContext ++javax/swing/text/AbstractDocument$AttributeContext ++javax/swing/text/StyleConstants ++javax/swing/text/StyleConstants$CharacterConstants ++javax/swing/text/AttributeSet$CharacterAttribute ++javax/swing/text/StyleConstants$FontConstants ++javax/swing/text/AttributeSet$FontAttribute ++javax/swing/text/StyleConstants$ColorConstants ++javax/swing/text/AttributeSet$ColorAttribute ++javax/swing/text/StyleConstants$ParagraphConstants ++javax/swing/text/AttributeSet$ParagraphAttribute ++javax/swing/text/StyleContext$FontKey ++javax/swing/text/SimpleAttributeSet ++javax/swing/text/MutableAttributeSet ++javax/swing/text/AttributeSet ++javax/swing/text/SimpleAttributeSet$EmptyAttributeSet ++javax/swing/text/StyleContext$NamedStyle ++javax/swing/text/Style ++javax/swing/text/StyleContext$SmallAttributeSet ++javax/swing/text/AbstractDocument$BidiRootElement ++javax/swing/text/AbstractDocument$BranchElement ++javax/swing/text/AbstractDocument$AbstractElement ++javax/swing/tree/TreeNode ++javax/swing/text/AbstractDocument$1 ++javax/swing/text/AbstractDocument$BidiElement ++javax/swing/text/AbstractDocument$LeafElement ++javax/swing/text/GapContent$StickyPosition ++javax/swing/text/Position ++javax/swing/text/StyleContext$KeyEnumeration ++javax/swing/text/GapContent$InsertUndo ++javax/swing/undo/AbstractUndoableEdit ++javax/swing/undo/UndoableEdit ++javax/swing/text/AbstractDocument$DefaultDocumentEvent ++javax/swing/event/DocumentEvent ++javax/swing/undo/CompoundEdit ++javax/swing/event/DocumentEvent$EventType ++javax/swing/text/Segment ++java/text/CharacterIterator ++javax/swing/text/Utilities ++javax/swing/text/SegmentCache ++javax/swing/text/SegmentCache$CachedSegment ++javax/swing/event/UndoableEditEvent ++javax/swing/text/AbstractDocument$ElementEdit ++javax/swing/event/DocumentEvent$ElementChange ++java/net/Socket ++java/net/InetAddress ++java/net/InetAddress$Cache ++java/net/InetAddress$Cache$Type ++java/net/InetAddressImplFactory ++java/net/Inet4AddressImpl ++java/net/InetAddressImpl ++java/net/InetAddress$1 ++sun/net/spi/nameservice/NameService ++sun/net/util/IPAddressUtil ++java/util/RandomAccessSubList ++java/util/SubList ++java/util/SubList$1 ++java/util/AbstractList$ListItr ++java/net/Inet4Address ++java/net/InetSocketAddress ++java/net/SocketAddress ++java/net/SocksSocketImpl ++java/net/SocksConsts ++java/net/PlainSocketImpl ++java/net/SocketImpl ++java/net/SocketOptions ++java/net/SocketException ++java/net/SocksSocketImpl$5 ++java/net/ProxySelector ++sun/net/spi/DefaultProxySelector ++sun/net/spi/DefaultProxySelector$1 ++sun/net/NetProperties ++sun/net/NetProperties$1 ++sun/net/spi/DefaultProxySelector$NonProxyInfo ++java/net/Inet6Address ++java/net/URI ++java/net/URI$Parser ++java/net/Proxy ++java/net/Proxy$Type ++java/net/ConnectException ++javax/swing/JMenu ++javax/swing/MenuElement ++javax/swing/JMenuItem ++javax/swing/AbstractButton ++java/awt/ItemSelectable ++javax/swing/event/MenuListener ++javax/swing/JCheckBoxMenuItem ++javax/swing/Icon ++javax/swing/JButton ++java/awt/event/WindowListener ++java/net/URLClassLoader$2 ++javax/swing/ImageIcon ++javax/swing/ImageIcon$1 ++java/awt/MediaTracker ++sun/misc/SoftCache$ValueCell ++sun/awt/image/URLImageSource ++sun/awt/image/InputStreamImageSource ++sun/awt/image/ImageFetchable ++sun/awt/image/ToolkitImage ++java/awt/Image$1 ++sun/awt/image/SurfaceManager$ImageAccessor ++sun/awt/image/SurfaceManager ++sun/awt/image/NativeLibLoader ++java/awt/ImageMediaEntry ++java/awt/MediaEntry ++sun/awt/image/ImageRepresentation ++java/awt/image/ImageConsumer ++sun/awt/image/ImageWatched ++sun/awt/image/ImageWatched$Link ++sun/awt/image/ImageWatched$WeakLink ++sun/awt/image/ImageConsumerQueue ++sun/awt/image/ImageFetcher ++sun/awt/image/FetcherInfo ++sun/awt/image/ImageFetcher$1 ++sun/awt/image/GifImageDecoder ++sun/awt/image/ImageDecoder ++sun/awt/image/GifFrame ++java/awt/image/Raster ++java/awt/image/DataBufferByte ++java/awt/image/DataBuffer ++java/awt/image/PixelInterleavedSampleModel ++java/awt/image/ComponentSampleModel ++java/awt/image/SampleModel ++sun/awt/image/ByteInterleavedRaster ++sun/awt/image/ByteComponentRaster ++sun/awt/image/SunWritableRaster ++java/awt/image/WritableRaster ++java/awt/image/BufferedImage ++java/awt/image/WritableRenderedImage ++java/awt/image/RenderedImage ++sun/awt/image/IntegerComponentRaster ++sun/awt/image/BytePackedRaster ++java/awt/Canvas ++sun/font/FontDesignMetrics ++sun/font/FontStrikeDesc ++sun/font/CompositeStrike ++sun/font/FontStrikeDisposer ++sun/font/StrikeCache$SoftDisposerRef ++sun/font/StrikeCache$DisposableStrike ++sun/font/TrueTypeFont$TTDisposerRecord ++sun/font/TrueTypeFont$1 ++java/io/RandomAccessFile ++java/nio/ByteBufferAsIntBufferB ++java/nio/IntBuffer ++sun/font/TrueTypeFont$DirectoryEntry ++java/nio/ByteBufferAsShortBufferB ++java/nio/ShortBuffer ++sun/nio/cs/UTF_16 ++sun/nio/cs/UTF_16$Decoder ++sun/nio/cs/UnicodeDecoder ++sun/font/FileFontStrike ++sun/font/TrueTypeGlyphMapper ++sun/font/CMap ++sun/font/CMap$NullCMapClass ++sun/font/CMap$CMapFormat4 ++java/nio/ByteBufferAsCharBufferB ++sun/font/FontDesignMetrics$KeyReference ++sun/awt/image/PNGImageDecoder ++sun/awt/image/PNGFilterInputStream ++java/util/zip/InflaterInputStream ++java/util/zip/Inflater ++sun/awt/EventQueueItem ++sun/awt/SunToolkit$3 ++sun/awt/X11/XExposeEvent ++sun/reflect/UnsafeBooleanFieldAccessorImpl ++sun/awt/event/IgnorePaintEvent ++java/awt/image/DataBufferInt ++java/awt/image/SinglePixelPackedSampleModel ++sun/awt/image/IntegerInterleavedRaster ++sun/awt/image/OffScreenImage ++sun/awt/image/BufImgSurfaceData ++sun/java2d/opengl/GLXGraphicsConfig ++sun/java2d/opengl/OGLGraphicsConfig ++sun/java2d/x11/X11SurfaceData$X11PixmapSurfaceData ++sun/awt/image/WritableRasterNative ++sun/awt/image/DataBufferNative ++sun/java2d/SurfaceManagerFactory ++sun/java2d/opengl/GLXSurfaceData ++sun/java2d/opengl/OGLSurfaceData ++sun/font/CompositeGlyphMapper ++sun/java2d/loops/FontInfo ++java/util/Date ++sun/util/calendar/CalendarSystem ++sun/util/calendar/Gregorian ++sun/util/calendar/BaseCalendar ++sun/util/calendar/AbstractCalendar ++java/util/TimeZone ++java/lang/InheritableThreadLocal ++sun/util/calendar/ZoneInfo ++sun/util/calendar/ZoneInfoFile ++sun/util/calendar/ZoneInfoFile$1 ++java/util/TimeZone$1 ++sun/util/calendar/Gregorian$Date ++sun/util/calendar/BaseCalendar$Date ++sun/util/calendar/CalendarDate ++sun/util/calendar/CalendarUtils ++java/util/TimeZone$DisplayNames ++sun/util/TimeZoneNameUtility ++sun/util/resources/TimeZoneNames ++sun/util/resources/TimeZoneNamesBundle ++sun/util/resources/TimeZoneNames_en ++java/util/spi/TimeZoneNameProvider ++java/lang/ProcessBuilder ++java/lang/ProcessImpl ++java/lang/UNIXProcess ++java/lang/Process ++java/lang/UNIXProcess$1 ++java/net/ServerSocket ++java/util/Random ++java/util/concurrent/atomic/AtomicLong ++java/lang/InternalError ++java/io/StringReader ++java/lang/SecurityException ++java/io/FilterReader ++java/lang/reflect/Proxy ++java/lang/reflect/InvocationHandler ++java/lang/NoSuchFieldException ++java/lang/InstantiationException ++java/lang/ArrayIndexOutOfBoundsException ++java/lang/IndexOutOfBoundsException ++javax/swing/JDialog ++sun/awt/X11/XClipboard ++sun/awt/datatransfer/SunClipboard ++java/awt/datatransfer/Clipboard ++java/awt/datatransfer/SystemFlavorMap ++java/awt/datatransfer/FlavorMap ++java/awt/datatransfer/FlavorTable ++java/awt/datatransfer/SystemFlavorMap$1 ++sun/net/ProgressMonitor ++sun/net/DefaultProgressMeteringPolicy ++sun/net/ProgressMeteringPolicy ++java/awt/datatransfer/SystemFlavorMap$2 ++java/awt/datatransfer/MimeType ++java/io/Externalizable ++java/awt/datatransfer/MimeTypeParameterList ++sun/awt/datatransfer/DataTransferer ++java/util/Collections$SynchronizedSet ++java/util/Collections$SynchronizedCollection ++java/awt/datatransfer/DataFlavor ++java/awt/datatransfer/DataFlavor$1 ++sun/awt/datatransfer/DataTransferer$CharsetComparator ++sun/awt/datatransfer/DataTransferer$IndexedComparator ++sun/nio/cs/UTF_16LE ++sun/nio/cs/UTF_16BE ++sun/awt/datatransfer/DataTransferer$DataFlavorComparator ++java/rmi/Remote ++sun/awt/datatransfer/DataTransferer$1 ++sun/awt/X11/XDataTransferer ++sun/awt/datatransfer/ToolkitThreadBlockedHandler ++javax/imageio/ImageTypeSpecifier ++sun/awt/X11/XSelection ++sun/security/action/GetIntegerAction ++sun/awt/X11/XSelection$IncrementalTransferHandler ++sun/awt/X11/XSelection$SelectionEventHandler ++java/awt/datatransfer/Transferable ++java/io/EOFException ++java/util/Vector$1 ++java/util/zip/ZipFile$1 ++java/util/zip/ZipFile$2 ++java/util/jar/JarFile$1 ++java/util/PropertyResourceBundle ++java/util/ResourceBundle$Control$1 ++java/util/Hashtable$EntrySet ++java/lang/IllegalAccessError ++java/text/MessageFormat ++java/text/MessageFormat$Field ++java/text/Format$Field ++java/lang/CloneNotSupportedException ++sun/reflect/MethodAccessorGenerator ++sun/reflect/AccessorGenerator ++sun/reflect/ClassFileConstants ++java/lang/Void ++sun/reflect/ByteVectorFactory ++sun/reflect/ByteVectorImpl ++sun/reflect/ByteVector ++sun/reflect/ClassFileAssembler ++sun/reflect/UTF8 ++sun/reflect/Label ++sun/reflect/Label$PatchInfo ++sun/reflect/MethodAccessorGenerator$1 ++sun/reflect/ClassDefiner ++sun/reflect/ClassDefiner$1 ++sun/reflect/BootstrapConstructorAccessorImpl ++java/awt/event/ActionListener ++javax/swing/Timer ++javax/swing/Timer$DoPostEvent ++javax/swing/TimerQueue ++javax/swing/TimerQueue$1 ++javax/swing/ToolTipManager ++java/awt/event/MouseAdapter ++javax/swing/ToolTipManager$insideTimerAction ++javax/swing/ToolTipManager$outsideTimerAction ++javax/swing/ToolTipManager$stillInsideTimerAction ++sun/swing/UIAction ++javax/swing/Action ++javax/swing/ToolTipManager$MoveBeforeEnterListener ++java/awt/event/MouseMotionAdapter ++java/util/Hashtable$ValueCollection ++javax/swing/event/CaretListener ++javax/swing/JToolBar ++javax/swing/JSplitPane ++javax/swing/border/Border ++javax/swing/JToggleButton ++javax/swing/border/EmptyBorder ++javax/swing/border/AbstractBorder ++javax/swing/DefaultButtonModel ++javax/swing/ButtonModel ++javax/swing/AbstractButton$Handler ++javax/swing/event/ChangeListener ++java/awt/event/ItemListener ++javax/swing/plaf/metal/MetalButtonUI ++javax/swing/plaf/basic/BasicButtonUI ++javax/swing/plaf/ButtonUI ++javax/swing/plaf/metal/MetalBorders ++javax/swing/plaf/BorderUIResource$CompoundBorderUIResource ++javax/swing/border/CompoundBorder ++javax/swing/plaf/metal/MetalBorders$ButtonBorder ++javax/swing/plaf/basic/BasicBorders$MarginBorder ++javax/swing/plaf/basic/BasicButtonListener ++java/awt/AWTEventMulticaster ++java/awt/event/WindowFocusListener ++java/awt/event/WindowStateListener ++java/awt/event/AdjustmentListener ++java/awt/event/TextListener ++javax/swing/event/AncestorListener ++java/beans/VetoableChangeListener ++javax/swing/ButtonGroup ++javax/swing/JToggleButton$ToggleButtonModel ++javax/swing/plaf/metal/MetalToggleButtonUI ++javax/swing/plaf/basic/BasicToggleButtonUI ++javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder ++java/awt/CardLayout ++javax/swing/Box ++javax/swing/plaf/metal/MetalBorders$TextFieldBorder ++javax/swing/plaf/metal/MetalBorders$Flush3DBorder ++javax/swing/BoxLayout ++javax/swing/JMenuBar ++javax/swing/DefaultSingleSelectionModel ++javax/swing/SingleSelectionModel ++javax/swing/plaf/basic/BasicMenuBarUI ++javax/swing/plaf/MenuBarUI ++javax/swing/plaf/basic/DefaultMenuLayout ++javax/swing/plaf/metal/MetalBorders$MenuBarBorder ++javax/swing/plaf/basic/BasicMenuBarUI$Handler ++javax/swing/KeyboardManager ++javax/swing/event/MenuEvent ++javax/swing/JMenu$MenuChangeListener ++javax/swing/JMenuItem$MenuItemFocusListener ++javax/swing/plaf/basic/BasicMenuUI ++javax/swing/plaf/basic/BasicMenuItemUI ++javax/swing/plaf/MenuItemUI ++javax/swing/plaf/metal/MetalBorders$MenuItemBorder ++javax/swing/plaf/metal/MetalIconFactory ++javax/swing/plaf/metal/MetalIconFactory$MenuArrowIcon ++javax/swing/plaf/basic/BasicMenuUI$Handler ++javax/swing/event/MenuKeyListener ++javax/swing/plaf/basic/BasicMenuItemUI$Handler ++javax/swing/event/MenuDragMouseListener ++javax/swing/event/MouseInputListener ++javax/swing/event/ChangeEvent ++java/awt/event/ContainerEvent ++javax/swing/plaf/metal/MetalIconFactory$MenuItemArrowIcon ++javax/swing/JPopupMenu ++javax/swing/plaf/basic/BasicPopupMenuUI ++javax/swing/plaf/PopupMenuUI ++javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper ++java/awt/event/AWTEventListenerProxy ++java/awt/Toolkit$SelectiveAWTEventListener ++java/awt/Toolkit$ToolkitEventMulticaster ++javax/swing/plaf/basic/BasicLookAndFeel$1 ++javax/swing/plaf/metal/MetalBorders$PopupMenuBorder ++javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener ++javax/swing/event/PopupMenuListener ++javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener ++javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber ++javax/swing/MenuSelectionManager ++javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper ++javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 ++java/awt/event/FocusAdapter ++javax/swing/JMenu$WinListener ++java/awt/event/WindowAdapter ++javax/swing/JPopupMenu$Separator ++javax/swing/JSeparator ++javax/swing/plaf/metal/MetalPopupMenuSeparatorUI ++javax/swing/plaf/metal/MetalSeparatorUI ++javax/swing/plaf/basic/BasicSeparatorUI ++javax/swing/plaf/SeparatorUI ++javax/swing/JComboBox ++javax/swing/event/ListDataListener ++javax/swing/event/CaretEvent ++javax/swing/text/TabExpander ++javax/swing/JScrollBar ++java/awt/Adjustable ++javax/swing/event/MouseInputAdapter ++javax/swing/JScrollBar$ModelListener ++javax/swing/DefaultBoundedRangeModel ++javax/swing/BoundedRangeModel ++javax/swing/plaf/metal/MetalScrollBarUI ++javax/swing/plaf/basic/BasicScrollBarUI ++javax/swing/plaf/ScrollBarUI ++javax/swing/plaf/metal/MetalBumps ++javax/swing/plaf/metal/MetalScrollButton ++javax/swing/plaf/basic/BasicArrowButton ++javax/swing/plaf/basic/BasicScrollBarUI$TrackListener ++javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener ++javax/swing/plaf/basic/BasicScrollBarUI$ModelListener ++javax/swing/plaf/metal/MetalScrollBarUI$ScrollBarListener ++javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler ++javax/swing/plaf/basic/BasicScrollBarUI$Handler ++javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener ++javax/swing/CellRendererPane ++java/util/HashMap$EntryIterator ++javax/swing/border/MatteBorder ++sun/font/StandardGlyphVector ++java/awt/font/GlyphVector ++sun/font/StandardGlyphVector$GlyphStrike ++sun/font/CoreMetrics ++sun/font/FontLineMetrics ++java/awt/font/LineMetrics ++javax/swing/ComboBoxModel ++javax/swing/ListModel ++javax/swing/ListCellRenderer ++javax/swing/DefaultComboBoxModel ++javax/swing/MutableComboBoxModel ++javax/swing/AbstractListModel ++javax/swing/JComboBox$1 ++javax/swing/AncestorNotifier ++javax/swing/plaf/metal/MetalComboBoxUI ++javax/swing/plaf/basic/BasicComboBoxUI ++javax/swing/plaf/ComboBoxUI ++javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager ++javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager ++javax/swing/plaf/basic/BasicComboPopup ++javax/swing/plaf/basic/ComboPopup ++javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass ++javax/swing/border/LineBorder ++javax/swing/plaf/basic/BasicComboPopup$1 ++javax/swing/JList ++javax/swing/DropMode ++javax/swing/DefaultListSelectionModel ++javax/swing/ListSelectionModel ++javax/swing/plaf/basic/BasicListUI ++javax/swing/plaf/ListUI ++javax/swing/plaf/basic/BasicListUI$ListTransferHandler ++javax/swing/TransferHandler ++javax/swing/TransferHandler$TransferAction ++javax/swing/DefaultListCellRenderer$UIResource ++javax/swing/DefaultListCellRenderer ++javax/swing/TransferHandler$SwingDropTarget ++java/awt/dnd/DropTargetContext ++javax/swing/TransferHandler$DropHandler ++javax/swing/TransferHandler$TransferSupport ++javax/swing/plaf/basic/BasicListUI$Handler ++javax/swing/event/ListSelectionListener ++javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag ++javax/swing/plaf/basic/BasicComboPopup$Handler ++javax/swing/JScrollPane ++javax/swing/ScrollPaneConstants ++javax/swing/ScrollPaneLayout$UIResource ++javax/swing/ScrollPaneLayout ++javax/swing/JViewport ++javax/swing/ViewportLayout ++javax/swing/plaf/basic/BasicViewportUI ++javax/swing/plaf/ViewportUI ++javax/swing/JScrollPane$ScrollBar ++javax/swing/JViewport$ViewListener ++java/awt/event/ComponentAdapter ++javax/swing/plaf/metal/MetalScrollPaneUI ++javax/swing/plaf/basic/BasicScrollPaneUI ++javax/swing/plaf/ScrollPaneUI ++javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder ++javax/swing/plaf/basic/BasicScrollPaneUI$Handler ++javax/swing/plaf/metal/MetalScrollPaneUI$1 ++javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource ++javax/swing/plaf/basic/BasicComboBoxRenderer ++javax/swing/plaf/metal/MetalComboBoxEditor$UIResource ++javax/swing/plaf/metal/MetalComboBoxEditor ++javax/swing/plaf/basic/BasicComboBoxEditor ++javax/swing/ComboBoxEditor ++javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField ++javax/swing/JTextField$NotifyAction ++javax/swing/text/TextAction ++javax/swing/AbstractAction ++javax/swing/text/JTextComponent$MutableCaretEvent ++javax/swing/plaf/metal/MetalTextFieldUI ++javax/swing/plaf/basic/BasicTextFieldUI ++javax/swing/plaf/basic/BasicTextUI ++javax/swing/text/ViewFactory ++javax/swing/plaf/TextUI ++javax/swing/plaf/basic/BasicTextUI$BasicCursor ++javax/swing/text/DefaultEditorKit ++javax/swing/text/EditorKit ++javax/swing/text/DefaultEditorKit$InsertContentAction ++javax/swing/text/DefaultEditorKit$DeletePrevCharAction ++javax/swing/text/DefaultEditorKit$DeleteNextCharAction ++javax/swing/text/DefaultEditorKit$ReadOnlyAction ++javax/swing/text/DefaultEditorKit$DeleteWordAction ++javax/swing/text/DefaultEditorKit$WritableAction ++javax/swing/text/DefaultEditorKit$CutAction ++javax/swing/text/DefaultEditorKit$CopyAction ++javax/swing/text/DefaultEditorKit$PasteAction ++javax/swing/text/DefaultEditorKit$VerticalPageAction ++javax/swing/text/DefaultEditorKit$PageAction ++javax/swing/text/DefaultEditorKit$InsertBreakAction ++javax/swing/text/DefaultEditorKit$BeepAction ++javax/swing/text/DefaultEditorKit$NextVisualPositionAction ++javax/swing/text/DefaultEditorKit$BeginWordAction ++javax/swing/text/DefaultEditorKit$EndWordAction ++javax/swing/text/DefaultEditorKit$PreviousWordAction ++javax/swing/text/DefaultEditorKit$NextWordAction ++javax/swing/text/DefaultEditorKit$BeginLineAction ++javax/swing/text/DefaultEditorKit$EndLineAction ++javax/swing/text/DefaultEditorKit$BeginParagraphAction ++javax/swing/text/DefaultEditorKit$EndParagraphAction ++javax/swing/text/DefaultEditorKit$BeginAction ++javax/swing/text/DefaultEditorKit$EndAction ++javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction ++javax/swing/text/DefaultEditorKit$InsertTabAction ++javax/swing/text/DefaultEditorKit$SelectWordAction ++javax/swing/text/DefaultEditorKit$SelectLineAction ++javax/swing/text/DefaultEditorKit$SelectParagraphAction ++javax/swing/text/DefaultEditorKit$SelectAllAction ++javax/swing/text/DefaultEditorKit$UnselectAction ++javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction ++javax/swing/text/DefaultEditorKit$DumpModelAction ++javax/swing/plaf/basic/BasicTextUI$TextTransferHandler ++javax/swing/text/Position$Bias ++javax/swing/plaf/basic/BasicTextUI$RootView ++javax/swing/text/View ++javax/swing/plaf/basic/BasicTextUI$UpdateHandler ++javax/swing/event/DocumentListener ++javax/swing/plaf/basic/BasicTextUI$DragListener ++javax/swing/plaf/basic/BasicComboBoxEditor$UIResource ++javax/swing/plaf/basic/BasicTextUI$BasicCaret ++javax/swing/text/DefaultCaret ++javax/swing/text/Caret ++javax/swing/text/DefaultCaret$Handler ++java/awt/datatransfer/ClipboardOwner ++javax/swing/plaf/basic/BasicTextUI$BasicHighlighter ++javax/swing/text/DefaultHighlighter ++javax/swing/text/LayeredHighlighter ++javax/swing/text/Highlighter ++javax/swing/text/Highlighter$Highlight ++javax/swing/text/DefaultHighlighter$DefaultHighlightPainter ++javax/swing/text/LayeredHighlighter$LayerPainter ++javax/swing/text/Highlighter$HighlightPainter ++javax/swing/text/DefaultHighlighter$SafeDamager ++javax/swing/text/FieldView ++javax/swing/text/PlainView ++javax/swing/text/JTextComponent$DefaultKeymap ++javax/swing/text/Keymap ++javax/swing/text/JTextComponent$KeymapWrapper ++javax/swing/text/JTextComponent$KeymapActionMap ++javax/swing/plaf/basic/BasicTextUI$FocusAction ++javax/swing/plaf/basic/BasicTextUI$TextActionWrapper ++javax/swing/JTextArea ++javax/swing/JEditorPane ++javax/swing/JTextField$ScrollRepainter ++javax/swing/plaf/metal/MetalComboBoxEditor$1 ++javax/swing/plaf/metal/MetalComboBoxEditor$EditorBorder ++javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener ++javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler ++javax/swing/plaf/basic/BasicComboBoxUI$Handler ++javax/swing/plaf/metal/MetalComboBoxButton ++javax/swing/plaf/metal/MetalComboBoxIcon ++javax/swing/plaf/metal/MetalComboBoxButton$1 ++javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager ++javax/swing/JComboBox$KeySelectionManager ++javax/swing/JToolBar$DefaultToolBarLayout ++javax/swing/plaf/metal/MetalToolBarUI ++javax/swing/plaf/basic/BasicToolBarUI ++javax/swing/plaf/ToolBarUI ++javax/swing/plaf/metal/MetalBorders$ToolBarBorder ++javax/swing/plaf/metal/MetalLookAndFeel$MetalLazyValue$1 ++javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder ++javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder ++javax/swing/plaf/basic/BasicBorders$RadioButtonBorder ++javax/swing/plaf/basic/BasicBorders$ButtonBorder ++javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder ++javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener ++javax/swing/plaf/basic/BasicToolBarUI$DockingListener ++javax/swing/plaf/basic/BasicToolBarUI$Handler ++javax/swing/border/EtchedBorder ++javax/swing/JToolBar$Separator ++javax/swing/plaf/basic/BasicToolBarSeparatorUI ++java/applet/Applet ++java/awt/Panel ++com/sun/awt/AWTUtilities ++javax/swing/KeyboardManager$ComponentKeyStrokePair ++sun/awt/EmbeddedFrame ++sun/awt/im/InputMethodContext ++java/awt/im/spi/InputMethodContext ++sun/awt/im/InputContext ++sun/awt/im/InputMethodManager ++sun/awt/im/ExecutableInputMethodManager ++sun/awt/X11/XInputMethodDescriptor ++sun/awt/X11InputMethodDescriptor ++java/awt/im/spi/InputMethodDescriptor ++sun/awt/im/InputMethodLocator ++sun/awt/im/ExecutableInputMethodManager$2 ++sun/misc/Service ++sun/misc/Service$LazyIterator ++java/util/TreeSet ++java/util/NavigableSet ++java/util/SortedSet ++javax/swing/SizeRequirements ++javax/swing/plaf/basic/BasicGraphicsUtils ++java/awt/event/AdjustmentEvent ++java/awt/MenuBar ++sun/awt/X11/XComponentPeer$2 ++java/awt/SequencedEvent ++java/beans/PropertyVetoException ++java/awt/DefaultKeyboardFocusManager$TypeAheadMarker ++java/awt/KeyboardFocusManager$HeavyweightFocusRequest ++java/awt/KeyboardFocusManager$LightweightFocusRequest ++sun/awt/KeyboardFocusManagerPeerImpl ++sun/awt/SunToolkit$7 ++java/awt/Window$1DisposeAction ++java/awt/LightweightDispatcher$2 ++sun/awt/X11/XReparentEvent ++sun/awt/X11/XWindowAttributes ++sun/awt/X11/XFocusChangeEvent ++sun/awt/X11/XComponentPeer$1 ++sun/awt/X11/XUnmapEvent ++java/io/StringWriter ++javax/swing/JWindow ++java/io/UnsupportedEncodingException ++java/net/UnknownHostException ++java/nio/channels/SocketChannel ++java/nio/channels/spi/AbstractSelectableChannel ++java/nio/channels/SelectableChannel ++java/net/SocketImplFactory ++javax/swing/UnsupportedLookAndFeelException ++java/lang/UnsatisfiedLinkError ++javax/swing/Box$Filler ++javax/swing/JComponent$2 ++sun/net/www/MimeTable ++java/net/FileNameMap ++sun/net/www/MimeTable$1 ++sun/net/www/MimeEntry ++java/net/URLConnection$1 ++java/text/SimpleDateFormat ++java/text/DateFormat ++java/text/DateFormat$Field ++java/util/Calendar ++java/util/GregorianCalendar ++sun/util/resources/CalendarData ++sun/util/resources/CalendarData_en ++java/text/DateFormatSymbols ++java/text/spi/DateFormatSymbolsProvider ++java/text/DontCareFieldPosition ++java/text/DontCareFieldPosition$1 ++java/text/Format$FieldDelegate ++javax/swing/plaf/BorderUIResource ++javax/swing/BorderFactory ++javax/swing/border/BevelBorder ++javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon ++javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 ++java/util/zip/ZipInputStream ++java/io/PushbackInputStream ++java/util/zip/CRC32 ++java/util/zip/Checksum ++java/lang/Thread$State ++javax/swing/SwingUtilities$SharedOwnerFrame ++javax/swing/JTable ++javax/swing/event/TableModelListener ++javax/swing/event/TableColumnModelListener ++javax/swing/event/CellEditorListener ++javax/swing/event/RowSorterListener ++javax/swing/BufferStrategyPaintManager$BufferInfo ++java/awt/Component$BltSubRegionBufferStrategy ++sun/awt/SubRegionShowable ++java/awt/Component$BltBufferStrategy ++sun/awt/image/SunVolatileImage ++sun/awt/image/BufferedImageGraphicsConfig ++sun/print/PrinterGraphicsConfig ++sun/java2d/x11/X11VolatileSurfaceManager ++sun/awt/image/VolatileSurfaceManager ++java/awt/print/PrinterGraphics ++java/awt/PrintGraphics ++java/awt/GraphicsCallback$PaintCallback ++java/awt/GraphicsCallback ++sun/awt/SunGraphicsCallback ++javax/swing/JRadioButton ++java/lang/ClassFormatError ++javax/swing/JTabbedPane ++javax/swing/JTabbedPane$ModelListener ++javax/swing/plaf/metal/MetalTabbedPaneUI ++javax/swing/plaf/basic/BasicTabbedPaneUI ++javax/swing/plaf/TabbedPaneUI ++javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout ++javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout ++javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout ++javax/swing/plaf/basic/BasicTabbedPaneUI$Handler ++sun/swing/ImageIconUIResource ++javax/swing/GrayFilter ++java/awt/image/RGBImageFilter ++java/awt/image/ImageFilter ++java/awt/image/FilteredImageSource ++org/w3c/dom/Node ++org/xml/sax/SAXException ++javax/xml/parsers/ParserConfigurationException ++org/xml/sax/EntityResolver ++java/security/NoSuchAlgorithmException ++java/security/GeneralSecurityException ++java/util/zip/GZIPInputStream ++java/util/zip/DeflaterOutputStream ++org/xml/sax/InputSource ++javax/xml/parsers/DocumentBuilderFactory ++javax/xml/parsers/FactoryFinder ++javax/xml/parsers/SecuritySupport ++javax/xml/parsers/SecuritySupport$2 ++javax/xml/parsers/SecuritySupport$5 ++javax/xml/parsers/SecuritySupport$1 ++javax/xml/parsers/SecuritySupport$4 ++javax/xml/parsers/DocumentBuilder ++org/w3c/dom/Document ++org/xml/sax/helpers/DefaultHandler ++org/xml/sax/DTDHandler ++org/xml/sax/ContentHandler ++org/xml/sax/ErrorHandler ++org/xml/sax/SAXNotSupportedException ++org/xml/sax/Locator ++org/xml/sax/SAXNotRecognizedException ++org/xml/sax/SAXParseException ++org/w3c/dom/NodeList ++org/w3c/dom/events/EventTarget ++org/w3c/dom/traversal/DocumentTraversal ++org/w3c/dom/events/DocumentEvent ++org/w3c/dom/ranges/DocumentRange ++org/w3c/dom/Entity ++org/w3c/dom/Element ++org/w3c/dom/CharacterData ++org/w3c/dom/CDATASection ++org/w3c/dom/Text ++org/xml/sax/AttributeList ++org/w3c/dom/DOMException ++org/w3c/dom/Notation ++org/w3c/dom/DocumentType ++org/w3c/dom/Attr ++org/w3c/dom/EntityReference ++org/w3c/dom/ProcessingInstruction ++org/w3c/dom/Comment ++org/w3c/dom/DocumentFragment ++org/w3c/dom/events/Event ++org/w3c/dom/events/MutationEvent ++org/w3c/dom/traversal/TreeWalker ++org/w3c/dom/ranges/Range ++org/w3c/dom/traversal/NodeIterator ++org/w3c/dom/events/EventException ++org/w3c/dom/NamedNodeMap ++java/lang/StringIndexOutOfBoundsException ++java/awt/GridLayout ++javax/swing/plaf/metal/MetalRadioButtonUI ++javax/swing/plaf/basic/BasicRadioButtonUI ++javax/swing/plaf/basic/BasicBorders ++javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon ++java/awt/event/ItemEvent ++java/awt/CardLayout$Card ++javax/swing/JCheckBox ++javax/swing/event/ListSelectionEvent ++javax/swing/plaf/metal/MetalCheckBoxUI ++javax/swing/plaf/metal/MetalIconFactory$CheckBoxIcon ++java/lang/ExceptionInInitializerError ++com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI ++javax/swing/JProgressBar ++javax/swing/JProgressBar$ModelListener ++javax/swing/plaf/metal/MetalProgressBarUI ++javax/swing/plaf/basic/BasicProgressBarUI ++javax/swing/plaf/ProgressBarUI ++javax/swing/plaf/BorderUIResource$LineBorderUIResource ++javax/swing/plaf/basic/BasicProgressBarUI$Handler ++javax/swing/tree/TreeModel ++javax/swing/table/TableCellRenderer ++javax/swing/table/JTableHeader ++javax/swing/event/TreeExpansionListener ++javax/swing/table/AbstractTableModel ++javax/swing/table/TableModel ++javax/swing/table/DefaultTableCellRenderer ++javax/swing/JTree ++javax/swing/tree/TreeSelectionModel ++javax/swing/tree/DefaultTreeCellRenderer ++javax/swing/tree/TreeCellRenderer ++javax/swing/table/TableCellEditor ++javax/swing/CellEditor ++javax/swing/JToolTip ++javax/swing/table/TableColumn ++javax/swing/table/DefaultTableColumnModel ++javax/swing/table/TableColumnModel ++javax/swing/table/DefaultTableModel ++javax/swing/event/TableModelEvent ++sun/swing/table/DefaultTableCellHeaderRenderer ++javax/swing/plaf/basic/BasicTableHeaderUI ++javax/swing/plaf/TableHeaderUI ++javax/swing/plaf/basic/BasicTableHeaderUI$1 ++javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler ++javax/swing/DefaultCellEditor ++javax/swing/tree/TreeCellEditor ++javax/swing/AbstractCellEditor ++javax/swing/plaf/basic/BasicTableUI ++javax/swing/plaf/TableUI ++javax/swing/plaf/basic/BasicTableUI$TableTransferHandler ++javax/swing/plaf/basic/BasicTableUI$Handler ++javax/swing/tree/DefaultTreeSelectionModel ++javax/swing/tree/TreePath ++javax/swing/plaf/metal/MetalTreeUI ++javax/swing/plaf/basic/BasicTreeUI ++javax/swing/plaf/TreeUI ++javax/swing/plaf/basic/BasicTreeUI$Actions ++javax/swing/plaf/basic/BasicTreeUI$TreeTransferHandler ++javax/swing/plaf/metal/MetalTreeUI$LineListener ++javax/swing/plaf/basic/BasicTreeUI$Handler ++javax/swing/event/TreeModelListener ++javax/swing/event/TreeSelectionListener ++javax/swing/event/SwingPropertyChangeSupport ++javax/swing/tree/VariableHeightLayoutCache ++javax/swing/tree/AbstractLayoutCache ++javax/swing/tree/RowMapper ++javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler ++javax/swing/tree/AbstractLayoutCache$NodeDimensions ++javax/swing/JTree$TreeModelHandler ++javax/swing/tree/VariableHeightLayoutCache$TreeStateNode ++javax/swing/tree/DefaultMutableTreeNode ++javax/swing/tree/MutableTreeNode ++javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration ++javax/swing/event/TableColumnModelEvent ++java/text/ParseException ++java/text/NumberFormat$Field ++javax/swing/event/UndoableEditListener ++javax/swing/filechooser/FileFilter ++javax/swing/tree/DefaultTreeModel ++javax/swing/tree/DefaultTreeCellEditor ++javax/swing/tree/DefaultTreeCellEditor$1 ++javax/swing/tree/DefaultTreeCellEditor$DefaultTextField ++javax/swing/DefaultCellEditor$1 ++javax/swing/DefaultCellEditor$EditorDelegate ++javax/swing/tree/DefaultTreeCellEditor$EditorContainer ++javax/swing/JTree$TreeSelectionRedirector ++javax/swing/event/TreeModelEvent ++javax/swing/plaf/metal/MetalSplitPaneUI ++javax/swing/plaf/basic/BasicSplitPaneUI ++javax/swing/plaf/SplitPaneUI ++javax/swing/plaf/basic/BasicSplitPaneDivider ++javax/swing/plaf/basic/BasicBorders$SplitPaneBorder ++javax/swing/plaf/metal/MetalSplitPaneDivider ++javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout ++javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler ++javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder ++javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager ++javax/swing/plaf/basic/BasicSplitPaneUI$1 ++javax/swing/plaf/basic/BasicSplitPaneUI$Handler ++javax/swing/plaf/metal/MetalSplitPaneDivider$1 ++javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchActionHandler ++javax/swing/plaf/metal/MetalSplitPaneDivider$2 ++javax/swing/border/TitledBorder ++javax/swing/plaf/basic/BasicTextAreaUI ++java/util/Collections$UnmodifiableCollection$1 ++java/io/InterruptedIOException ++java/net/NoRouteToHostException ++java/net/BindException ++javax/swing/tree/PathPlaceHolder ++javax/swing/event/TreeSelectionEvent ++javax/swing/JList$3 ++javax/swing/JList$ListSelectionHandler ++javax/swing/JSlider ++javax/swing/JSlider$ModelListener ++javax/swing/plaf/metal/MetalSliderUI ++javax/swing/plaf/basic/BasicSliderUI ++javax/swing/plaf/SliderUI ++javax/swing/plaf/basic/BasicSliderUI$Actions ++javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon ++javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon ++javax/swing/plaf/basic/BasicSliderUI$TrackListener ++javax/swing/plaf/basic/BasicSliderUI$Handler ++javax/swing/plaf/basic/BasicSliderUI$ScrollListener ++javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener ++javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler ++sun/java2d/HeadlessGraphicsEnvironment ++java/util/Hashtable$KeySet ++java/awt/FontFormatException ++sun/font/Type1Font$1 ++java/nio/channels/FileChannel$MapMode ++sun/nio/ch/FileChannelImpl$Unmapper ++sun/nio/ch/Util$3 ++java/nio/DirectByteBufferR ++java/nio/charset/Charset$3 ++sun/nio/cs/AbstractCharsetProvider ++sun/nio/cs/SingleByteDecoder ++java/lang/CharacterData00 ++javax/swing/DefaultListModel ++javax/swing/event/ListDataEvent ++javax/sound/sampled/DataLine ++javax/sound/sampled/Line ++javax/sound/sampled/Line$Info ++javax/sound/sampled/DataLine$Info ++javax/sound/sampled/Control$Type ++javax/sound/sampled/FloatControl$Type ++javax/sound/sampled/LineUnavailableException ++javax/sound/sampled/UnsupportedAudioFileException ++javax/swing/JRadioButtonMenuItem ++javax/swing/JMenuItem$AccessibleJMenuItem ++javax/swing/AbstractButton$AccessibleAbstractButton ++javax/accessibility/AccessibleAction ++javax/accessibility/AccessibleValue ++javax/accessibility/AccessibleText ++javax/accessibility/AccessibleExtendedComponent ++javax/accessibility/AccessibleComponent ++javax/swing/JComponent$AccessibleJComponent ++java/awt/Container$AccessibleAWTContainer ++java/awt/Component$AccessibleAWTComponent ++javax/accessibility/AccessibleRelationSet ++javax/accessibility/AccessibleState ++javax/accessibility/AccessibleBundle ++javax/swing/plaf/basic/BasicCheckBoxMenuItemUI ++javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon ++javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem ++javax/swing/plaf/basic/BasicRadioButtonMenuItemUI ++javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon ++sun/awt/image/ImageDecoder$1 ++javax/swing/JTabbedPane$Page ++java/net/DatagramSocket ++java/net/MulticastSocket ++java/net/DatagramPacket ++sun/net/InetAddressCachePolicy ++sun/net/InetAddressCachePolicy$1 ++sun/net/InetAddressCachePolicy$2 ++java/net/InetAddress$CacheEntry ++java/net/PlainDatagramSocketImpl ++java/net/DatagramSocketImpl ++java/net/NetworkInterface ++java/net/InterfaceAddress ++java/text/Collator ++java/text/spi/CollatorProvider ++sun/text/resources/CollationData ++sun/text/resources/CollationData_en ++sun/util/EmptyListResourceBundle ++java/text/RuleBasedCollator ++java/text/CollationRules ++java/text/RBCollationTables ++java/text/RBTableBuilder ++java/text/RBCollationTables$BuildAPI ++sun/text/IntHashtable ++sun/text/UCompactIntArray ++sun/text/normalizer/NormalizerImpl ++sun/text/normalizer/ICUData ++sun/text/normalizer/NormalizerDataReader ++sun/text/normalizer/ICUBinary$Authenticate ++sun/text/normalizer/ICUBinary ++sun/text/normalizer/NormalizerImpl$FCDTrieImpl ++sun/text/normalizer/Trie$DataManipulate ++sun/text/normalizer/NormalizerImpl$NormTrieImpl ++sun/text/normalizer/NormalizerImpl$AuxTrieImpl ++sun/text/normalizer/IntTrie ++sun/text/normalizer/Trie ++sun/text/normalizer/CharTrie ++sun/text/normalizer/CharTrie$FriendAgent ++sun/text/normalizer/UnicodeSet ++sun/text/normalizer/UnicodeMatcher ++sun/text/normalizer/NormalizerImpl$DecomposeArgs ++java/text/MergeCollation ++java/text/PatternEntry$Parser ++java/text/PatternEntry ++java/text/EntryPair ++sun/text/ComposedCharIter ++sun/text/normalizer/UTF16 ++sun/net/www/protocol/http/Handler ++java/io/ObjectInputStream$BlockDataInputStream ++java/io/ObjectInputStream$PeekInputStream ++java/io/ObjectInputStream$HandleTable ++java/io/ObjectInputStream$ValidationList ++java/io/Bits ++java/io/ObjectStreamClass$Caches ++java/io/ObjectStreamClass$WeakClassKey ++java/io/ObjectStreamClass$EntryFuture ++java/io/ObjectStreamClass$2 ++sun/reflect/SerializationConstructorAccessorImpl ++java/io/ObjectStreamClass$FieldReflectorKey ++java/io/ObjectStreamClass$FieldReflector ++java/io/ObjectStreamClass$1 ++java/io/DataOutputStream ++java/io/ObjectStreamClass$MemberSignature ++java/io/ObjectStreamClass$3 ++java/io/ObjectStreamClass$4 ++java/io/ObjectStreamClass$5 ++java/security/MessageDigest ++java/security/MessageDigestSpi ++sun/security/jca/GetInstance ++sun/security/jca/Providers ++sun/security/jca/ProviderList ++sun/security/jca/ProviderConfig ++sun/security/jca/ProviderList$3 ++sun/security/jca/ProviderList$1 ++sun/security/jca/ProviderList$2 ++sun/security/jca/ProviderConfig$1 ++sun/security/jca/ProviderConfig$3 ++java/security/Provider$Service ++java/security/Provider$UString ++sun/security/provider/SHA ++sun/security/provider/DigestBase ++sun/security/jca/GetInstance$Instance ++java/security/MessageDigest$Delegate ++sun/security/provider/ByteArrayAccess ++java/io/ObjectStreamClass$ClassDataSlot ++sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl ++java/security/SignatureException ++java/security/InvalidKeyException ++java/security/KeyException ++java/security/Signature ++java/security/SignatureSpi ++java/io/ObjectOutputStream$BlockDataOutputStream ++sun/security/provider/DSAPublicKey ++java/security/interfaces/DSAPublicKey ++java/security/interfaces/DSAKey ++java/security/PublicKey ++java/security/Key ++sun/security/x509/X509Key ++java/io/ObjectOutputStream$HandleTable ++java/io/ObjectOutputStream$ReplaceTable ++sun/security/x509/AlgorithmId ++sun/security/util/DerEncoder ++sun/security/util/BitArray ++sun/security/util/DerOutputStream ++sun/security/util/DerValue ++java/math/BigInteger ++java/security/interfaces/DSAParams ++sun/security/util/DerInputStream ++sun/security/util/DerInputBuffer ++sun/security/util/ObjectIdentifier ++java/security/AlgorithmParameters ++java/security/AlgorithmParametersSpi ++sun/security/provider/DSAParameters ++sun/security/util/ByteArrayLexOrder ++sun/security/util/ByteArrayTagOrder ++sun/security/util/DerIndefLenConverter ++java/io/InvalidClassException ++java/io/ObjectStreamException ++java/io/ObjectInputStream$GetFieldImpl ++java/io/ObjectInputStream$GetField ++sun/security/jca/ServiceId ++sun/security/jca/ProviderList$ServiceList ++sun/security/jca/ProviderList$ServiceList$1 ++java/security/Signature$Delegate ++java/security/interfaces/DSAPrivateKey ++java/security/PrivateKey ++sun/security/provider/DSA$SHA1withDSA ++sun/security/provider/DSA ++java/security/spec/DSAParameterSpec ++java/security/spec/AlgorithmParameterSpec ++java/math/MutableBigInteger ++java/math/SignedMutableBigInteger ++java/awt/EventQueue$1AWTInvocationLock ++java/awt/Component$FlipBufferStrategy ++java/awt/SentEvent ++sun/awt/X11/XDestroyWindowEvent ++sun/awt/X11/XDropTargetRegistry ++sun/awt/X11/XEmbeddedFramePeer ++sun/awt/X11/XDragAndDropProtocols ++sun/awt/X11/XDropTargetContextPeer ++sun/awt/dnd/SunDropTargetContextPeer ++java/awt/dnd/peer/DropTargetContextPeer ++sun/awt/X11/XDropTargetContextPeer$XDropTargetProtocolListenerImpl ++sun/awt/X11/XDropTargetProtocolListener ++sun/awt/X11/XDnDDragSourceProtocol ++sun/awt/X11/XDragSourceProtocol ++sun/awt/X11/MotifDnDDragSourceProtocol ++sun/awt/X11/XDnDDropTargetProtocol ++sun/awt/X11/XDropTargetProtocol ++sun/awt/X11/MotifDnDDropTargetProtocol ++sun/awt/X11/XDnDConstants ++sun/awt/X11/MotifDnDConstants ++javax/swing/JTable$2 ++javax/swing/JTable$Resizable3 ++javax/swing/JTable$Resizable2 ++javax/swing/JTable$5 ++javax/swing/event/AncestorEvent ++sun/font/FontDesignMetrics$MetricsKey ++java/awt/geom/Line2D$Float ++java/awt/geom/Line2D ++com/sun/java/swing/plaf/gtk/GTKLookAndFeel ++javax/swing/plaf/synth/SynthLookAndFeel ++javax/swing/plaf/synth/DefaultSynthStyleFactory ++javax/swing/plaf/synth/SynthStyleFactory ++sun/swing/BakedArrayList ++javax/swing/plaf/synth/SynthLookAndFeel$Handler ++javax/swing/plaf/synth/SynthDefaultLookup ++com/sun/java/swing/plaf/gtk/GTKEngine ++com/sun/java/swing/plaf/gtk/GTKEngine$Settings ++com/sun/java/swing/plaf/gtk/GTKStyleFactory ++com/sun/java/swing/plaf/gtk/PangoFonts ++com/sun/java/swing/plaf/gtk/GTKLookAndFeel$WeakPCL ++javax/swing/plaf/synth/Region ++javax/swing/plaf/synth/SynthLookAndFeel$AATextListener ++com/sun/java/swing/plaf/gtk/GTKRegion ++com/sun/java/swing/plaf/gtk/GTKStyle ++com/sun/java/swing/plaf/gtk/GTKConstants ++javax/swing/plaf/synth/SynthStyle ++javax/swing/plaf/synth/SynthGraphicsUtils ++com/sun/java/swing/plaf/gtk/GTKGraphicsUtils ++com/sun/java/swing/plaf/gtk/GTKStyle$GTKStockIcon ++sun/swing/plaf/synth/SynthIcon ++com/sun/java/swing/plaf/gtk/GTKColorType ++javax/swing/plaf/synth/ColorType ++com/sun/java/swing/plaf/gtk/resources/gtk ++com/sun/swing/internal/plaf/synth/resources/synth ++com/sun/java/swing/plaf/gtk/GTKStyle$GTKLazyValue ++com/sun/java/swing/plaf/gtk/GTKLookAndFeel$1FontLazyValue ++com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2 ++com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3 ++javax/swing/plaf/synth/SynthPanelUI ++javax/swing/plaf/synth/SynthConstants ++javax/swing/plaf/synth/SynthContext ++javax/swing/plaf/synth/SynthBorder ++javax/swing/plaf/synth/SynthRootPaneUI ++javax/swing/plaf/synth/SynthLabelUI ++javax/swing/plaf/synth/SynthButtonUI ++javax/swing/plaf/synth/SynthToggleButtonUI ++javax/swing/plaf/basic/BasicBorders$FieldBorder ++javax/swing/plaf/synth/SynthMenuBarUI ++javax/swing/plaf/synth/SynthMenuUI ++javax/swing/plaf/synth/SynthUI ++com/sun/java/swing/plaf/gtk/GTKIconFactory ++com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon ++com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon ++com/sun/java/swing/plaf/gtk/GTKConstants$ArrowType ++javax/swing/plaf/basic/BasicIconFactory ++javax/swing/plaf/basic/BasicIconFactory$MenuItemCheckIcon ++javax/swing/plaf/synth/SynthMenuItemUI ++javax/swing/plaf/synth/SynthPopupMenuUI ++javax/swing/plaf/synth/SynthSeparatorUI ++javax/swing/plaf/synth/SynthScrollBarUI ++javax/swing/plaf/synth/SynthArrowButton ++javax/swing/plaf/synth/SynthArrowButton$SynthArrowButtonUI ++javax/swing/plaf/synth/SynthComboBoxUI ++javax/swing/plaf/synth/SynthComboPopup ++javax/swing/plaf/synth/SynthListUI ++javax/swing/plaf/synth/SynthListUI$SynthListCellRenderer ++javax/swing/plaf/synth/SynthViewportUI ++javax/swing/plaf/synth/SynthScrollPaneUI ++javax/swing/plaf/synth/SynthScrollPaneUI$ViewportBorder ++javax/swing/plaf/synth/SynthComboBoxUI$SynthComboBoxRenderer ++javax/swing/plaf/synth/SynthComboBoxUI$SynthComboBoxEditor ++javax/swing/plaf/synth/SynthTextFieldUI ++javax/swing/plaf/synth/SynthToolBarUI ++javax/swing/plaf/synth/SynthToolBarUI$SynthToolBarLayoutManager ++com/sun/java/swing/plaf/gtk/GTKIconFactory$ToolBarHandleIcon ++com/sun/java/swing/plaf/gtk/GTKConstants$Orientation ++sun/awt/X11/XTranslateCoordinates ++com/sun/java/swing/plaf/gtk/GTKPainter ++javax/swing/plaf/synth/SynthPainter ++javax/swing/plaf/synth/SynthPainter$1 ++com/sun/java/swing/plaf/gtk/GTKConstants$PositionType ++com/sun/java/swing/plaf/gtk/GTKConstants$ShadowType ++java/io/ObjectInputStream$HandleTable$HandleList ++sun/java2d/pipe/ShapeSpanIterator ++sun/java2d/pipe/SpanIterator ++sun/dc/path/PathConsumer ++sun/dc/pr/PathStroker ++sun/dc/pr/PathDasher ++java/awt/geom/LineIterator ++java/awt/geom/PathIterator ++sun/applet/Main ++sun/applet/AppletMessageHandler ++sun/applet/resources/MsgAppletViewer ++sun/applet/AppletSecurity ++sun/awt/AWTSecurityManager ++java/lang/SecurityManager ++java/security/DomainCombiner ++sun/applet/AppletSecurity$1 ++java/lang/SecurityManager$1 ++java/security/SecurityPermission ++java/util/PropertyPermission ++sun/applet/AppletViewer ++java/applet/AppletContext ++java/awt/print/Printable ++sun/security/util/SecurityConstants ++java/awt/AWTPermission ++java/net/NetPermission ++java/net/SocketPermission ++javax/security/auth/AuthPermission ++java/lang/Thread$1 ++java/util/logging/LogManager$5 ++sun/applet/StdAppletViewerFactory ++sun/applet/AppletViewerFactory ++sun/applet/AppletViewer$UserActionListener ++sun/applet/AppletViewerPanel ++sun/applet/AppletPanel ++java/applet/AppletStub ++sun/misc/MessageUtils ++sun/applet/AppletPanel$10 ++java/security/Policy$1 ++sun/security/provider/PolicyFile$1 ++sun/security/provider/PolicyFile$3 ++sun/security/util/PropertyExpander ++sun/security/provider/PolicyParser ++sun/security/util/PolicyUtil ++sun/security/provider/PolicyParser$GrantEntry ++sun/security/provider/PolicyParser$PermissionEntry ++sun/security/provider/PolicyFile$PolicyEntry ++sun/security/provider/PolicyFile$6 ++sun/security/provider/PolicyFile$7 ++java/net/SocketPermissionCollection ++java/util/PropertyPermissionCollection ++sun/applet/AppletPanel$9 ++sun/applet/AppletClassLoader ++sun/applet/AppletThreadGroup ++sun/applet/AppContextCreator ++sun/applet/AppletPanel$1 ++sun/awt/X11/XMenuBarPeer ++java/awt/peer/MenuBarPeer ++java/awt/peer/MenuComponentPeer ++sun/awt/X11/XBaseMenuWindow ++sun/awt/X11/XMenuPeer ++java/awt/peer/MenuPeer ++java/awt/peer/MenuItemPeer ++sun/awt/X11/XMenuItemPeer ++java/awt/MenuShortcut ++sun/awt/X11/XMenuWindow ++sun/awt/X11/XMenuItemPeer$TextMetrics ++sun/awt/AppContext$3 ++sun/awt/X11/XMenuBarPeer$MappingData ++sun/awt/X11/XBaseMenuWindow$MappingData ++sun/applet/AppletViewer$1 ++sun/applet/AppletViewer$1AppletEventListener ++sun/applet/AppletListener ++sun/applet/AppletEventMulticaster ++sun/misc/Queue ++sun/misc/QueueElement ++sun/applet/AppletEvent ++sun/applet/AppletClassLoader$1 ++sun/awt/X11/XBaseMenuWindow$3 ++java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent ++sun/awt/CausedFocusEvent ++sun/awt/X11/XWindow$1 ++java/net/URLClassLoader$4 ++sun/applet/AppletClassLoader$2 ++javax/swing/JApplet ++java/lang/ClassLoader$1 ++sun/security/provider/PolicyFile$5 ++java/security/PermissionsEnumerator ++java/util/Collections$1 ++sun/applet/AppletPanel$11 ++sun/applet/AppletPanel$8 ++sun/applet/AppletPanel$2 ++sun/applet/AppletPanel$3 ++sun/applet/AppletPanel$6 ++javax/swing/BufferStrategyPaintManager$1 ++# f3ac8b467e7f8c49 +--- jdk/src/share/classes/java/util/TimeZone.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/java/util/TimeZone.java 2012-05-17 16:14:57.000000000 -0700 +@@ -890,15 +890,13 @@ } int gmtOffset = (hours * 60 + num) * 60 * 1000; @@ -17578,8 +4567,8 @@ } return zi; } ---- ./jdk/src/share/classes/sun/awt/FontConfiguration.java 2011-11-17 21:59:04.000000000 -0800 -+++ ./jdk/src/share/classes/sun/awt/FontConfiguration.java 2012-02-26 15:38:42.000000000 -0800 +--- jdk/src/share/classes/sun/awt/FontConfiguration.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/awt/FontConfiguration.java 2012-02-26 15:38:42.000000000 -0800 @@ -1146,7 +1146,7 @@ */ HashMap<String, Boolean> existsMap; @@ -17589,17 +4578,17 @@ return false; } else if (existsMap == null) { existsMap = new HashMap<String, Boolean>(); ---- ./jdk/src/share/classes/sun/awt/OSInfo.java 2011-11-17 21:59:04.000000000 -0800 -+++ ./jdk/src/share/classes/sun/awt/OSInfo.java 2011-04-22 23:08:28.000000000 -0700 +--- jdk/src/share/classes/sun/awt/OSInfo.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/awt/OSInfo.java 2012-05-17 16:18:00.000000000 -0700 @@ -39,6 +39,7 @@ WINDOWS, LINUX, SOLARIS, + BSD, + MACOSX, UNKNOWN } - -@@ -100,6 +101,14 @@ +@@ -101,6 +102,10 @@ return SOLARIS; } @@ -17607,39 +4596,35 @@ + return BSD; + } + -+ if (osName.contains("Darwin")) { -+ return BSD; -+ } -+ - // determine another OS here - } - ---- ./jdk/src/share/classes/sun/font/FontUtilities.java 2011-11-17 21:59:07.000000000 -0800 -+++ ./jdk/src/share/classes/sun/font/FontUtilities.java 2011-04-22 23:08:28.000000000 -0700 + if (osName.contains("OS X")) { + return MACOSX; + } +--- jdk/src/share/classes/sun/font/FontUtilities.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/font/FontUtilities.java 2012-05-17 16:18:00.000000000 -0700 @@ -48,6 +48,8 @@ public static boolean isLinux; + public static boolean isBSD; + - public static boolean isSolaris8; + public static boolean isMacOSX; - public static boolean isSolaris9; -@@ -76,6 +78,11 @@ + public static boolean isSolaris8; +@@ -78,6 +80,11 @@ isLinux = osName.startsWith("Linux"); -+ isBSD = (osName.startsWith("FreeBSD") || -+ osName.startsWith("NetBSD") || -+ osName.startsWith("OpenBSD") || -+ osName.startsWith("Darwin")); + ++ isBSD = (osName.startsWith("FreeBSD") || ++ osName.startsWith("NetBSD") || ++ osName.startsWith("OpenBSD")); ++ + isMacOSX = osName.contains("OS X"); // TODO: MacOSX + String t2kStr = System.getProperty("sun.java2d.font.scaler"); - if (t2kStr != null) { - useT2K = "t2k".equals(t2kStr); ---- ./jdk/src/share/classes/sun/font/SunFontManager.java 2011-11-17 21:59:08.000000000 -0800 -+++ ./jdk/src/share/classes/sun/font/SunFontManager.java 2011-04-22 23:08:28.000000000 -0700 -@@ -413,7 +413,7 @@ +--- jdk/src/share/classes/sun/font/SunFontManager.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/font/SunFontManager.java 2012-05-17 16:14:57.000000000 -0700 +@@ -417,7 +417,7 @@ * registerFonts method as on-screen these JRE fonts * always go through the T2K rasteriser. */ @@ -17648,803 +4633,39 @@ /* Linux font configuration uses these fonts */ registerFontDir(jreFontDirName); } ---- ./jdk/src/share/classes/sun/io/ByteToCharEUC_JP_BSD.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/share/classes/sun/io/ByteToCharEUC_JP_BSD.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,190 +0,0 @@ --/* -- * Copyright (c) 2000, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --package sun.io; -- --/** -- * Class for converting bytes to characters for the EUC-JP encoding in -- * bsd. This converter supports the JIS0201 and the JIS0208 encoding and -- * omits support for the JIS212 encoding. -- * -- * @author Naveen Sanjeeva -- */ -- --public class ByteToCharEUC_JP_BSD extends ByteToCharJIS0208 { -- private byte savedSecond = 0; -- ByteToCharJIS0201 bcJIS0201 = new ByteToCharJIS0201(); -- -- public ByteToCharEUC_JP_BSD() { -- super(); -- start = 0xA1; -- end = 0xFE; -- savedSecond = 0; -- } -- -- public int flush(char[] output, int outStart, int outEnd) -- throws MalformedInputException -- { -- if (savedSecond != 0) { -- reset(); -- throw new MalformedInputException(); -- } -- reset(); -- return 0; -- } -- -- /** -- * Resets the converter. -- * Call this method to reset the converter to its initial state -- */ -- public void reset() { -- super.reset(); -- savedSecond = 0; -- } -- -- public String getCharacterEncoding() { -- return "EUC_JP_BSD"; -- } -- -- protected char convSingleByte(int b) { -- if (b < 0 || b > 0x7F) -- return REPLACE_CHAR; -- return bcJIS0201.getUnicode(b); -- } -- -- protected char getUnicode(int byte1, int byte2) { -- if (byte1 == 0x8E) { -- return bcJIS0201.getUnicode(byte2 - 256); -- } -- // Fix for bug 4121358 - similar fix for bug 4117820 put -- // into ByteToCharDoubleByte.getUnicode() -- if (((byte1 < 0) || (byte1 > index1.length)) -- || ((byte2 < start) || (byte2 > end))) -- return REPLACE_CHAR; -- -- int n = (index1[byte1 - 0x80] & 0xf) * (end - start + 1) -- + (byte2 - start); -- return index2[index1[byte1 - 0x80] >> 4].charAt(n); -- } -- -- /** -- * Converts sequences of bytes to characters. -- * Conversions that result in Exceptions can be restarted by calling -- * convert again, with appropriately modified parameters. -- * @return the characters written to output. -- * @param input byte array containing text in Double/single Byte -- * @param inStart offset in input array -- * @param inEnd offset of last byte to be converted -- * @param output character array to receive conversion result -- * @param outStart starting offset -- * @param outEnd offset of last byte to be written to -- * @throw UnsupportedCharacterException for any bytes -- * that cannot be converted to the external character set. -- */ -- public int convert(byte[] input, int inOff, int inEnd, -- char[] output, int outOff, int outEnd) -- throws UnknownCharacterException, -- ConversionBufferFullException -- { -- char outputChar = REPLACE_CHAR; -- int inputSize = 0; // Size of input -- -- // Record beginning offsets -- charOff = outOff; -- byteOff = inOff; -- -- // Loop until we hit the end of the input -- while (byteOff < inEnd) { -- int byte1, byte2; -- -- if (savedByte == 0) { -- byte1 = input[byteOff]; -- inputSize = 1; -- } else { -- byte1 = savedByte; -- savedByte = 0; -- inputSize = 0; -- } -- -- outputChar = convSingleByte(byte1); -- -- if (outputChar == REPLACE_CHAR) { // Multibyte char -- if ((byte1 & 0xff) != 0x8F) { // JIS0208 -- if (byteOff + inputSize >= inEnd) { -- // split in the middle of a character -- // save the first byte for next time around -- savedByte = (byte) byte1; -- byteOff += inputSize; -- break; -- } -- byte1 &= 0xff; -- byte2 = input[byteOff + inputSize] & 0xff; -- inputSize++; -- outputChar = getUnicode(byte1, byte2); -- } else if ((byte1 & 0xff) == 0x8F) { // JIS0212 -- // Handling of 3-byte sequences for this converter involves -- // just ignoring the relevant bytes and returning a -- // suitable substitute char if one exists. -- if (byteOff + inputSize + 1 >= inEnd) { -- // split in the middle of a character -- // save the first 2 bytes for next time around -- savedByte = (byte) byte1; -- byteOff += inputSize; -- if (byteOff < inEnd) { -- savedSecond = input[byteOff]; -- byteOff++; -- } -- break; -- } -- -- // Skip over the saved bytes if any -- if (savedSecond != 0) { -- savedSecond = 0; -- } else { -- inputSize++; -- } -- inputSize++; -- } -- } -- -- if (outputChar == REPLACE_CHAR) { -- if (subMode) -- outputChar = subChars[0]; -- else { -- badInputLength = inputSize; -- throw new UnknownCharacterException(); -- } -- } -- -- if (charOff >= outEnd) -- throw new ConversionBufferFullException(); -- -- output[charOff++] = outputChar; -- byteOff += inputSize; -- } -- -- return charOff - outOff; -- } --} ---- ./jdk/src/share/classes/sun/io/CharToByteEUC_JP_BSD.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/share/classes/sun/io/CharToByteEUC_JP_BSD.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,193 +0,0 @@ --/* -- * Copyright (c) 2000, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --package sun.io; -- --/** -- * Class for converting characters to bytes for the EUC-JP encoding in -- * bsd. This converter supports the JIS0201 and the JIS0208 encoding and -- * omits support for the JIS212 encoding. -- * -- * @author Naveen Sanjeeva -- */ -- --public class CharToByteEUC_JP_BSD extends CharToByteJIS0208 { -- CharToByteJIS0201 cbJIS0201 = new CharToByteJIS0201(); -- -- public String getCharacterEncoding() { -- return "EUC_JP_BSD"; -- } -- -- protected int convSingleByte(char inputChar, byte[] outputByte) { -- byte b; -- -- if (inputChar == 0) { -- outputByte[0] = (byte)0; -- return 1; -- } -- -- if ((b = cbJIS0201.getNative(inputChar)) == 0) -- return 0; -- -- if (b > 0 && b < 128) { -- outputByte[0] = b; -- return 1; -- } -- outputByte[0] = (byte)0x8E; -- outputByte[1] = b; -- return 2; -- } -- -- protected int getNative(char ch) { -- int offset = index1[((ch & 0xff00) >> 8 )] << 8; -- int r = index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff)); -- if (r != 0) -- return r + 0x8080; -- return r; -- } -- -- /** -- * Converts characters to sequences of bytes. -- * Conversions that result in Exceptions can be restarted by calling -- * convert again, with appropriately modified parameters. -- * @return the characters written to output. -- * @param input char array containing text in Unicode -- * @param inStart offset in input array -- * @param inEnd offset of last byte to be converted -- * @param output byte array to receive conversion result -- * @param outStart starting offset -- * @param outEnd offset of last byte to be written to -- * @throw UnsupportedCharacterException for any character -- * that cannot be converted to the external character set. -- */ -- public int convert(char[] input, int inOff, int inEnd, -- byte[] output, int outOff, int outEnd) -- throws MalformedInputException, UnknownCharacterException, -- ConversionBufferFullException -- { -- char inputChar; // Input character to be converted -- byte[] outputByte; // Output byte written to output -- int inputSize = 0; // Size of input -- int outputSize = 0; // Size of output -- byte[] tmpbuf = new byte[4]; -- -- // Record beginning offsets -- charOff = inOff; -- byteOff = outOff; -- -- if (highHalfZoneCode != 0) { -- inputChar = highHalfZoneCode; -- highHalfZoneCode = 0; -- if (input[inOff] >= 0xdc00 && input[inOff] <= 0xdfff) { -- // This is legal UTF16 sequence. -- badInputLength = 1; -- throw new UnknownCharacterException(); -- } else { -- // This is illegal UTF16 sequence. -- badInputLength = 0; -- throw new MalformedInputException(); -- } -- } -- -- // Loop until we hit the end of the input -- while(charOff < inEnd) { -- inputSize = 1; -- outputByte = tmpbuf; -- inputChar = input[charOff]; // Get the input character -- -- // Is this a high surrogate? -- if(inputChar >= '\uD800' && inputChar <= '\uDBFF') { -- // Is this the last character of the input? -- if (charOff + 1 >= inEnd) { -- highHalfZoneCode = inputChar; -- break; -- } -- -- // Is there a low surrogate following? -- inputChar = input[charOff + 1]; -- if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') { -- // We have a valid surrogate pair. Too bad we don't do -- // surrogates. Is substitution enabled? -- if (subMode) { -- outputByte = subBytes; -- outputSize = subBytes.length; -- inputSize = 2; -- } else { -- badInputLength = 2; -- throw new UnknownCharacterException(); -- } -- } else { -- // We have a malformed surrogate pair -- badInputLength = 1; -- throw new MalformedInputException(); -- } -- } -- // Is this an unaccompanied low surrogate? -- else if (inputChar >= '\uDC00' && inputChar <= '\uDFFF') { -- badInputLength = 1; -- throw new MalformedInputException(); -- } else { -- outputSize = convSingleByte(inputChar, outputByte); -- if (outputSize == 0) { // DoubleByte -- int ncode = getNative(inputChar); -- if (ncode != 0 && ((ncode & 0xFF0000) == 0)) { -- outputByte[0] = (byte) ((ncode & 0xff00) >> 8); -- outputByte[1] = (byte) (ncode & 0xff); -- outputSize = 2; -- } else { -- if (subMode) { -- outputByte = subBytes; -- outputSize = subBytes.length; -- } else { -- badInputLength = 1; -- throw new UnknownCharacterException(); -- } -- } -- } -- } -- -- // If we don't have room for the output, throw an exception -- if (byteOff + outputSize > outEnd) -- throw new ConversionBufferFullException(); -- -- // Put the byte in the output buffer -- for (int i = 0; i < outputSize; i++) { -- output[byteOff++] = outputByte[i]; -- } -- charOff += inputSize; -- } -- // Return the length written to the output buffer -- return byteOff - outOff; -- } -- -- -- /** -- * the maximum number of bytes needed to hold a converted char -- * @returns the maximum number of bytes needed for a converted char -- */ -- public int getMaxBytesPerChar() { -- return 2; -- } --} ---- ./jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_BSD.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_BSD.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,370 +0,0 @@ --/* -- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --/* -- */ -- --package sun.nio.cs.ext; -- --import java.nio.ByteBuffer; --import java.nio.CharBuffer; --import java.nio.charset.Charset; --import java.nio.charset.CharsetDecoder; --import java.nio.charset.CharsetEncoder; --import java.nio.charset.CoderResult; --import sun.nio.cs.HistoricallyNamedCharset; --import sun.nio.cs.Surrogate; -- --public class EUC_JP_BSD -- extends Charset -- implements HistoricallyNamedCharset --{ -- public EUC_JP_BSD() { -- super("x-euc-jp-bsd", ExtendedCharsets.aliasesFor("x-euc-jp-bsd")); -- } -- -- public String historicalName() { -- return "EUC_JP_BSD"; -- } -- -- public boolean contains(Charset cs) { -- return ((cs instanceof JIS_X_0201) -- || (cs.name().equals("US-ASCII")) -- || (cs instanceof EUC_JP_BSD)); -- } -- -- public CharsetDecoder newDecoder() { -- return new Decoder(this); -- } -- -- public CharsetEncoder newEncoder() { -- return new Encoder(this); -- } -- -- private static class Decoder extends CharsetDecoder { -- JIS_X_0201.Decoder decoderJ0201; -- protected final char REPLACE_CHAR='\uFFFD'; -- -- private static final int start = 0xa1; -- private static final int end = 0xfe; -- private static final short[] jis0208Index1 = -- JIS_X_0208_Decoder.getIndex1(); -- private static final String[] jis0208Index2 = -- JIS_X_0208_Decoder.getIndex2(); -- -- private Decoder(Charset cs) { -- super(cs, 1.0f, 1.0f); -- decoderJ0201 = new JIS_X_0201.Decoder(cs); -- } -- -- protected char convSingleByte(int b) { -- if (b < 0 || b > 0x7f) -- return REPLACE_CHAR; -- return decoderJ0201.decode(b); -- } -- -- protected char decodeDouble(int byte1, int byte2) { -- if (byte1 == 0x8e) { -- return decoderJ0201.decode(byte2 - 256); -- } -- -- if (((byte1 < 0) || (byte1 > jis0208Index1.length)) -- || ((byte2 < start) || (byte2 > end))) -- return REPLACE_CHAR; -- -- int n = (jis0208Index1[byte1 - 0x80] & 0xf) * (end - start + 1) -- + (byte2 - start); -- return jis0208Index2[jis0208Index1[byte1 - 0x80] >> 4].charAt(n); -- } -- -- private CoderResult decodeArrayLoop(ByteBuffer src, -- CharBuffer dst) -- { -- byte[] sa = src.array(); -- int sp = src.arrayOffset() + src.position(); -- int sl = src.arrayOffset() + src.limit(); -- assert (sp <= sl); -- sp = (sp <= sl ? sp : sl); -- -- char[] da = dst.array(); -- int dp = dst.arrayOffset() + dst.position(); -- int dl = dst.arrayOffset() + dst.limit(); -- assert (dp <= dl); -- dp = (dp <= dl ? dp : dl); -- -- int b1 = 0, b2 = 0; -- int inputSize = 0; -- char outputChar = REPLACE_CHAR; // U+FFFD; -- -- try { -- while (sp < sl) { -- b1 = sa[sp] & 0xff; -- inputSize = 1; -- if ((b1 & 0x80) == 0) { -- outputChar = (char)b1; -- } -- else { // Multibyte char -- if ((b1 & 0xff) == 0x8f) { // JIS0212 -- if (sp + 3 > sl) -- return CoderResult.UNDERFLOW; -- inputSize = 3; -- return CoderResult.unmappableForLength(inputSize); // substitute -- } else { -- // JIS0208 -- if (sp + 2 > sl) -- return CoderResult.UNDERFLOW; -- b2 = sa[sp + 1] & 0xff; -- inputSize = 2; -- outputChar = decodeDouble(b1, b2); -- } -- } -- if (outputChar == REPLACE_CHAR) { // can't be decoded -- return CoderResult.unmappableForLength(inputSize); -- } -- if (dp + 1 > dl) -- return CoderResult.OVERFLOW; -- da[dp++] = outputChar; -- sp += inputSize; -- } -- return CoderResult.UNDERFLOW; -- } finally { -- src.position(sp - src.arrayOffset()); -- dst.position(dp - dst.arrayOffset()); -- } -- } -- -- private CoderResult decodeBufferLoop(ByteBuffer src, -- CharBuffer dst) -- { -- int mark = src.position(); -- char outputChar = REPLACE_CHAR; // U+FFFD; -- -- try { -- while (src.hasRemaining()) { -- int b1 = src.get() & 0xff; -- int inputSize = 1; -- -- if ((b1 & 0x80) == 0) { -- outputChar = (char)b1; -- } else { // Multibyte char -- -- if ((b1 & 0xff) == 0x8f) { // JIS0212 not supported -- if (src.remaining() < 2) -- return CoderResult.UNDERFLOW; -- return CoderResult.unmappableForLength(3); -- } else { -- // JIS0208 -- if (src.remaining() < 1) -- return CoderResult.UNDERFLOW; -- int b2 = src.get() & 0xff; -- inputSize++; -- outputChar = decodeDouble(b1, b2); -- } -- } -- -- if (outputChar == REPLACE_CHAR) -- return CoderResult.unmappableForLength(inputSize); -- if (dst.remaining() < 1) -- return CoderResult.OVERFLOW; -- dst.put(outputChar); -- mark += inputSize; -- } -- return CoderResult.UNDERFLOW; -- } finally { -- src.position(mark); -- } -- } -- -- protected CoderResult decodeLoop(ByteBuffer src, -- CharBuffer dst) -- { -- if (src.hasArray() && dst.hasArray()) -- return decodeArrayLoop(src, dst); -- else -- return decodeBufferLoop(src, dst); -- } -- } -- -- -- private static class Encoder extends CharsetEncoder { -- -- JIS_X_0201.Encoder encoderJ0201; -- -- private final Surrogate.Parser sgp = new Surrogate.Parser(); -- private static final short[] jis0208Index1 = -- JIS_X_0208_Encoder.getIndex1(); -- private static final String[] jis0208Index2 = -- JIS_X_0208_Encoder.getIndex2(); -- -- private Encoder(Charset cs) { -- super(cs, 2.0f, 2.0f); -- encoderJ0201 = new JIS_X_0201.Encoder(cs); -- } -- -- public boolean canEncode(char c) { -- byte[] encodedBytes = new byte[2]; -- -- if (encodeSingle(c, encodedBytes) == 0) { //doublebyte -- if (encodeDouble(c) == 0) -- return false; -- } -- return true; -- } -- -- protected int encodeSingle(char inputChar, byte[] outputByte) { -- byte b; -- -- if (inputChar == 0) { -- outputByte[0] = (byte)0; -- return 1; -- } -- -- if ((b = encoderJ0201.encode(inputChar)) == 0) -- return 0; -- -- if (b > 0 && b < 128) { -- outputByte[0] = b; -- return 1; -- } -- outputByte[0] = (byte)0x8e; -- outputByte[1] = b; -- return 2; -- } -- -- protected int encodeDouble(char ch) { -- int offset = jis0208Index1[((ch & 0xff00) >> 8 )] << 8; -- int r = jis0208Index2[offset >> 12].charAt((offset & 0xfff) + (ch & 0xff)); -- if (r != 0) -- return r + 0x8080; -- return r; -- } -- -- private CoderResult encodeArrayLoop(CharBuffer src, -- ByteBuffer dst) -- { -- char[] sa = src.array(); -- int sp = src.arrayOffset() + src.position(); -- int sl = src.arrayOffset() + src.limit(); -- assert (sp <= sl); -- sp = (sp <= sl ? sp : sl); -- byte[] da = dst.array(); -- int dp = dst.arrayOffset() + dst.position(); -- int dl = dst.arrayOffset() + dst.limit(); -- assert (dp <= dl); -- dp = (dp <= dl ? dp : dl); -- -- final byte[] outputByte = new byte[2]; -- -- try { -- while (sp < sl) { -- char c = sa[sp]; -- -- if (Character.isSurrogate(c)) { -- if (sgp.parse(c, sa, sp, sl) < 0) -- return sgp.error(); -- return sgp.unmappableResult(); -- } -- -- int outputSize = encodeSingle(c, outputByte); -- if (outputSize == 0) { // DoubleByte -- int ncode = encodeDouble(c); -- if (ncode != 0 && ((ncode & 0xFF0000) == 0)) { -- outputByte[0] = (byte) ((ncode & 0xff00) >> 8); -- outputByte[1] = (byte) (ncode & 0xff); -- outputSize = 2; -- } else { -- return CoderResult.unmappableForLength(1); -- } -- } -- -- if (dl - dp < outputSize) -- return CoderResult.OVERFLOW; -- // Put the byte in the output buffer -- for (int i = 0; i < outputSize; i++) { -- da[dp++] = outputByte[i]; -- } -- sp++; -- } -- return CoderResult.UNDERFLOW; -- } finally { -- src.position(sp - src.arrayOffset()); -- dst.position(dp - dst.arrayOffset()); -- } -- } -- -- private CoderResult encodeBufferLoop(CharBuffer src, -- ByteBuffer dst) -- { -- final byte[] outputByte = new byte[4]; -- int mark = src.position(); -- -- try { -- while (src.hasRemaining()) { -- char c = src.get(); -- if (Character.isSurrogate(c)) { -- if (sgp.parse(c, src) < 0) -- return sgp.error(); -- return sgp.unmappableResult(); -- } -- -- int outputSize = encodeSingle(c, outputByte); -- if (outputSize == 0) { // DoubleByte -- int ncode = encodeDouble(c); -- if (ncode != 0 ) { -- if ((ncode & 0xFF0000) == 0) { -- outputByte[0] = (byte) ((ncode & 0xff00) >> 8); -- outputByte[1] = (byte) (ncode & 0xff); -- outputSize = 2; -- } -- } else { -- return CoderResult.unmappableForLength(1); -- } -- } -- -- if (dst.remaining() < outputSize) -- return CoderResult.OVERFLOW; -- -- // Put the byte in the output buffer -- for (int i = 0; i < outputSize; i++) { -- dst.put(outputByte[i]); -- } -- mark++; -- } -- return CoderResult.UNDERFLOW; -- } finally { -- src.position(mark); -- } -- } -- -- protected CoderResult encodeLoop(CharBuffer src, -- ByteBuffer dst) -- { -- if (src.hasArray() && dst.hasArray()) -- return encodeArrayLoop(src, dst); -- else -- return encodeBufferLoop(src, dst); -- } -- } --} ---- ./jdk/src/share/classes/sun/print/PSPrinterJob.java 2011-11-17 21:59:35.000000000 -0800 -+++ ./jdk/src/share/classes/sun/print/PSPrinterJob.java 2011-04-22 23:08:30.000000000 -0700 -@@ -1534,7 +1534,9 @@ - pFlags |= NOSHEET; - ncomps+=1; +--- jdk/src/share/classes/sun/print/PSPrinterJob.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/print/PSPrinterJob.java 2012-05-17 16:18:00.000000000 -0700 +@@ -1536,7 +1536,7 @@ } -- if (System.getProperty("os.name").equals("Linux")) { -+ -+ String osname = System.getProperty("os.name"); -+ if (osname.equals("Linux") || osname.equals("FreeBSD") || osname.equals("NetBSD") || osname.equals("OpenBSD") || osname.equals("Darwin")) { + + String osname = System.getProperty("os.name"); +- if (osname.equals("Linux") || osname.contains("OS X")) { ++ if (osname.equals("Linux") || osname.equals("FreeBSD") || osname.equals("NetBSD") || osname.equals("OpenBSD") || osname.equals("OS X")) { execCmd = new String[ncomps]; execCmd[n++] = "/usr/bin/lpr"; if ((pFlags & PRINTER) != 0) { ---- ./jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java 2011-11-17 21:59:53.000000000 -0800 -+++ ./jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java 2011-04-22 23:08:31.000000000 -0700 -@@ -83,7 +83,9 @@ +--- jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java 2012-05-20 10:08:29.000000000 -0700 +@@ -83,7 +83,8 @@ String osname = System.getProperty("os.name"); if (osname.startsWith("SunOS")) { gssLibs = new String[]{ "libgss.so" }; - } else if (osname.startsWith("Linux")) { + } else if (osname.startsWith("Linux") || -+ osname.startsWith("Darwin") || -+ osname.endsWith("BSD")) { ++ osname.endsWith("BSD")) { gssLibs = new String[]{ "libgssapi.so", "libgssapi_krb5.so", ---- ./jdk/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider 2011-11-17 22:00:16.000000000 -0800 -+++ ./jdk/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider 2011-04-22 23:08:32.000000000 -0700 -@@ -30,3 +30,4 @@ +--- jdk/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider 2012-05-17 16:18:00.000000000 -0700 +@@ -30,4 +30,5 @@ #[solaris]sun.tools.attach.SolarisAttachProvider #[windows]sun.tools.attach.WindowsAttachProvider #[linux]sun.tools.attach.LinuxAttachProvider +#[bsd]sun.tools.attach.BsdAttachProvider ---- ./jdk/src/share/classes/sun/tools/jar/Main.java 2011-11-17 22:00:16.000000000 -0800 -+++ ./jdk/src/share/classes/sun/tools/jar/Main.java 2011-04-22 23:08:32.000000000 -0700 + #[macosx]sun.tools.attach.BsdAttachProvider +--- jdk/src/share/classes/sun/tools/jar/Main.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/tools/jar/Main.java 2011-04-22 23:08:32.000000000 -0700 @@ -51,6 +51,7 @@ String zname = ""; String[] files; @@ -18515,8 +4736,8 @@ if (!d.exists() && !d.mkdirs() || !d.isDirectory()) { throw new IOException(formatMsg( "error.create.dir", d.getPath())); ---- ./jdk/src/share/classes/sun/tools/jar/resources/jar.properties 2011-11-17 22:00:16.000000000 -0800 -+++ ./jdk/src/share/classes/sun/tools/jar/resources/jar.properties 2011-04-22 23:08:32.000000000 -0700 +--- jdk/src/share/classes/sun/tools/jar/resources/jar.properties 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/classes/sun/tools/jar/resources/jar.properties 2011-04-22 23:08:32.000000000 -0700 @@ -44,6 +44,8 @@ {0} : could not create directory error.incorrect.length=\ @@ -18526,8 +4747,8 @@ out.added.manifest=\ added manifest out.update.manifest=\ ---- ./jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt 2011-11-17 22:00:40.000000000 -0800 -+++ ./jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt 2011-04-22 23:08:34.000000000 -0700 +--- jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt 2011-04-22 23:08:34.000000000 -0700 @@ -38,6 +38,7 @@ # gnumake JDK=<java_home> OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] # gnumake JDK=<java_home> OSNAME=linux [OPT=true] @@ -18566,346 +4787,55 @@ # Common -I options CFLAGS += -I. CFLAGS += -I../agent_util ---- ./jdk/src/share/native/com/sun/java/util/jar/pack/defines.h 2011-11-17 22:00:50.000000000 -0800 -+++ ./jdk/src/share/native/com/sun/java/util/jar/pack/defines.h 2011-04-22 23:08:35.000000000 -0700 -@@ -32,6 +32,10 @@ - #include <unistd.h> - #endif - -+#ifndef NO_ZLIB -+# include <zconf.h> -+#endif -+ - #ifndef FULL - #define FULL 1 /* Adds <500 bytes to the zipped final product. */ - #endif -@@ -89,11 +93,13 @@ +--- jdk/src/share/native/com/sun/java/util/jar/pack/defines.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/com/sun/java/util/jar/pack/defines.h 2012-05-17 16:18:00.000000000 -0700 +@@ -93,7 +93,7 @@ // bytes and byte arrays typedef unsigned int uint; -+#ifdef NO_ZLIB +-#if !defined(MACOSX) || (defined(MACOSX) && defined(NO_ZLIB)) ++#if !defined(_ALLBSD_SOURCE) || (defined(_ALLBSD_SOURCE) && defined(NO_ZLIB)) #ifdef _LP64 typedef unsigned int uLong; // Historical zlib, should be 32-bit. #else - typedef unsigned long uLong; - #endif -+#endif - #ifdef _MSC_VER - typedef LONGLONG jlong; - typedef DWORDLONG julong; ---- ./jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp 2011-11-17 22:00:50.000000000 -0800 -+++ ./jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp 2011-04-22 23:08:35.000000000 -0700 -@@ -22,6 +22,9 @@ - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -+#ifdef _ALLBSD_SOURCE -+#include <stdint.h> -+#endif - #include <sys/types.h> - - #include <stdio.h> -@@ -35,7 +38,7 @@ - - #if defined(unix) && !defined(PRODUCT) - #include "pthread.h" --#define THREAD_SELF ((int)pthread_self()) -+#define THREAD_SELF ((intptr_t) pthread_self()) - #endif - - #include "defines.h" -@@ -58,9 +61,9 @@ - // Single-threaded, implementation, not reentrant. - // Includes a weak error check against MT access. - #ifndef THREAD_SELF --#define THREAD_SELF (0) -+#define THREAD_SELF ((intptr_t) 0) - #endif --NOT_PRODUCT(static int uThread = -1;) -+NOT_PRODUCT(static intptr_t uThread = -1;) - - unpacker* unpacker::non_mt_current = null; - unpacker* unpacker::current() { -@@ -69,7 +72,7 @@ - } - static void set_current_unpacker(unpacker* u) { - unpacker::non_mt_current = u; -- assert(((uThread = (u == null) ? -1 : THREAD_SELF), -+ assert(((uThread = (u == null) ? ((intptr_t) -1) : THREAD_SELF), - true)); - } - ---- ./jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c 2011-11-17 22:00:50.000000000 -0800 -+++ ./jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c 2011-04-22 23:08:35.000000000 -0700 -@@ -33,7 +33,11 @@ - - #include <jni.h> - // for malloc -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - #include "SoundDefs.h" - #include "DirectAudio.h" - #include "Utilities.h" ---- ./jdk/src/share/native/com/sun/media/sound/Platform.c 2011-11-17 22:00:50.000000000 -0800 -+++ ./jdk/src/share/native/com/sun/media/sound/Platform.c 2011-04-22 23:08:35.000000000 -0700 -@@ -99,5 +99,24 @@ - return com_sun_media_sound_Platform_LIB_ALSA; - } - #endif -+#if (X_PLATFORM == X_BSD) -+ switch (feature) { -+ case com_sun_media_sound_Platform_FEATURE_MIDIIO: -+ return com_sun_media_sound_Platform_LIB_MAIN; -+#ifdef __FreeBSD__ -+ case com_sun_media_sound_Platform_FEATURE_PORTS: -+ return com_sun_media_sound_Platform_LIB_ALSA; -+ case com_sun_media_sound_Platform_FEATURE_DIRECT_AUDIO: -+ return com_sun_media_sound_Platform_LIB_ALSA; -+#else -+ case com_sun_media_sound_Platform_FEATURE_PORTS: -+ return com_sun_media_sound_Platform_LIB_MAIN; -+ case com_sun_media_sound_Platform_FEATURE_DIRECT_AUDIO: -+ // XXXBSD: When native Direct Audio support is ported change -+ // this back to returning com_sun_media_sound_Platform_LIB_MAIN -+ return 0; -+#endif -+ } -+#endif - return 0; - } ---- ./jdk/src/share/native/com/sun/media/sound/SoundDefs.h 2011-11-17 22:00:51.000000000 -0800 -+++ ./jdk/src/share/native/com/sun/media/sound/SoundDefs.h 2011-04-22 23:08:35.000000000 -0700 -@@ -31,6 +31,7 @@ - #define X_WINDOWS 1 - #define X_SOLARIS 2 - #define X_LINUX 3 -+#define X_BSD 4 - - // types for X_ARCH - #define X_I586 1 -@@ -52,7 +53,7 @@ +--- jdk/src/share/native/com/sun/media/sound/SoundDefs.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/com/sun/media/sound/SoundDefs.h 2012-05-17 16:18:00.000000000 -0700 +@@ -64,7 +64,7 @@ // following is needed for _LP64 --#if ((X_PLATFORM == X_SOLARIS) || (X_PLATFORM == X_LINUX)) -+#if ((X_PLATFORM == X_SOLARIS) || (X_PLATFORM == X_LINUX) || (X_PLATFORM == X_BSD)) +-#if ((X_PLATFORM == X_SOLARIS) || (X_PLATFORM == X_LINUX) || (X_PLATFORM == X_MACOSX)) ++#if ((X_PLATFORM == X_SOLARIS) || (X_PLATFORM == X_LINUX) || (X_PLATFORM == X_BSD) || (X_PLATFORM == X_MACOSX)) #include <sys/types.h> #endif -@@ -132,4 +133,9 @@ - #endif - - -+#if X_PLATFORM == X_BSD -+#define INLINE inline -+#endif -+ -+ - #endif // __SOUNDDEFS_INCLUDED__ ---- ./jdk/src/share/native/common/check_code.c 2011-11-17 22:00:51.000000000 -0800 -+++ ./jdk/src/share/native/common/check_code.c 2011-04-22 23:08:35.000000000 -0700 -@@ -1067,7 +1067,7 @@ - * Make sure that branches don't go into the middle of nowhere. - */ - --static jint ntohl(jint n) -+static jint _ck_ntohl(jint n) - { - unsigned char *p = (unsigned char *)&n; - return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; -@@ -1146,26 +1146,26 @@ - } - } - if (opcode == JVM_OPC_tableswitch) { -- keys = ntohl(lpc[2]) - ntohl(lpc[1]) + 1; -+ keys = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]) + 1; - delta = 1; - } else { -- keys = ntohl(lpc[1]); /* number of pairs */ -+ keys = _ck_ntohl(lpc[1]); /* number of pairs */ - delta = 2; - /* Make sure that the tableswitch items are sorted */ - for (k = keys - 1, lptr = &lpc[2]; --k >= 0; lptr += 2) { -- int this_key = ntohl(lptr[0]); /* NB: ntohl may be unsigned */ -- int next_key = ntohl(lptr[2]); -+ int this_key = _ck_ntohl(lptr[0]); /* NB: ntohl may be unsigned */ -+ int next_key = _ck_ntohl(lptr[2]); - if (this_key >= next_key) { - CCerror(context, "Unsorted lookup switch"); - } - } - } - saved_operand = NEW(int, keys + 2); -- if (!isLegalTarget(context, offset + ntohl(lpc[0]))) -+ if (!isLegalTarget(context, offset + _ck_ntohl(lpc[0]))) - CCerror(context, "Illegal default target in switch"); -- saved_operand[keys + 1] = code_data[offset + ntohl(lpc[0])]; -+ saved_operand[keys + 1] = code_data[offset + _ck_ntohl(lpc[0])]; - for (k = keys, lptr = &lpc[3]; --k >= 0; lptr += delta) { -- int target = offset + ntohl(lptr[0]); -+ int target = offset + _ck_ntohl(lptr[0]); - if (!isLegalTarget(context, target)) - CCerror(context, "Illegal branch in tableswitch"); - saved_operand[k + 1] = code_data[target]; -@@ -1634,7 +1634,7 @@ - if (lpc + 2 >= (int *)end) { - return -1; /* do not read pass the end */ - } -- index = ntohl(lpc[2]) - ntohl(lpc[1]); -+ index = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]); - if ((index < 0) || (index > 65535)) { - return -1; /* illegal */ - } else { -@@ -1647,7 +1647,7 @@ - int npairs; - if (lpc + 1 >= (int *)end) - return -1; /* do not read pass the end */ -- npairs = ntohl(lpc[1]); -+ npairs = _ck_ntohl(lpc[1]); - /* There can't be more than 64K labels because of the limit - * on per-method byte code length. - */ ---- ./jdk/src/share/native/java/io/io_util.h 2011-11-17 22:00:51.000000000 -0800 -+++ ./jdk/src/share/native/java/io/io_util.h 2011-04-22 23:08:35.000000000 -0700 -@@ -29,7 +29,15 @@ - extern jfieldID IO_fd_fdID; - extern jfieldID IO_handle_fdID; - --#if !defined(O_DSYNC) || !defined(O_SYNC) -+#ifdef _ALLBSD_SOURCE -+#include <fcntl.h> -+#ifndef O_SYNC -+#define O_SYNC O_FSYNC -+#endif -+#ifndef O_DSYNC -+#define O_DSYNC O_FSYNC -+#endif -+#elif !defined(O_DSYNC) || !defined(O_SYNC) - #define O_SYNC (0x0800) - #define O_DSYNC (0x2000) - #endif ---- ./jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h 2011-11-17 22:00:51.000000000 -0800 -+++ ./jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h 2012-02-26 15:38:42.000000000 -0800 -@@ -24,6 +24,15 @@ +--- jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h 2012-05-17 16:18:00.000000000 -0700 +@@ -24,6 +24,9 @@ * questions. */ +#ifdef __OpenBSD__ +#include <sys/types.h> +#endif -+#ifdef _ALLBSD_SOURCE -+#include <machine/endian.h> -+#elif __linux__ -+#define __USE_BSD 1 -+#include <endian.h> -+#endif - #include "jfdlibm.h" - - #ifdef __NEWVALID /* special setup for Sun test regime */ -@@ -34,7 +43,8 @@ + #ifdef _ALLBSD_SOURCE + #include <machine/endian.h> + #elif __linux__ +@@ -32,6 +35,12 @@ #endif - #endif - --#ifdef _LITTLE_ENDIAN -+#if (defined(__solaris__) && defined(_LITTLE_ENDIAN)) || \ -+ BYTE_ORDER == LITTLE_ENDIAN - #define __HI(x) *(1+(int*)&x) - #define __LO(x) *(int*)&x - #define __HIp(x) *(1+(int*)x) ---- ./jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h 2011-11-17 22:00:51.000000000 -0800 -+++ ./jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h 2012-02-26 15:38:42.000000000 -0800 -@@ -61,7 +61,7 @@ - #define log1p jlog1p - #define expm1 jexpm1 - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #define __ieee754_sqrt __j__ieee754_sqrt - #define __ieee754_acos __j__ieee754_acos - #define __ieee754_log __j__ieee754_log ---- ./jdk/src/share/native/java/util/zip/Inflater.c 2011-11-17 22:00:54.000000000 -0800 -+++ ./jdk/src/share/native/java/util/zip/Inflater.c 2011-04-22 23:08:35.000000000 -0700 -@@ -65,6 +65,10 @@ - return jlong_zero; - } else { - char *msg; -+// BSDXXX needed for FreeBSD 5.4 and below with system zlib -+#if defined(__FreeBSD__) && __FreeBSD__ < 6 -+ strm->adler = 1; -+#endif - switch (inflateInit2(strm, nowrap ? -MAX_WBITS : MAX_WBITS)) { - case Z_OK: - return ptr_to_jlong(strm); -@@ -192,6 +196,10 @@ - if (inflateReset(jlong_to_ptr(addr)) != Z_OK) { - JNU_ThrowInternalError(env, 0); - } -+// BSDXXX needed for FreeBSD 5.4 and below with system zlib -+#if defined(__FreeBSD__) && __FreeBSD__ < 6 -+ ((z_stream *)jlong_to_ptr(strm))->adler = 1; -+#endif - } - - JNIEXPORT void JNICALL ---- ./jdk/src/share/native/java/util/zip/zip_util.c 2011-11-17 22:00:55.000000000 -0800 -+++ ./jdk/src/share/native/java/util/zip/zip_util.c 2011-04-22 23:08:35.000000000 -0700 -@@ -46,6 +46,11 @@ - #include "zip_util.h" - #include "zlib.h" + #include "jfdlibm.h" -+#ifdef _ALLBSD_SOURCE -+#define off64_t off_t -+#define mmap64 mmap ++/* BSD's always define both _LITTLE_ENDIAN && _BIG_ENDIAN */ ++#if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN) && \ ++ _BYTE_ORDER == _BIG_ENDIAN ++#undef _LITTLE_ENDIAN +#endif + - /* USE_MMAP means mmap the CEN & ENDHDR part of the zip file. */ - #ifdef USE_MMAP - #include <sys/mman.h> ---- ./jdk/src/share/native/sun/awt/debug/debug_util.h 2011-11-17 22:00:57.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/debug/debug_util.h 2011-04-22 23:08:35.000000000 -0700 -@@ -50,7 +50,9 @@ - #include <stdio.h> - #include <string.h> - #include <assert.h> -+#if !defined(_ALLBSD_SOURCE) - #include <malloc.h> -+#endif - #include <limits.h> - - /* keep these after the other headers */ ---- ./jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c 2011-11-17 22:00:57.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c 2011-04-22 23:08:35.000000000 -0700 -@@ -24,7 +24,11 @@ - */ - - #include "BufImgSurfaceData.h" -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include "malloc.h" -+#endif - - #include "sun_awt_image_BufImgSurfaceData.h" - ---- ./jdk/src/share/native/sun/awt/image/DataBufferNative.c 2011-11-17 22:00:57.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/image/DataBufferNative.c 2011-04-22 23:08:35.000000000 -0700 -@@ -23,7 +23,11 @@ - * questions. - */ - -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include "malloc.h" -+#endif - - #include "SurfaceData.h" - #include "sun_awt_image_DataBufferNative.h" ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c 2011-11-17 22:01:00.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c 2011-04-22 23:08:36.000000000 -0700 + #ifdef __NEWVALID /* special setup for Sun test regime */ + #if defined(i386) || defined(i486) || \ + defined(intel) || defined(x86) || defined(arm) || \ +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c 2011-04-22 23:08:36.000000000 -0700 @@ -86,7 +86,7 @@ #endif /* MLIB_USE_FTOI_CLAMPING */ @@ -18945,8 +4875,8 @@ #endif /* _NO_LONGLONG */ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c 2011-11-17 22:01:00.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c 2011-04-22 23:08:36.000000000 -0700 @@ -126,7 +126,7 @@ #define D2I(x) CLAMP_S32((x) SAT_OFF) @@ -18986,8 +4916,8 @@ #endif /* _NO_LONGLONG */ /***************************************************************/ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c 2011-11-17 22:01:00.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c 2011-04-22 23:08:36.000000000 -0700 @@ -94,7 +94,7 @@ #define D2I(x) CLAMP_S32((x) SAT_OFF) @@ -19027,8 +4957,8 @@ #endif /* _NO_LONGLONG */ /***************************************************************/ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c 2011-11-17 22:01:00.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c 2011-04-22 23:08:36.000000000 -0700 @@ -126,7 +126,7 @@ #define D2I(x) CLAMP_S32((x) SAT_OFF) @@ -19068,8 +4998,8 @@ #endif /* _NO_LONGLONG */ /***************************************************************/ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c 2011-11-17 22:01:00.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c 2011-04-22 23:08:36.000000000 -0700 @@ -95,7 +95,7 @@ #define D2I(x) CLAMP_S32((x) SAT_OFF) @@ -19109,8 +5039,8 @@ #endif /* _NO_LONGLONG */ /***************************************************************/ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c 2011-11-17 22:01:01.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c 2011-04-22 23:08:36.000000000 -0700 @@ -126,7 +126,7 @@ #define D2I(x) CLAMP_S32((x) SAT_OFF) @@ -19150,8 +5080,8 @@ #endif /* _NO_LONGLONG */ /***************************************************************/ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c 2011-11-17 22:01:01.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c 2011-04-22 23:08:36.000000000 -0700 @@ -94,7 +94,7 @@ #define D2I(x) CLAMP_S32((x) SAT_OFF) @@ -19191,8 +5121,8 @@ #endif /* _NO_LONGLONG */ /***************************************************************/ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c 2011-11-17 22:01:01.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c 2011-04-22 23:08:36.000000000 -0700 @@ -95,7 +95,7 @@ dst = dp[0]; if (ld_offset + size < 32) { @@ -19412,8 +5342,8 @@ } #else /* _LONGLONG */ ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c 2011-11-17 22:01:01.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c 2011-04-22 23:08:36.000000000 -0700 @@ -168,7 +168,7 @@ } @@ -19694,8 +5624,8 @@ dp[12] = t0; dp[13] = t1; dp[14] = t2; ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c 2011-11-17 22:01:01.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c 2011-04-22 23:08:36.000000000 -0700 @@ -88,7 +88,7 @@ } d64_2_f32; @@ -19847,8 +5777,8 @@ ((mlib_u32*)lh)[0] = l; ((mlib_u32*)lh)[1] = l; ((mlib_u32*)lh)[2] = l; ((mlib_u32*)lh)[3] = h; ---- ./jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c 2011-11-17 22:01:01.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c 2011-04-22 23:08:36.000000000 -0700 @@ -30,7 +30,7 @@ typedef union { mlib_d64 db; @@ -19858,8 +5788,8 @@ mlib_s32 int1, int0; #else mlib_s32 int0, int1; ---- ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c 2011-11-17 22:01:02.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c 2011-04-22 23:08:36.000000000 -0700 @@ -275,11 +275,11 @@ for (i = 0; j <= (b_size - 4); j += 4, i++) { src0 = src1; @@ -19958,8 +5888,8 @@ s0 = s1; dp += SIZE; sp += SIZE; ---- ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c 2011-11-17 22:01:02.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c 2011-04-22 23:08:36.000000000 -0700 +--- jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c 2011-04-22 23:08:36.000000000 -0700 @@ -120,7 +120,7 @@ } \ } @@ -21192,373 +7122,79 @@ dp[12] = t0; dp[13] = t1; dp[14] = t2; ---- ./jdk/src/share/native/sun/awt/medialib/mlib_image.h 2011-11-17 22:01:02.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_image.h 2011-04-22 23:08:36.000000000 -0700 -@@ -27,6 +27,16 @@ +--- jdk/src/share/native/sun/awt/medialib/mlib_image.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_image.h 2012-05-17 16:18:01.000000000 -0700 +@@ -27,9 +27,21 @@ #ifndef MLIB_IMAGE_H #define MLIB_IMAGE_H +-#ifdef MACOSX +#ifdef __OpenBSD__ +#include <sys/types.h> +#endif ++ +#ifdef _ALLBSD_SOURCE -+#include <machine/endian.h> -+#elif __linux__ -+#define __USE_BSD 1 -+#include <endian.h> -+#endif + #include <machine/endian.h> ++ ++/* BSD's always define both _LITTLE_ENDIAN && _BIG_ENDIAN */ ++#if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN) && \ ++ _BYTE_ORDER == _BIG_ENDIAN ++#undef _LITTLE_ENDIAN + #endif ++ ++#endif /* _ALLBSD_SOURCE */ + #include <mlib_types.h> #include <mlib_status.h> #include <mlib_sys.h> ---- ./jdk/src/share/native/sun/awt/medialib/mlib_sys.c 2011-11-17 22:01:02.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_sys.c 2011-04-22 23:08:36.000000000 -0700 -@@ -26,9 +26,15 @@ +--- jdk/src/share/native/sun/awt/medialib/mlib_sys.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_sys.c 2012-05-17 16:18:01.000000000 -0700 +@@ -26,7 +26,7 @@ #include <stdlib.h> #include <string.h> +-#ifdef MACOSX +#ifdef _ALLBSD_SOURCE -+#include <unistd.h> -+#endif - #include <mlib_types.h> - #include <mlib_sys_proto.h> - #include "mlib_SysMath.h" -+#if defined(_ALLBSD_SOURCE) -+#include <sys/param.h> -+#endif - - /***************************************************************/ - -@@ -86,7 +92,12 @@ + #include <unistd.h> + #include <sys/param.h> + #endif +@@ -90,7 +90,10 @@ * alignment. -- from stdlib.h of MS VC++5.0. */ return (void *) malloc(size); --#else /* _MSC_VER */ +-#elif defined(MACOSX) +#elif defined(__FreeBSD__) && (__FreeBSD_version >= 700013) + void *ret; + return posix_memalign(&ret, 8, size) ? NULL : ret; +#elif defined(_ALLBSD_SOURCE) -+ return valloc(size); -+#else + return valloc(size); + #else return (void *) memalign(8, size); - #endif /* _MSC_VER */ - } ---- ./jdk/src/share/native/sun/awt/medialib/mlib_types.h 2011-11-17 22:01:02.000000000 -0800 -+++ ./jdk/src/share/native/sun/awt/medialib/mlib_types.h 2011-04-22 23:08:36.000000000 -0700 -@@ -59,7 +59,10 @@ +--- jdk/src/share/native/sun/awt/medialib/mlib_types.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/awt/medialib/mlib_types.h 2012-05-17 16:18:01.000000000 -0700 +@@ -59,7 +59,7 @@ #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__) --#if defined(__linux__) +-#if defined(MACOSX) +#if defined(_ALLBSD_SOURCE) -+#include <stddef.h> /* for ptrdiff_t */ -+#include <stdint.h> /* for uintptr_t */ -+#elif defined(__linux__) + #include <stddef.h> /* for ptrdiff_t */ #include <stdint.h> /* for uintptr_t */ - #include <malloc.h> /* for ptrdiff_t */ - #else ---- ./jdk/src/share/native/sun/font/AccelGlyphCache.c 2011-11-17 22:01:02.000000000 -0800 -+++ ./jdk/src/share/native/sun/font/AccelGlyphCache.c 2011-04-22 23:08:36.000000000 -0700 -@@ -23,7 +23,11 @@ - * questions. - */ - -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - #include "jni.h" - #include "AccelGlyphCache.h" - #include "Trace.h" ---- ./jdk/src/share/native/sun/font/DrawGlyphList.c 2011-11-17 22:01:03.000000000 -0800 -+++ ./jdk/src/share/native/sun/font/DrawGlyphList.c 2011-04-22 23:08:36.000000000 -0700 -@@ -26,7 +26,11 @@ - #include "jlong.h" - #include "math.h" - #include "string.h" -+#ifdef _ALLBSD_SOURCE -+#include "stdlib.h" -+#else - #include "malloc.h" -+#endif - #include "sunfontids.h" - #include "fontscalerdefs.h" - #include "glyphblitting.h" ---- ./jdk/src/share/native/sun/font/sunFont.c 2011-11-17 22:01:06.000000000 -0800 -+++ ./jdk/src/share/native/sun/font/sunFont.c 2011-04-22 23:08:36.000000000 -0700 -@@ -24,7 +24,9 @@ - */ - - #include "stdlib.h" -+#ifndef _ALLBSD_SOURCE - #include "malloc.h" -+#endif - #include "string.h" - #include "gdefs.h" - #include "jlong.h" ---- ./jdk/src/share/native/sun/java2d/SurfaceData.c 2011-11-17 22:01:07.000000000 -0800 -+++ ./jdk/src/share/native/sun/java2d/SurfaceData.c 2011-04-22 23:08:36.000000000 -0700 -@@ -28,7 +28,11 @@ - #include "jni_util.h" - #include "Disposer.h" - -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include "malloc.h" -+#endif - #include "string.h" - - /** ---- ./jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h 2011-11-17 22:01:09.000000000 -0800 -+++ ./jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h 2011-04-22 23:08:36.000000000 -0700 -@@ -26,6 +26,9 @@ + #elif defined(__linux__) +--- jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h 2012-05-17 16:18:01.000000000 -0700 +@@ -26,7 +26,7 @@ #ifndef OGLFuncs_h_Included #define OGLFuncs_h_Included +-#ifdef MACOSX +#ifdef _ALLBSD_SOURCE -+#include <dlfcn.h> -+#endif - #include "jni.h" - #include "J2D_GL/gl.h" - #include "J2D_GL/glext.h" ---- ./jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c 2011-11-17 22:01:10.000000000 -0800 -+++ ./jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c 2011-04-22 23:08:36.000000000 -0700 -@@ -25,7 +25,11 @@ - - #ifndef HEADLESS - -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - - #include "sun_java2d_pipe_BufferedOpCodes.h" - ---- ./jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c 2011-11-17 22:01:10.000000000 -0800 -+++ ./jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c 2011-04-22 23:08:36.000000000 -0700 -@@ -25,7 +25,11 @@ - - #ifndef HEADLESS - -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - #include <math.h> - #include <jlong.h> - ---- ./jdk/src/share/native/sun/nio/ch/genSocketOptionRegistry.c 2011-11-17 22:01:11.000000000 -0800 -+++ ./jdk/src/share/native/sun/nio/ch/genSocketOptionRegistry.c 2011-05-20 20:04:18.000000000 -0700 -@@ -28,6 +28,7 @@ - #include <winsock2.h> - #include <ws2tcpip.h> - #else -+#include <sys/types.h> - #include <sys/socket.h> - #include <netinet/in.h> - #include <netinet/tcp.h> ---- ./jdk/src/share/native/sun/security/ec/impl/ecc_impl.h 2011-11-17 22:01:12.000000000 -0800 -+++ ./jdk/src/share/native/sun/security/ec/impl/ecc_impl.h 2011-06-07 20:03:04.000000000 -0700 -@@ -57,6 +57,14 @@ - typedef enum { B_FALSE, B_TRUE } boolean_t; - #endif /* __linux__ */ - -+#ifdef _ALLBSD_SOURCE -+#include <stdint.h> -+#define B_FALSE FALSE -+#define B_TRUE TRUE -+typedef unsigned long ulong_t; -+typedef enum boolean { B_FALSE, B_TRUE } boolean_t; -+#endif /* _ALLBSD_SOURCE */ -+ - #ifdef _WIN32 - typedef unsigned char uint8_t; - typedef unsigned long ulong_t; ---- ./jdk/src/share/native/sun/security/ec/impl/ecdecode.c 2011-11-17 22:01:12.000000000 -0800 -+++ ./jdk/src/share/native/sun/security/ec/impl/ecdecode.c 2011-06-07 20:03:04.000000000 -0700 -@@ -39,9 +39,9 @@ - #include <sys/types.h> - - #ifndef _WIN32 --#ifndef __linux__ -+#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) - #include <sys/systm.h> --#endif /* __linux__ */ -+#endif /* __linux__ || _ALLBSD_SOURCE */ - #include <sys/param.h> - #endif /* _WIN32 */ - ---- ./jdk/src/share/native/sun/security/ec/impl/oid.c 2011-11-17 22:01:13.000000000 -0800 -+++ ./jdk/src/share/native/sun/security/ec/impl/oid.c 2011-06-07 20:03:04.000000000 -0700 -@@ -38,9 +38,9 @@ - #include <sys/types.h> - - #ifndef _WIN32 --#ifndef __linux__ -+#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) - #include <sys/systm.h> --#endif /* __linux__ */ -+#endif /* __linux__ || _ALLBSD_SOURCE */ - #include <sys/param.h> - #endif /* _WIN32 */ - ---- ./jdk/src/share/native/sun/security/ec/impl/secitem.c 2011-11-17 22:01:13.000000000 -0800 -+++ ./jdk/src/share/native/sun/security/ec/impl/secitem.c 2011-06-07 20:03:04.000000000 -0700 -@@ -43,9 +43,9 @@ - #include <sys/types.h> - - #ifndef _WIN32 --#ifndef __linux__ -+#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) - #include <sys/systm.h> --#endif /* __linux__ */ -+#endif /* __linux__ || _ALLBSD_SOURCE */ - #include <sys/param.h> - #endif /* _WIN32 */ - ---- ./jdk/src/share/transport/socket/socketTransport.c 2011-11-17 22:01:19.000000000 -0800 -+++ ./jdk/src/share/transport/socket/socketTransport.c 2012-02-12 13:05:35.000000000 -0800 -@@ -65,6 +65,9 @@ - #define HEADER_SIZE 11 - #define MAX_DATA_SIZE 1000 - -+static jint recv_fully(int, char *, int); -+static jint send_fully(int, char *, int); -+ - /* - * Record the last error for this thread. - */ -@@ -155,7 +158,7 @@ - } - buf = b; - buf += received; -- n = dbgsysRecv(fd, buf, helloLen-received, 0); -+ n = recv_fully(fd, buf, helloLen-received); - if (n == 0) { - setLastError(0, "handshake failed - connection prematurally closed"); - return JDWPTRANSPORT_ERROR_IO_ERROR; -@@ -180,7 +183,7 @@ - return JDWPTRANSPORT_ERROR_IO_ERROR; - } - -- if (dbgsysSend(fd, (char*)hello, helloLen, 0) != helloLen) { -+ if (send_fully(fd, (char*)hello, helloLen) != helloLen) { - RETURN_IO_ERROR("send failed during handshake"); - } - return JDWPTRANSPORT_ERROR_NONE; -@@ -555,19 +558,19 @@ - /* Do one send for short packets, two for longer ones */ - if (data_len <= MAX_DATA_SIZE) { - memcpy(header + HEADER_SIZE, data, data_len); -- if (dbgsysSend(socketFD, (char *)&header, HEADER_SIZE + data_len, 0) != -+ if (send_fully(socketFD, (char *)&header, HEADER_SIZE + data_len) != - HEADER_SIZE + data_len) { - RETURN_IO_ERROR("send failed"); - } - } else { - memcpy(header + HEADER_SIZE, data, MAX_DATA_SIZE); -- if (dbgsysSend(socketFD, (char *)&header, HEADER_SIZE + MAX_DATA_SIZE, 0) != -+ if (send_fully(socketFD, (char *)&header, HEADER_SIZE + MAX_DATA_SIZE) != - HEADER_SIZE + MAX_DATA_SIZE) { - RETURN_IO_ERROR("send failed"); - } - /* Send the remaining data bytes right out of the data area. */ -- if (dbgsysSend(socketFD, (char *)data + MAX_DATA_SIZE, -- data_len - MAX_DATA_SIZE, 0) != data_len - MAX_DATA_SIZE) { -+ if (send_fully(socketFD, (char *)data + MAX_DATA_SIZE, -+ data_len - MAX_DATA_SIZE) != data_len - MAX_DATA_SIZE) { - RETURN_IO_ERROR("send failed"); - } - } -@@ -575,7 +578,7 @@ - return JDWPTRANSPORT_ERROR_NONE; - } - --static jint -+jint - recv_fully(int f, char *buf, int len) - { - int nbytes = 0; -@@ -591,6 +594,22 @@ - return nbytes; - } - -+jint -+send_fully(int f, char *buf, int len) -+{ -+ int nbytes = 0; -+ while (nbytes < len) { -+ int res = dbgsysSend(f, buf + nbytes, len - nbytes, 0); -+ if (res < 0) { -+ return res; -+ } else if (res == 0) { -+ break; /* eof, return nbytes which is less than len */ -+ } -+ nbytes += res; -+ } -+ return nbytes; -+} -+ - static jdwpTransportError JNICALL - socketTransport_readPacket(jdwpTransportEnv* env, jdwpPacket* packet) { - jint length, data_len; ---- ./jdk/src/solaris/back/exec_md.c 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/back/exec_md.c 2011-04-22 23:08:37.000000000 -0700 -@@ -30,7 +30,7 @@ - #include "sys.h" - #include "util.h" - --#ifdef LINUX -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - /* Linux */ - #define FORK() fork() - #else ---- ./jdk/src/solaris/back/linker_md.c 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/back/linker_md.c 2011-04-22 23:08:37.000000000 -0700 -@@ -48,6 +48,12 @@ - #include "threads_md.h" + #include <dlfcn.h> #endif - -+#ifdef __APPLE__ -+#define LIB_SUFFIX "dylib" -+#else -+#define LIB_SUFFIX "so" -+#endif -+ - /* - * create a string for the JNI native function name by adding the - * appropriate decorations. -@@ -77,9 +83,9 @@ - } - - if (pnamelen == 0) { -- (void)snprintf(holder, holderlen, "lib%s.so", fname); -+ (void)snprintf(holder, holderlen, "lib%s." LIB_SUFFIX, fname); - } else { -- (void)snprintf(holder, holderlen, "%s/lib%s.so", pname, fname); -+ (void)snprintf(holder, holderlen, "%s/lib%s." LIB_SUFFIX, pname, fname); - } - } - ---- ./jdk/src/solaris/back/util_md.h 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/back/util_md.h 2011-04-22 23:08:37.000000000 -0700 -@@ -31,6 +31,11 @@ - - #include <limits.h> - #include <sys/types.h> -+#ifdef _ALLBSD_SOURCE -+#include <machine/endian.h> -+#elif __linux__ -+#include <endian.h> -+#endif - - #ifdef _LP64 - typedef unsigned long UNSIGNED_JLONG; -@@ -46,7 +51,7 @@ + #include "jni.h" +--- jdk/src/solaris/back/util_md.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/back/util_md.h 2012-05-17 16:14:59.000000000 -0700 +@@ -51,7 +51,7 @@ /* On little endian machines, convert java big endian numbers. */ @@ -21567,17 +7203,14 @@ #define HOST_TO_JAVA_CHAR(x) (((x & 0xff) << 8) | ((x >> 8) & (0xff))) #define HOST_TO_JAVA_SHORT(x) (((x & 0xff) << 8) | ((x >> 8) & (0xff))) ---- ./jdk/src/solaris/bin/ergo.c 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/bin/ergo.c 2011-04-22 23:08:37.000000000 -0700 -@@ -100,14 +100,39 @@ +--- jdk/src/solaris/bin/ergo.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/bin/ergo.c 2012-05-20 12:17:44.000000000 -0700 +@@ -100,6 +100,27 @@ /* Compute physical memory by asking the OS */ uint64_t physical_memory(void) { ++#if !defined(MACOSX) && defined(_ALLBSD_SOURCE) + uint64_t result; -+ -+# define UINT64_FORMAT "%" PRIu64 -+ -+#if defined(_ALLBSD_SOURCE) +#ifdef HW_PHYSMEM64 + int64_t physmem; + int name[2] = { CTL_HW, HW_PHYSMEM64 }; @@ -21586,33 +7219,28 @@ + int name[2] = { CTL_HW, HW_PHYSMEM }; +#endif + size_t physmem_len = sizeof(physmem); ++# define UINT64_FORMAT "%" PRIu64 + + if (sysctl(name, 2, &physmem, &physmem_len, NULL, 0) == -1) -+ physmem = 256 * MB; ++ physmem = 256 * MB; + + result = (uint64_t)physmem; + + JLI_TraceLauncher("physical memory: " UINT64_FORMAT " (%.3fGB)\n", + result, result / (double) GB); + return result; -+ +#else /* !_ALLBSD_SOURCE */ -+ const uint64_t pages = (uint64_t) sysconf(_SC_PHYS_PAGES); const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE); -- const uint64_t result = pages * page_size; --# define UINT64_FORMAT "%" PRIu64 -+ result = pages * page_size; - - JLI_TraceLauncher("pages: " UINT64_FORMAT - " page_size: " UINT64_FORMAT + const uint64_t result = pages * page_size; +@@ -110,4 +131,5 @@ " physical memory: " UINT64_FORMAT " (%.3fGB)\n", pages, page_size, result, result / (double) GB); return result; -+#endif /* _ALLBSD_SOURCE */ ++#endif } ---- ./jdk/src/solaris/bin/ergo.h 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/bin/ergo.h 2011-04-22 23:08:37.000000000 -0700 +--- jdk/src/solaris/bin/ergo.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/bin/ergo.h 2012-05-17 16:14:59.000000000 -0700 @@ -33,6 +33,10 @@ #include <sys/stat.h> #include <unistd.h> @@ -21624,268 +7252,130 @@ #include "java.h" ---- ./jdk/src/solaris/bin/ergo_i586.c 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/bin/ergo_i586.c 2011-04-22 23:08:37.000000000 -0700 +--- jdk/src/solaris/bin/ergo_i586.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/bin/ergo_i586.c 2012-05-20 12:18:55.000000000 -0700 @@ -106,7 +106,7 @@ #endif /* __solaris__ */ -#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) ++#if !defined(MACOSX) && (defined(__linux__) || defined(_ALLBSD_SOURCE)) /* * A utility method for asking the CPU about itself. -@@ -170,7 +170,9 @@ - *edxp = value_of_edx; +@@ -171,6 +171,12 @@ #endif /* _LP64 */ } -+#endif /* __linux__ || _ALLBSD_SOURCE */ +#ifdef __linux__ ++#define OSNAMEPREFIX "linux_" ++#else ++#define OSNAMEPREFIX "bsd_" ++#endif ++ /* The definition of a server-class machine for linux-i586 */ jboolean ServerClassMachineImpl(void) { -@@ -199,6 +201,37 @@ +@@ -193,11 +199,11 @@ + result = JNI_TRUE; + } + } +- JLI_TraceLauncher("linux_" LIBARCHNAME "_ServerClassMachine: %s\n", ++ JLI_TraceLauncher(OSNAMEPREFIX LIBARCHNAME "_ServerClassMachine: %s\n", + (result == JNI_TRUE ? "true" : "false")); + return result; } - #endif /* __linux__ */ +-#endif /* __linux__ */ ++#endif /* !MACOSX && (__linux__ || _ALLBSD_SOURCE) */ -+#if defined(_ALLBSD_SOURCE) -+ -+/* The definition of a server-class machine for bsd-i586 */ -+jboolean -+ServerClassMachineImpl(void) { -+ jboolean result = JNI_FALSE; -+ /* How big is a server class machine? */ -+ const unsigned long server_processors = 2UL; -+ const uint64_t server_memory = 2UL * GB; -+ /* -+ * We seem not to get our full complement of memory. -+ * We allow some part (1/8?) of the memory to be "missing", -+ * based on the sizes of DIMMs, and maybe graphics cards. -+ */ -+ const uint64_t missing_memory = 256UL * MB; -+ const uint64_t actual_memory = physical_memory(); -+ -+ /* Is this a server class machine? */ -+ if (actual_memory >= (server_memory - missing_memory)) { -+ const unsigned long actual_processors = physical_processors(); -+ if (actual_processors >= server_processors) { -+ result = JNI_TRUE; -+ } -+ } -+ JLI_TraceLauncher("bsd_" LIBARCHNAME "_ServerClassMachine: %s\n", -+ (result == JNI_TRUE ? "true" : "false")); -+ return result; -+} -+ -+#endif /* _ALLBSD_SOURCE */ -+ /* * Routines shared by solaris-i586 and linux-i586. - */ -@@ -308,6 +341,14 @@ +@@ -308,6 +314,15 @@ /* Compute the number of physical processors, not logical processors */ static unsigned long physical_processors(void) { -+#if defined(_ALLBSD_SOURCE) ++#if !defined(MACOSX) && defined(_ALLBSD_SOURCE) + unsigned long result; + int name[2] = { CTL_HW, HW_NCPU }; + size_t rlen = sizeof(result); + + if (sysctl(name, 2, &result, &rlen, NULL, 0) == -1) -+ result = 1; -+#else /* !_ALLBSD_SOURCE */ ++ result = 1; ++ return result; ++#else const long sys_processors = sysconf(_SC_NPROCESSORS_CONF); unsigned long result = sys_processors; -@@ -318,6 +359,7 @@ - result = (unsigned long) sys_processors / logical_processors; - } +@@ -320,4 +335,5 @@ } -+#endif /* _ALLBSD_SOURCE */ JLI_TraceLauncher("physical processors: %lu\n", result); return result; - } ---- ./jdk/src/solaris/bin/java_md.c 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/bin/java_md.c 2011-05-07 21:54:10.000000000 -0700 -@@ -24,6 +24,7 @@ - */ - - #include "java.h" -+#include "jvm_md.h" - #include <dirent.h> - #include <dlfcn.h> - #include <fcntl.h> -@@ -34,17 +35,30 @@ - #include <sys/stat.h> - #include <unistd.h> - #include <sys/types.h> -+#if defined(_ALLBSD_SOURCE) -+#include <sys/time.h> -+#endif -+ - #include "manifest_info.h" - #include "version_comp.h" - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #include <pthread.h> - #else - #include <thread.h> - #endif - -+#ifdef __APPLE__ -+#define JVM_DLL "libjvm.dylib" -+#define JAVA_DLL "libjava.dylib" -+/* FALLBACK avoids naming conflicts with system libraries -+ * (eg, ImageIO's libJPEG.dylib) */ -+#define LD_LIBRARY_PATH "DYLD_FALLBACK_LIBRARY_PATH" -+#else - #define JVM_DLL "libjvm.so" - #define JAVA_DLL "libjava.so" -+#define LD_LIBRARY_PATH "LD_LIBRARY_PATH" -+#endif - - /* help jettison the LD_LIBRARY_PATH settings in the future */ - #ifndef SETENV_REQUIRED -@@ -75,14 +89,31 @@ - #endif - - /* pointer to environment */ -+#ifdef __APPLE__ -+#include <crt_externs.h> -+#define environ (*_NSGetEnviron()) -+#else - extern char **environ; +#endif - - /* - * A collection of useful strings. One should think of these as #define - * entries, but actual strings can be more efficient (with many compilers). - */ --#ifdef __linux__ --static const char *system_dir = "/usr/java"; -+#if defined(__FreeBSD__) -+static const char *system_dir = PACKAGE_PATH "/openjdk7"; -+static const char *user_dir = "/java"; -+#elif defined(__NetBSD__) -+static const char *system_dir = PACKAGE_PATH "/openjdk7"; -+static const char *user_dir = "/java"; -+#elif defined(__OpenBSD__) -+static const char *system_dir = PACKAGE_PATH "/openjdk7"; -+static const char *user_dir = "/java"; -+#elif defined(__APPLE__) -+static const char *system_dir = PACKAGE_PATH "/openjdk7"; -+static const char *user_dir = "/java"; -+#elif defined(__linux__) -+static const char *system_dir = PACKAGE_PATH "/java"; - static const char *user_dir = "/java"; - #else /* Solaris */ - static const char *system_dir = "/usr/jdk"; -@@ -1397,9 +1428,23 @@ - return(borrowed_unsetenv(name)); + } +--- jdk/src/solaris/bin/java_md_solinux.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/bin/java_md_solinux.c 2012-05-17 16:18:01.000000000 -0700 +@@ -951,6 +951,19 @@ + return exec_path; } -+#if defined(_ALLBSD_SOURCE) ++#if !defined(MACOSX) && defined(_ALLBSD_SOURCE) +/* + * BSD's implementation of CounterGet() + */ +int64_t +CounterGet() +{ -+ struct timeval tv; -+ gettimeofday(&tv, NULL); -+ return (tv.tv_sec * 1000) + tv.tv_usec; ++ struct timeval tv; ++ gettimeofday(&tv, NULL); ++ return (tv.tv_sec * 1000) + tv.tv_usec; +} +#endif + -+ /* --- Splash Screen shared library support --- */ - --static const char* SPLASHSCREEN_SO = "libsplashscreen.so"; -+static const char* SPLASHSCREEN_SO = JNI_LIB_NAME("splashscreen"); - + static const char* SPLASHSCREEN_SO = JNI_LIB_NAME("splashscreen"); static void* hSplashLib = NULL; - -@@ -1435,7 +1480,7 @@ +@@ -982,7 +995,7 @@ int ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { int rslt; -#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) ++#if !defined(MACOSX) && (defined(__linux__) || defined(_ALLBSD_SOURCE)) pthread_t tid; pthread_attr_t attr; pthread_attr_init(&attr); ---- ./jdk/src/solaris/bin/java_md.h 2011-11-17 22:01:20.000000000 -0800 -+++ ./jdk/src/solaris/bin/java_md.h 2011-04-22 23:08:37.000000000 -0700 -@@ -47,10 +47,14 @@ +--- jdk/src/solaris/bin/java_md_solinux.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/bin/java_md_solinux.h 2012-05-20 10:43:26.000000000 -0700 +@@ -33,6 +33,10 @@ #include <sys/time.h> #define CounterGet() (gethrtime()/1000) #define Counter2Micros(counts) (counts) -+#elif defined(_ALLBSD_SOURCE) -+/* CounterGet() is implemented in java_md.c */ ++#elif !defined(MACOSX) && defined(_ALLBSD_SOURCE) ++/* CounterGet() is implemented in java_md_solinux.c */ +int64_t CounterGet(void); +#define Counter2Micros(counts) (counts) - #else + #else /* ! HAVE_GETHRTIME */ #define CounterGet() (0) #define Counter2Micros(counts) (1) --#endif /* HAVE_GETHRTIME */ -+#endif /* HAVE_GETHRTIME || _ALLBSD_SOURCE */ - - /* - * Function prototypes. ---- ./jdk/src/solaris/classes/sun/awt/X11/XWM.java 2011-11-17 22:01:23.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/awt/X11/XWM.java 2011-04-22 23:08:38.000000000 -0700 -@@ -101,7 +101,8 @@ - ICE_WM = 10, - METACITY_WM = 11, - COMPIZ_WM = 12, -- LG3D_WM = 13; -+ LG3D_WM = 13, -+ CWM_WM = 14; - public String toString() { - switch (WMID) { - case NO_WM: -@@ -128,6 +129,8 @@ - return "Compiz"; - case LG3D_WM: - return "LookingGlass"; -+ case CWM_WM: -+ return "CWM"; - case UNDETERMINED_WM: - default: - return "Undetermined WM"; -@@ -555,6 +558,10 @@ - return isNetWMName("LG3D"); - } - -+ static boolean isCWM() { -+ return isNetWMName("CWM"); -+ } -+ - /* - * Is Metacity running? - */ -@@ -567,7 +574,7 @@ - } - - static boolean isNonReparentingWM() { -- return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM); -+ return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM); - } +@@ -48,13 +52,16 @@ + #ifdef __linux__ + static const char *system_dir = "/usr/java"; + static const char *user_dir = "/java"; ++#elif !defined(MACOSX) && defined(_ALLBSD_SOURCE) ++static const char *system_dir = PACKAGE_PATH "/openjdk7"; ++static const char *user_dir = "/java"; + #else /* Solaris */ + static const char *system_dir = "/usr/jdk"; + static const char *user_dir = "/jdk"; + #endif - /* -@@ -743,6 +750,8 @@ - awt_wmgr = XWM.COMPIZ_WM; - } else if (isLookingGlass()) { - awt_wmgr = LG3D_WM; -+ } else if (isCWM()) { -+ awt_wmgr = CWM_WM; - } else if (doIsIceWM && isIceWM()) { - awt_wmgr = XWM.ICE_WM; - } ---- ./jdk/src/solaris/classes/sun/awt/X11FontManager.java 2011-11-17 22:01:24.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/awt/X11FontManager.java 2011-04-22 23:08:38.000000000 -0700 + #include <dlfcn.h> +-#ifdef __linux__ ++#if defined(__linux__) || defined(_ALLBSD_SOURCE) + #include <pthread.h> + #else + #include <thread.h> +--- jdk/src/solaris/classes/sun/awt/X11FontManager.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/classes/sun/awt/X11FontManager.java 2011-04-22 23:08:38.000000000 -0700 @@ -213,7 +213,7 @@ if (fontID != null) { fileName = (String)fontNameMap.get(fontID); @@ -21913,3153 +7403,44 @@ (!mFontConfig.foundOsSpecificFile() || !mFontConfig.fontFilesArePresent()) || (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent()))) { ---- ./jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.Fedora.properties 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.Fedora.properties 1969-12-31 16:00:00.000000000 -0800 -@@ -1,377 +0,0 @@ --# --# --# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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. Oracle designates this --# particular file as subject to the "Classpath" exception as provided --# by Oracle in the LICENSE file that accompanied this code. --# --# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA --# or visit www.oracle.com if you need additional information or have any --# questions. --# -- --# Version -- --# Uses Fedora 9 fonts and file paths. --version=1 -- --# Component Font Mappings -- --dialog.plain.latin-1=DejaVu Sans --dialog.plain.japanese-x0208=Sazanami Gothic --dialog.plain.korean=Baekmuk Gulim --dialog.plain.chinese-big5=AR PL ShanHeiSun Uni --dialog.plain.chinese-gb18030=AR PL ShanHeiSun Uni --dialog.plain.bengali=Lohit Bengali --dialog.plain.gujarati=Lohit Gujarati --dialog.plain.hindi=Lohit Hindi --dialog.plain.malayalam=Lohit Malayalam --dialog.plain.oriya=Lohit Oriya --dialog.plain.punjabi=Lohit Punjabi --dialog.plain.tamil=Lohit Tamil --dialog.plain.telugu=Lohit Telugu --dialog.plain.sinhala=LKLUG -- --dialog.bold.latin-1=DejaVu Sans Bold --dialog.bold.japanese-x0208=Sazanami Gothic --dialog.bold.korean=Baekmuk Gulim --dialog.bold.chinese-big5=AR PL ShanHeiSun Uni --dialog.bold.chinese-gb18030=AR PL ShanHeiSun Uni --dialog.bold.bengali=Lohit Bengali --dialog.bold.gujarati=Lohit Gujarati --dialog.bold.hindi=Lohit Hindi --dialog.bold.malayalam=Lohit Malayalam --dialog.bold.oriya=Lohit Oriya --dialog.bold.punjabi=Lohit Punjabi --dialog.bold.tamil=Lohit Tamil --dialog.bold.telugu=Lohit Telugu --dialog.bold.sinhala=LKLUG -- --dialog.italic.latin-1=DejaVu Sans Oblique --dialog.italic.japanese-x0208=Sazanami Gothic --dialog.italic.korean=Baekmuk Gulim --dialog.italic.chinese-big5=AR PL ShanHeiSun Uni --dialog.italic.chinese-gb18030=AR PL ShanHeiSun Uni --dialog.italic.bengali=Lohit Bengali --dialog.italic.gujarati=Lohit Gujarati --dialog.italic.hindi=Lohit Hindi --dialog.italic.malayalam=Lohit Malayalam --dialog.italic.oriya=Lohit Oriya --dialog.italic.punjabi=Lohit Punjabi --dialog.italic.tamil=Lohit Tamil --dialog.italic.telugu=Lohit Telugu --dialog.italic.sinhala=LKLUG -- --dialog.bolditalic.latin-1=DejaVu Sans Bold Oblique --dialog.bolditalic.japanese-x0208=Sazanami Gothic --dialog.bolditalic.korean=Baekmuk Gulim --dialog.bolditalic.chinese-big5=AR PL ShanHeiSun Uni --dialog.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni --dialog.bolditalic.bengali=Lohit Bengali --dialog.bolditalic.gujarati=Lohit Gujarati --dialog.bolditalic.hindi=Lohit Hindi --dialog.bolditalic.malayalam=Lohit Malayalam --dialog.bolditalic.oriya=Lohit Oriya --dialog.bolditalic.punjabi=Lohit Punjabi --dialog.bolditalic.tamil=Lohit Tamil --dialog.bolditalic.telugu=Lohit Telugu --dialog.bolditalic.sinhala=LKLUG -- --sansserif.plain.latin-1=DejaVu Sans --sansserif.plain.japanese-x0208=Sazanami Gothic --sansserif.plain.korean=Baekmuk Gulim --sansserif.plain.chinese-big5=AR PL ShanHeiSun Uni --sansserif.plain.chinese-gb18030=AR PL ShanHeiSun Uni --sansserif.plain.bengali=Lohit Bengali --sansserif.plain.gujarati=Lohit Gujarati --sansserif.plain.hindi=Lohit Hindi --sansserif.plain.malayalam=Lohit Malayalam --sansserif.plain.oriya=Lohit Oriya --sansserif.plain.punjabi=Lohit Punjabi --sansserif.plain.tamil=Lohit Tamil --sansserif.plain.telugu=Lohit Telugu --sansserif.plain.sinhala=LKLUG -- --sansserif.bold.latin-1=DejaVu Sans Bold --sansserif.bold.japanese-x0208=Sazanami Gothic --sansserif.bold.korean=Baekmuk Gulim --sansserif.bold.chinese-big5=AR PL ShanHeiSun Uni --sansserif.bold.chinese-gb18030=AR PL ShanHeiSun Uni --sansserif.bold.bengali=Lohit Bengali --sansserif.bold.gujarati=Lohit Gujarati --sansserif.bold.hindi=Lohit Hindi --sansserif.bold.malayalam=Lohit Malayalam --sansserif.bold.oriya=Lohit Oriya --sansserif.bold.punjabi=Lohit Punjabi --sansserif.bold.tamil=Lohit Tamil --sansserif.bold.telugu=Lohit Telugu --sansserif.bold.sinhala=LKLUG -- --sansserif.italic.latin-1=DejaVu Sans Oblique --sansserif.italic.japanese-x0208=Sazanami Gothic --sansserif.italic.korean=Baekmuk Gulim --sansserif.italic.chinese-big5=AR PL ShanHeiSun Uni --sansserif.italic.chinese-gb18030=AR PL ShanHeiSun Uni --sansserif.italic.bengali=Lohit Bengali --sansserif.italic.gujarati=Lohit Gujarati --sansserif.italic.hindi=Lohit Hindi --sansserif.italic.malayalam=Lohit Malayalam --sansserif.italic.oriya=Lohit Oriya --sansserif.italic.punjabi=Lohit Punjabi --sansserif.italic.tamil=Lohit Tamil --sansserif.italic.telugu=Lohit Telugu --sansserif.italic.sinhala=LKLUG -- --sansserif.bolditalic.latin-1=DejaVu Sans Bold Oblique --sansserif.bolditalic.japanese-x0208=Sazanami Gothic --sansserif.bolditalic.korean=Baekmuk Gulim --sansserif.bolditalic.chinese-big5=AR PL ShanHeiSun Uni --sansserif.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni --sansserif.bolditalic.bengali=Lohit Bengali --sansserif.bolditalic.gujarati=Lohit Gujarati --sansserif.bolditalic.hindi=Lohit Hindi --sansserif.bolditalic.malayalam=Lohit Malayalam --sansserif.bolditalic.oriya=Lohit Oriya --sansserif.bolditalic.punjabi=Lohit Punjabi --sansserif.bolditalic.tamil=Lohit Tamil --sansserif.bolditalic.telugu=Lohit Telugu --sansserif.bolditalic.sinhala=LKLUG -- --serif.plain.latin-1=DejaVu Serif --serif.plain.japanese-x0208=Sazanami Mincho --serif.plain.korean=Baekmuk Batang --serif.plain.chinese-big5=AR PL ZenKai Uni --serif.plain.chinese-gb18030=AR PL ZenKai Uni --serif.plain.bengali=Lohit Bengali --serif.plain.gujarati=Lohit Gujarati --serif.plain.hindi=Lohit Hindi --serif.plain.malayalam=Lohit Malayalam --serif.plain.oriya=Lohit Oriya --serif.plain.punjabi=Lohit Punjabi --serif.plain.tamil=Lohit Tamil --serif.plain.telugu=Lohit Telugu --serif.plain.sinhala=LKLUG -- --serif.bold.latin-1=DejaVu Serif Bold --serif.bold.japanese-x0208=Sazanami Mincho --serif.bold.korean=Baekmuk Batang --serif.bold.chinese-big5=AR PL ZenKai Uni --serif.bold.chinese-gb18030=AR PL ZenKai Uni --serif.bold.bengali=Lohit Bengali --serif.bold.gujarati=Lohit Gujarati --serif.bold.hindi=Lohit Hindi --serif.bold.malayalam=Lohit Malayalam --serif.bold.oriya=Lohit Oriya --serif.bold.punjabi=Lohit Punjabi --serif.bold.tamil=Lohit Tamil --serif.bold.telugu=Lohit Telugu --serif.bold.sinhala=LKLUG -- --serif.italic.latin-1=DejaVu Serif Oblique --serif.italic.japanese-x0208=Sazanami Mincho --serif.italic.korean=Baekmuk Batang --serif.italic.chinese-big5=AR PL ZenKai Uni --serif.italic.chinese-gb18030=AR PL ZenKai Uni --serif.italic.bengali=Lohit Bengali --serif.italic.gujarati=Lohit Gujarati --serif.italic.hindi=Lohit Hindi --serif.italic.malayalam=Lohit Malayalam --serif.italic.oriya=Lohit Oriya --serif.italic.punjabi=Lohit Punjabi --serif.italic.tamil=Lohit Tamil --serif.italic.telugu=Lohit Telugu --serif.italic.sinhala=LKLUG -- --serif.bolditalic.latin-1=DejaVu Serif Bold Oblique --serif.bolditalic.japanese-x0208=Sazanami Mincho --serif.bolditalic.korean=Baekmuk Batang --serif.bolditalic.chinese-big5=AR PL ZenKai Uni --serif.bolditalic.chinese-gb18030=AR PL ZenKai Uni --serif.bolditalic.bengali=Lohit Bengali --serif.bolditalic.gujarati=Lohit Gujarati --serif.bolditalic.hindi=Lohit Hindi --serif.bolditalic.malayalam=Lohit Malayalam --serif.bolditalic.oriya=Lohit Oriya --serif.bolditalic.punjabi=Lohit Punjabi --serif.bolditalic.tamil=Lohit Tamil --serif.bolditalic.telugu=Lohit Telugu --serif.bolditalic.sinhala=LKLUG -- --monospaced.plain.latin-1=DejaVu Sans Mono --monospaced.plain.japanese-x0208=Sazanami Gothic --monospaced.plain.korean=Baekmuk Gulim --monospaced.plain.chinese-big5=AR PL ShanHeiSun Uni --monospaced.plain.chinese-gb18030=AR PL ShanHeiSun Uni --monospaced.plain.bengali=Lohit Bengali --monospaced.plain.gujarati=Lohit Gujarati --monospaced.plain.hindi=Lohit Hindi --monospaced.plain.malayalam=Lohit Malayalam --monospaced.plain.oriya=Lohit Oriya --monospaced.plain.punjabi=Lohit Punjabi --monospaced.plain.tamil=Lohit Tamil --monospaced.plain.telugu=Lohit Telugu --monospaced.plain.sinhala=LKLUG -- --monospaced.bold.latin-1=DejaVu Sans Mono Bold --monospaced.bold.japanese-x0208=Sazanami Gothic --monospaced.bold.korean=Baekmuk Gulim --monospaced.bold.chinese-big5=AR PL ShanHeiSun Uni --monospaced.bold.chinese-gb18030=AR PL ShanHeiSun Uni --monospaced.bold.bengali=Lohit Bengali --monospaced.bold.gujarati=Lohit Gujarati --monospaced.bold.hindi=Lohit Hindi --monospaced.bold.malayalam=Lohit Malayalam --monospaced.bold.oriya=Lohit Oriya --monospaced.bold.punjabi=Lohit Punjabi --monospaced.bold.tamil=Lohit Tamil --monospaced.bold.telugu=Lohit Telugu --monospaced.bold.sinhala=LKLUG -- --monospaced.italic.latin-1=DejaVu Sans Mono Oblique --monospaced.italic.japanese-x0208=Sazanami Gothic --monospaced.italic.korean=Baekmuk Gulim --monospaced.italic.chinese-big5=AR PL ShanHeiSun Uni --monospaced.italic.chinese-gb18030=AR PL ShanHeiSun Uni --monospaced.italic.bengali=Lohit Bengali --monospaced.italic.gujarati=Lohit Gujarati --monospaced.italic.hindi=Lohit Hindi --monospaced.italic.malayalam=Lohit Malayalam --monospaced.italic.oriya=Lohit Oriya --monospaced.italic.punjabi=Lohit Punjabi --monospaced.italic.tamil=Lohit Tamil --monospaced.italic.telugu=Lohit Telugu --monospaced.italic.sinhala=LKLUG -- --monospaced.bolditalic.latin-1=DejaVu Sans Mono Bold Oblique --monospaced.bolditalic.japanese-x0208=Sazanami Gothic --monospaced.bolditalic.korean=Baekmuk Gulim --monospaced.bolditalic.chinese-big5=AR PL ShanHeiSun Uni --monospaced.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni --monospaced.bolditalic.bengali=Lohit Bengali --monospaced.bolditalic.gujarati=Lohit Gujarati --monospaced.bolditalic.hindi=Lohit Hindi --monospaced.bolditalic.malayalam=Lohit Malayalam --monospaced.bolditalic.oriya=Lohit Oriya --monospaced.bolditalic.punjabi=Lohit Punjabi --monospaced.bolditalic.tamil=Lohit Tamil --monospaced.bolditalic.telugu=Lohit Telugu --monospaced.bolditalic.sinhala=LKLUG -- --dialoginput.plain.latin-1=DejaVu Sans Mono --dialoginput.plain.japanese-x0208=Sazanami Gothic --dialoginput.plain.korean=Baekmuk Gulim --dialoginput.plain.chinese-big5=AR PL ShanHeiSun Uni --dialoginput.plain.chinese-gb18030=AR PL ShanHeiSun Uni --dialoginput.plain.bengali=Lohit Bengali --dialoginput.plain.gujarati=Lohit Gujarati --dialoginput.plain.hindi=Lohit Hindi --dialoginput.plain.malayalam=Lohit Malayalam --dialoginput.plain.oriya=Lohit Oriya --dialoginput.plain.punjabi=Lohit Punjabi --dialoginput.plain.tamil=Lohit Tamil --dialoginput.plain.telugu=Lohit Telugu --dialoginput.plain.sinhala=LKLUG -- --dialoginput.bold.latin-1=DejaVu Sans Mono Bold --dialoginput.bold.japanese-x0208=Sazanami Gothic --dialoginput.bold.korean=Baekmuk Gulim --dialoginput.bold.chinese-big5=AR PL ShanHeiSun Uni --dialoginput.bold.chinese-gb18030=AR PL ShanHeiSun Uni --dialoginput.bold.bengali=Lohit Bengali --dialoginput.bold.gujarati=Lohit Gujarati --dialoginput.bold.hindi=Lohit Hindi --dialoginput.bold.malayalam=Lohit Malayalam --dialoginput.bold.oriya=Lohit Oriya --dialoginput.bold.punjabi=Lohit Punjabi --dialoginput.bold.tamil=Lohit Tamil --dialoginput.bold.telugu=Lohit Telugu --dialoginput.bold.sinhala=LKLUG -- --dialoginput.italic.latin-1=DejaVu Sans Mono Oblique --dialoginput.italic.japanese-x0208=Sazanami Gothic --dialoginput.italic.korean=Baekmuk Gulim --dialoginput.italic.chinese-big5=AR PL ShanHeiSun Uni --dialoginput.italic.chinese-gb18030=AR PL ShanHeiSun Uni --dialoginput.italic.bengali=Lohit Bengali --dialoginput.italic.gujarati=Lohit Gujarati --dialoginput.italic.hindi=Lohit Hindi --dialoginput.italic.malayalam=Lohit Malayalam --dialoginput.italic.oriya=Lohit Oriya --dialoginput.italic.punjabi=Lohit Punjabi --dialoginput.italic.tamil=Lohit Tamil --dialoginput.italic.telugu=Lohit Telugu --dialoginput.italic.sinhala=LKLUG -- --dialoginput.bolditalic.latin-1=DejaVu Sans Mono Bold Oblique --dialoginput.bolditalic.japanese-x0208=Sazanami Gothic --dialoginput.bolditalic.korean=Baekmuk Gulim --dialoginput.bolditalic.chinese-big5=AR PL ShanHeiSun Uni --dialoginput.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni --dialoginput.bolditalic.bengali=Lohit Bengali --dialoginput.bolditalic.gujarati=Lohit Gujarati --dialoginput.bolditalic.hindi=Lohit Hindi --dialoginput.bolditalic.malayalam=Lohit Malayalam --dialoginput.bolditalic.oriya=Lohit Oriya --dialoginput.bolditalic.punjabi=Lohit Punjabi --dialoginput.bolditalic.tamil=Lohit Tamil --dialoginput.bolditalic.telugu=Lohit Telugu --dialoginput.bolditalic.sinhala=LKLUG -- --# Search Sequences -- --sequence.allfonts=latin-1 --sequence.allfonts.Big5=chinese-big5,latin-1 --sequence.allfonts.x-euc-jp-bsd=japanese-x0208,latin-1 --sequence.allfonts.EUC-KR=korean,latin-1 --sequence.allfonts.GB18030=chinese-gb18030,latin-1 --sequence.fallback=chinese-big5,chinese-gb18030,japanese-x0208,korean,bengali,gujarati,hindi,oriya,punjabi,malayalam,tamil,telugu,sinhala -- --# Font File Names -- --filename.DejaVu_Sans=/usr/share/fonts/dejavu/DejaVuSans.ttf --filename.DejaVu_Sans_Bold=/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf --filename.DejaVu_Sans_Oblique=/usr/share/fonts/dejavu/DejaVuSans-Oblique.ttf --filename.DejaVu_Sans_Bold_Oblique=/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf -- --filename.DejaVu_Sans_Mono=/usr/share/fonts/dejavu/DejaVuSansMono.ttf --filename.DejaVu_Sans_Mono_Bold=/usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf --filename.DejaVu_Sans_Mono_Oblique=/usr/share/fonts/dejavu/DejaVuSansMono-Oblique.ttf --filename.DejaVu_Sans_Mono_Bold_Oblique=/usr/share/fonts/dejavu/DejaVuSansMono-BoldOblique.ttf -- --filename.DejaVu_Serif=/usr/share/fonts/dejavu/DejaVuSerif.ttf --filename.DejaVu_Serif_Bold=/usr/share/fonts/dejavu/DejaVuSerif-Bold.ttf --filename.DejaVu_Serif_Oblique=/usr/share/fonts/dejavu/DejaVuSerif-Oblique.ttf --filename.DejaVu_Serif_Bold_Oblique=/usr/share/fonts/dejavu/DejaVuSerif-BoldOblique.ttf -- --filename.Sazanami_Gothic=/usr/share/fonts/sazanami-fonts-gothic/sazanami-gothic.ttf --filename.Sazanami_Mincho=/usr/share/fonts/sazanami-fonts-mincho/sazanami-mincho.ttf --filename.AR_PL_ShanHeiSun_Uni=/usr/share/fonts/cjkunifonts-uming/uming.ttc --filename.AR_PL_ZenKai_Uni=/usr/share/fonts/cjkunifonts-ukai/ukai.ttc --filename.Baekmuk_Gulim=/usr/share/fonts/baekmuk-ttf-gulim/gulim.ttf --filename.Baekmuk_Batang=/usr/share/fonts/baekmuk-ttf-batang/batang.ttf -- --filename.Lohit_Bengali=/usr/share/fonts/lohit-bengali/lohit_bn.ttf --filename.Lohit_Gujarati=/usr/share/fonts/lohit-gujarati/lohit_gu.ttf --filename.Lohit_Hindi=/usr/share/fonts/lohit-hindi/lohit_hi.ttf --filename.Lohit_Kannda=/usr/share/fonts/lohit-kannada/lohit_kn.ttf --filename.Lohit_Malayalam=/usr/share/fonts/lohit-malayalam/lohit_ml.ttf --filename.Lohit_Oriya=/usr/share/fonts/lohit-oriya/lohit_or.ttf --filename.Lohit_Punjabi=/usr/share/fonts/lohit-punjabi/lohit_pa.ttf --filename.Lohit_Tamil=/usr/share/fonts/lohit-tamil/lohit_ta.ttf --filename.Lohit_Telugu=/usr/share/fonts/lohit-telugu/lohit_te.ttf --filename.LKLUG=/usr/share/fonts/lklug/lklug.ttf -- ---- ./jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.SuSE.properties 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.SuSE.properties 1969-12-31 16:00:00.000000000 -0800 -@@ -1,154 +0,0 @@ --# --# --# Copyright (c) 2007, Oracle and/or its affiliates. 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. Oracle designates this --# particular file as subject to the "Classpath" exception as provided --# by Oracle in the LICENSE file that accompanied this code. --# --# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA --# or visit www.oracle.com if you need additional information or have any --# questions. --# -- --# Version -- --# Uses SuSE 10.2 fonts and file paths. --version=1 -- --# Component Font Mappings -- --dialog.plain.latin-1=Albany AMT --dialog.plain.japanese-x0208=Sazanami Gothic --dialog.plain.korean=UnDotum -- --dialog.bold.latin-1=Albany AMT Bold --dialog.bold.japanese-x0208=Sazanami Gothic --dialog.bold.korean=UnDotum Bold -- --dialog.italic.latin-1=Albany AMT Italic --dialog.italic.japanese-x0208=Sazanami Gothic --dialog.italic.korean=UnDotum -- --dialog.bolditalic.latin-1=Albany AMT Bold Italic --dialog.bolditalic.japanese-x0208=Sazanami Gothic --dialog.bolditalic.korean=UnDotum Bold -- -- --sansserif.plain.latin-1=Albany AMT --sansserif.plain.japanese-x0208=Sazanami Gothic --sansserif.plain.korean=UnDotum -- --sansserif.bold.latin-1=Albany AMT Bold --sansserif.bold.japanese-x0208=Sazanami Gothic --sansserif.bold.korean=UnDotum Bold -- --sansserif.italic.latin-1=Albany AMT Italic --sansserif.italic.japanese-x0208=Sazanami Gothic --sansserif.italic.korean=UnDotum -- --sansserif.bolditalic.latin-1=Albany AMT Bold Italic --sansserif.bolditalic.japanese-x0208=Sazanami Gothic --sansserif.bolditalic.korean=UnDotum Bold -- -- --serif.plain.latin-1=Thorndale AMT --serif.plain.japanese-x0208=Sazanami Mincho --serif.plain.korean=UnBatang -- --serif.bold.latin-1=Thorndale AMT Bold --serif.bold.japanese-x0208=Sazanami Mincho --serif.bold.korean=UnBatang Bold -- --serif.italic.latin-1=Thorndale AMT Italic --serif.italic.japanese-x0208=Sazanami Mincho --serif.italic.korean=UnBatang -- --serif.bolditalic.latin-1=Thorndale AMT Bold Italic --serif.bolditalic.japanese-x0208=Sazanami Mincho --serif.bolditalic.korean=UnBatang Bold -- -- --monospaced.plain.latin-1=Cumberland AMT --monospaced.plain.japanese-x0208=Sazanami Gothic --monospaced.plain.korean=UnDotum -- --monospaced.bold.latin-1=Cumberland AMT Bold --monospaced.bold.japanese-x0208=Sazanami Gothic --monospaced.bold.korean=UnDotum Bold -- --monospaced.italic.latin-1=Cumberland AMT Italic --monospaced.italic.japanese-x0208=Sazanami Gothic --monospaced.italic.korean=UnDotum -- --monospaced.bolditalic.latin-1=Cumberland AMT Bold Italic --monospaced.bolditalic.japanese-x0208=Sazanami Gothic --monospaced.bolditalic.korean=UnDotum Bold -- -- --dialoginput.plain.latin-1=Cumberland AMT --dialoginput.plain.japanese-x0208=Sazanami Gothic --dialoginput.plain.korean=UnDotum -- --dialoginput.bold.latin-1=Cumberland AMT Bold --dialoginput.bold.japanese-x0208=Sazanami Gothic --dialoginput.bold.korean=UnDotum Bold -- --dialoginput.italic.latin-1=Cumberland AMT Italic --dialoginput.italic.japanese-x0208=Sazanami Gothic --dialoginput.italic.korean=UnDotum -- --dialoginput.bolditalic.latin-1=Cumberland AMT Bold Italic --dialoginput.bolditalic.japanese-x0208=Sazanami Gothic --dialoginput.bolditalic.korean=UnDotum Bold -- --allfonts.chinese-big5=AR PL Mingti2L Big5 --allfonts.chinese-gb18030=AR PL SungtiL GB -- --# Search Sequences -- --sequence.allfonts=latin-1 --sequence.allfonts.Big5=chinese-big5,latin-1 --sequence.allfonts.x-euc-jp-bsd=japanese-x0208,latin-1 --sequence.allfonts.EUC-KR=korean,latin-1 --sequence.allfonts.GB18030=chinese-gb18030,latin-1 --sequence.fallback=chinese-big5,chinese-gb18030,japanese-x0208,korean -- --# Font File Names -- --filename.Albany_AMT=/usr/share/fonts/truetype/albw.ttf --filename.Albany_AMT_Bold=/usr/share/fonts/truetype/albwb.ttf --filename.Albany_AMT_Italic=/usr/share/fonts/truetype/albwb.ttf --filename.Albany_AMT_Bold_Italic=/usr/share/fonts/truetype/albwbi.ttf -- --filename.Thorndale_AMT=/usr/share/fonts/truetype/thowr___.ttf --filename.Thorndale_AMT_Bold=/usr/share/fonts/truetype/thowb___.ttf --filename.Thorndale_AMT_Italic=/usr/share/fonts/truetype/thowi___.ttf --filename.Thorndale_AMT_Bold_Italic=/usr/share/fonts/truetype/thowbi__.ttf -- --filename.Cumberland_AMT=/usr/share/fonts/truetype/cumbwr__.ttf --filename.Cumberland_AMT_Bold=/usr/share/fonts/truetype/cumbwb__.ttf --filename.Cumberland_AMT_Italic=/usr/share/fonts/truetype/cumbwi__.ttf --filename.Cumberland_AMT_Bold_Italic=/usr/share/fonts/truetype/cumbwbi_.ttf -- --filename.Sazanami_Gothic=/usr/share/fonts/truetype/sazanami-gothic.ttf --filename.Sazanami_Mincho=/usr/share/fonts/truetype/sazanami-mincho.ttf --filename.AR_PL_SungtiL_GB=/usr/share/fonts/truetype/gbsn00lp.ttf --filename.AR_PL_Mingti2L_Big5=/usr/share/fonts/truetype/bsmi00lp.ttf --filename.UnDotum=/usr/share/fonts/truetype/UnDotum.ttf --filename.UnDotum_Bold=/usr/share/fonts/truetype/UnDotumBold.ttf --filename.UnBatang=/usr/share/fonts/truetype/UnBatang.ttf --filename.UnBatang_Bold=/usr/share/fonts/truetype/UnBatangBold.ttf ---- ./jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.Ubuntu.properties 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.Ubuntu.properties 1969-12-31 16:00:00.000000000 -0800 -@@ -1,348 +0,0 @@ --# --# --# Copyright (c) 2007, 2010, Oracle and/or its affiliates. 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. Oracle designates this --# particular file as subject to the "Classpath" exception as provided --# by Oracle in the LICENSE file that accompanied this code. --# --# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA --# or visit www.oracle.com if you need additional information or have any --# questions. --# -- --# Version -- --# Uses Ubuntu 8.04 (hardy), Debian 6.0 (Squeeze) (and more recent releases) fonts and file paths. --version=1 -- --# Component Font Mappings -- --# Chinese fonts --allfonts.umingcn=AR PL UMing CN --#allfonts.umingcn.motif=AR PL UMing CN --allfonts.uminghk=AR PL UMing HK --#allfonts.uminghk.motif=AR PL UMing HK --allfonts.umingtw=AR PL UMing TW --#allfonts.umingtw.motif=AR PL UMing TW --allfonts.wqy-zenhei=WenQuanYi Zen Hei --#allfonts.wqy-zenhei.motif=WenQuanYi Zen Hei --allfonts.shanheisun=AR PL ShanHeiSun Uni --#allfonts.shanheisun.motif=AR PL ShanHeiSun Uni -- --# Indic scripts --allfonts.bengali=Lohit Bengali --allfonts.gujarati=Lohit Gujarati --allfonts.hindi=Lohit Hindi --#allfonts.malayalam=Lohit Malayalam --allfonts.oriya=Lohit Oriya --allfonts.punjabi=Lohit Punjabi --allfonts.tamil=Lohit Tamil --allfonts.telugu=Lohit Telugu --allfonts.sinhala=LKLUG -- -- --serif.plain.latin-1=DejaVu Serif --#serif.plain.latin-1.motif=LuxiSerif-Regular --serif.plain.japanese-kochi=Kochi Mincho --serif.plain.japanese-sazanami=Sazanami Mincho --serif.plain.japanese-vlgothic=Sazanami Mincho --serif.plain.korean-baekmuk=Baekmuk Batang --#serif.plain.korean-baekmuk.motif=Baekmuk Batang --serif.plain.korean-un=UnBatang --#serif.plain.korean-un.motif=UnBatang -- --serif.bold.latin-1=DejaVu Serif Bold --#serif.bold.latin-1.motif=LuxiSerif-Bold --serif.bold.japanese-kochi=Kochi Mincho --serif.bold.japanese-sazanami=Sazanami Mincho --serif.bold.japanese-vlgothic=Sazanami Mincho --serif.bold.korean-baekmuk=Baekmuk Batang --#serif.bold.korean-baekmuk.motif=Baekmuk Batang --serif.bold.korean-un=UnBatang Bold --#serif.bold.korean-un.motif=UnBatang Bold -- --serif.italic.latin-1=DejaVu Serif Oblique --#serif.italic.latin-1.motif=LuxiSerif-Oblique --serif.italic.japanese-kochi=Kochi Mincho --serif.italic.japanese-sazanami=Sazanami Mincho --serif.italic.japanese-vlgothic=Sazanami Mincho --serif.italic.korean-baekmuk=Baekmuk Batang --#serif.italic.korean-baekmuk.motif=Baekmuk Batang --serif.italic.korean-un=UnBatang --#serif.italic.korean-un.motif=UnBatang -- --serif.bolditalic.latin-1=DejaVu Serif Bold Oblique --#serif.bolditalic.latin-1.motif=LuxiSerif-BoldOblique --serif.bolditalic.japanese-kochi=Kochi Mincho --serif.bolditalic.japanese-sazanami=Sazanami Mincho --serif.bolditalic.japanese-vlgothic=Sazanami Mincho --serif.bolditalic.korean-baekmuk=Baekmuk Batang --#serif.bolditalic.korean-baekmuk.motif=Baekmuk Batang --serif.bolditalic.korean-un=UnBatang Bold --#serif.bolditalic.korean-un.motif=UnBatang Bold -- --sansserif.plain.latin-1=DejaVu Sans --#sansserif.plain.latin-1.motif=LuxiSans-Regular --sansserif.plain.japanese-kochi=Kochi Gothic --sansserif.plain.japanese-sazanami=Sazanami Gothic --sansserif.plain.japanese-vlgothic=VL PGothic --sansserif.plain.korean-baekmuk=Baekmuk Gulim --#sansserif.plain.korean-baekmuk.motif=Baekmuk Gulim --sansserif.plain.korean-un=UnDotum --#sansserif.plain.korean-un.motif=UnDotum -- --sansserif.bold.latin-1=DejaVu Sans Bold --#sansserif.bold.latin-1.motif=LuxiSans-Bold --sansserif.bold.japanese-kochi=Kochi Gothic --sansserif.bold.japanese-sazanami=Sazanami Gothic --sansserif.bold.japanese-vlgothic=VL PGothic --sansserif.bold.korean-baekmuk=Baekmuk Gulim --#sansserif.bold.korean-baekmuk.motif=Baekmuk Gulim --sansserif.bold.korean-un=UnDotum Bold --#sansserif.bold.korean-un.motif=UnDotum Bold -- --sansserif.italic.latin-1=DejaVu Sans Oblique --#sansserif.italic.latin-1.motif=LuxiSans-Oblique --sansserif.italic.japanese-kochi=Kochi Gothic --sansserif.italic.japanese-sazanami=Sazanami Gothic --sansserif.italic.japanese-vlgothic=VL PGothic --sansserif.italic.korean-baekmuk=Baekmuk Gulim --#sansserif.italic.korean-baekmuk.motif=Baekmuk Gulim --sansserif.italic.korean-un=UnDotum --#sansserif.italic.korean-un.motif=UnDotum -- --sansserif.bolditalic.latin-1=DejaVu Sans Bold Oblique --#sansserif.bolditalic.latin-1.motif=LuxiSans-BoldOblique --sansserif.bolditalic.japanese-kochi=Kochi Gothic --sansserif.bolditalic.japanese-sazanami=Sazanami Gothic --sansserif.bolditalic.japanese-vlgothic=VL PGothic --sansserif.bolditalic.korean-baekmuk=Baekmuk Gulim --#sansserif.bolditalic.korean-baekmuk.motif=Baekmuk Gulim --sansserif.bolditalic.korean-un=UnDotum Bold --#sansserif.bolditalic.korean-un.motif=UnDotum Bold -- --monospaced.plain.latin-1=DejaVu Sans Mono --#monospaced.plain.latin-1.motif=LuxiMono-Regular --monospaced.plain.japanese-kochi=Kochi Gothic --monospaced.plain.japanese-sazanami=Sazanami Gothic --monospaced.plain.japanese-vlgothic=VL Gothic --monospaced.plain.korean-baekmuk=Baekmuk Gulim --#monospaced.plain.korean-baekmuk.motif=Baekmuk Gulim --monospaced.plain.korean-un=UnDotum --#monospaced.plain.korean-un.motif=UnDotum -- --monospaced.bold.latin-1=DejaVu Sans Mono Bold --#monospaced.bold.latin-1.motif=LuxiMono-Bold --monospaced.bold.japanese-kochi=Kochi Gothic --monospaced.bold.japanese-sazanami=Sazanami Gothic --monospaced.bold.japanese-vlgothic=VL Gothic --monospaced.bold.korean-baekmuk=Baekmuk Gulim --#monospaced.bold.korean-baekmuk.motif=Baekmuk Gulim --monospaced.bold.korean-un=UnDotum Bold --#monospaced.bold.korean-un.motif=UnDotum Bold -- --monospaced.italic.latin-1=DejaVu Sans Mono Oblique --#monospaced.italic.latin-1.motif=LuxiMono-Oblique --monospaced.italic.japanese-kochi=Kochi Gothic --monospaced.italic.japanese-sazanami=Sazanami Gothic --monospaced.italic.japanese-vlgothic=VL Gothic --monospaced.italic.korean-baekmuk=Baekmuk Gulim --#monospaced.italic.korean-baekmuk.motif=Baekmuk Gulim --monospaced.italic.korean-un=UnDotum --#monospaced.italic.korean-un.motif=UnDotum -- --monospaced.bolditalic.latin-1=DejaVu Sans Mono Bold Oblique --#monospaced.bolditalic.latin-1.motif=LuxiMono-BoldOblique --monospaced.bolditalic.japanese-kochi=Kochi Gothic --monospaced.bolditalic.japanese-sazanami=Sazanami Gothic --monospaced.bolditalic.japanese-vlgothic=VL Gothic --monospaced.bolditalic.korean-baekmuk=Baekmuk Gulim --#monospaced.bolditalic.korean-baekmuk.motif=Baekmuk Gulim --monospaced.bolditalic.korean-un=UnDotum Bold --#monospaced.bolditalic.korean-un.motif=UnDotum Bold -- --dialog.plain.latin-1=DejaVu Sans --#dialog.plain.latin-1.motif=LuxiSans-Regular --dialog.plain.japanese-kochi=Kochi Gothic --dialog.plain.japanese-sazanami=Sazanami Gothic --dialog.plain.japanese-vlgothic=VL PGothic --dialog.plain.korean-baekmuk=Baekmuk Gulim --#dialog.plain.korean-baekmuk.motif=Baekmuk Gulim --dialog.plain.korean-un=UnDotum --#dialog.plain.korean-un.motif=UnDotum -- --dialog.bold.latin-1=DejaVu Sans Bold --#dialog.bold.latin-1.motif=LuxiSans-Bold --dialog.bold.japanese-kochi=Kochi Gothic --dialog.bold.japanese-sazanami=Sazanami Gothic --dialog.bold.japanese-vlgothic=VL PGothic --dialog.bold.korean-baekmuk=Baekmuk Gulim --#dialog.bold.korean-baekmuk.motif=Baekmuk Gulim --dialog.bold.korean-un=UnDotum Bold --#dialog.bold.korean-un.motif=UnDotum Bold -- --dialog.italic.latin-1=DejaVu Sans Oblique --#dialog.italic.latin-1.motif=LuxiSans-Oblique --dialog.italic.japanese-kochi=Kochi Gothic --dialog.italic.japanese-sazanami=Sazanami Gothic --dialog.italic.japanese-vlgothic=VL PGothic --dialog.italic.korean-baekmuk=Baekmuk Gulim --#dialog.italic.korean-baekmuk.motif=Baekmuk Gulim --dialog.italic.korean-un=UnDotum --#dialog.italic.korean-un.motif=UnDotum -- --dialog.bolditalic.latin-1=DejaVu Sans Bold Oblique --#dialog.bolditalic.latin-1.motif=LuxiSans-BoldOblique --dialog.bolditalic.japanese-kochi=Kochi Gothic --dialog.bolditalic.japanese-sazanami=Sazanami Gothic --dialog.bolditalic.japanese-vlgothic=VL PGothic --dialog.bolditalic.korean-baekmuk=Baekmuk Gulim --#dialog.bolditalic.korean-baekmuk.motif=Baekmuk Gulim --dialog.bolditalic.korean-un=UnDotum Bold --#dialog.bolditalic.korean-un.motif=UnDotum Bold -- --dialoginput.plain.latin-1=DejaVu Sans Mono --#dialoginput.plain.latin-1.motif=LuxiMono-Regular --dialoginput.plain.japanese-kochi=Kochi Gothic --dialoginput.plain.japanese-sazanami=Sazanami Gothic --dialoginput.plain.japanese-vlgothic=VL Gothic --dialoginput.plain.korean-baekmuk=Baekmuk Gulim --#dialoginput.plain.korean-baekmuk.motif=Baekmuk Gulim --dialoginput.plain.korean-un=UnDotum --#dialoginput.plain.korean-un.motif=UnDotum -- --dialoginput.bold.latin-1=DejaVu Sans Mono Bold --#dialoginput.bold.latin-1.motif=LuxiMono-Bold --dialoginput.bold.japanese-kochi=Kochi Gothic --dialoginput.bold.japanese-sazanami=Sazanami Gothic --dialoginput.bold.japanese-vlgothic=VL Gothic --dialoginput.bold.korean-baekmuk=Baekmuk Gulim --#dialoginput.bold.korean-baekmuk.motif=Baekmuk Gulim --dialoginput.bold.korean-un=UnDotum Bold --#dialoginput.bold.korean-un.motif=UnDotum Bold -- --dialoginput.italic.latin-1=DejaVu Sans Mono Oblique --#dialoginput.italic.latin-1.motif=LuxiMono-Oblique --dialoginput.italic.japanese-kochi=Kochi Gothic --dialoginput.italic.japanese-sazanami=Sazanami Gothic --dialoginput.italic.japanese-vlgothic=VL Gothic --dialoginput.italic.korean-baekmuk=Baekmuk Gulim --#dialoginput.italic.korean-baekmuk.motif=Baekmuk Gulim --dialoginput.italic.korean-un=UnDotum --#dialoginput.italic.korean-un.motif=UnDotum -- --dialoginput.bolditalic.latin-1=DejaVu Sans Mono Bold Oblique --#dialoginput.bolditalic.latin-1.motif=LuxiMono-BoldOblique --dialoginput.bolditalic.japanese-kochi=Kochi Gothic --dialoginput.bolditalic.japanese-sazanami=Sazanami Gothic --dialoginput.bolditalic.japanese-vlgothic=VL Gothic --dialoginput.bolditalic.korean-baekmuk=Baekmuk Gulim --#dialoginput.bolditalic.korean-baekmuk.motif=Baekmuk Gulim --dialoginput.bolditalic.korean-un=UnDotum Bold --#dialoginput.bolditalic.korean-un.motif=UnDotum Bold -- --# Search Sequences -- --sequence.allfonts=latin-1 --sequence.allfonts.GB18030=latin-1,umingcn,shanheisun,wqy-zenhei --sequence.allfonts.GB2312=latin-1,umingcn,shanheisun,wqy-zenhei --sequence.allfonts.GBK=latin-1,umingcn,shanheisun,wqy-zenhei --sequence.allfonts.x-euc-jp-bsd=latin-1,japanese-vlgothic,japanese-sazanami,japanese-kochi --sequence.allfonts.EUC-KR=latin-1,korean-un,korean-baekmuk --sequence.allfonts.Big5=latin-1,umingtw,shanheisun,wqy-zenhei --sequence.allfonts.Big5-HKSCS=latin-1,uminghk,shanheisun,wqy-zenhei --#sequence.fallback=uminghk,shanheisun,wqy-zenhei,japanese-vlgothic,japanese-kochi,japanese-sazanami,korean-un,korean-baekmuk,bengali,gujarati,hindi,oriya,punjabi,malayalam,tamil,telugu,sinhala --sequence.fallback=uminghk,shanheisun,wqy-zenhei,japanese-vlgothic,japanese-sazanami,japanese-kochi,korean-un,korean-baekmuk,bengali,gujarati,hindi,oriya,punjabi,tamil,telugu -- --# Exclusion Ranges -- --exclusion.japanese-kochi=0390-03d6,2200-22ef,2701-27be --exclusion.japanese-sazanami=0390-03d6,2200-22ef,2701-27be --exclusion.japanese-vlgothic=0390-03d6,2200-22ef,2701-27be -- --# Font File Names -- --filename.DejaVu_Sans=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf --filename.DejaVu_Sans_Bold=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf --filename.DejaVu_Sans_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf --filename.DejaVu_Sans_Bold_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf -- --filename.DejaVu_Sans_Mono=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf --filename.DejaVu_Sans_Mono_Bold=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf --filename.DejaVu_Sans_Mono_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf --filename.DejaVu_Sans_Mono_Bold_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf -- --filename.DejaVu_Serif=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf --filename.DejaVu_Serif_Bold=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf --filename.DejaVu_Serif_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Oblique.ttf --filename.DejaVu_Serif_Bold_Oblique=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-BoldOblique.ttf -- --filename.AR_PL_UMing_CN=/usr/share/fonts/truetype/arphic/uming.ttc --filename.AR_PL_UMing_HK=/usr/share/fonts/truetype/arphic/uming.ttc --filename.AR_PL_UMing_TW=/usr/share/fonts/truetype/arphic/uming.ttc --filename.AR_PL_ShanHeiSun_Uni=/usr/share/fonts/truetype/arphic/uming.ttf -- --filename.WenQuanYi_Zen_Hei=/usr/share/fonts/truetype/wqy/wqy-zenhei.ttf --filename.Baekmuk_Batang=/usr/share/fonts/truetype/baekmuk/batang.ttf --filename.UnBatang=/usr/share/fonts/truetype/unfonts/UnBatang.ttf --filename.UnBatang_Bold=/usr/share/fonts/truetype/unfonts/UnBatangBold.ttf --filename.Baekmuk_Gulim=/usr/share/fonts/truetype/baekmuk/gulim.ttf --filename.UnDotum=/usr/share/fonts/truetype/unfonts/UnDotum.ttf --filename.UnDotum_Bold=/usr/share/fonts/truetype/unfonts/UnDotumBold.ttf --filename.Kochi_Gothic=/usr/share/fonts/truetype/kochi/kochi-gothic.ttf --filename.Sazanami_Gothic=/usr/share/fonts/truetype/sazanami/sazanami-gothic.ttf --filename.Kochi_Mincho=/usr/share/fonts/truetype/kochi/kochi-mincho.ttf --filename.Sazanami_Mincho=/usr/share/fonts/truetype/sazanami/sazanami-mincho.ttf --filename.VL_Gothic=/usr/share/fonts/truetype/vlgothic/VL-Gothic-Regular.ttf --filename.VL_PGothic=/usr/share/fonts/truetype/vlgothic/VL-PGothic-Regular.ttf -- --filename.Lohit_Bengali=/usr/share/fonts/truetype/ttf-bengali-fonts/lohit_bn.ttf --filename.Lohit_Gujarati=/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_gu.ttf --filename.Lohit_Hindi=/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_hi.ttf --filename.Lohit_Kannda=/usr/share/fonts/truetype/ttf-kannada-fonts/lohit_kn.ttf --#filename.Lohit_Malayalam=/usr/share/fonts/lohit-malayalam/lohit_ml.ttf --filename.Lohit_Oriya=/usr/share/fonts/truetype/ttf-oriya-fonts/lohit_or.ttf --filename.Lohit_Punjabi=/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf --filename.Lohit_Tamil=/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_ta.ttf --filename.Lohit_Telugu=/usr/share/fonts/truetype/ttf-telugu-fonts/lohit_te.ttf --filename.LKLUG=/usr/share/fonts/truetype/ttf-sinhala-lklug/lklug.ttf -- --filename.LuxiSans-Regular=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxisr.ttf --filename.LuxiSans-Bold=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxisb.ttf --filename.LuxiSans-Oblique=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxisri.ttf --filename.LuxiSans-BoldOblique=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxisbi.ttf --filename.LuxiMono-Regular=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luximr.ttf --filename.LuxiMono-Bold=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luximb.ttf --filename.LuxiMono-Oblique=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luximri.ttf --filename.LuxiMono-BoldOblique=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luximbi.ttf --filename.LuxiSerif-Regular=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxirr.ttf --filename.LuxiSerif-Bold=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxirb.ttf --filename.LuxiSerif-Oblique=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxirri.ttf --filename.LuxiSerif-BoldOblique=/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxirbi.ttf -- --# AWT X11 font paths --awtfontpath.latin-1=/usr/share/fonts/X11/Type1 --awtfontpath.umingcn=/usr/share/fonts/truetype/arphic --awtfontpath.uminghk=/usr/share/fonts/truetype/arphic --awtfontpath.umingtw=/usr/share/fonts/truetype/arphic --awtfontpath.shanheisun=/usr/share/fonts/truetype/arphic --awtfontpath.wqy-zenhei=/usr/share/fonts/truetype/wqy --awtfontpath.japanese-kochi=/usr/share/fonts/truetype/kochi --awtfontpath.japanese-sazanami=/usr/share/fonts/truetype/sazanami --awtfontpath.japanese-vlgothic=/usr/share/fonts/truetype/vlgothic --awtfontpath.korean-baekmuk=/usr/share/fonts/truetype/baekmuk --awtfontpath.korean-un=/usr/share/fonts/truetype/unfonts ---- ./jdk/src/solaris/classes/sun/nio/ch/BsdAsynchronousChannelProvider.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/ch/BsdAsynchronousChannelProvider.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,90 +0,0 @@ --/* -- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --package sun.nio.ch; -- --import java.nio.channels.*; --import java.nio.channels.spi.AsynchronousChannelProvider; --import java.util.concurrent.ExecutorService; --import java.util.concurrent.ThreadFactory; --import java.io.IOException; -- --public class BsdAsynchronousChannelProvider -- extends AsynchronousChannelProvider --{ -- private static volatile EPollPort defaultPort; -- -- private EPollPort defaultEventPort() throws IOException { -- if (defaultPort == null) { -- synchronized (BsdAsynchronousChannelProvider.class) { -- if (defaultPort == null) { -- defaultPort = new EPollPort(this, ThreadPool.getDefault()).start(); -- } -- } -- } -- return defaultPort; -- } -- -- public BsdAsynchronousChannelProvider() { -- } -- -- @Override -- public AsynchronousChannelGroup openAsynchronousChannelGroup(int nThreads, ThreadFactory factory) -- throws IOException -- { -- return new EPollPort(this, ThreadPool.create(nThreads, factory)).start(); -- } -- -- @Override -- public AsynchronousChannelGroup openAsynchronousChannelGroup(ExecutorService executor, int initialSize) -- throws IOException -- { -- return new EPollPort(this, ThreadPool.wrap(executor, initialSize)).start(); -- } -- -- private Port toPort(AsynchronousChannelGroup group) throws IOException { -- if (group == null) { -- return defaultEventPort(); -- } else { -- if (!(group instanceof EPollPort)) -- throw new IllegalChannelGroupException(); -- return (Port)group; -- } -- } -- -- @Override -- public AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(AsynchronousChannelGroup group) -- throws IOException -- { -- return new UnixAsynchronousServerSocketChannelImpl(toPort(group)); -- } -- -- @Override -- public AsynchronousSocketChannel openAsynchronousSocketChannel(AsynchronousChannelGroup group) -- throws IOException -- { -- return new UnixAsynchronousSocketChannelImpl(toPort(group)); -- } --} ---- ./jdk/src/solaris/classes/sun/nio/fs/BsdDosFileAttributeView.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/BsdDosFileAttributeView.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,281 +0,0 @@ --/* -- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --package sun.nio.fs; -- --import java.nio.file.attribute.*; --import java.util.Map; --import java.util.Set; --import java.io.IOException; --import sun.misc.Unsafe; -- --import static sun.nio.fs.UnixNativeDispatcher.*; --import static sun.nio.fs.UnixConstants.*; -- --/** -- * Bsd implementation of DosFileAttributeView for use on file systems such -- * as ext3 that have extended attributes enabled and SAMBA configured to store -- * DOS attributes. -- */ -- --class BsdDosFileAttributeView -- extends UnixFileAttributeViews.Basic implements DosFileAttributeView --{ -- private static final Unsafe unsafe = Unsafe.getUnsafe(); -- -- private static final String READONLY_NAME = "readonly"; -- private static final String ARCHIVE_NAME = "archive"; -- private static final String SYSTEM_NAME = "system"; -- private static final String HIDDEN_NAME = "hidden"; -- -- private static final String DOS_XATTR_NAME = "user.DOSATTRIB"; -- private static final byte[] DOS_XATTR_NAME_AS_BYTES = DOS_XATTR_NAME.getBytes(); -- -- private static final int DOS_XATTR_READONLY = 0x01; -- private static final int DOS_XATTR_HIDDEN = 0x02; -- private static final int DOS_XATTR_SYSTEM = 0x04; -- private static final int DOS_XATTR_ARCHIVE = 0x20; -- -- // the names of the DOS attributes (includes basic) -- private static final Set<String> dosAttributeNames = -- Util.newSet(basicAttributeNames, READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME, HIDDEN_NAME); -- -- BsdDosFileAttributeView(UnixPath file, boolean followLinks) { -- super(file, followLinks); -- } -- -- @Override -- public String name() { -- return "dos"; -- } -- -- @Override -- public void setAttribute(String attribute, Object value) -- throws IOException -- { -- if (attribute.equals(READONLY_NAME)) { -- setReadOnly((Boolean)value); -- return; -- } -- if (attribute.equals(ARCHIVE_NAME)) { -- setArchive((Boolean)value); -- return; -- } -- if (attribute.equals(SYSTEM_NAME)) { -- setSystem((Boolean)value); -- return; -- } -- if (attribute.equals(HIDDEN_NAME)) { -- setHidden((Boolean)value); -- return; -- } -- super.setAttribute(attribute, value); -- } -- -- @Override -- public Map<String,Object> readAttributes(String[] attributes) -- throws IOException -- { -- AttributesBuilder builder = -- AttributesBuilder.create(dosAttributeNames, attributes); -- DosFileAttributes attrs = readAttributes(); -- addRequestedBasicAttributes(attrs, builder); -- if (builder.match(READONLY_NAME)) -- builder.add(READONLY_NAME, attrs.isReadOnly()); -- if (builder.match(ARCHIVE_NAME)) -- builder.add(ARCHIVE_NAME, attrs.isArchive()); -- if (builder.match(SYSTEM_NAME)) -- builder.add(SYSTEM_NAME, attrs.isSystem()); -- if (builder.match(HIDDEN_NAME)) -- builder.add(HIDDEN_NAME, attrs.isHidden()); -- return builder.unmodifiableMap(); -- } -- -- @Override -- public DosFileAttributes readAttributes() throws IOException { -- file.checkRead(); -- -- int fd = file.openForAttributeAccess(followLinks); -- try { -- final UnixFileAttributes attrs = UnixFileAttributes.get(fd); -- final int dosAttribute = getDosAttribute(fd); -- -- return new DosFileAttributes() { -- @Override -- public FileTime lastModifiedTime() { -- return attrs.lastModifiedTime(); -- } -- @Override -- public FileTime lastAccessTime() { -- return attrs.lastAccessTime(); -- } -- @Override -- public FileTime creationTime() { -- return attrs.creationTime(); -- } -- @Override -- public boolean isRegularFile() { -- return attrs.isRegularFile(); -- } -- @Override -- public boolean isDirectory() { -- return attrs.isDirectory(); -- } -- @Override -- public boolean isSymbolicLink() { -- return attrs.isSymbolicLink(); -- } -- @Override -- public boolean isOther() { -- return attrs.isOther(); -- } -- @Override -- public long size() { -- return attrs.size(); -- } -- @Override -- public Object fileKey() { -- return attrs.fileKey(); -- } -- @Override -- public boolean isReadOnly() { -- return (dosAttribute & DOS_XATTR_READONLY) != 0; -- } -- @Override -- public boolean isHidden() { -- return (dosAttribute & DOS_XATTR_HIDDEN) != 0; -- } -- @Override -- public boolean isArchive() { -- return (dosAttribute & DOS_XATTR_ARCHIVE) != 0; -- } -- @Override -- public boolean isSystem() { -- return (dosAttribute & DOS_XATTR_SYSTEM) != 0; -- } -- }; -- -- } catch (UnixException x) { -- x.rethrowAsIOException(file); -- return null; // keep compiler happy -- } finally { -- close(fd); -- } -- } -- -- @Override -- public void setReadOnly(boolean value) throws IOException { -- updateDosAttribute(DOS_XATTR_READONLY, value); -- } -- -- @Override -- public void setHidden(boolean value) throws IOException { -- updateDosAttribute(DOS_XATTR_HIDDEN, value); -- } -- -- @Override -- public void setArchive(boolean value) throws IOException { -- updateDosAttribute(DOS_XATTR_ARCHIVE, value); -- } -- -- @Override -- public void setSystem(boolean value) throws IOException { -- updateDosAttribute(DOS_XATTR_SYSTEM, value); -- } -- -- /** -- * Reads the value of the user.DOSATTRIB extended attribute -- */ -- private int getDosAttribute(int fd) throws UnixException { -- final int size = 24; -- -- NativeBuffer buffer = NativeBuffers.getNativeBuffer(size); -- try { -- int len = BsdNativeDispatcher -- .fgetxattr(fd, DOS_XATTR_NAME_AS_BYTES, buffer.address(), size); -- -- if (len > 0) { -- // ignore null terminator -- if (unsafe.getByte(buffer.address()+len-1) == 0) -- len--; -- -- // convert to String and parse -- byte[] buf = new byte[len]; -- unsafe.copyMemory(null, buffer.address(), buf, -- Unsafe.ARRAY_BYTE_BASE_OFFSET, len); -- String value = new String(buf); // platform encoding -- -- // should be something like 0x20 -- if (value.length() >= 3 && value.startsWith("0x")) { -- try { -- return Integer.parseInt(value.substring(2), 16); -- } catch (NumberFormatException x) { -- // ignore -- } -- } -- } -- throw new UnixException("Value of " + DOS_XATTR_NAME + " attribute is invalid"); -- } catch (UnixException x) { -- // default value when attribute does not exist -- if (x.errno() == ENODATA) -- return 0; -- throw x; -- } finally { -- buffer.release(); -- } -- } -- -- /** -- * Updates the value of the user.DOSATTRIB extended attribute -- */ -- private void updateDosAttribute(int flag, boolean enable) throws IOException { -- file.checkWrite(); -- -- int fd = file.openForAttributeAccess(followLinks); -- try { -- int oldValue = getDosAttribute(fd); -- int newValue = oldValue; -- if (enable) { -- newValue |= flag; -- } else { -- newValue &= ~flag; -- } -- if (newValue != oldValue) { -- byte[] value = ("0x" + Integer.toHexString(newValue)).getBytes(); -- NativeBuffer buffer = NativeBuffers.asNativeBuffer(value); -- try { -- BsdNativeDispatcher.fsetxattr(fd, DOS_XATTR_NAME_AS_BYTES, -- buffer.address(), value.length+1); -- } finally { -- buffer.release(); -- } -- } -- } catch (UnixException x) { -- x.rethrowAsIOException(file); -- } finally { -- close(fd); -- } -- } --} ---- ./jdk/src/solaris/classes/sun/nio/fs/BsdFileStore.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/BsdFileStore.java 2011-04-22 23:08:38.000000000 -0700 -@@ -36,10 +36,6 @@ - class BsdFileStore - extends UnixFileStore - { -- // used when checking if extended attributes are enabled or not -- private volatile boolean xattrChecked; -- private volatile boolean xattrEnabled; -- - BsdFileStore(UnixPath file) throws IOException { - super(file); - } -@@ -54,7 +50,7 @@ - */ - @Override - UnixMountEntry findMountEntry() throws IOException { -- BsdFileSystem fs = (BsdFileSystem)file().getFileSystem(); -+ UnixFileSystem fs = file().getFileSystem(); - - // step 1: get realpath - UnixPath path = null; -@@ -80,20 +76,20 @@ - parent = parent.getParent(); - } - -- // step 3: lookup mounted file systems (use /proc/mounts to ensure we -- // find the file system even when not in /etc/mtab) -+ // step 3: lookup mounted file systems - byte[] dir = path.asByteArray(); -- for (UnixMountEntry entry: fs.getMountEntries("/proc/mounts")) { -+ for (UnixMountEntry entry: fs.getMountEntries()) { - if (Arrays.equals(dir, entry.dir())) - return entry; - } - -- throw new IOException("Mount point not found"); -+ throw new IOException("Mount point not found in fstab"); - } - - // returns true if extended attributes enabled on file system where given - // file resides, returns false if disabled or unable to determine. - private boolean isExtendedAttributesEnabled(UnixPath path) { -+/* - try { - int fd = path.openForAttributeAccess(false); - try { -@@ -110,11 +106,13 @@ - } catch (IOException ignore) { - // nothing we can do - } -+*/ - return false; - } - - @Override - public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) { -+/* - // support DosFileAttributeView and UserDefinedAttributeView if extended - // attributes enabled - if (type == DosFileAttributeView.class || -@@ -145,15 +143,18 @@ - } - return xattrEnabled; - } -+*/ - return super.supportsFileAttributeView(type); - } - - @Override - public boolean supportsFileAttributeView(String name) { -+/* - if (name.equals("dos")) - return supportsFileAttributeView(DosFileAttributeView.class); - if (name.equals("user")) - return supportsFileAttributeView(UserDefinedFileAttributeView.class); -+*/ - return super.supportsFileAttributeView(name); - } - } ---- ./jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/BsdFileSystem.java 2011-04-22 23:08:38.000000000 -0700 -@@ -28,13 +28,15 @@ - import java.nio.file.*; - import java.io.IOException; - import java.util.*; --import static sun.nio.fs.BsdNativeDispatcher.*; -+import java.security.AccessController; -+import sun.security.action.GetPropertyAction; - - /** - * Bsd implementation of FileSystem - */ - - class BsdFileSystem extends UnixFileSystem { -+ - BsdFileSystem(UnixFileSystemProvider provider, String dir) { - super(provider, dir); - } -@@ -43,21 +45,17 @@ - public WatchService newWatchService() - throws IOException - { -- // assume 2.6.13 or newer -- return new BsdWatchService(this); -+ // use polling implementation until we implement a BSD/kqueue one -+ return new PollingWatchService(); - } - -- - // lazy initialization of the list of supported attribute views - private static class SupportedFileFileAttributeViewsHolder { - static final Set<String> supportedFileAttributeViews = - supportedFileAttributeViews(); - private static Set<String> supportedFileAttributeViews() { -- Set<String> result = new HashSet<>(); -+ Set<String> result = new HashSet<String>(); - result.addAll(standardFileAttributeViews()); -- // additional Bsd-specific views -- result.add("dos"); -- result.add("user"); - return Collections.unmodifiableSet(result); - } - } -@@ -69,26 +67,26 @@ - - @Override - void copyNonPosixAttributes(int ofd, int nfd) { -- BsdUserDefinedFileAttributeView.copyExtendedAttributes(ofd, nfd); - } - - /** -- * Returns object to iterate over the mount entries in the given fstab file. -+ * Returns object to iterate over mount entries - */ -- Iterable<UnixMountEntry> getMountEntries(String fstab) { -- ArrayList<UnixMountEntry> entries = new ArrayList<>(); -+ @Override -+ Iterable<UnixMountEntry> getMountEntries() { -+ ArrayList<UnixMountEntry> entries = new ArrayList<UnixMountEntry>(); - try { -- long fp = setmntent(fstab.getBytes(), "r".getBytes()); -+ long iter = BsdNativeDispatcher.getfsstat(); - try { - for (;;) { - UnixMountEntry entry = new UnixMountEntry(); -- int res = getextmntent(fp, entry); -+ int res = BsdNativeDispatcher.fsstatEntry(iter, entry); - if (res < 0) - break; - entries.add(entry); - } - } finally { -- endmntent(fp); -+ BsdNativeDispatcher.endfsstat(iter); - } - - } catch (UnixException x) { -@@ -97,14 +95,6 @@ - return entries; - } - -- /** -- * Returns object to iterate over the mount entries in /etc/mtab -- */ -- @Override -- Iterable<UnixMountEntry> getMountEntries() { -- return getMountEntries("/etc/mtab"); -- } -- - - - @Override ---- ./jdk/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java 2011-04-22 23:08:38.000000000 -0700 -@@ -54,14 +54,6 @@ - Class<V> type, - LinkOption... options) - { -- if (type == DosFileAttributeView.class) { -- return (V) new BsdDosFileAttributeView(UnixPath.toUnixPath(obj), -- Util.followLinks(options)); -- } -- if (type == UserDefinedFileAttributeView.class) { -- return (V) new BsdUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), -- Util.followLinks(options)); -- } - return super.getFileAttributeView(obj, type, options); - } - -@@ -70,14 +62,6 @@ - String name, - LinkOption... options) - { -- if (name.equals("dos")) { -- return new BsdDosFileAttributeView(UnixPath.toUnixPath(obj), -- Util.followLinks(options)); -- } -- if (name.equals("user")) { -- return new BsdUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), -- Util.followLinks(options)); -- } - return super.getFileAttributeView(obj, name, options); - } - ---- ./jdk/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java 2011-04-22 23:08:38.000000000 -0700 -@@ -36,84 +36,23 @@ - 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<Void>() { -@@ -121,6 +60,6 @@ - System.loadLibrary("nio"); - return null; - }}); -- init(); -+ initIDs(); - } - } ---- ./jdk/src/solaris/classes/sun/nio/fs/BsdUserDefinedFileAttributeView.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/BsdUserDefinedFileAttributeView.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,350 +0,0 @@ --/* -- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --package sun.nio.fs; -- --import java.nio.file.*; --import java.nio.ByteBuffer; --import java.io.IOException; --import java.util.*; --import sun.misc.Unsafe; -- --import static sun.nio.fs.UnixConstants.*; --import static sun.nio.fs.BsdNativeDispatcher.*; -- --/** -- * Bsd implementation of UserDefinedFileAttributeView using extended attributes. -- */ -- --class BsdUserDefinedFileAttributeView -- extends AbstractUserDefinedFileAttributeView --{ -- private static final Unsafe unsafe = Unsafe.getUnsafe(); -- -- // namespace for extended user attributes -- private static final String USER_NAMESPACE = "user."; -- -- // maximum bytes in extended attribute name (includes namespace) -- private static final int XATTR_NAME_MAX = 255; -- -- private byte[] nameAsBytes(UnixPath file, String name) throws IOException { -- if (name == null) -- throw new NullPointerException("'name' is null"); -- name = USER_NAMESPACE + name; -- byte[] bytes = name.getBytes(); -- if (bytes.length > XATTR_NAME_MAX) { -- throw new FileSystemException(file.getPathForExecptionMessage(), -- null, "'" + name + "' is too big"); -- } -- return bytes; -- } -- -- // Parses buffer as array of NULL-terminated C strings. -- private List<String> asList(long address, int size) { -- List<String> list = new ArrayList<>(); -- int start = 0; -- int pos = 0; -- while (pos < size) { -- if (unsafe.getByte(address + pos) == 0) { -- int len = pos - start; -- byte[] value = new byte[len]; -- unsafe.copyMemory(null, address+start, value, -- Unsafe.ARRAY_BYTE_BASE_OFFSET, len); -- String s = new String(value); -- if (s.startsWith(USER_NAMESPACE)) { -- s = s.substring(USER_NAMESPACE.length()); -- list.add(s); -- } -- start = pos + 1; -- } -- pos++; -- } -- return list; -- } -- -- private final UnixPath file; -- private final boolean followLinks; -- -- BsdUserDefinedFileAttributeView(UnixPath file, boolean followLinks) { -- this.file = file; -- this.followLinks = followLinks; -- } -- -- @Override -- public List<String> list() throws IOException { -- if (System.getSecurityManager() != null) -- checkAccess(file.getPathForPermissionCheck(), true, false); -- -- int fd = file.openForAttributeAccess(followLinks); -- NativeBuffer buffer = null; -- try { -- int size = 1024; -- buffer = NativeBuffers.getNativeBuffer(size); -- for (;;) { -- try { -- int n = flistxattr(fd, buffer.address(), size); -- List<String> list = asList(buffer.address(), n); -- return Collections.unmodifiableList(list); -- } catch (UnixException x) { -- // allocate larger buffer if required -- if (x.errno() == ERANGE && size < 32*1024) { -- buffer.release(); -- size *= 2; -- buffer = null; -- buffer = NativeBuffers.getNativeBuffer(size); -- continue; -- } -- throw new FileSystemException(file.getPathForExecptionMessage(), -- null, "Unable to get list of extended attributes: " + -- x.getMessage()); -- } -- } -- } finally { -- if (buffer != null) -- buffer.release(); -- close(fd); -- } -- } -- -- @Override -- public int size(String name) throws IOException { -- if (System.getSecurityManager() != null) -- checkAccess(file.getPathForPermissionCheck(), true, false); -- -- int fd = file.openForAttributeAccess(followLinks); -- try { -- // fgetxattr returns size if called with size==0 -- return fgetxattr(fd, nameAsBytes(file,name), 0L, 0); -- } catch (UnixException x) { -- throw new FileSystemException(file.getPathForExecptionMessage(), -- null, "Unable to get size of extended attribute '" + name + -- "': " + x.getMessage()); -- } finally { -- close(fd); -- } -- } -- -- @Override -- public int read(String name, ByteBuffer dst) throws IOException { -- if (System.getSecurityManager() != null) -- checkAccess(file.getPathForPermissionCheck(), true, false); -- -- if (dst.isReadOnly()) -- throw new IllegalArgumentException("Read-only buffer"); -- int pos = dst.position(); -- int lim = dst.limit(); -- assert (pos <= lim); -- int rem = (pos <= lim ? lim - pos : 0); -- -- NativeBuffer nb; -- long address; -- if (dst instanceof sun.nio.ch.DirectBuffer) { -- nb = null; -- address = ((sun.nio.ch.DirectBuffer)dst).address() + pos; -- } else { -- // substitute with native buffer -- nb = NativeBuffers.getNativeBuffer(rem); -- address = nb.address(); -- } -- -- int fd = file.openForAttributeAccess(followLinks); -- try { -- try { -- int n = fgetxattr(fd, nameAsBytes(file,name), address, rem); -- -- // if remaining is zero then fgetxattr returns the size -- if (rem == 0) { -- if (n > 0) -- throw new UnixException(ERANGE); -- return 0; -- } -- -- // copy from buffer into backing array if necessary -- if (nb != null) { -- int off = dst.arrayOffset() + pos + Unsafe.ARRAY_BYTE_BASE_OFFSET; -- unsafe.copyMemory(null, address, dst.array(), off, n); -- } -- dst.position(pos + n); -- return n; -- } catch (UnixException x) { -- String msg = (x.errno() == ERANGE) ? -- "Insufficient space in buffer" : x.getMessage(); -- throw new FileSystemException(file.getPathForExecptionMessage(), -- null, "Error reading extended attribute '" + name + "': " + msg); -- } finally { -- close(fd); -- } -- } finally { -- if (nb != null) -- nb.release(); -- } -- } -- -- @Override -- public int write(String name, ByteBuffer src) throws IOException { -- if (System.getSecurityManager() != null) -- checkAccess(file.getPathForPermissionCheck(), false, true); -- -- int pos = src.position(); -- int lim = src.limit(); -- assert (pos <= lim); -- int rem = (pos <= lim ? lim - pos : 0); -- -- NativeBuffer nb; -- long address; -- if (src instanceof sun.nio.ch.DirectBuffer) { -- nb = null; -- address = ((sun.nio.ch.DirectBuffer)src).address() + pos; -- } else { -- // substitute with native buffer -- nb = NativeBuffers.getNativeBuffer(rem); -- address = nb.address(); -- -- if (src.hasArray()) { -- // copy from backing array into buffer -- int off = src.arrayOffset() + pos + Unsafe.ARRAY_BYTE_BASE_OFFSET; -- unsafe.copyMemory(src.array(), off, null, address, rem); -- } else { -- // backing array not accessible so transfer via temporary array -- byte[] tmp = new byte[rem]; -- src.get(tmp); -- src.position(pos); // reset position as write may fail -- unsafe.copyMemory(tmp, Unsafe.ARRAY_BYTE_BASE_OFFSET, null, -- address, rem); -- } -- } -- -- int fd = file.openForAttributeAccess(followLinks); -- try { -- try { -- fsetxattr(fd, nameAsBytes(file,name), address, rem); -- src.position(pos + rem); -- return rem; -- } catch (UnixException x) { -- throw new FileSystemException(file.getPathForExecptionMessage(), -- null, "Error writing extended attribute '" + name + "': " + -- x.getMessage()); -- } finally { -- close(fd); -- } -- } finally { -- if (nb != null) -- nb.release(); -- } -- } -- -- @Override -- public void delete(String name) throws IOException { -- if (System.getSecurityManager() != null) -- checkAccess(file.getPathForPermissionCheck(), false, true); -- -- int fd = file.openForAttributeAccess(followLinks); -- try { -- fremovexattr(fd, nameAsBytes(file,name)); -- } catch (UnixException x) { -- throw new FileSystemException(file.getPathForExecptionMessage(), -- null, "Unable to delete extended attribute '" + name + "': " + x.getMessage()); -- } finally { -- close(fd); -- } -- } -- -- /** -- * Used by copyTo/moveTo to copy extended attributes from source to target. -- * -- * @param ofd -- * file descriptor for source file -- * @param nfd -- * file descriptor for target file -- */ -- static void copyExtendedAttributes(int ofd, int nfd) { -- NativeBuffer buffer = null; -- try { -- -- // call flistxattr to get list of extended attributes. -- int size = 1024; -- buffer = NativeBuffers.getNativeBuffer(size); -- for (;;) { -- try { -- size = flistxattr(ofd, buffer.address(), size); -- break; -- } catch (UnixException x) { -- // allocate larger buffer if required -- if (x.errno() == ERANGE && size < 32*1024) { -- buffer.release(); -- size *= 2; -- buffer = null; -- buffer = NativeBuffers.getNativeBuffer(size); -- continue; -- } -- -- // unable to get list of attributes -- return; -- } -- } -- -- // parse buffer as array of NULL-terminated C strings. -- long address = buffer.address(); -- int start = 0; -- int pos = 0; -- while (pos < size) { -- if (unsafe.getByte(address + pos) == 0) { -- // extract attribute name and copy attribute to target. -- // FIXME: We can avoid needless copying by using address+pos -- // as the address of the name. -- int len = pos - start; -- byte[] name = new byte[len]; -- unsafe.copyMemory(null, address+start, name, -- Unsafe.ARRAY_BYTE_BASE_OFFSET, len); -- try { -- copyExtendedAttribute(ofd, name, nfd); -- } catch (UnixException ignore) { -- // ignore -- } -- start = pos + 1; -- } -- pos++; -- } -- -- } finally { -- if (buffer != null) -- buffer.release(); -- } -- } -- -- private static void copyExtendedAttribute(int ofd, byte[] name, int nfd) -- throws UnixException -- { -- int size = fgetxattr(ofd, name, 0L, 0); -- NativeBuffer buffer = NativeBuffers.getNativeBuffer(size); -- try { -- long address = buffer.address(); -- size = fgetxattr(ofd, name, address, size); -- fsetxattr(nfd, name, address, size); -- } finally { -- buffer.release(); -- } -- } --} ---- ./jdk/src/solaris/classes/sun/nio/fs/BsdWatchService.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/BsdWatchService.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,463 +0,0 @@ --/* -- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --package sun.nio.fs; -- --import java.nio.file.*; --import java.security.AccessController; --import java.security.PrivilegedAction; --import java.util.*; --import java.io.IOException; --import sun.misc.Unsafe; -- --import static sun.nio.fs.UnixNativeDispatcher.*; --import static sun.nio.fs.UnixConstants.*; -- --/** -- * Bsd implementation of WatchService based on inotify. -- * -- * In summary a background thread polls inotify plus a socket used for the wakeup -- * mechanism. Requests to add or remove a watch, or close the watch service, -- * cause the thread to wakeup and process the request. Events are processed -- * by the thread which causes it to signal/queue the corresponding watch keys. -- */ -- --class BsdWatchService -- extends AbstractWatchService --{ -- private static final Unsafe unsafe = Unsafe.getUnsafe(); -- -- // background thread to read change events -- private final Poller poller; -- -- BsdWatchService(UnixFileSystem fs) throws IOException { -- // initialize inotify -- int ifd = - 1; -- try { -- ifd = inotifyInit(); -- } catch (UnixException x) { -- throw new IOException(x.errorString()); -- } -- -- // configure inotify to be non-blocking -- // create socketpair used in the close mechanism -- int sp[] = new int[2]; -- try { -- configureBlocking(ifd, false); -- socketpair(sp); -- configureBlocking(sp[0], false); -- } catch (UnixException x) { -- UnixNativeDispatcher.close(ifd); -- throw new IOException(x.errorString()); -- } -- -- this.poller = new Poller(fs, this, ifd, sp); -- this.poller.start(); -- } -- -- @Override -- WatchKey register(Path dir, -- WatchEvent.Kind<?>[] events, -- WatchEvent.Modifier... modifiers) -- throws IOException -- { -- // delegate to poller -- return poller.register(dir, events, modifiers); -- } -- -- @Override -- void implClose() throws IOException { -- // delegate to poller -- poller.close(); -- } -- -- /** -- * WatchKey implementation -- */ -- private static class BsdWatchKey extends AbstractWatchKey { -- // inotify descriptor -- private final int ifd; -- // watch descriptor -- private volatile int wd; -- -- BsdWatchKey(UnixPath dir, BsdWatchService watcher, int ifd, int wd) { -- super(dir, watcher); -- this.ifd = ifd; -- this.wd = wd; -- } -- -- int descriptor() { -- return wd; -- } -- -- void invalidate(boolean remove) { -- if (remove) { -- try { -- inotifyRmWatch(ifd, wd); -- } catch (UnixException x) { -- // ignore -- } -- } -- wd = -1; -- } -- -- @Override -- public boolean isValid() { -- return (wd != -1); -- } -- -- @Override -- public void cancel() { -- if (isValid()) { -- // delegate to poller -- ((BsdWatchService)watcher()).poller.cancel(this); -- } -- } -- } -- -- /** -- * Background thread to read from inotify -- */ -- private static class Poller extends AbstractPoller { -- /** -- * struct inotify_event { -- * int wd; -- * uint32_t mask; -- * uint32_t len; -- * char name __flexarr; // present if len > 0 -- * } act_t; -- */ -- private static final int SIZEOF_INOTIFY_EVENT = eventSize(); -- private static final int[] offsets = eventOffsets(); -- private static final int OFFSETOF_WD = offsets[0]; -- private static final int OFFSETOF_MASK = offsets[1]; -- private static final int OFFSETOF_LEN = offsets[3]; -- private static final int OFFSETOF_NAME = offsets[4]; -- -- private static final int IN_MODIFY = 0x00000002; -- private static final int IN_ATTRIB = 0x00000004; -- private static final int IN_MOVED_FROM = 0x00000040; -- private static final int IN_MOVED_TO = 0x00000080; -- private static final int IN_CREATE = 0x00000100; -- private static final int IN_DELETE = 0x00000200; -- -- private static final int IN_UNMOUNT = 0x00002000; -- private static final int IN_Q_OVERFLOW = 0x00004000; -- private static final int IN_IGNORED = 0x00008000; -- -- // sizeof buffer for when polling inotify -- private static final int BUFFER_SIZE = 8192; -- -- private final UnixFileSystem fs; -- private final BsdWatchService watcher; -- -- // inotify file descriptor -- private final int ifd; -- // socketpair used to shutdown polling thread -- private final int socketpair[]; -- // maps watch descriptor to Key -- private final Map<Integer,BsdWatchKey> wdToKey; -- // address of read buffer -- private final long address; -- -- Poller(UnixFileSystem fs, BsdWatchService watcher, int ifd, int[] sp) { -- this.fs = fs; -- this.watcher = watcher; -- this.ifd = ifd; -- this.socketpair = sp; -- this.wdToKey = new HashMap<Integer,BsdWatchKey>(); -- this.address = unsafe.allocateMemory(BUFFER_SIZE); -- } -- -- @Override -- void wakeup() throws IOException { -- // write to socketpair to wakeup polling thread -- try { -- write(socketpair[1], address, 1); -- } catch (UnixException x) { -- throw new IOException(x.errorString()); -- } -- } -- -- @Override -- Object implRegister(Path obj, -- Set<? extends WatchEvent.Kind<?>> events, -- WatchEvent.Modifier... modifiers) -- { -- UnixPath dir = (UnixPath)obj; -- -- int mask = 0; -- for (WatchEvent.Kind<?> event: events) { -- if (event == StandardWatchEventKinds.ENTRY_CREATE) { -- mask |= IN_CREATE | IN_MOVED_TO; -- continue; -- } -- if (event == StandardWatchEventKinds.ENTRY_DELETE) { -- mask |= IN_DELETE | IN_MOVED_FROM; -- continue; -- } -- if (event == StandardWatchEventKinds.ENTRY_MODIFY) { -- mask |= IN_MODIFY | IN_ATTRIB; -- continue; -- } -- } -- -- // no modifiers supported at this time -- if (modifiers.length > 0) { -- for (WatchEvent.Modifier modifier: modifiers) { -- if (modifier == null) -- return new NullPointerException(); -- if (modifier instanceof com.sun.nio.file.SensitivityWatchEventModifier) -- continue; // ignore -- return new UnsupportedOperationException("Modifier not supported"); -- } -- } -- -- // check file is directory -- UnixFileAttributes attrs = null; -- try { -- attrs = UnixFileAttributes.get(dir, true); -- } catch (UnixException x) { -- return x.asIOException(dir); -- } -- if (!attrs.isDirectory()) { -- return new NotDirectoryException(dir.getPathForExecptionMessage()); -- } -- -- // register with inotify (replaces existing mask if already registered) -- int wd = -1; -- try { -- NativeBuffer buffer = -- NativeBuffers.asNativeBuffer(dir.getByteArrayForSysCalls()); -- try { -- wd = inotifyAddWatch(ifd, buffer.address(), mask); -- } finally { -- buffer.release(); -- } -- } catch (UnixException x) { -- if (x.errno() == ENOSPC) { -- return new IOException("User limit of inotify watches reached"); -- } -- return x.asIOException(dir); -- } -- -- // ensure watch descriptor is in map -- BsdWatchKey key = wdToKey.get(wd); -- if (key == null) { -- key = new BsdWatchKey(dir, watcher, ifd, wd); -- wdToKey.put(wd, key); -- } -- return key; -- } -- -- // cancel single key -- @Override -- void implCancelKey(WatchKey obj) { -- BsdWatchKey key = (BsdWatchKey)obj; -- if (key.isValid()) { -- wdToKey.remove(key.descriptor()); -- key.invalidate(true); -- } -- } -- -- // close watch service -- @Override -- void implCloseAll() { -- // invalidate all keys -- for (Map.Entry<Integer,BsdWatchKey> entry: wdToKey.entrySet()) { -- entry.getValue().invalidate(true); -- } -- wdToKey.clear(); -- -- // free resources -- unsafe.freeMemory(address); -- UnixNativeDispatcher.close(socketpair[0]); -- UnixNativeDispatcher.close(socketpair[1]); -- UnixNativeDispatcher.close(ifd); -- } -- -- /** -- * Poller main loop -- */ -- @Override -- public void run() { -- try { -- for (;;) { -- int nReady, bytesRead; -- -- // wait for close or inotify event -- nReady = poll(ifd, socketpair[0]); -- -- // read from inotify -- try { -- bytesRead = read(ifd, address, BUFFER_SIZE); -- } catch (UnixException x) { -- if (x.errno() != EAGAIN) -- throw x; -- bytesRead = 0; -- } -- -- // process any pending requests -- if ((nReady > 1) || (nReady == 1 && bytesRead == 0)) { -- try { -- read(socketpair[0], address, BUFFER_SIZE); -- boolean shutdown = processRequests(); -- if (shutdown) -- break; -- } catch (UnixException x) { -- if (x.errno() != UnixConstants.EAGAIN) -- throw x; -- } -- } -- -- // iterate over buffer to decode events -- int offset = 0; -- while (offset < bytesRead) { -- long event = address + offset; -- int wd = unsafe.getInt(event + OFFSETOF_WD); -- int mask = unsafe.getInt(event + OFFSETOF_MASK); -- int len = unsafe.getInt(event + OFFSETOF_LEN); -- -- // file name -- UnixPath name = null; -- if (len > 0) { -- int actual = len; -- -- // null-terminated and maybe additional null bytes to -- // align the next event -- while (actual > 0) { -- long last = event + OFFSETOF_NAME + actual - 1; -- if (unsafe.getByte(last) != 0) -- break; -- actual--; -- } -- if (actual > 0) { -- byte[] buf = new byte[actual]; -- unsafe.copyMemory(null, event + OFFSETOF_NAME, -- buf, Unsafe.ARRAY_BYTE_BASE_OFFSET, actual); -- name = new UnixPath(fs, buf); -- } -- } -- -- // process event -- processEvent(wd, mask, name); -- -- offset += (SIZEOF_INOTIFY_EVENT + len); -- } -- } -- } catch (UnixException x) { -- x.printStackTrace(); -- } -- } -- -- -- /** -- * map inotify event to WatchEvent.Kind -- */ -- private WatchEvent.Kind<?> maskToEventKind(int mask) { -- if ((mask & IN_MODIFY) > 0) -- return StandardWatchEventKinds.ENTRY_MODIFY; -- if ((mask & IN_ATTRIB) > 0) -- return StandardWatchEventKinds.ENTRY_MODIFY; -- if ((mask & IN_CREATE) > 0) -- return StandardWatchEventKinds.ENTRY_CREATE; -- if ((mask & IN_MOVED_TO) > 0) -- return StandardWatchEventKinds.ENTRY_CREATE; -- if ((mask & IN_DELETE) > 0) -- return StandardWatchEventKinds.ENTRY_DELETE; -- if ((mask & IN_MOVED_FROM) > 0) -- return StandardWatchEventKinds.ENTRY_DELETE; -- return null; -- } -- -- /** -- * Process event from inotify -- */ -- private void processEvent(int wd, int mask, final UnixPath name) { -- // overflow - signal all keys -- if ((mask & IN_Q_OVERFLOW) > 0) { -- for (Map.Entry<Integer,BsdWatchKey> entry: wdToKey.entrySet()) { -- entry.getValue() -- .signalEvent(StandardWatchEventKinds.OVERFLOW, null); -- } -- return; -- } -- -- // lookup wd to get key -- BsdWatchKey key = wdToKey.get(wd); -- if (key == null) -- return; // should not happen -- -- // file deleted -- if ((mask & IN_IGNORED) > 0) { -- wdToKey.remove(wd); -- key.invalidate(false); -- key.signal(); -- return; -- } -- -- // event for directory itself -- if (name == null) -- return; -- -- // map to event and queue to key -- WatchEvent.Kind<?> kind = maskToEventKind(mask); -- if (kind != null) { -- key.signalEvent(kind, name); -- } -- } -- } -- -- // -- native methods -- -- -- // sizeof inotify_event -- private static native int eventSize(); -- -- // offsets of inotify_event -- private static native int[] eventOffsets(); -- -- private static native int inotifyInit() throws UnixException; -- -- private static native int inotifyAddWatch(int fd, long pathAddress, int mask) -- throws UnixException; -- -- private static native void inotifyRmWatch(int fd, int wd) -- throws UnixException; -- -- private static native void configureBlocking(int fd, boolean blocking) -- throws UnixException; -- -- private static native void socketpair(int[] sv) throws UnixException; -- -- private static native int poll(int fd1, int fd2) throws UnixException; -- -- static { -- AccessController.doPrivileged(new PrivilegedAction<Void>() { -- public Void run() { -- System.loadLibrary("nio"); -- return null; -- }}); -- } --} ---- ./jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java 2011-11-17 22:01:29.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java 2011-04-22 23:08:38.000000000 -0700 -@@ -68,6 +68,8 @@ +--- jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java 2012-05-17 16:18:01.000000000 -0700 +@@ -68,7 +68,7 @@ return createProvider("sun.nio.fs.SolarisFileSystemProvider"); if (osname.equals("Linux")) return createProvider("sun.nio.fs.LinuxFileSystemProvider"); -+ if (osname.endsWith("BSD") || osname.equals("Darwin")) -+ return createProvider("sun.nio.fs.BsdFileSystemProvider"); +- if (osname.equals("Darwin") || osname.contains("OS X")) ++ if (osname.endsWith("BSD") || osname.equals("Darwin") || osname.contains("OS X")) + return createProvider("sun.nio.fs.BsdFileSystemProvider"); throw new AssertionError("Platform not recognized"); } - } ---- ./jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java 2011-11-17 22:01:30.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java 2011-04-22 23:08:38.000000000 -0700 -@@ -119,7 +119,11 @@ - } +--- jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java 2012-05-17 16:18:01.000000000 -0700 +@@ -120,6 +120,7 @@ static boolean isBSD() { -- return osname.equals("Linux"); -+ return (osname.equals("Linux") || -+ osname.equals("FreeBSD") || -+ osname.equals("Darwin") || -+ osname.equals("NetBSD") || -+ osname.equals("OpenBSD")); - } - - static final int UNINITIALIZED = -1; -@@ -134,8 +138,8 @@ - }; - - String[] lpcAllCom = { -- "/usr/sbin/lpc status | grep : | sed -e 's/://'", -- "/usr/sbin/lpc -a status | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}' | sort" -+ "/usr/sbin/lpc status all | grep : | sed -e 's/://'", -+ "/usr/sbin/lpc status all | grep -E '^[ 0-9a-zA-Z_-]*@' | awk -F'@' '{print $1}' | sort" - }; - - String[] lpcNameCom = { -@@ -145,7 +149,7 @@ - - - static int getBSDCommandIndex() { -- String command = "/usr/sbin/lpc status"; -+ String command = "/usr/sbin/lpc status all"; - String[] names = execCmd(command); - - if ((names == null) || (names.length == 0)) { ---- ./jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java 2011-04-22 23:08:38.000000000 -0700 -@@ -40,9 +40,6 @@ - // temp directory for socket file - private static final String tmpdir = System.getProperty("java.io.tmpdir"); - -- // Indicates if this machine uses the old BsdThreads -- static boolean isBsdThreads; -- - // The patch to the socket file created by the target VM - String path; - -@@ -67,25 +64,10 @@ - // Then we attempt to find the socket file again. - path = findSocketFile(pid); - if (path == null) { -- File f = createAttachFile(pid); -+ File f = new File(tmpdir, ".attach_pid" + pid); -+ createAttachFile(f.getPath()); - try { -- // On BsdThreads each thread is a process and we don't have the -- // pid of the VMThread which has SIGQUIT unblocked. To workaround -- // this we get the pid of the "manager thread" that is created -- // by the first call to pthread_create. This is parent of all -- // threads (except the initial thread). -- if (isBsdThreads) { -- int mpid; -- try { -- mpid = getBsdThreadsManager(pid); -- } catch (IOException x) { -- throw new AttachNotSupportedException(x.getMessage()); -- } -- assert(mpid >= 1); -- sendQuitToChildrenOf(mpid); -- } else { -- sendQuitTo(pid); -- } -+ sendQuitTo(pid); - - // give the target VM time to start the attach mechanism - int i = 0; -@@ -267,31 +249,8 @@ - // First check for a .java_pid<pid> file in the working directory - // of the target process - String fn = ".java_pid" + pid; -- String path = "/proc/" + pid + "/cwd/" + fn; -- File f = new File(path); -- if (!f.exists()) { -- // Not found, so try temp directory -- f = new File(tmpdir, fn); -- path = f.exists() ? f.getPath() : null; -- } -- return path; -- } -- -- // On Solaris/Bsd a simple handshake is used to start the attach mechanism -- // if not already started. The client creates a .attach_pid<pid> file in the -- // target VM's working directory (or temp directory), and the SIGQUIT handler -- // checks for the file. -- private File createAttachFile(int pid) throws IOException { -- String fn = ".attach_pid" + pid; -- String path = "/proc/" + pid + "/cwd/" + fn; -- File f = new File(path); -- try { -- f.createNewFile(); -- } catch (IOException x) { -- f = new File(tmpdir, fn); -- f.createNewFile(); -- } -- return f; -+ File f = new File(tmpdir, path); -+ return f.exists() ? f.getPath() : null; - } - - /* -@@ -316,12 +275,6 @@ - - //-- native methods - -- static native boolean isBsdThreads(); -- -- static native int getBsdThreadsManager(int pid) throws IOException; -- -- static native void sendQuitToChildrenOf(int pid) throws IOException; -- - static native void sendQuitTo(int pid) throws IOException; - - static native void checkPermissions(String path) throws IOException; -@@ -336,8 +289,9 @@ - - static native void write(int fd, byte buf[], int off, int bufLen) throws IOException; - -+ static native void createAttachFile(String path); -+ - static { - System.loadLibrary("attach"); -- isBsdThreads = isBsdThreads(); - } - } ---- ./jdk/src/solaris/demo/jvmti/hprof/hprof_md.c 2011-11-17 22:01:31.000000000 -0800 -+++ ./jdk/src/solaris/demo/jvmti/hprof/hprof_md.c 2012-02-26 15:38:43.000000000 -0800 -@@ -42,7 +42,7 @@ - #include <sys/stat.h> - #include <fcntl.h> - --#ifndef LINUX -+#if !defined(LINUX) && !defined(_ALLBSD_SOURCE) - #include <procfs.h> - #endif - -@@ -62,6 +62,7 @@ - #include <time.h> - - #include "jni.h" -+#include "jvm_md.h" - #include "hprof.h" - - int -@@ -85,7 +86,7 @@ - void - md_init(void) - { --#ifdef LINUX -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - /* No Hi-Res timer option? */ - #else - if ( gdata->micro_state_accounting ) { -@@ -247,7 +248,7 @@ - jlong - md_get_microsecs(void) - { --#ifdef LINUX -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - return (jlong)(md_timeofday() * (jlong)1000); /* Milli to micro */ - #else - return (jlong)(gethrtime()/(hrtime_t)1000); /* Nano seconds to micro seconds */ -@@ -265,7 +266,7 @@ - jlong - md_get_thread_cpu_timemillis(void) - { --#ifdef LINUX -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - return md_timeofday(); - #else - return (jlong)(gethrvtime()/1000); /* Nano seconds to milli seconds */ -@@ -280,7 +281,7 @@ - Dl_info dlinfo; - - libdir[0] = 0; --#ifdef LINUX -+#if defined(LINUX) || defined(_ALLBSD_SOURCE) - addr = (void*)&Agent_OnLoad; - #else - /* Just using &Agent_OnLoad will get the first external symbol with -@@ -388,9 +389,9 @@ - - /* Construct path to library */ - if (pnamelen == 0) { -- (void)snprintf(holder, holderlen, "lib%s.so", fname); -+ (void)snprintf(holder, holderlen, "lib%s" JNI_LIB_SUFFIX, fname); - } else { -- (void)snprintf(holder, holderlen, "%s/lib%s.so", pname, fname); -+ (void)snprintf(holder, holderlen, "%s/lib%s" JNI_LIB_SUFFIX, pname, fname); + return (osname.equals("Linux") || ++ osname.endsWith("BSD") || + osname.contains("OS X")); } - } - ---- ./jdk/src/solaris/javavm/export/jvm_md.h 2011-11-17 22:01:35.000000000 -0800 -+++ ./jdk/src/solaris/javavm/export/jvm_md.h 2011-04-22 23:08:38.000000000 -0700 -@@ -41,7 +41,14 @@ - #define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"} - - #define JNI_LIB_PREFIX "lib" -+#ifdef __APPLE__ -+#define JNI_LIB_SUFFIX ".dylib" -+#define VERSIONED_JNI_LIB_NAME(NAME, VERSION) JNI_LIB_PREFIX NAME "." VERSION JNI_LIB_SUFFIX -+#else - #define JNI_LIB_SUFFIX ".so" -+#define VERSIONED_JNI_LIB_NAME(NAME, VERSION) JNI_LIB_PREFIX NAME JNI_LIB_SUFFIX "." VERSION -+#endif -+#define JNI_LIB_NAME(NAME) JNI_LIB_PREFIX NAME JNI_LIB_SUFFIX - #define JVM_MAXPATHLEN MAXPATHLEN - -@@ -68,7 +75,7 @@ +--- jdk/src/solaris/javavm/export/jvm_md.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/javavm/export/jvm_md.h 2012-05-20 10:12:05.000000000 -0700 +@@ -75,7 +75,11 @@ #define JVM_O_O_APPEND O_APPEND #define JVM_O_EXCL O_EXCL #define JVM_O_CREAT O_CREAT --#define JVM_O_DELETE 0x10000 ++#if !defined(__APPLE__) && defined(_ALLBSD_SOURCE) +#define JVM_O_DELETE 0x10000000 - - /* Signals */ - ---- ./jdk/src/solaris/native/com/sun/management/BsdOperatingSystem.c 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/native/com/sun/management/BsdOperatingSystem.c 1969-12-31 16:00:00.000000000 -0800 -@@ -1,332 +0,0 @@ --/* -- * Copyright (c) 2011, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --#include <stdio.h> --#include <stdint.h> --#include <stdarg.h> --#include <unistd.h> --#include <errno.h> --#include <string.h> --#include <sys/resource.h> --#include <sys/types.h> --#include <dirent.h> --#include <stdlib.h> --#include <dlfcn.h> --#include <pthread.h> --#include "com_sun_management_UnixOperatingSystem.h" -- --struct ticks { -- uint64_t used; -- uint64_t usedKernel; -- uint64_t total; --}; -- --typedef struct ticks ticks; -- --typedef enum { -- CPU_LOAD_VM_ONLY, -- CPU_LOAD_GLOBAL, --} CpuLoadTarget; -- --static struct perfbuf { -- int nProcs; -- ticks jvmTicks; -- ticks cpuTicks; -- ticks *cpus; --} counters; -- --#define DEC_64 "%lld" -- --static void next_line(FILE *f) { -- while (fgetc(f) != '\n'); --} -- --/** -- * Return the total number of ticks since the system was booted. -- * If the usedTicks parameter is not NULL, it will be filled with -- * the number of ticks spent on actual processes (user, system or -- * nice processes) since system boot. Note that this is the total number -- * of "executed" ticks on _all_ CPU:s, that is on a n-way system it is -- * n times the number of ticks that has passed in clock time. -- * -- * Returns a negative value if the reading of the ticks failed. -- */ --static int get_totalticks(int which, ticks *pticks) { -- FILE *fh; -- uint64_t userTicks, niceTicks, systemTicks, idleTicks; -- int n; -- -- if((fh = fopen("/proc/stat", "r")) == NULL) { -- return -1; -- } -- -- n = fscanf(fh, "cpu " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64, -- &userTicks, &niceTicks, &systemTicks, &idleTicks); -- -- // Move to next line -- next_line(fh); -- -- //find the line for requested cpu faster to just iterate linefeeds? -- if (which != -1) { -- int i; -- for (i = 0; i < which; i++) { -- if (fscanf(fh, "cpu%*d " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64, &userTicks, &niceTicks, &systemTicks, &idleTicks) != 4) { -- fclose(fh); -- return -2; -- } -- next_line(fh); -- } -- n = fscanf(fh, "cpu%*d " DEC_64 " " DEC_64 " " DEC_64 " " DEC_64 "\n", -- &userTicks, &niceTicks, &systemTicks, &idleTicks); -- } -- -- fclose(fh); -- if (n != 4) { -- return -2; -- } -- -- pticks->used = userTicks + niceTicks; -- pticks->usedKernel = systemTicks; -- pticks->total = userTicks + niceTicks + systemTicks + idleTicks; -- -- return 0; --} -- --static int vread_statdata(const char *procfile, const char *fmt, va_list args) { -- FILE *f; -- int n; -- char buf[2048]; -- -- if ((f = fopen(procfile, "r")) == NULL) { -- return -1; -- } -- -- if ((n = fread(buf, 1, sizeof(buf), f)) != -1) { -- char *tmp; -- -- buf[n-1] = '\0'; -- /** skip through pid and exec name. the exec name _could be wacky_ (renamed) and -- * make scanf go mupp. -- */ -- if ((tmp = strrchr(buf, ')')) != NULL) { -- // skip the ')' and the following space but check that the buffer is long enough -- tmp += 2; -- if (tmp < buf + n) { -- n = vsscanf(tmp, fmt, args); -- } -- } -- } -- -- fclose(f); -- -- return n; --} -- --static int read_statdata(const char *procfile, const char *fmt, ...) { -- int n; -- va_list args; -- -- va_start(args, fmt); -- n = vread_statdata(procfile, fmt, args); -- va_end(args); -- return n; --} -- --/** read user and system ticks from a named procfile, assumed to be in 'stat' format then. */ --static int read_ticks(const char *procfile, uint64_t *userTicks, uint64_t *systemTicks) { -- return read_statdata(procfile, "%*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u "DEC_64" "DEC_64, -- userTicks, systemTicks -- ); --} -- --/** -- * Return the number of ticks spent in any of the processes belonging -- * to the JVM on any CPU. -- */ --static int get_jvmticks(ticks *pticks) { -- uint64_t userTicks; -- uint64_t systemTicks; -- -- if (read_ticks("/proc/self/stat", &userTicks, &systemTicks) < 0) { -- return -1; -- } -- -- // get the total -- if (get_totalticks(-1, pticks) < 0) { -- return -1; -- } -- -- pticks->used = userTicks; -- pticks->usedKernel = systemTicks; -- -- return 0; --} -- --/** -- * This method must be called first, before any data can be gathererd. -- */ --int perfInit() { -- static int initialized=1; -- -- if (!initialized) { -- int i; -- -- int n = sysconf(_SC_NPROCESSORS_ONLN); -- if (n <= 0) { -- n = 1; -- } -- -- counters.cpus = calloc(n,sizeof(ticks)); -- if (counters.cpus != NULL) { -- // For the CPU load -- get_totalticks(-1, &counters.cpuTicks); -- -- for (i = 0; i < n; i++) { -- get_totalticks(i, &counters.cpus[i]); -- } -- // For JVM load -- get_jvmticks(&counters.jvmTicks); -- initialized = 1; -- } -- } -- -- return initialized ? 0 : -1; --} -- --#define MAX(a,b) (a>b?a:b) --#define MIN(a,b) (a<b?a:b) -- --static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; -- --/** -- * Return the load of the CPU as a double. 1.0 means the CPU process uses all -- * available time for user or system processes, 0.0 means the CPU uses all time -- * being idle. -- * -- * Returns a negative value if there is a problem in determining the CPU load. -- */ -- --static double get_cpuload_internal(int which, double *pkernelLoad, CpuLoadTarget target) { -- uint64_t udiff, kdiff, tdiff; -- ticks *pticks, tmp; -- double user_load = -1.0; -- int failed = 0; -- -- *pkernelLoad = 0.0; -- -- pthread_mutex_lock(&lock); -- -- if(perfInit() == 0) { -- -- if (target == CPU_LOAD_VM_ONLY) { -- pticks = &counters.jvmTicks; -- } else if (which == -1) { -- pticks = &counters.cpuTicks; -- } else { -- pticks = &counters.cpus[which]; -- } -- -- tmp = *pticks; -- -- if (target == CPU_LOAD_VM_ONLY) { -- if (get_jvmticks(pticks) != 0) { -- failed = 1; -- } -- } else if (get_totalticks(which, pticks) < 0) { -- failed = 1; -- } -- -- if(!failed) { -- // seems like we sometimes end up with less kernel ticks when -- // reading /proc/self/stat a second time, timing issue between cpus? -- if (pticks->usedKernel < tmp.usedKernel) { -- kdiff = 0; -- } else { -- kdiff = pticks->usedKernel - tmp.usedKernel; -- } -- tdiff = pticks->total - tmp.total; -- udiff = pticks->used - tmp.used; -- -- if (tdiff == 0) { -- user_load = 0; -- } else { -- if (tdiff < (udiff + kdiff)) { -- tdiff = udiff + kdiff; -- } -- *pkernelLoad = (kdiff / (double)tdiff); -- // BUG9044876, normalize return values to sane values -- *pkernelLoad = MAX(*pkernelLoad, 0.0); -- *pkernelLoad = MIN(*pkernelLoad, 1.0); -- -- user_load = (udiff / (double)tdiff); -- user_load = MAX(user_load, 0.0); -- user_load = MIN(user_load, 1.0); -- } -- } -- } -- pthread_mutex_unlock(&lock); -- return user_load; --} -- --double get_cpu_load(int which) { -- double u, s; -- u = get_cpuload_internal(which, &s, CPU_LOAD_GLOBAL); -- if (u < 0) { -- return -1.0; -- } -- // Cap total systemload to 1.0 -- return MIN((u + s), 1.0); --} -- --double get_process_load() { -- double u, s; -- u = get_cpuload_internal(-1, &s, CPU_LOAD_VM_ONLY); -- if (u < 0) { -- return -1.0; -- } -- return u + s; --} -- --JNIEXPORT jdouble JNICALL --Java_com_sun_management_UnixOperatingSystem_getSystemCpuLoad --(JNIEnv *env, jobject dummy) --{ -- if(perfInit() == 0) { -- return get_cpu_load(-1); -- } else { -- return -1.0; -- } --} -- --JNIEXPORT jdouble JNICALL --Java_com_sun_management_UnixOperatingSystem_getProcessCpuLoad --(JNIEnv *env, jobject dummy) --{ -- if(perfInit() == 0) { -- return get_process_load(); -- } else { -- return -1.0; -- } --} ---- ./jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c 2011-11-17 22:01:35.000000000 -0800 -+++ ./jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c 2011-04-22 23:08:38.000000000 -0700 -@@ -32,10 +32,16 @@ - - #include <sys/types.h> - #include <sys/stat.h> -+#if defined(_ALLBSD_SOURCE) -+#include <sys/sysctl.h> +#else - #include <sys/swap.h> + #define JVM_O_DELETE 0x10000 +#endif - #include <sys/resource.h> - #include <sys/times.h> -+#ifndef _ALLBSD_SOURCE - #include <sys/sysinfo.h> -+#endif - #include <ctype.h> - #include <dirent.h> - #include <errno.h> -@@ -46,16 +52,22 @@ - - static jlong page_size = 0; - -+#if defined(_ALLBSD_SOURCE) -+#define MB (1024UL * 1024UL) -+#else -+ - /* This gets us the new structured proc interfaces of 5.6 & later */ - /* - see comment in <sys/procfs.h> */ - #define _STRUCTURED_PROC 1 - #include <sys/procfs.h> - -+#endif /* _ALLBSD_SOURCE */ -+ - static struct dirent* read_dir(DIR* dirp, struct dirent* entry) { - #ifdef __solaris__ - struct dirent* dbuf = readdir(dirp); - return dbuf; --#else /* __linux__ */ -+#else /* __linux__ || _ALLBSD_SOURCE */ - struct dirent* p; - if (readdir_r(dirp, entry, &p) == 0) { - return p; -@@ -124,7 +136,7 @@ - free(strtab); - return available ? ((jlong)avail * page_size) : - ((jlong)total * page_size); --#else /* __linux__ */ -+#elif defined(__linux__) - int ret; - FILE *fp; - jlong total = 0, avail = 0; -@@ -138,6 +150,13 @@ - avail = (jlong)si.freeswap * si.mem_unit; - - return available ? avail : total; -+#else /* _ALLBSD_SOURCE */ -+ /* -+ * XXXBSD: there's no way available to get swap info in -+ * FreeBSD. Usage of libkvm is not an option here -+ */ -+ // throw_internal_error(env, "Unimplemented in FreeBSD"); -+ return (0); - #endif - } - -@@ -179,7 +198,7 @@ - - JVM_Close(fd); - return (jlong) psinfo.pr_size * 1024; --#else /* __linux__ */ -+#elif defined(__linux__) - FILE *fp; - unsigned long vsize = 0; - -@@ -197,6 +216,12 @@ - - fclose(fp); - return (jlong)vsize; -+#else /* _ALLBSD_SOURCE */ -+ /* -+ * XXXBSD: there's no way available to do it in FreeBSD, AFAIK. -+ */ -+ // throw_internal_error(env, "Unimplemented in FreeBSD"); -+ return (64 * MB); - #endif - } - -@@ -222,9 +247,13 @@ - jlong cpu_time_ns; - struct tms time; - --#ifdef __solaris__ -+ /* -+ * BSDNOTE: FreeBSD implements _SC_CLK_TCK since FreeBSD 5, so -+ * add a magic to handle it -+ */ -+#if defined(__solaris__) || defined(_SC_CLK_TCK) - clk_tck = (jlong) sysconf(_SC_CLK_TCK); --#else /* __linux__ */ -+#elif defined(__linux__) || defined(_ALLBSD_SOURCE) - clk_tck = 100; - #endif - if (clk_tck == -1) { -@@ -244,22 +273,51 @@ - Java_com_sun_management_UnixOperatingSystem_getFreePhysicalMemorySize - (JNIEnv *env, jobject mbean) - { -+#ifdef _ALLBSD_SOURCE -+ /* -+ * XXXBSD: there's no way available to do it in FreeBSD, AFAIK. -+ */ -+ // throw_internal_error(env, "Unimplemented in FreeBSD"); -+ return (128 * MB); -+#else - jlong num_avail_physical_pages = sysconf(_SC_AVPHYS_PAGES); - return (num_avail_physical_pages * page_size); -+#endif - } - - JNIEXPORT jlong JNICALL - Java_com_sun_management_UnixOperatingSystem_getTotalPhysicalMemorySize - (JNIEnv *env, jobject mbean) - { -+#ifdef _ALLBSD_SOURCE -+ jlong result; -+ int mib[2]; -+ size_t rlen; -+ -+ mib[0] = CTL_HW; -+ mib[1] = HW_PHYSMEM; -+ rlen = sizeof(result); -+ if (sysctl(mib, 2, &result, &rlen, NULL, 0) == -1) -+ result = 256 * MB; -+ -+ return (result); -+#else - jlong num_physical_pages = sysconf(_SC_PHYS_PAGES); - return (num_physical_pages * page_size); -+#endif - } - - JNIEXPORT jlong JNICALL - Java_com_sun_management_UnixOperatingSystem_getOpenFileDescriptorCount - (JNIEnv *env, jobject mbean) - { -+#ifdef _ALLBSD_SOURCE -+ /* -+ * XXXBSD: there's no way available to do it in FreeBSD, AFAIK. -+ */ -+ // throw_internal_error(env, "Unimplemented in FreeBSD"); -+ return (100); -+#else /* solaris/linux */ - DIR *dirp; - struct dirent dbuf; - struct dirent* dentp; -@@ -282,6 +340,7 @@ - closedir(dirp); - // subtract by 1 which was the fd open for this implementation - return (fds - 1); -+#endif - } - - JNIEXPORT jlong JNICALL ---- ./jdk/src/solaris/native/java/io/UnixFileSystem_md.c 2011-11-17 22:01:36.000000000 -0800 -+++ ./jdk/src/solaris/native/java/io/UnixFileSystem_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -41,6 +41,12 @@ - #include "java_io_FileSystem.h" - #include "java_io_UnixFileSystem.h" -+#if defined(_ALLBSD_SOURCE) -+#define dirent64 dirent -+#define readdir64_r readdir_r -+#define stat64 stat -+#define statvfs64 statvfs -+#endif - - /* -- Field IDs -- */ + /* Signals */ -@@ -140,7 +146,6 @@ +--- jdk/src/solaris/native/java/io/UnixFileSystem_md.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/io/UnixFileSystem_md.c 2012-05-17 16:15:00.000000000 -0700 +@@ -146,7 +146,6 @@ return rv; } @@ -25067,54 +7448,9 @@ JNIEXPORT jboolean JNICALL Java_java_io_UnixFileSystem_setPermission(JNIEnv *env, jobject this, jobject file, ---- ./jdk/src/solaris/native/java/io/canonicalize_md.c 2011-11-17 22:01:36.000000000 -0800 -+++ ./jdk/src/solaris/native/java/io/canonicalize_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -33,7 +33,9 @@ - #include <sys/stat.h> - #include <errno.h> - #include <limits.h> -+#if !defined(_ALLBSD_SOURCE) - #include <alloca.h> -+#endif - - - /* Note: The comments in this file use the terminology ---- ./jdk/src/solaris/native/java/io/io_util_md.c 2011-11-17 22:01:36.000000000 -0800 -+++ ./jdk/src/solaris/native/java/io/io_util_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -36,7 +36,7 @@ - WITH_PLATFORM_STRING(env, path, ps) { - FD fd; - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - /* Remove trailing slashes, since the kernel won't */ - char *p = (char *)ps + strlen(ps) - 1; - while ((p > ps) && (*p == '/')) ---- ./jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -28,6 +28,11 @@ - #include "jni.h" - #include "jni_util.h" - -+#ifdef __APPLE__ -+#include <crt_externs.h> -+#define environ (*_NSGetEnviron()) -+#endif -+ - JNIEXPORT jobjectArray JNICALL - Java_java_lang_ProcessEnvironment_environ(JNIEnv *env, jclass ign) - { -@@ -37,7 +42,9 @@ - * no standard (not even de-facto) header file where the - * declaration is to be found. See: - * http://www.opengroup.org/onlinepubs/007908799/xbd/envvar.html */ -+#ifndef __APPLE__ - extern char ** environ; /* environ[i] looks like: VAR=VALUE\0 */ -+#endif - - jsize count = 0; - jsize i, j; -@@ -46,7 +53,7 @@ +--- jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c 2012-05-17 16:15:00.000000000 -0700 +@@ -53,7 +53,7 @@ for (i = 0; environ[i]; i++) { /* Ignore corrupted environment variables */ @@ -25123,7 +7459,7 @@ count++; } -@@ -56,7 +63,7 @@ +@@ -63,7 +63,7 @@ for (i = 0, j = 0; environ[i]; i++) { const char * varEnd = strchr(environ[i], '='); /* Ignore corrupted environment variables */ @@ -25132,943 +7468,72 @@ jbyteArray var, val; const char * valBeg = varEnd + 1; jsize varLength = varEnd - environ[i]; ---- ./jdk/src/solaris/native/java/lang/UNIXProcess_md.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/lang/UNIXProcess_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -40,7 +40,11 @@ - #include <stdlib.h> - #include <sys/types.h> - #include <ctype.h> -+#ifdef _ALLBSD_SOURCE -+#include <sys/wait.h> -+#else - #include <wait.h> -+#endif - #include <signal.h> - #include <string.h> - #include <errno.h> -@@ -49,6 +53,17 @@ - #include <fcntl.h> - #include <limits.h> - -+#ifdef __FreeBSD__ -+#include <dlfcn.h> -+#include <pthread.h> -+#include <pthread_np.h> -+#endif -+ -+#ifdef __APPLE__ -+#include <crt_externs.h> -+#define environ (*_NSGetEnviron()) -+#endif -+ - /* - * There are 3 possible strategies we might use to "fork": - * -@@ -385,6 +400,32 @@ +--- jdk/src/solaris/native/java/lang/UNIXProcess_md.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/lang/UNIXProcess_md.c 2012-05-17 16:18:01.000000000 -0700 +@@ -394,7 +394,17 @@ return c >= '0' && c <= '9'; } +-#ifdef _ALLBSD_SOURCE +#if defined(__OpenBSD__) -+/* -+ * Directly call _thread_sys_closefrom() so the child process -+ * doesn't reset the parrent's file descriptors to be blocking. -+ * This function is only called from the child process which -+ * is single threaded and about to call execvp() so it is -+ * safe to bypass the threaded closefrom(). -+ */ -+int _thread_sys_closefrom(int); -+ +static int +closeDescriptors(void) +{ -+ return _thread_sys_closefrom(FAIL_FILENO + 1); ++ int err; ++ RESTARTABLE(closefrom(FAIL_FILENO + 1), err); ++ return err; +} -+ -+#else -+ -+#ifdef _ALLBSD_SOURCE -+#define FD_DIR "/dev/fd" -+#define dirent64 dirent -+#define readdir64 readdir +#else -+#define FD_DIR "/proc/self/fd" -+#endif + - static int - closeDescriptors(void) - { -@@ -402,7 +443,7 @@ - restartableClose(from_fd); /* for possible use by opendir() */ - restartableClose(from_fd + 1); /* another one for good luck */ - -- if ((dp = opendir("/proc/self/fd")) == NULL) -+ if ((dp = opendir(FD_DIR)) == NULL) - return 0; - - /* We use readdir64 instead of readdir to work around Solaris bug -@@ -419,6 +460,7 @@ ++#if defined(_ALLBSD_SOURCE) + #define FD_DIR "/dev/fd" + #define dirent64 dirent + #define readdir64 readdir +@@ -436,6 +446,7 @@ return 1; } -+#endif /* !__OpenBSD__ */ ++#endif static int moveDescriptor(int fd_from, int fd_to) -@@ -556,6 +598,21 @@ - const char *argv[], - const char *const envp[]) - { -+ /* This is one of the rare times it's more portable to declare an -+ * external symbol explicitly, rather than via a system header. -+ * The declaration is standardized as part of UNIX98, but there is -+ * no standard (not even de-facto) header file where the -+ * declaration is to be found. See: -+ * http://www.opengroup.org/onlinepubs/009695399/functions/environ.html -+ * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_02.html -+ * -+ * "All identifiers in this volume of IEEE Std 1003.1-2001, except -+ * environ, are defined in at least one of the headers" (!) -+ */ -+#ifndef __APPLE__ -+ extern char **environ; -+#endif -+ - if (envp == NULL || (char **) envp == environ) { - execvp(file, (char **) argv); - return; ---- ./jdk/src/solaris/native/java/lang/java_props_md.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/lang/java_props_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -23,7 +23,7 @@ - * questions. - */ - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #include <stdio.h> - #include <ctype.h> - #endif -@@ -42,9 +42,17 @@ - #include <time.h> - #include <errno.h> - -+#if defined(_ALLBSD_SOURCE) -+#if !defined(P_tmpdir) -+#include <paths.h> -+#define P_tmpdir _PATH_VARTMP -+#endif -+#endif -+ - #include "locale_str.h" - #include "java_props.h" - -+#if !defined(_ALLBSD_SOURCE) - #ifdef __linux__ - #ifndef CODESET - #define CODESET _NL_CTYPE_CODESET_NAME -@@ -54,6 +62,7 @@ - #define CODESET ALT_CODESET_KEY - #endif - #endif -+#endif /* !_ALLBSD_SOURCE */ - - #ifdef JAVASE_EMBEDDED - #include <dlfcn.h> -@@ -437,6 +446,13 @@ - sprops.display_variant = sprops.variant; - sprops.sun_jnu_encoding = sprops.encoding; - -+#ifdef _ALLBSD_SOURCE -+#if BYTE_ORDER == _LITTLE_ENDIAN -+ sprops.unicode_encoding = "UnicodeLittle"; -+ #else -+ sprops.unicode_encoding = "UnicodeBig"; -+ #endif -+#else /* !_ALLBSD_SOURCE */ - #ifdef __linux__ - #if __BYTE_ORDER == __LITTLE_ENDIAN - sprops.unicode_encoding = "UnicodeLittle"; -@@ -446,6 +462,7 @@ - #else - sprops.unicode_encoding = "UnicodeBig"; - #endif -+#endif /* _ALLBSD_SOURCE */ - - /* user properties */ - { -@@ -482,12 +499,14 @@ - sprops.path_separator = ":"; - sprops.line_separator = "\n"; - -+#if !defined(_ALLBSD_SOURCE) - /* Append CDE message and resource search path to NLSPATH and - * XFILESEARCHPATH, in order to pick localized message for - * FileSelectionDialog window (Bug 4173641). - */ - setPathEnvironment("NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat"); - setPathEnvironment("XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt"); -+#endif - - return &sprops; - } ---- ./jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -36,12 +36,288 @@ - #include <stdlib.h> - #include <ctype.h> - -+#ifdef _ALLBSD_SOURCE -+#include <unistd.h> -+#include <sys/param.h> -+#endif -+ - #include "jvm.h" - #include "jni_util.h" - #include "net_util.h" - - #include "java_net_Inet4AddressImpl.h" - -+#if defined(__GLIBC__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104)) -+#define HAS_GLIBC_GETHOSTBY_R 1 -+#endif -+ -+#if defined(_ALLBSD_SOURCE) && !defined(HAS_GLIBC_GETHOSTBY_R) -+/* Use getaddrinfo(3), which is thread safe */ -+/************************************************************************ -+ * Inet4AddressImpl -+ */ -+ -+/* -+ * Class: java_net_Inet4AddressImpl -+ * Method: getLocalHostName -+ * Signature: ()Ljava/lang/String; -+ */ -+JNIEXPORT jstring JNICALL -+Java_java_net_Inet4AddressImpl_getLocalHostName(JNIEnv *env, jobject this) { -+ char hostname[NI_MAXHOST+1]; -+ -+ hostname[0] = '\0'; -+ if (JVM_GetHostName(hostname, NI_MAXHOST)) { -+ /* Something went wrong, maybe networking is not setup? */ -+ strcpy(hostname, "localhost"); -+ } else { -+ struct addrinfo hints, *res; -+ int error; -+ -+ memset(&hints, 0, sizeof(hints)); -+ hints.ai_flags = AI_CANONNAME; -+ hints.ai_family = AF_UNSPEC; -+ -+ error = getaddrinfo(hostname, NULL, &hints, &res); -+ -+ if (error == 0) { -+ /* host is known to name service */ -+ error = getnameinfo(res->ai_addr, -+ res->ai_addrlen, -+ hostname, -+ NI_MAXHOST, -+ NULL, -+ 0, -+ NI_NAMEREQD); -+ -+ /* if getnameinfo fails hostname is still the value -+ from gethostname */ -+ -+ freeaddrinfo(res); -+ } -+ } -+ return (*env)->NewStringUTF(env, hostname); -+} -+ -+static jclass ni_iacls; -+static jclass ni_ia4cls; -+static jmethodID ni_ia4ctrID; -+static jfieldID ni_iaaddressID; -+static jfieldID ni_iahostID; -+static jfieldID ni_iafamilyID; -+static int initialized = 0; -+ -+/* -+ * Find an internet address for a given hostname. Note that this -+ * code only works for addresses of type INET. The translation -+ * of %d.%d.%d.%d to an address (int) occurs in java now, so the -+ * String "host" shouldn't *ever* be a %d.%d.%d.%d string -+ * -+ * Class: java_net_Inet4AddressImpl -+ * Method: lookupAllHostAddr -+ * Signature: (Ljava/lang/String;)[[B -+ */ -+ -+JNIEXPORT jobjectArray JNICALL -+Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, -+ jstring host) { -+ const char *hostname; -+ jobject name; -+ jobjectArray ret = 0; -+ int retLen = 0; -+ -+ int error=0; -+ struct addrinfo hints, *res, *resNew = NULL; -+ -+ if (!initialized) { -+ ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); -+ ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); -+ ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); -+ ni_ia4cls = (*env)->NewGlobalRef(env, ni_ia4cls); -+ ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "<init>", "()V"); -+ ni_iaaddressID = (*env)->GetFieldID(env, ni_iacls, "address", "I"); -+ ni_iafamilyID = (*env)->GetFieldID(env, ni_iacls, "family", "I"); -+ ni_iahostID = (*env)->GetFieldID(env, ni_iacls, "hostName", "Ljava/lang/String;"); -+ initialized = 1; -+ } -+ -+ if (IS_NULL(host)) { -+ JNU_ThrowNullPointerException(env, "host is null"); -+ return 0; -+ } -+ hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE); -+ CHECK_NULL_RETURN(hostname, NULL); -+ -+ memset(&hints, 0, sizeof(hints)); -+ hints.ai_flags = AI_CANONNAME; -+ hints.ai_family = AF_INET; -+ -+ /* -+ * Workaround for Solaris bug 4160367 - if a hostname contains a -+ * white space then 0.0.0.0 is returned -+ */ -+ if (isspace((unsigned char)hostname[0])) { -+ JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException", -+ (char *)hostname); -+ JNU_ReleaseStringPlatformChars(env, host, hostname); -+ return NULL; -+ } -+ -+ error = getaddrinfo(hostname, NULL, &hints, &res); -+ -+ if (error) { -+ /* report error */ -+ JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException", -+ (char *)hostname); -+ JNU_ReleaseStringPlatformChars(env, host, hostname); -+ return NULL; -+ } else { -+ int i = 0; -+ struct addrinfo *itr, *last = NULL, *iterator = res; -+ while (iterator != NULL) { -+ int skip = 0; -+ itr = resNew; -+ -+ while (itr != NULL) { -+ struct sockaddr_in *addr1, *addr2; -+ -+ addr1 = (struct sockaddr_in *)iterator->ai_addr; -+ addr2 = (struct sockaddr_in *)itr->ai_addr; -+ if (addr1->sin_addr.s_addr == -+ addr2->sin_addr.s_addr) { -+ skip = 1; -+ break; -+ } -+ -+ itr = itr->ai_next; -+ } -+ -+ if (!skip) { -+ struct addrinfo *next -+ = (struct addrinfo*) malloc(sizeof(struct addrinfo)); -+ if (!next) { -+ JNU_ThrowOutOfMemoryError(env, "heap allocation failed"); -+ ret = NULL; -+ goto cleanupAndReturn; -+ } -+ memcpy(next, iterator, sizeof(struct addrinfo)); -+ next->ai_next = NULL; -+ if (resNew == NULL) { -+ resNew = next; -+ } else { -+ last->ai_next = next; -+ } -+ last = next; -+ i++; -+ } -+ iterator = iterator->ai_next; -+ } -+ -+ retLen = i; -+ iterator = resNew; -+ i = 0; -+ -+ name = (*env)->NewStringUTF(env, hostname); -+ if (IS_NULL(name)) { -+ goto cleanupAndReturn; -+ } -+ -+ ret = (*env)->NewObjectArray(env, retLen, ni_iacls, NULL); -+ if (IS_NULL(ret)) { -+ /* we may have memory to free at the end of this */ -+ goto cleanupAndReturn; -+ } -+ -+ while (iterator != NULL) { -+ /* We need 4 bytes to store ipv4 address; */ -+ int len = 4; -+ -+ jobject iaObj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID); -+ if (IS_NULL(iaObj)) { -+ /* we may have memory to free at the end of this */ -+ ret = NULL; -+ goto cleanupAndReturn; -+ } -+ (*env)->SetIntField(env, iaObj, ni_iaaddressID, -+ ntohl(((struct sockaddr_in*)(iterator->ai_addr))->sin_addr.s_addr)); -+ (*env)->SetObjectField(env, iaObj, ni_iahostID, name); -+ (*env)->SetObjectArrayElement(env, ret, retLen - i -1, iaObj); -+ i++; -+ iterator = iterator->ai_next; -+ } -+ } -+ -+cleanupAndReturn: -+ { -+ struct addrinfo *iterator, *tmp; -+ iterator = resNew; -+ while (iterator != NULL) { -+ tmp = iterator; -+ iterator = iterator->ai_next; -+ free(tmp); -+ } -+ JNU_ReleaseStringPlatformChars(env, host, hostname); -+ } -+ -+ freeaddrinfo(res); -+ -+ return ret; -+ -+} -+ -+/* -+ * Class: java_net_Inet4AddressImpl -+ * Method: getHostByAddr -+ * Signature: (I)Ljava/lang/String; -+ */ -+JNIEXPORT jstring JNICALL -+Java_java_net_Inet4AddressImpl_getHostByAddr(JNIEnv *env, jobject this, -+ jbyteArray addrArray) { -+ jstring ret = NULL; -+ -+ char host[NI_MAXHOST+1]; -+ jfieldID fid; -+ int error = 0; -+ jint family; -+ struct sockaddr *him ; -+ int len = 0; -+ jbyte caddr[4]; -+ jint addr; -+ -+ struct sockaddr_in him4; -+ struct sockaddr *sa; -+ -+ /* -+ * For IPv4 addresses construct a sockaddr_in structure. -+ */ -+ (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr); -+ addr = ((caddr[0]<<24) & 0xff000000); -+ addr |= ((caddr[1] <<16) & 0xff0000); -+ addr |= ((caddr[2] <<8) & 0xff00); -+ addr |= (caddr[3] & 0xff); -+ memset((char *) &him4, 0, sizeof(him4)); -+ him4.sin_addr.s_addr = (uint32_t) htonl(addr); -+ him4.sin_family = AF_INET; -+ sa = (struct sockaddr *) &him4; -+ len = sizeof(him4); -+ -+ error = getnameinfo(sa, len, host, NI_MAXHOST, NULL, 0, -+ NI_NAMEREQD); -+ -+ if (!error) { -+ ret = (*env)->NewStringUTF(env, host); -+ } -+ -+ if (ret == NULL) { -+ JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException", NULL); -+ } -+ -+ return ret; -+ -+} -+ -+#else /* defined(_ALLBSD_SOURCE) && !defined(HAS_GLIBC_GETHOSTBY_R) */ -+ - /* the initial size of our hostent buffers */ - #define HENT_BUF_SIZE 1024 - #define BIG_HENT_BUF_SIZE 10240 /* a jumbo-sized one */ -@@ -86,13 +362,13 @@ - // ensure null-terminated - hostname[MAXHOSTNAMELEN] = '\0'; - --#ifdef __GLIBC__ -+#ifdef HAS_GLIBC_GETHOSTBY_R - gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &hp, &h_error); - #else - hp = gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &h_error); - #endif - if (hp) { --#ifdef __GLIBC__ -+#ifdef HAS_GLIBC_GETHOSTBY_R - gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET, - &res2, (char*)buf2, sizeof(buf2), &hp, &h_error); - #else -@@ -182,7 +458,7 @@ - #endif - - /* Try once, with our static buffer. */ --#ifdef __GLIBC__ -+#ifdef HAS_GLIBC_GETHOSTBY_R - gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &hp, &h_error); - #else - hp = gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &h_error); -@@ -195,7 +471,7 @@ - */ - if (hp == NULL && errno == ERANGE) { - if ((tmp = (char*)malloc(BIG_HENT_BUF_SIZE))) { --#ifdef __GLIBC__ -+#ifdef HAS_GLIBC_GETHOSTBY_R - gethostbyname_r(hostname, &res, tmp, BIG_HENT_BUF_SIZE, - &hp, &h_error); - #else -@@ -280,7 +556,7 @@ - addr |= ((caddr[2] <<8) & 0xff00); - addr |= (caddr[3] & 0xff); - addr = htonl(addr); --#ifdef __GLIBC__ -+#ifdef HAS_GLIBC_GETHOSTBY_R - gethostbyaddr_r((char *)&addr, sizeof(addr), AF_INET, &hent, - (char*)buf, sizeof(buf), &hp, &h_error); - #else -@@ -294,7 +570,7 @@ - */ - if (hp == NULL && errno == ERANGE) { - if ((tmp = (char*)malloc(BIG_HENT_BUF_SIZE))) { --#ifdef __GLIBC__ -+#ifdef HAS_GLIBC_GETHOSTBY_R - gethostbyaddr_r((char *)&addr, sizeof(addr), AF_INET, - &hent, tmp, BIG_HENT_BUF_SIZE, &hp, &h_error); - #else -@@ -316,6 +592,8 @@ - return ret; - } - -+#endif /* _ALLBSD_SOURCE */ -+ - #define SET_NONBLOCKING(fd) { \ - int flags = fcntl(fd, F_GETFL); \ - flags |= O_NONBLOCK; \ ---- ./jdk/src/solaris/native/java/net/Inet6AddressImpl.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/Inet6AddressImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -33,6 +33,9 @@ - #include <strings.h> - #include <stdlib.h> - #include <ctype.h> -+#ifdef _ALLBSD_SOURCE -+#include <unistd.h> /* gethostname */ -+#endif - - #include "jvm.h" - #include "jni_util.h" -@@ -70,10 +73,18 @@ - } else { - // ensure null-terminated - hostname[NI_MAXHOST] = '\0'; --#ifdef __linux__ -- /* On Linux gethostname() says "host.domain.sun.com". On -+#if defined(__linux__) && defined(_ALLBSD_SOURCE) -+ /* On Linux/FreeBSD gethostname() says "host.domain.sun.com". On - * Solaris gethostname() says "host", so extra work is needed. - */ -+ /* -+ * XXXBSD: Though on FreeBSD it's possible case then hostname does -+ * not contain '.' (depends on previous sethostname() call). Maybe -+ * we need to proceed with Solaris way, but using getnameinfo() -+ * in conjunction with gethostby*() breaks thread-safeness, so -+ * we need to protect all calls to gethostby*() and getnameinfo() -+ * using same mutex. -+ */ - #else - /* Solaris doesn't want to give us a fully qualified domain name. - * We do a reverse lookup to try and get one. This works -@@ -109,7 +120,7 @@ - } - } - #endif /* AF_INET6 */ --#endif /* __linux__ */ -+#endif /* __linux__ || _ALLBSD_SOURCE */ - } - return (*env)->NewStringUTF(env, hostname); - } ---- ./jdk/src/solaris/native/java/net/NetworkInterface.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/NetworkInterface.c 2011-07-06 09:10:57.000000000 -0700 -@@ -26,6 +26,9 @@ - - #include <errno.h> - #include <strings.h> -+#if defined(_ALLBSD_SOURCE) && defined(__OpenBSD__) -+#include <sys/types.h> -+#endif - #include <netinet/in.h> - #include <stdlib.h> - #include <string.h> -@@ -53,6 +56,23 @@ - #define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" - #endif - -+#if defined(_ALLBSD_SOURCE) -+#include <sys/param.h> -+#include <sys/ioctl.h> -+#include <sys/sockio.h> +--- jdk/src/solaris/native/java/net/NetworkInterface.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/net/NetworkInterface.c 2012-05-17 16:18:01.000000000 -0700 +@@ -60,14 +60,18 @@ + #include <sys/param.h> + #include <sys/ioctl.h> + #include <sys/sockio.h> +-#if defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__APPLE__) -+#include <net/ethernet.h> -+#include <net/if_var.h> + #include <net/ethernet.h> + #include <net/if_var.h> +#elif defined(__OpenBSD__) +#include <netinet/if_ether.h> +#elif defined(__NetBSD__) +#include <net/if_ether.h> +#endif -+#include <net/if_dl.h> -+#include <netinet/in_var.h> -+#include <ifaddrs.h> -+#endif -+ - #include "jvm.h" - #include "jni_util.h" - #include "net_util.h" -@@ -820,11 +840,11 @@ - netif *currif = ifs, *parent; - netaddr *addrP; - -- #ifdef __solaris__ -+#ifdef LIFNAMSIZ - char name[LIFNAMSIZ], vname[LIFNAMSIZ]; -- #else -+#else - char name[IFNAMSIZ], vname[IFNAMSIZ]; -- #endif -+#endif - - char *name_colonP; - int mask; -@@ -1648,3 +1668,311 @@ + #include <net/if_dl.h> + #include <netinet/in_var.h> + #include <ifaddrs.h> #endif +-#endif + #include "jvm.h" + #include "jni_util.h" +@@ -1979,7 +1983,11 @@ + return -1; + } -+/** BSD **/ -+#ifdef _ALLBSD_SOURCE -+/* Open socket for further ioct calls, try v4 socket first and -+ * if it falls return v6 socket -+ */ -+ -+#ifdef AF_INET6 -+static int openSocketWithFallback(JNIEnv *env, const char *ifname){ -+ int sock; -+ struct ifreq if2; -+ -+ if ((sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0)) < 0) { -+ if (errno == EPROTONOSUPPORT){ -+ if ( (sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0)) < 0 ){ -+ NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed"); -+ return -1; -+ } -+ } -+ else{ // errno is not NOSUPPORT -+ NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "IPV4 Socket creation failed"); -+ return -1; -+ } -+ } -+ -+ return sock; -+} -+ -+#else -+static int openSocketWithFallback(JNIEnv *env, const char *ifname){ -+ return openSocket(env,AF_INET); -+} -+#endif -+ -+/* -+ * Enumerates and returns all IPv4 interfaces -+ */ -+static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) { -+ struct ifaddrs *ifa, *origifa; -+ -+ if (getifaddrs(&origifa) != 0) { -+ NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", -+ "getifaddrs() function failed"); -+ return ifs; -+ } -+ -+ for (ifa = origifa; ifa != NULL; ifa = ifa->ifa_next) { -+ -+ /* -+ * Skip non-AF_INET entries. -+ */ -+ if (ifa->ifa_addr == NULL || ifa->ifa_addr->sa_family != AF_INET) -+ continue; -+ -+ /* -+ * Add to the list. -+ */ -+ ifs = addif(env, sock, ifa->ifa_name, ifs, ifa->ifa_addr, AF_INET, 0); -+ -+ /* -+ * If an exception occurred then free the list. -+ */ -+ if ((*env)->ExceptionOccurred(env)) { -+ freeifaddrs(origifa); -+ freeif(ifs); -+ return NULL; -+ } -+ } -+ -+ /* -+ * Free socket and buffer -+ */ -+ freeifaddrs(origifa); -+ return ifs; -+} -+ -+ -+/* -+ * Enumerates and returns all IPv6 interfaces on Linux -+ */ -+ -+#ifdef AF_INET6 -+/* -+ * Determines the prefix on BSD for IPv6 interfaces. -+ */ -+static -+int prefix(void *val, int size) { -+ u_char *name = (u_char *)val; -+ int byte, bit, plen = 0; -+ -+ for (byte = 0; byte < size; byte++, plen += 8) -+ if (name[byte] != 0xff) -+ break; -+ if (byte == size) -+ return (plen); -+ for (bit = 7; bit != 0; bit--, plen++) -+ if (!(name[byte] & (1 << bit))) -+ break; -+ for (; bit != 0; bit--) -+ if (name[byte] & (1 << bit)) -+ return (0); -+ byte++; -+ for (; byte < size; byte++) -+ if (name[byte]) -+ return (0); -+ return (plen); -+} -+ -+/* -+ * Enumerates and returns all IPv6 interfaces on BSD -+ */ -+static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) { -+ struct ifaddrs *ifa, *origifa; -+ struct sockaddr_in6 *sin6; -+ struct in6_ifreq ifr6; -+ -+ if (getifaddrs(&origifa) != 0) { -+ NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", -+ "getifaddrs() function failed"); -+ return ifs; -+ } -+ -+ for (ifa = origifa; ifa != NULL; ifa = ifa->ifa_next) { -+ -+ /* -+ * Skip non-AF_INET6 entries. -+ */ -+ if (ifa->ifa_addr == NULL || ifa->ifa_addr->sa_family != AF_INET6) -+ continue; -+ -+ memset(&ifr6, 0, sizeof(ifr6)); -+ strlcpy(ifr6.ifr_name, ifa->ifa_name, sizeof(ifr6.ifr_name)); -+ memcpy(&ifr6.ifr_addr, ifa->ifa_addr, MIN(sizeof(ifr6.ifr_addr), ifa->ifa_addr->sa_len)); -+ -+ if (ioctl(sock, SIOCGIFNETMASK_IN6, (caddr_t)&ifr6) < 0) { -+ NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", -+ "ioctl SIOCGIFNETMASK_IN6 failed"); -+ freeifaddrs(origifa); -+ freeif(ifs); -+ return NULL; -+ } -+ -+ /* Add to the list. */ -+ sin6 = (struct sockaddr_in6 *)&ifr6.ifr_addr; -+ ifs = addif(env, sock, ifa->ifa_name, ifs, ifa->ifa_addr, AF_INET6, -+ prefix(&sin6->sin6_addr, sizeof(struct in6_addr))); -+ -+ /* If an exception occurred then free the list. */ -+ if ((*env)->ExceptionOccurred(env)) { -+ freeifaddrs(origifa); -+ freeif(ifs); -+ return NULL; -+ } -+ } -+ -+ /* -+ * Free socket and ifaddrs buffer -+ */ -+ freeifaddrs(origifa); -+ return ifs; -+} -+#endif -+ -+static int getIndex(int sock, const char *name){ -+#ifdef __FreeBSD__ -+ /* -+ * Try to get the interface index -+ * (Not supported on Solaris 2.6 or 7) -+ */ -+ struct ifreq if2; -+ strcpy(if2.ifr_name, name); -+ -+ if (ioctl(sock, SIOCGIFINDEX, (char *)&if2) < 0) { -+ return -1; -+ } -+ -+ return if2.ifr_index; -+#else -+ /* -+ * Try to get the interface index using BSD specific if_nametoindex -+ */ -+ int index = if_nametoindex(name); -+ return (index == 0) ? -1 : index; -+#endif -+} -+ -+/** -+ * Returns the IPv4 broadcast address of a named interface, if it exists. -+ * Returns 0 if it doesn't have one. -+ */ -+static struct sockaddr *getBroadcast(JNIEnv *env, int sock, const char *ifname, struct sockaddr *brdcast_store) { -+ struct sockaddr *ret = NULL; -+ struct ifreq if2; -+ -+ memset((char *) &if2, 0, sizeof(if2)); -+ strcpy(if2.ifr_name, ifname); -+ -+ /* Let's make sure the interface does have a broadcast address */ -+ if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) < 0) { -+ NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFFLAGS failed"); -+ return ret; -+ } -+ -+ if (if2.ifr_flags & IFF_BROADCAST) { -+ /* It does, let's retrieve it*/ -+ if (ioctl(sock, SIOCGIFBRDADDR, (char *)&if2) < 0) { -+ NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFBRDADDR failed"); -+ return ret; -+ } -+ -+ ret = brdcast_store; -+ memcpy(ret, &if2.ifr_broadaddr, sizeof(struct sockaddr)); -+ } -+ -+ return ret; -+} -+ -+/** -+ * Returns the IPv4 subnet prefix length (aka subnet mask) for the named -+ * interface, if it has one, otherwise return -1. -+ */ -+static short getSubnet(JNIEnv *env, int sock, const char *ifname) { -+ unsigned int mask; -+ short ret; -+ struct ifreq if2; -+ -+ memset((char *) &if2, 0, sizeof(if2)); -+ strcpy(if2.ifr_name, ifname); -+ -+ if (ioctl(sock, SIOCGIFNETMASK, (char *)&if2) < 0) { -+ NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFNETMASK failed"); -+ return -1; -+ } -+ -+ mask = ntohl(((struct sockaddr_in*)&(if2.ifr_addr))->sin_addr.s_addr); -+ ret = 0; -+ while (mask) { -+ mask <<= 1; -+ ret++; -+ } -+ -+ return ret; -+} -+ -+/** -+ * Get the Hardware address (usually MAC address) for the named interface. -+ * return puts the data in buf, and returns the length, in byte, of the -+ * MAC address. Returns -1 if there is no hardware address on that interface. -+ */ -+static int getMacAddress(JNIEnv *env, int sock, const char* ifname, const struct in_addr* addr, unsigned char *buf) { -+ struct ifaddrs *ifa0, *ifa; -+ struct sockaddr *saddr; -+ int i; -+ -+ /* Grab the interface list */ -+ if (!getifaddrs(&ifa0)) { -+ /* Cycle through the interfaces */ -+ for (i = 0, ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next, i++) { -+ saddr = ifa->ifa_addr; -+ /* Link layer contains the MAC address */ -+ if (saddr->sa_family == AF_LINK && !strcmp(ifname, ifa->ifa_name)) { -+ struct sockaddr_dl *sadl = (struct sockaddr_dl *) saddr; -+ /* Check the address is the correct length */ -+ if (sadl->sdl_alen == ETHER_ADDR_LEN) { -+ memcpy(buf, (sadl->sdl_data + sadl->sdl_nlen), ETHER_ADDR_LEN); -+ freeifaddrs(ifa0); -+ return ETHER_ADDR_LEN; -+ } -+ } -+ } -+ freeifaddrs(ifa0); -+ } -+ -+ return -1; -+} -+ -+static int getMTU(JNIEnv *env, int sock, const char *ifname) { -+ struct ifreq if2; -+ -+ memset((char *) &if2, 0, sizeof(if2)); -+ strcpy(if2.ifr_name, ifname); -+ -+ if (ioctl(sock, SIOCGIFMTU, (char *)&if2) < 0) { -+ NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFMTU failed"); -+ return -1; -+ } -+ -+ return if2.ifr_mtu; -+} -+ -+static int getFlags(int sock, const char *ifname) { -+ struct ifreq if2; -+ int ret = -1; -+ -+ memset((char *) &if2, 0, sizeof(if2)); -+ strcpy(if2.ifr_name, ifname); -+ -+ if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) < 0){ -+ return -1; -+ } -+ +#ifdef __FreeBSD__ + return ((if2.ifr_flags & 0xffff) | (if2.ifr_flagshigh << 16)); +#else -+ return (((int) if2.ifr_flags) & 0xffff); + return (((int) if2.ifr_flags) & 0xffff); +#endif -+} -+ -+#endif ---- ./jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2011-04-22 23:08:39.000000000 -0700 + } + + #endif +--- jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2012-05-17 16:18:01.000000000 -0700 @@ -23,12 +23,12 @@ * questions. */ @@ -26084,27 +7549,7 @@ #ifdef __solaris__ #include <fcntl.h> -@@ -331,7 +331,7 @@ - /* The fdObj'fd */ - jint fd; - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - SOCKADDR addr; - int len; - #endif -@@ -341,26 +341,39 @@ - } - fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID); - -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #ifdef __linux__ - if (isOldKernel) { - int t = 1; - setsockopt(fd, SOL_SOCKET, SO_BSDCOMPAT, (char*) &t, sizeof(int)); - } else { -+#endif /* __linux__ */ - memset(&addr, 0, sizeof(addr)); +@@ -357,13 +357,21 @@ #ifdef AF_INET6 if (ipv6_available()) { struct sockaddr_in6 *him6 = (struct sockaddr_in6 *)&addr; @@ -26126,299 +7571,25 @@ len = sizeof(struct sockaddr_in); } JVM_Connect(fd, (struct sockaddr *)&addr, len); -+ /* XXXBSD: here we can get EADDRNOTAVAIL which need to be ignored -+ but since return value is not checked, ignore it */ - -+#ifdef __linux__ - // After disconnecting a UDP socket, Linux kernel will set - // local port to zero if the port number comes from implicit - // bind. Successive send/recv on the same socket will fail. -@@ -383,6 +396,7 @@ - NET_Bind(fd, (struct sockaddr *)&addr, len); - } - } -+#endif - #else - JVM_Connect(fd, 0, 0); +--- jdk/src/solaris/native/java/net/net_util_md.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/net/net_util_md.c 2012-05-17 16:18:01.000000000 -0700 +@@ -45,6 +45,10 @@ + #endif #endif -@@ -2400,18 +2414,30 @@ - mname6.ipv6mr_interface = idx; - } - -+#if defined(_ALLBSD_SOURCE) -+#define ADD_MEMBERSHIP IPV6_JOIN_GROUP -+#define DRP_MEMBERSHIP IPV6_LEAVE_GROUP -+#define S_ADD_MEMBERSHIP "IPV6_JOIN_GROUP" -+#define S_DRP_MEMBERSHIP "IPV6_LEAVE_GROUP" -+#else -+#define ADD_MEMBERSHIP IPV6_ADD_MEMBERSHIP -+#define DRP_MEMBERSHIP IPV6_DROP_MEMBERSHIP -+#define S_ADD_MEMBERSHIP "IPV6_ADD_MEMBERSHIP" -+#define S_DRP_MEMBERSHIP "IPV6_DROP_MEMBERSHIP" -+#endif -+ - /* Join the multicast group */ -- if (JVM_SetSockOpt(fd, IPPROTO_IPV6, (join ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP), -+ if (JVM_SetSockOpt(fd, IPPROTO_IPV6, (join ? ADD_MEMBERSHIP : DRP_MEMBERSHIP), - (char *) &mname6, sizeof (mname6)) < 0) { - - if (join) { -- NET_ThrowCurrent(env, "setsockopt IPV6_ADD_MEMBERSHIP failed"); -+ NET_ThrowCurrent(env, "setsockopt " S_ADD_MEMBERSHIP " failed"); - } else { - if (errno == ENOENT) { - JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", - "Not a member of the multicast group"); - } else { -- NET_ThrowCurrent(env, "setsockopt IPV6_DROP_MEMBERSHIP failed"); -+ NET_ThrowCurrent(env, "setsockopt " S_DRP_MEMBERSHIP " failed"); - } - } - } ---- ./jdk/src/solaris/native/java/net/PlainSocketImpl.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/PlainSocketImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -483,9 +483,11 @@ - if (connect_rv == JVM_IO_INTR) { - JNU_ThrowByName(env, JNU_JAVAIOPKG "InterruptedIOException", - "operation interrupted"); -+#if defined(EPROTO) - } else if (errno == EPROTO) { - NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "ProtocolException", - "Protocol error"); -+#endif - } else if (errno == ECONNREFUSED) { - NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "ConnectException", - "Connection refused"); -@@ -1001,7 +1003,7 @@ - */ - if (cmd == java_net_SocketOptions_SO_BINDADDR) { - SOCKADDR him; -- socklen_t len = 0; -+ socklen_t len; - int port; - jobject iaObj; - jclass iaCntrClass; ---- ./jdk/src/solaris/native/java/net/bsd_close.c 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/bsd_close.c 2011-04-22 23:08:39.000000000 -0700 -@@ -57,7 +57,7 @@ - /* - * Signal to unblock thread - */ --static int sigWakeup = (__SIGRTMAX - 2); -+static int sigWakeup = SIGIO; - - /* - * The fd table and the number of file descriptors -@@ -281,9 +281,7 @@ - - int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, - struct sockaddr *from, int *fromlen) { -- socklen_t socklen = *fromlen; -- BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) ); -- *fromlen = socklen; -+ BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); - } - - int NET_Send(int s, void *msg, int len, unsigned int flags) { -@@ -300,9 +298,11 @@ - } - - int NET_Accept(int s, struct sockaddr *addr, int *addrlen) { -- socklen_t socklen = *addrlen; -- BLOCKING_IO_RETURN_INT( s, accept(s, addr, &socklen) ); -- *addrlen = socklen; -+ socklen_t len = *addrlen; -+ int error = accept(s, addr, &len); -+ if (error != -1) -+ *addrlen = (int)len; -+ BLOCKING_IO_RETURN_INT( s, error ); - } - int NET_Connect(int s, struct sockaddr *addr, int addrlen) { ---- ./jdk/src/solaris/native/java/net/net_util_md.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/net_util_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -33,7 +33,16 @@ - #include <netdb.h> - #include <stdlib.h> - #include <dlfcn.h> --#include <values.h> -+#include <limits.h> -+ -+#ifdef _ALLBSD_SOURCE -+#include <sys/param.h> -+#include <sys/sysctl.h> -+#endif -+ +#ifdef __OpenBSD__ +#include <sys/socketvar.h> +#endif - - #ifdef __solaris__ - #include <sys/sockio.h> -@@ -127,7 +136,7 @@ - - static int findMaxBuf(int fd, int opt, int sotype) { - int a = 0; -- int b = MAXINT; -+ int b = INT_MAX; - int initial_guess; - int limit = -1; - -@@ -272,6 +281,14 @@ - return (*env)->GetFieldID(env, cls, "fd", "I"); - } - -+#if defined(DONT_ENABLE_IPV6) -+jint IPv6_supported() -+{ -+ return JNI_FALSE; -+} -+ -+#else /* !DONT_ENABLE_IPV6 */ -+ - jint IPv6_supported() - { - #ifndef AF_INET6 -@@ -410,6 +427,7 @@ - return JNI_TRUE; - #endif /* AF_INET6 */ - } -+#endif /* DONT_ENABLE_IPV6 */ - - void ThrowUnknownHostExceptionWithGaiError(JNIEnv *env, - const char* hostname, -@@ -772,6 +790,10 @@ - him6->sin6_family = AF_INET6; - *len = sizeof(struct sockaddr_in6) ; - -+#if defined(_ALLBSD_SOURCE) && defined(_AF_INET6) -+// XXXBSD: should we do something with scope id here ? see below linux comment -+#endif + - /* - * On Linux if we are connecting to a link-local address - * we need to specify the interface in the scope_id (2.4 kernel only) -@@ -1178,7 +1200,6 @@ - *len = socklen; - } - #endif -- - if (rv < 0) { - return rv; - } -@@ -1224,6 +1245,24 @@ - #define IPTOS_PREC_MASK 0xe0 - #endif - -+#if defined(_ALLBSD_SOURCE) -+#if defined(KIPC_MAXSOCKBUF) -+ int mib[3]; -+ size_t rlen; -+#endif -+ -+ int *bufsize; -+ -+#ifdef __APPLE__ -+ static int maxsockbuf = -1; -+#else -+ static long maxsockbuf = -1; -+#endif -+ -+ int addopt; -+ struct linger *ling; -+#endif -+ - /* - * IPPROTO/IP_TOS :- - * 1. IPv6 on Solaris: no-op and will be set in flowinfo -@@ -1256,6 +1295,10 @@ - *iptos &= (IPTOS_TOS_MASK | IPTOS_PREC_MASK); - } - -+#if defined(AF_INET6) && defined(_ALLBSD_SOURCE) -+// XXXBSD: to be implemented ? -+#endif -+ - /* - * SOL_SOCKET/{SO_SNDBUF,SO_RCVBUF} - On Solaris we may need to clamp - * the value when it exceeds the system limit. -@@ -1263,7 +1306,8 @@ #ifdef __solaris__ - if (level == SOL_SOCKET) { - if (opt == SO_SNDBUF || opt == SO_RCVBUF) { -- int sotype=0, arglen; -+ int sotype = 0; -+ socklen_t arglen; - int *bufsize, maxbuf; - int ret; - -@@ -1329,6 +1373,84 @@ + #include <sys/sockio.h> + #include <stropts.h> +@@ -1485,7 +1489,22 @@ + } } - #endif -+#if defined(_ALLBSD_SOURCE) -+ /* -+ * SOL_SOCKET/{SO_SNDBUF,SO_RCVBUF} - On FreeBSD need to -+ * ensure that value is <= kern.ipc.maxsockbuf as otherwise we get -+ * an ENOBUFS error. -+ */ -+ if (level == SOL_SOCKET) { -+ if (opt == SO_SNDBUF || opt == SO_RCVBUF) { -+#ifdef KIPC_MAXSOCKBUF -+ if (maxsockbuf == -1) { -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_IPC; -+ mib[2] = KIPC_MAXSOCKBUF; -+ rlen = sizeof(maxsockbuf); -+ if (sysctl(mib, 3, &maxsockbuf, &rlen, NULL, 0) == -1) -+ maxsockbuf = 1024; -+ -+#if 1 -+ /* XXXBSD: This is a hack to workaround mb_max/mb_max_adj -+ problem. It should be removed when kern.ipc.maxsockbuf -+ will be real value. */ -+ maxsockbuf = (maxsockbuf/5)*4; -+#endif -+ } -+#elif defined(__OpenBSD__) -+ maxsockbuf = SB_MAX; -+#else -+ maxsockbuf = 64 * 1024; /* XXX: NetBSD */ -+#endif -+ -+ bufsize = (int *)arg; -+ if (*bufsize > maxsockbuf) { -+ *bufsize = maxsockbuf; -+ } -+ -+ if (opt == SO_RCVBUF && *bufsize < 1024) { -+ *bufsize = 1024; -+ } -+ -+ } -+ } -+ -+ /* -+ * On Solaris, SO_REUSEADDR will allow multiple datagram -+ * sockets to bind to the same port. The network jck tests -+ * for this "feature", so we need to emulate it by turning on -+ * SO_REUSEPORT as well for that combination. -+ */ -+ if (level == SOL_SOCKET && opt == SO_REUSEADDR) { -+ int sotype; -+ socklen_t arglen; -+ -+ arglen = sizeof(sotype); -+ if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void *)&sotype, &arglen) < 0) { -+ return -1; -+ } -+ -+ if (sotype == SOCK_DGRAM) { -+ addopt = SO_REUSEPORT; -+ setsockopt(fd, level, addopt, arg, len); -+ } -+ } -+ +-#endif ++#ifndef __APPLE__ + /* + * Don't allow SO_LINGER value to be too big. + * Current max value (240) is empiric value based on tcp_timer.h's @@ -26432,436 +7603,136 @@ + ling->l_linger = 240; + } + } -+#endif -+ ++#endif __APPLE__ ++#endif _ALLBSD_SOURCE + return setsockopt(fd, level, opt, arg, len); } - -@@ -1379,7 +1501,8 @@ - * corresponding IPv4 port is in use. - */ - if (ipv6_available()) { -- int arg, len; -+ int arg; -+ socklen_t len; - - len = sizeof(arg); - if (getsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&arg, ---- ./jdk/src/solaris/native/java/net/net_util_md.h 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/net/net_util_md.h 2011-04-22 23:08:39.000000000 -0700 +--- jdk/src/solaris/native/java/net/net_util_md.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/net/net_util_md.h 2012-05-17 16:18:01.000000000 -0700 @@ -37,7 +37,7 @@ #endif --#ifdef __linux__ -+#if defined(__linux__) || defined(__FreeBSD__) +-#if defined(__linux__) || defined(MACOSX) ++#if defined(__linux__) || defined(__FreeBSD__) || defined(MACOSX) extern int NET_Timeout(int s, long timeout); extern int NET_Read(int s, void* buf, size_t len); extern int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, ---- ./jdk/src/solaris/native/java/util/FileSystemPreferences.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/util/FileSystemPreferences.c 2011-04-22 23:08:39.000000000 -0700 -@@ -47,8 +47,11 @@ - return (jint) result; - } - -- -+#if defined(_ALLBSD_SOURCE) -+typedef struct flock FLOCK; -+#else - typedef struct flock64 FLOCK; -+#endif - - /** - * Try to open a named lock file. -@@ -86,7 +89,11 @@ - if (fd < 0) { - result[0] = 0; - } else { -+#if defined(_ALLBSD_SOURCE) -+ rc = fcntl(fd, F_SETLK, &fl); -+#else - rc = fcntl(fd, F_SETLK64, &fl); -+#endif - result[1] = errno; - if (rc < 0) { - result[0]= 0; -@@ -116,7 +123,11 @@ - fl.l_start = 0; - fl.l_type = F_UNLCK; - -+#if defined(_ALLBSD_SOURCE) -+ rc = fcntl(fd, F_SETLK, &fl); -+#else - rc = fcntl(fd, F_SETLK64, &fl); -+#endif - - if (rc < 0) { - close(fd); ---- ./jdk/src/solaris/native/java/util/TimeZone_md.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/java/util/TimeZone_md.c 2012-03-04 13:19:33.000000000 -0800 -@@ -30,6 +30,7 @@ - #include <limits.h> - #include <errno.h> - #include <stddef.h> -+ - #include <sys/stat.h> - #include <sys/types.h> - #include <string.h> -@@ -49,7 +50,11 @@ - #define fileclose fclose - #endif - -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) -+ - #ifdef __linux__ -+static const char *sysconfig_clock_file = "/etc/sysconfig/clock"; -+#endif - - static const char *ETC_TIMEZONE_FILE = "/etc/timezone"; - static const char *ZONEINFO_DIR = "/usr/share/zoneinfo"; -@@ -122,7 +127,7 @@ +--- jdk/src/solaris/native/java/util/TimeZone_md.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/java/util/TimeZone_md.c 2012-05-25 18:05:24.000000000 -0700 +@@ -123,7 +123,7 @@ return NULL; } --#if defined(__linux__) || (defined(__solaris__) && (defined(_POSIX_PTHREAD_SEMANTICS) || \ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) || (defined(__solaris__) && (defined(_POSIX_PTHREAD_SEMANTICS) || \ - defined(_LP64))) +-#if defined(__linux__) || defined(MACOSX) || (defined(__solaris__) \ ++#if defined(__linux__) || defined(_ALLBSD_SOURCE) || (defined(__solaris__) \ + && (defined(_POSIX_PTHREAD_SEMANTICS) || defined(_LP64))) while (readdir_r(dirp, entry, &dp) == 0 && dp != NULL) { #else -@@ -211,7 +216,7 @@ +@@ -212,7 +212,7 @@ return tz; } --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) /* * Performs Linux specific mapping and returns a zone ID -@@ -226,7 +231,9 @@ - int fd; - char *buf; - size_t size; -+ char zoneinfo_file[PATH_MAX+1]; - -+#ifdef __linux__ - /* - * Try reading the /etc/timezone file for Debian distros. There's - * no spec of the file format available. This parsing assumes that -@@ -250,6 +257,7 @@ - return tz; - } - } -+#endif /* __linux__ */ - - /* - * Next, try /etc/localtime to find the zone ID. -@@ -258,6 +266,9 @@ - return NULL; - } - -+ strncpy(zoneinfo_file, DEFAULT_ZONEINFO_FILE, PATH_MAX); -+ zoneinfo_file[PATH_MAX] = '\0'; -+ - /* - * If it's a symlink, get the link name and its zone ID part. (The - * older versions of timeconfig created a symlink as described in -@@ -266,20 +277,23 @@ - * from /etc/localtime.) - */ - if (S_ISLNK(statbuf.st_mode)) { -- char linkbuf[PATH_MAX+1]; - int len; - -- if ((len = readlink(DEFAULT_ZONEINFO_FILE, linkbuf, sizeof(linkbuf)-1)) == -1) { -+ if ((len = readlink(DEFAULT_ZONEINFO_FILE, zoneinfo_file, sizeof(zoneinfo_file)-1)) == -1) { - jio_fprintf(stderr, (const char *) "can't get a symlink of %s\n", - DEFAULT_ZONEINFO_FILE); - return NULL; - } -- linkbuf[len] = '\0'; -- tz = getZoneName(linkbuf); -+ zoneinfo_file[len] = '\0'; -+ tz = getZoneName(zoneinfo_file); - if (tz != NULL) { - tz = strdup(tz); -+ return tz; -+ } else { -+ if (lstat(zoneinfo_file, &statbuf) == -1) { -+ return NULL; -+ } - } -- return tz; - } - - /* -@@ -291,7 +305,7 @@ - if (buf == NULL) { - return NULL; - } -- if ((fd = open(DEFAULT_ZONEINFO_FILE, O_RDONLY)) == -1) { -+ if ((fd = open(zoneinfo_file, O_RDONLY)) == -1) { - free((void *) buf); - return NULL; - } -@@ -605,7 +619,7 @@ - return tz; - } - #endif /*__solaris__*/ --#endif /*__linux__*/ -+#endif /* __linux__ || _ALLBSD_SOURCE */ - - /* - * findJavaTZ_md() maps platform time zone ID to Java time zone ID -@@ -624,7 +638,7 @@ +@@ -672,7 +672,7 @@ + * Returns a GMT-offset-based zone ID. (e.g., "GMT-08:00") + */ - tz = getenv("TZ"); +-#ifdef MACOSX ++#ifdef _ALLBSD_SOURCE --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - if (tz == NULL) { - #else - #ifdef __solaris__ -@@ -674,6 +688,21 @@ - { - time_t offset; - char sign, buf[32]; -+#if defined(_ALLBSD_SOURCE) -+ struct tm *local_tm; -+ time_t clock; -+ -+ clock = time(NULL); -+ tzset(); -+ local_tm = localtime(&clock); -+ if (local_tm->tm_gmtoff >= 0) { -+ offset = (time_t) local_tm->tm_gmtoff; -+ sign = "+"; -+ } else { -+ offset = (time_t) -local_tm->tm_gmtoff; -+ sign = "-"; -+ } -+#else - #ifdef __solaris__ - struct tm localtm; - time_t currenttime; -@@ -699,6 +728,7 @@ - offset = -offset; - sign = '+'; - } -+#endif - sprintf(buf, (const char *)"GMT%c%02d:%02d", + char * + getGMTOffsetID() +@@ -732,4 +732,4 @@ sign, (int)(offset/3600), (int)((offset%3600)/60)); return strdup(buf); ---- ./jdk/src/solaris/native/sun/awt/CUPSfuncs.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/CUPSfuncs.c 2011-04-22 23:08:39.000000000 -0700 -@@ -25,6 +25,7 @@ - - #include <jni.h> - #include <jni_util.h> -+#include <jvm_md.h> - #include <dlfcn.h> - #include <cups/cups.h> - #include <cups/ppd.h> -@@ -65,10 +66,11 @@ - JNIEXPORT jboolean JNICALL - Java_sun_print_CUPSPrinter_initIDs(JNIEnv *env, - jobject printObj) { -- void *handle = dlopen("libcups.so.2", RTLD_LAZY | RTLD_GLOBAL); -+ void *handle = dlopen(VERSIONED_JNI_LIB_NAME("cups", "2"), -+ RTLD_LAZY | RTLD_GLOBAL); - - if (handle == NULL) { -- handle = dlopen("libcups.so", RTLD_LAZY | RTLD_GLOBAL); -+ handle = dlopen(JNI_LIB_NAME("cups"), RTLD_LAZY | RTLD_GLOBAL); - if (handle == NULL) { - return JNI_FALSE; - } ---- ./jdk/src/solaris/native/sun/awt/VDrawingArea.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/VDrawingArea.c 2011-04-22 23:08:39.000000000 -0700 -@@ -31,7 +31,11 @@ - #endif /* !HEADLESS */ - - #include <stdio.h> -+#if defined(_ALLBSD_SOURCE) -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - - #ifdef __linux__ - /* XXX: Shouldn't be necessary. */ ---- ./jdk/src/solaris/native/sun/awt/X11Color.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/X11Color.c 2011-04-22 23:08:39.000000000 -0700 -@@ -33,7 +33,9 @@ - #include <math.h> - #include <sys/time.h> - #include <sys/resource.h> -+#if !defined(_ALLBSD_SOURCE) - #include <alloca.h> -+#endif - #ifndef HEADLESS - #include <X11/Xlib.h> - #include <X11/Xatom.h> ---- ./jdk/src/solaris/native/sun/awt/XDrawingArea.c 2011-11-17 22:01:37.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/XDrawingArea.c 2011-04-22 23:08:39.000000000 -0700 -@@ -31,7 +31,11 @@ - #include <Xm/XmP.h> - - #include <stdio.h> -+#if defined(_ALLBSD_SOURCE) -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - - #ifdef DEBUG - #include <jvm.h> /* To get jio_fprintf() */ ---- ./jdk/src/solaris/native/sun/awt/awt_Font.c 2011-11-17 22:01:38.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_Font.c 2011-04-22 23:08:39.000000000 -0700 + } +-#endif /* MACOSX */ ++#endif /* _ALLBSD_SOURCE */ +--- jdk/src/solaris/native/sun/awt/awt_Font.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/awt_Font.c 2012-05-17 16:18:01.000000000 -0700 @@ -334,7 +334,7 @@ if (strcmp(style, "regular") == 0) { altstyle = "roman"; } --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) if (!strcmp(family, "lucidasans")) { family = "lucida"; } ---- ./jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2011-11-17 22:01:38.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2011-04-22 23:08:39.000000000 -0700 -@@ -40,6 +40,7 @@ - #include <jni.h> - #include <jni_util.h> - #include <jvm.h> -+#include <jvm_md.h> - #include <jlong.h> - - #include <stdlib.h> -@@ -122,7 +123,7 @@ +--- jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c 2012-05-17 16:18:01.000000000 -0700 +@@ -123,7 +123,7 @@ */ #define MAXFRAMEBUFFERS 16 --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) typedef struct { int screen_number; short x_org; -@@ -427,6 +428,11 @@ - { - xrenderLibHandle = dlopen("libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL); - -+ if (xrenderLibHandle == NULL) { -+ xrenderLibHandle = dlopen("libXrender.so", -+ RTLD_LAZY | RTLD_GLOBAL); -+ } -+ - #ifndef __linux__ /* SOLARIS */ - if (xrenderLibHandle == NULL) { - xrenderLibHandle = dlopen("/usr/sfw/lib/libXrender.so.1", -@@ -640,19 +646,22 @@ +@@ -652,7 +652,7 @@ #endif /* HEADLESS */ #ifndef HEADLESS --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) static void xinerama_init_linux() { -- void* libHandle = 0; -- char* XineramaLibName= "libXinerama.so.1"; -+ void* libHandle = NULL; - int32_t locNumScr = 0; - XineramaScreenInfo *xinInfo; - char* XineramaQueryScreensName = "XineramaQueryScreens"; - XineramaQueryScreensFunc* XineramaQueryScreens = NULL; - - /* load library */ -- libHandle = dlopen(XineramaLibName, RTLD_LAZY | RTLD_GLOBAL); -- if (libHandle != 0) { -+ libHandle = dlopen(VERSIONED_JNI_LIB_NAME("Xinerama", "1"), -+ RTLD_LAZY | RTLD_GLOBAL); -+ if (libHandle == NULL) { -+ libHandle = dlopen(JNI_LIB_NAME("Xinerama"), RTLD_LAZY | RTLD_GLOBAL); -+ } -+ if (libHandle != NULL) { - XineramaQueryScreens = (XineramaQueryScreensFunc*) - dlsym(libHandle, XineramaQueryScreensName); - -@@ -688,11 +697,10 @@ + void* libHandle = NULL; +@@ -703,7 +703,7 @@ } } #endif --#ifndef __linux__ /* Solaris */ +-#if !defined(__linux__) && !defined(MACOSX) /* Solaris */ +#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) /* Solaris */ static void xinerama_init_solaris() { -- void* libHandle = 0; -- char* XineramaLibName= "libXext.so"; -+ void* libHandle = NULL; - unsigned char fbhints[MAXFRAMEBUFFERS]; - int32_t locNumScr = 0; - /* load and run XineramaGetInfo */ -@@ -701,8 +709,8 @@ - XineramaGetInfoFunc* XineramaSolarisFunc = NULL; - - /* load library */ -- libHandle = dlopen(XineramaLibName, RTLD_LAZY | RTLD_GLOBAL); -- if (libHandle != 0) { -+ libHandle = dlopen(JNI_LIB_NAME("Xext"), RTLD_LAZY | RTLD_GLOBAL); -+ if (libHandle != NULL) { - XineramaSolarisFunc = (XineramaGetInfoFunc*)dlsym(libHandle, XineramaGetInfoName); - XineramaSolarisCenterFunc = - (XineramaGetCenterHintFunc*)dlsym(libHandle, XineramaGetCenterHintName); -@@ -749,11 +757,11 @@ + void* libHandle = NULL; +@@ -763,11 +763,11 @@ } DTRACE_PRINTLN("Xinerama extension is available"); --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) xinerama_init_linux(); #else /* Solaris */ xinerama_init_solaris(); --#endif /* __linux__ */ +-#endif /* __linux__ || MACOSX */ +#endif /* __linux__ || _ALLBSD_SOURCE */ } #endif /* HEADLESS */ -@@ -1628,7 +1636,7 @@ +@@ -1642,7 +1642,7 @@ { jobject point = NULL; #ifndef HEADLESS /* return NULL in HEADLESS, Linux */ --#ifndef __linux__ +-#if !defined(__linux__) && !defined(MACOSX) +#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) int x,y; AWT_LOCK(); -@@ -1641,7 +1649,7 @@ +@@ -1655,7 +1655,7 @@ DTRACE_PRINTLN("unable to call XineramaSolarisCenterFunc: symbol is null"); } AWT_FLUSH_UNLOCK(); --#endif /* __linux __ */ +-#endif /* __linux __ || MACOSX */ +#endif /* __linux __ || _ALLBSD_SOURCE */ #endif /* HEADLESS */ return point; } -@@ -1711,7 +1719,11 @@ - { - int rr_maj_ver = 0, rr_min_ver = 0; - -- void *pLibRandR = dlopen("libXrandr.so.2", RTLD_LAZY | RTLD_LOCAL); -+ void *pLibRandR = dlopen(VERSIONED_JNI_LIB_NAME("Xrandr", "2"), -+ RTLD_LAZY | RTLD_LOCAL); -+ if (pLibRandR == NULL) { -+ pLibRandR = dlopen(JNI_LIB_NAME("Xrandr"), RTLD_LAZY | RTLD_LOCAL); -+ } - if (pLibRandR == NULL) { - J2dRlsTraceLn(J2D_TRACE_ERROR, - "X11GD_InitXrandrFuncs: Could not open libXrandr.so.2"); ---- ./jdk/src/solaris/native/sun/awt/awt_InputMethod.c 2011-11-17 22:01:38.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_InputMethod.c 2011-04-22 23:08:39.000000000 -0700 +--- jdk/src/solaris/native/sun/awt/awt_InputMethod.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/awt_InputMethod.c 2012-05-17 16:18:01.000000000 -0700 @@ -67,7 +67,7 @@ XIMPreeditDrawCallbackStruct *); static void PreeditCaretCallback(XIC, XPointer, XIMPreeditCaretCallbackStruct *); --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) static void StatusStartCallback(XIC, XPointer, XPointer); static void StatusDoneCallback(XIC, XPointer, XPointer); @@ -26870,7 +7741,7 @@ #define PreeditDoneIndex 1 #define PreeditDrawIndex 2 #define PreeditCaretIndex 3 --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) #define StatusStartIndex 4 #define StatusDoneIndex 5 @@ -26879,7 +7750,7 @@ (XIMProc)PreeditDoneCallback, (XIMProc)PreeditDrawCallback, (XIMProc)PreeditCaretCallback, --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) (XIMProc)StatusStartCallback, (XIMProc)StatusDoneCallback, @@ -26887,7 +7758,7 @@ #endif }; --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) #define MAX_STATUS_LEN 100 typedef struct { @@ -26896,7 +7767,7 @@ #endif /* XAWT */ jobject x11inputmethod; /* global ref to X11InputMethod instance */ /* associated with the XIC */ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) StatusWindow *statusWindow; /* our own status window */ #else @@ -26905,7 +7776,7 @@ static void freeX11InputMethodData(JNIEnv *env, X11InputMethodData *pX11IMData) { --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) if (pX11IMData->statusWindow != NULL){ StatusWindow *sw = pX11IMData->statusWindow; @@ -26914,7 +7785,7 @@ pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance); if (pX11IMData == NULL) { --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) return False; #else @@ -26923,7 +7794,7 @@ } if ((ic = pX11IMData->current_ic) == (XIC)0){ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) return False; #else @@ -26932,7 +7803,7 @@ return result; } --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) static StatusWindow *createStatusWindow( #ifdef XAWT @@ -26941,7 +7812,7 @@ } } } --#endif /*__linux__*/ +-#endif /* __linux__ || MACOSX */ +#endif /* __linux__ || _ALLBSD_SOURCE */ /* * Creates two XICs, one for active clients and the other for passive @@ -26950,7 +7821,7 @@ return FALSE ; } --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) on_the_spot_styles |= XIMStatusNothing; @@ -26959,7 +7830,7 @@ break; } } --#else /*! __linux__ */ +-#else /*! __linux__ && !MACOSX */ +#else /*! __linux__ && !_ALLBSD_SOURCE */ #ifdef XAWT on_the_spot_styles |= XIMStatusNothing; @@ -26968,7 +7839,7 @@ on_the_spot_styles |= XIMStatusNothing; #endif /* XAWT */ --#endif /* __linux__ */ +-#endif /* __linux__ || MACOSX */ +#endif /* __linux__ || _ALLBSD_SOURCE */ for (i = 0; i < im_styles->count_styles; i++) { @@ -26977,7 +7848,7 @@ NULL); if (preedit == (XVaNestedList)NULL) goto err; --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) /*always try XIMStatusCallbacks for active client...*/ { @@ -26986,7 +7857,7 @@ XFree((void *)status); XFree((void *)preedit); } --#else /* !__linux__ */ +-#else /* !__linux__ && !MACOSX */ +#else /* !__linux__ && !_ALLBSD_SOURCE */ #ifndef XAWT if (on_the_spot_styles & XIMStatusArea) { @@ -26995,7 +7866,7 @@ } #endif /* XAWT */ XFree((void *)preedit); --#endif /* __linux__ */ +-#endif /* __linux__ || MACOSX */ +#endif /* __linux__ || _ALLBSD_SOURCE */ pX11IMData->ic_passive = XCreateIC(X11im, XNClientWindow, w, @@ -27004,7 +7875,7 @@ } --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) static void StatusStartCallback(XIC ic, XPointer client_data, XPointer call_data) @@ -27013,7 +7884,7 @@ finally: AWT_UNLOCK(); } --#endif /*__linux__*/ +-#endif /* __linux__ || MACOSX */ +#endif /* __linux__ || _ALLBSD_SOURCE */ static void CommitStringCallback(XIC ic, XPointer client_data, XPointer call_data) { @@ -27022,7 +7893,7 @@ /* Use IMInstantiate call back only on Linux, as there is a bug in Solaris (4768335) */ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) registered = XRegisterIMInstantiateCallback(dpy, NULL, NULL, NULL, (XIDProc)OpenXIMCallback, NULL); @@ -27030,7 +7901,7 @@ /* directly call openXIM callback */ #endif OpenXIMCallback(dpy, NULL, NULL); --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) } #endif @@ -27039,15 +7910,15 @@ #endif /* XAWT */ globalRef = (*env)->NewGlobalRef(env, this); pX11IMData->x11inputmethod = globalRef; --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) pX11IMData->statusWindow = NULL; --#else /* __linux__ */ +-#else /* !__linux__ && !MACOSX */ +#else /* !__linux__ && !_ALLBSD_SOURCE */ #ifndef XAWT pX11IMData->statusWidget = (Widget) NULL; #endif /* XAWT */ --#endif /* __linux__ */ +-#endif /* __linux__ || MACOSX */ +#endif /* __linux__ || _ALLBSD_SOURCE */ pX11IMData->lookup_buf = 0; @@ -27056,7 +7927,7 @@ setXICFocus(pX11IMData->current_ic, req); currentX11InputMethodInstance = pX11IMData->x11inputmethod; currentFocusWindow = w; --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) if (active && pX11IMData->statusWindow && pX11IMData->statusWindow->on) onoffStatusWindow(pX11IMData, w, True); @@ -27064,7 +7935,7 @@ } else { currentX11InputMethodInstance = NULL; currentFocusWindow = 0; --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) onoffStatusWindow(pX11IMData, 0, False); if (pX11IMData->current_ic != NULL) @@ -27073,7 +7944,7 @@ Java_sun_awt_X11InputMethod_turnoffStatusWindow(JNIEnv *env, jobject this) { --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) X11InputMethodData *pX11IMData; StatusWindow *statusWindow; @@ -27082,7 +7953,7 @@ X11InputMethodData *pX11IMData; XVaNestedList status; --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) /*do nothing for linux? */ #else @@ -27091,117 +7962,44 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_XInputMethod_adjustStatusWindow (JNIEnv *env, jobject this, jlong window) { --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) AWT_LOCK(); adjustStatusWindow(window); AWT_UNLOCK(); ---- ./jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c 2011-11-17 22:01:38.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c 2011-05-07 22:00:01.000000000 -0700 -@@ -130,10 +130,10 @@ - - /* Calculate library name to load */ - if (AWTIsHeadless()) { -- strncpy(p, "/headless/libmawt.so", MAXPATHLEN-len-1); -+ strncpy(p, "/headless/libmawt" JNI_LIB_SUFFIX, MAXPATHLEN-len-1); - } else { - /* Default AWT Toolkit on Linux and Solaris is XAWT. */ -- strncpy(p, "/xawt/libmawt.so", MAXPATHLEN-len-1); -+ strncpy(p, "/xawt/libmawt" JNI_LIB_SUFFIX, MAXPATHLEN-len-1); - } - - if (toolkit) { ---- ./jdk/src/solaris/native/sun/awt/awt_MToolkit.c 2011-11-17 22:01:38.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_MToolkit.c 2011-04-22 23:08:39.000000000 -0700 -@@ -63,8 +63,9 @@ - extern JavaVM *jvm; - - #ifndef HEADLESS --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - extern void statusWindowEventHandler(XEvent event); -+Boolean awt_dnd_process_event(XEvent* event); - #endif - #endif /* !HEADLESS */ - -@@ -1642,7 +1643,7 @@ - */ - Widget widget=XtWindowToWidget(awt_display, xev.xany.window); - eventNumber++; --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - statusWindowEventHandler(xev); - #endif - xembed_eventHandler(&xev); ---- ./jdk/src/solaris/native/sun/awt/awt_Mlib.c 2011-11-17 22:01:38.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_Mlib.c 2011-04-22 23:08:39.000000000 -0700 -@@ -32,6 +32,7 @@ - #include <dlfcn.h> - #include "jni.h" - #include <jni_util.h> -+#include "jvm_md.h" - #include "awt_Mlib.h" - #include "java_awt_image_BufferedImage.h" - -@@ -67,11 +68,11 @@ - ((strncmp(name.machine, "sun4v" , 5) == 0) && - (getenv("USE_VIS_ON_SUN4V") != NULL))) - { -- handle = dlopen("libmlib_image_v.so", RTLD_LAZY); -+ handle = dlopen(JNI_LIB_NAME("mlib_image_v"), RTLD_LAZY); - } - - if (handle == NULL) { -- handle = dlopen("libmlib_image.so", RTLD_LAZY); -+ handle = dlopen(JNI_LIB_NAME("mlib_image"), RTLD_LAZY); - } - - if (handle == NULL) { ---- ./jdk/src/solaris/native/sun/awt/awt_Robot.c 2011-11-17 22:01:38.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_Robot.c 2011-05-20 20:09:20.000000000 -0700 +--- jdk/src/solaris/native/sun/awt/awt_Robot.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/awt_Robot.c 2012-05-17 16:18:01.000000000 -0700 @@ -45,7 +45,7 @@ #include "wsutils.h" #include "list.h" #include "multiVis.h" --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) #include <sys/socket.h> #endif -@@ -196,7 +196,6 @@ - AWT_UNLOCK(); - } - -- - JNIEXPORT void JNICALL - Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env, - jclass cls, ---- ./jdk/src/solaris/native/sun/awt/awt_util.h 2011-11-17 22:01:39.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_util.h 2011-04-22 23:08:39.000000000 -0700 -@@ -187,15 +187,20 @@ +--- jdk/src/solaris/native/sun/awt/awt_util.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/awt_util.h 2012-05-17 16:18:01.000000000 -0700 +@@ -187,7 +187,7 @@ #ifdef __solaris__ extern Widget awt_util_getXICStatusAreaWindow(Widget w); #else +-#if defined(MACOSX) +#if defined(_ALLBSD_SOURCE) -+int32_t awt_util_getIMStatusHeight(Widget vw); -+Widget awt_util_getXICStatusAreaWindow(Widget w); -+#else int32_t awt_util_getIMStatusHeight(Widget vw); - XVaNestedList awt_util_getXICStatusAreaList(Widget w); Widget awt_util_getXICStatusAreaWindow(Widget w); - #endif -+#endif - + #else +@@ -200,7 +200,7 @@ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) typedef struct _XmImRefRec { Cardinal num_refs; /* Number of referencing widgets. */ Cardinal max_refs; /* Maximum length of refs array. */ ---- ./jdk/src/solaris/native/sun/awt/awt_wm.c 2011-11-17 22:01:39.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_wm.c 2011-04-22 23:08:39.000000000 -0700 +--- jdk/src/solaris/native/sun/awt/awt_wm.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/awt_wm.c 2011-04-22 23:08:39.000000000 -0700 @@ -121,12 +121,19 @@ static Atom XA_KWM_WIN_MAXIMIZED; @@ -27299,8 +8097,8 @@ awt_wmgr = OPENLOOK_WM; } else { ---- ./jdk/src/solaris/native/sun/awt/awt_wm.h 2011-11-17 22:01:39.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/awt_wm.h 2011-04-22 23:08:39.000000000 -0700 +--- jdk/src/solaris/native/sun/awt/awt_wm.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/awt_wm.h 2011-04-22 23:08:39.000000000 -0700 @@ -45,7 +45,10 @@ KDE2_WM, SAWFISH_WM, @@ -27313,13 +8111,13 @@ }; extern void awt_wm_init(void); ---- ./jdk/src/solaris/native/sun/awt/extutil.h 2011-11-17 22:01:39.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/extutil.h 2011-04-22 23:08:39.000000000 -0700 +--- jdk/src/solaris/native/sun/awt/extutil.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/extutil.h 2012-05-17 16:18:01.000000000 -0700 @@ -58,7 +58,7 @@ */ /* $XFree86: xc/include/extensions/extutil.h,v 1.5 2001/01/17 17:53:20 dawes Exp $ */ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) #ifndef _EXTUTIL_H_ @@ -27328,57 +8126,32 @@ char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n) #endif --#endif /* __linux__ */ +-#endif /* __linux__ || MACOSX */ +#endif /* __linux__ || _ALLBSD_SOURCE */ ---- ./jdk/src/solaris/native/sun/awt/fontpath.c 2011-11-17 22:01:39.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/fontpath.c 2012-03-03 19:11:40.000000000 -0800 +--- jdk/src/solaris/native/sun/awt/fontpath.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/fontpath.c 2012-05-17 16:18:01.000000000 -0700 @@ -23,7 +23,7 @@ * questions. */ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) #include <string.h> #endif /* __linux__ */ #include <stdio.h> -@@ -40,6 +40,7 @@ - - #include <jni.h> - #include <jni_util.h> -+#include <jvm_md.h> - #include <sun_font_FontManager.h> - #ifndef HEADLESS - #include <X11/Xlib.h> -@@ -58,10 +59,24 @@ - extern Display *awt_display; - #endif /* !HEADLESS */ - -+#ifdef __APPLE__ -+// XXXDARWIN: Hard-code the path to Apple's freetype, as it is -+// not included in the dyld search path by default, and 10.4 -+// does not support -rpath. -+// -+// This ignores the build time setting of ALT_FREETYPE_LIB_PATH, -+// and should be replaced with -rpath/@rpath support on 10.5 or later, -+// or via support for a the FREETYPE_LIB_PATH define. -+#define FONTCONFIG_DLL_VERSIONED X11_PATH "/lib/" VERSIONED_JNI_LIB_NAME("fontconfig", "1") -+#define FONTCONFIG_DLL X11_PATH "/lib/" JNI_LIB_NAME("fontconfig") -+#else -+#define FONTCONFIG_DLL_VERSIONED VERSIONED_JNI_LIB_NAME("fontconfig", "1") -+#define FONTCONFIG_DLL JNI_LIB_NAME("fontconfig") -+#endif +@@ -78,7 +78,7 @@ #define MAXFDIRS 512 /* Max number of directories that contain fonts */ --#ifndef __linux__ +-#if !defined(__linux__) && !defined(MACOSX) +#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) /* * This can be set in the makefile to "/usr/X11" if so desired. */ -@@ -111,24 +126,40 @@ +@@ -144,6 +144,22 @@ + PACKAGE_PATH "/share/fonts/Type1", NULL, /* terminates the list */ }; - +#elif _ALLBSD_SOURCE +static char *fullBSDFontPath[] = { + X11_PATH "/lib/X11/fonts/TrueType", @@ -27398,632 +8171,101 @@ #else /* __linux */ /* All the known interesting locations we have discovered on * various flavors of Linux - */ - static char *fullLinuxFontPath[] = { -- "/usr/X11R6/lib/X11/fonts/TrueType", /* RH 7.1+ */ -- "/usr/X11R6/lib/X11/fonts/truetype", /* SuSE */ -- "/usr/X11R6/lib/X11/fonts/tt", -- "/usr/X11R6/lib/X11/fonts/TTF", -- "/usr/X11R6/lib/X11/fonts/OTF", /* RH 9.0 (but empty!) */ -- "/usr/share/fonts/ja/TrueType", /* RH 7.2+ */ -- "/usr/share/fonts/truetype", -- "/usr/share/fonts/ko/TrueType", /* RH 9.0 */ -- "/usr/share/fonts/zh_CN/TrueType", /* RH 9.0 */ -- "/usr/share/fonts/zh_TW/TrueType", /* RH 9.0 */ -+ X11_PATH "/lib/X11/fonts/TrueType", /* RH 7.1+ */ -+ X11_PATH "/lib/X11/fonts/truetype", /* SuSE */ -+ X11_PATH "/lib/X11/fonts/tt", -+ X11_PATH "/lib/X11/fonts/TTF", -+ X11_PATH "/lib/X11/fonts/OTF", /* RH 9.0 (but empty!) */ -+ PACKAGE_PATH "/share/fonts/ja/TrueType", /* RH 7.2+ */ -+ PACKAGE_PATH "/share/fonts/truetype", -+ PACKAGE_PATH "/share/fonts/ko/TrueType", /* RH 9.0 */ -+ PACKAGE_PATH "/share/fonts/zh_CN/TrueType", /* RH 9.0 */ -+ PACKAGE_PATH "/share/fonts/zh_TW/TrueType", /* RH 9.0 */ - "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType", /* Debian */ -- "/usr/X11R6/lib/X11/fonts/Type1", -- "/usr/share/fonts/default/Type1", /* RH 9.0 */ -+ X11_PATH "/lib/X11/fonts/Type1", -+ PACKAGE_PATH "/share/fonts/default/Type1", /* RH 9.0 */ - NULL, /* terminates the list */ - }; - #endif -@@ -362,7 +393,7 @@ +@@ -395,7 +411,7 @@ #endif /* !HEADLESS */ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) /* from awt_LoadLibrary.c */ JNIEXPORT jboolean JNICALL AWTIsHeadless(); #endif -@@ -487,8 +518,10 @@ - */ - fcdirs = getFontConfigLocations(); - --#ifdef __linux__ -+#if defined(__linux__) +@@ -524,6 +540,8 @@ knowndirs = fullLinuxFontPath; + #elif defined(MACOSX) + knowndirs = full_MACOSX_X11FontPath; +#elif defined(_ALLBSD_SOURCE) + knowndirs = fullBSDFontPath; #else /* IF SOLARIS */ knowndirs = fullSolarisFontPath; #endif -@@ -499,7 +532,8 @@ +@@ -534,7 +552,7 @@ * be initialised. */ #ifndef HEADLESS --#ifdef __linux__ /* There's no headless build on linux ... */ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) -+ /* There's no headless build on linux ... */ + /* There's no headless build on linux ... */ if (!AWTIsHeadless()) { /* .. so need to call a function to check */ #endif - /* Using the X11 font path to locate font files is now a fallback -@@ -514,7 +548,7 @@ +@@ -550,7 +568,7 @@ x11dirs = getX11FontPath(); } AWT_UNLOCK(); --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) } #endif #endif /* !HEADLESS */ -@@ -547,7 +581,7 @@ - } - - #include <dlfcn.h> --#ifndef __linux__ /* i.e. is solaris */ -+#if !(defined(__linux__) || defined(__APPLE__)) - #include <link.h> - #endif - -@@ -593,9 +627,9 @@ - * certain symbols - and functionality - to be available. - * Also add explicit search for .so.1 in case .so symlink doesn't exist. - */ -- libfontconfig = dlopen("libfontconfig.so.1", RTLD_LOCAL|RTLD_LAZY); -+ libfontconfig = dlopen(FONTCONFIG_DLL_VERSIONED, RTLD_LOCAL|RTLD_LAZY); - if (libfontconfig == NULL) { -- libfontconfig = dlopen("libfontconfig.so", RTLD_LOCAL|RTLD_LAZY); -+ libfontconfig = dlopen(FONTCONFIG_DLL, RTLD_LOCAL|RTLD_LAZY); - if (libfontconfig == NULL) { - return NULL; - } -@@ -1194,6 +1228,7 @@ - /* We only want TrueType fonts but some Linuxes still depend - * on Type 1 fonts for some Locale support, so we'll allow - * them there. -+ * XXX: Should we allow this on *BSD as well? - */ - if (fontformat != NULL - && (strcmp((char*)fontformat, "TrueType") != 0) ---- ./jdk/src/solaris/native/sun/awt/gtk2_interface.c 2011-11-17 22:01:39.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/gtk2_interface.c 2011-05-07 21:54:10.000000000 -0700 -@@ -30,9 +30,12 @@ - #include <string.h> - #include "gtk2_interface.h" - #include "java_awt_Transparency.h" -+#include "jvm_md.h" - --#define GTK2_LIB "libgtk-x11-2.0.so.0" --#define GTHREAD_LIB "libgthread-2.0.so.0" -+#define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0") -+#define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0") -+#define GTHREAD_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gthread-2.0", "0") -+#define GTHREAD_LIB JNI_LIB_NAME("gthread-2.0") - - #define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) - #define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1) -@@ -414,9 +417,12 @@ - void *lib = NULL; - gboolean result = FALSE; - -- lib = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); -+ lib = dlopen(GTK2_LIB_VERSIONED, RTLD_LAZY | RTLD_LOCAL); - if (lib == NULL) { -- return FALSE; -+ lib = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); -+ if (lib == NULL) { -+ return FALSE; -+ } - } - - fp_gtk_check_version = dlsym(lib, "gtk_check_version"); -@@ -470,11 +476,19 @@ - int (*io_handler)(); - char *gtk_modules_env; - -- gtk2_libhandle = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); -- gthread_libhandle = dlopen(GTHREAD_LIB, RTLD_LAZY | RTLD_LOCAL); -+ gtk2_libhandle = dlopen(GTK2_LIB_VERSIONED, RTLD_LAZY | RTLD_LOCAL); -+ if (gtk2_libhandle == NULL) { -+ gtk2_libhandle = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); -+ if (gtk2_libhandle == NULL) -+ return FALSE; -+ } - -- if (gtk2_libhandle == NULL || gthread_libhandle == NULL) -- return FALSE; -+ gthread_libhandle = dlopen(GTHREAD_LIB_VERSIONED, RTLD_LAZY | RTLD_LOCAL); -+ if (gthread_libhandle == NULL) { -+ gthread_libhandle = dlopen(GTHREAD_LIB, RTLD_LAZY | RTLD_LOCAL); -+ if (gthread_libhandle == NULL) -+ return FALSE; -+ } - - if (setjmp(j) == 0) - { ---- ./jdk/src/solaris/native/sun/awt/list.c 2011-11-17 22:01:40.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/list.c 2011-04-22 23:08:39.000000000 -0700 -@@ -66,7 +66,11 @@ - ----------------------------------------------------------------------- **/ - - #include <stdio.h> -+#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - #include "list.h" - - ---- ./jdk/src/solaris/native/sun/awt/robot_common.c 2011-11-17 22:01:42.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/awt/robot_common.c 2011-04-22 23:08:39.000000000 -0700 -@@ -27,6 +27,9 @@ +--- jdk/src/solaris/native/sun/awt/robot_common.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/awt/robot_common.c 2012-05-17 16:18:01.000000000 -0700 +@@ -27,7 +27,7 @@ #error This file should not be included in headless library #endif +-#ifdef MACOSX +#ifdef _ALLBSD_SOURCE -+#include <stdlib.h> -+#endif - #include "robot_common.h" - - /* ---- ./jdk/src/solaris/native/sun/font/X11FontScaler.c 2011-11-17 22:01:42.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/font/X11FontScaler.c 2011-04-22 23:08:39.000000000 -0700 -@@ -32,7 +32,11 @@ - * into X11FontScaler_md.c, which is compiled into another library. - */ - #include <stdio.h> -+#if defined(_ALLBSD_SOURCE) -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - #include <ctype.h> - #include <sys/utsname.h> - ---- ./jdk/src/solaris/native/sun/font/X11TextRenderer.c 2011-11-17 22:01:42.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/font/X11TextRenderer.c 2011-04-22 23:08:39.000000000 -0700 -@@ -39,7 +39,11 @@ - #include "GraphicsPrimitiveMgr.h" - #include "glyphblitting.h" - #include "sunfontids.h" -+#if defined(_ALLBSD_SOURCE) -+#include <stdlib.h> -+#else - #include <malloc.h> -+#endif - + #include <stdlib.h> + #endif - JNIEXPORT void JNICALL AWTDrawGlyphList ---- ./jdk/src/solaris/native/sun/java2d/j2d_md.h 2011-11-17 22:01:42.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/java2d/j2d_md.h 2011-04-22 23:08:39.000000000 -0700 -@@ -28,11 +28,11 @@ +--- jdk/src/solaris/native/sun/java2d/j2d_md.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/java2d/j2d_md.h 2012-05-17 16:18:01.000000000 -0700 +@@ -28,9 +28,9 @@ #include <sys/types.h> /* -- * Linux version of <sys/types.h> does not define intptr_t -+ * Linux and BSD's version of <sys/types.h> does not define intptr_t +- * Linux and MACOSX's version of <sys/types.h> does not define intptr_t ++ * Linux and BSD's's version of <sys/types.h> does not define intptr_t */ --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) #include <stdint.h> --#endif /* __linux__ */ -+#endif /* __linux__ || _ALLBSD_SOURCE */ - - typedef unsigned char jubyte; - typedef unsigned short jushort; ---- ./jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c 2011-11-17 22:01:42.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c 2011-04-22 23:08:39.000000000 -0700 -@@ -63,6 +63,10 @@ - * MLIB_EDGE_SRC_PADDED - */ - -+#ifdef __OpenBSD__ -+#include <sys/types.h> -+#endif -+#include <machine/endian.h> - #include <mlib_image.h> - #include <mlib_ImageZoom.h> - -@@ -99,7 +103,7 @@ - - /***************************************************************/ - --#ifdef _LITTLE_ENDIAN -+#if (BYTE_ORDER == LITTLE_ENDIAN) + #endif /* __linux__ || MACOSX */ - static const mlib_u32 mlib_bit_mask4[16] = { - 0x00000000u, 0xFF000000u, 0x00FF0000u, 0xFFFF0000u, -@@ -108,7 +112,7 @@ - 0x0000FFFFu, 0xFF00FFFFu, 0x00FFFFFFu, 0xFFFFFFFFu - }; - --#else /* _LITTLE_ENDIAN */ -+#else /* BIG_ENDIAN */ - - static const mlib_u32 mlib_bit_mask4[16] = { - 0x00000000u, 0x000000FFu, 0x0000FF00u, 0x0000FFFFu, -@@ -117,7 +121,7 @@ - 0xFFFF0000u, 0xFFFF00FFu, 0xFFFFFF00u, 0xFFFFFFFFu - }; - --#endif /* _LITTLE_ENDIAN */ -+#endif /* LITTLE_ENDIAN */ - - /***************************************************************/ - -@@ -341,11 +345,11 @@ - #ifdef _NO_LONGLONG - - typedef struct { --#ifdef _LITTLE_ENDIAN -+#if (BYTE_ORDER == LITTLE_ENDIAN) - mlib_u32 uint1, uint0; --#else /* _LITTLE_ENDIAN */ -+#else /* BIG_ENDIAN */ - mlib_u32 uint0, uint1; --#endif /* _LITTLE_ENDIAN */ -+#endif /* LITTLE_ENDIAN */ - } two_uint; - - /***************************************************************/ -@@ -508,11 +512,11 @@ - DTYPE mask; - MASK(mask); - off *= 8; --#ifdef _LITTLE_ENDIAN -+#if (BYTE_ORDER == LITTLE_ENDIAN) - LSHIFT(dd_old, da[0], 64 - off); --#else /* _LITTLE_ENDIAN */ -+#else /* BIG_ENDIAN */ - RSHIFT(dd_old, da[0], 64 - off); --#endif /* _LITTLE_ENDIAN */ -+#endif /* LITTLE_ENDIAN */ - - #ifdef __SUNPRO_C - #pragma pipeloop(0) -@@ -537,30 +541,30 @@ - - res = (res & 0xff) | (res >> 8); - dd = gray_mask[res]; --#ifdef _LITTLE_ENDIAN -+#if (BYTE_ORDER == LITTLE_ENDIAN) - /* *da++ = (dd_old >> (64 - off)) | (dd << off);*/ - RSHIFT(dd_old, dd_old, 64 - off); - LSHIFT(dtmp, dd, off); --#else /* _LITTLE_ENDIAN */ -+#else /* BIG_ENDIAN */ - /* *da++ = (dd_old << (64 - off)) | (dd >> off);*/ - LSHIFT(dd_old, dd_old, 64 - off); - RSHIFT(dtmp, dd, off); --#endif /* _LITTLE_ENDIAN */ -+#endif /* LITTLE_ENDIAN */ - LOGIC(*da++, dd_old, dtmp, |); - dd_old = dd; - } - --#ifdef _LITTLE_ENDIAN -+#if (BYTE_ORDER == LITTLE_ENDIAN) - /* da[0] = (dd_old >> (64 - off)) | (da[0] & ((mlib_u64)((mlib_s64) -1) << off));*/ - LSHIFT(dtmp, mask, off); - LOGIC(dtmp, da[0], dtmp, &); - RSHIFT(dtmp1, dd_old, 64 - off); --#else /* _LITTLE_ENDIAN */ -+#else /* BIG_ENDIAN */ - /* da[0] = (dd_old << (64 - off)) | (da[0] & ((mlib_u64)((mlib_s64) -1) >> off));*/ - RSHIFT(dtmp, mask, off); - LOGIC(dtmp, da[0], dtmp, &); - LSHIFT(dtmp1, dd_old, 64 - off); --#endif /* _LITTLE_ENDIAN */ -+#endif /* LITTLE_ENDIAN */ - LOGIC(da[0], dtmp, dtmp1, |); - } - else { /* aligned */ ---- ./jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c 2011-11-17 22:01:43.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c 2011-04-22 23:08:39.000000000 -0700 +--- jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c 2012-05-17 16:18:01.000000000 -0700 @@ -804,7 +804,7 @@ static int initialized; static int usevis = JNI_TRUE; --#ifdef __linux__ +-#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) || defined(_ALLBSD_SOURCE) # define ULTRA_CHIP "sparc64" #else # define ULTRA_CHIP "sun4u" ---- ./jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h 2011-11-17 22:01:43.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h 2011-04-22 23:08:39.000000000 -0700 -@@ -27,7 +27,10 @@ - #define OGLFuncs_md_h_Included - - #include <stdlib.h> -+#ifndef __APPLE__ - #include <link.h> -+#endif -+#include "jvm_md.h" - #include "J2D_GL/glx.h" - #include "OGLFuncMacros.h" - -@@ -113,7 +116,7 @@ - { \ - char *libGLPath = getenv("J2D_ALT_LIBGL_PATH"); \ - if (libGLPath == NULL) { \ -- libGLPath = "libGL.so.1"; \ -+ libGLPath = VERSIONED_JNI_LIB_NAME("GL", "1"); \ - } \ - OGL_LIB_HANDLE = dlopen(libGLPath, RTLD_LAZY | RTLD_LOCAL); \ - } \ ---- ./jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c 2011-11-17 22:01:43.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c 2011-04-22 23:08:39.000000000 -0700 -@@ -32,6 +32,7 @@ - #include "gdefs.h" - - #include "jni_util.h" -+#include "jvm_md.h" - #include "awt_Component.h" - #include "awt_GraphicsEnv.h" - -@@ -163,7 +164,7 @@ - - if (tryDGA && (getenv("NO_J2D_DGA") == NULL)) { - /* we use RTLD_NOW because of bug 4032715 */ -- lib = dlopen("libsunwjdga.so", RTLD_NOW); -+ lib = dlopen(JNI_LIB_NAME("sunwjdga"), RTLD_NOW); - } - - if (lib != NULL) { ---- ./jdk/src/solaris/native/sun/jdga/dgalock.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/jdga/dgalock.c 2011-04-22 23:08:39.000000000 -0700 -@@ -44,6 +44,7 @@ - #include <X11/Xlib.h> - - #include "jni.h" -+#include "jvm_md.h" - #include "jdga.h" - #include "jdgadevice.h" - -@@ -84,10 +85,10 @@ - static GetVirtualDrawableFunc * GetVirtualDrawable = GetVirtualDrawableStub; - - static void Solaris_DGA_XineramaInit(Display *display) { -- void * handle = 0; -+ void * handle = NULL; - if (IsXineramaOn == NULL) { -- handle = dlopen("libxinerama.so", RTLD_NOW); -- if (handle != 0) { -+ handle = dlopen(JNI_LIB_NAME("xinerama"), RTLD_NOW); -+ if (handle != NULL) { - void *sym = dlsym(handle, "IsXineramaOn"); - IsXineramaOn = (IsXineramaOnFunc *)sym; - if (IsXineramaOn != 0 && (*IsXineramaOn)(display)) { ---- ./jdk/src/solaris/native/sun/management/FileSystemImpl.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/management/FileSystemImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -30,6 +30,10 @@ - #include "jni_util.h" - #include "sun_management_FileSystemImpl.h" - -+#ifdef _ALLBSD_SOURCE -+#define stat64 stat -+#endif -+ - /* - * Class: sun_management_FileSystemImpl - * Method: isAccessUserOnly0 ---- ./jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -33,7 +33,7 @@ - #include <strings.h> - #endif - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #include <string.h> - #endif - ---- ./jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c 2011-04-22 23:08:39.000000000 -0700 -@@ -26,11 +26,12 @@ - #include "jni.h" - #include "jni_util.h" - #include "jvm.h" -+#include "jvm_md.h" - #include "jlong.h" - #include "sun_net_spi_DefaultProxySelector.h" - #include <dlfcn.h> - #include <stdio.h> --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #include <string.h> - #else - #include <strings.h> -@@ -110,8 +111,9 @@ - /** - * Let's try to load le GConf-2 library - */ -- if (dlopen("libgconf-2.so", RTLD_GLOBAL | RTLD_LAZY) != NULL || -- dlopen("libgconf-2.so.4", RTLD_GLOBAL | RTLD_LAZY) != NULL) { -+ if (dlopen(JNI_LIB_NAME("gconf-2"), RTLD_GLOBAL | RTLD_LAZY) != NULL || -+ dlopen(VERSIONED_JNI_LIB_NAME("gconf-2", "4"), -+ RTLD_GLOBAL | RTLD_LAZY) != NULL) { - gconf_ver = 2; - } - if (gconf_ver > 0) { ---- ./jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -35,7 +35,7 @@ - #include <string.h> - #include <errno.h> - --#if __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #include <netinet/in.h> - #endif - -@@ -86,7 +86,7 @@ - rv = connect(fd, 0, 0); - #endif - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - { - int len; - SOCKADDR sa; -@@ -96,17 +96,30 @@ - #ifdef AF_INET6 - if (ipv6_available()) { - struct sockaddr_in6 *him6 = (struct sockaddr_in6 *)&sa; -+#if defined(_ALLBSD_SOURCE) -+ him6->sin6_family = AF_INET6; -+#else - him6->sin6_family = AF_UNSPEC; -+#endif - len = sizeof(struct sockaddr_in6); - } else - #endif - { - struct sockaddr_in *him4 = (struct sockaddr_in*)&sa; -+#if defined(_ALLBSD_SOURCE) -+ him4->sin_family = AF_INET; -+#else - him4->sin_family = AF_UNSPEC; -+#endif - len = sizeof(struct sockaddr_in); - } - - rv = connect(fd, (struct sockaddr *)&sa, len); -+ -+#if defined(_ALLBSD_SOURCE) -+ if (rv < 0 && errno == EADDRNOTAVAIL) -+ rv = errno = 0; -+#endif - } - #endif - ---- ./jdk/src/solaris/native/sun/nio/ch/DatagramDispatcher.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/DatagramDispatcher.c 2011-04-22 23:08:39.000000000 -0700 -@@ -73,7 +73,7 @@ - m.msg_accrightslen = 0; - #endif - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - m.msg_control = NULL; - m.msg_controllen = 0; - #endif -@@ -121,7 +121,7 @@ - m.msg_accrightslen = 0; - #endif - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - m.msg_control = NULL; - m.msg_controllen = 0; - #endif ---- ./jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -26,9 +26,11 @@ - #include "jni.h" - #include "jni_util.h" - #include "jvm.h" -+#include "jvm_md.h" - #include "jlong.h" - #include <sys/mman.h> - #include <sys/stat.h> -+#include <fcntl.h> - #include "sun_nio_ch_FileChannelImpl.h" - #include "java_lang_Integer.h" - #include "nio.h" -@@ -37,6 +39,13 @@ - - #if defined(__linux__) || defined(__solaris__) - #include <sys/sendfile.h> -+#elif defined(_ALLBSD_SOURCE) -+#include <sys/types.h> -+#include <sys/socket.h> -+#include <sys/uio.h> -+ -+#define lseek64 lseek -+#define mmap64 mmap - #endif - - static jfieldID chan_fd; /* jobject 'fd' in sun.io.FileChannelImpl */ -@@ -192,7 +201,36 @@ +--- jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c 2012-05-17 16:18:01.000000000 -0700 +@@ -201,7 +201,7 @@ return IOS_THROWN; } return result; +-#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) -+ off_t numBytes; -+ int result; -+ -+ numBytes = count; -+ -+#ifdef __APPLE__ -+ result = sendfile(srcFD, dstFD, position, &numBytes, NULL, 0); + off_t numBytes; + int result; + +@@ -209,6 +209,8 @@ + + #ifdef __APPLE__ + result = sendfile(srcFD, dstFD, position, &numBytes, NULL, 0); +#elif defined(__FreeBSD__) + result = sendfile(srcFD, dstFD, position, count, NULL, &numBytes, 0); -+#endif -+ -+ if (numBytes > 0) -+ return numBytes; -+ -+ if (result == -1) { -+ if (errno == EAGAIN) -+ return IOS_UNAVAILABLE; -+ if (errno == EOPNOTSUPP || errno == ENOTSOCK || errno == ENOTCONN) -+ return IOS_UNSUPPORTED_CASE; -+ if ((errno == EINVAL) && ((ssize_t)count >= 0)) -+ return IOS_UNSUPPORTED_CASE; -+ if (errno == EINTR) -+ return IOS_INTERRUPTED; -+ JNU_ThrowIOExceptionWithLastError(env, "Transfer failed"); -+ return IOS_THROWN; -+ } -+ -+ return result; - #else -- return IOS_UNSUPPORTED_CASE; -+ return IOS_UNSUPPORTED; #endif - } ---- ./jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -33,9 +33,24 @@ - #include <sys/socket.h> - #include <fcntl.h> - #include <sys/uio.h> -+#include <unistd.h> - #include "nio.h" - #include "nio_util.h" - -+#ifdef _ALLBSD_SOURCE -+#define stat64 stat -+#define flock64 flock -+#define off64_t off_t -+#define F_SETLKW64 F_SETLKW -+#define F_SETLK64 F_SETLK -+ -+#define pread64 pread -+#define pwrite64 pwrite -+#define ftruncate64 ftruncate -+#define fstat64 fstat -+ -+#define fdatasync fsync -+#endif - static int preCloseFD = -1; /* File descriptor to which we dup other fd's - before closing them for real */ -@@ -218,6 +233,23 @@ + if (numBytes > 0) +--- jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c 2012-05-19 21:08:04.000000000 -0700 +@@ -233,6 +233,21 @@ fl.l_start = (off64_t)pos; fl.l_type = F_UNLCK; lockResult = fcntl(fd, cmd, &fl); @@ -28031,200 +8273,22 @@ + /* XXXFREEBSD: While doing of preClose0() we're closing actual fd which + was locked, so here we'll get an error which need to be ignored to + satisfy TCK FileLock test */ -+ /* XXXFREEBSD: backport to 1.4.2 */ + if (lockResult < 0 && errno == EBADF) -+ lockResult = errno = 0; ++ lockResult = errno = 0; +#endif +#if defined(__NetBSD__) + /* XXXNETBSD: The dup2 in preClose0 is being done onto 1 end of a + socketpair which isn't a valid target for F_UNLCK. No good way to see + this vs. a bad lock setup so just return errno = 0 there + to pass JCK (lock will get removed once all fd's close anyways) */ -+ /* XXXNETBSD: backport to 1.4.2 */ + if (lockResult < 0 && errno == EINVAL) -+ lockResult = errno = 0; ++ lockResult = errno = 0; +#endif if (lockResult < 0) { JNU_ThrowIOExceptionWithLastError(env, "Release failed"); } ---- ./jdk/src/solaris/native/sun/nio/ch/FileKey.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/FileKey.c 2011-04-22 23:08:39.000000000 -0700 -@@ -30,6 +30,12 @@ - #include "nio_util.h" - #include "sun_nio_ch_FileKey.h" - -+#ifdef _ALLBSD_SOURCE -+#define stat64 stat -+ -+#define fstat64 fstat -+#endif -+ - static jfieldID key_st_dev; /* id for FileKey.st_dev */ - static jfieldID key_st_ino; /* id for FileKey.st_ino */ - ---- ./jdk/src/solaris/native/sun/nio/ch/Net.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/Net.c 2011-04-22 23:08:39.000000000 -0700 -@@ -116,6 +116,47 @@ - - #endif /* __linux__ */ - -+#ifdef _ALLBSD_SOURCE -+ -+#ifndef IP_BLOCK_SOURCE -+ -+#define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ -+#define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ -+#define IP_BLOCK_SOURCE 72 /* block a source */ -+#define IP_UNBLOCK_SOURCE 73 /* unblock a source */ -+ -+#endif /* IP_BLOCK_SOURCE */ -+ -+#ifndef MCAST_BLOCK_SOURCE -+ -+#define MCAST_JOIN_SOURCE_GROUP 82 /* join a source-specific group */ -+#define MCAST_LEAVE_SOURCE_GROUP 83 /* leave a single source */ -+#define MCAST_BLOCK_SOURCE 84 /* block a source */ -+#define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ -+ -+#endif /* MCAST_BLOCK_SOURCE */ -+ -+#ifndef IPV6_ADD_MEMBERSHIP -+ -+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP -+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP -+ -+#endif /* IPV6_ADD_MEMBERSHIP */ -+ -+struct my_ip_mreq_source { -+ struct in_addr imr_multiaddr; -+ struct in_addr imr_interface; -+ struct in_addr imr_sourceaddr; -+}; -+ -+struct my_group_source_req { -+ uint32_t gsr_interface; /* interface index */ -+ struct sockaddr_storage gsr_group; /* group address */ -+ struct sockaddr_storage gsr_source; /* source address */ -+}; -+ -+#endif /* _ALLBSD_SOURCE */ -+ - - #define COPY_INET6_ADDRESS(env, source, target) \ - (*env)->GetByteArrayRegion(env, source, 0, 16, target) -@@ -287,8 +328,30 @@ - SOCKADDR sa; - socklen_t sa_len = SOCKADDR_LEN; - if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) { -+#ifdef _ALLBSD_SOURCE -+ /* -+ * XXXBSD: -+ * ECONNRESET is specific to the BSDs. We can not return an error, -+ * as the calling Java code with raise a java.lang.Error given the expectation -+ * that getsockname() will never fail. According to the Single UNIX Specification, -+ * it shouldn't fail. As such, we just fill in generic Linux-compatible values. -+ */ -+ if (errno == ECONNRESET) { -+ struct sockaddr_in *sin; -+ sin = (struct sockaddr_in *) &sa; -+ bzero(sin, sizeof(*sin)); -+ sin->sin_len = sizeof(struct sockaddr_in); -+ sin->sin_family = AF_INET; -+ sin->sin_port = htonl(0); -+ sin->sin_addr.s_addr = INADDR_ANY; -+ } else { -+ handleSocketError(env, errno); -+ return -1; -+ } -+#else /* _ALLBSD_SOURCE */ - handleSocketError(env, errno); - return -1; -+#endif /* _ALLBSD_SOURCE */ - } - return NET_GetPortFromSockaddr((struct sockaddr *)&sa); - } -@@ -300,8 +363,30 @@ - socklen_t sa_len = SOCKADDR_LEN; - int port; - if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) { -+#ifdef _ALLBSD_SOURCE -+ /* -+ * XXXBSD: -+ * ECONNRESET is specific to the BSDs. We can not return an error, -+ * as the calling Java code with raise a java.lang.Error with the expectation -+ * that getsockname() will never fail. According to the Single UNIX Specification, -+ * it shouldn't fail. As such, we just fill in generic Linux-compatible values. -+ */ -+ if (errno == ECONNRESET) { -+ struct sockaddr_in *sin; -+ sin = (struct sockaddr_in *) &sa; -+ bzero(sin, sizeof(*sin)); -+ sin->sin_len = sizeof(struct sockaddr_in); -+ sin->sin_family = AF_INET; -+ sin->sin_port = htonl(0); -+ sin->sin_addr.s_addr = INADDR_ANY; -+ } else { -+ handleSocketError(env, errno); -+ return NULL; -+ } -+#else /* _ALLBSD_SOURCE */ - handleSocketError(env, errno); - return NULL; -+#endif /* _ALLBSD_SOURCE */ - } - return NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port); - } -@@ -365,7 +450,8 @@ - struct linger linger; - u_char carg; - void *parg; -- int arglen, n; -+ socklen_t arglen; -+ int n; - - /* Option value is an int except for a few specific cases */ - -@@ -528,7 +614,7 @@ - Java_sun_nio_ch_Net_setInterface4(JNIEnv* env, jobject this, jobject fdo, jint interf) - { - struct in_addr in; -- int arglen = sizeof(struct in_addr); -+ socklen_t arglen = sizeof(struct in_addr); - int n; - - in.s_addr = htonl(interf); -@@ -559,7 +645,7 @@ - Java_sun_nio_ch_Net_setInterface6(JNIEnv* env, jobject this, jobject fdo, jint index) - { - int value = (jint)index; -- int arglen = sizeof(value); -+ socklen_t arglen = sizeof(value); - int n; - - n = setsockopt(fdval(env, fdo), IPPROTO_IPV6, IPV6_MULTICAST_IF, -@@ -602,9 +688,11 @@ - switch (errorValue) { - case EINPROGRESS: /* Non-blocking connect */ - return 0; -+#ifdef EPROTO - case EPROTO: - xn = JNU_JAVANETPKG "ProtocolException"; - break; -+#endif - case ECONNREFUSED: - xn = JNU_JAVANETPKG "ConnectException"; - break; ---- ./jdk/src/solaris/native/sun/nio/ch/Sctp.h 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/Sctp.h 2011-04-22 23:08:39.000000000 -0700 -@@ -67,7 +67,7 @@ - - - --#else /* __linux__ */ -+#elif __linux__ - #include <stdint.h> - #include <linux/types.h> - #include <sys/socket.h> +--- jdk/src/solaris/native/sun/nio/ch/Sctp.h 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/nio/ch/Sctp.h 2012-05-19 21:00:43.000000000 -0700 @@ -320,8 +320,20 @@ typedef int sctp_peeloff_func(int sock, sctp_assoc_t id); @@ -28252,36 +8316,20 @@ +#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 -+#define nio_sctp_peeloff sctp_peeloff ++#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 ++#define nio_sctp_peeloff sctp_peeloff + +#endif + jboolean loadSocketExtensionFuncs(JNIEnv* env); #endif /* !SUN_NIO_CH_SCTP_H */ ---- ./jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c 2011-04-22 23:08:39.000000000 -0700 -@@ -337,11 +337,11 @@ - 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); ---- ./jdk/src/solaris/native/sun/nio/ch/SctpNet.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/ch/SctpNet.c 2011-04-22 23:08:39.000000000 -0700 +--- jdk/src/solaris/native/sun/nio/ch/SctpNet.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/nio/ch/SctpNet.c 2011-04-22 23:08:39.000000000 -0700 @@ -58,6 +58,7 @@ */ jboolean loadSocketExtensionFuncs @@ -28298,584 +8346,9 @@ funcsLoaded = JNI_TRUE; return JNI_TRUE; ---- ./jdk/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c 2011-04-22 23:08:39.000000000 -0700 -@@ -28,23 +28,35 @@ - #include "jvm.h" - #include "jlong.h" - --#include <stdio.h> --#include <dlfcn.h> --#include <errno.h> --#include <mntent.h> -+#include <sys/param.h> -+#include <sys/mount.h> -+#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 <stdlib.h> -+#include <string.h> -+ -+static jfieldID entry_name; -+static jfieldID entry_dir; -+static jfieldID entry_fstype; -+static jfieldID entry_options; -+static jfieldID entry_dev; -+ -+ -+struct fsstat_iter { -+ struct statfs *buf; -+ int pos; -+ int nentries; -+}; - - #include "sun_nio_fs_BsdNativeDispatcher.h" - --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); -- --fgetxattr_func* my_fgetxattr_func = NULL; --fsetxattr_func* my_fsetxattr_func = NULL; --fremovexattr_func* my_fremovexattr_func = NULL; --flistxattr_func* my_flistxattr_func = NULL; -- - static void throwUnixException(JNIEnv* env, int errnum) { - jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException", - "(I)V", errnum); -@@ -53,108 +65,146 @@ - } - } - -+/** -+ * 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); -- } -- if (res == (size_t)-1) -- throwUnixException(env, errno); -- return (jint)res; -+ clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry"); -+ if (clazz == NULL) { -+ return; -+ } -+ 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); -- -- if (my_fsetxattr_func == NULL) { -- errno = ENOTSUP; -- } else { -- /* EINTR not documented */ -- res = (*my_fsetxattr_func)(fd, name, value, valueLen, 0); -+ int nentries; -+ size_t bufsize; -+ struct fsstat_iter *iter = malloc(sizeof(*iter)); -+ -+ 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 -+ -+ 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; -+ } - -- if (my_fremovexattr_func == NULL) { -- errno = ENOTSUP; -- } else { -- /* EINTR not documented */ -- res = (*my_fremovexattr_func)(fd, name); -+ 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 (iter == NULL || iter->pos >= iter->nentries) -+ return -1; -+ -+ 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; -+ -+ 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 (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 (dev != 0) -+ (*env)->SetLongField(env, entry, entry_dev, (jlong)dev); - --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); -- -- do { -- fp = setmntent(path, mode); -- } while (fp == NULL && errno == EINTR); -- if (fp == NULL) { -- throwUnixException(env, errno); -- } -- return ptr_to_jlong(fp); -+ 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); -+ } - } ---- ./jdk/src/solaris/native/sun/nio/fs/BsdWatchService.c 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/fs/BsdWatchService.c 1969-12-31 16:00:00.000000000 -0800 -@@ -1,153 +0,0 @@ --/* -- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. 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. Oracle designates this -- * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -- * -- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --#include "jni.h" --#include "jni_util.h" --#include "jvm.h" --#include "jlong.h" -- --#include <stdlib.h> --#include <dlfcn.h> --#include <sys/types.h> --#include <sys/socket.h> --#include <sys/poll.h> --#include <sys/inotify.h> -- --#include "sun_nio_fs_BsdWatchService.h" -- --static void throwUnixException(JNIEnv* env, int errnum) { -- jobject x = JNU_NewObjectByName(env, "sun/nio/fs/UnixException", -- "(I)V", errnum); -- if (x != NULL) { -- (*env)->Throw(env, x); -- } --} -- --JNIEXPORT jint JNICALL --Java_sun_nio_fs_BsdWatchService_eventSize(JNIEnv *env, jclass clazz) --{ -- return (jint)sizeof(struct inotify_event); --} -- --JNIEXPORT jintArray JNICALL --Java_sun_nio_fs_BsdWatchService_eventOffsets(JNIEnv *env, jclass clazz) --{ -- jintArray result = (*env)->NewIntArray(env, 5); -- if (result != NULL) { -- jint arr[5]; -- arr[0] = (jint)offsetof(struct inotify_event, wd); -- arr[1] = (jint)offsetof(struct inotify_event, mask); -- arr[2] = (jint)offsetof(struct inotify_event, cookie); -- arr[3] = (jint)offsetof(struct inotify_event, len); -- arr[4] = (jint)offsetof(struct inotify_event, name); -- (*env)->SetIntArrayRegion(env, result, 0, 5, arr); -- } -- return result; --} -- -- --JNIEXPORT jint JNICALL --Java_sun_nio_fs_BsdWatchService_inotifyInit -- (JNIEnv* env, jclass clazz) --{ -- int ifd = inotify_init(); -- if (ifd == -1) { -- throwUnixException(env, errno); -- } -- return (jint)ifd; --} -- --JNIEXPORT jint JNICALL --Java_sun_nio_fs_BsdWatchService_inotifyAddWatch -- (JNIEnv* env, jclass clazz, jint fd, jlong address, jint mask) --{ -- int wfd = -1; -- const char* path = (const char*)jlong_to_ptr(address); -- -- wfd = inotify_add_watch((int)fd, path, mask); -- if (wfd == -1) { -- throwUnixException(env, errno); -- } -- return (jint)wfd; --} -- --JNIEXPORT void JNICALL --Java_sun_nio_fs_BsdWatchService_inotifyRmWatch -- (JNIEnv* env, jclass clazz, jint fd, jint wd) --{ -- int err = inotify_rm_watch((int)fd, (int)wd); -- if (err == -1) -- throwUnixException(env, errno); --} -- --JNIEXPORT void JNICALL --Java_sun_nio_fs_BsdWatchService_configureBlocking -- (JNIEnv* env, jclass clazz, jint fd, jboolean blocking) --{ -- int flags = fcntl(fd, F_GETFL); -- -- if ((blocking == JNI_FALSE) && !(flags & O_NONBLOCK)) -- fcntl(fd, F_SETFL, flags | O_NONBLOCK); -- else if ((blocking == JNI_TRUE) && (flags & O_NONBLOCK)) -- fcntl(fd, F_SETFL, flags & ~O_NONBLOCK); --} -- --JNIEXPORT void JNICALL --Java_sun_nio_fs_BsdWatchService_socketpair -- (JNIEnv* env, jclass clazz, jintArray sv) --{ -- int sp[2]; -- if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) == -1) { -- throwUnixException(env, errno); -- } else { -- jint res[2]; -- res[0] = (jint)sp[0]; -- res[1] = (jint)sp[1]; -- (*env)->SetIntArrayRegion(env, sv, 0, 2, &res[0]); -- } --} -- --JNIEXPORT jint JNICALL --Java_sun_nio_fs_BsdWatchService_poll -- (JNIEnv* env, jclass clazz, jint fd1, jint fd2) --{ -- struct pollfd ufds[2]; -- int n; -- -- ufds[0].fd = fd1; -- ufds[0].events = POLLIN; -- ufds[1].fd = fd2; -- ufds[1].events = POLLIN; -- -- n = poll(&ufds[0], 2, -1); -- if (n == -1) { -- if (errno == EINTR) { -- n = 0; -- } else { -- throwUnixException(env, errno); -- } -- } -- return (jint)n; --} ---- ./jdk/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c 2011-11-17 22:01:44.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c 2011-04-22 23:08:39.000000000 -0700 -@@ -30,7 +30,9 @@ - - #include <stdlib.h> - #include <dlfcn.h> -+#ifndef __APPLE__ - #include <link.h> -+#endif - - #ifdef __solaris__ - #include <strings.h> ---- ./jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c 2011-11-17 22:01:45.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c 2011-05-20 20:04:19.000000000 -0700 -@@ -49,6 +49,19 @@ - #include <mntent.h> - #endif - -+#ifdef _ALLBSD_SOURCE -+#include <string.h> -+ -+#define stat64 stat -+#define statvfs64 statvfs -+ -+#define open64 open -+#define fstat64 fstat -+#define lstat64 lstat -+#define dirent64 dirent -+#define readdir64_r readdir_r -+#endif -+ - #include "jni.h" - #include "jni_util.h" - #include "jlong.h" -@@ -198,7 +211,7 @@ - - /* system calls that might not be available at run time */ - --#if defined(__solaris__) && defined(_LP64) -+#if (defined(__solaris__) && defined(_LP64)) || defined(_ALLBSD_SOURCE) - /* Solaris 64-bit does not have openat64/fstatat64 */ - my_openat64_func = (openat64_func*)dlsym(RTLD_DEFAULT, "openat"); - my_fstatat64_func = (fstatat64_func*)dlsym(RTLD_DEFAULT, "fstatat"); -@@ -224,6 +237,8 @@ - flags |= sun_nio_fs_UnixNativeDispatcher_HAS_AT_SYSCALLS; - } - -+ my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir"); -+ - return flags; - } - -@@ -1068,6 +1083,10 @@ - { - #ifdef __solaris__ - struct extmnttab ent; -+#elif defined(_ALLBSD_SOURCE) -+ char buf[1024]; -+ char *str; -+ char *last; - #else - struct mntent ent; - char buf[1024]; -@@ -1096,6 +1115,25 @@ - throwUnixException(env, errno); - return -1; - } -+#elif defined(_ALLBSD_SOURCE) -+again: -+ if (!(str = fgets(buf, sizeof(buf), fp))) -+ return -1; -+ -+ name = strtok_r(str, " \t\n", &last); -+ if (name == NULL) -+ return -1; -+ -+ // skip comments -+ if (*name == '#') -+ goto again; -+ -+ dir = strtok_r((char *)NULL, " \t\n", &last); -+ fstype = strtok_r((char *)NULL, " \t\n", &last); -+ options = strtok_r((char *)NULL, " \t\n", &last); -+ if (options == NULL) -+ return -1; -+ dev = 0; - #else - m = getmntent_r(fp, &ent, (char*)&buf, buflen); - if (m == NULL) ---- ./jdk/src/solaris/native/sun/nio/fs/genUnixConstants.c 2011-11-17 22:01:45.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/nio/fs/genUnixConstants.c 2011-04-22 23:08:39.000000000 -0700 -@@ -63,7 +63,12 @@ - DEFX(O_EXCL); - DEFX(O_TRUNC); - DEFX(O_SYNC); -+#ifndef O_DSYNC -+ // At least FreeBSD doesn't define O_DSYNC -+ emit("O_DSYNC", O_SYNC); -+#else - DEFX(O_DSYNC); -+#endif - DEFX(O_NOFOLLOW); - - // mode masks -@@ -106,7 +111,12 @@ - DEF(ENOSYS); - DEF(ELOOP); - DEF(EROFS); -+#ifndef ENODATA -+ // Only used in Linux java source, provide any value so it compiles -+ emit("ENODATA", ELAST); -+#else - DEF(ENODATA); -+#endif - DEF(ERANGE); - - // flags used with openat/unlinkat/etc. ---- ./jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c 2011-11-17 22:01:45.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c 2011-04-22 23:08:39.000000000 -0700 -@@ -26,7 +26,9 @@ - #include <stdio.h> - #include <stdlib.h> - #include <dlfcn.h> -+#ifndef __APPLE__ - #include <link.h> -+#endif - #include "NativeFunc.h" - - /* standard GSS method names (ordering is from mapfile) */ ---- ./jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c 2011-11-17 22:01:45.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -28,12 +28,19 @@ - #include <string.h> - - #include <dlfcn.h> -+#ifndef __APPLE__ - #include <link.h> -+#endif - - #include <jni_util.h> +--- jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c 2012-05-17 16:15:01.000000000 -0700 +@@ -36,6 +36,11 @@ #include "j2secmod.h" @@ -28887,7 +8360,7 @@ void *findFunction(JNIEnv *env, jlong jHandle, const char *functionName) { void *hModule = (void*)jHandle; void *fAddress = dlsym(hModule, functionName); -@@ -51,7 +58,11 @@ +@@ -53,7 +58,11 @@ { const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL); // look up existing handle only, do not load @@ -28899,7 +8372,7 @@ dprintf2("-handle for %s: %u\n", libName, hModule); (*env)->ReleaseStringUTFChars(env, jLibName, libName); return (jlong)hModule; -@@ -65,6 +76,9 @@ +@@ -67,6 +76,9 @@ dprintf1("-lib %s\n", libName); hModule = dlopen(libName, RTLD_LAZY); @@ -28909,607 +8382,56 @@ (*env)->ReleaseStringUTFChars(env, jLibName, libName); dprintf2("-handle: %u (0X%X)\n", hModule, hModule); ---- ./jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c 2011-11-17 22:01:45.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -64,7 +64,9 @@ - #include <assert.h> - - #include <dlfcn.h> -+#ifndef __APPLE__ - #include <link.h> -+#endif - - #include <jni.h> - ---- ./jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c 2011-11-17 22:01:45.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c 2011-04-22 23:08:39.000000000 -0700 -@@ -29,7 +29,9 @@ - #include <assert.h> - - #include <dlfcn.h> -+#ifndef __APPLE__ - #include <link.h> -+#endif - - #include <winscard.h> - ---- ./jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c 2011-04-22 23:08:39.000000000 -0700 -@@ -1,12 +1,12 @@ - /* -- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -+ * Copyright 2005 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. Oracle designates this -+ * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided -- * by Oracle in the LICENSE file that accompanied this code. -+ * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -@@ -18,9 +18,9 @@ - * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -+ * 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 "jni.h" -@@ -35,10 +35,10 @@ - #include <dirent.h> - #include <ctype.h> - #include <sys/types.h> --#include <sys/types.h> - #include <sys/socket.h> - #include <sys/stat.h> - #include <sys/un.h> -+#include <fcntl.h> - - #include "sun_tools_attach_BsdVirtualMachine.h" - -@@ -49,85 +49,6 @@ - } while(0) - - /* -- * Defines a callback that is invoked for each process -- */ --typedef void (*ProcessCallback)(const pid_t pid, void* user_data); -- --/* -- * Invokes the callback function for each process -- */ --static void forEachProcess(ProcessCallback f, void* user_data) { -- DIR* dir; -- struct dirent* ptr; -- -- /* -- * To locate the children we scan /proc looking for files that have a -- * position integer as a filename. -- */ -- if ((dir = opendir("/proc")) == NULL) { -- return; -- } -- while ((ptr = readdir(dir)) != NULL) { -- pid_t pid; -- -- /* skip current/parent directories */ -- if (strcmp(ptr->d_name, ".") == 0 || strcmp(ptr->d_name, "..") == 0) { -- continue; -- } -- -- /* skip files that aren't numbers */ -- pid = (pid_t)atoi(ptr->d_name); -- if ((int)pid <= 0) { -- continue; -- } -- -- /* invoke the callback */ -- (*f)(pid, user_data); -- } -- closedir(dir); --} -- -- --/* -- * Returns the parent pid of a given pid, or -1 if not found -- */ --static pid_t getParent(pid_t pid) { -- char state; -- FILE* fp; -- char stat[2048]; -- int statlen; -- char fn[32]; -- int i, p; -- char* s; -- -- /* -- * try to open /proc/%d/stat -- */ -- sprintf(fn, "/proc/%d/stat", pid); -- fp = fopen(fn, "r"); -- if (fp == NULL) { -- return -1; -- } -- -- /* -- * The format is: pid (command) state ppid ... -- * As the command could be anything we must find the right most -- * ")" and then skip the white spaces that follow it. -- */ -- statlen = fread(stat, 1, 2047, fp); -- stat[statlen] = '\0'; -- fclose(fp); -- s = strrchr(stat, ')'); -- if (s == NULL) { -- return -1; -- } -- do s++; while (isspace(*s)); -- i = sscanf(s, "%c %d", &state, &p); -- return (pid_t)p; --} -- -- --/* - * Class: sun_tools_attach_BsdVirtualMachine - * Method: socket - * Signature: ()I -@@ -188,146 +109,6 @@ - - /* - * Class: sun_tools_attach_BsdVirtualMachine -- * Method: isBsdThreads -- * Signature: ()V -- */ --JNIEXPORT jboolean JNICALL Java_sun_tools_attach_BsdVirtualMachine_isBsdThreads -- (JNIEnv *env, jclass cls) --{ --# ifndef _CS_GNU_LIBPTHREAD_VERSION --# define _CS_GNU_LIBPTHREAD_VERSION 3 --# endif -- size_t n; -- char* s; -- jboolean res; -- -- n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0); -- if (n <= 0) { -- /* glibc before 2.3.2 only has BsdThreads */ -- return JNI_TRUE; -- } -- -- s = (char *)malloc(n); -- if (s == NULL) { -- JNU_ThrowOutOfMemoryError(env, "malloc failed"); -- return JNI_TRUE; -- } -- confstr(_CS_GNU_LIBPTHREAD_VERSION, s, n); -- -- /* -- * If the LIBPTHREAD version include "NPTL" then we know we -- * have the new threads library and not BsdThreads -- */ -- res = (jboolean)(strstr(s, "NPTL") == NULL); -- free(s); -- return res; --} -- --/* -- * Structure and callback function used to count the children of -- * a given process, and record the pid of the "manager thread". -- */ --typedef struct { -- pid_t ppid; -- int count; -- pid_t mpid; --} ChildCountContext; -- --static void ChildCountCallback(const pid_t pid, void* user_data) { -- ChildCountContext* context = (ChildCountContext*)user_data; -- if (getParent(pid) == context->ppid) { -- context->count++; -- /* -- * Remember the pid of the first child. If the final count is -- * one then this is the pid of the BsdThreads manager. -- */ -- if (context->count == 1) { -- context->mpid = pid; -- } -- } --} -- --/* -- * Class: sun_tools_attach_BsdVirtualMachine -- * Method: getBsdThreadsManager -- * Signature: (I)I -- */ --JNIEXPORT jint JNICALL Java_sun_tools_attach_BsdVirtualMachine_getBsdThreadsManager -- (JNIEnv *env, jclass cls, jint pid) --{ -- ChildCountContext context; -- -- /* -- * Iterate over all processes to find how many children 'pid' has -- */ -- context.ppid = pid; -- context.count = 0; -- context.mpid = (pid_t)0; -- forEachProcess(ChildCountCallback, (void*)&context); -- -- /* -- * If there's no children then this is likely the pid of the primordial -- * created by the launcher - in that case the BsdThreads manager is the -- * parent of this process. -- */ -- if (context.count == 0) { -- pid_t parent = getParent(pid); -- if ((int)parent > 0) { -- return (jint)parent; -- } -- } -- -- /* -- * There's one child so this is likely the embedded VM case where the -- * the primordial thread == BsdThreads initial thread. The BsdThreads -- * manager in that case is the child. -- */ -- if (context.count == 1) { -- return (jint)context.mpid; -- } -- -- /* -- * If we get here it's most likely we were given the wrong pid -- */ -- JNU_ThrowIOException(env, "Unable to get pid of BsdThreads manager thread"); -- return -1; --} -- --/* -- * Structure and callback function used to send a QUIT signal to all -- * children of a given process -- */ --typedef struct { -- pid_t ppid; --} SendQuitContext; -- --static void SendQuitCallback(const pid_t pid, void* user_data) { -- SendQuitContext* context = (SendQuitContext*)user_data; -- pid_t parent = getParent(pid); -- if (parent == context->ppid) { -- kill(pid, SIGQUIT); -- } --} -- --/* -- * Class: sun_tools_attach_BsdVirtualMachine -- * Method: sendQuitToChildrenOf -- * Signature: (I)V -- */ --JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_sendQuitToChildrenOf -- (JNIEnv *env, jclass cls, jint pid) --{ -- SendQuitContext context; -- context.ppid = (pid_t)pid; -- -- /* -- * Iterate over all children of 'pid' and send a QUIT signal to each. -- */ -- forEachProcess(SendQuitCallback, (void*)&context); --} -- --/* -- * Class: sun_tools_attach_BsdVirtualMachine - * Method: sendQuitTo - * Signature: (I)V - */ -@@ -350,7 +131,7 @@ - jboolean isCopy; - const char* p = GetStringPlatformChars(env, path, &isCopy); - if (p != NULL) { -- struct stat64 sb; -+ struct stat sb; - uid_t uid, gid; - int res; - -@@ -361,7 +142,7 @@ - uid = geteuid(); - gid = getegid(); - -- res = stat64(p, &sb); -+ res = stat(p, &sb); - if (res != 0) { - /* save errno */ - res = errno; -@@ -459,3 +240,40 @@ - - } while (remaining > 0); - } -+ -+/* -+ * Class: sun_tools_attach_BSDVirtualMachine -+ * Method: createAttachFile -+ * Signature: (Ljava.lang.String;)V -+ */ -+JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_createAttachFile(JNIEnv *env, jclass cls, jstring path) -+{ -+ const char* _path; -+ jboolean isCopy; -+ int fd, rc; -+ -+ _path = GetStringPlatformChars(env, path, &isCopy); -+ if (_path == NULL) { -+ JNU_ThrowIOException(env, "Must specify a path"); -+ return; -+ } -+ -+ RESTARTABLE(open(_path, O_CREAT | O_EXCL, S_IWUSR | S_IRUSR), fd); -+ if (fd == -1) { -+ /* release p here before we throw an I/O exception */ -+ if (isCopy) { -+ JNU_ReleaseStringPlatformChars(env, path, _path); -+ } -+ JNU_ThrowIOExceptionWithLastError(env, "open"); -+ return; -+ } -+ -+ RESTARTABLE(chown(_path, geteuid(), getegid()), rc); -+ -+ RESTARTABLE(close(fd), rc); -+ -+ /* release p here */ -+ if (isCopy) { -+ JNU_ReleaseStringPlatformChars(env, path, _path); -+ } -+} ---- ./jdk/src/solaris/native/sun/xawt/XWindow.c 2011-11-17 22:01:46.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/xawt/XWindow.c 2011-04-22 23:08:39.000000000 -0700 -@@ -228,10 +228,10 @@ - {java_awt_event_KeyEvent_VK_DOWN, XK_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD}, - - /* Keypad equivalents of Triangular Navigation Block */ -- {java_awt_event_KeyEvent_VK_KP_LEFT, XK_KP_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, -- {java_awt_event_KeyEvent_VK_KP_UP, XK_KP_Up, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, -- {java_awt_event_KeyEvent_VK_KP_RIGHT, XK_KP_Right, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, -- {java_awt_event_KeyEvent_VK_KP_DOWN, XK_KP_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, -+ {java_awt_event_KeyEvent_VK_LEFT, XK_KP_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, -+ {java_awt_event_KeyEvent_VK_UP, XK_KP_Up, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, -+ {java_awt_event_KeyEvent_VK_RIGHT, XK_KP_Right, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, -+ {java_awt_event_KeyEvent_VK_DOWN, XK_KP_Down, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD}, - - /* Other vendor-specific Triangular Navigation Block */ - {java_awt_event_KeyEvent_VK_LEFT, osfXK_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD}, +--- jdk/src/solaris/native/sun/xawt/XWindow.c 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/src/solaris/native/sun/xawt/XWindow.c 2012-05-17 16:18:01.000000000 -0700 @@ -867,7 +867,7 @@ { KeySym originalKeysym = *keysym; --#ifndef __linux__ +-#if !defined(__linux__) && !defined(MACOSX) +#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) /* The following code on Linux will cause the keypad keys * not to echo on JTextField when the NumLock is on. The * keysyms will be 0, because the last parameter 2 is not defined. ---- ./jdk/src/solaris/native/sun/xawt/awt_Desktop.c 2011-11-17 22:01:46.000000000 -0800 -+++ ./jdk/src/solaris/native/sun/xawt/awt_Desktop.c 2011-04-22 23:08:39.000000000 -0700 -@@ -24,6 +24,7 @@ - */ - - #include <jni.h> -+#include <jvm_md.h> - #include <dlfcn.h> - - typedef int gboolean; -@@ -39,12 +40,15 @@ - void *gnome_handle; - const char *errmsg; - -- vfs_handle = dlopen("libgnomevfs-2.so.0", RTLD_LAZY); -+ vfs_handle = dlopen(VERSIONED_JNI_LIB_NAME("gnomevfs-2", "0"), RTLD_LAZY); - if (vfs_handle == NULL) { -+ vfs_handle = dlopen(JNI_LIB_NAME("gnomevfs-2"), RTLD_LAZY); -+ if (vfs_handle == NULL) { - #ifdef INTERNAL_BUILD -- fprintf(stderr, "can not load libgnomevfs-2.so\n"); -+ fprintf(stderr, "can not load libgnomevfs-2.so\n"); - #endif -- return 0; -+ return 0; -+ } - } - dlerror(); /* Clear errors */ - gnome_vfs_init = (GNOME_VFS_INIT_TYPE*)dlsym(vfs_handle, "gnome_vfs_init"); -@@ -63,12 +67,15 @@ - // call gonme_vfs_init() - (*gnome_vfs_init)(); - -- gnome_handle = dlopen("libgnome-2.so.0", RTLD_LAZY); -+ gnome_handle = dlopen(VERSIONED_JNI_LIB_NAME("gnome-2", "0"), RTLD_LAZY); - if (gnome_handle == NULL) { -+ gnome_handle = dlopen(JNI_LIB_NAME("gnome-2"), RTLD_LAZY); -+ if (gnome_handle == NULL) { - #ifdef INTERNAL_BUILD -- fprintf(stderr, "can not load libgnome-2.so\n"); -+ fprintf(stderr, "can not load libgnome-2.so\n"); - #endif -- return 0; -+ return 0; -+ } - } - dlerror(); /* Clear errors */ - gnome_url_show = (GNOME_URL_SHOW_TYPE*)dlsym(gnome_handle, "gnome_url_show"); ---- ./jdk/src/solaris/npt/npt_md.h 2011-11-17 22:01:46.000000000 -0800 -+++ ./jdk/src/solaris/npt/npt_md.h 2011-04-22 23:08:39.000000000 -0700 -@@ -32,9 +32,10 @@ - #include <string.h> - #include <errno.h> - #include <dlfcn.h> -+#ifndef __APPLE__ - #include <link.h> -- --#define NPT_LIBNAME "libnpt.so" -+#endif -+#include <jvm_md.h> - - #define NPT_INITIALIZE(pnpt,version,options) \ - { \ -@@ -43,7 +44,7 @@ - \ - if ( (pnpt) == NULL ) NPT_ERROR("NptEnv* is NULL"); \ - *(pnpt) = NULL; \ -- _handle = dlopen(NPT_LIBNAME, RTLD_LAZY); \ -+ _handle = dlopen(JNI_LIB_NAME("npt"), RTLD_LAZY); \ - if ( _handle == NULL ) NPT_ERROR("Cannot open library"); \ - _sym = dlsym(_handle, "nptInitialize"); \ - if ( _sym == NULL ) NPT_ERROR("Cannot find nptInitialize"); \ ---- ./jdk/src/solaris/transport/socket/socket_md.c 2011-11-17 22:01:46.000000000 -0800 -+++ ./jdk/src/solaris/transport/socket/socket_md.c 2012-02-12 13:05:35.000000000 -0800 -@@ -36,7 +36,7 @@ - #ifdef __solaris__ - #include <thread.h> - #endif --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - #include <pthread.h> - #include <sys/poll.h> - #endif -@@ -52,7 +52,7 @@ - int - dbgsysConnect(int fd, struct sockaddr *name, int namelen) { - int rv = connect(fd, name, namelen); -- if (rv < 0 && errno == EINPROGRESS) { -+ if (rv < 0 && (errno == EINPROGRESS || errno == EINTR)) { - return DBG_EINPROGRESS; - } else { - return rv; -@@ -79,7 +79,7 @@ - if (rv >= 0) { - return rv; - } -- if (errno != ECONNABORTED) { -+ if (errno != ECONNABORTED && errno != EINTR) { - return rv; - } - } -@@ -88,23 +88,43 @@ - int - dbgsysRecvFrom(int fd, char *buf, int nBytes, - int flags, struct sockaddr *from, int *fromlen) { -- return recvfrom(fd, buf, nBytes, flags, from, fromlen); -+ int rv; -+ do { -+ rv = recvfrom(fd, buf, nBytes, flags, from, fromlen); -+ } while (rv == -1 && errno == EINTR); -+ -+ return rv; - } - - int - dbgsysSendTo(int fd, char *buf, int len, - int flags, struct sockaddr *to, int tolen) { -- return sendto(fd, buf, len, flags, to, tolen); -+ int rv; -+ do { -+ rv = sendto(fd, buf, len, flags, to, tolen); -+ } while (rv == -1 && errno == EINTR); -+ -+ return rv; - } - - int - dbgsysRecv(int fd, char *buf, int nBytes, int flags) { -- return recv(fd, buf, nBytes, flags); -+ int rv; -+ do { -+ rv = recv(fd, buf, nBytes, flags); -+ } while (rv == -1 && errno == EINTR); -+ -+ return rv; - } - - int - dbgsysSend(int fd, char *buf, int nBytes, int flags) { -- return send(fd, buf, nBytes, flags); -+ int rv; -+ do { -+ rv = send(fd, buf, nBytes, flags); -+ } while (rv == -1 && errno == EINTR); -+ -+ return rv; - } - - struct hostent * -@@ -123,7 +143,12 @@ - } - - int dbgsysSocketClose(int fd) { -- return close(fd); -+ int rv; -+ do { -+ rv = close(fd); -+ } while (rv == -1 && errno == EINTR); -+ -+ return rv; - } - - int -@@ -283,7 +308,7 @@ - - #endif - --#ifdef __linux__ -+#if defined(__linux__) || defined(_ALLBSD_SOURCE) - int - dbgsysTlsAlloc() { - pthread_key_t key; ---- ./jdk/test/Makefile 2011-11-17 22:02:07.000000000 -0800 -+++ ./jdk/test/Makefile 2011-04-22 23:08:40.000000000 -0700 -@@ -79,6 +79,16 @@ +--- jdk/test/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/Makefile 2012-05-17 16:18:01.000000000 -0700 +@@ -79,6 +79,11 @@ endif OS_VERSION := $(shell $(UNAME) -r) endif -+ifeq ($(UNAME_S), Darwin) -+ OS_NAME = bsd -+ OS_ARCH := $(shell $(UNAME) -m) -+ OS_VERSION := $(shell $(UNAME) -r) -+endif +ifeq ($(findstring BSD,$(UNAME_S)), BSD) + OS_NAME = bsd + OS_ARCH := $(shell $(UNAME) -m) + OS_VERSION := $(shell $(UNAME) -r) +endif - ifeq ($(OS_NAME),) - OS_NAME = windows - # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always ---- ./jdk/test/com/sun/jdi/ImmutableResourceTest.sh 2011-11-17 22:02:13.000000000 -0800 -+++ ./jdk/test/com/sun/jdi/ImmutableResourceTest.sh 2011-04-22 23:08:41.000000000 -0700 + ifeq ($(UNAME_S), Darwin) + OS_NAME = macosx + OS_ARCH := $(shell $(UNAME) -m) +--- jdk/test/com/sun/jdi/ImmutableResourceTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/jdi/ImmutableResourceTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -56,7 +56,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" ;; ---- ./jdk/test/com/sun/jdi/JITDebug.sh 2011-11-17 22:02:13.000000000 -0800 -+++ ./jdk/test/com/sun/jdi/JITDebug.sh 2011-04-22 23:08:41.000000000 -0700 +--- jdk/test/com/sun/jdi/JITDebug.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/jdi/JITDebug.sh 2012-05-17 16:18:01.000000000 -0700 @@ -63,7 +63,7 @@ OS=`uname -s` export TRANSPORT_METHOD case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" TRANSPORT_METHOD=dt_socket ;; ---- ./jdk/test/com/sun/jdi/PrivateTransportTest.sh 2011-11-17 22:02:15.000000000 -0800 -+++ ./jdk/test/com/sun/jdi/PrivateTransportTest.sh 2011-04-22 23:08:41.000000000 -0700 -@@ -123,10 +123,14 @@ +--- jdk/test/com/sun/jdi/PrivateTransportTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/jdi/PrivateTransportTest.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -123,7 +123,7 @@ esac libloc=${jreloc}/lib/${libarch} ;; @@ -29518,64 +8440,71 @@ xx=`find ${jreloc}/lib -name libdt_socket.so` libloc=`dirname ${xx}` ;; -+ Darwin) -+ xx=`find ${jreloc}/lib -name libdt_socket.dylib` -+ libloc=`dirname ${xx}` -+ ;; - Windows*) - is_windows=true - libloc=${jreloc}/bin ---- ./jdk/test/com/sun/jdi/ShellScaffold.sh 2011-11-17 22:02:16.000000000 -0800 -+++ ./jdk/test/com/sun/jdi/ShellScaffold.sh 2011-04-22 23:08:41.000000000 -0700 +--- jdk/test/com/sun/jdi/ShellScaffold.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/jdi/ShellScaffold.sh 2012-05-17 16:18:01.000000000 -0700 @@ -292,7 +292,7 @@ psCmd=ps jstack=jstack.exe ;; -- SunOS | Linux) +- SunOS | Linux | Darwin) + SunOS | Linux | *BSD | Darwin) transport=dt_socket address= devnull=/dev/null ---- ./jdk/test/com/sun/jdi/Solaris32AndSolaris64Test.sh 2011-11-17 22:02:16.000000000 -0800 -+++ ./jdk/test/com/sun/jdi/Solaris32AndSolaris64Test.sh 2011-04-22 23:08:41.000000000 -0700 +--- jdk/test/com/sun/jdi/Solaris32AndSolaris64Test.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/jdi/Solaris32AndSolaris64Test.sh 2012-05-17 16:18:01.000000000 -0700 @@ -112,7 +112,7 @@ fi ;; -- Linux ) +- Linux | Darwin ) + Linux | *BSD | Darwin ) pass "This test always passes on $OS" ;; ---- ./jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh 2011-11-17 22:02:17.000000000 -0800 -+++ ./jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh 2011-04-22 23:08:41.000000000 -0700 -@@ -45,10 +45,7 @@ +--- jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -45,7 +45,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) -- PS=":" -- ;; -- Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" ;; Windows* | CYGWIN*) ---- ./jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh 2011-11-17 22:02:20.000000000 -0800 -+++ ./jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh 2011-04-22 23:08:41.000000000 -0700 -@@ -83,6 +83,10 @@ +--- jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh 2012-05-19 16:20:55.000000000 -0700 +@@ -72,6 +72,16 @@ + done + } + ++bsd_swap_size() ++{ ++ total_swap=0 ++ for i in `/usr/sbin/swapinfo -k | awk '{print $2}' | grep -v blocks` ++ do ++ # swapinfo -k returns size in kilobytes. ++ total_swap=`expr $i \* 1024 + $total_swap` ++ done ++} ++ + # Test GetTotalSwapSpaceSize if we are running on Unix + total_swap=0 + case `uname -s` in +@@ -83,6 +93,10 @@ total_swap=`free -b | grep -i swap | awk '{print $2}'` runOne GetTotalSwapSpaceSize $total_swap ;; + *BSD ) -+ # FIXME: Determine swap space. -+ runOne GetTotalSwapSpaceSize "sanity-only" ++ bsd_swap_size ++ runOne GetTotalSwapSpaceSize $total_swap + ;; * ) runOne GetTotalSwapSpaceSize "sanity-only" ;; ---- ./jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh 2011-11-17 22:02:20.000000000 -0800 -+++ ./jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh 2011-04-22 23:08:41.000000000 -0700 +--- jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh 2011-04-22 23:08:41.000000000 -0700 @@ -48,7 +48,7 @@ # Test GetMaxFileDescriptorCount if we are running on Unix @@ -29585,8 +8514,8 @@ runOne GetMaxFileDescriptorCount ;; * ) ---- ./jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh 2011-11-17 22:02:20.000000000 -0800 -+++ ./jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh 2011-04-22 23:08:41.000000000 -0700 +--- jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh 2011-04-22 23:08:41.000000000 -0700 @@ -48,7 +48,7 @@ # Test GetOpenFileDescriptorCount if we are running on Unix @@ -29596,23 +8525,19 @@ runOne GetOpenFileDescriptorCount ;; * ) ---- ./jdk/test/com/sun/tools/attach/CommonSetup.sh 2011-11-17 22:02:27.000000000 -0800 -+++ ./jdk/test/com/sun/tools/attach/CommonSetup.sh 2011-04-22 23:08:41.000000000 -0700 -@@ -36,11 +36,7 @@ +--- jdk/test/com/sun/tools/attach/CommonSetup.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/com/sun/tools/attach/CommonSetup.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -36,7 +36,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) -- PS=":" -- FS="/" -- ;; -- Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/java/awt/PrintJob/Text/stringwidth.sh 2011-11-17 22:02:43.000000000 -0800 -+++ ./jdk/test/java/awt/PrintJob/Text/stringwidth.sh 2011-04-22 23:08:42.000000000 -0700 +--- jdk/test/java/awt/PrintJob/Text/stringwidth.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/awt/PrintJob/Text/stringwidth.sh 2012-05-19 16:22:36.000000000 -0700 @@ -25,10 +25,11 @@ fi @@ -29624,13 +8549,13 @@ +case "${OS}" in + SunOS | Linux | *BSD | Darwin ) + exit 0 -+ ;; ++ ;; +esac # Windows if [ -z "${TESTJAVA}" ] ; then ---- ./jdk/test/java/io/File/GetXSpace.sh 2011-11-17 22:03:07.000000000 -0800 -+++ ./jdk/test/java/io/File/GetXSpace.sh 2011-04-22 23:08:43.000000000 -0700 +--- jdk/test/java/io/File/GetXSpace.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/io/File/GetXSpace.sh 2011-04-22 23:08:43.000000000 -0700 @@ -26,7 +26,7 @@ # set platform-dependent variable OS=`uname -s` @@ -29640,42 +8565,70 @@ Windows_98 ) return ;; Windows* ) SID=`sid`; TMP="c:/temp" ;; * ) ---- ./jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh 2011-11-17 22:03:13.000000000 -0800 -+++ ./jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh 2011-04-22 23:08:44.000000000 -0700 +--- jdk/test/java/io/FileOutputStream/ManyFiles.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/io/FileOutputStream/ManyFiles.java 2012-05-19 16:24:37.000000000 -0700 +@@ -43,7 +43,7 @@ + // Windows capability it is much simpler to only run it + // on that platform. + String osName = System.getProperty("os.name"); +- if (osName.startsWith("Linux")||osName.startsWith("SunOS")) ++ if (osName.startsWith("Linux")||osName.startsWith("SunOS")||osName.endsWith("BSD")||osName.contains("OS X")) + return; + + for (int n = 0; n < NUM_FILES; n++) { +--- jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh 2012-05-17 16:18:01.000000000 -0700 @@ -41,7 +41,7 @@ # Need to determine the classpath separator and filepath separator based on the # operating system. case "$OS" in --SunOS | Linux ) +-SunOS | Linux | Darwin ) +SunOS | Linux | *BSD | Darwin ) PS=":" ;; Windows* | CYGWIN* ) PS=";" ;; ---- ./jdk/test/java/io/Serializable/serialver/classpath/run.sh 2011-11-17 22:03:15.000000000 -0800 -+++ ./jdk/test/java/io/Serializable/serialver/classpath/run.sh 2011-04-22 23:08:44.000000000 -0700 +--- jdk/test/java/io/Serializable/serialver/classpath/run.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/io/Serializable/serialver/classpath/run.sh 2012-05-17 16:18:01.000000000 -0700 @@ -47,7 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" ;; Windows* | CYGWIN* ) PS=";" ;; ---- ./jdk/test/java/io/Serializable/serialver/nested/run.sh 2011-11-17 22:03:15.000000000 -0800 -+++ ./jdk/test/java/io/Serializable/serialver/nested/run.sh 2011-04-22 23:08:44.000000000 -0700 +--- jdk/test/java/io/Serializable/serialver/nested/run.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/io/Serializable/serialver/nested/run.sh 2012-05-17 16:18:01.000000000 -0700 @@ -47,7 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" ;; Windows* | CYGWIN* ) PS=";" ;; ---- ./jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh 2011-11-17 22:03:20.000000000 -0800 -+++ ./jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh 2011-04-22 23:08:44.000000000 -0700 -@@ -49,10 +49,7 @@ +--- jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh 2012-05-19 16:25:13.000000000 -0700 +@@ -45,13 +45,7 @@ + # set platform-specific variables + OS=`uname -s` + case "$OS" in +- SunOS ) +- FS="/" +- ;; +- Linux ) +- FS="/" +- ;; +- Darwin ) ++ SunOS | Linux | *BSD | Darwin ) + FS="/" + ;; + Windows*) +--- jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh 2012-05-19 16:25:55.000000000 -0700 +@@ -49,13 +49,7 @@ # set platform-specific variables OS=`uname -s` case "$OS" in @@ -29683,34 +8636,37 @@ - FS="/" - ;; - Linux ) +- FS="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" ;; Windows* | CYGWIN* ) ---- ./jdk/test/java/lang/StringCoding/CheckEncodings.sh 2011-11-17 22:03:23.000000000 -0800 -+++ ./jdk/test/java/lang/StringCoding/CheckEncodings.sh 2011-04-22 23:08:45.000000000 -0700 +--- jdk/test/java/lang/StringCoding/CheckEncodings.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/lang/StringCoding/CheckEncodings.sh 2012-05-17 16:18:01.000000000 -0700 @@ -30,7 +30,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) ;; -+ SunOS | Linux | *BSD | Darwin ) ;; +- SunOS | Linux | Darwin) ;; ++ SunOS | Linux | *BSD | Darwin) ;; Windows* | CYGWIN* ) echo "Passed"; exit 0 ;; * ) echo "Unrecognized system!" ; exit 1 ;; ---- ./jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh 2011-11-17 22:03:24.000000000 -0800 -+++ ./jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh 2011-04-22 23:08:45.000000000 -0700 +--- jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh 2012-05-17 16:18:01.000000000 -0700 @@ -44,7 +44,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) -+ SunOS | Linux | *BSD | Darwin ) +- SunOS | Linux | Darwin) ++ SunOS | Linux | *BSD | Darwin) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/java/lang/instrument/MakeJAR2.sh 2011-11-17 22:03:25.000000000 -0800 -+++ ./jdk/test/java/lang/instrument/MakeJAR2.sh 2011-04-22 23:08:45.000000000 -0700 +--- jdk/test/java/lang/instrument/MakeJAR2.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/lang/instrument/MakeJAR2.sh 2011-04-22 23:08:45.000000000 -0700 @@ -49,7 +49,7 @@ OS=`uname -s` @@ -29720,9 +8676,9 @@ PATHSEP=":" ;; ---- ./jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh 2011-11-17 22:03:28.000000000 -0800 -+++ ./jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh 2011-04-22 23:08:45.000000000 -0700 -@@ -35,11 +35,7 @@ +--- jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh 2012-05-19 16:26:36.000000000 -0700 +@@ -35,15 +35,7 @@ OS=`uname -s` case "$OS" in @@ -29731,42 +8687,54 @@ - FS="/" - ;; - Linux ) +- PS=":" +- FS="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh 2011-11-17 22:03:30.000000000 -0800 -+++ ./jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh 2011-04-22 23:08:45.000000000 -0700 -@@ -61,10 +61,7 @@ +--- jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -61,7 +61,7 @@ while true; do echo "Run $i: TestSystemLoadAvg" case `uname -s` in -- SunOS ) -- runOne GetSystemLoadAverage -- ;; -- Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) runOne GetSystemLoadAverage ;; * ) ---- ./jdk/test/java/net/Authenticator/B4933582.sh 2011-11-17 22:03:34.000000000 -0800 -+++ ./jdk/test/java/net/Authenticator/B4933582.sh 2011-04-22 23:08:45.000000000 -0700 +--- jdk/test/java/net/Authenticator/B4933582.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/Authenticator/B4933582.sh 2012-05-17 16:18:01.000000000 -0700 @@ -26,7 +26,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh 2011-11-17 22:03:36.000000000 -0800 -+++ ./jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh 2011-04-22 23:08:45.000000000 -0700 +--- jdk/test/java/net/DatagramSocket/SendDatagramToBadAddress.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/DatagramSocket/SendDatagramToBadAddress.java 2012-05-19 21:01:58.000000000 -0700 +@@ -45,6 +45,8 @@ + return (true); + if (p.getProperty ("os.name").equals ("Linux")) + return (true); ++ if (p.getProperty ("os.name").endsWith ("BSD")) ++ return (true); + if (p.getProperty ("os.name").startsWith ("Mac OS")) + return (true); + // Check for specific Solaris version from here +--- jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh 2012-05-17 16:18:01.000000000 -0700 @@ -27,11 +27,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS ) +- SunOS | Darwin ) - PATHSEP=":" - FILESEP="/" - ;; @@ -29775,46 +8743,46 @@ PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/java/net/Socket/OldSocketImpl.sh 2011-11-17 22:03:40.000000000 -0800 -+++ ./jdk/test/java/net/Socket/OldSocketImpl.sh 2011-04-22 23:08:45.000000000 -0700 +--- jdk/test/java/net/Socket/OldSocketImpl.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/Socket/OldSocketImpl.sh 2012-05-17 16:18:01.000000000 -0700 @@ -28,7 +28,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/java/net/URL/B5086147.sh 2011-11-17 22:03:42.000000000 -0800 -+++ ./jdk/test/java/net/URL/B5086147.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/net/URL/B5086147.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/URL/B5086147.sh 2012-05-17 16:18:01.000000000 -0700 @@ -26,7 +26,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) exit 0 ;; CYGWIN* ) ---- ./jdk/test/java/net/URL/runconstructor.sh 2011-11-17 22:03:43.000000000 -0800 -+++ ./jdk/test/java/net/URL/runconstructor.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/net/URL/runconstructor.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/URL/runconstructor.sh 2012-05-17 16:18:01.000000000 -0700 @@ -27,7 +27,7 @@ # OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/java/net/URLClassLoader/B5077773.sh 2011-11-17 22:03:43.000000000 -0800 -+++ ./jdk/test/java/net/URLClassLoader/B5077773.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/net/URLClassLoader/B5077773.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/URLClassLoader/B5077773.sh 2012-05-17 16:18:01.000000000 -0700 @@ -34,11 +34,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) +- SunOS | Darwin ) - PS=":" - FS="/" - ;; @@ -29823,28 +8791,28 @@ PS=":" FS="/" ;; ---- ./jdk/test/java/net/URLClassLoader/sealing/checksealed.sh 2011-11-17 22:03:45.000000000 -0800 -+++ ./jdk/test/java/net/URLClassLoader/sealing/checksealed.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/net/URLClassLoader/sealing/checksealed.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/URLClassLoader/sealing/checksealed.sh 2012-05-17 16:18:01.000000000 -0700 @@ -27,11 +27,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) +- SunOS | Darwin ) - PS=":" -- FS="/" +- FS="/" - ;; - Linux ) + SunOS | Linux | *BSD | Darwin ) PS=":" - FS="/" + FS="/" ;; ---- ./jdk/test/java/net/URLConnection/6212146/test.sh 2011-11-17 22:03:45.000000000 -0800 -+++ ./jdk/test/java/net/URLConnection/6212146/test.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/net/URLConnection/6212146/test.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/net/URLConnection/6212146/test.sh 2012-05-17 16:18:01.000000000 -0700 @@ -33,11 +33,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) +- SunOS | Darwin ) - PS=":" - FS="/" - ;; @@ -29853,8 +8821,8 @@ PS=":" FS="/" ;; ---- ./jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Makefile 2011-11-17 22:03:53.000000000 -0800 -+++ ./jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Makefile 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Makefile 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/Makefile 2011-04-22 23:08:46.000000000 -0700 @@ -71,6 +71,48 @@ EXTRA_LIBS = -lc endif @@ -29904,9 +8872,8 @@ LIBDIR=lib/$(PLATFORM)-$(ARCH) LAUNCHERLIB=$(LIBDIR)/libLauncher.so -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/lib/bsd-i586/libLauncher.so and /tmp/bsd-port/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/lib/bsd-i586/libLauncher.so differ ---- ./jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh 2011-11-17 22:03:54.000000000 -0800 -+++ ./jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh 2011-04-22 23:08:46.000000000 -0700 @@ -33,11 +33,14 @@ # @run shell run_tests.sh @@ -29975,8 +8942,8 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select LIBDIR=lib/${PLATFORM}-${ARCH} LAUNCHERLIB=${LIBDIR}/libLauncher.so ---- ./jdk/test/java/nio/charset/Charset/default.sh 2011-11-17 22:03:54.000000000 -0800 -+++ ./jdk/test/java/nio/charset/Charset/default.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/nio/charset/Charset/default.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/nio/charset/Charset/default.sh 2011-04-22 23:08:46.000000000 -0700 @@ -41,10 +41,14 @@ fi @@ -29996,24 +8963,24 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select JAVA=$TESTJAVA/bin/java ---- ./jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh 2011-11-17 22:03:54.000000000 -0800 -+++ ./jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh 2012-05-17 16:18:01.000000000 -0700 @@ -34,7 +34,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) ;; -+ SunOS | Linux | *BSD | Darwin) ;; +- SunOS | Linux | Darwin ) ;; ++ SunOS | Linux | *BSD | Darwin ) ;; # Skip locale test for Windows Windows* ) echo "Passed"; exit 0 ;; ---- ./jdk/test/java/nio/charset/spi/basic.sh 2011-11-17 22:03:54.000000000 -0800 -+++ ./jdk/test/java/nio/charset/spi/basic.sh 2011-04-22 23:08:46.000000000 -0700 +--- jdk/test/java/nio/charset/spi/basic.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/nio/charset/spi/basic.sh 2012-05-17 16:18:01.000000000 -0700 @@ -70,10 +70,14 @@ L="$1" shift s=`uname -s` -- if [ $s != Linux -a $s != SunOS ]; then +- if [ $s != Linux -a $s != SunOS -a $s != Darwin ]; then - echo "$L: Locales not supported on this system, skipping..." - exit 0 - fi @@ -30023,7 +8990,7 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select + *) + echo "$L: Locales not supported on this system, skipping..." + exit 0 -+ ;; ++ ;; + esac if [ "x`locale -a | grep $L`" != "x$L" ]; then echo "$L: Locale not supported, skipping..." @@ -30032,36 +8999,55 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select cd $TMP case `uname` in -- SunOS | Linux ) CPS=':' ;; -+ SunOS | Linux | *BSD | Darwin) CPS=':' ;; +- SunOS | Linux | Darwin ) CPS=':' ;; ++ SunOS | Linux | *BSD | Darwin ) CPS=':' ;; Windows* ) CPS=';' ;; *) echo "Unknown platform: `uname`"; exit 1 ;; esac ---- ./jdk/test/java/nio/file/Files/CopyAndMove.java 2011-11-17 22:03:55.000000000 -0800 -+++ ./jdk/test/java/nio/file/Files/CopyAndMove.java 2011-04-22 23:08:46.000000000 -0700 -@@ -153,7 +153,8 @@ - - // get file attributes of source file +--- jdk/test/java/nio/file/FileSystem/Basic.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/nio/file/FileSystem/Basic.java 2012-05-19 21:04:39.000000000 -0700 +@@ -76,6 +76,8 @@ + checkSupported(fs, "posix", "unix", "owner", "acl", "user"); + if (os.equals("Linux")) + checkSupported(fs, "posix", "unix", "owner", "dos", "user"); ++ if (os.endsWith("BSD")) ++ checkSupported(fs, "posix", "unix", "owner"); + if (os.contains("OS X")) + checkSupported(fs, "posix", "unix", "owner"); + if (os.equals("Windows")) +--- jdk/test/java/nio/file/Files/CopyAndMove.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/nio/file/Files/CopyAndMove.java 2012-05-17 16:18:01.000000000 -0700 +@@ -634,7 +634,7 @@ + + // check POSIX attributes are copied + String os = System.getProperty("os.name"); +- if (os.equals("SunOS") || os.equals("Linux")) { ++ if (os.equals("SunOS") || os.equals("Linux") || os.endsWith("BSD")) { + checkPosixAttributes( + readAttributes(source, PosixFileAttributes.class, linkOptions), + readAttributes(target, PosixFileAttributes.class, linkOptions)); +@@ -1136,7 +1136,7 @@ + static void randomizeAttributes(Path file) throws IOException { String os = System.getProperty("os.name"); -- if (os.equals("SunOS") || os.equals("Linux")) { -+ if (os.equals("SunOS") || os.equals("Linux") || -+ os.endsWith("BSD") || os.equals("Darwin")) { - posixAttributes = readAttributes(source, PosixFileAttributes.class, NOFOLLOW_LINKS); - basicAttributes = posixAttributes; - } ---- ./jdk/test/java/rmi/registry/readTest/readTest.sh 2011-11-17 22:04:02.000000000 -0800 -+++ ./jdk/test/java/rmi/registry/readTest/readTest.sh 2012-03-03 19:12:22.000000000 -0800 + boolean isWindows = os.startsWith("Windows"); +- boolean isUnix = os.equals("SunOS") || os.equals("Linux"); ++ boolean isUnix = os.equals("SunOS") || os.equals("Linux") || os.endsWith("BSD"); + boolean isDirectory = isDirectory(file, NOFOLLOW_LINKS); + + if (isUnix) { +--- jdk/test/java/rmi/registry/readTest/readTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/rmi/registry/readTest/readTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -28,7 +28,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) -+ SunOS | Linux | *BSD ) +- SunOS | Linux | Darwin ) ++ SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" FILEURL="file:" ---- ./jdk/test/java/rmi/reliability/launch_reliability.ksh 2011-11-17 22:04:05.000000000 -0800 -+++ ./jdk/test/java/rmi/reliability/launch_reliability.ksh 2011-04-22 23:08:47.000000000 -0700 +--- jdk/test/java/rmi/reliability/launch_reliability.ksh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/rmi/reliability/launch_reliability.ksh 2011-04-22 23:08:47.000000000 -0700 @@ -84,14 +84,12 @@ @@ -30081,9 +9067,28 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select export PATH_SEP mainpid=$$ ---- ./jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh 2011-11-17 22:04:16.000000000 -0800 -+++ ./jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh 2011-04-22 23:08:48.000000000 -0700 -@@ -46,11 +46,7 @@ +--- jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh 2012-05-19 21:05:25.000000000 -0700 +@@ -46,15 +46,7 @@ + # set platform-dependent variables + OS=`uname -s` + case "$OS" in +- SunOS ) +- PATHSEP=":" +- FILESEP="/" +- ;; +- Linux ) +- PATHSEP=":" +- FILESEP="/" +- ;; +- Darwin ) ++ SunOS | Linux | *BSD | Darwin ) + PATHSEP=":" + FILESEP="/" + ;; +--- jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh 2012-05-19 21:05:48.000000000 -0700 +@@ -34,15 +34,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in @@ -30092,13 +9097,17 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select - FILESEP="/" - ;; - Linux ) +- PATHSEP=":" +- FILESEP="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh 2011-11-17 22:04:16.000000000 -0800 -+++ ./jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh 2011-04-22 23:08:48.000000000 -0700 -@@ -34,11 +34,7 @@ +--- jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh 2012-05-19 21:06:15.000000000 -0700 +@@ -50,15 +50,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in @@ -30107,13 +9116,17 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select - FILESEP="/" - ;; - Linux ) +- PATHSEP=":" +- FILESEP="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/java/security/Security/signedfirst/Dyn.sh 2011-11-17 22:04:17.000000000 -0800 -+++ ./jdk/test/java/security/Security/signedfirst/Dyn.sh 2011-04-22 23:08:48.000000000 -0700 -@@ -46,11 +46,7 @@ +--- jdk/test/java/security/Security/signedfirst/Dyn.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/security/Security/signedfirst/Dyn.sh 2012-05-19 21:06:42.000000000 -0700 +@@ -46,15 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in @@ -30122,13 +9135,17 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select - FILESEP="/" - ;; - Linux ) +- PATHSEP=":" +- FILESEP="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/java/security/Security/signedfirst/Static.sh 2011-11-17 22:04:17.000000000 -0800 -+++ ./jdk/test/java/security/Security/signedfirst/Static.sh 2011-04-22 23:08:48.000000000 -0700 -@@ -46,11 +46,7 @@ +--- jdk/test/java/security/Security/signedfirst/Static.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/security/Security/signedfirst/Static.sh 2012-05-19 21:07:17.000000000 -0700 +@@ -46,15 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in @@ -30137,96 +9154,111 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select - FILESEP="/" - ;; - Linux ) +- PATHSEP=":" +- FILESEP="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/java/util/Currency/PropertiesTest.sh 2011-11-17 22:04:26.000000000 -0800 -+++ ./jdk/test/java/util/Currency/PropertiesTest.sh 2011-04-22 23:08:48.000000000 -0700 +--- jdk/test/java/util/Currency/PropertiesTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/util/Currency/PropertiesTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -30,7 +30,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/java/util/PluggableLocale/ExecTest.sh 2011-11-17 22:04:32.000000000 -0800 -+++ ./jdk/test/java/util/PluggableLocale/ExecTest.sh 2011-04-22 23:08:48.000000000 -0700 +--- jdk/test/java/util/PluggableLocale/ExecTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/util/PluggableLocale/ExecTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -58,7 +58,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/java/util/ResourceBundle/Bug6299235Test.sh 2011-11-17 22:04:35.000000000 -0800 -+++ ./jdk/test/java/util/ResourceBundle/Bug6299235Test.sh 2011-04-22 23:08:49.000000000 -0700 +--- jdk/test/java/util/ResourceBundle/Bug6299235Test.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/util/ResourceBundle/Bug6299235Test.sh 2012-05-17 16:18:01.000000000 -0700 @@ -31,7 +31,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh 2011-11-17 22:04:36.000000000 -0800 -+++ ./jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh 2011-04-22 23:08:49.000000000 -0700 -@@ -75,7 +75,7 @@ - SunOS) +--- jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh 2012-05-20 10:01:42.000000000 -0700 +@@ -72,10 +72,10 @@ + Windows* | CYGWIN* ) + DEL=";" + ;; +-SunOS | Darwin) ++SunOS | Darwin ) DEL=":" ;; -Linux) -+Linux|*BSD|Darwin) ++Linux | *BSD ) DEL=":" HAS_S=YES ;; ---- ./jdk/test/java/util/ServiceLoader/basic.sh 2011-11-17 22:04:39.000000000 -0800 -+++ ./jdk/test/java/util/ServiceLoader/basic.sh 2011-04-22 23:08:49.000000000 -0700 +--- jdk/test/java/util/ServiceLoader/basic.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/java/util/ServiceLoader/basic.sh 2012-05-17 16:18:01.000000000 -0700 @@ -42,9 +42,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) +- SunOS | Darwin ) - SEP=':' ;; - Linux ) + SunOS | Linux | *BSD | Darwin ) SEP=':' ;; * ) SEP='\;' ;; ---- ./jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh 2011-11-17 22:04:52.000000000 -0800 -+++ ./jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh 2011-04-22 23:08:49.000000000 -0700 +--- jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -51,7 +51,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/javax/script/CommonSetup.sh 2011-11-17 22:05:04.000000000 -0800 -+++ ./jdk/test/javax/script/CommonSetup.sh 2011-04-22 23:08:50.000000000 -0700 -@@ -36,11 +36,7 @@ +--- jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh 2012-05-20 10:02:13.000000000 -0700 +@@ -84,7 +84,7 @@ + TMP="/tmp" + ;; + +- Linux | Darwin ) ++ Linux | *BSD | Darwin ) + VAR="A different value for Linux" + DEFAULT_JDK=/usr/local/java/jdk1.4/linux-i386 + FILESEP="/" +--- jdk/test/javax/script/CommonSetup.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/javax/script/CommonSetup.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -36,7 +36,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) -- PS=":" -- FS="/" -- ;; -- Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/javax/security/auth/Subject/doAs/Test.sh 2011-11-17 22:05:06.000000000 -0800 -+++ ./jdk/test/javax/security/auth/Subject/doAs/Test.sh 2011-04-22 23:08:50.000000000 -0700 -@@ -33,12 +33,7 @@ +--- jdk/test/javax/security/auth/Subject/doAs/Test.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/javax/security/auth/Subject/doAs/Test.sh 2012-05-20 10:02:50.000000000 -0700 +@@ -33,17 +33,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in @@ -30236,12 +9268,17 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select - RM="/bin/rm -f" - ;; - Linux ) +- PS=":" +- FS="/" +- RM="/bin/rm -f" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" RM="/bin/rm -f" ---- ./jdk/test/jprt.config 2011-11-17 22:05:23.000000000 -0800 -+++ ./jdk/test/jprt.config 2011-04-22 23:08:51.000000000 -0700 +--- jdk/test/jprt.config 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/jprt.config 2011-04-22 23:08:51.000000000 -0700 @@ -71,8 +71,8 @@ # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. @@ -30309,20 +9346,20 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select # Export PATH setting PATH="${path4sdk}" ---- ./jdk/test/lib/security/java.policy/Ext_AllPolicy.sh 2011-11-17 22:05:23.000000000 -0800 -+++ ./jdk/test/lib/security/java.policy/Ext_AllPolicy.sh 2011-04-22 23:08:51.000000000 -0700 +--- jdk/test/lib/security/java.policy/Ext_AllPolicy.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/lib/security/java.policy/Ext_AllPolicy.sh 2012-05-17 16:18:01.000000000 -0700 @@ -50,7 +50,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh 2011-11-17 22:05:26.000000000 -0800 -+++ ./jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh 2011-04-22 23:08:51.000000000 -0700 -@@ -45,37 +45,50 @@ +--- jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh 2012-05-20 10:04:06.000000000 -0700 +@@ -45,37 +45,53 @@ # has to locate libjvm.so. Also $! is not reliable on some releases of MKS. #{ OS=`uname -s` @@ -30392,25 +9429,28 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select + i[3-6]86) + ARCH=i586 + ;; ++ x86_64) ++ ARCH=amd64 ++ ;; + esac + ;; +esac # ---- ./jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 2011-11-17 22:05:26.000000000 -0800 -+++ ./jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 2011-04-22 23:08:51.000000000 -0700 +--- jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 2012-05-17 16:18:01.000000000 -0700 @@ -35,7 +35,7 @@ UMASK=`umask` case $OS in --SunOS | Linux) +-SunOS | Linux | Darwin) +SunOS | Linux | *BSD | Darwin) PATHSEP=":" FILESEP="/" DFILESEP=$FILESEP ---- ./jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh 2011-11-17 22:05:26.000000000 -0800 -+++ ./jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh 2011-04-22 23:08:51.000000000 -0700 +--- jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh 2011-04-22 23:08:51.000000000 -0700 @@ -86,10 +86,12 @@ # on Windows 98. @@ -30428,8 +9468,8 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select JAVA=${TESTJAVA}/bin/java CLASSPATH=${TESTCLASSES} ---- ./jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh 2011-11-17 22:05:26.000000000 -0800 -+++ ./jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh 2011-04-22 23:08:51.000000000 -0700 +--- jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh 2011-04-22 23:08:51.000000000 -0700 @@ -70,10 +70,12 @@ # security the password file. @@ -30447,8 +9487,8 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select # Create configuration file and dummy password file ---- ./jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh 2011-11-17 22:05:27.000000000 -0800 -+++ ./jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh 2011-04-22 23:08:51.000000000 -0700 +--- jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh 2011-04-22 23:08:51.000000000 -0700 @@ -69,10 +69,12 @@ # security the password file. @@ -30466,245 +9506,93 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/java/nio/channels/spi/Select # Create management and SSL configuration files -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/management/jmxremote/bootstrap/bsd-i586/launcher and /tmp/bsd-port/jdk/test/sun/management/jmxremote/bootstrap/bsd-i586/launcher differ ---- ./jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh 2011-11-17 22:05:28.000000000 -0800 -+++ ./jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh 2011-04-22 23:08:52.000000000 -0700 -@@ -36,11 +36,7 @@ +--- jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -36,7 +36,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) -- PS=":" -- FS="/" -- ;; -- Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/net/www/MarkResetTest.sh 2011-11-17 22:05:30.000000000 -0800 -+++ ./jdk/test/sun/net/www/MarkResetTest.sh 2011-04-22 23:08:52.000000000 -0700 +--- jdk/test/sun/net/www/MarkResetTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/net/www/MarkResetTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -28,7 +28,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/net/www/http/HttpClient/RetryPost.sh 2011-11-17 22:05:31.000000000 -0800 -+++ ./jdk/test/sun/net/www/http/HttpClient/RetryPost.sh 2011-04-22 23:08:52.000000000 -0700 +--- jdk/test/sun/net/www/http/HttpClient/RetryPost.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/net/www/http/HttpClient/RetryPost.sh 2012-05-17 16:18:01.000000000 -0700 @@ -28,7 +28,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/net/www/protocol/jar/B5105410.sh 2011-11-17 22:05:32.000000000 -0800 -+++ ./jdk/test/sun/net/www/protocol/jar/B5105410.sh 2011-04-22 23:08:52.000000000 -0700 -@@ -31,11 +31,7 @@ +--- jdk/test/sun/net/www/protocol/jar/B5105410.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/net/www/protocol/jar/B5105410.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -31,7 +31,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) -- PS=":" -- FS="/" -- ;; -- Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/net/www/protocol/jar/jarbug/run.sh 2011-11-17 22:05:33.000000000 -0800 -+++ ./jdk/test/sun/net/www/protocol/jar/jarbug/run.sh 2011-04-22 23:08:52.000000000 -0700 -@@ -31,11 +31,7 @@ +--- jdk/test/sun/net/www/protocol/jar/jarbug/run.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/net/www/protocol/jar/jarbug/run.sh 2012-05-17 16:18:01.000000000 -0700 +@@ -31,7 +31,7 @@ OS=`uname -s` case "$OS" in -- SunOS ) -- PS=":" -- FS="/" -- ;; -- Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/nio/cs/EucJpBsd0212.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/test/sun/nio/cs/EucJpBsd0212.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,79 +0,0 @@ --/* -- * Copyright (c) 2008, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --/* -- * @test -- * @bug 6350021 -- * @summary Consistency checks when input buffer contains JISX0212 characters -- * @author Martin Buchholz -- */ -- --import java.io.*; --import java.util.*; --import java.nio.*; --import java.nio.charset.*; -- --public class EucJpBsd0212 { -- private static void equal(CharBuffer b1, CharBuffer b2) { -- equal(b1.position(), b2.position()); -- equal(b1.limit(), b2.limit()); -- System.out.printf("positions=%d %d%n", b1.position(), b2.position()); -- System.out.printf("limits=%d %d%n", b1.limit(), b2.limit()); -- for (int i = b1.position(); i < b1.limit(); i++) -- equal((int)b1.get(i), (int)b2.get(i)); -- } -- -- private static void realMain(String[] args) throws Throwable { -- List<ByteBuffer> bbs = Arrays.asList( -- ByteBuffer.allocate(10), -- ByteBuffer.allocateDirect(10)); -- List<CharBuffer> cbs = new ArrayList<CharBuffer>(); -- -- for (ByteBuffer bb : bbs) { -- bb.put(new byte[]{ (byte)0x8f, 0x01, 0x02, -- (byte)0xa1, (byte)0xc0, -- 0x02, 0x03}); -- bb.flip(); -- CharsetDecoder decoder = Charset.forName("EUC_JP_BSD").newDecoder(); -- decoder.onUnmappableCharacter(CodingErrorAction.REPLACE); -- CharBuffer cb = decoder.decode(bb); -- cbs.add(cb); -- } -- equal(cbs.get(0), cbs.get(1)); -- } -- -- //--------------------- Infrastructure --------------------------- -- static volatile int passed = 0, failed = 0; -- static void pass() {passed++;} -- static void fail() {failed++; Thread.dumpStack();} -- static void fail(String msg) {System.out.println(msg); fail();} -- static void unexpected(Throwable t) {failed++; t.printStackTrace();} -- static void check(boolean cond) {if (cond) pass(); else fail();} -- static void equal(Object x, Object y) { -- if (x == null ? y == null : x.equals(y)) pass(); -- else fail(x + " not equal to " + y);} -- public static void main(String[] args) throws Throwable { -- try {realMain(args);} catch (Throwable t) {unexpected(t);} -- System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); -- if (failed > 0) throw new AssertionError("Some tests failed");} --} ---- ./jdk/test/sun/nio/cs/EucJpBsdDecoderRecoveryTest.java 2012-03-04 16:33:49.000000000 -0800 -+++ ./jdk/test/sun/nio/cs/EucJpBsdDecoderRecoveryTest.java 1969-12-31 16:00:00.000000000 -0800 -@@ -1,70 +0,0 @@ --/* -- * Copyright (c) 2008, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -- * or visit www.oracle.com if you need additional information or have any -- * questions. -- */ -- --/* @test -- @bug 5016049 -- @summary ensure euc-jp-bsd charset decoder recovery for unmappable input -- */ -- --import java.io.*; -- --public class EucJpBsdDecoderRecoveryTest { -- public static void main(String[] args) throws Exception { -- byte[] encoded = { -- // EUC_JP_BSD mappable JIS X 0208 range -- (byte)0xa6, (byte)0xc5, -- // EUC_JP_BSD Unmappable (JIS X 0212 range) -- (byte)0x8f, (byte)0xa2, (byte)0xb7, -- // EUC_JP_BSD mappable JIS X 0208 range -- (byte)0xa6, (byte)0xc7 }; -- -- char[] decodedChars = new char[3]; -- char[] expectedChars = -- { -- '\u03B5', // mapped -- '\ufffd', // unmapped -- '\u03B7' // mapped -- }; -- -- ByteArrayInputStream bais = new ByteArrayInputStream(encoded); -- InputStreamReader isr = new InputStreamReader(bais, "EUC_JP_BSD"); -- int n = 0; // number of chars decoded -- -- try { -- n = isr.read(decodedChars); -- } catch (Exception ex) { -- throw new Error("euc-jp-bsd decoding broken"); -- } -- -- // check number of decoded chars is what is expected -- if (n != expectedChars.length) -- throw new Error("Unexpected number of chars decoded"); -- -- // Compare actual decoded with expected -- -- for (int i = 0; i < n; i++) { -- if (expectedChars[i] != decodedChars[i]) -- throw new Error("euc-jp-bsd decoding incorrect"); -- } -- } --} ---- ./jdk/test/sun/security/krb5/runNameEquals.sh 2011-11-17 22:05:44.000000000 -0800 -+++ ./jdk/test/sun/security/krb5/runNameEquals.sh 2011-04-22 23:08:53.000000000 -0700 -@@ -58,6 +58,11 @@ +--- jdk/test/sun/nio/ch/SelProvider.java 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/nio/ch/SelProvider.java 2012-05-19 20:59:15.000000000 -0700 +@@ -50,6 +50,8 @@ + } else { + throw new RuntimeException("Test does not recognize this operating system"); + } ++ } else if (osname.endsWith("BSD")) { ++ expected = "sun.nio.ch.PollSelectorProvider"; + } else if (osname.contains("OS X")) { + expected = "sun.nio.ch.PollSelectorProvider"; + } else +--- jdk/test/sun/security/krb5/runNameEquals.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/krb5/runNameEquals.sh 2012-05-19 20:58:43.000000000 -0700 +@@ -48,15 +48,11 @@ + # set platform-dependent variables + OS=`uname -s` + case "$OS" in +- SunOS | Linux ) ++ SunOS | Linux | Darwin | *BSD ) + PATHSEP=":" FILESEP="/" NATIVE=true ;; -+ Darwin | *BSD ) -+ PATHSEP=":" -+ FILESEP="/" -+ NATIVE=true -+ ;; +- Darwin ) +- PATHSEP=":" +- FILESEP="/" +- ;; CYGWIN* ) PATHSEP=";" FILESEP="/" ---- ./jdk/test/sun/security/pkcs11/KeyStore/Basic.sh 2011-11-17 22:05:45.000000000 -0800 -+++ ./jdk/test/sun/security/pkcs11/KeyStore/Basic.sh 2011-04-22 23:08:53.000000000 -0700 +--- jdk/test/sun/security/pkcs11/KeyStore/Basic.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/pkcs11/KeyStore/Basic.sh 2012-05-19 20:57:48.000000000 -0700 @@ -131,6 +131,27 @@ ;; esac @@ -30718,7 +9606,7 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/management/jmxremote/boo + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; -+ amd64* ) ++ amd64* | x86_64 ) + FS="/" + PS=":" + CP="${FS}bin${FS}cp" @@ -30733,9 +9621,9 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/management/jmxremote/boo Windows* ) FS="\\" PS=";" ---- ./jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh 2011-11-17 22:05:45.000000000 -0800 -+++ ./jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh 2011-04-22 23:08:53.000000000 -0700 -@@ -92,6 +92,27 @@ +--- jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh 2012-05-19 20:57:18.000000000 -0700 +@@ -93,6 +93,27 @@ ;; esac ;; @@ -30748,7 +9636,7 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/management/jmxremote/boo + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; -+ amd64* ) ++ amd64* | x86_64 ) + FS="/" + PS=":" + CP="${FS}bin${FS}cp" @@ -30763,9 +9651,9 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/management/jmxremote/boo Windows* ) FS="\\" PS=";" ---- ./jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh 2011-11-17 22:05:46.000000000 -0800 -+++ ./jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh 2011-04-22 23:08:53.000000000 -0700 -@@ -50,13 +50,7 @@ +--- jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh 2012-05-19 20:56:13.000000000 -0700 +@@ -50,19 +50,7 @@ OS=`uname -s` case "$OS" in @@ -30776,13 +9664,19 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/management/jmxremote/boo - CHMOD="${FS}bin${FS}chmod" - ;; - Linux ) +- FS="/" +- PS=":" +- CP="${FS}bin${FS}cp" +- CHMOD="${FS}bin${FS}chmod" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" PS=":" CP="${FS}bin${FS}cp" ---- ./jdk/test/sun/security/pkcs11/Provider/Login.sh 2011-11-17 22:05:46.000000000 -0800 -+++ ./jdk/test/sun/security/pkcs11/Provider/Login.sh 2011-04-22 23:08:53.000000000 -0700 -@@ -51,13 +51,7 @@ +--- jdk/test/sun/security/pkcs11/Provider/Login.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/pkcs11/Provider/Login.sh 2012-05-19 20:55:50.000000000 -0700 +@@ -51,19 +51,7 @@ OS=`uname -s` case "$OS" in @@ -30793,27 +9687,18 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/management/jmxremote/boo - CHMOD="${FS}bin${FS}chmod" - ;; - Linux ) +- FS="/" +- PS=":" +- CP="${FS}bin${FS}cp" +- CHMOD="${FS}bin${FS}chmod" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" PS=":" CP="${FS}bin${FS}cp" -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libfreebl3.chk and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libfreebl3.chk differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libfreebl3.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libfreebl3.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libnspr4.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libnspr4.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libnss3.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libnss3.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libnssckbi.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libnssckbi.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libplc4.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libplc4.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libplds4.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libplds4.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libsoftokn3.chk and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libsoftokn3.chk differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libsoftokn3.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-amd64/libsoftokn3.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libnspr4.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libnspr4.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libnss3.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libnss3.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libnssckbi.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libnssckbi.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libplc4.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libplc4.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libplds4.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libplds4.so differ -Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libsoftokn3.so and /tmp/bsd-port/jdk/test/sun/security/pkcs11/nss/lib/bsd-i586/libsoftokn3.so differ ---- ./jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh 2011-11-17 22:05:53.000000000 -0800 -+++ ./jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh 2011-04-22 23:08:53.000000000 -0700 +--- jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh 2011-04-22 23:08:53.000000000 -0700 @@ -44,11 +44,7 @@ # set platform-dependent variables OS=`uname -s` @@ -30827,9 +9712,9 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh 2011-11-17 22:05:54.000000000 -0800 -+++ ./jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh 2011-04-22 23:08:54.000000000 -0700 -@@ -47,11 +47,7 @@ +--- jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh 2012-05-19 20:54:54.000000000 -0700 +@@ -47,15 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in @@ -30838,101 +9723,116 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ - FS="/" - ;; - Linux ) +- PS=":" +- FS="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh 2011-11-17 22:05:57.000000000 -0800 -+++ ./jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh 2012-05-19 20:54:32.000000000 -0700 +@@ -33,7 +33,7 @@ + + OS=`uname -s` + case "$OS" in +- SunOS | Linux | Darwin ) ++ SunOS | Linux | *BSD | Darwin ) + PS=":" + FS="/" + ;; +--- jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -42,7 +42,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) FILESEP="/" - PATHSEP=":" - ;; ---- ./jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh 2011-11-17 22:05:59.000000000 -0800 -+++ ./jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh 2011-04-22 23:08:54.000000000 -0700 + PATHSEP=":" + ;; +--- jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh 2012-05-17 16:18:01.000000000 -0700 @@ -32,7 +32,7 @@ HOSTNAME=`uname -n` OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh 2011-11-17 22:05:59.000000000 -0800 -+++ ./jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh 2012-05-17 16:18:01.000000000 -0700 @@ -32,7 +32,7 @@ HOSTNAME=`uname -n` OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./jdk/test/sun/security/tools/jarsigner/AlgOptions.sh 2011-11-17 22:06:00.000000000 -0800 -+++ ./jdk/test/sun/security/tools/jarsigner/AlgOptions.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/jarsigner/AlgOptions.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/jarsigner/AlgOptions.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/jarsigner/PercentSign.sh 2011-11-17 22:06:00.000000000 -0800 -+++ ./jdk/test/sun/security/tools/jarsigner/PercentSign.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/jarsigner/PercentSign.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/jarsigner/PercentSign.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/jarsigner/diffend.sh 2011-11-17 22:06:00.000000000 -0800 -+++ ./jdk/test/sun/security/tools/jarsigner/diffend.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/jarsigner/diffend.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/jarsigner/diffend.sh 2012-05-17 16:18:01.000000000 -0700 @@ -41,7 +41,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) -+ SunOS | Linux | *BSD | Darwin) +- SunOS | Linux | Darwin ) ++ SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/jarsigner/oldsig.sh 2011-11-17 22:06:00.000000000 -0800 -+++ ./jdk/test/sun/security/tools/jarsigner/oldsig.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/jarsigner/oldsig.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/jarsigner/oldsig.sh 2012-05-17 16:18:01.000000000 -0700 @@ -42,7 +42,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/keytool/AltProviderPath.sh 2011-11-17 22:06:00.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/AltProviderPath.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/AltProviderPath.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/AltProviderPath.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/keytool/CloneKeyAskPassword.sh 2011-11-17 22:06:00.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/CloneKeyAskPassword.sh 2011-04-22 23:08:54.000000000 -0700 -@@ -47,11 +47,7 @@ +--- jdk/test/sun/security/tools/keytool/CloneKeyAskPassword.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/CloneKeyAskPassword.sh 2012-05-19 20:54:02.000000000 -0700 +@@ -47,15 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in @@ -30941,34 +9841,55 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ - FILESEP="/" - ;; - Linux ) +- PATHSEP=":" +- FILESEP="/" +- ;; +- Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" FILESEP="/" ;; ---- ./jdk/test/sun/security/tools/keytool/SecretKeyKS.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/SecretKeyKS.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/NoExtNPE.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/NoExtNPE.sh 2012-05-19 10:52:58.000000000 -0700 +@@ -42,13 +42,7 @@ + # set platform-dependent variables + OS=`uname -s` + case "$OS" in +- SunOS ) +- FILESEP="/" +- ;; +- Linux ) +- FILESEP="/" +- ;; +- Darwin ) ++ SunOS | Linux | *BSD | Darwin ) + FILESEP="/" + ;; + CYGWIN* ) +--- jdk/test/sun/security/tools/keytool/SecretKeyKS.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/SecretKeyKS.sh 2012-05-17 16:18:01.000000000 -0700 @@ -45,7 +45,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/keytool/StandardAlgName.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/StandardAlgName.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/StandardAlgName.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/StandardAlgName.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/keytool/autotest.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/autotest.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/autotest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/autotest.sh 2011-04-22 23:08:54.000000000 -0700 @@ -72,6 +72,27 @@ ;; esac @@ -30997,8 +9918,8 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ * ) echo "Will not run test on: ${OS}" exit 0; ---- ./jdk/test/sun/security/tools/keytool/i18n.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/i18n.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/i18n.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/i18n.sh 2011-04-22 23:08:54.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` @@ -31008,129 +9929,129 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/keytool/printssl.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/printssl.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/printssl.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/printssl.sh 2012-05-17 16:18:01.000000000 -0700 @@ -37,7 +37,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" ;; CYGWIN* ) ---- ./jdk/test/sun/security/tools/keytool/resource.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/resource.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/resource.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/resource.sh 2012-05-17 16:18:01.000000000 -0700 @@ -43,7 +43,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null FS="/" TMP=/tmp ---- ./jdk/test/sun/security/tools/keytool/standard.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/keytool/standard.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/keytool/standard.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/keytool/standard.sh 2012-05-17 16:18:01.000000000 -0700 @@ -44,7 +44,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows_* ) ---- ./jdk/test/sun/security/tools/policytool/Alias.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/policytool/Alias.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/policytool/Alias.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/policytool/Alias.sh 2012-05-17 16:18:01.000000000 -0700 @@ -47,7 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/policytool/ChangeUI.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/policytool/ChangeUI.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/policytool/ChangeUI.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/policytool/ChangeUI.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/policytool/OpenPolicy.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/policytool/OpenPolicy.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/policytool/OpenPolicy.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/policytool/OpenPolicy.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/policytool/SaveAs.sh 2011-11-17 22:06:01.000000000 -0800 -+++ ./jdk/test/sun/security/tools/policytool/SaveAs.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/policytool/SaveAs.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/policytool/SaveAs.sh 2012-05-17 16:18:01.000000000 -0700 @@ -47,7 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/policytool/UpdatePermissions.sh 2011-11-17 22:06:02.000000000 -0800 -+++ ./jdk/test/sun/security/tools/policytool/UpdatePermissions.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/policytool/UpdatePermissions.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/policytool/UpdatePermissions.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/policytool/UsePolicy.sh 2011-11-17 22:06:02.000000000 -0800 -+++ ./jdk/test/sun/security/tools/policytool/UsePolicy.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/policytool/UsePolicy.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/policytool/UsePolicy.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/security/tools/policytool/i18n.sh 2011-11-17 22:06:02.000000000 -0800 -+++ ./jdk/test/sun/security/tools/policytool/i18n.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/security/tools/policytool/i18n.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/security/tools/policytool/i18n.sh 2012-05-17 16:18:01.000000000 -0700 @@ -46,7 +46,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./jdk/test/sun/tools/jconsole/ImmutableResourceTest.sh 2011-11-17 22:06:03.000000000 -0800 -+++ ./jdk/test/sun/tools/jconsole/ImmutableResourceTest.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/tools/jconsole/ImmutableResourceTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/tools/jconsole/ImmutableResourceTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -53,7 +53,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" ;; ---- ./jdk/test/sun/tools/jconsole/ResourceCheckTest.sh 2011-11-17 22:06:03.000000000 -0800 -+++ ./jdk/test/sun/tools/jconsole/ResourceCheckTest.sh 2011-04-22 23:08:54.000000000 -0700 +--- jdk/test/sun/tools/jconsole/ResourceCheckTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/tools/jconsole/ResourceCheckTest.sh 2011-04-22 23:08:54.000000000 -0700 @@ -54,7 +54,7 @@ OS=`uname -s` @@ -31140,8 +10061,8 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ PATHSEP=":" ;; ---- ./jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh 2011-11-17 22:06:06.000000000 -0800 -+++ ./jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh 2011-04-22 23:08:55.000000000 -0700 +--- jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh 2011-04-22 23:08:55.000000000 -0700 @@ -33,7 +33,7 @@ case `uname -s` in @@ -31151,63 +10072,33 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ esac N2A=$TESTJAVA/bin/native2ascii ---- ./jdk/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh 2011-11-17 22:06:06.000000000 -0800 -+++ ./jdk/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh 2011-04-22 23:08:55.000000000 -0700 +--- jdk/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh 2012-05-26 23:29:12.000000000 -0700 ++++ jdk/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh 2012-05-17 16:18:01.000000000 -0700 @@ -56,7 +56,7 @@ OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PATHSEP=":" ;; ---- ./langtools/.hgtags 2011-11-17 22:08:21.000000000 -0800 -+++ ./langtools/.hgtags 2012-02-26 15:37:57.000000000 -0800 -@@ -139,3 +139,5 @@ - ee94565d9f57ee9885e3af44891877163b637cc3 jdk7u1-b08 - d37897312d318c18b0a855ce80f70c410865d105 jdk7u2-b11 - f0802d8a0909f66ce19d3d44b33ddf4943aee076 jdk7u2-b12 -+f474527e77e4797d78bd6c3b31923fddcfd9d5c6 jdk7u2-b13 -+fc0769df8cd03fffc38c7a1ab6b2e2e7cc2506a8 jdk7u2-b21 ---- ./langtools/make/build.xml 2011-11-17 22:08:21.000000000 -0800 -+++ ./langtools/make/build.xml 2011-07-15 21:28:16.000000000 -0700 -@@ -169,10 +169,10 @@ - in the build-bootstrap-classes macro. --> - - <available property="import.jdk.src.dir" value="${import.jdk}/src/share/classes" -- filepath="${import.jdk}/src/share/classes" file="java/nio/file/Path.java"/> -+ filepath="${import.jdk}/src/share/classes" file="java/nio/file/StandardWatchEventKinds.java"/> - <available property="import.jdk.jar" value="${import.jdk}/jre/lib/rt.jar" - ignoresystemclasses="true" -- classpath="${import.jdk}/jre/lib/rt.jar" classname="java.nio.file.Path"/> -+ classpath="${import.jdk}/jre/lib/rt.jar" classname="java.nio.file.StandardWatchEventKinds"/> - - <!-- Set the default bootclasspath option used for javac. - Note that different variants of the option are used, meaning we can't just -@@ -188,7 +188,7 @@ - <condition property="boot.java.provides.latest.jdk"> - <available - ignoresystemclasses="true" -- classpath="${boot.java.home}/jre/lib/rt.jar" classname="java.nio.file.Path"/> -+ classpath="${boot.java.home}/jre/lib/rt.jar" classname="java.nio.file.StandardWatchEventKinds"/> - </condition> - - <condition property="bootstrap.exclude.files" value="" else="${require.latest.jdk.files}"> ---- ./langtools/test/Makefile 2011-11-17 22:08:32.000000000 -0800 -+++ ./langtools/test/Makefile 2011-04-22 23:11:42.000000000 -0700 -@@ -34,6 +34,22 @@ +--- langtools/.hgtags 2012-05-26 23:29:10.000000000 -0700 ++++ langtools/.hgtags 2012-05-16 16:10:26.000000000 -0700 +@@ -123,6 +123,7 @@ + 9425dd4f53d5bfcd992d9aecea0eb7d8b2d4f62b jdk7-b146 + d34578643d1c6c752d4a6b5e79c6ab1b60850b4a jdk7u1-b01 + 58bc532d63418ac3c9b42460d89cdaf595c6f3e1 jdk7-b147 ++23aadf169f085b180803bcdc53baad4ae870f75b 7u0 + cd2cc8b5edb045b950aed46d159b4fb8fc2fd1df jdk7u1-b02 + 82820a30201dbf4b80f1916f3d0f4a92ad21b61a jdk7u1-b03 + baa2c13c70fea3d6e259a34f0903197fdceb64b5 jdk7u1-b04 +--- langtools/test/Makefile 2012-05-26 23:29:10.000000000 -0700 ++++ langtools/test/Makefile 2012-05-16 16:17:05.000000000 -0700 +@@ -42,6 +42,14 @@ ARCH=i586 endif endif -+ifeq ($(OSNAME), Darwin) -+ PLATFORM = bsd -+ JT_PLATFORM = linux -+ ARCH = $(shell uname -m) -+ ifeq ($(ARCH), i386) -+ ARCH=i586 -+ endif -+endif +ifeq ($(findstring BSD,$(OSNAME)), BSD) + PLATFORM = bsd + JT_PLATFORM = linux @@ -31219,7 +10110,7 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ ifeq ($(OSNAME), Windows_NT) PLATFORM = windows JT_PLATFORM = win32 -@@ -93,7 +109,7 @@ +@@ -101,7 +109,7 @@ ifdef JPRT_JAVA_HOME JT_JAVA = $(JPRT_JAVA_HOME) else @@ -31228,7 +10119,7 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ endif # Default JDK to test -@@ -188,7 +204,9 @@ +@@ -196,7 +204,9 @@ # The test directories to run DEFAULT_TESTDIRS = . @@ -31239,247 +10130,178 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ # Root of all test results TEST_OUTPUT_DIR = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools ---- ./langtools/test/jprt.config 2011-11-17 22:08:39.000000000 -0800 -+++ ./langtools/test/jprt.config 2011-04-22 23:11:43.000000000 -0700 -@@ -71,8 +71,8 @@ - - # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. - osname=`uname -s` --if [ "${osname}" = SunOS ] ; then -- -+case "${osname}" in -+ SunOS) - # SOLARIS: Sparc or X86 - osarch=`uname -p` - if [ "${osarch}" = sparc ] ; then -@@ -96,9 +96,9 @@ - - # File creation mask - umask 002 -+ ;; - --elif [ "${osname}" = Linux ] ; then -- -+ Linux | Darwin ) - # Add basic paths - path4sdk=/usr/bin:/bin:/usr/sbin:/sbin - -@@ -107,9 +107,31 @@ - fileMustExist "${make}" make - - umask 002 -+ ;; -+ -+ FreeBSD | OpenBSD ) -+ # Add basic paths -+ path4sdk=/usr/bin:/bin:/usr/sbin:/sbin -+ -+ # Find GNU make -+ make=/usr/local/bin/gmake -+ fileMustExist "${make}" make -+ -+ umask 002 -+ ;; - --else -+ NetBSD ) -+ # Add basic paths -+ path4sdk=/usr/bin:/bin:/usr/sbin:/sbin - -+ # Find GNU make -+ make=/usr/pkg/bin/gmake -+ fileMustExist "${make}" make -+ -+ umask 002 -+ ;; -+ -+ *) - # Windows: Differs on CYGWIN vs. MKS. - - # We need to determine if we are running a CYGWIN shell or an MKS shell -@@ -150,8 +172,8 @@ - if [ "${unix_toolset}" = CYGWIN ] ; then - path4sdk="`/usr/bin/cygpath -p ${path4sdk}`" - fi -- --fi -+ ;; -+esac - - # Export PATH setting - PATH="${path4sdk}" ---- ./langtools/test/tools/javac/4846262/Test.sh 2011-11-17 22:08:41.000000000 -0800 -+++ ./langtools/test/tools/javac/4846262/Test.sh 2011-04-22 23:11:44.000000000 -0700 +--- langtools/test/tools/javac/4846262/Test.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/4846262/Test.sh 2012-05-16 16:17:18.000000000 -0700 @@ -44,7 +44,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" ;; CYGWIN* ) ---- ./langtools/test/tools/javac/6302184/T6302184.sh 2011-11-17 22:08:42.000000000 -0800 -+++ ./langtools/test/tools/javac/6302184/T6302184.sh 2011-04-22 23:11:44.000000000 -0700 +--- langtools/test/tools/javac/6302184/T6302184.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/6302184/T6302184.sh 2012-05-16 16:17:29.000000000 -0700 @@ -41,7 +41,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" ;; CYGWIN* ) ---- ./langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh 2011-11-17 22:08:45.000000000 -0800 -+++ ./langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh 2011-04-22 23:11:44.000000000 -0700 +--- langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh 2012-05-16 16:17:54.000000000 -0700 @@ -56,7 +56,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows* ) ---- ./langtools/test/tools/javac/ExtDirs/ExtDirs.sh 2011-11-17 22:08:47.000000000 -0800 -+++ ./langtools/test/tools/javac/ExtDirs/ExtDirs.sh 2011-04-22 23:11:44.000000000 -0700 +--- langtools/test/tools/javac/ExtDirs/ExtDirs.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/ExtDirs/ExtDirs.sh 2012-05-16 16:18:08.000000000 -0700 @@ -54,7 +54,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./langtools/test/tools/javac/MissingInclude.sh 2011-11-17 22:08:48.000000000 -0800 -+++ ./langtools/test/tools/javac/MissingInclude.sh 2011-04-22 23:11:45.000000000 -0700 +--- langtools/test/tools/javac/MissingInclude.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/MissingInclude.sh 2012-05-16 16:18:28.000000000 -0700 @@ -47,7 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows* ) ---- ./langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh 2011-11-17 22:08:49.000000000 -0800 -+++ ./langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh 2011-04-22 23:11:45.000000000 -0700 +--- langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh 2012-05-16 16:18:38.000000000 -0700 @@ -52,7 +52,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./langtools/test/tools/javac/T5090006/compiler.sh 2011-11-17 22:08:51.000000000 -0800 -+++ ./langtools/test/tools/javac/T5090006/compiler.sh 2011-04-22 23:11:45.000000000 -0700 +--- langtools/test/tools/javac/T5090006/compiler.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/T5090006/compiler.sh 2012-05-16 16:33:41.000000000 -0700 @@ -47,7 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows* ) ---- ./langtools/test/tools/javac/apt.sh 2011-11-17 22:08:55.000000000 -0800 -+++ ./langtools/test/tools/javac/apt.sh 2011-04-22 23:11:45.000000000 -0700 +--- langtools/test/tools/javac/apt.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/apt.sh 2012-05-16 16:33:47.000000000 -0700 @@ -38,7 +38,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./langtools/test/tools/javac/constDebug/ConstDebug.sh 2011-11-17 22:08:56.000000000 -0800 -+++ ./langtools/test/tools/javac/constDebug/ConstDebug.sh 2011-04-22 23:11:46.000000000 -0700 +--- langtools/test/tools/javac/constDebug/ConstDebug.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/constDebug/ConstDebug.sh 2012-05-16 16:33:56.000000000 -0700 @@ -47,7 +47,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./langtools/test/tools/javac/fatalErrors/NoJavaLang.sh 2011-11-17 22:09:03.000000000 -0800 -+++ ./langtools/test/tools/javac/fatalErrors/NoJavaLang.sh 2011-04-22 23:11:46.000000000 -0700 +--- langtools/test/tools/javac/fatalErrors/NoJavaLang.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/fatalErrors/NoJavaLang.sh 2012-05-16 16:34:05.000000000 -0700 @@ -48,7 +48,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" ;; CYGWIN* ) ---- ./langtools/test/tools/javac/innerClassFile/Driver.sh 2011-11-17 22:09:12.000000000 -0800 -+++ ./langtools/test/tools/javac/innerClassFile/Driver.sh 2011-04-22 23:11:47.000000000 -0700 +--- langtools/test/tools/javac/innerClassFile/Driver.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/innerClassFile/Driver.sh 2012-05-16 16:34:21.000000000 -0700 @@ -53,7 +53,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows* ) ---- ./langtools/test/tools/javac/javazip/Test.sh 2011-11-17 22:09:12.000000000 -0800 -+++ ./langtools/test/tools/javac/javazip/Test.sh 2011-04-22 23:11:47.000000000 -0700 +--- langtools/test/tools/javac/javazip/Test.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/javazip/Test.sh 2012-05-16 16:34:29.000000000 -0700 @@ -41,7 +41,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) FS="/" SCR=`pwd` ;; ---- ./langtools/test/tools/javac/links/links.sh 2011-11-17 22:09:12.000000000 -0800 -+++ ./langtools/test/tools/javac/links/links.sh 2011-04-22 23:11:47.000000000 -0700 +--- langtools/test/tools/javac/links/links.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/links/links.sh 2012-05-16 16:34:36.000000000 -0700 @@ -53,7 +53,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) NULL=/dev/null PS=":" FS="/" ---- ./langtools/test/tools/javac/newlines/Newlines.sh 2011-11-17 22:09:14.000000000 -0800 -+++ ./langtools/test/tools/javac/newlines/Newlines.sh 2011-04-22 23:11:48.000000000 -0700 +--- langtools/test/tools/javac/newlines/Newlines.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/newlines/Newlines.sh 2012-05-16 16:34:54.000000000 -0700 @@ -50,7 +50,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows* ) ---- ./langtools/test/tools/javac/stackmap/T4955930.sh 2011-11-17 22:09:17.000000000 -0800 -+++ ./langtools/test/tools/javac/stackmap/T4955930.sh 2011-04-22 23:11:48.000000000 -0700 +--- langtools/test/tools/javac/stackmap/T4955930.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/stackmap/T4955930.sh 2012-05-16 16:35:11.000000000 -0700 @@ -41,7 +41,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows_95 | Windows_98 | Windows_NT ) ---- ./langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh 2011-11-17 22:09:18.000000000 -0800 -+++ ./langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh 2011-04-22 23:11:48.000000000 -0700 +--- langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh 2012-05-19 10:56:30.000000000 -0700 @@ -66,6 +66,17 @@ exit 0; fi ;; -+ *BSD | Darwin ) ++ *BSD ) + if [ -d /usr/share/locale/en_US.UTF-8 -o -d /usr/share/locale/en_US.utf8 ] + then + ENV="env LANG=en_US.UTF-8" @@ -31493,69 +10315,58 @@ Files /tmp/openjdk_srcdir.D3vYK7Iv/openjdk/jdk/test/sun/security/pkcs11/nss/lib/ Windows_98 | Windows_ME ) echo "As Windows 98/Me do not provide Unicode-aware file system, the compilation of the test case is expected to fail on these platforms. Ignoring this test." exit 0; ---- ./langtools/test/tools/javah/6257087/foo.sh 2011-11-17 22:09:21.000000000 -0800 -+++ ./langtools/test/tools/javah/6257087/foo.sh 2011-04-22 23:11:49.000000000 -0700 +--- langtools/test/tools/javah/6257087/foo.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javah/6257087/foo.sh 2012-05-16 16:35:18.000000000 -0700 @@ -41,7 +41,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./langtools/test/tools/javah/ConstMacroTest.sh 2011-11-17 22:09:21.000000000 -0800 -+++ ./langtools/test/tools/javah/ConstMacroTest.sh 2011-04-22 23:11:49.000000000 -0700 +--- langtools/test/tools/javah/ConstMacroTest.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javah/ConstMacroTest.sh 2012-05-16 16:35:25.000000000 -0700 @@ -56,7 +56,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux ) +- SunOS | Linux | Darwin ) + SunOS | Linux | *BSD | Darwin ) PS=":" FS="/" ;; ---- ./langtools/test/tools/javah/MissingParamClassTest.sh 2011-11-17 22:09:21.000000000 -0800 -+++ ./langtools/test/tools/javah/MissingParamClassTest.sh 2011-04-22 23:11:49.000000000 -0700 +--- langtools/test/tools/javah/MissingParamClassTest.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javah/MissingParamClassTest.sh 2012-05-16 16:35:40.000000000 -0700 @@ -58,7 +58,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) PS=":" FS="/" ;; ---- ./langtools/test/tools/javah/ReadOldClass.sh 2011-11-17 22:09:21.000000000 -0800 -+++ ./langtools/test/tools/javah/ReadOldClass.sh 2011-04-22 23:11:49.000000000 -0700 +--- langtools/test/tools/javah/ReadOldClass.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javah/ReadOldClass.sh 2012-05-16 16:35:57.000000000 -0700 @@ -43,7 +43,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) PS=":" FS="/" ;; ---- ./langtools/test/tools/javap/pathsep.sh 2011-11-17 22:09:22.000000000 -0800 -+++ ./langtools/test/tools/javap/pathsep.sh 2011-04-22 23:11:49.000000000 -0700 +--- langtools/test/tools/javap/pathsep.sh 2012-05-26 23:29:11.000000000 -0700 ++++ langtools/test/tools/javap/pathsep.sh 2012-05-16 16:36:14.000000000 -0700 @@ -40,7 +40,7 @@ # set platform-dependent variables OS=`uname -s` case "$OS" in -- SunOS | Linux | CYGWIN* ) -+ SunOS | Linux | CYGWIN* | *BSD | Darwin ) +- SunOS | Linux | Darwin | CYGWIN* ) ++ SunOS | Linux | *BSD | Darwin | CYGWIN* ) FS="/" ;; Windows* ) ---- ./make/Defs-internal.gmk 2011-11-17 21:30:05.000000000 -0800 -+++ ./make/Defs-internal.gmk 2012-02-26 13:57:18.000000000 -0800 -@@ -79,7 +79,7 @@ - # Find all build_time_* files and print their contents in a list sorted - # on the name of the sub repository. - define ReportBuildTimes --$(PRINTF) "-- Build times ----------\nTarget %s\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \ -+$(PRINTF) "## Build times ##########\nTarget %s\nStart %s\nEnd %s\n%s\n%s\n#########################\n" \ - $1 \ - "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \ - "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \ diff --git a/java/openjdk7/files/patch-u3 b/java/openjdk7/files/patch-u3 deleted file mode 100644 index b44fa61ee87b..000000000000 --- a/java/openjdk7/files/patch-u3 +++ /dev/null @@ -1,4326 +0,0 @@ -diff -uNr -x '.hg*' jdk7u2/corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyFactoryImpl.java jdk7u3/corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyFactoryImpl.java ---- corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyFactoryImpl.java 2012-04-17 17:40:35.000000000 -0400 -+++ corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyFactoryImpl.java 2012-04-17 17:50:37.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. 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 -@@ -82,6 +82,6 @@ - private String[] __ids = { "IDL:omg.org/DynamicAny/DynAnyFactory:1.0" }; - - public String[] _ids() { -- return __ids; -+ return (String[])__ids.clone(); - } - } -diff -uNr -x '.hg*' jdk7u2/corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyImpl.java jdk7u3/corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyImpl.java ---- corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyImpl.java 2012-04-17 17:40:35.000000000 -0400 -+++ corba/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyImpl.java 2012-04-17 17:50:37.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. 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 -@@ -195,6 +195,6 @@ - private String[] __ids = { "IDL:omg.org/DynamicAny/DynAny:1.0" }; - - public String[] _ids() { -- return __ids; -+ return (String[])__ids.clone(); - } - } -diff -uNr -x '.hg*' jdk7u2/corba/src/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java jdk7u3/corba/src/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java ---- corba/src/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java 2012-04-17 17:40:36.000000000 -0400 -+++ corba/src/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java 2012-04-17 17:50:39.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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 -@@ -138,7 +138,7 @@ - - public String[] _ids () - { -- return __ids; -+ return (String[])__ids.clone(); - } - - -diff -uNr -x '.hg*' jdk7u2/hotspot/make/hotspot_version jdk7u3/hotspot/make/hotspot_version ---- hotspot/make/hotspot_version 2012-04-17 17:34:59.000000000 -0400 -+++ hotspot/make/hotspot_version 2012-04-17 17:50:17.000000000 -0400 -@@ -34,12 +34,12 @@ - HOTSPOT_VM_COPYRIGHT=Copyright 2011 - - HS_MAJOR_VER=22 --HS_MINOR_VER=0 --HS_BUILD_NUMBER=10 -+HS_MINOR_VER=1 -+HS_BUILD_NUMBER=02 - - JDK_MAJOR_VER=1 --JDK_MINOR_VER=8 -+JDK_MINOR_VER=7 - JDK_MICRO_VER=0 - - # Previous (bootdir) JDK version --JDK_PREVIOUS_VERSION=1.7.0 -+JDK_PREVIOUS_VERSION=1.6.0 -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java jdk7u3/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java ---- jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java 2012-04-17 17:39:04.000000000 -0400 -+++ jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java 2012-04-17 17:48:41.000000000 -0400 -@@ -736,7 +736,7 @@ - if (off < 0) { - throw new ArrayIndexOutOfBoundsException(off); - } -- if (off + len > b.length) { -+ if ((long)off + (long)len > (long)b.length) { - throw new ArrayIndexOutOfBoundsException(b.length); - } - -@@ -964,7 +964,7 @@ - if (off < 0) { - throw new ArrayIndexOutOfBoundsException(off); - } -- if (off + len > b.length) { -+ if ((long)off + (long)len > (long)b.length) { - throw new ArrayIndexOutOfBoundsException(b.length); - } - if (!isActive() && doIO) { -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java jdk7u3/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java ---- jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java 2012-04-17 17:39:04.000000000 -0400 -+++ jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java 2012-04-17 17:48:41.000000000 -0400 -@@ -130,6 +130,12 @@ - if (len % framesize != 0) - throw new IllegalArgumentException( - "Number of bytes does not represent an integral number of sample frames."); -+ if (off < 0) { -+ throw new ArrayIndexOutOfBoundsException(off); -+ } -+ if ((long)off + (long)len > (long)b.length) { -+ throw new ArrayIndexOutOfBoundsException(b.length); -+ } - - byte[] buff = cycling_buffer; - int buff_len = cycling_buffer.length; -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/java/awt/KeyboardFocusManager.java jdk7u3/jdk/src/share/classes/java/awt/KeyboardFocusManager.java ---- jdk/src/share/classes/java/awt/KeyboardFocusManager.java 2012-04-17 17:39:07.000000000 -0400 -+++ jdk/src/share/classes/java/awt/KeyboardFocusManager.java 2012-04-17 17:48:43.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. 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 -@@ -503,14 +503,8 @@ - */ - protected Component getGlobalFocusOwner() throws SecurityException { - synchronized (KeyboardFocusManager.class) { -- if (this == getCurrentKeyboardFocusManager()) { -- return focusOwner; -- } else { -- if (focusLog.isLoggable(PlatformLogger.FINER)) { -- focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); -- } -- throw new SecurityException(notPrivileged); -- } -+ checkCurrentKFMSecurity(); -+ return focusOwner; - } - } - -@@ -544,6 +538,8 @@ - - if (focusOwner == null || focusOwner.isFocusable()) { - synchronized (KeyboardFocusManager.class) { -+ checkCurrentKFMSecurity(); -+ - oldFocusOwner = getFocusOwner(); - - try { -@@ -593,6 +589,9 @@ - * @see java.awt.event.FocusEvent#FOCUS_LOST - */ - public void clearGlobalFocusOwner() { -+ synchronized (KeyboardFocusManager.class) { -+ checkCurrentKFMSecurity(); -+ } - if (!GraphicsEnvironment.isHeadless()) { - // Toolkit must be fully initialized, otherwise - // _clearGlobalFocusOwner will crash or throw an exception -@@ -672,14 +671,8 @@ - throws SecurityException - { - synchronized (KeyboardFocusManager.class) { -- if (this == getCurrentKeyboardFocusManager()) { -- return permanentFocusOwner; -- } else { -- if (focusLog.isLoggable(PlatformLogger.FINER)) { -- focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); -- } -- throw new SecurityException(notPrivileged); -- } -+ checkCurrentKFMSecurity(); -+ return permanentFocusOwner; - } - } - -@@ -708,13 +701,14 @@ - * @beaninfo - * bound: true - */ -- protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner) -- { -+ protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner) { - Component oldPermanentFocusOwner = null; - boolean shouldFire = false; - - if (permanentFocusOwner == null || permanentFocusOwner.isFocusable()) { - synchronized (KeyboardFocusManager.class) { -+ checkCurrentKFMSecurity(); -+ - oldPermanentFocusOwner = getPermanentFocusOwner(); - - try { -@@ -780,14 +774,8 @@ - */ - protected Window getGlobalFocusedWindow() throws SecurityException { - synchronized (KeyboardFocusManager.class) { -- if (this == getCurrentKeyboardFocusManager()) { -- return focusedWindow; -- } else { -- if (focusLog.isLoggable(PlatformLogger.FINER)) { -- focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); -- } -- throw new SecurityException(notPrivileged); -- } -+ checkCurrentKFMSecurity(); -+ return focusedWindow; - } - } - -@@ -818,6 +806,8 @@ - - if (focusedWindow == null || focusedWindow.isFocusableWindow()) { - synchronized (KeyboardFocusManager.class) { -+ checkCurrentKFMSecurity(); -+ - oldFocusedWindow = getFocusedWindow(); - - try { -@@ -884,14 +874,8 @@ - */ - protected Window getGlobalActiveWindow() throws SecurityException { - synchronized (KeyboardFocusManager.class) { -- if (this == getCurrentKeyboardFocusManager()) { -- return activeWindow; -- } else { -- if (focusLog.isLoggable(PlatformLogger.FINER)) { -- focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); -- } -- throw new SecurityException(notPrivileged); -- } -+ checkCurrentKFMSecurity(); -+ return activeWindow; - } - } - -@@ -920,6 +904,8 @@ - protected void setGlobalActiveWindow(Window activeWindow) { - Window oldActiveWindow; - synchronized (KeyboardFocusManager.class) { -+ checkCurrentKFMSecurity(); -+ - oldActiveWindow = getActiveWindow(); - if (focusLog.isLoggable(PlatformLogger.FINER)) { - focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow); -@@ -1214,14 +1200,8 @@ - throws SecurityException - { - synchronized (KeyboardFocusManager.class) { -- if (this == getCurrentKeyboardFocusManager()) { -- return currentFocusCycleRoot; -- } else { -- if (focusLog.isLoggable(PlatformLogger.FINER)) { -- focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); -- } -- throw new SecurityException(notPrivileged); -- } -+ checkCurrentKFMSecurity(); -+ return currentFocusCycleRoot; - } - } - -@@ -1245,6 +1225,8 @@ - Container oldFocusCycleRoot; - - synchronized (KeyboardFocusManager.class) { -+ checkCurrentKFMSecurity(); -+ - oldFocusCycleRoot = getCurrentFocusCycleRoot(); - currentFocusCycleRoot = newFocusCycleRoot; - } -@@ -3062,4 +3044,14 @@ - : null; - } - } -+ -+ private void checkCurrentKFMSecurity() { -+ if (this != getCurrentKeyboardFocusManager()) { -+ if (focusLog.isLoggable(PlatformLogger.FINER)) { -+ focusLog.finer("This manager is " + this + -+ ", current is " + getCurrentKeyboardFocusManager()); -+ } -+ throw new SecurityException(notPrivileged); -+ } -+ } - } -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/java/io/ObjectStreamClass.java jdk7u3/jdk/src/share/classes/java/io/ObjectStreamClass.java ---- jdk/src/share/classes/java/io/ObjectStreamClass.java 2012-04-17 17:39:08.000000000 -0400 -+++ jdk/src/share/classes/java/io/ObjectStreamClass.java 2012-04-17 17:48:44.000000000 -0400 -@@ -123,14 +123,39 @@ - */ - private boolean hasBlockExternalData = true; - -+ /** -+ * Contains information about InvalidClassException instances to be thrown -+ * when attempting operations on an invalid class. Note that instances of -+ * this class are immutable and are potentially shared among -+ * ObjectStreamClass instances. -+ */ -+ private static class ExceptionInfo { -+ private final String className; -+ private final String message; -+ -+ ExceptionInfo(String cn, String msg) { -+ className = cn; -+ message = msg; -+ } -+ -+ /** -+ * Returns (does not throw) an InvalidClassException instance created -+ * from the information in this object, suitable for being thrown by -+ * the caller. -+ */ -+ InvalidClassException newInvalidClassException() { -+ return new InvalidClassException(className, message); -+ } -+ } -+ - /** exception (if any) thrown while attempting to resolve class */ - private ClassNotFoundException resolveEx; - /** exception (if any) to throw if non-enum deserialization attempted */ -- private InvalidClassException deserializeEx; -+ private ExceptionInfo deserializeEx; - /** exception (if any) to throw if non-enum serialization attempted */ -- private InvalidClassException serializeEx; -+ private ExceptionInfo serializeEx; - /** exception (if any) to throw if default serialization attempted */ -- private InvalidClassException defaultSerializeEx; -+ private ExceptionInfo defaultSerializeEx; - - /** serializable fields */ - private ObjectStreamField[] fields; -@@ -444,7 +469,8 @@ - fields = getSerialFields(cl); - computeFieldOffsets(); - } catch (InvalidClassException e) { -- serializeEx = deserializeEx = e; -+ serializeEx = deserializeEx = -+ new ExceptionInfo(e.classname, e.getMessage()); - fields = NO_FIELDS; - } - -@@ -483,15 +509,14 @@ - - if (deserializeEx == null) { - if (isEnum) { -- deserializeEx = new InvalidClassException(name, "enum type"); -+ deserializeEx = new ExceptionInfo(name, "enum type"); - } else if (cons == null) { -- deserializeEx = new InvalidClassException( -- name, "no valid constructor"); -+ deserializeEx = new ExceptionInfo(name, "no valid constructor"); - } - } - for (int i = 0; i < fields.length; i++) { - if (fields[i].getField() == null) { -- defaultSerializeEx = new InvalidClassException( -+ defaultSerializeEx = new ExceptionInfo( - name, "unmatched serializable field(s) declared"); - } - } -@@ -601,8 +626,8 @@ - (externalizable != localDesc.externalizable) || - !(serializable || externalizable)) - { -- deserializeEx = new InvalidClassException(localDesc.name, -- "class invalid for deserialization"); -+ deserializeEx = new ExceptionInfo( -+ localDesc.name, "class invalid for deserialization"); - } - } - -@@ -727,11 +752,7 @@ - */ - void checkDeserialize() throws InvalidClassException { - if (deserializeEx != null) { -- InvalidClassException ice = -- new InvalidClassException(deserializeEx.classname, -- deserializeEx.getMessage()); -- ice.initCause(deserializeEx); -- throw ice; -+ throw deserializeEx.newInvalidClassException(); - } - } - -@@ -742,11 +763,7 @@ - */ - void checkSerialize() throws InvalidClassException { - if (serializeEx != null) { -- InvalidClassException ice = -- new InvalidClassException(serializeEx.classname, -- serializeEx.getMessage()); -- ice.initCause(serializeEx); -- throw ice; -+ throw serializeEx.newInvalidClassException(); - } - } - -@@ -759,11 +776,7 @@ - */ - void checkDefaultSerialize() throws InvalidClassException { - if (defaultSerializeEx != null) { -- InvalidClassException ice = -- new InvalidClassException(defaultSerializeEx.classname, -- defaultSerializeEx.getMessage()); -- ice.initCause(defaultSerializeEx); -- throw ice; -+ throw defaultSerializeEx.newInvalidClassException(); - } - } - -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/java/util/TimeZone.java jdk7u3/jdk/src/share/classes/java/util/TimeZone.java ---- jdk/src/share/classes/java/util/TimeZone.java 2012-04-17 17:39:10.000000000 -0400 -+++ jdk/src/share/classes/java/util/TimeZone.java 2012-04-17 17:48:47.000000000 -0400 -@@ -43,6 +43,7 @@ - import java.security.AccessController; - import java.security.PrivilegedAction; - import java.util.concurrent.ConcurrentHashMap; -+import sun.awt.AppContext; - import sun.security.action.GetPropertyAction; - import sun.util.TimeZoneNameUtility; - import sun.util.calendar.ZoneInfo; -@@ -615,7 +616,7 @@ - * method doesn't create a clone. - */ - static TimeZone getDefaultRef() { -- TimeZone defaultZone = defaultZoneTL.get(); -+ TimeZone defaultZone = getDefaultInAppContext(); - if (defaultZone == null) { - defaultZone = defaultTimeZone; - if (defaultZone == null) { -@@ -706,10 +707,49 @@ - if (hasPermission()) { - synchronized (TimeZone.class) { - defaultTimeZone = zone; -- defaultZoneTL.set(null); -+ setDefaultInAppContext(null); - } - } else { -- defaultZoneTL.set(zone); -+ setDefaultInAppContext(zone); -+ } -+ } -+ -+ /** -+ * Returns the default TimeZone in an AppContext if any AppContext -+ * has ever used. null is returned if any AppContext hasn't been -+ * used or if the AppContext doesn't have the default TimeZone. -+ */ -+ private synchronized static TimeZone getDefaultInAppContext() { -+ if (!hasSetInAppContext) { -+ return null; -+ } -+ -+ AppContext ac = AppContext.getAppContext(); -+ if (ac != null && !ac.isDisposed()) { -+ return (TimeZone) ac.get(TimeZone.class); -+ } -+ return null; -+ } -+ -+ /** -+ * Sets the default TimeZone in the AppContext to the given -+ * tz. null is handled special: do nothing if any AppContext -+ * hasn't been used, remove the default TimeZone in the -+ * AppContext otherwise. -+ */ -+ private synchronized static void setDefaultInAppContext(TimeZone tz) { -+ if (!hasSetInAppContext && tz == null) { -+ return; -+ } -+ -+ AppContext ac = AppContext.getAppContext(); -+ if (ac != null && !ac.isDisposed()) { -+ if (tz != null) { -+ ac.put(TimeZone.class, tz); -+ hasSetInAppContext = true; -+ } else { -+ ac.remove(TimeZone.class); -+ } - } - } - -@@ -760,12 +800,13 @@ - */ - private String ID; - private static volatile TimeZone defaultTimeZone; -- private static final InheritableThreadLocal<TimeZone> defaultZoneTL -- = new InheritableThreadLocal<TimeZone>(); - - static final String GMT_ID = "GMT"; - private static final int GMT_ID_LENGTH = 3; - -+ // true if the default TimeZone has been set in any AppContext -+ private static boolean hasSetInAppContext; -+ - /** - * Parses a custom time zone identifier and returns a corresponding zone. - * This method doesn't support the RFC 822 time zone format. (e.g., +hhmm) -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java jdk7u3/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java ---- jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java 2012-04-17 17:39:10.000000000 -0400 -+++ jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java 2012-04-17 17:48:47.000000000 -0400 -@@ -34,8 +34,10 @@ - */ - - package java.util.concurrent.atomic; -+ -+import java.lang.reflect.Array; -+import java.util.Arrays; - import sun.misc.Unsafe; --import java.util.*; - - /** - * An array of object references in which elements may be updated -@@ -49,13 +51,23 @@ - public class AtomicReferenceArray<E> implements java.io.Serializable { - private static final long serialVersionUID = -6209656149925076980L; - -- private static final Unsafe unsafe = Unsafe.getUnsafe(); -- private static final int base = unsafe.arrayBaseOffset(Object[].class); -+ private static final Unsafe unsafe; -+ private static final int base; - private static final int shift; -- private final Object[] array; -+ private static final long arrayFieldOffset; -+ private final Object[] array; // must have exact type Object[] - - static { -- int scale = unsafe.arrayIndexScale(Object[].class); -+ int scale; -+ try { -+ unsafe = Unsafe.getUnsafe(); -+ arrayFieldOffset = unsafe.objectFieldOffset -+ (AtomicReferenceArray.class.getDeclaredField("array")); -+ base = unsafe.arrayBaseOffset(Object[].class); -+ scale = unsafe.arrayIndexScale(Object[].class); -+ } catch (Exception e) { -+ throw new Error(e); -+ } - if ((scale & (scale - 1)) != 0) - throw new Error("data type scale not a power of two"); - shift = 31 - Integer.numberOfLeadingZeros(scale); -@@ -91,7 +103,7 @@ - */ - public AtomicReferenceArray(E[] array) { - // Visibility guaranteed by final field guarantees -- this.array = array.clone(); -+ this.array = Arrays.copyOf(array, array.length, Object[].class); - } - - /** -@@ -150,7 +162,7 @@ - public final E getAndSet(int i, E newValue) { - long offset = checkedByteOffset(i); - while (true) { -- E current = (E) getRaw(offset); -+ E current = getRaw(offset); - if (compareAndSetRaw(offset, current, newValue)) - return current; - } -@@ -196,7 +208,7 @@ - * @return the String representation of the current values of array - */ - public String toString() { -- int iMax = array.length - 1; -+ int iMax = array.length - 1; - if (iMax == -1) - return "[]"; - -@@ -210,4 +222,19 @@ - } - } - -+ /** -+ * Reconstitutes the instance from a stream (that is, deserializes it). -+ * @param s the stream -+ */ -+ private void readObject(java.io.ObjectInputStream s) -+ throws java.io.IOException, ClassNotFoundException { -+ // Note: This must be changed if any additional fields are defined -+ Object a = s.readFields().get("array", null); -+ if (a == null || !a.getClass().isArray()) -+ throw new java.io.InvalidObjectException("Not array type"); -+ if (a.getClass() != Object[].class) -+ a = Arrays.copyOf((Object[])a, Array.getLength(a), Object[].class); -+ unsafe.putObjectVolatile(this, arrayFieldOffset, a); -+ } -+ - } -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/java2d/SunGraphics2D.java jdk7u3/jdk/src/share/classes/sun/java2d/SunGraphics2D.java ---- jdk/src/share/classes/sun/java2d/SunGraphics2D.java 2012-04-17 17:39:17.000000000 -0400 -+++ jdk/src/share/classes/sun/java2d/SunGraphics2D.java 2012-04-17 17:48:53.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. 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 -@@ -370,6 +370,17 @@ - } - - public void validatePipe() { -+ /* This workaround is for the situation when we update the Pipelines -+ * for invalid SurfaceData and run further code when the current -+ * pipeline doesn't support the type of new SurfaceData created during -+ * the current pipeline's work (in place of the invalid SurfaceData). -+ * Usually SurfaceData and Pipelines are repaired (through revalidateAll) -+ * and called again in the exception handlers */ -+ -+ if (!surfaceData.isValid()) { -+ throw new InvalidPipeException("attempt to validate Pipe with invalid SurfaceData"); -+ } -+ - surfaceData.validatePipe(this); - } - -@@ -1804,7 +1815,12 @@ - width += x; - height += y; - } -- if (!getCompClip().intersectsQuickCheckXYXY(x, y, width, height)) { -+ -+ try { -+ if (!getCompClip().intersectsQuickCheckXYXY(x, y, width, height)) { -+ return false; -+ } -+ } catch (InvalidPipeException e) { - return false; - } - // REMIND: We could go one step further here and examine the -@@ -1988,8 +2004,8 @@ - try { - doCopyArea(x, y, w, h, dx, dy); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - doCopyArea(x, y, w, h, dx, dy); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2120,8 +2136,8 @@ - try { - drawpipe.drawLine(this, x1, y1, x2, y2); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - drawpipe.drawLine(this, x1, y1, x2, y2); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2137,8 +2153,8 @@ - try { - drawpipe.drawRoundRect(this, x, y, w, h, arcW, arcH); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - drawpipe.drawRoundRect(this, x, y, w, h, arcW, arcH); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2154,8 +2170,8 @@ - try { - fillpipe.fillRoundRect(this, x, y, w, h, arcW, arcH); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - fillpipe.fillRoundRect(this, x, y, w, h, arcW, arcH); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2171,8 +2187,8 @@ - try { - drawpipe.drawOval(this, x, y, w, h); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - drawpipe.drawOval(this, x, y, w, h); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2188,8 +2204,8 @@ - try { - fillpipe.fillOval(this, x, y, w, h); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - fillpipe.fillOval(this, x, y, w, h); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2206,8 +2222,8 @@ - try { - drawpipe.drawArc(this, x, y, w, h, startAngl, arcAngl); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - drawpipe.drawArc(this, x, y, w, h, startAngl, arcAngl); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2224,8 +2240,8 @@ - try { - fillpipe.fillArc(this, x, y, w, h, startAngl, arcAngl); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - fillpipe.fillArc(this, x, y, w, h, startAngl, arcAngl); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2241,8 +2257,8 @@ - try { - drawpipe.drawPolyline(this, xPoints, yPoints, nPoints); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - drawpipe.drawPolyline(this, xPoints, yPoints, nPoints); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2258,8 +2274,8 @@ - try { - drawpipe.drawPolygon(this, xPoints, yPoints, nPoints); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - drawpipe.drawPolygon(this, xPoints, yPoints, nPoints); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2275,8 +2291,8 @@ - try { - fillpipe.fillPolygon(this, xPoints, yPoints, nPoints); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - fillpipe.fillPolygon(this, xPoints, yPoints, nPoints); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2292,8 +2308,8 @@ - try { - drawpipe.drawRect(this, x, y, w, h); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - drawpipe.drawRect(this, x, y, w, h); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2309,8 +2325,8 @@ - try { - fillpipe.fillRect(this, x, y, w, h); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - fillpipe.fillRect(this, x, y, w, h); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2358,7 +2374,6 @@ - Paint p = paint; - setComposite(AlphaComposite.Src); - setColor(getBackground()); -- validatePipe(); - fillRect(x, y, w, h); - setPaint(p); - setComposite(c); -@@ -2382,8 +2397,8 @@ - try { - shapepipe.draw(this, s); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - shapepipe.draw(this, s); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2412,8 +2427,8 @@ - try { - shapepipe.fill(this, s); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - shapepipe.fill(this, s); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2560,10 +2575,17 @@ - // Include padding for interpolation/antialiasing if necessary - int pad = isIntegerTranslate ? 0 : 3; - -+ Region clip; -+ try { -+ clip = getCompClip(); -+ } catch (InvalidPipeException e) { -+ return; -+ } -+ - // Determine the region of the image that may contribute to - // the clipped drawing area - Rectangle region = getImageRegion(img, -- getCompClip(), -+ clip, - transform, - xform, - pad, pad); -@@ -2806,8 +2828,8 @@ - try { - textpipe.drawString(this, str, x, y); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - textpipe.drawString(this, str, x, y); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2835,8 +2857,8 @@ - try { - textpipe.drawString(this, str, x, y); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - textpipe.drawString(this, str, x, y); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2881,8 +2903,8 @@ - try { - textpipe.drawGlyphVector(this, gv, x, y); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - textpipe.drawGlyphVector(this, gv, x, y); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2914,8 +2936,8 @@ - try { - textpipe.drawChars(this, data, offset, length, x, y); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - textpipe.drawChars(this, data, offset, length, x, y); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2951,8 +2973,8 @@ - try { - textpipe.drawChars(this, chData, 0, length, x, y); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - textpipe.drawChars(this, chData, 0, length, x, y); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -2988,8 +3010,8 @@ - return imagepipe.copyImage(this, img, dx, dy, sx, sy, - width, height, bgcolor, observer); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - return imagepipe.copyImage(this, img, dx, dy, sx, sy, - width, height, bgcolor, observer); - } catch (InvalidPipeException e2) { -@@ -3025,8 +3047,8 @@ - return imagepipe.scaleImage(this, img, x, y, width, height, - bg, observer); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - return imagepipe.scaleImage(this, img, x, y, width, height, - bg, observer); - } catch (InvalidPipeException e2) { -@@ -3061,8 +3083,8 @@ - try { - return imagepipe.copyImage(this, img, x, y, bg, observer); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - return imagepipe.copyImage(this, img, x, y, bg, observer); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -3138,8 +3160,8 @@ - sx1, sy1, sx2, sy2, bgcolor, - observer); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, - sx1, sy1, sx2, sy2, bgcolor, - observer); -@@ -3187,8 +3209,8 @@ - try { - return imagepipe.transformImage(this, img, xform, observer); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - return imagepipe.transformImage(this, img, xform, observer); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -@@ -3213,8 +3235,8 @@ - try { - imagepipe.transformImage(this, bImg, op, x, y); - } catch (InvalidPipeException e) { -- revalidateAll(); - try { -+ revalidateAll(); - imagepipe.transformImage(this, bImg, op, x, y); - } catch (InvalidPipeException e2) { - // Still catching the exception; we are not yet ready to -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/java2d/opengl/OGLRenderer.java jdk7u3/jdk/src/share/classes/sun/java2d/opengl/OGLRenderer.java ---- jdk/src/share/classes/sun/java2d/opengl/OGLRenderer.java 2012-04-17 17:39:17.000000000 -0400 -+++ jdk/src/share/classes/sun/java2d/opengl/OGLRenderer.java 2012-04-17 17:48:53.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. 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 -@@ -27,6 +27,7 @@ - - import java.awt.Transparency; - import java.awt.geom.Path2D; -+import sun.java2d.InvalidPipeException; - import sun.java2d.SunGraphics2D; - import sun.java2d.loops.GraphicsPrimitive; - import sun.java2d.pipe.BufferedRenderPipe; -@@ -46,7 +47,12 @@ - int ctxflags = - sg2d.paint.getTransparency() == Transparency.OPAQUE ? - OGLContext.SRC_IS_OPAQUE : OGLContext.NO_CONTEXT_FLAGS; -- OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData; -+ OGLSurfaceData dstData; -+ try { -+ dstData = (OGLSurfaceData)sg2d.surfaceData; -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - OGLContext.validateContext(dstData, dstData, - sg2d.getCompClip(), sg2d.composite, - null, sg2d.paint, sg2d, ctxflags); -@@ -55,7 +61,12 @@ - @Override - protected void validateContextAA(SunGraphics2D sg2d) { - int ctxflags = OGLContext.NO_CONTEXT_FLAGS; -- OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData; -+ OGLSurfaceData dstData; -+ try { -+ dstData = (OGLSurfaceData)sg2d.surfaceData; -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - OGLContext.validateContext(dstData, dstData, - sg2d.getCompClip(), sg2d.composite, - null, sg2d.paint, sg2d, ctxflags); -@@ -69,7 +80,12 @@ - int ctxflags = - sg2d.surfaceData.getTransparency() == Transparency.OPAQUE ? - OGLContext.SRC_IS_OPAQUE : OGLContext.NO_CONTEXT_FLAGS; -- OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData; -+ OGLSurfaceData dstData; -+ try { -+ dstData = (OGLSurfaceData)sg2d.surfaceData; -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - OGLContext.validateContext(dstData, dstData, - sg2d.getCompClip(), sg2d.composite, - null, null, null, ctxflags); -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/java2d/pipe/BufferedContext.java jdk7u3/jdk/src/share/classes/sun/java2d/pipe/BufferedContext.java ---- jdk/src/share/classes/sun/java2d/pipe/BufferedContext.java 2012-04-17 17:39:17.000000000 -0400 -+++ jdk/src/share/classes/sun/java2d/pipe/BufferedContext.java 2012-04-17 17:48:54.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. 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 -@@ -111,6 +111,8 @@ - * - * Note: must be called while the RenderQueue lock is held. - * -+ * It's assumed that the type of surfaces has been checked by the Renderer -+ * - * @throws InvalidPipeException if either src or dest surface is not valid - * or lost - * @see RenderQueue#lock -@@ -135,6 +137,8 @@ - * - * Note: must be called while the RenderQueue lock is held. - * -+ * It's assumed that the type of surfaces has been checked by the Renderer -+ * - * @throws InvalidPipeException if the surface is not valid - * or lost - * @see RenderQueue#lock -@@ -160,6 +164,8 @@ - * - * Note: must be called while the RenderQueue lock is held. - * -+ * It's assumed that the type of surfaces has been checked by the Renderer -+ * - * @throws InvalidPipeException if either src or dest surface is not valid - * or lost - */ -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/net/httpserver/Request.java jdk7u3/jdk/src/share/classes/sun/net/httpserver/Request.java ---- jdk/src/share/classes/sun/net/httpserver/Request.java 2012-04-17 17:39:18.000000000 -0400 -+++ jdk/src/share/classes/sun/net/httpserver/Request.java 2012-04-17 17:48:55.000000000 -0400 -@@ -203,6 +203,13 @@ - v = new String(); - else - v = String.copyValueOf(s, keyend, len - keyend); -+ -+ if (hdrs.size() >= ServerConfig.getMaxReqHeaders()) { -+ throw new IOException("Maximum number of request headers (" + -+ "sun.net.httpserver.maxReqHeaders) exceeded, " + -+ ServerConfig.getMaxReqHeaders() + "."); -+ } -+ - hdrs.add (k,v); - len = 0; - } -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/net/httpserver/ServerConfig.java jdk7u3/jdk/src/share/classes/sun/net/httpserver/ServerConfig.java ---- jdk/src/share/classes/sun/net/httpserver/ServerConfig.java 2012-04-17 17:39:18.000000000 -0400 -+++ jdk/src/share/classes/sun/net/httpserver/ServerConfig.java 2012-04-17 17:48:55.000000000 -0400 -@@ -46,13 +46,14 @@ - static final long DEFAULT_MAX_REQ_TIME = -1; // default: forever - static final long DEFAULT_MAX_RSP_TIME = -1; // default: forever - static final long DEFAULT_TIMER_MILLIS = 1000; -- -+ static final int DEFAULT_MAX_REQ_HEADERS = 200; - static final long DEFAULT_DRAIN_AMOUNT = 64 * 1024; - - static long idleInterval; - static long drainAmount; // max # of bytes to drain from an inputstream - static int maxIdleConnections; -- -+ // The maximum number of request headers allowable -+ private static int maxReqHeaders; - // max time a request or response is allowed to take - static long maxReqTime; - static long maxRspTime; -@@ -80,6 +81,10 @@ - drainAmount = Long.getLong("sun.net.httpserver.drainAmount", - DEFAULT_DRAIN_AMOUNT); - -+ maxReqHeaders = Integer.getInteger( -+ "sun.net.httpserver.maxReqHeaders", -+ DEFAULT_MAX_REQ_HEADERS); -+ - maxReqTime = Long.getLong("sun.net.httpserver.maxReqTime", - DEFAULT_MAX_REQ_TIME); - -@@ -157,6 +162,10 @@ - return drainAmount; - } - -+ static int getMaxReqHeaders() { -+ return maxReqHeaders; -+ } -+ - static long getMaxReqTime () { - return maxReqTime; - } -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java jdk7u3/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java ---- jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java 2012-04-17 17:39:20.000000000 -0400 -+++ jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java 2012-04-17 17:48:57.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. 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 -@@ -668,7 +668,10 @@ - + "\n Subject: " + cert.getSubjectX500Principal() + ")"); - } - -- ForwardState currState = (ForwardState) currentState; -+ ForwardState currState = (ForwardState)currentState; -+ -+ // Don't bother to verify untrusted certificate more. -+ currState.untrustedChecker.check(cert, Collections.<String>emptySet()); - - /* - * check for looping - abort a loop if -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/provider/certpath/ForwardState.java jdk7u3/jdk/src/share/classes/sun/security/provider/certpath/ForwardState.java ---- jdk/src/share/classes/sun/security/provider/certpath/ForwardState.java 2012-04-17 17:39:20.000000000 -0400 -+++ jdk/src/share/classes/sun/security/provider/certpath/ForwardState.java 2012-04-17 17:48:57.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. 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 -@@ -79,6 +79,9 @@ - /* the checker used for revocation status */ - public CrlRevocationChecker crlChecker; - -+ /* the untrusted certificates checker */ -+ UntrustedChecker untrustedChecker; -+ - /* The list of user-defined checkers that support forward checking */ - ArrayList<PKIXCertPathChecker> forwardCheckers; - -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java jdk7u3/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java ---- jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java 2012-04-17 17:39:20.000000000 -0400 -+++ jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java 2012-04-17 17:48:57.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. 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 -@@ -314,10 +314,12 @@ - pkixParam.isAnyPolicyInhibited(), - pkixParam.getPolicyQualifiersRejected(), - rootNode); -+ UntrustedChecker untrustedChecker = new UntrustedChecker(); - - ArrayList<PKIXCertPathChecker> certPathCheckers = - new ArrayList<PKIXCertPathChecker>(); - // add standard checkers that we will be using -+ certPathCheckers.add(untrustedChecker); - certPathCheckers.add(algorithmChecker); - certPathCheckers.add(keyChecker); - certPathCheckers.add(constraintsChecker); -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java jdk7u3/jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java ---- jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java 2012-04-17 17:39:20.000000000 -0400 -+++ jdk/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java 2012-04-17 17:48:57.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. 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 -@@ -347,6 +347,10 @@ - return; - } - -+ // Don't bother to verify untrusted certificate more. -+ currentState.untrustedChecker.check(cert, -+ Collections.<String>emptySet()); -+ - /* - * check for looping - abort a loop if - * ((we encounter the same certificate twice) AND -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java jdk7u3/jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java ---- jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java 2012-04-17 17:39:20.000000000 -0400 -+++ jdk/src/share/classes/sun/security/provider/certpath/ReverseState.java 2012-04-17 17:48:57.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. 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 -@@ -99,6 +99,9 @@ - /* the algorithm checker */ - AlgorithmChecker algorithmChecker; - -+ /* the untrusted certificates checker */ -+ UntrustedChecker untrustedChecker; -+ - /* the trust anchor used to validate the path */ - TrustAnchor trustAnchor; - -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java jdk7u3/jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java ---- jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java 2012-04-17 17:39:20.000000000 -0400 -+++ jdk/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java 2012-04-17 17:48:57.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. 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 -@@ -284,6 +284,7 @@ - Iterator<TrustAnchor> iter = buildParams.getTrustAnchors().iterator(); - while (iter.hasNext()) { - TrustAnchor anchor = iter.next(); -+ - /* check if anchor satisfies target constraints */ - if (anchorIsTarget(anchor, targetSel)) { - this.trustAnchor = anchor; -@@ -303,6 +304,7 @@ - currentState.crlChecker = - new CrlRevocationChecker(null, buildParams, null, onlyEECert); - currentState.algorithmChecker = new AlgorithmChecker(anchor); -+ currentState.untrustedChecker = new UntrustedChecker(); - try { - depthFirstSearchReverse(null, currentState, - new ReverseBuilder(buildParams, targetSubjectDN), adjacencyList, -@@ -349,6 +351,7 @@ - // init the crl checker - currentState.crlChecker - = new CrlRevocationChecker(null, buildParams, null, onlyEECert); -+ currentState.untrustedChecker = new UntrustedChecker(); - - depthFirstSearchForward(targetSubjectDN, currentState, - new ForwardBuilder -@@ -645,8 +648,8 @@ - vertex.setIndex(adjList.size() - 1); - - /* recursively search for matching certs at next dN */ -- depthFirstSearchForward(cert.getIssuerX500Principal(), nextState, builder, -- adjList, certPathList); -+ depthFirstSearchForward(cert.getIssuerX500Principal(), -+ nextState, builder, adjList, certPathList); - - /* - * If path has been completed, return ASAP! -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/provider/certpath/UntrustedChecker.java jdk7u3/jdk/src/share/classes/sun/security/provider/certpath/UntrustedChecker.java ---- jdk/src/share/classes/sun/security/provider/certpath/UntrustedChecker.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/src/share/classes/sun/security/provider/certpath/UntrustedChecker.java 2012-04-17 17:48:57.000000000 -0400 -@@ -0,0 +1,89 @@ -+/* -+ * Copyright (c) 2012, Oracle and/or its affiliates. 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. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+package sun.security.provider.certpath; -+ -+import java.security.cert.Certificate; -+import java.security.cert.X509Certificate; -+import java.security.cert.CertPathValidatorException; -+import java.security.cert.PKIXCertPathChecker; -+import java.util.Set; -+import java.util.Collection; -+import sun.security.util.Debug; -+import sun.security.util.UntrustedCertificates; -+ -+/** -+ * A <code>PKIXCertPathChecker</code> implementation to check whether a -+ * specified certificate is distrusted. -+ * -+ * @see PKIXCertPathChecker -+ * @see PKIXParameters -+ */ -+final public class UntrustedChecker extends PKIXCertPathChecker { -+ -+ private static final Debug debug = Debug.getInstance("certpath"); -+ -+ /** -+ * Default Constructor -+ */ -+ public UntrustedChecker() { -+ // blank -+ } -+ -+ @Override -+ public void init(boolean forward) throws CertPathValidatorException { -+ // Note that this class supports both forward and reverse modes. -+ } -+ -+ @Override -+ public boolean isForwardCheckingSupported() { -+ // Note that this class supports both forward and reverse modes. -+ return true; -+ } -+ -+ @Override -+ public Set<String> getSupportedExtensions() { -+ return null; -+ } -+ -+ @Override -+ public void check(Certificate cert, -+ Collection<String> unresolvedCritExts) -+ throws CertPathValidatorException { -+ -+ X509Certificate currCert = (X509Certificate)cert; -+ -+ if (UntrustedCertificates.isUntrusted(currCert)) { -+ if (debug != null) { -+ debug.println("UntrustedChecker: untrusted certificate " + -+ currCert.getSubjectX500Principal()); -+ } -+ -+ throw new CertPathValidatorException( -+ "Untrusted certificate: " + currCert.getSubjectX500Principal()); -+ } -+ } -+} -+ -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java jdk7u3/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java ---- jdk/src/share/classes/sun/security/util/UntrustedCertificates.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/src/share/classes/sun/security/util/UntrustedCertificates.java 2012-04-17 17:48:58.000000000 -0400 -@@ -0,0 +1,741 @@ -+/* -+ * Copyright (c) 2012, Oracle and/or its affiliates. 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. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+package sun.security.util; -+ -+import java.io.IOException; -+import java.io.ByteArrayInputStream; -+import java.security.cert.X509Certificate; -+import java.security.cert.CertificateFactory; -+import java.security.cert.CertificateException; -+import java.util.Set; -+import java.util.HashSet; -+ -+/** -+ * A utility class to check if a certificate is untrusted. This is an internal -+ * mechanism that explicitly marks a certificate as untrusted, normally in the -+ * case that a certificate is known to be used for malicious reasons. -+ * -+ * <b>Attention</b>: This check is NOT meant to replace the standard PKI-defined -+ * validation check, neither is it used as an alternative to CRL. -+ */ -+public final class UntrustedCertificates { -+ -+ private final static Set<X509Certificate> untrustedCerts = new HashSet<>(); -+ -+ /** -+ * Checks if a certificate is untrusted. -+ * -+ * @param cert the certificate to check -+ * @return true if the certificate is untrusted. -+ */ -+ public static boolean isUntrusted(X509Certificate cert) { -+ return untrustedCerts.contains(cert); -+ } -+ -+ private static void add(String alias, String pemCert) { -+ // generate certificate from PEM certificate -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(pemCert.getBytes())) { -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ X509Certificate cert = (X509Certificate)cf.generateCertificate(is); -+ -+ if (!untrustedCerts.add(cert)) { -+ throw new RuntimeException("Duplicate untrusted certificate: " + -+ cert.getSubjectX500Principal()); -+ } -+ } catch (CertificateException | IOException e) { -+ throw new RuntimeException( -+ "Incorrect untrusted certificate: " + alias, e); -+ } -+ } -+ -+ static { -+ // ----------------------------------------------------------------- -+ // Compromised CAs of Digicert Malaysia -+ // -+ // Reported by Digicert in its announcement on November 05, 2011. -+ // -+ -+ // Digicert Malaysia intermediate, cross-signed by CyberTrust -+ // -+ // Subject: CN=Digisign Server ID (Enrich), -+ // OU=457608-K, -+ // O=Digicert Sdn. Bhd., -+ // C=MY -+ // Issuer: CN=GTE CyberTrust Global Root, -+ // OU=GTE CyberTrust Solutions, Inc., -+ // O=GTE Corporation, -+ // C=US -+ // Serial: 120001705 (07:27:14:a9) -+ add("digicert-server-cross-to-cybertrust-4C0E636A", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIDyzCCAzSgAwIBAgIEBycUqTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQGEwJV\n" + -+ "UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU\n" + -+ "cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds\n" + -+ "b2JhbCBSb290MB4XDTA3MDcxNzE1MTc0OFoXDTEyMDcxNzE1MTY1NFowYzELMAkG\n" + -+ "A1UEBhMCTVkxGzAZBgNVBAoTEkRpZ2ljZXJ0IFNkbi4gQmhkLjERMA8GA1UECxMI\n" + -+ "NDU3NjA4LUsxJDAiBgNVBAMTG0RpZ2lzaWduIFNlcnZlciBJRCAoRW5yaWNoKTCB\n" + -+ "nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArahkS02Hx4RZufuQRqCmicDx/tXa\n" + -+ "VII3DZkrRSYK6Fawf8qo9I5HhAGCKeOzarWR8/uVhbxyqGToCkCcxfRxrnt7agfq\n" + -+ "kBRPjYmvlKuyBtQCanuYH1m5Os1U+iDfsioK6bjdaZDAKdNO0JftZszFGUkGf/pe\n" + -+ "LHx7hRsyQt97lSUCAwEAAaOCAXgwggF0MBIGA1UdEwEB/wQIMAYBAf8CAQAwXAYD\n" + -+ "VR0gBFUwUzBIBgkrBgEEAbE+AQAwOzA5BggrBgEFBQcCARYtaHR0cDovL2N5YmVy\n" + -+ "dHJ1c3Qub21uaXJvb3QuY29tL3JlcG9zaXRvcnkuY2ZtMAcGBWCDSgEBMA4GA1Ud\n" + -+ "DwEB/wQEAwIB5jCBiQYDVR0jBIGBMH+heaR3MHUxCzAJBgNVBAYTAlVTMRgwFgYD\n" + -+ "VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv\n" + -+ "bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv\n" + -+ "b3SCAgGlMEUGA1UdHwQ+MDwwOqA4oDaGNGh0dHA6Ly93d3cucHVibGljLXRydXN0\n" + -+ "LmNvbS9jZ2ktYmluL0NSTC8yMDE4L2NkcC5jcmwwHQYDVR0OBBYEFMYWk04WF+wW\n" + -+ "royUdvOGbcV0boR3MA0GCSqGSIb3DQEBBQUAA4GBAHYAe6Z4K2Ydjl42xqSOBfIj\n" + -+ "knyTZ9P0wAp9iy3Z6tVvGvPhSilaIoRNUC9LDPL/hcJ7VdREgr5trGeOvLQfkpxR\n" + -+ "gBoU9m6rYYgLrRx/90tQUdZlG6ZHcRVesHHzNRTyN71jyNXwk1o0X9g96F33xR7A\n" + -+ "5c8fhiSpPAdmzcHSNmNZ\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // Digicert Malaysia intermediate, cross-signed by Entrust -+ // -+ // Subject: CN=Digisign Server ID - (Enrich), -+ // OU=457608-K, -+ // O=Digicert Sdn. Bhd., -+ // C=MY -+ // Issuer: CN=Entrust.net Certification Authority (2048) -+ // OU=(c) 1999 Entrust.net Limited, -+ // OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), -+ // O=Entrust.net -+ // Serial: 1184644297 (4c:0e:63:6a) -+ add("digicert-server-cross-to-entrust-ca-4C0E636A", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIEzjCCA7agAwIBAgIETA5jajANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML\n" + -+ "RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp\n" + -+ "bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5\n" + -+ "IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp\n" + -+ "ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw0xMDA3MTYxNzIzMzdaFw0xNTA3\n" + -+ "MTYxNzUzMzdaMGUxCzAJBgNVBAYTAk1ZMRswGQYDVQQKExJEaWdpY2VydCBTZG4u\n" + -+ "IEJoZC4xETAPBgNVBAsTCDQ1NzYwOC1LMSYwJAYDVQQDEx1EaWdpc2lnbiBTZXJ2\n" + -+ "ZXIgSUQgLSAoRW5yaWNoKTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n" + -+ "AMWJ5PQNBkCSWccaszXRDkwqM/n4r8qef+65p21g9FTob9Wb8xtjMQRoctE0Foy0\n" + -+ "FyyX3nPF2JAVoBor9cuzSIZE8B2ITM5BQhrv9Qze/kDaOSD3BlU6ap1GwdJvpbLI\n" + -+ "Vz4po5zg6YV3ZuiYpyR+vsBZIOVEb7ZX2L7OwmV3WMZhQdF0BMh/SULFcqlyFu6M\n" + -+ "3RJdtErU0a9Qt9iqdXZorT5dqjBtYairEFs+E78z4K9EnTgiW+9ML6ZxJhUmyiiM\n" + -+ "2fqOjqmiFDXimySItPR/hZ2DTwehthSQNsQ0HI0mYW0Tb3i+6I8nx0uElqOGaAwj\n" + -+ "vgvsjJQAqQSKE5D334VsDLECAwEAAaOCATQwggEwMA4GA1UdDwEB/wQEAwIBBjAS\n" + -+ "BgNVHRMBAf8ECDAGAQH/AgEAMCcGA1UdJQQgMB4GCCsGAQUFBwMBBggrBgEFBQcD\n" + -+ "AgYIKwYBBQUHAwQwMwYIKwYBBQUHAQEEJzAlMCMGCCsGAQUFBzABhhdodHRwOi8v\n" + -+ "b2NzcC5lbnRydXN0Lm5ldDBEBgNVHSAEPTA7MDkGBWCDSgEBMDAwLgYIKwYBBQUH\n" + -+ "AgEWImh0dHA6Ly93d3cuZGlnaWNlcnQuY29tLm15L2Nwcy5odG0wMgYDVR0fBCsw\n" + -+ "KTAnoCWgI4YhaHR0cDovL2NybC5lbnRydXN0Lm5ldC8yMDQ4Y2EuY3JsMBEGA1Ud\n" + -+ "DgQKBAhMTswlKAMpgTAfBgNVHSMEGDAWgBRV5IHREYC+2Im5CKMx+aEkCRa5cDAN\n" + -+ "BgkqhkiG9w0BAQUFAAOCAQEAl0zvSjpJrHL8MCBrtClbp8WVBJD5MtXChWreA6E3\n" + -+ "+YkAsFqsVX7bQzX/yQH4Ub7MJsrIaqTEVD4mHucMo82XZ5TdpkLrXM2POXlrM3kh\n" + -+ "Bnn6gkQVmczBtznTRmJ8snDrb84gqj4Zt+l0gpy0pUtNYQA35IfS8hQ6ZHy4qXth\n" + -+ "4JMi59WfPkfmNnagU9gAAzoPtTP+lsrT0oI6Lt3XSOHkp2nMHOmZSufKcEXXCwcO\n" + -+ "mnUb0C+Sb/akB8O9HEumhLZ9qJqp0qcp8QtXaR6XVybsK0Os1EWDBQDp4/BGQAf6\n" + -+ "6rFRc5Mcpd1TETfIKqcVJx20qsx/qjEw/LhFn0gJ7RDixQ==\n" + -+ "-----END CERTIFICATE-----"); -+ -+ -+ // ----------------------------------------------------------------- -+ // -+ // No longer used certificates -+ // -+ -+ // Subject: CN=Java Media APIs, -+ // OU=Java Signed Extensions, -+ // OU=Corporate Object Signing, -+ // O=Sun Microsystems Inc -+ // Issuer: CN=Object Signing CA, -+ // OU=Class 2 OnSite Subscriber CA, -+ // OU=VeriSign Trust Network, -+ // O=Sun Microsystems Inc -+ // Serial: 6a:8b:99:91:37:59:4f:89:53:e2:97:18:9f:19:1e:4e -+ add("java-media-pretrusted-9F191E4E", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFdzCCBF+gAwIBAgIQaouZkTdZT4lT4pcYnxkeTjANBgkqhkiG9w0BAQUFADCB\n" + -+ "gzEdMBsGA1UEChMUU3VuIE1pY3Jvc3lzdGVtcyBJbmMxHzAdBgNVBAsTFlZlcmlT\n" + -+ "aWduIFRydXN0IE5ldHdvcmsxJTAjBgNVBAsTHENsYXNzIDIgT25TaXRlIFN1YnNj\n" + -+ "cmliZXIgQ0ExGjAYBgNVBAMTEU9iamVjdCBTaWduaW5nIENBMB4XDTA5MDUxMjAw\n" + -+ "MDAwMFoXDTEyMDUxMTIzNTk1OVowfTEdMBsGA1UEChQUU3VuIE1pY3Jvc3lzdGVt\n" + -+ "cyBJbmMxITAfBgNVBAsUGENvcnBvcmF0ZSBPYmplY3QgU2lnbmluZzEfMB0GA1UE\n" + -+ "CxQWSmF2YSBTaWduZWQgRXh0ZW5zaW9uczEYMBYGA1UEAxQPSmF2YSBNZWRpYSBB\n" + -+ "UElzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl5blzoKTVE8y4Hpz\n" + -+ "q6E15RZz1bF5HnYEyYqgHkZXnAKedmYCoMzm1XK8s+gQWShLEvGEAvs5yqarx9gE\n" + -+ "nnC21N28aEZgIJMa2/arKxCUkS4pxdGPYGexL9UzSRkUpoBShCZKEGdmX7gfJE2K\n" + -+ "/sd9MFvGV5/yZtWXrADzvm0Kd/9mg1KRv1gfrZIq0TJbupoXPYYqb73AkI9eT2ZD\n" + -+ "q9MdwD4E5+oojsDFXt8GU/D00fUhtXpYwuplU7D667WHYdJhIah0ST6JywyqcLXG\n" + -+ "XSuFTXOgITT2idSHluZVmx3dqJ72u9kPkO4JdJTMDfaK8zgNLaRkiU8Qcj+qhLYH\n" + -+ "ytaqcwIDAQABo4IB6jCCAeYwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCB4AwfwYD\n" + -+ "VR0fBHgwdjB0oHKgcIZuaHR0cDovL29uc2l0ZWNybC52ZXJpc2lnbi5jb20vU3Vu\n" + -+ "TWljcm9zeXN0ZW1zSW5jQ29ycG9yYXRlT2JqZWN0U2lnbmluZ0phdmFTaWduZWRF\n" + -+ "eHRlbnNpb25zQ2xhc3NCL0xhdGVzdENSTC5jcmwwHwYDVR0jBBgwFoAUs0crgn5T\n" + -+ "tHPKuLsZt76BTQeVx+0wHQYDVR0OBBYEFKS32mVx0gNWTeS4ProHEaeSpvvIMDsG\n" + -+ "CCsGAQUFBwEBBC8wLTArBggrBgEFBQcwAYYfaHR0cDovL29uc2l0ZS1vY3NwLnZl\n" + -+ "cmlzaWduLmNvbTCBtQYDVR0gBIGtMIGqMDkGC2CGSAGG+EUBBxcCMCowKAYIKwYB\n" + -+ "BQUHAgEWHGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEwbQYLYIZIAYb3AIN9\n" + -+ "nD8wXjAnBggrBgEFBQcCARYbaHR0cHM6Ly93d3cuc3VuLmNvbS9wa2kvY3BzMDMG\n" + -+ "CCsGAQUFBwICMCcaJVZhbGlkYXRlZCBGb3IgU3VuIEJ1c2luZXNzIE9wZXJhdGlv\n" + -+ "bnMwEwYDVR0lBAwwCgYIKwYBBQUHAwMwDQYJKoZIhvcNAQEFBQADggEBAAe6BO4W\n" + -+ "3TSNWfezyelJs6kE3HfulT6Bdyz4UUoh9ykXcV8nRwT+kh25I5MdyG2GfkJoADPR\n" + -+ "VhC5DYo13UFpIsTNVjq+hGYe2hML93bN7ad9SxCCyjHUo3yMz2qgBbHZI3VA9ZHA\n" + -+ "aWM4Tx0saMwbcnVvlbuGh+PXvStfypJqYT6lzcdFfjNVX4FI/QQNGhBswMY51tC8\n" + -+ "GTBCL2qhJon0gSCU4zaawDOf7+XxJWirLamYL1Aal1/h2z2sFrvA/1ftxtU3kZ6I\n" + -+ "7De8DyoHeZg7pYGdrj7g+lPhCga/WvEhN152I+aP08YbFcJHYmK05ngl/Ye4c6Bd\n" + -+ "cdrdfbw6QzEUIYY=\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // Subject: CN=JavaFX 1.0 Runtime, -+ // OU=Java Signed Extensions, -+ // OU=Corporate Object Signing, -+ // O=Sun Microsystems Inc -+ // Issuer: CN=Object Signing CA, -+ // OU=Class 2 OnSite Subscriber CA, -+ // OU=VeriSign Trust Network, -+ // O=Sun Microsystems Inc -+ // Serial: 55:c0:e6:44:59:59:79:9e:d9:26:f1:b0:4a:1e:f0:27 -+ add("java-fx10-pretrusted-4A1EF027", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFezCCBGOgAwIBAgIQVcDmRFlZeZ7ZJvGwSh7wJzANBgkqhkiG9w0BAQUFADCB\n" + -+ "gzEdMBsGA1UEChMUU3VuIE1pY3Jvc3lzdGVtcyBJbmMxHzAdBgNVBAsTFlZlcmlT\n" + -+ "aWduIFRydXN0IE5ldHdvcmsxJTAjBgNVBAsTHENsYXNzIDIgT25TaXRlIFN1YnNj\n" + -+ "cmliZXIgQ0ExGjAYBgNVBAMTEU9iamVjdCBTaWduaW5nIENBMB4XDTA4MTAwOTAw\n" + -+ "MDAwMFoXDTExMTAwOTIzNTk1OVowgYAxHTAbBgNVBAoUFFN1biBNaWNyb3N5c3Rl\n" + -+ "bXMgSW5jMSEwHwYDVQQLFBhDb3Jwb3JhdGUgT2JqZWN0IFNpZ25pbmcxHzAdBgNV\n" + -+ "BAsUFkphdmEgU2lnbmVkIEV4dGVuc2lvbnMxGzAZBgNVBAMUEkphdmFGWCAxLjAg\n" + -+ "UnVudGltZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM+WDc6+bu+4\n" + -+ "tmAcS/lBtUc02WOt9QZpVsXg9cG2pu/8bUtmDELa8iiYBVFpIs8DU58HLrGQtCUY\n" + -+ "SIAGOVPsOJoN29UKCDWfY9j5JeVhfhMGqk9DwrWhzgsjy4cpZ1pIp+k/fJ8zT8Ul\n" + -+ "aYLpow1vg3UNddsmwz02tN7cOrMw9WYIG4CRYnY1OrtJSfe2pYzheC4zyvR+aiVl\n" + -+ "nang2OtqikSQsNFOFHsLOJFxngy9LrO8evDSu25VTKI6zlWU6/bMeqtztJPN0VOn\n" + -+ "NyUrJZvkxZ207Jg0T693BGSxNC1n+ihztXogql8950M/pEuUbDjylv5FFvlp6DSB\n" + -+ "dDT2MkutmyMCAwEAAaOCAeowggHmMAkGA1UdEwQCMAAwDgYDVR0PAQH/BAQDAgeA\n" + -+ "MH8GA1UdHwR4MHYwdKByoHCGbmh0dHA6Ly9vbnNpdGVjcmwudmVyaXNpZ24uY29t\n" + -+ "L1N1bk1pY3Jvc3lzdGVtc0luY0NvcnBvcmF0ZU9iamVjdFNpZ25pbmdKYXZhU2ln\n" + -+ "bmVkRXh0ZW5zaW9uc0NsYXNzQi9MYXRlc3RDUkwuY3JsMB8GA1UdIwQYMBaAFLNH\n" + -+ "K4J+U7Rzyri7Gbe+gU0HlcftMB0GA1UdDgQWBBTjgufVi3XJ3gx1ewsA6Rr7BR4Z\n" + -+ "zjA7BggrBgEFBQcBAQQvMC0wKwYIKwYBBQUHMAGGH2h0dHA6Ly9vbnNpdGUtb2Nz\n" + -+ "cC52ZXJpc2lnbi5jb20wgbUGA1UdIASBrTCBqjA5BgtghkgBhvhFAQcXAjAqMCgG\n" + -+ "CCsGAQUFBwIBFhxodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhMG0GC2CGSAGG\n" + -+ "9wCDfZw/MF4wJwYIKwYBBQUHAgEWG2h0dHBzOi8vd3d3LnN1bi5jb20vcGtpL2Nw\n" + -+ "czAzBggrBgEFBQcCAjAnGiVWYWxpZGF0ZWQgRm9yIFN1biBCdXNpbmVzcyBPcGVy\n" + -+ "YXRpb25zMBMGA1UdJQQMMAoGCCsGAQUFBwMDMA0GCSqGSIb3DQEBBQUAA4IBAQAB\n" + -+ "YVJTTVe7rzyTO4jc3zajErOT/COkdQTfNo0eIX1QbNynFieJvwY/jRzUZwjktIFR\n" + -+ "2p4JtbpHGAtKtjOAOTieQ8xdDOoC1djzpE7/AbMvuvlTavtUKT+F7tPdhfXgWXJV\n" + -+ "6Wbt8jryKyk3zZGiEhauIwZUkfjRkEtffEmZWLUd8c8rURJjfC/XHH2oyurscoxc\n" + -+ "CjX29c9ynxSiS/VvQp1an0HvErGh69N48wj7cj8mtZ1yHzd2XCzSSR1OfTPfk0Pt\n" + -+ "yg51p7yJaFiH21PTZegEL6zyVNOYBTKwwIi2OzpwYalD3uvK6e3OKDrfFCOxu17u\n" + -+ "4PveESbrdyrmvLe7IVez\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // Subject: CN=JavaFX Runtime, -+ // OU=Java Signed Extensions, -+ // OU=Corporate Object Signing, -+ // O=Sun Microsystems Inc -+ // Issuer: CN=Object Signing CA, -+ // OU=Class 2 OnSite Subscriber CA, -+ // OU=VeriSign Trust Network, -+ // O=Sun Microsystems Inc -+ // Serial: 47:f4:55:f1:da:4a:5e:f9:e3:f7:a8:03:62:17:c0:ff -+ add("javafx-runtime-pretrusted-6217C0FF", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFdjCCBF6gAwIBAgIQR/RV8dpKXvnj96gDYhfA/zANBgkqhkiG9w0BAQUFADCB\n" + -+ "gzEdMBsGA1UEChMUU3VuIE1pY3Jvc3lzdGVtcyBJbmMxHzAdBgNVBAsTFlZlcmlT\n" + -+ "aWduIFRydXN0IE5ldHdvcmsxJTAjBgNVBAsTHENsYXNzIDIgT25TaXRlIFN1YnNj\n" + -+ "cmliZXIgQ0ExGjAYBgNVBAMTEU9iamVjdCBTaWduaW5nIENBMB4XDTA5MDEyOTAw\n" + -+ "MDAwMFoXDTEyMDEyOTIzNTk1OVowfDEdMBsGA1UEChQUU3VuIE1pY3Jvc3lzdGVt\n" + -+ "cyBJbmMxITAfBgNVBAsUGENvcnBvcmF0ZSBPYmplY3QgU2lnbmluZzEfMB0GA1UE\n" + -+ "CxQWSmF2YSBTaWduZWQgRXh0ZW5zaW9uczEXMBUGA1UEAxQOSmF2YUZYIFJ1bnRp\n" + -+ "bWUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCIzd0fAk8mI9ONc6RJ\n" + -+ "aGieioK2FLdXEwj8zL3vdGDVmBwyR1zwYkaOIFFgF9IW/8qc4iAYA5sGUY+0g8q3\n" + -+ "5DuYAxfTzBB5KdaYvbuq6GGnoHIWmTirXY+1friFp8lyXSvtuEaGB1VHaBoZchEg\n" + -+ "k+UgeVDA43dHwcT1Ov3DePczJRUes8T/QHzLX+BxUDG43vjyncCEO/AjqLZxXEz2\n" + -+ "xrNbKLcH3lGMJK7hdbfssUfF5BjC38Hn71HauYlA43b2no+2y0Sjulwzez2YPbDC\n" + -+ "0GLR3TnKtA8dqOrnl5t3DniDbfOBNtBE3VOydJO0XW57Ng1HRXD023nm9ECPY2xp\n" + -+ "0N/pAgMBAAGjggHqMIIB5jAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIHgDB/BgNV\n" + -+ "HR8EeDB2MHSgcqBwhm5odHRwOi8vb25zaXRlY3JsLnZlcmlzaWduLmNvbS9TdW5N\n" + -+ "aWNyb3N5c3RlbXNJbmNDb3Jwb3JhdGVPYmplY3RTaWduaW5nSmF2YVNpZ25lZEV4\n" + -+ "dGVuc2lvbnNDbGFzc0IvTGF0ZXN0Q1JMLmNybDAfBgNVHSMEGDAWgBSzRyuCflO0\n" + -+ "c8q4uxm3voFNB5XH7TAdBgNVHQ4EFgQUvOdd0cKPj+Yik/iOBwTdphh5A+gwOwYI\n" + -+ "KwYBBQUHAQEELzAtMCsGCCsGAQUFBzABhh9odHRwOi8vb25zaXRlLW9jc3AudmVy\n" + -+ "aXNpZ24uY29tMIG1BgNVHSAEga0wgaowOQYLYIZIAYb4RQEHFwIwKjAoBggrBgEF\n" + -+ "BQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYTBtBgtghkgBhvcAg32c\n" + -+ "PzBeMCcGCCsGAQUFBwIBFhtodHRwczovL3d3dy5zdW4uY29tL3BraS9jcHMwMwYI\n" + -+ "KwYBBQUHAgIwJxolVmFsaWRhdGVkIEZvciBTdW4gQnVzaW5lc3MgT3BlcmF0aW9u\n" + -+ "czATBgNVHSUEDDAKBggrBgEFBQcDAzANBgkqhkiG9w0BAQUFAAOCAQEAbGcf2NjL\n" + -+ "AI93HG6ny2BbepaZA1a8xa/R6uUc7xV+Qw6MgLwFD4Q4i6LWUztQDvg9l68MM2/i\n" + -+ "Y9LEi1KM4lcNbK5+D+t9x98wXBiuojXhVdp5ZmC03EyEBbriopdBsmXVLDSu/Y3+\n" + -+ "zowOO5xwpMK3dbgsSDs2Vt0UosD3FTcRaD3GNfOhXMp+o1grHNiXF9YgkmdQbPPZ\n" + -+ "DQ2KBhFPCRJXBGvyKOqno/DTg0sQ3crGH/C4/4t7mnQXWldZotmJUZ0ONc9oD+Q1\n" + -+ "JAaguUKqIwn9yZ093ie+JWHbYNid9IIIPXYgtRxmf9a376WBhqhu56uJftBJ7x9g\n" + -+ "eQ7Lot6CSWCiFw==\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // -+ // Compromised Solaris INTERNAL DEVELOPMENT USE ONLY certificate -+ // -+ -+ // Subject: CN=Solaris INTERNAL DEVELOPMENT USE ONLY, -+ // OU=Solaris Cryptographic Framework, -+ // OU=Corporate Object Signing, -+ // O=Sun Microsystems Inc -+ // Issuer: CN=Object Signing CA, -+ // OU=Class 2 OnSite Subscriber CA, -+ // OU=VeriSign Trust Network, -+ // O=Sun Microsystems Inc -+ // Serial: 77:29:77:52:6a:19:7b:9a:a6:a2:c7:99:a0:e1:cd:8c -+ add("solaris-internal-dev-A0E1CD8C", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFHjCCBAagAwIBAgIQdyl3UmoZe5qmoseZoOHNjDANBgkqhkiG9w0BAQUFADCB\n" + -+ "gzEdMBsGA1UEChMUU3VuIE1pY3Jvc3lzdGVtcyBJbmMxHzAdBgNVBAsTFlZlcmlT\n" + -+ "aWduIFRydXN0IE5ldHdvcmsxJTAjBgNVBAsTHENsYXNzIDIgT25TaXRlIFN1YnNj\n" + -+ "cmliZXIgQ0ExGjAYBgNVBAMTEU9iamVjdCBTaWduaW5nIENBMB4XDTA3MDEwNDAw\n" + -+ "MDAwMFoXDTEwMDEwMzIzNTk1OVowgZwxHTAbBgNVBAoUFFN1biBNaWNyb3N5c3Rl\n" + -+ "bXMgSW5jMSEwHwYDVQQLFBhDb3Jwb3JhdGUgT2JqZWN0IFNpZ25pbmcxKDAmBgNV\n" + -+ "BAsUH1NvbGFyaXMgQ3J5cHRvZ3JhcGhpYyBGcmFtZXdvcmsxLjAsBgNVBAMUJVNv\n" + -+ "bGFyaXMgSU5URVJOQUwgREVWRUxPUE1FTlQgVVNFIE9OTFkwgZ8wDQYJKoZIhvcN\n" + -+ "AQEBBQADgY0AMIGJAoGBALbNU4hf3mD5ArDI9pjgioAyvV3bjMPRQdCZniIeGJBp\n" + -+ "odFlSEH+Mh64W1DsY8coeZ7FvvGJkx9IpTMJW9k8w1oJK9UNqHyAQfaYjQyXi3xQ\n" + -+ "LJp62EvYdGfDlwOZejEcR/MbzZG+GOPMMvQj5+xyFDvLXNGfQNTnxw2qnBgCJXjj\n" + -+ "AgMBAAGjggH1MIIB8TAJBgNVHRMEAjAAMA4GA1UdDwEB/wQEAwIHgDCBiQYDVR0f\n" + -+ "BIGBMH8wfaB7oHmGd2h0dHA6Ly9vbnNpdGVjcmwudmVyaXNpZ24uY29tL1N1bk1p\n" + -+ "Y3Jvc3lzdGVtc0luY0NvcnBvcmF0ZU9iamVjdFNpZ25pbmdTb2xhcmlzQ3J5cHRv\n" + -+ "Z3JhcGhpY0ZyYW1ld29ya0NsYXNzQi9MYXRlc3RDUkwuY3JsMB8GA1UdIwQYMBaA\n" + -+ "FLNHK4J+U7Rzyri7Gbe+gU0HlcftMB0GA1UdDgQWBBRpfiGYkehTnsIzuN2H6AFb\n" + -+ "VCZG8jA7BggrBgEFBQcBAQQvMC0wKwYIKwYBBQUHMAGGH2h0dHA6Ly9vbnNpdGUt\n" + -+ "b2NzcC52ZXJpc2lnbi5jb20wgbUGA1UdIASBrTCBqjA5BgtghkgBhvhFAQcXAjAq\n" + -+ "MCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhMG0GC2CG\n" + -+ "SAGG9wCDfZw/MF4wJwYIKwYBBQUHAgEWG2h0dHBzOi8vd3d3LnN1bi5jb20vcGtp\n" + -+ "L2NwczAzBggrBgEFBQcCAjAnFiVWYWxpZGF0ZWQgRm9yIFN1biBCdXNpbmVzcyBP\n" + -+ "cGVyYXRpb25zMBMGA1UdJQQMMAoGCCsGAQUFBwMDMA0GCSqGSIb3DQEBBQUAA4IB\n" + -+ "AQCG5soy3LFHTFbA8/5SzDRhQoJkHUnOP0t3b6nvX6vZYRp649fje7TQOPRm1pFd\n" + -+ "CZ17J+tggdZwgzTqY4aYpJ00jZaK6pV37q/vgFC/ia6jDs8Q+ly9cEcadBZ5loYg\n" + -+ "cmxp9p57W2MNWx8VA8oFdNtKfF0jUNXbLNtvwGHmgR6YcwLrGN1b6/9Lt9bO3ODl\n" + -+ "FO+ZDwkfQz5ClUVrTx2dGBvKRYFqSG5S8JAfsgYhPvcacUQkA7ExyKvfRXLWVrce\n" + -+ "ZiPpcElbx+819H2sAPvVvparVeAruZGMAtejHZp9NFoowKen5drJp9VxePS4eM49\n" + -+ "3DepB6lKRrNRw66LNQol4ZBz\n" + -+ "-----END CERTIFICATE-----"); -+ -+ -+ // ----------------------------------------------------------------- -+ // Compromised CAs of DigiNotar -+ // -+ // Reported by Fox-IT in its interim report on September 5, 2011, -+ // "DigiNotar Certificate Authority breach 'Operation Black Tulip'". -+ // -+ -+ // -+ // Compromised DigiNotar Cyber CA -+ // -+ -+ // DigiNotar intermediate, cross-signed by CyberTrust -+ // -+ // Subject: EMAILADDRESS=info@diginotar.nl, CN=DigiNotar Cyber CA, -+ // O=DigiNotar, C=NL -+ // Issuer: CN=GTE CyberTrust Global Root, -+ // OU=GTE CyberTrust Solutions, Inc., -+ // O=GTE Corporation, -+ // C=US -+ // Serial: 120000525 (07:27:10:0D) -+ add("info-at-diginotar-cyber-ca-cross-to-gte-cybertrust-0727100D", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFWjCCBMOgAwIBAgIEBycQDTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQGEwJV\n" + -+ "UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU\n" + -+ "cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds\n" + -+ "b2JhbCBSb290MB4XDTA2MTAwNDEwNTQxMVoXDTExMTAwNDEwNTMxMVowYDELMAkG\n" + -+ "A1UEBhMCTkwxEjAQBgNVBAoTCURpZ2lOb3RhcjEbMBkGA1UEAxMSRGlnaU5vdGFy\n" + -+ "IEN5YmVyIENBMSAwHgYJKoZIhvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCCAiIw\n" + -+ "DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANLOFQotqF6EZ639vu9Gx8i5z3P8\n" + -+ "9DS5+SxD52ATPXrjss87Z2yQrcC5P4RS8DVC3HTcKDu9UrSnrHJFF8bwieu0qiXy\n" + -+ "XUte0dmHutZ9fPXOMp8QM8WxSrtekTHC0OlBwpFkfglBO9uLCDdqqspS3rU5HsCI\n" + -+ "A6U/i5kTYUO1m4Kz7iBvz6FEouova0CfjytXraFTwoUiaZ2gP1HfC0GRDaXhqKpc\n" + -+ "SQhdvd5wQbEPyWNr0380dAIvNFp4dRxoeoFnivPaQPBgY/SSINcDpj2jHmfEhBtB\n" + -+ "pcmM5r3qSLYFFgizNxJa92E89zhvLpfgb1Y4VNMota0Ubi5LZLUnZbd1JQm2Bz2V\n" + -+ "VgIKgmCyc0XgMyZRdJq51FAc9k1bW1JSE1qmf6cO4ehBVGeYjIfVydNsy9NUkgYJ\n" + -+ "NEH3gW8/nsl8dVWw58Gzd+jDxAA1lUBwEEoF3iW7n1mlZLxHYL9g43aLE1Xd4XR6\n" + -+ "uc8kpmp/3mQiRFhogmoQ+T3lPhu5vfwi9GAEibtVbShV+t6OjRshFNc3izR7Tfay\n" + -+ "shDPM7F9HGKZSMsrbHaWVb8ZDR0fu2WqG46ZtcYokOWCLXhQIJr9eS8kf/CJKWn0\n" + -+ "fc1zvrPtTsHR7VJej/e4142HrbLZG1ES/1az4a80fVykeIgQnp0DxqWqoiRR90kU\n" + -+ "xbHuWUOV36toKDA/AgMBAAGjggGGMIIBgjASBgNVHRMBAf8ECDAGAQH/AgEBMFMG\n" + -+ "A1UdIARMMEowSAYJKwYBBAGxPgEAMDswOQYIKwYBBQUHAgEWLWh0dHA6Ly93d3cu\n" + -+ "cHVibGljLXRydXN0LmNvbS9DUFMvT21uaVJvb3QuaHRtbDAOBgNVHQ8BAf8EBAMC\n" + -+ "AQYwgaAGA1UdIwSBmDCBlYAUpgwdn2H/Bxe1vzhG20Mw1Y6wUgaheaR3MHUxCzAJ\n" + -+ "BgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdU\n" + -+ "RSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVy\n" + -+ "VHJ1c3QgR2xvYmFsIFJvb3SCAgGlMEUGA1UdHwQ+MDwwOqA4oDaGNGh0dHA6Ly93\n" + -+ "d3cucHVibGljLXRydXN0LmNvbS9jZ2ktYmluL0NSTC8yMDE4L2NkcC5jcmwwHQYD\n" + -+ "VR0OBBYEFKv5aN/PSjfXe0WMX3LeQETDZbvCMA0GCSqGSIb3DQEBBQUAA4GBAI9o\n" + -+ "a6VbB7pEZg4cqFwwezPkCiYE/O+eGjjWLqEf0JlHwnVkJP2eOyh2uSYoYZEMbSz4\n" + -+ "BJ98UAHV42mv7xXSRZskCSpmBU8lgcpdvqrBWSeuM46C9990sFWzjvjnN8huqlZE\n" + -+ "9r1TgSOWPbT6MopTZkQloiXGpjwljPDgKAYityZB\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // DigiNotar intermediate, cross-signed by CyberTrust -+ // -+ // Subject: CN=DigiNotar Cyber CA, O=DigiNotar, C=NL -+ // Issuer: CN=GTE CyberTrust Global Root, -+ // OU=GTE CyberTrust Solutions, Inc., -+ // O=GTE Corporation, -+ // C=US -+ // Serial: 120000505 (07:27:0F:F9) -+ add("diginotar-cyber-ca-cross-to-gte-cybertrust-07270FF9", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFODCCBKGgAwIBAgIEBycP+TANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQGEwJV\n" + -+ "UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU\n" + -+ "cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds\n" + -+ "b2JhbCBSb290MB4XDTA2MDkyMDA5NDUzMloXDTEzMDkyMDA5NDQwNlowPjELMAkG\n" + -+ "A1UEBhMCTkwxEjAQBgNVBAoTCURpZ2lOb3RhcjEbMBkGA1UEAxMSRGlnaU5vdGFy\n" + -+ "IEN5YmVyIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0s4VCi2o\n" + -+ "XoRnrf2+70bHyLnPc/z0NLn5LEPnYBM9euOyzztnbJCtwLk/hFLwNULcdNwoO71S\n" + -+ "tKesckUXxvCJ67SqJfJdS17R2Ye61n189c4ynxAzxbFKu16RMcLQ6UHCkWR+CUE7\n" + -+ "24sIN2qqylLetTkewIgDpT+LmRNhQ7WbgrPuIG/PoUSi6i9rQJ+PK1etoVPChSJp\n" + -+ "naA/Ud8LQZENpeGoqlxJCF293nBBsQ/JY2vTfzR0Ai80Wnh1HGh6gWeK89pA8GBj\n" + -+ "9JIg1wOmPaMeZ8SEG0GlyYzmvepItgUWCLM3Elr3YTz3OG8ul+BvVjhU0yi1rRRu\n" + -+ "LktktSdlt3UlCbYHPZVWAgqCYLJzReAzJlF0mrnUUBz2TVtbUlITWqZ/pw7h6EFU\n" + -+ "Z5iMh9XJ02zL01SSBgk0QfeBbz+eyXx1VbDnwbN36MPEADWVQHAQSgXeJbufWaVk\n" + -+ "vEdgv2DjdosTVd3hdHq5zySman/eZCJEWGiCahD5PeU+G7m9/CL0YASJu1VtKFX6\n" + -+ "3o6NGyEU1zeLNHtN9rKyEM8zsX0cYplIyytsdpZVvxkNHR+7Zaobjpm1xiiQ5YIt\n" + -+ "eFAgmv15LyR/8IkpafR9zXO+s+1OwdHtUl6P97jXjYetstkbURL/VrPhrzR9XKR4\n" + -+ "iBCenQPGpaqiJFH3SRTFse5ZQ5Xfq2goMD8CAwEAAaOCAYYwggGCMBIGA1UdEwEB\n" + -+ "/wQIMAYBAf8CAQEwUwYDVR0gBEwwSjBIBgkrBgEEAbE+AQAwOzA5BggrBgEFBQcC\n" + -+ "ARYtaHR0cDovL3d3dy5wdWJsaWMtdHJ1c3QuY29tL0NQUy9PbW5pUm9vdC5odG1s\n" + -+ "MA4GA1UdDwEB/wQEAwIBBjCBoAYDVR0jBIGYMIGVgBSmDB2fYf8HF7W/OEbbQzDV\n" + -+ "jrBSBqF5pHcwdTELMAkGA1UEBhMCVVMxGDAWBgNVBAoTD0dURSBDb3Jwb3JhdGlv\n" + -+ "bjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3QgU29sdXRpb25zLCBJbmMuMSMwIQYD\n" + -+ "VQQDExpHVEUgQ3liZXJUcnVzdCBHbG9iYWwgUm9vdIICAaUwRQYDVR0fBD4wPDA6\n" + -+ "oDigNoY0aHR0cDovL3d3dy5wdWJsaWMtdHJ1c3QuY29tL2NnaS1iaW4vQ1JMLzIw\n" + -+ "MTgvY2RwLmNybDAdBgNVHQ4EFgQUq/lo389KN9d7RYxfct5ARMNlu8IwDQYJKoZI\n" + -+ "hvcNAQEFBQADgYEACcpiD427SuDUejUrBi3RKGG2rAH7g0m8rtQvLYauGYOl1h0T\n" + -+ "4he+/jJ06XoUOMqUXvcpAWlxG5Ea/aO7qh3Ke+IW/aGjDvMMX7LhIDGUK16Sdu36\n" + -+ "6bUjpr8KOwOpb1JgVM1f6bcvfKIn/UGDdbYN+3gm87FF6TKVKho1IZXFonU=\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // DigiNotar intermediate, cross-signed by CyberTrust -+ // -+ // Subject: CN=DigiNotar Cyber CA, O=DigiNotar, C=NL -+ // Issuer: CN=GTE CyberTrust Global Root, -+ // OU=GTE CyberTrust Solutions, Inc., -+ // O=GTE Corporation, -+ // C=US -+ // Serial: 120000515 (07:27:10:03) -+ add("diginotar-cyber-ca-cross-to-gte-cybertrust-07271003", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFODCCBKGgAwIBAgIEBycQAzANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQGEwJV\n" + -+ "UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU\n" + -+ "cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds\n" + -+ "b2JhbCBSb290MB4XDTA2MDkyNzEwNTMzMloXDTExMDkyNzEwNTIzMFowPjELMAkG\n" + -+ "A1UEBhMCTkwxEjAQBgNVBAoTCURpZ2lOb3RhcjEbMBkGA1UEAxMSRGlnaU5vdGFy\n" + -+ "IEN5YmVyIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0s4VCi2o\n" + -+ "XoRnrf2+70bHyLnPc/z0NLn5LEPnYBM9euOyzztnbJCtwLk/hFLwNULcdNwoO71S\n" + -+ "tKesckUXxvCJ67SqJfJdS17R2Ye61n189c4ynxAzxbFKu16RMcLQ6UHCkWR+CUE7\n" + -+ "24sIN2qqylLetTkewIgDpT+LmRNhQ7WbgrPuIG/PoUSi6i9rQJ+PK1etoVPChSJp\n" + -+ "naA/Ud8LQZENpeGoqlxJCF293nBBsQ/JY2vTfzR0Ai80Wnh1HGh6gWeK89pA8GBj\n" + -+ "9JIg1wOmPaMeZ8SEG0GlyYzmvepItgUWCLM3Elr3YTz3OG8ul+BvVjhU0yi1rRRu\n" + -+ "LktktSdlt3UlCbYHPZVWAgqCYLJzReAzJlF0mrnUUBz2TVtbUlITWqZ/pw7h6EFU\n" + -+ "Z5iMh9XJ02zL01SSBgk0QfeBbz+eyXx1VbDnwbN36MPEADWVQHAQSgXeJbufWaVk\n" + -+ "vEdgv2DjdosTVd3hdHq5zySman/eZCJEWGiCahD5PeU+G7m9/CL0YASJu1VtKFX6\n" + -+ "3o6NGyEU1zeLNHtN9rKyEM8zsX0cYplIyytsdpZVvxkNHR+7Zaobjpm1xiiQ5YIt\n" + -+ "eFAgmv15LyR/8IkpafR9zXO+s+1OwdHtUl6P97jXjYetstkbURL/VrPhrzR9XKR4\n" + -+ "iBCenQPGpaqiJFH3SRTFse5ZQ5Xfq2goMD8CAwEAAaOCAYYwggGCMBIGA1UdEwEB\n" + -+ "/wQIMAYBAf8CAQEwUwYDVR0gBEwwSjBIBgkrBgEEAbE+AQAwOzA5BggrBgEFBQcC\n" + -+ "ARYtaHR0cDovL3d3dy5wdWJsaWMtdHJ1c3QuY29tL0NQUy9PbW5pUm9vdC5odG1s\n" + -+ "MA4GA1UdDwEB/wQEAwIBBjCBoAYDVR0jBIGYMIGVgBSmDB2fYf8HF7W/OEbbQzDV\n" + -+ "jrBSBqF5pHcwdTELMAkGA1UEBhMCVVMxGDAWBgNVBAoTD0dURSBDb3Jwb3JhdGlv\n" + -+ "bjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3QgU29sdXRpb25zLCBJbmMuMSMwIQYD\n" + -+ "VQQDExpHVEUgQ3liZXJUcnVzdCBHbG9iYWwgUm9vdIICAaUwRQYDVR0fBD4wPDA6\n" + -+ "oDigNoY0aHR0cDovL3d3dy5wdWJsaWMtdHJ1c3QuY29tL2NnaS1iaW4vQ1JMLzIw\n" + -+ "MTgvY2RwLmNybDAdBgNVHQ4EFgQUq/lo389KN9d7RYxfct5ARMNlu8IwDQYJKoZI\n" + -+ "hvcNAQEFBQADgYEAWcyGZhizJlRP1jjNupZey+yZG6oMDW4Z11boriMHbYPCndBE\n" + -+ "bVh07zmPbZsihOw9w/vm5KbVX5CgxUv4Rhzh/20Faixf3P3bpWg0qgzHVVusNVR/\n" + -+ "P50aKkpdK3hp+QLl56e+lWOddSAINIpmcuyDI1hyuzB+GJEASm9tNU/6rs8=\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // -+ // Compromised DigiNotar Root CA -+ // -+ -+ // DigiNotar intermediate, cross-signed by Entrust -+ // -+ // Subject: EMAILADDRESS=info@diginotar.nl, -+ // CN=DigiNotar Root CA, -+ // O=DigiNotar, C=NL -+ // Issuer: CN=Entrust.net Secure Server Certification Authority -+ // OU=(c) 1999 Entrust.net Limited, -+ // OU=www.entrust.net/CPS incorp. by ref. (limits liab.), -+ // O=Entrust.net, -+ // C=US, -+ // Serial: 1184644297 (46:9C:3C:C9) -+ add("info-at-diginotar-root-ca-cross-to-entrust-secure-server-469C3CC9", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFSDCCBLGgAwIBAgIERpw8yTANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzA0\n" + -+ "MjYwNTAwMDBaFw0xMzA4MTQyMDEyMzZaMF8xCzAJBgNVBAYTAk5MMRIwEAYDVQQK\n" + -+ "EwlEaWdpTm90YXIxGjAYBgNVBAMTEURpZ2lOb3RhciBSb290IENBMSAwHgYJKoZI\n" + -+ "hvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + -+ "ADCCAgoCggIBAKywWMEAvdghCAsrmv5uVjAFnxt3kBBBXMMNhxF3joHxynzpjGrt\n" + -+ "OHQ1u9rf+bvACTe0lnOBfTMamDn3k2+Vfz25sXWHulFI6ItwPpUExdi2wxbZiLCx\n" + -+ "hx1w2oa0DxSLes8Q0XQ2ohJ7d4ZKeeZ73wIRaKVOhq40WJskE3hWIiUeAYtLUXH7\n" + -+ "gsxZlmmIWmhTxbkNAjfLS7xmSpB+KgsFB+0WX1WQddhGyRuD4gi+8SPMmR3WKg+D\n" + -+ "IBVYJ4Iu+uIiwkmxuQGBap1tnUB3aHZOISpthECFTnaZfILz87cCWdQmARuO361T\n" + -+ "BtGuGN3isjrL14g4jqxbKbkZ05j5GAPPSIKGZgsbaQ/J6ziIeiYaBUyS1yTUlvKs\n" + -+ "Ui2jR9VS9j/+zoQGcKaqPqLytlY0GFei5IFt58rwatPHkWsCg0F8Fe9rmmRe49A8\n" + -+ "5bHre12G+8vmd0nNo2Xc97mcuOQLX5PPzDAaMhzOHGOVpfnq4XSLnukrqTB7oBgf\n" + -+ "DhgL5Vup09FsHgdnj5FLqYq80maqkwGIspH6MVzVpsFSCAnNCmOi0yKm6KHZOQaX\n" + -+ "9W6NApCMFHs/gM0bnLrEWHIjr7ZWn8Z6QjMpBz+CyeYfBQ3NTCg2i9PIPhzGiO9e\n" + -+ "7olk6R3r2ol+MqZp0d3MiJ/R0MlmIdwGZ8WUepptYkx9zOBkgLKeR46jAgMBAAGj\n" + -+ "ggEmMIIBIjASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMB\n" + -+ "BggrBgEFBQcDAgYIKwYBBQUHAwQwEQYDVR0gBAowCDAGBgRVHSAAMDMGCCsGAQUF\n" + -+ "BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD\n" + -+ "VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9zZXJ2ZXIxLmNy\n" + -+ "bDAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wCwYDVR0PBAQDAgEGMB8G\n" + -+ "A1UdIwQYMBaAFPAXYhNVPbP/CgBr+1CEl/PtYtAaMBkGCSqGSIb2fQdBAAQMMAob\n" + -+ "BFY3LjEDAgCBMA0GCSqGSIb3DQEBBQUAA4GBAI979rBep8tu3TeLunapgsZ0jtXp\n" + -+ "GDFjKWSk87dj1jCyYi+q/GyDyZ6ZQZNRP0sF+6twscq05lClWNy3TROMp7QeuoLO\n" + -+ "G7Utw3OJaswUtp4YglANMRTHEe3g9ltifUXRH5tSuy7u6yi4LD4WTm5ULP6r/g6l\n" + -+ "0CnjXYb0+b1Fmz6U\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // DigiNotar intermediate, cross-signed by Entrust -+ // -+ // Subject: EMAILADDRESS=info@diginotar.nl, -+ // CN=DigiNotar Root CA, -+ // O=DigiNotar, C=NL -+ // Issuer: CN=Entrust.net Secure Server Certification Authority -+ // OU=(c) 1999 Entrust.net Limited, -+ // OU=www.entrust.net/CPS incorp. by ref. (limits liab.), -+ // O=Entrust.net, -+ // C=US, -+ // Serial: 1184640175 (46:9C:2C:AF) -+ add("info-at-diginotar-root-ca-cross-to-entrust-secure-server-469C2CAF", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFSDCCBLGgAwIBAgIERpwsrzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzA3\n" + -+ "MjYxNTU3MzlaFw0xMzA4MjYxNjI3MzlaMF8xCzAJBgNVBAYTAk5MMRIwEAYDVQQK\n" + -+ "EwlEaWdpTm90YXIxGjAYBgNVBAMTEURpZ2lOb3RhciBSb290IENBMSAwHgYJKoZI\n" + -+ "hvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + -+ "ADCCAgoCggIBAKywWMEAvdghCAsrmv5uVjAFnxt3kBBBXMMNhxF3joHxynzpjGrt\n" + -+ "OHQ1u9rf+bvACTe0lnOBfTMamDn3k2+Vfz25sXWHulFI6ItwPpUExdi2wxbZiLCx\n" + -+ "hx1w2oa0DxSLes8Q0XQ2ohJ7d4ZKeeZ73wIRaKVOhq40WJskE3hWIiUeAYtLUXH7\n" + -+ "gsxZlmmIWmhTxbkNAjfLS7xmSpB+KgsFB+0WX1WQddhGyRuD4gi+8SPMmR3WKg+D\n" + -+ "IBVYJ4Iu+uIiwkmxuQGBap1tnUB3aHZOISpthECFTnaZfILz87cCWdQmARuO361T\n" + -+ "BtGuGN3isjrL14g4jqxbKbkZ05j5GAPPSIKGZgsbaQ/J6ziIeiYaBUyS1yTUlvKs\n" + -+ "Ui2jR9VS9j/+zoQGcKaqPqLytlY0GFei5IFt58rwatPHkWsCg0F8Fe9rmmRe49A8\n" + -+ "5bHre12G+8vmd0nNo2Xc97mcuOQLX5PPzDAaMhzOHGOVpfnq4XSLnukrqTB7oBgf\n" + -+ "DhgL5Vup09FsHgdnj5FLqYq80maqkwGIspH6MVzVpsFSCAnNCmOi0yKm6KHZOQaX\n" + -+ "9W6NApCMFHs/gM0bnLrEWHIjr7ZWn8Z6QjMpBz+CyeYfBQ3NTCg2i9PIPhzGiO9e\n" + -+ "7olk6R3r2ol+MqZp0d3MiJ/R0MlmIdwGZ8WUepptYkx9zOBkgLKeR46jAgMBAAGj\n" + -+ "ggEmMIIBIjASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMB\n" + -+ "BggrBgEFBQcDAgYIKwYBBQUHAwQwEQYDVR0gBAowCDAGBgRVHSAAMDMGCCsGAQUF\n" + -+ "BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD\n" + -+ "VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9zZXJ2ZXIxLmNy\n" + -+ "bDAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wCwYDVR0PBAQDAgEGMB8G\n" + -+ "A1UdIwQYMBaAFPAXYhNVPbP/CgBr+1CEl/PtYtAaMBkGCSqGSIb2fQdBAAQMMAob\n" + -+ "BFY3LjEDAgCBMA0GCSqGSIb3DQEBBQUAA4GBAEa6RcDNcEIGUlkDJUY/pWTds4zh\n" + -+ "xbVkp3wSmpwPFhx5fxTyF4HD2L60jl3aqjTB7gPpsL2Pk5QZlNsi3t4UkCV70UOd\n" + -+ "ueJRN3o/LOtk4+bjXY2lC0qTHbN80VMLqPjmaf9ghSA9hwhskdtMgRsgfd90q5QP\n" + -+ "ZFdYf+hthc3m6IcJ\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // -+ // Compromised DigiNotar PKIoverheid CA Organisatie - G2 -+ // -+ -+ // DigiNotar intermediate, cross-signed by the Dutch government -+ // -+ // Subject: CN=DigiNotar PKIoverheid CA Organisatie - G2, -+ // O=DigiNotar B.V., -+ // C=NL -+ // Issuer: CN=Staat der Nederlanden Organisatie CA - G2, -+ // O=Staat der Nederlanden, -+ // C=NL -+ // Serial: 20001983 (01:31:34:bf) -+ add("diginotar-pkioverheid-organisatie-cross-to-nederlanden-013134BF", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIGnDCCBISgAwIBAgIEATE0vzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJO\n" + -+ "TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMTIwMAYDVQQDDClTdGFh\n" + -+ "dCBkZXIgTmVkZXJsYW5kZW4gT3JnYW5pc2F0aWUgQ0EgLSBHMjAeFw0xMDA1MTIw\n" + -+ "ODUxMzhaFw0yMDAzMjMwOTUwMDRaMFoxCzAJBgNVBAYTAk5MMRcwFQYDVQQKDA5E\n" + -+ "aWdpTm90YXIgQi5WLjEyMDAGA1UEAwwpRGlnaU5vdGFyIFBLSW92ZXJoZWlkIENB\n" + -+ "IE9yZ2FuaXNhdGllIC0gRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC\n" + -+ "AQCxExkPJ+Zs1FWGS9DsiYpFkXisR71HK+T8RetPtCZzWzfTw3/2497Xo/gtaMUI\n" + -+ "PkuU1uSHJTZrhLUYdPMoWHMvm2rPvAQe9t7dr/xLqvXbZmIlASWC3vKXWhBu3V2p\n" + -+ "IrEEqSNzOvhxrR3PhETrR9Gvbch8KKvH8jd6dF9fxQIUiqNa4xtsAeNdjtlo1vQJ\n" + -+ "GzLckbUs9SDrjANtJkm4k8SFXdjSm69WaswFM8ygQp40VUSca6DUEtArVM23iQ3l\n" + -+ "9uvo+4UBM096a/GdcjOWDveyhKWlJ8Qn8VFzKXe6Z27+TNy04qGhgS85SY1DOBPO\n" + -+ "0KVcwoc6AGdlQiPxNlkKHaNRyLyjlCox3+M88p0aPASw77EKMBNzttfzo0wBdRSF\n" + -+ "eMDXijlYhVD6LubFvs+LP6+PNtQlCS3SD6xyk/K/i9RQs/kVUJuZ9RTZ+4uRozIm\n" + -+ "JqD43ztggYaDeVsr6xM9KTrBbd29no6H1kquNJcF7hSm9tw4fkrpJFQHPZdoN0Zr\n" + -+ "DceoIa8TVOQJavFNRgrJXfubT73e+7dUy7g4nKc5+2otwHuNq6WnV+xKkoozxeEg\n" + -+ "XHPYkJIrgNUPhhhpfDlPhIa890xb89W0yqDC8DciynlSH1PmqvOQsDvd8ij9rOvF\n" + -+ "BiSgydQvD1j9tZ7sD8+yWdCiBHo4aq5y+73wJWKUCacFCwIDAQABo4IBYTCCAV0w\n" + -+ "SAYDVR0gBEEwPzA9BgRVHSAAMDUwMwYIKwYBBQUHAgEWJ2h0dHA6Ly93d3cuZGln\n" + -+ "aW5vdGFyLm5sL2Nwcy9wa2lvdmVyaGVpZDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud\n" + -+ "DwEB/wQEAwIBBjCBhQYDVR0jBH4wfIAUORCLSZJc22ESIM1JnRqO2pxnQLmhXqRc\n" + -+ "MFoxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4x\n" + -+ "KzApBgNVBAMMIlN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENBIC0gRzKCBACY\n" + -+ "lvQwSQYDVR0fBEIwQDA+oDygOoY4aHR0cDovL2NybC5wa2lvdmVyaGVpZC5ubC9E\n" + -+ "b21PcmdhbmlzYXRpZUxhdGVzdENSTC1HMi5jcmwwHQYDVR0OBBYEFLxdlDvZq3sD\n" + -+ "JXNhwtst7vyrj2WhMA0GCSqGSIb3DQEBCwUAA4ICAQCP/C1Mt9kt1R+978v0t2gX\n" + -+ "dZ1O1ffdnPEqJu2forYcA9VTs+wIzzTi48P0tRYvyMO+19NzqwA2+RpKftZj6V5G\n" + -+ "uqW2jhW3oyrYQx3vXcgfgYWzi/f/PPTZ9EYIP5y8HaDZqEzNJVJOCrEg9x/pQ9lU\n" + -+ "RoETmsBedGwqmDLq/He7DaWiMZgifnx859qkrey3LhoZcfhIUNpDjyyE3cFAJ+O1\n" + -+ "8BVOltT4XOOGKUYr1zsH6zh/yIZXl9PvKjPEF1DVZGlrK2tFXl0vF8paTs/D1zk8\n" + -+ "9TufRrmb5w5Jl53W1eMbD+qPAU6aE5RZCgIHSEsaYKt/T+0L2FUNaG9VnGllFULs\n" + -+ "wNzdbKzDFs4LHVabpMTE0i7gD+JEJytQaaTcYuiKISlCbMwAOpZ2m+9AwKRed4Qy\n" + -+ "bCYqOWauXeO5ubIsaB8empADOfCqs6TMSYsYNOk3yXspx4R8b0QVL+xhWQTJRcui\n" + -+ "1lKifH8pktZKxYtCqNT+6tjHhyMY5J16fXNAUpigrm7jBT8FD+Clxm1N7YM3iJzH\n" + -+ "89xCmmq21yFJNnfy7xhPxXDZnunetyuL9Lx+KN8NQMmFXK6dxTH/0FwOtah+8Okv\n" + -+ "uq+IruW10Vilr5xxpykBkINpN4IFuvwJwQhujHg7wzMCgD9EhQgd31VWCK0shS1d\n" + -+ "sQPhrqp0xaTzTro3mHuCuQ==\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // -+ // Compromised DigiNotar PKIoverheid CA Overheid en Bedrijven -+ // -+ -+ // DigiNotar intermediate, cross-signed by the Dutch government -+ // -+ // Subject: CN=DigiNotar PKIoverheid CA Overheid en Bedrijven, -+ // O=DigiNotar B.V., -+ // C=NL -+ // Issuer: CN=Staat der Nederlanden Overheid CA -+ // O=Staat der Nederlanden, -+ // C=NL -+ // Serial: 20015536 (01:31:69:b0) -+ add("diginotar-pkioverheid-overheid-enb-cross-to-nederlanden-013169B0", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIEiDCCA3CgAwIBAgIEATFpsDANBgkqhkiG9w0BAQUFADBZMQswCQYDVQQGEwJO\n" + -+ "TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSowKAYDVQQDEyFTdGFh\n" + -+ "dCBkZXIgTmVkZXJsYW5kZW4gT3ZlcmhlaWQgQ0EwHhcNMDcwNzA1MDg0MjA3WhcN\n" + -+ "MTUwNzI3MDgzOTQ2WjBfMQswCQYDVQQGEwJOTDEXMBUGA1UEChMORGlnaU5vdGFy\n" + -+ "IEIuVi4xNzA1BgNVBAMTLkRpZ2lOb3RhciBQS0lvdmVyaGVpZCBDQSBPdmVyaGVp\n" + -+ "ZCBlbiBCZWRyaWp2ZW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDc\n" + -+ "vdKnTmoKuzuiheF/AK2+tDBomAfNoHrElM9x+Yo35FPrV3bMi+Zs/u6HVcg+uwQ5\n" + -+ "AKeAeKxbT370vbhUuHE7BzFJOZNUfCA7eSuPu2GQfbGs5h+QLp1FAalkLU3DL7nn\n" + -+ "UNVOKlyrdnY3Rtd57EKZ96LspIlw3Dgrh6aqJOadkiQbvvb91C8ZF3rmMgeUVAVT\n" + -+ "Q+lsvK9Hy7zL/b07RBKB8WtLu+20z6slTxjSzAL8o0+1QjPLWc0J3NNQ/aB2jKx+\n" + -+ "ZopC9q0ckvO2+xRG603XLzDgbe5bNr5EdLcgBVeFTegAGaL2DOauocBC36esgl3H\n" + -+ "aLcY5olLmmv6znn58yynAgMBAAGjggFQMIIBTDBIBgNVHSAEQTA/MD0GBFUdIAAw\n" + -+ "NTAzBggrBgEFBQcCARYnaHR0cDovL3d3dy5kaWdpbm90YXIubmwvY3BzL3BraW92\n" + -+ "ZXJoZWlkMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMIGABgNVHSME\n" + -+ "eTB3gBQLhtYPd6NosftkCcOIblwEHFfpPaFZpFcwVTELMAkGA1UEBhMCTkwxHjAc\n" + -+ "BgNVBAoTFVN0YWF0IGRlciBOZWRlcmxhbmRlbjEmMCQGA1UEAxMdU3RhYXQgZGVy\n" + -+ "IE5lZGVybGFuZGVuIFJvb3QgQ0GCBACYmnkwPQYDVR0fBDYwNDAyoDCgLoYsaHR0\n" + -+ "cDovL2NybC5wa2lvdmVyaGVpZC5ubC9Eb21PdkxhdGVzdENSTC5jcmwwHQYDVR0O\n" + -+ "BBYEFEwIyY128ZjHPt881y91DbF2eZfMMA0GCSqGSIb3DQEBBQUAA4IBAQAMlIca\n" + -+ "v03jheLu19hjeQ5Q38aEW9K72fUxCho1l3TfFPoqDz7toOMI9tVOW6+mriXiRWsi\n" + -+ "D7dUKH6S3o0UbNEc5W50BJy37zRERd/Jgx0ZH8Apad+J1T/CsFNt5U4X5HNhIxMm\n" + -+ "cUP9TFnLw98iqiEr2b+VERqKpOKrp11Lbyn1UtHk0hWxi/7wA8+nfemZhzizDXMU\n" + -+ "5HIs4c71rQZIZPrTKbmi2Lv01QulQERDjqC/zlqlUkxk0xcxYczopIro5Ij76eUv\n" + -+ "BjMzm5RmZrGrUDqhCYF0U1onuabSJc/Tw6f/ltAv6uAejVLpGBwgCkegllYOQJBR\n" + -+ "RKwa/fHuhR/3Qlpl\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // -+ // Compromised DigiNotar PKIoverheid CA Overheid -+ // -+ -+ // DigiNotar intermediate, cross-signed by the Dutch government -+ // -+ // Subject: CN=DigiNotar PKIoverheid CA Overheid -+ // O=DigiNotar B.V., -+ // C=NL -+ // Issuer: CN=Staat der Nederlanden Overheid CA -+ // O=Staat der Nederlanden, -+ // C=NL -+ // Serial: 20006006 (01:31:44:76) -+ add("diginotar-pkioverheid-overheid-cross-to-nederlanden-01314476", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIEezCCA2OgAwIBAgIEATFEdjANBgkqhkiG9w0BAQUFADBZMQswCQYDVQQGEwJO\n" + -+ "TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSowKAYDVQQDEyFTdGFh\n" + -+ "dCBkZXIgTmVkZXJsYW5kZW4gT3ZlcmhlaWQgQ0EwHhcNMDQwNjI0MDgxOTMyWhcN\n" + -+ "MTAwNjIzMDgxNzM2WjBSMQswCQYDVQQGEwJOTDEXMBUGA1UEChMORGlnaU5vdGFy\n" + -+ "IEIuVi4xKjAoBgNVBAMTIURpZ2lOb3RhciBQS0lvdmVyaGVpZCBDQSBPdmVyaGVp\n" + -+ "ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANSlrubta5tlOjVCi/gb\n" + -+ "yLCvRqfBjxG8H594VcKHu0WAYc99SPZF9cycj5mw2GyfQvy/WIrGrL4iyNq1gSqR\n" + -+ "0QA/mTXKZIaPqzpDhdm+VvrKkmjrbZfaQxgMSs3ChtBsjcP9Lc0X1zXZ4Q8nBe3k\n" + -+ "BTp+zehINfmbjoEgXLxsMR5RQ6GxzKjuC04PQpbJQgTIakglKaqYcDDZbEscWgPV\n" + -+ "Hgj/2aoHlj6leW/ThHZ+O41jUguEmBLZA3mu3HrCfrHntb5dPt0ihzSx7GtD/SaX\n" + -+ "5HBLxnP189YuqMk5iRA95CtiSdKauvon/xRKRLNgG6XAz0ctSoY7xLDdiBVU5kJd\n" + -+ "FScCAwEAAaOCAVAwggFMMEgGA1UdIARBMD8wPQYEVR0gADA1MDMGCCsGAQUFBwIB\n" + -+ "FidodHRwOi8vd3d3LmRpZ2lub3Rhci5ubC9jcHMvcGtpb3ZlcmhlaWQwDwYDVR0T\n" + -+ "AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgYAGA1UdIwR5MHeAFAuG1g93o2ix\n" + -+ "+2QJw4huXAQcV+k9oVmkVzBVMQswCQYDVQQGEwJOTDEeMBwGA1UEChMVU3RhYXQg\n" + -+ "ZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g\n" + -+ "Um9vdCBDQYIEAJiaeTA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnBraW92\n" + -+ "ZXJoZWlkLm5sL0RvbU92TGF0ZXN0Q1JMLmNybDAdBgNVHQ4EFgQUvRaYQh2+kdE9\n" + -+ "wpcl4CjXWOC1f+IwDQYJKoZIhvcNAQEFBQADggEBAGhQsCWLiaN2EOhPAW+JQP6o\n" + -+ "XBOrLv5w6joahzBFVn1BiefzmlMKjibqKYxURRvMAsMkh82/MfL8V0w6ugxl81lu\n" + -+ "i42dcxl9cKSVXKMw4bbBzJ2VQI5HTIABwefeNuy/eX6idVwYdt3ajAH7fUA8Q9Cq\n" + -+ "vr6H8B+8mwoEqTVTEVlCSsC/EXsokYEUr06PPzRudKjDmijgj7zFaIioZNc8hk7g\n" + -+ "ufEgrs/tmcNGylrwRHgCXjCRBt2NHlZ08l7A1AGU8HcHlSbG9Un/2q9kVHUkps0D\n" + -+ "gtUaEK+x6jpAu/R8Ojezu/+ZEcwwjI/KOhG+84+ejFmtyEkrUdsAdEdLf/2dKsw=\n" + -+ "-----END CERTIFICATE-----"); -+ -+ // -+ // Compromised DigiNotar Services 1024 CA -+ // -+ -+ // DigiNotar intermediate, cross-signed by the Entrust -+ // -+ // Subject: EMAILADDRESS=info@diginotar.nl, -+ // CN=DigiNotar Services 1024 CA -+ // O=DigiNotar, C=NL -+ // Issuer: CN=Entrust.net Secure Server Certification Authority, -+ // OU=(c) 1999 Entrust.net Limited, -+ // OU=www.entrust.net/CPS incorp. by ref. (limits liab.), -+ // O=Entrust.net, -+ // C=US -+ // Serial: 1184640176 (46:9c:2c:b0) -+ add("diginotar-services-1024-ca-cross-to-entrust-469C2CB0", -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIDzTCCAzagAwIBAgIERpwssDANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzA3\n" + -+ "MjYxNTU5MDBaFw0xMzA4MjYxNjI5MDBaMGgxCzAJBgNVBAYTAk5MMRIwEAYDVQQK\n" + -+ "EwlEaWdpTm90YXIxIzAhBgNVBAMTGkRpZ2lOb3RhciBTZXJ2aWNlcyAxMDI0IENB\n" + -+ "MSAwHgYJKoZIhvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCBnzANBgkqhkiG9w0B\n" + -+ "AQEFAAOBjQAwgYkCgYEA2ptNXTz50eKLxsYIIMXZHkjsZlhneWIrQWP0iY1o2q+4\n" + -+ "lDaLGSSkoJPSmQ+yrS01Tc0vauH5mxkrvAQafi09UmTN8T5nD4ku6PJPrqYIoYX+\n" + -+ "oakJ5sarPkP8r3oDkdqmOaZh7phPGKjTs69mgumfvN1y+QYEvRLZGCTnq5NTi1kC\n" + -+ "AwEAAaOCASYwggEiMBIGA1UdEwEB/wQIMAYBAf8CAQAwJwYDVR0lBCAwHgYIKwYB\n" + -+ "BQUHAwEGCCsGAQUFBwMCBggrBgEFBQcDBDARBgNVHSAECjAIMAYGBFUdIAAwMwYI\n" + -+ "KwYBBQUHAQEEJzAlMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5lbnRydXN0Lm5l\n" + -+ "dDAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8vY3JsLmVudHJ1c3QubmV0L3NlcnZl\n" + -+ "cjEuY3JsMB0GA1UdDgQWBBT+3JRJDG/vXH/G8RKZTxZJrfuCZTALBgNVHQ8EBAMC\n" + -+ "AQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0BowGQYJKoZIhvZ9B0EA\n" + -+ "BAwwChsEVjcuMQMCAIEwDQYJKoZIhvcNAQEFBQADgYEAY3RqN6k/lpxmyFisCcnv\n" + -+ "9WWUf6MCxDgxvV0jh+zUVrLJsm7kBQb87PX6iHBZ1O7m3bV6oKNgLwIMq94SXa/w\n" + -+ "NUuqikeRGvWFLELHHe+VQ7NeuJWTpdrFKKqtci0xrZlrbP+MISevrZqRK8fdWMNu\n" + -+ "B8WfedLHjFW/TMcnXlEWKz4=\n" + -+ "-----END CERTIFICATE-----"); -+ -+ } -+} -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/validator/SimpleValidator.java jdk7u3/jdk/src/share/classes/sun/security/validator/SimpleValidator.java ---- jdk/src/share/classes/sun/security/validator/SimpleValidator.java 2012-04-17 17:39:21.000000000 -0400 -+++ jdk/src/share/classes/sun/security/validator/SimpleValidator.java 2012-04-17 17:48:58.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. 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 -@@ -41,6 +41,7 @@ - import sun.security.util.ObjectIdentifier; - - import sun.security.provider.certpath.AlgorithmChecker; -+import sun.security.provider.certpath.UntrustedChecker; - - /** - * A simple validator implementation. It is based on code from the JSSE -@@ -137,6 +138,9 @@ - date = new Date(); - } - -+ // create distrusted certificates checker -+ UntrustedChecker untrustedChecker = new UntrustedChecker(); -+ - // create default algorithm constraints checker - TrustAnchor anchor = new TrustAnchor(chain[chain.length - 1], null); - AlgorithmChecker defaultAlgChecker = new AlgorithmChecker(anchor); -@@ -154,6 +158,17 @@ - X509Certificate issuerCert = chain[i + 1]; - X509Certificate cert = chain[i]; - -+ // check untrusted certificate -+ try { -+ // Untrusted checker does not care about the unresolved -+ // critical extensions. -+ untrustedChecker.check(cert, Collections.<String>emptySet()); -+ } catch (CertPathValidatorException cpve) { -+ throw new ValidatorException( -+ "Untrusted certificate: " + cert.getSubjectX500Principal(), -+ ValidatorException.T_UNTRUSTED_CERT, cert, cpve); -+ } -+ - // check certificate algorithm - try { - // Algorithm checker does not care about the unresolved -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/classes/sun/security/validator/ValidatorException.java jdk7u3/jdk/src/share/classes/sun/security/validator/ValidatorException.java ---- jdk/src/share/classes/sun/security/validator/ValidatorException.java 2012-04-17 17:39:21.000000000 -0400 -+++ jdk/src/share/classes/sun/security/validator/ValidatorException.java 2012-04-17 17:48:58.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. 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 -@@ -58,6 +58,9 @@ - public final static Object T_ALGORITHM_DISABLED = - "Certificate signature algorithm disabled"; - -+ public final static Object T_UNTRUSTED_CERT = -+ "Untrusted certificate"; -+ - private Object type; - private X509Certificate cert; - -diff -uNr -x '.hg*' jdk7u2/jdk/src/share/native/java/util/zip/zip_util.c jdk7u3/jdk/src/share/native/java/util/zip/zip_util.c ---- jdk/src/share/native/java/util/zip/zip_util.c 2012-04-17 17:39:25.000000000 -0400 -+++ jdk/src/share/native/java/util/zip/zip_util.c 2012-04-17 17:49:02.000000000 -0400 -@@ -521,7 +521,7 @@ - { - jint count = 0; - ptrdiff_t i; -- for (i = 0; i + CENHDR < end - beg; i += CENSIZE(beg + i)) -+ for (i = 0; i + CENHDR <= end - beg; i += CENSIZE(beg + i)) - count++; - return count; - } -diff -uNr -x '.hg*' jdk7u2/jdk/src/windows/classes/sun/java2d/d3d/D3DRenderer.java jdk7u3/jdk/src/windows/classes/sun/java2d/d3d/D3DRenderer.java ---- jdk/src/windows/classes/sun/java2d/d3d/D3DRenderer.java 2012-04-17 17:39:31.000000000 -0400 -+++ jdk/src/windows/classes/sun/java2d/d3d/D3DRenderer.java 2012-04-17 17:49:07.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. 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 -@@ -27,6 +27,7 @@ - - import java.awt.Transparency; - import java.awt.geom.Path2D; -+import sun.java2d.InvalidPipeException; - import sun.java2d.SunGraphics2D; - import sun.java2d.loops.GraphicsPrimitive; - import sun.java2d.pipe.BufferedPaints; -@@ -47,7 +48,12 @@ - int ctxflags = - sg2d.paint.getTransparency() == Transparency.OPAQUE ? - D3DContext.SRC_IS_OPAQUE : D3DContext.NO_CONTEXT_FLAGS; -- D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData; -+ D3DSurfaceData dstData; -+ try { -+ dstData = (D3DSurfaceData)sg2d.surfaceData; -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - D3DContext.validateContext(dstData, dstData, - sg2d.getCompClip(), sg2d.composite, - null, sg2d.paint, sg2d, ctxflags); -@@ -56,7 +62,12 @@ - @Override - protected void validateContextAA(SunGraphics2D sg2d) { - int ctxflags = D3DContext.NO_CONTEXT_FLAGS; -- D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData; -+ D3DSurfaceData dstData; -+ try { -+ dstData = (D3DSurfaceData)sg2d.surfaceData; -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - D3DContext.validateContext(dstData, dstData, - sg2d.getCompClip(), sg2d.composite, - null, sg2d.paint, sg2d, ctxflags); -@@ -70,7 +81,12 @@ - int ctxflags = - sg2d.surfaceData.getTransparency() == Transparency.OPAQUE ? - D3DContext.SRC_IS_OPAQUE : D3DContext.NO_CONTEXT_FLAGS; -- D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData; -+ D3DSurfaceData dstData; -+ try { -+ dstData = (D3DSurfaceData)sg2d.surfaceData; -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - D3DContext.validateContext(dstData, dstData, - sg2d.getCompClip(), sg2d.composite, - null, null, null, ctxflags); -diff -uNr -x '.hg*' jdk7u2/jdk/src/windows/classes/sun/java2d/windows/GDIRenderer.java jdk7u3/jdk/src/windows/classes/sun/java2d/windows/GDIRenderer.java ---- jdk/src/windows/classes/sun/java2d/windows/GDIRenderer.java 2012-04-17 17:39:31.000000000 -0400 -+++ jdk/src/windows/classes/sun/java2d/windows/GDIRenderer.java 2012-04-17 17:49:07.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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 -@@ -29,6 +29,7 @@ - import java.awt.Shape; - import java.awt.geom.Path2D; - import java.awt.geom.PathIterator; -+import sun.java2d.InvalidPipeException; - import sun.java2d.SunGraphics2D; - import sun.java2d.SurfaceData; - import sun.java2d.pipe.Region; -@@ -45,7 +46,7 @@ - PixelFillPipe, - ShapeDrawPipe - { -- native void doDrawLine(SurfaceData sData, -+ native void doDrawLine(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x1, int y1, int x2, int y2); - -@@ -54,24 +55,32 @@ - { - int transx = sg2d.transX; - int transy = sg2d.transY; -- doDrawLine(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x1+transx, y1+transy, x2+transx, y2+transy); -+ try { -+ doDrawLine((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x1+transx, y1+transy, x2+transx, y2+transy); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doDrawRect(SurfaceData sData, -+ native void doDrawRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h); - - public void drawRect(SunGraphics2D sg2d, - int x, int y, int width, int height) - { -- doDrawRect(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height); -+ try { -+ doDrawRect((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doDrawRoundRect(SurfaceData sData, -+ native void doDrawRoundRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int arcW, int arcH); -@@ -80,25 +89,33 @@ - int x, int y, int width, int height, - int arcWidth, int arcHeight) - { -- doDrawRoundRect(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height, -- arcWidth, arcHeight); -+ try { -+ doDrawRoundRect((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height, -+ arcWidth, arcHeight); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doDrawOval(SurfaceData sData, -+ native void doDrawOval(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h); - - public void drawOval(SunGraphics2D sg2d, - int x, int y, int width, int height) - { -- doDrawOval(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height); -+ try { -+ doDrawOval((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doDrawArc(SurfaceData sData, -+ native void doDrawArc(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int angleStart, int angleExtent); -@@ -107,13 +124,17 @@ - int x, int y, int width, int height, - int startAngle, int arcAngle) - { -- doDrawArc(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height, -- startAngle, arcAngle); -+ try { -+ doDrawArc((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height, -+ startAngle, arcAngle); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doDrawPoly(SurfaceData sData, -+ native void doDrawPoly(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int transx, int transy, - int[] xpoints, int[] ypoints, -@@ -123,33 +144,45 @@ - int xpoints[], int ypoints[], - int npoints) - { -- doDrawPoly(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- sg2d.transX, sg2d.transY, xpoints, ypoints, npoints, false); -+ try { -+ doDrawPoly((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ sg2d.transX, sg2d.transY, xpoints, ypoints, npoints, false); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - - public void drawPolygon(SunGraphics2D sg2d, - int xpoints[], int ypoints[], - int npoints) - { -- doDrawPoly(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- sg2d.transX, sg2d.transY, xpoints, ypoints, npoints, true); -+ try { -+ doDrawPoly((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ sg2d.transX, sg2d.transY, xpoints, ypoints, npoints, true); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doFillRect(SurfaceData sData, -+ native void doFillRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h); - - public void fillRect(SunGraphics2D sg2d, - int x, int y, int width, int height) - { -- doFillRect(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height); -+ try { -+ doFillRect((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doFillRoundRect(SurfaceData sData, -+ native void doFillRoundRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int arcW, int arcH); -@@ -158,25 +191,33 @@ - int x, int y, int width, int height, - int arcWidth, int arcHeight) - { -- doFillRoundRect(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height, -- arcWidth, arcHeight); -+ try { -+ doFillRoundRect((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height, -+ arcWidth, arcHeight); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doFillOval(SurfaceData sData, -+ native void doFillOval(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h); - - public void fillOval(SunGraphics2D sg2d, - int x, int y, int width, int height) - { -- doFillOval(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height); -+ try { -+ doFillOval((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doFillArc(SurfaceData sData, -+ native void doFillArc(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int angleStart, int angleExtent); -@@ -185,13 +226,17 @@ - int x, int y, int width, int height, - int startAngle, int arcAngle) - { -- doFillArc(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- x+sg2d.transX, y+sg2d.transY, width, height, -- startAngle, arcAngle); -+ try { -+ doFillArc((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ x+sg2d.transX, y+sg2d.transY, width, height, -+ startAngle, arcAngle); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doFillPoly(SurfaceData sData, -+ native void doFillPoly(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int transx, int transy, - int[] xpoints, int[] ypoints, -@@ -201,12 +246,16 @@ - int xpoints[], int ypoints[], - int npoints) - { -- doFillPoly(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- sg2d.transX, sg2d.transY, xpoints, ypoints, npoints); -+ try { -+ doFillPoly((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ sg2d.transX, sg2d.transY, xpoints, ypoints, npoints); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - -- native void doShape(SurfaceData sData, -+ native void doShape(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int transX, int transY, - Path2D.Float p2df, boolean isfill); -@@ -228,9 +277,13 @@ - transX = 0; - transY = 0; - } -- doShape(sg2d.surfaceData, -- sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -- transX, transY, p2df, isfill); -+ try { -+ doShape((GDIWindowSurfaceData)sg2d.surfaceData, -+ sg2d.getCompClip(), sg2d.composite, sg2d.eargb, -+ transX, transY, p2df, isfill); -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - } - - // REMIND: This is just a hack to get WIDE lines to honor the -@@ -239,7 +292,12 @@ - // method that could be filled by the doShape method more quickly. - public void doFillSpans(SunGraphics2D sg2d, SpanIterator si) { - int box[] = new int[4]; -- SurfaceData sd = sg2d.surfaceData; -+ GDIWindowSurfaceData sd; -+ try { -+ sd = (GDIWindowSurfaceData)sg2d.surfaceData; -+ } catch (ClassCastException e) { -+ throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); -+ } - Region clip = sg2d.getCompClip(); - Composite comp = sg2d.composite; - int eargb = sg2d.eargb; -@@ -268,7 +326,7 @@ - doShape(sg2d, s, true); - } - -- public native void devCopyArea(SurfaceData sData, -+ public native void devCopyArea(GDIWindowSurfaceData sData, - int srcx, int srcy, - int dx, int dy, - int w, int h); -@@ -278,21 +336,21 @@ - } - - public static class Tracer extends GDIRenderer { -- void doDrawLine(SurfaceData sData, -+ void doDrawLine(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x1, int y1, int x2, int y2) - { - GraphicsPrimitive.tracePrimitive("GDIDrawLine"); - super.doDrawLine(sData, clip, comp, color, x1, y1, x2, y2); - } -- void doDrawRect(SurfaceData sData, -+ void doDrawRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h) - { - GraphicsPrimitive.tracePrimitive("GDIDrawRect"); - super.doDrawRect(sData, clip, comp, color, x, y, w, h); - } -- void doDrawRoundRect(SurfaceData sData, -+ void doDrawRoundRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int arcW, int arcH) -@@ -301,14 +359,14 @@ - super.doDrawRoundRect(sData, clip, comp, color, - x, y, w, h, arcW, arcH); - } -- void doDrawOval(SurfaceData sData, -+ void doDrawOval(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h) - { - GraphicsPrimitive.tracePrimitive("GDIDrawOval"); - super.doDrawOval(sData, clip, comp, color, x, y, w, h); - } -- void doDrawArc(SurfaceData sData, -+ void doDrawArc(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int angleStart, int angleExtent) -@@ -317,7 +375,7 @@ - super.doDrawArc(sData, clip, comp, color, x, y, w, h, - angleStart, angleExtent); - } -- void doDrawPoly(SurfaceData sData, -+ void doDrawPoly(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int transx, int transy, - int[] xpoints, int[] ypoints, -@@ -327,14 +385,14 @@ - super.doDrawPoly(sData, clip, comp, color, transx, transy, - xpoints, ypoints, npoints, isclosed); - } -- void doFillRect(SurfaceData sData, -+ void doFillRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h) - { - GraphicsPrimitive.tracePrimitive("GDIFillRect"); - super.doFillRect(sData, clip, comp, color, x, y, w, h); - } -- void doFillRoundRect(SurfaceData sData, -+ void doFillRoundRect(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int arcW, int arcH) -@@ -343,14 +401,14 @@ - super.doFillRoundRect(sData, clip, comp, color, - x, y, w, h, arcW, arcH); - } -- void doFillOval(SurfaceData sData, -+ void doFillOval(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h) - { - GraphicsPrimitive.tracePrimitive("GDIFillOval"); - super.doFillOval(sData, clip, comp, color, x, y, w, h); - } -- void doFillArc(SurfaceData sData, -+ void doFillArc(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int x, int y, int w, int h, - int angleStart, int angleExtent) -@@ -359,7 +417,7 @@ - super.doFillArc(sData, clip, comp, color, x, y, w, h, - angleStart, angleExtent); - } -- void doFillPoly(SurfaceData sData, -+ void doFillPoly(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int transx, int transy, - int[] xpoints, int[] ypoints, -@@ -369,7 +427,7 @@ - super.doFillPoly(sData, clip, comp, color, transx, transy, - xpoints, ypoints, npoints); - } -- void doShape(SurfaceData sData, -+ void doShape(GDIWindowSurfaceData sData, - Region clip, Composite comp, int color, - int transX, int transY, - Path2D.Float p2df, boolean isfill) -@@ -380,7 +438,7 @@ - super.doShape(sData, clip, comp, color, - transX, transY, p2df, isfill); - } -- public void devCopyArea(SurfaceData sData, -+ public void devCopyArea(GDIWindowSurfaceData sData, - int srcx, int srcy, - int dx, int dy, - int w, int h) -diff -uNr -x '.hg*' jdk7u2/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp jdk7u3/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp ---- jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp 2012-04-17 17:39:32.000000000 -0400 -+++ jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp 2012-04-17 17:49:08.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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 -@@ -117,7 +117,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doDrawLine -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doDrawLine -@@ -164,7 +164,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doDrawRect -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doDrawRect -@@ -209,7 +209,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doDrawRoundRect -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doDrawRoundRect -@@ -253,7 +253,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doDrawOval -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doDrawOval -@@ -291,7 +291,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doDrawArc -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doDrawArc -@@ -347,7 +347,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doDrawPoly -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;III[I[IIZ)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;III[I[IIZ)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doDrawPoly -@@ -412,7 +412,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doFillRect -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doFillRect -@@ -445,7 +445,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doFillRoundRect -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doFillRoundRect -@@ -488,7 +488,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doFillOval -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doFillOval -@@ -555,7 +555,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doFillArc -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;IIIIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doFillArc -@@ -615,7 +615,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doFillPoly -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;III[I[II)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region;Ljava/awt/Composite;III[I[II)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_doFillPoly -@@ -680,7 +680,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: doShape -- * Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/pipe/Region; -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;Lsun/java2d/pipe/Region; - * Ljava/awt/Composite;IIILjava/awt/geom/Path2D.Float;Z)V - */ - JNIEXPORT void JNICALL -@@ -863,7 +863,7 @@ - /* - * Class: sun_java2d_windows_GDIRenderer - * Method: devCopyArea -- * Signature: (Lsun/awt/windows/SurfaceData;IIIIII)V -+ * Signature: (Lsun/java2d/windows/GDIWindowSurfaceData;IIIIII)V - */ - JNIEXPORT void JNICALL - Java_sun_java2d_windows_GDIRenderer_devCopyArea -diff -uNr -x '.hg*' jdk7u2/jdk/test/java/io/Serializable/expectedStackTrace/ExpectedStackTrace.java jdk7u3/jdk/test/java/io/Serializable/expectedStackTrace/ExpectedStackTrace.java ---- jdk/test/java/io/Serializable/expectedStackTrace/ExpectedStackTrace.java 2012-04-17 17:39:36.000000000 -0400 -+++ jdk/test/java/io/Serializable/expectedStackTrace/ExpectedStackTrace.java 2012-04-17 17:49:13.000000000 -0400 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. 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 -@@ -22,7 +22,7 @@ - */ - - /* @test -- * @bug 6317435 -+ * @bug 6317435 7110700 - * @summary Verify that stack trace contains a proper cause of - * InvalidClassException (methods: checkSerialize, - * checkDeserialize or checkDefaultSerialize) -@@ -59,7 +59,7 @@ - private static final String SER_METHOD_NAME = "checkSerializable"; - - public static final void main(String[] args) throws Exception { -- System.err.println("\nRegression test for CR6317435"); -+ System.err.println("\nRegression test for CRs 6317435, 7110700"); - checkSerializable(getObject()); - } - -@@ -99,9 +99,12 @@ - } - } - if (found) { -+ if (ex.getCause() != null) { -+ throw new Error("\nTest for CR 7110700 FAILED"); -+ } - System.err.println("\nTEST PASSED"); - } else { -- throw new Error(); -+ throw new Error("\nTest for CR 6317435 FAILED"); - } - } - } -diff -uNr -x '.hg*' jdk7u2/jdk/test/java/util/zip/ZipFile/VmCrash.java jdk7u3/jdk/test/java/util/zip/ZipFile/VmCrash.java ---- jdk/test/java/util/zip/ZipFile/VmCrash.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/test/java/util/zip/ZipFile/VmCrash.java 2012-04-17 17:49:21.000000000 -0400 -@@ -0,0 +1,47 @@ -+/* -+ * Copyright (c) 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* @test -+ @bug 7118283 -+ @summary Test if a corrupted zip file crashes VM -+ */ -+ -+import java.util.zip.*; -+import java.io.*; -+import java.util.*; -+ -+public class VmCrash { -+ public static void main(String[] argv) throws Exception { -+ try { -+ ZipFile zf = new ZipFile(new File(System.getProperty("test.src","."), -+ "vmcrash.zip")); -+ for (Enumeration e = zf.entries(); e.hasMoreElements();) { -+ System.out.println(e.nextElement()); -+ } -+ throw new RuntimeException("Corrupted zip read without exception"); -+ } catch (ZipException ex) { -+ System.out.println("expected ZipException:"); -+ //ex.printStackTrace(); -+ } -+ } -+} -Files jdk7u2/jdk/test/java/util/zip/ZipFile/vmcrash.zip and jdk7u3/jdk/test/java/util/zip/ZipFile/vmcrash.zip differ -diff -uNr -x '.hg*' jdk7u2/jdk/test/javax/sound/sampled/DataLine/DataLine_ArrayIndexOutOfBounds.java jdk7u3/jdk/test/javax/sound/sampled/DataLine/DataLine_ArrayIndexOutOfBounds.java ---- jdk/test/javax/sound/sampled/DataLine/DataLine_ArrayIndexOutOfBounds.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/test/javax/sound/sampled/DataLine/DataLine_ArrayIndexOutOfBounds.java 2012-04-17 17:49:23.000000000 -0400 -@@ -0,0 +1,226 @@ -+/** -+ * @test -+ * @bug 7088367 -+ * @summary SourceDataLine.write and TargetDataLine.read don't throw ArrayIndexOutOfBoundsException -+ * @author Alex Menkov -+ */ -+ -+import javax.sound.sampled.AudioSystem; -+import javax.sound.sampled.DataLine; -+import javax.sound.sampled.Line; -+import javax.sound.sampled.LineUnavailableException; -+import javax.sound.sampled.Mixer; -+import javax.sound.sampled.SourceDataLine; -+import javax.sound.sampled.TargetDataLine; -+ -+public class DataLine_ArrayIndexOutOfBounds { -+ -+ static int total = 0; -+ static int failed = 0; -+ -+ // shared buffer for all tests -+ static final byte[] buffer = new byte[5000000]; -+ -+ // the class describes different test scenarios (buffer properties) -+ static abstract class Scenario { -+ abstract int getBufferOffset(DataLine line); -+ abstract int getBufferLength(DataLine line); -+ } -+ -+ // scenarios to tests -+ static Scenario[] scenarios = new Scenario[]{ -+ new Scenario() { -+ public String toString() { -+ return "offset is near Integer.MAX_VALUE"; -+ } -+ public int getBufferOffset(DataLine line) { -+ return Integer.MAX_VALUE - 4096; -+ } -+ public int getBufferLength(DataLine line) { -+ return 65536; -+ } -+ }, -+ new Scenario() { -+ public String toString() { -+ return "offset is less than buffer.length, length is large"; -+ } -+ int getBufferOffset(DataLine line) { -+ return buffer.length / 10; -+ } -+ int getBufferLength(DataLine line) { -+ return Integer.MAX_VALUE - getBufferOffset(line) + 4096; -+ } -+ } -+ }; -+ -+ public static void main(String[] args) throws Exception { -+ Mixer.Info[] infos = AudioSystem.getMixerInfo(); -+ log("" + infos.length + " mixers detected"); -+ for (int i=0; i<infos.length; i++) { -+ Mixer mixer = AudioSystem.getMixer(infos[i]); -+ log("Mixer " + (i+1) + ": " + infos[i]); -+ try { -+ mixer.open(); -+ for (Scenario scenario: scenarios) { -+ testSDL(mixer, scenario); -+ testTDL(mixer, scenario); -+ } -+ mixer.close(); -+ } catch (LineUnavailableException ex) { -+ log("LineUnavailableException: " + ex); -+ } -+ } -+ if (failed == 0) { -+ log("PASSED (" + total + " tests)"); -+ } else { -+ log("FAILED (" + failed + " of " + total + " tests)"); -+ throw new Exception("Test FAILED"); -+ } -+ } -+ -+ final static int STOPPER_DELAY = 5000; // 1 sec -+ -+ static class AsyncLineStopper implements Runnable { -+ private final DataLine line; -+ private final long delayMS; // delay before stop the line -+ private final Thread thread; -+ private final Object readyEvent = new Object(); -+ private final Object startEvent = new Object(); -+ -+ public AsyncLineStopper(DataLine line, long delayMS) { -+ this.line = line; -+ this.delayMS = delayMS; -+ thread = new Thread(this); -+ thread.setDaemon(true); -+ // starts the thread and waits until it becomes ready -+ synchronized (readyEvent) { -+ thread.start(); -+ try { -+ readyEvent.wait(); -+ } catch (InterruptedException ex) { } -+ } -+ } -+ -+ // makes the delay and then stops the line -+ public void schedule() { -+ synchronized(startEvent) { -+ startEvent.notifyAll(); -+ } -+ } -+ -+ // force stop/close the line -+ public void force() { -+ thread.interrupt(); -+ try { -+ thread.join(); -+ } catch (InterruptedException ex) { -+ log("join exception: " + ex); -+ } -+ } -+ -+ // Runnable implementation -+ public void run() { -+ try { -+ synchronized(readyEvent) { -+ readyEvent.notifyAll(); -+ } -+ synchronized(startEvent) { -+ startEvent.wait(); -+ } -+ // delay -+ Thread.sleep(delayMS); -+ } catch (InterruptedException ex) { -+ log(" AsyncLineStopper has been interrupted: " + ex); -+ } -+ // and flush -+ log(" stop..."); -+ line.stop(); -+ log(" close..."); -+ line.close(); -+ } -+ } -+ -+ static void testSDL(Mixer mixer, Scenario scenario) { -+ log(" Testing SDL (scenario: " + scenario + ")..."); -+ Line.Info linfo = new Line.Info(SourceDataLine.class); -+ SourceDataLine line = null; -+ try { -+ line = (SourceDataLine)mixer.getLine(linfo); -+ log(" got line: " + line); -+ log(" open..."); -+ line.open(); -+ } catch (IllegalArgumentException ex) { -+ log(" unsupported (IllegalArgumentException)"); -+ return; -+ } catch (LineUnavailableException ex) { -+ log(" unavailable: " + ex); -+ return; -+ } -+ -+ total++; -+ -+ log(" start..."); -+ line.start(); -+ -+ AsyncLineStopper lineStopper = new AsyncLineStopper(line, STOPPER_DELAY); -+ int offset = scenario.getBufferOffset(line); -+ int len = scenario.getBufferLength(line); -+ // ensure len represents integral number of frames -+ len -= len % line.getFormat().getFrameSize(); -+ -+ log(" write..."); -+ lineStopper.schedule(); -+ try { -+ line.write(buffer, offset, len); -+ log(" ERROR: didn't get ArrayIndexOutOfBoundsException"); -+ failed++; -+ } catch (ArrayIndexOutOfBoundsException ex) { -+ log(" OK: got ArrayIndexOutOfBoundsException: " + ex); -+ } -+ lineStopper.force(); -+ } -+ -+ static void testTDL(Mixer mixer, Scenario scenario) { -+ log(" Testing TDL (scenario: " + scenario + ")..."); -+ Line.Info linfo = new Line.Info(TargetDataLine.class); -+ TargetDataLine line = null; -+ try { -+ line = (TargetDataLine)mixer.getLine(linfo); -+ log(" got line: " + line); -+ log(" open..."); -+ line.open(); -+ } catch (IllegalArgumentException ex) { -+ log(" unsupported (IllegalArgumentException)"); -+ return; -+ } catch (LineUnavailableException ex) { -+ log(" unavailable: " + ex); -+ return; -+ } -+ -+ total++; -+ -+ log(" start..."); -+ line.start(); -+ -+ AsyncLineStopper lineStopper = new AsyncLineStopper(line, STOPPER_DELAY); -+ int offset = scenario.getBufferOffset(line); -+ int len = scenario.getBufferLength(line); -+ // ensure len represents integral number of frames -+ len -= len % line.getFormat().getFrameSize(); -+ -+ log(" read..."); -+ try { -+ line.read(buffer, offset, len); -+ log(" ERROR: didn't get ArrayIndexOutOfBoundsException"); -+ failed++; -+ } catch (ArrayIndexOutOfBoundsException ex) { -+ log(" OK: got ArrayIndexOutOfBoundsException: " + ex); -+ } -+ lineStopper.force(); -+ } -+ -+ static void log(String s) { -+ System.out.println(s); -+ System.out.flush(); -+ } -+} -diff -uNr -x '.hg*' jdk7u2/jdk/test/sun/security/provider/certpath/X509CertPath/ForwardBuildCompromised.java jdk7u3/jdk/test/sun/security/provider/certpath/X509CertPath/ForwardBuildCompromised.java ---- jdk/test/sun/security/provider/certpath/X509CertPath/ForwardBuildCompromised.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/test/sun/security/provider/certpath/X509CertPath/ForwardBuildCompromised.java 2012-04-17 17:49:27.000000000 -0400 -@@ -0,0 +1,312 @@ -+/* -+ * Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* -+ * @test -+ * @bug 7123519 -+ * @summary Problem with java/classes_security -+ */ -+ -+import java.net.*; -+import java.util.*; -+import java.io.*; -+import javax.net.ssl.*; -+import java.security.KeyStore; -+import java.security.cert.*; -+import java.security.spec.*; -+import java.security.interfaces.*; -+ -+public class ForwardBuildCompromised { -+ // DigiNotar Root CA, untrusted root certificate -+ static String trustedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1\n" + -+ "MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE\n" + -+ "ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j\n" + -+ "b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\n" + -+ "bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg\n" + -+ "U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA\n" + -+ "A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/\n" + -+ "I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3\n" + -+ "wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC\n" + -+ "AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb\n" + -+ "oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5\n" + -+ "BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p\n" + -+ "dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk\n" + -+ "MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp\n" + -+ "b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\n" + -+ "dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0\n" + -+ "MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi\n" + -+ "E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa\n" + -+ "MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI\n" + -+ "hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN\n" + -+ "95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd\n" + -+ "2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, untrusted cross-certificate -+ static String untrustedCrossCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFSDCCBLGgAwIBAgIERpwsrzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzA3\n" + -+ "MjYxNTU3MzlaFw0xMzA4MjYxNjI3MzlaMF8xCzAJBgNVBAYTAk5MMRIwEAYDVQQK\n" + -+ "EwlEaWdpTm90YXIxGjAYBgNVBAMTEURpZ2lOb3RhciBSb290IENBMSAwHgYJKoZI\n" + -+ "hvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + -+ "ADCCAgoCggIBAKywWMEAvdghCAsrmv5uVjAFnxt3kBBBXMMNhxF3joHxynzpjGrt\n" + -+ "OHQ1u9rf+bvACTe0lnOBfTMamDn3k2+Vfz25sXWHulFI6ItwPpUExdi2wxbZiLCx\n" + -+ "hx1w2oa0DxSLes8Q0XQ2ohJ7d4ZKeeZ73wIRaKVOhq40WJskE3hWIiUeAYtLUXH7\n" + -+ "gsxZlmmIWmhTxbkNAjfLS7xmSpB+KgsFB+0WX1WQddhGyRuD4gi+8SPMmR3WKg+D\n" + -+ "IBVYJ4Iu+uIiwkmxuQGBap1tnUB3aHZOISpthECFTnaZfILz87cCWdQmARuO361T\n" + -+ "BtGuGN3isjrL14g4jqxbKbkZ05j5GAPPSIKGZgsbaQ/J6ziIeiYaBUyS1yTUlvKs\n" + -+ "Ui2jR9VS9j/+zoQGcKaqPqLytlY0GFei5IFt58rwatPHkWsCg0F8Fe9rmmRe49A8\n" + -+ "5bHre12G+8vmd0nNo2Xc97mcuOQLX5PPzDAaMhzOHGOVpfnq4XSLnukrqTB7oBgf\n" + -+ "DhgL5Vup09FsHgdnj5FLqYq80maqkwGIspH6MVzVpsFSCAnNCmOi0yKm6KHZOQaX\n" + -+ "9W6NApCMFHs/gM0bnLrEWHIjr7ZWn8Z6QjMpBz+CyeYfBQ3NTCg2i9PIPhzGiO9e\n" + -+ "7olk6R3r2ol+MqZp0d3MiJ/R0MlmIdwGZ8WUepptYkx9zOBkgLKeR46jAgMBAAGj\n" + -+ "ggEmMIIBIjASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMB\n" + -+ "BggrBgEFBQcDAgYIKwYBBQUHAwQwEQYDVR0gBAowCDAGBgRVHSAAMDMGCCsGAQUF\n" + -+ "BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD\n" + -+ "VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9zZXJ2ZXIxLmNy\n" + -+ "bDAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wCwYDVR0PBAQDAgEGMB8G\n" + -+ "A1UdIwQYMBaAFPAXYhNVPbP/CgBr+1CEl/PtYtAaMBkGCSqGSIb2fQdBAAQMMAob\n" + -+ "BFY3LjEDAgCBMA0GCSqGSIb3DQEBBQUAA4GBAEa6RcDNcEIGUlkDJUY/pWTds4zh\n" + -+ "xbVkp3wSmpwPFhx5fxTyF4HD2L60jl3aqjTB7gPpsL2Pk5QZlNsi3t4UkCV70UOd\n" + -+ "ueJRN3o/LOtk4+bjXY2lC0qTHbN80VMLqPjmaf9ghSA9hwhskdtMgRsgfd90q5QP\n" + -+ "ZFdYf+hthc3m6IcJ\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, compromised certificate -+ static String compromisedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgxOTIxWjBfMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEg\n" + -+ "MB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3DQEB\n" + -+ "AQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B\n" + -+ "8cp86Yxq7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXY\n" + -+ "tsMW2YiwsYcdcNqGtA8Ui3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIl\n" + -+ "HgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8ZkqQfioLBQftFl9VkHXYRskbg+IIvvEj\n" + -+ "zJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEqbYRAhU52mXyC8/O3AlnU\n" + -+ "JgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4iHomGgVM\n" + -+ "ktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXv\n" + -+ "a5pkXuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57p\n" + -+ "K6kwe6AYHw4YC+VbqdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMi\n" + -+ "puih2TkGl/VujQKQjBR7P4DNG5y6xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovT\n" + -+ "yD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHcBmfFlHqabWJMfczgZICynkeO\n" + -+ "owIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV\n" + -+ "HQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC\n" + -+ "jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXy\n" + -+ "fJ9oHbtdzno5wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBo\n" + -+ "Y6pFITlIYXg23PFDk9Qlx/KAZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHo\n" + -+ "M/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedTFLJgQT2EkTFoPSdE2+Xe9PpjRchM\n" + -+ "Ppj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKfyvBovWsdst+Nbwed\n" + -+ "2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoAZbwH\n" + -+ "/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQl\n" + -+ "nQ7KN+ZQ/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jE\n" + -+ "O1hZibCMjFCz2IbLaKPECudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU\n" + -+ "9jQZjHkJNsphFyUXC4KYcwx3dMPVDceoEkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9\n" + -+ "j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Public CA 2025, intermediate certificate -+ static String intermediateCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIGAzCCA+ugAwIBAgIQHn16Uz1FMEGWQA9xSB9FBDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDYwMjA2MTYwNzAyWhcNMjUwMzI4MTYwNzAyWjBmMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdpTm90YXIgUHVibGljIENB\n" + -+ "IDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5vdGFyLm5sMIIBIjANBgkq\n" + -+ "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/2eu/I5fMG8lbvPph3e8zfJpZQtg/72\n" + -+ "Yx29+ivtKehiF6A3n785XyoY6IT3vlCrhy1CbMOY3M0x1n4YQlv17B0XZ/DqHyBA\n" + -+ "SQvnDNbkM9j4NoSy/sRtGsP6PetIFFjrhE9whZuvuSUC1PY4PruEEJp8zOCx4+wU\n" + -+ "Zt9xvjy4Xra+bSia5rwccQ/R5FYTGKrYCthOy9C9ud5Fhd++rlVhgdA/78w+Cs2s\n" + -+ "xS4i0MAxG75P3/e/bATJKepbydHdDjkyz9o3RW/wdPUXhzEw4EwUjYg6XJrDzMad\n" + -+ "6aL9M/eaxDjgz6o48EaWRDrGptaE2uJRuErVz7oOO0p/wYKq/BU+/wIDAQABo4IB\n" + -+ "sjCCAa4wOgYIKwYBBQUHAQEELjAsMCoGCCsGAQUFBzABhh5odHRwOi8vdmFsaWRh\n" + -+ "dGlvbi5kaWdpbm90YXIubmwwHwYDVR0jBBgwFoAUiGi/4I41xDs4a2L3KDuEgcgM\n" + -+ "100wEgYDVR0TAQH/BAgwBgEB/wIBADCBxgYDVR0gBIG+MIG7MIG4Bg5ghBABh2kB\n" + -+ "AQEBBQIGBDCBpTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpbm90YXIubmwv\n" + -+ "Y3BzMHoGCCsGAQUFBwICMG4abENvbmRpdGlvbnMsIGFzIG1lbnRpb25lZCBvbiBv\n" + -+ "dXIgd2Vic2l0ZSAod3d3LmRpZ2lub3Rhci5ubCksIGFyZSBhcHBsaWNhYmxlIHRv\n" + -+ "IGFsbCBvdXIgcHJvZHVjdHMgYW5kIHNlcnZpY2VzLjBDBgNVHR8EPDA6MDigNqA0\n" + -+ "hjJodHRwOi8vc2VydmljZS5kaWdpbm90YXIubmwvY3JsL3Jvb3QvbGF0ZXN0Q1JM\n" + -+ "LmNybDAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFN8zwK+S/jf8ttgWFtDZsZHV\n" + -+ "+m6lMA0GCSqGSIb3DQEBBQUAA4ICAQCfV1rmBd9QStEyQ40lT0tqby0/3ez0STuJ\n" + -+ "ESBQLQD56XYdb4VFSuqA6xTtiuSVHLoiv2xyISN9FvX3A5VtifkJ00JEaLQJiSsE\n" + -+ "wGDkYGl1DT7SsqtAVKdMAuCM+e0j0/RV3hZ6kcrM7/wFccHwM+/TiurR9lgZDzB4\n" + -+ "a7++A4XrYyKx9vc9ZwBEnD1nrAe7++gg9cuZgP7e+QL0FBHMjpw+gnCDjr2dzBZC\n" + -+ "4r+b8SOqlbPRPexBuNghlc7PfcPIyFis2LJXDRMWiAd3TcfdALwRsuKMR/T+cwyr\n" + -+ "asy69OEGHplLT57otQ524BDctDXNzlH9bHEh52QzqkWvIDqs42910IUy1nYNPIUG\n" + -+ "yYJV/T7H8Jb6vfMZWe47iUFvtNZCi8+b542gRUwdi+ca+hGviBC9Qr4Wv1pl7CBQ\n" + -+ "Hy1axTkHiQawUo/hgmoetCpftugl9yJTfvsBorUV1ZMxn9B1JLSGtWnbUsFRla7G\n" + -+ "fNa0IsUkzmmha8XCzvNu0d1PDGtcQyUqmDOE1Hx4cIBeuF8ipuIXkrVCr9zAZ4ZC\n" + -+ "hgz6aA1gDTW8whSRJqYEYEQ0pcMEFLyXE+Nz3O8NinO2AuxqKhjMk13203xA7lPY\n" + -+ "MnBQ0v7S3qqbp/pvPMiUhOz/VaYted6QmOY5EATBnFiLCuw87JXoAyp382eJ3WX1\n" + -+ "hOiR4IX9Tg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // The fraudulent certificate issued by above compromised CA -+ static String targetCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFKDCCBBCgAwIBAgIQBeLmpM0J6lTWZbB1/iKiVjANBgkqhkiG9w0BAQUFADBm\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdp\n" + -+ "Tm90YXIgUHVibGljIENBIDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5v\n" + -+ "dGFyLm5sMB4XDTExMDcxMDE5MDYzMFoXDTEzMDcwOTE5MDYzMFowajELMAkGA1UE\n" + -+ "BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxFjAUBgNVBAcTDU1vdW50YWluIFZp\n" + -+ "ZXcxFzAVBgNVBAUTDlBLMDAwMjI5MjAwMDAyMRUwEwYDVQQDEwwqLmdvb2dsZS5j\n" + -+ "b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNbeKubCV0aCxhOiOS\n" + -+ "CSQ/w9HXTYuD5BLKuiqXNw3setdTymeJz2L8aWOHo3nicFNDVwWTgwWomGNr2J6Q\n" + -+ "7g1iINNSW0rR4E1l2szRkcnAY6c6i/Eke93nF4i2hDsnIBveolF5yjpuRm73uQQD\n" + -+ "ulHjA3BFRF/PTi0fw2/Yt+8ieoMuNcMWN6Eou5Gqt5YZkWv176ofeCbsBmMrP87x\n" + -+ "OhhtTDckCapk4VQZG2XrfzZcV6tdzCp5TI8uHdu17cdzXm1imZ8tyvzFeiCEOQN8\n" + -+ "vPNzB/fIr3CJQ5q4uM5aKT3DD5PeVzf4rfJKQNgCTWiIBc9XcWEUuszwAsnmg7e2\n" + -+ "EJRdAgMBAAGjggHMMIIByDA6BggrBgEFBQcBAQQuMCwwKgYIKwYBBQUHMAGGHmh0\n" + -+ "dHA6Ly92YWxpZGF0aW9uLmRpZ2lub3Rhci5ubDAfBgNVHSMEGDAWgBTfM8Cvkv43\n" + -+ "/LbYFhbQ2bGR1fpupTAJBgNVHRMEAjAAMIHGBgNVHSAEgb4wgbswgbgGDmCEEAGH\n" + -+ "aQEBAQIEAQICMIGlMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2lub3Rhci5u\n" + -+ "bC9jcHMwegYIKwYBBQUHAgIwbhpsQ29uZGl0aW9ucywgYXMgbWVudGlvbmVkIG9u\n" + -+ "IG91ciB3ZWJzaXRlICh3d3cuZGlnaW5vdGFyLm5sKSwgYXJlIGFwcGxpY2FibGUg\n" + -+ "dG8gYWxsIG91ciBwcm9kdWN0cyBhbmQgc2VydmljZXMuMEkGA1UdHwRCMEAwPqA8\n" + -+ "oDqGOGh0dHA6Ly9zZXJ2aWNlLmRpZ2lub3Rhci5ubC9jcmwvcHVibGljMjAyNS9s\n" + -+ "YXRlc3RDUkwuY3JsMA4GA1UdDwEB/wQEAwIEsDAbBgNVHREEFDASgRBhZG1pbkBn\n" + -+ "b29nbGUuY29tMB0GA1UdDgQWBBQHSn0WJzIo0eMBMQUNsMqN6eF/7TANBgkqhkiG\n" + -+ "9w0BAQUFAAOCAQEAAs5dL7N9wzRJkI4Aq4lC5t8j5ZadqnqUcgYLADzSv4ExytNH\n" + -+ "UY2nH6iVTihC0UPSsILWraoeApdT7Rphz/8DLQEBRGdeKWAptNM3EbiXtQaZT2uB\n" + -+ "pidL8UoafX0kch3f71Y1scpBEjvu5ZZLnjg0A8AL0tnsereOVdDpU98bKqdbbrnM\n" + -+ "FRmBlSf7xdaNca6JJHeEpga4E9Ty683CmccrSGXdU2tTCuHEJww+iOAUtPIZcsum\n" + -+ "U7/eYeY1pMyGLyIjbNgRY7nDzRwvM/BsbL9eh4/mSQj/4nncqJd22sVQpCggQiVK\n" + -+ "baB2sVGcVNBkK55bT8gPqnx8JypubyUvayzZGg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ public static void main(String args[]) throws Exception { -+ -+ Exception reservedException = null; -+ try { -+ build(); -+ } catch (CertPathBuilderException cpbe) { -+ reservedException = cpbe; -+ } -+ -+ if (reservedException == null) { -+ throw new Exception("Unable to block fraudulent certificate"); -+ } -+ -+ System.out.println( -+ "The expected untrusted cert exception: " + reservedException); -+ } -+ -+ private static X509CertSelector generateSelector() throws Exception { -+ -+ // generate certificate from cert strings -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ X509Certificate target = null; -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(targetCertStr.getBytes())) { -+ target = (X509Certificate)cf.generateCertificate(is); -+ } -+ -+ X509CertSelector selector = new X509CertSelector(); -+ selector.setCertificate(target); -+ -+ return selector; -+ } -+ -+ -+ private static CertStore generateCertificateStore() throws Exception { -+ -+ // generate certificate from cert strings -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ // generate certification path -+ Set<Certificate> entries = new HashSet(); -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(targetCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(intermediateCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(compromisedCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(untrustedCrossCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ return CertStore.getInstance("Collection", -+ new CollectionCertStoreParameters(entries)); -+ } -+ -+ private static Set<TrustAnchor> generateTrustAnchors() -+ throws CertificateException, IOException { -+ // generate certificate from cert string -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ Certificate trustedCert = null; -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(trustedCertStr.getBytes())) { -+ trustedCert = cf.generateCertificate(is); -+ } -+ -+ // generate a trust anchor -+ TrustAnchor anchor = -+ new TrustAnchor((X509Certificate)trustedCert, null); -+ -+ return Collections.singleton(anchor); -+ } -+ -+ private static void build() throws Exception { -+ X509CertSelector selector = generateSelector(); -+ Set<TrustAnchor> anchors = generateTrustAnchors(); -+ CertStore certs = generateCertificateStore(); -+ -+ PKIXBuilderParameters params = -+ new PKIXBuilderParameters(anchors, selector); -+ params.addCertStore(certs); -+ params.setRevocationEnabled(false); -+ params.setDate(new Date(111, 11, 25)); // 2011-12-25 -+ -+ CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); -+ PKIXCertPathBuilderResult result = -+ (PKIXCertPathBuilderResult)builder.build(params); -+ } -+} -+ -diff -uNr -x '.hg*' jdk7u2/jdk/test/sun/security/provider/certpath/X509CertPath/ReverseBuildCompromised.java jdk7u3/jdk/test/sun/security/provider/certpath/X509CertPath/ReverseBuildCompromised.java ---- jdk/test/sun/security/provider/certpath/X509CertPath/ReverseBuildCompromised.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/test/sun/security/provider/certpath/X509CertPath/ReverseBuildCompromised.java 2012-04-17 17:49:27.000000000 -0400 -@@ -0,0 +1,315 @@ -+/* -+ * Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* -+ * @test -+ * @bug 7123519 -+ * @summary Problem with java/classes_security -+ */ -+ -+import java.net.*; -+import java.util.*; -+import java.io.*; -+import javax.net.ssl.*; -+import java.security.KeyStore; -+import java.security.cert.*; -+import java.security.spec.*; -+import java.security.interfaces.*; -+import sun.security.provider.certpath.SunCertPathBuilderParameters; -+ -+public class ReverseBuildCompromised { -+ // DigiNotar Root CA, untrusted root certificate -+ static String trustedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1\n" + -+ "MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE\n" + -+ "ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j\n" + -+ "b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\n" + -+ "bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg\n" + -+ "U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA\n" + -+ "A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/\n" + -+ "I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3\n" + -+ "wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC\n" + -+ "AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb\n" + -+ "oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5\n" + -+ "BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p\n" + -+ "dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk\n" + -+ "MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp\n" + -+ "b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\n" + -+ "dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0\n" + -+ "MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi\n" + -+ "E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa\n" + -+ "MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI\n" + -+ "hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN\n" + -+ "95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd\n" + -+ "2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, untrusted cross-certificate -+ static String untrustedCrossCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFSDCCBLGgAwIBAgIERpwsrzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzA3\n" + -+ "MjYxNTU3MzlaFw0xMzA4MjYxNjI3MzlaMF8xCzAJBgNVBAYTAk5MMRIwEAYDVQQK\n" + -+ "EwlEaWdpTm90YXIxGjAYBgNVBAMTEURpZ2lOb3RhciBSb290IENBMSAwHgYJKoZI\n" + -+ "hvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + -+ "ADCCAgoCggIBAKywWMEAvdghCAsrmv5uVjAFnxt3kBBBXMMNhxF3joHxynzpjGrt\n" + -+ "OHQ1u9rf+bvACTe0lnOBfTMamDn3k2+Vfz25sXWHulFI6ItwPpUExdi2wxbZiLCx\n" + -+ "hx1w2oa0DxSLes8Q0XQ2ohJ7d4ZKeeZ73wIRaKVOhq40WJskE3hWIiUeAYtLUXH7\n" + -+ "gsxZlmmIWmhTxbkNAjfLS7xmSpB+KgsFB+0WX1WQddhGyRuD4gi+8SPMmR3WKg+D\n" + -+ "IBVYJ4Iu+uIiwkmxuQGBap1tnUB3aHZOISpthECFTnaZfILz87cCWdQmARuO361T\n" + -+ "BtGuGN3isjrL14g4jqxbKbkZ05j5GAPPSIKGZgsbaQ/J6ziIeiYaBUyS1yTUlvKs\n" + -+ "Ui2jR9VS9j/+zoQGcKaqPqLytlY0GFei5IFt58rwatPHkWsCg0F8Fe9rmmRe49A8\n" + -+ "5bHre12G+8vmd0nNo2Xc97mcuOQLX5PPzDAaMhzOHGOVpfnq4XSLnukrqTB7oBgf\n" + -+ "DhgL5Vup09FsHgdnj5FLqYq80maqkwGIspH6MVzVpsFSCAnNCmOi0yKm6KHZOQaX\n" + -+ "9W6NApCMFHs/gM0bnLrEWHIjr7ZWn8Z6QjMpBz+CyeYfBQ3NTCg2i9PIPhzGiO9e\n" + -+ "7olk6R3r2ol+MqZp0d3MiJ/R0MlmIdwGZ8WUepptYkx9zOBkgLKeR46jAgMBAAGj\n" + -+ "ggEmMIIBIjASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMB\n" + -+ "BggrBgEFBQcDAgYIKwYBBQUHAwQwEQYDVR0gBAowCDAGBgRVHSAAMDMGCCsGAQUF\n" + -+ "BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD\n" + -+ "VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9zZXJ2ZXIxLmNy\n" + -+ "bDAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wCwYDVR0PBAQDAgEGMB8G\n" + -+ "A1UdIwQYMBaAFPAXYhNVPbP/CgBr+1CEl/PtYtAaMBkGCSqGSIb2fQdBAAQMMAob\n" + -+ "BFY3LjEDAgCBMA0GCSqGSIb3DQEBBQUAA4GBAEa6RcDNcEIGUlkDJUY/pWTds4zh\n" + -+ "xbVkp3wSmpwPFhx5fxTyF4HD2L60jl3aqjTB7gPpsL2Pk5QZlNsi3t4UkCV70UOd\n" + -+ "ueJRN3o/LOtk4+bjXY2lC0qTHbN80VMLqPjmaf9ghSA9hwhskdtMgRsgfd90q5QP\n" + -+ "ZFdYf+hthc3m6IcJ\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, compromised certificate -+ static String compromisedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgxOTIxWjBfMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEg\n" + -+ "MB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3DQEB\n" + -+ "AQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B\n" + -+ "8cp86Yxq7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXY\n" + -+ "tsMW2YiwsYcdcNqGtA8Ui3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIl\n" + -+ "HgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8ZkqQfioLBQftFl9VkHXYRskbg+IIvvEj\n" + -+ "zJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEqbYRAhU52mXyC8/O3AlnU\n" + -+ "JgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4iHomGgVM\n" + -+ "ktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXv\n" + -+ "a5pkXuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57p\n" + -+ "K6kwe6AYHw4YC+VbqdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMi\n" + -+ "puih2TkGl/VujQKQjBR7P4DNG5y6xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovT\n" + -+ "yD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHcBmfFlHqabWJMfczgZICynkeO\n" + -+ "owIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV\n" + -+ "HQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC\n" + -+ "jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXy\n" + -+ "fJ9oHbtdzno5wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBo\n" + -+ "Y6pFITlIYXg23PFDk9Qlx/KAZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHo\n" + -+ "M/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedTFLJgQT2EkTFoPSdE2+Xe9PpjRchM\n" + -+ "Ppj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKfyvBovWsdst+Nbwed\n" + -+ "2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoAZbwH\n" + -+ "/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQl\n" + -+ "nQ7KN+ZQ/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jE\n" + -+ "O1hZibCMjFCz2IbLaKPECudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU\n" + -+ "9jQZjHkJNsphFyUXC4KYcwx3dMPVDceoEkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9\n" + -+ "j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Public CA 2025, intermediate certificate -+ static String intermediateCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIGAzCCA+ugAwIBAgIQHn16Uz1FMEGWQA9xSB9FBDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDYwMjA2MTYwNzAyWhcNMjUwMzI4MTYwNzAyWjBmMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdpTm90YXIgUHVibGljIENB\n" + -+ "IDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5vdGFyLm5sMIIBIjANBgkq\n" + -+ "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/2eu/I5fMG8lbvPph3e8zfJpZQtg/72\n" + -+ "Yx29+ivtKehiF6A3n785XyoY6IT3vlCrhy1CbMOY3M0x1n4YQlv17B0XZ/DqHyBA\n" + -+ "SQvnDNbkM9j4NoSy/sRtGsP6PetIFFjrhE9whZuvuSUC1PY4PruEEJp8zOCx4+wU\n" + -+ "Zt9xvjy4Xra+bSia5rwccQ/R5FYTGKrYCthOy9C9ud5Fhd++rlVhgdA/78w+Cs2s\n" + -+ "xS4i0MAxG75P3/e/bATJKepbydHdDjkyz9o3RW/wdPUXhzEw4EwUjYg6XJrDzMad\n" + -+ "6aL9M/eaxDjgz6o48EaWRDrGptaE2uJRuErVz7oOO0p/wYKq/BU+/wIDAQABo4IB\n" + -+ "sjCCAa4wOgYIKwYBBQUHAQEELjAsMCoGCCsGAQUFBzABhh5odHRwOi8vdmFsaWRh\n" + -+ "dGlvbi5kaWdpbm90YXIubmwwHwYDVR0jBBgwFoAUiGi/4I41xDs4a2L3KDuEgcgM\n" + -+ "100wEgYDVR0TAQH/BAgwBgEB/wIBADCBxgYDVR0gBIG+MIG7MIG4Bg5ghBABh2kB\n" + -+ "AQEBBQIGBDCBpTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpbm90YXIubmwv\n" + -+ "Y3BzMHoGCCsGAQUFBwICMG4abENvbmRpdGlvbnMsIGFzIG1lbnRpb25lZCBvbiBv\n" + -+ "dXIgd2Vic2l0ZSAod3d3LmRpZ2lub3Rhci5ubCksIGFyZSBhcHBsaWNhYmxlIHRv\n" + -+ "IGFsbCBvdXIgcHJvZHVjdHMgYW5kIHNlcnZpY2VzLjBDBgNVHR8EPDA6MDigNqA0\n" + -+ "hjJodHRwOi8vc2VydmljZS5kaWdpbm90YXIubmwvY3JsL3Jvb3QvbGF0ZXN0Q1JM\n" + -+ "LmNybDAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFN8zwK+S/jf8ttgWFtDZsZHV\n" + -+ "+m6lMA0GCSqGSIb3DQEBBQUAA4ICAQCfV1rmBd9QStEyQ40lT0tqby0/3ez0STuJ\n" + -+ "ESBQLQD56XYdb4VFSuqA6xTtiuSVHLoiv2xyISN9FvX3A5VtifkJ00JEaLQJiSsE\n" + -+ "wGDkYGl1DT7SsqtAVKdMAuCM+e0j0/RV3hZ6kcrM7/wFccHwM+/TiurR9lgZDzB4\n" + -+ "a7++A4XrYyKx9vc9ZwBEnD1nrAe7++gg9cuZgP7e+QL0FBHMjpw+gnCDjr2dzBZC\n" + -+ "4r+b8SOqlbPRPexBuNghlc7PfcPIyFis2LJXDRMWiAd3TcfdALwRsuKMR/T+cwyr\n" + -+ "asy69OEGHplLT57otQ524BDctDXNzlH9bHEh52QzqkWvIDqs42910IUy1nYNPIUG\n" + -+ "yYJV/T7H8Jb6vfMZWe47iUFvtNZCi8+b542gRUwdi+ca+hGviBC9Qr4Wv1pl7CBQ\n" + -+ "Hy1axTkHiQawUo/hgmoetCpftugl9yJTfvsBorUV1ZMxn9B1JLSGtWnbUsFRla7G\n" + -+ "fNa0IsUkzmmha8XCzvNu0d1PDGtcQyUqmDOE1Hx4cIBeuF8ipuIXkrVCr9zAZ4ZC\n" + -+ "hgz6aA1gDTW8whSRJqYEYEQ0pcMEFLyXE+Nz3O8NinO2AuxqKhjMk13203xA7lPY\n" + -+ "MnBQ0v7S3qqbp/pvPMiUhOz/VaYted6QmOY5EATBnFiLCuw87JXoAyp382eJ3WX1\n" + -+ "hOiR4IX9Tg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // The fraudulent certificate issued by above compromised CA -+ static String targetCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFKDCCBBCgAwIBAgIQBeLmpM0J6lTWZbB1/iKiVjANBgkqhkiG9w0BAQUFADBm\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdp\n" + -+ "Tm90YXIgUHVibGljIENBIDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5v\n" + -+ "dGFyLm5sMB4XDTExMDcxMDE5MDYzMFoXDTEzMDcwOTE5MDYzMFowajELMAkGA1UE\n" + -+ "BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxFjAUBgNVBAcTDU1vdW50YWluIFZp\n" + -+ "ZXcxFzAVBgNVBAUTDlBLMDAwMjI5MjAwMDAyMRUwEwYDVQQDEwwqLmdvb2dsZS5j\n" + -+ "b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNbeKubCV0aCxhOiOS\n" + -+ "CSQ/w9HXTYuD5BLKuiqXNw3setdTymeJz2L8aWOHo3nicFNDVwWTgwWomGNr2J6Q\n" + -+ "7g1iINNSW0rR4E1l2szRkcnAY6c6i/Eke93nF4i2hDsnIBveolF5yjpuRm73uQQD\n" + -+ "ulHjA3BFRF/PTi0fw2/Yt+8ieoMuNcMWN6Eou5Gqt5YZkWv176ofeCbsBmMrP87x\n" + -+ "OhhtTDckCapk4VQZG2XrfzZcV6tdzCp5TI8uHdu17cdzXm1imZ8tyvzFeiCEOQN8\n" + -+ "vPNzB/fIr3CJQ5q4uM5aKT3DD5PeVzf4rfJKQNgCTWiIBc9XcWEUuszwAsnmg7e2\n" + -+ "EJRdAgMBAAGjggHMMIIByDA6BggrBgEFBQcBAQQuMCwwKgYIKwYBBQUHMAGGHmh0\n" + -+ "dHA6Ly92YWxpZGF0aW9uLmRpZ2lub3Rhci5ubDAfBgNVHSMEGDAWgBTfM8Cvkv43\n" + -+ "/LbYFhbQ2bGR1fpupTAJBgNVHRMEAjAAMIHGBgNVHSAEgb4wgbswgbgGDmCEEAGH\n" + -+ "aQEBAQIEAQICMIGlMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2lub3Rhci5u\n" + -+ "bC9jcHMwegYIKwYBBQUHAgIwbhpsQ29uZGl0aW9ucywgYXMgbWVudGlvbmVkIG9u\n" + -+ "IG91ciB3ZWJzaXRlICh3d3cuZGlnaW5vdGFyLm5sKSwgYXJlIGFwcGxpY2FibGUg\n" + -+ "dG8gYWxsIG91ciBwcm9kdWN0cyBhbmQgc2VydmljZXMuMEkGA1UdHwRCMEAwPqA8\n" + -+ "oDqGOGh0dHA6Ly9zZXJ2aWNlLmRpZ2lub3Rhci5ubC9jcmwvcHVibGljMjAyNS9s\n" + -+ "YXRlc3RDUkwuY3JsMA4GA1UdDwEB/wQEAwIEsDAbBgNVHREEFDASgRBhZG1pbkBn\n" + -+ "b29nbGUuY29tMB0GA1UdDgQWBBQHSn0WJzIo0eMBMQUNsMqN6eF/7TANBgkqhkiG\n" + -+ "9w0BAQUFAAOCAQEAAs5dL7N9wzRJkI4Aq4lC5t8j5ZadqnqUcgYLADzSv4ExytNH\n" + -+ "UY2nH6iVTihC0UPSsILWraoeApdT7Rphz/8DLQEBRGdeKWAptNM3EbiXtQaZT2uB\n" + -+ "pidL8UoafX0kch3f71Y1scpBEjvu5ZZLnjg0A8AL0tnsereOVdDpU98bKqdbbrnM\n" + -+ "FRmBlSf7xdaNca6JJHeEpga4E9Ty683CmccrSGXdU2tTCuHEJww+iOAUtPIZcsum\n" + -+ "U7/eYeY1pMyGLyIjbNgRY7nDzRwvM/BsbL9eh4/mSQj/4nncqJd22sVQpCggQiVK\n" + -+ "baB2sVGcVNBkK55bT8gPqnx8JypubyUvayzZGg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ public static void main(String args[]) throws Exception { -+ -+ Exception reservedException = null; -+ try { -+ build(); -+ } catch (CertPathBuilderException cpbe) { -+ reservedException = cpbe; -+ } -+ -+ if (reservedException == null) { -+ throw new Exception("Unable to block fraudulent certificate"); -+ } -+ -+ System.out.println( -+ "The expected untrusted cert exception: " + reservedException); -+ } -+ -+ private static X509CertSelector generateSelector() throws Exception { -+ -+ // generate certificate from cert strings -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ X509Certificate target = null; -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(targetCertStr.getBytes())) { -+ target = (X509Certificate)cf.generateCertificate(is); -+ } -+ -+ X509CertSelector selector = new X509CertSelector(); -+ selector.setCertificate(target); -+ selector.setSubject(target.getSubjectX500Principal()); -+ -+ return selector; -+ } -+ -+ -+ private static CertStore generateCertificateStore() throws Exception { -+ -+ // generate certificate from cert strings -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ // generate certification path -+ Set<Certificate> entries = new HashSet(); -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(targetCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(intermediateCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(compromisedCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(untrustedCrossCertStr.getBytes())) { -+ entries.add(cf.generateCertificate(is)); -+ } -+ -+ return CertStore.getInstance("Collection", -+ new CollectionCertStoreParameters(entries)); -+ } -+ -+ private static Set<TrustAnchor> generateTrustAnchors() -+ throws CertificateException, IOException { -+ // generate certificate from cert string -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ Certificate trustedCert = null; -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(trustedCertStr.getBytes())) { -+ trustedCert = cf.generateCertificate(is); -+ } -+ -+ // generate a trust anchor -+ TrustAnchor anchor = -+ new TrustAnchor((X509Certificate)trustedCert, null); -+ -+ return Collections.singleton(anchor); -+ } -+ -+ private static void build() throws Exception { -+ X509CertSelector selector = generateSelector(); -+ Set<TrustAnchor> anchors = generateTrustAnchors(); -+ CertStore certs = generateCertificateStore(); -+ -+ SunCertPathBuilderParameters params = -+ new SunCertPathBuilderParameters(anchors, selector); -+ params.setBuildForward(false); -+ params.addCertStore(certs); -+ params.setRevocationEnabled(false); -+ params.setDate(new Date(111, 11, 25)); // 2011-12-25 -+ -+ CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); -+ PKIXCertPathBuilderResult result = -+ (PKIXCertPathBuilderResult)builder.build(params); -+ } -+} -+ -diff -uNr -x '.hg*' jdk7u2/jdk/test/sun/security/provider/certpath/X509CertPath/ValidateCompromised.java jdk7u3/jdk/test/sun/security/provider/certpath/X509CertPath/ValidateCompromised.java ---- jdk/test/sun/security/provider/certpath/X509CertPath/ValidateCompromised.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/test/sun/security/provider/certpath/X509CertPath/ValidateCompromised.java 2012-04-17 17:49:27.000000000 -0400 -@@ -0,0 +1,297 @@ -+/* -+ * Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* -+ * @test -+ * @bug 7123519 -+ * @summary Problem with java/classes_security -+ */ -+ -+import java.net.*; -+import java.util.*; -+import java.io.*; -+import javax.net.ssl.*; -+import java.security.KeyStore; -+import java.security.cert.*; -+import java.security.spec.*; -+import java.security.interfaces.*; -+ -+public class ValidateCompromised { -+ // DigiNotar Root CA, untrusted root certificate -+ static String trustedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1\n" + -+ "MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE\n" + -+ "ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j\n" + -+ "b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\n" + -+ "bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg\n" + -+ "U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA\n" + -+ "A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/\n" + -+ "I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3\n" + -+ "wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC\n" + -+ "AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb\n" + -+ "oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5\n" + -+ "BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p\n" + -+ "dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk\n" + -+ "MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp\n" + -+ "b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\n" + -+ "dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0\n" + -+ "MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi\n" + -+ "E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa\n" + -+ "MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI\n" + -+ "hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN\n" + -+ "95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd\n" + -+ "2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, untrusted cross-certificate -+ static String untrustedCrossCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFSDCCBLGgAwIBAgIERpwsrzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzA3\n" + -+ "MjYxNTU3MzlaFw0xMzA4MjYxNjI3MzlaMF8xCzAJBgNVBAYTAk5MMRIwEAYDVQQK\n" + -+ "EwlEaWdpTm90YXIxGjAYBgNVBAMTEURpZ2lOb3RhciBSb290IENBMSAwHgYJKoZI\n" + -+ "hvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + -+ "ADCCAgoCggIBAKywWMEAvdghCAsrmv5uVjAFnxt3kBBBXMMNhxF3joHxynzpjGrt\n" + -+ "OHQ1u9rf+bvACTe0lnOBfTMamDn3k2+Vfz25sXWHulFI6ItwPpUExdi2wxbZiLCx\n" + -+ "hx1w2oa0DxSLes8Q0XQ2ohJ7d4ZKeeZ73wIRaKVOhq40WJskE3hWIiUeAYtLUXH7\n" + -+ "gsxZlmmIWmhTxbkNAjfLS7xmSpB+KgsFB+0WX1WQddhGyRuD4gi+8SPMmR3WKg+D\n" + -+ "IBVYJ4Iu+uIiwkmxuQGBap1tnUB3aHZOISpthECFTnaZfILz87cCWdQmARuO361T\n" + -+ "BtGuGN3isjrL14g4jqxbKbkZ05j5GAPPSIKGZgsbaQ/J6ziIeiYaBUyS1yTUlvKs\n" + -+ "Ui2jR9VS9j/+zoQGcKaqPqLytlY0GFei5IFt58rwatPHkWsCg0F8Fe9rmmRe49A8\n" + -+ "5bHre12G+8vmd0nNo2Xc97mcuOQLX5PPzDAaMhzOHGOVpfnq4XSLnukrqTB7oBgf\n" + -+ "DhgL5Vup09FsHgdnj5FLqYq80maqkwGIspH6MVzVpsFSCAnNCmOi0yKm6KHZOQaX\n" + -+ "9W6NApCMFHs/gM0bnLrEWHIjr7ZWn8Z6QjMpBz+CyeYfBQ3NTCg2i9PIPhzGiO9e\n" + -+ "7olk6R3r2ol+MqZp0d3MiJ/R0MlmIdwGZ8WUepptYkx9zOBkgLKeR46jAgMBAAGj\n" + -+ "ggEmMIIBIjASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMB\n" + -+ "BggrBgEFBQcDAgYIKwYBBQUHAwQwEQYDVR0gBAowCDAGBgRVHSAAMDMGCCsGAQUF\n" + -+ "BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD\n" + -+ "VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9zZXJ2ZXIxLmNy\n" + -+ "bDAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wCwYDVR0PBAQDAgEGMB8G\n" + -+ "A1UdIwQYMBaAFPAXYhNVPbP/CgBr+1CEl/PtYtAaMBkGCSqGSIb2fQdBAAQMMAob\n" + -+ "BFY3LjEDAgCBMA0GCSqGSIb3DQEBBQUAA4GBAEa6RcDNcEIGUlkDJUY/pWTds4zh\n" + -+ "xbVkp3wSmpwPFhx5fxTyF4HD2L60jl3aqjTB7gPpsL2Pk5QZlNsi3t4UkCV70UOd\n" + -+ "ueJRN3o/LOtk4+bjXY2lC0qTHbN80VMLqPjmaf9ghSA9hwhskdtMgRsgfd90q5QP\n" + -+ "ZFdYf+hthc3m6IcJ\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, compromised certificate -+ static String compromisedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgxOTIxWjBfMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEg\n" + -+ "MB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3DQEB\n" + -+ "AQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B\n" + -+ "8cp86Yxq7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXY\n" + -+ "tsMW2YiwsYcdcNqGtA8Ui3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIl\n" + -+ "HgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8ZkqQfioLBQftFl9VkHXYRskbg+IIvvEj\n" + -+ "zJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEqbYRAhU52mXyC8/O3AlnU\n" + -+ "JgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4iHomGgVM\n" + -+ "ktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXv\n" + -+ "a5pkXuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57p\n" + -+ "K6kwe6AYHw4YC+VbqdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMi\n" + -+ "puih2TkGl/VujQKQjBR7P4DNG5y6xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovT\n" + -+ "yD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHcBmfFlHqabWJMfczgZICynkeO\n" + -+ "owIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV\n" + -+ "HQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC\n" + -+ "jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXy\n" + -+ "fJ9oHbtdzno5wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBo\n" + -+ "Y6pFITlIYXg23PFDk9Qlx/KAZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHo\n" + -+ "M/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedTFLJgQT2EkTFoPSdE2+Xe9PpjRchM\n" + -+ "Ppj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKfyvBovWsdst+Nbwed\n" + -+ "2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoAZbwH\n" + -+ "/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQl\n" + -+ "nQ7KN+ZQ/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jE\n" + -+ "O1hZibCMjFCz2IbLaKPECudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU\n" + -+ "9jQZjHkJNsphFyUXC4KYcwx3dMPVDceoEkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9\n" + -+ "j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Public CA 2025, intermediate certificate -+ static String intermediateCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIGAzCCA+ugAwIBAgIQHn16Uz1FMEGWQA9xSB9FBDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDYwMjA2MTYwNzAyWhcNMjUwMzI4MTYwNzAyWjBmMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdpTm90YXIgUHVibGljIENB\n" + -+ "IDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5vdGFyLm5sMIIBIjANBgkq\n" + -+ "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/2eu/I5fMG8lbvPph3e8zfJpZQtg/72\n" + -+ "Yx29+ivtKehiF6A3n785XyoY6IT3vlCrhy1CbMOY3M0x1n4YQlv17B0XZ/DqHyBA\n" + -+ "SQvnDNbkM9j4NoSy/sRtGsP6PetIFFjrhE9whZuvuSUC1PY4PruEEJp8zOCx4+wU\n" + -+ "Zt9xvjy4Xra+bSia5rwccQ/R5FYTGKrYCthOy9C9ud5Fhd++rlVhgdA/78w+Cs2s\n" + -+ "xS4i0MAxG75P3/e/bATJKepbydHdDjkyz9o3RW/wdPUXhzEw4EwUjYg6XJrDzMad\n" + -+ "6aL9M/eaxDjgz6o48EaWRDrGptaE2uJRuErVz7oOO0p/wYKq/BU+/wIDAQABo4IB\n" + -+ "sjCCAa4wOgYIKwYBBQUHAQEELjAsMCoGCCsGAQUFBzABhh5odHRwOi8vdmFsaWRh\n" + -+ "dGlvbi5kaWdpbm90YXIubmwwHwYDVR0jBBgwFoAUiGi/4I41xDs4a2L3KDuEgcgM\n" + -+ "100wEgYDVR0TAQH/BAgwBgEB/wIBADCBxgYDVR0gBIG+MIG7MIG4Bg5ghBABh2kB\n" + -+ "AQEBBQIGBDCBpTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpbm90YXIubmwv\n" + -+ "Y3BzMHoGCCsGAQUFBwICMG4abENvbmRpdGlvbnMsIGFzIG1lbnRpb25lZCBvbiBv\n" + -+ "dXIgd2Vic2l0ZSAod3d3LmRpZ2lub3Rhci5ubCksIGFyZSBhcHBsaWNhYmxlIHRv\n" + -+ "IGFsbCBvdXIgcHJvZHVjdHMgYW5kIHNlcnZpY2VzLjBDBgNVHR8EPDA6MDigNqA0\n" + -+ "hjJodHRwOi8vc2VydmljZS5kaWdpbm90YXIubmwvY3JsL3Jvb3QvbGF0ZXN0Q1JM\n" + -+ "LmNybDAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFN8zwK+S/jf8ttgWFtDZsZHV\n" + -+ "+m6lMA0GCSqGSIb3DQEBBQUAA4ICAQCfV1rmBd9QStEyQ40lT0tqby0/3ez0STuJ\n" + -+ "ESBQLQD56XYdb4VFSuqA6xTtiuSVHLoiv2xyISN9FvX3A5VtifkJ00JEaLQJiSsE\n" + -+ "wGDkYGl1DT7SsqtAVKdMAuCM+e0j0/RV3hZ6kcrM7/wFccHwM+/TiurR9lgZDzB4\n" + -+ "a7++A4XrYyKx9vc9ZwBEnD1nrAe7++gg9cuZgP7e+QL0FBHMjpw+gnCDjr2dzBZC\n" + -+ "4r+b8SOqlbPRPexBuNghlc7PfcPIyFis2LJXDRMWiAd3TcfdALwRsuKMR/T+cwyr\n" + -+ "asy69OEGHplLT57otQ524BDctDXNzlH9bHEh52QzqkWvIDqs42910IUy1nYNPIUG\n" + -+ "yYJV/T7H8Jb6vfMZWe47iUFvtNZCi8+b542gRUwdi+ca+hGviBC9Qr4Wv1pl7CBQ\n" + -+ "Hy1axTkHiQawUo/hgmoetCpftugl9yJTfvsBorUV1ZMxn9B1JLSGtWnbUsFRla7G\n" + -+ "fNa0IsUkzmmha8XCzvNu0d1PDGtcQyUqmDOE1Hx4cIBeuF8ipuIXkrVCr9zAZ4ZC\n" + -+ "hgz6aA1gDTW8whSRJqYEYEQ0pcMEFLyXE+Nz3O8NinO2AuxqKhjMk13203xA7lPY\n" + -+ "MnBQ0v7S3qqbp/pvPMiUhOz/VaYted6QmOY5EATBnFiLCuw87JXoAyp382eJ3WX1\n" + -+ "hOiR4IX9Tg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // The fraudulent certificate issued by above compromised CA -+ static String targetCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFKDCCBBCgAwIBAgIQBeLmpM0J6lTWZbB1/iKiVjANBgkqhkiG9w0BAQUFADBm\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdp\n" + -+ "Tm90YXIgUHVibGljIENBIDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5v\n" + -+ "dGFyLm5sMB4XDTExMDcxMDE5MDYzMFoXDTEzMDcwOTE5MDYzMFowajELMAkGA1UE\n" + -+ "BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxFjAUBgNVBAcTDU1vdW50YWluIFZp\n" + -+ "ZXcxFzAVBgNVBAUTDlBLMDAwMjI5MjAwMDAyMRUwEwYDVQQDEwwqLmdvb2dsZS5j\n" + -+ "b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNbeKubCV0aCxhOiOS\n" + -+ "CSQ/w9HXTYuD5BLKuiqXNw3setdTymeJz2L8aWOHo3nicFNDVwWTgwWomGNr2J6Q\n" + -+ "7g1iINNSW0rR4E1l2szRkcnAY6c6i/Eke93nF4i2hDsnIBveolF5yjpuRm73uQQD\n" + -+ "ulHjA3BFRF/PTi0fw2/Yt+8ieoMuNcMWN6Eou5Gqt5YZkWv176ofeCbsBmMrP87x\n" + -+ "OhhtTDckCapk4VQZG2XrfzZcV6tdzCp5TI8uHdu17cdzXm1imZ8tyvzFeiCEOQN8\n" + -+ "vPNzB/fIr3CJQ5q4uM5aKT3DD5PeVzf4rfJKQNgCTWiIBc9XcWEUuszwAsnmg7e2\n" + -+ "EJRdAgMBAAGjggHMMIIByDA6BggrBgEFBQcBAQQuMCwwKgYIKwYBBQUHMAGGHmh0\n" + -+ "dHA6Ly92YWxpZGF0aW9uLmRpZ2lub3Rhci5ubDAfBgNVHSMEGDAWgBTfM8Cvkv43\n" + -+ "/LbYFhbQ2bGR1fpupTAJBgNVHRMEAjAAMIHGBgNVHSAEgb4wgbswgbgGDmCEEAGH\n" + -+ "aQEBAQIEAQICMIGlMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2lub3Rhci5u\n" + -+ "bC9jcHMwegYIKwYBBQUHAgIwbhpsQ29uZGl0aW9ucywgYXMgbWVudGlvbmVkIG9u\n" + -+ "IG91ciB3ZWJzaXRlICh3d3cuZGlnaW5vdGFyLm5sKSwgYXJlIGFwcGxpY2FibGUg\n" + -+ "dG8gYWxsIG91ciBwcm9kdWN0cyBhbmQgc2VydmljZXMuMEkGA1UdHwRCMEAwPqA8\n" + -+ "oDqGOGh0dHA6Ly9zZXJ2aWNlLmRpZ2lub3Rhci5ubC9jcmwvcHVibGljMjAyNS9s\n" + -+ "YXRlc3RDUkwuY3JsMA4GA1UdDwEB/wQEAwIEsDAbBgNVHREEFDASgRBhZG1pbkBn\n" + -+ "b29nbGUuY29tMB0GA1UdDgQWBBQHSn0WJzIo0eMBMQUNsMqN6eF/7TANBgkqhkiG\n" + -+ "9w0BAQUFAAOCAQEAAs5dL7N9wzRJkI4Aq4lC5t8j5ZadqnqUcgYLADzSv4ExytNH\n" + -+ "UY2nH6iVTihC0UPSsILWraoeApdT7Rphz/8DLQEBRGdeKWAptNM3EbiXtQaZT2uB\n" + -+ "pidL8UoafX0kch3f71Y1scpBEjvu5ZZLnjg0A8AL0tnsereOVdDpU98bKqdbbrnM\n" + -+ "FRmBlSf7xdaNca6JJHeEpga4E9Ty683CmccrSGXdU2tTCuHEJww+iOAUtPIZcsum\n" + -+ "U7/eYeY1pMyGLyIjbNgRY7nDzRwvM/BsbL9eh4/mSQj/4nncqJd22sVQpCggQiVK\n" + -+ "baB2sVGcVNBkK55bT8gPqnx8JypubyUvayzZGg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ public static void main(String args[]) throws Exception { -+ -+ Exception reservedException = null; -+ try { -+ validate(); -+ } catch (CertPathValidatorException cpve) { -+ reservedException = cpve; -+ } -+ -+ if (reservedException == null) { -+ throw new Exception("Unable to block fraudulent certificate"); -+ } -+ -+ System.out.println( -+ "The expected untrusted cert exception: " + reservedException); -+ } -+ -+ private static CertPath generateCertificatePath() -+ throws CertificateException, IOException { -+ -+ // generate certificate from cert strings -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ // generate certification path -+ List<Certificate> list = new ArrayList(); -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(targetCertStr.getBytes())) { -+ list.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(intermediateCertStr.getBytes())) { -+ list.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(compromisedCertStr.getBytes())) { -+ list.add(cf.generateCertificate(is)); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(untrustedCrossCertStr.getBytes())) { -+ list.add(cf.generateCertificate(is)); -+ } -+ -+ return cf.generateCertPath(list); -+ } -+ -+ private static Set<TrustAnchor> generateTrustAnchors() -+ throws CertificateException, IOException { -+ // generate certificate from cert string -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ Certificate trustedCert = null; -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(trustedCertStr.getBytes())) { -+ trustedCert = cf.generateCertificate(is); -+ } -+ -+ // generate a trust anchor -+ TrustAnchor anchor = -+ new TrustAnchor((X509Certificate)trustedCert, null); -+ -+ return Collections.singleton(anchor); -+ } -+ -+ private static void validate() -+ throws CertPathValidatorException, Exception { -+ -+ CertPath path = generateCertificatePath(); -+ Set<TrustAnchor> anchors = generateTrustAnchors(); -+ -+ PKIXParameters params = new PKIXParameters(anchors); -+ -+ // disable certificate revocation checking -+ params.setRevocationEnabled(false); -+ -+ // set the validation time -+ params.setDate(new Date(111, 11, 25)); // 2011-12-25 -+ -+ CertPathValidator validator = CertPathValidator.getInstance("PKIX"); -+ -+ validator.validate(path, params); -+ } -+} -+ -diff -uNr -x '.hg*' jdk7u2/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ComodoHacker.java jdk7u3/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ComodoHacker.java ---- jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ComodoHacker.java 1969-12-31 19:00:00.000000000 -0500 -+++ jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/X509TrustManagerImpl/ComodoHacker.java 2012-04-17 17:49:27.000000000 -0400 -@@ -0,0 +1,305 @@ -+/* -+ * Copyright (c) 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* -+ * @test -+ * @bug 7123519 -+ * @summary Problem with java/classes_security -+ * @run main/othervm ComodoHacker PKIX -+ * @run main/othervm ComodoHacker SunX509 -+ */ -+ -+import java.net.*; -+import java.util.*; -+import java.io.*; -+import javax.net.ssl.*; -+import java.security.KeyStore; -+import java.security.cert.Certificate; -+import java.security.cert.CertificateFactory; -+import java.security.cert.X509Certificate; -+import java.security.cert.CertificateException; -+import java.security.spec.*; -+import java.security.interfaces.*; -+ -+public class ComodoHacker { -+ // DigiNotar Root CA, untrusted root certificate -+ static String trustedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1\n" + -+ "MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE\n" + -+ "ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j\n" + -+ "b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\n" + -+ "bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg\n" + -+ "U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA\n" + -+ "A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/\n" + -+ "I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3\n" + -+ "wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC\n" + -+ "AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb\n" + -+ "oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5\n" + -+ "BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p\n" + -+ "dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk\n" + -+ "MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp\n" + -+ "b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\n" + -+ "dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0\n" + -+ "MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi\n" + -+ "E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa\n" + -+ "MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI\n" + -+ "hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN\n" + -+ "95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd\n" + -+ "2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, untrusted cross-certificate -+ static String untrustedCrossCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFSDCCBLGgAwIBAgIERpwsrzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\n" + -+ "VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\n" + -+ "ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\n" + -+ "KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\n" + -+ "ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzA3\n" + -+ "MjYxNTU3MzlaFw0xMzA4MjYxNjI3MzlaMF8xCzAJBgNVBAYTAk5MMRIwEAYDVQQK\n" + -+ "EwlEaWdpTm90YXIxGjAYBgNVBAMTEURpZ2lOb3RhciBSb290IENBMSAwHgYJKoZI\n" + -+ "hvcNAQkBFhFpbmZvQGRpZ2lub3Rhci5ubDCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + -+ "ADCCAgoCggIBAKywWMEAvdghCAsrmv5uVjAFnxt3kBBBXMMNhxF3joHxynzpjGrt\n" + -+ "OHQ1u9rf+bvACTe0lnOBfTMamDn3k2+Vfz25sXWHulFI6ItwPpUExdi2wxbZiLCx\n" + -+ "hx1w2oa0DxSLes8Q0XQ2ohJ7d4ZKeeZ73wIRaKVOhq40WJskE3hWIiUeAYtLUXH7\n" + -+ "gsxZlmmIWmhTxbkNAjfLS7xmSpB+KgsFB+0WX1WQddhGyRuD4gi+8SPMmR3WKg+D\n" + -+ "IBVYJ4Iu+uIiwkmxuQGBap1tnUB3aHZOISpthECFTnaZfILz87cCWdQmARuO361T\n" + -+ "BtGuGN3isjrL14g4jqxbKbkZ05j5GAPPSIKGZgsbaQ/J6ziIeiYaBUyS1yTUlvKs\n" + -+ "Ui2jR9VS9j/+zoQGcKaqPqLytlY0GFei5IFt58rwatPHkWsCg0F8Fe9rmmRe49A8\n" + -+ "5bHre12G+8vmd0nNo2Xc97mcuOQLX5PPzDAaMhzOHGOVpfnq4XSLnukrqTB7oBgf\n" + -+ "DhgL5Vup09FsHgdnj5FLqYq80maqkwGIspH6MVzVpsFSCAnNCmOi0yKm6KHZOQaX\n" + -+ "9W6NApCMFHs/gM0bnLrEWHIjr7ZWn8Z6QjMpBz+CyeYfBQ3NTCg2i9PIPhzGiO9e\n" + -+ "7olk6R3r2ol+MqZp0d3MiJ/R0MlmIdwGZ8WUepptYkx9zOBkgLKeR46jAgMBAAGj\n" + -+ "ggEmMIIBIjASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMB\n" + -+ "BggrBgEFBQcDAgYIKwYBBQUHAwQwEQYDVR0gBAowCDAGBgRVHSAAMDMGCCsGAQUF\n" + -+ "BwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD\n" + -+ "VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9zZXJ2ZXIxLmNy\n" + -+ "bDAdBgNVHQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wCwYDVR0PBAQDAgEGMB8G\n" + -+ "A1UdIwQYMBaAFPAXYhNVPbP/CgBr+1CEl/PtYtAaMBkGCSqGSIb2fQdBAAQMMAob\n" + -+ "BFY3LjEDAgCBMA0GCSqGSIb3DQEBBQUAA4GBAEa6RcDNcEIGUlkDJUY/pWTds4zh\n" + -+ "xbVkp3wSmpwPFhx5fxTyF4HD2L60jl3aqjTB7gPpsL2Pk5QZlNsi3t4UkCV70UOd\n" + -+ "ueJRN3o/LOtk4+bjXY2lC0qTHbN80VMLqPjmaf9ghSA9hwhskdtMgRsgfd90q5QP\n" + -+ "ZFdYf+hthc3m6IcJ\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Root CA, compromised certificate -+ static String compromisedCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFijCCA3KgAwIBAgIQDHbanJEMTiye/hXQWJM8TDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDcwNTE2MTcxOTM2WhcNMjUwMzMxMTgxOTIxWjBfMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdpTm90YXIgUm9vdCBDQTEg\n" + -+ "MB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmwwggIiMA0GCSqGSIb3DQEB\n" + -+ "AQUAA4ICDwAwggIKAoICAQCssFjBAL3YIQgLK5r+blYwBZ8bd5AQQVzDDYcRd46B\n" + -+ "8cp86Yxq7Th0Nbva3/m7wAk3tJZzgX0zGpg595NvlX89ubF1h7pRSOiLcD6VBMXY\n" + -+ "tsMW2YiwsYcdcNqGtA8Ui3rPENF0NqISe3eGSnnme98CEWilToauNFibJBN4ViIl\n" + -+ "HgGLS1Fx+4LMWZZpiFpoU8W5DQI3y0u8ZkqQfioLBQftFl9VkHXYRskbg+IIvvEj\n" + -+ "zJkd1ioPgyAVWCeCLvriIsJJsbkBgWqdbZ1Ad2h2TiEqbYRAhU52mXyC8/O3AlnU\n" + -+ "JgEbjt+tUwbRrhjd4rI6y9eIOI6sWym5GdOY+RgDz0iChmYLG2kPyes4iHomGgVM\n" + -+ "ktck1JbyrFIto0fVUvY//s6EBnCmqj6i8rZWNBhXouSBbefK8GrTx5FrAoNBfBXv\n" + -+ "a5pkXuPQPOWx63tdhvvL5ndJzaNl3Pe5nLjkC1+Tz8wwGjIczhxjlaX56uF0i57p\n" + -+ "K6kwe6AYHw4YC+VbqdPRbB4HZ4+RS6mKvNJmqpMBiLKR+jFc1abBUggJzQpjotMi\n" + -+ "puih2TkGl/VujQKQjBR7P4DNG5y6xFhyI6+2Vp/GekIzKQc/gsnmHwUNzUwoNovT\n" + -+ "yD4cxojvXu6JZOkd69qJfjKmadHdzIif0dDJZiHcBmfFlHqabWJMfczgZICynkeO\n" + -+ "owIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV\n" + -+ "HQ4EFgQUiGi/4I41xDs4a2L3KDuEgcgM100wDQYJKoZIhvcNAQEFBQADggIBADsC\n" + -+ "jcs8MOhuoK3yc7NfniUTBAXT9uOLuwt5zlPe5JbF0a9zvNXD0EBVfEB/zRtfCdXy\n" + -+ "fJ9oHbtdzno5wozWmHvFg1Wo1X1AyuAe94leY12hE8JdiraKfADzI8PthV9xdvBo\n" + -+ "Y6pFITlIYXg23PFDk9Qlx/KAZeFTAnVR/Ho67zerhChXDNjU1JlWbOOi/lmEtDHo\n" + -+ "M/hklJRRl6s5xUvt2t2AC298KQ3EjopyDedTFLJgQT2EkTFoPSdE2+Xe9PpjRchM\n" + -+ "Ppj1P0G6Tss3DbpmmPHdy59c91Q2gmssvBNhl0L4eLvMyKKfyvBovWsdst+Nbwed\n" + -+ "2o5nx0ceyrm/KkKRt2NTZvFCo+H0Wk1Ya7XkpDOtXHAd3ODy63MUkZoDweoAZbwH\n" + -+ "/M8SESIsrqC9OuCiKthZ6SnTGDWkrBFfGbW1G/8iSlzGeuQX7yCpp/Q/rYqnmgQl\n" + -+ "nQ7KN+ZQ/YxCKQSa7LnPS3K94gg2ryMvYuXKAdNw23yCIywWMQzGNgeQerEfZ1jE\n" + -+ "O1hZibCMjFCz2IbLaKPECudpSyDOwR5WS5WpI2jYMNjD67BVUc3l/Su49bsRn1NU\n" + -+ "9jQZjHkJNsphFyUXC4KYcwx3dMPVDceoEkzHp1RxRy4sGn3J4ys7SN4nhKdjNrN9\n" + -+ "j6BkOSQNPXuHr2ZcdBtLc7LljPCGmbjlxd+Ewbfr\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // DigiNotar Public CA 2025, intermediate certificate -+ static String intermediateCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIGAzCCA+ugAwIBAgIQHn16Uz1FMEGWQA9xSB9FBDANBgkqhkiG9w0BAQUFADBf\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMRowGAYDVQQDExFEaWdp\n" + -+ "Tm90YXIgUm9vdCBDQTEgMB4GCSqGSIb3DQEJARYRaW5mb0BkaWdpbm90YXIubmww\n" + -+ "HhcNMDYwMjA2MTYwNzAyWhcNMjUwMzI4MTYwNzAyWjBmMQswCQYDVQQGEwJOTDES\n" + -+ "MBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdpTm90YXIgUHVibGljIENB\n" + -+ "IDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5vdGFyLm5sMIIBIjANBgkq\n" + -+ "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/2eu/I5fMG8lbvPph3e8zfJpZQtg/72\n" + -+ "Yx29+ivtKehiF6A3n785XyoY6IT3vlCrhy1CbMOY3M0x1n4YQlv17B0XZ/DqHyBA\n" + -+ "SQvnDNbkM9j4NoSy/sRtGsP6PetIFFjrhE9whZuvuSUC1PY4PruEEJp8zOCx4+wU\n" + -+ "Zt9xvjy4Xra+bSia5rwccQ/R5FYTGKrYCthOy9C9ud5Fhd++rlVhgdA/78w+Cs2s\n" + -+ "xS4i0MAxG75P3/e/bATJKepbydHdDjkyz9o3RW/wdPUXhzEw4EwUjYg6XJrDzMad\n" + -+ "6aL9M/eaxDjgz6o48EaWRDrGptaE2uJRuErVz7oOO0p/wYKq/BU+/wIDAQABo4IB\n" + -+ "sjCCAa4wOgYIKwYBBQUHAQEELjAsMCoGCCsGAQUFBzABhh5odHRwOi8vdmFsaWRh\n" + -+ "dGlvbi5kaWdpbm90YXIubmwwHwYDVR0jBBgwFoAUiGi/4I41xDs4a2L3KDuEgcgM\n" + -+ "100wEgYDVR0TAQH/BAgwBgEB/wIBADCBxgYDVR0gBIG+MIG7MIG4Bg5ghBABh2kB\n" + -+ "AQEBBQIGBDCBpTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpbm90YXIubmwv\n" + -+ "Y3BzMHoGCCsGAQUFBwICMG4abENvbmRpdGlvbnMsIGFzIG1lbnRpb25lZCBvbiBv\n" + -+ "dXIgd2Vic2l0ZSAod3d3LmRpZ2lub3Rhci5ubCksIGFyZSBhcHBsaWNhYmxlIHRv\n" + -+ "IGFsbCBvdXIgcHJvZHVjdHMgYW5kIHNlcnZpY2VzLjBDBgNVHR8EPDA6MDigNqA0\n" + -+ "hjJodHRwOi8vc2VydmljZS5kaWdpbm90YXIubmwvY3JsL3Jvb3QvbGF0ZXN0Q1JM\n" + -+ "LmNybDAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFN8zwK+S/jf8ttgWFtDZsZHV\n" + -+ "+m6lMA0GCSqGSIb3DQEBBQUAA4ICAQCfV1rmBd9QStEyQ40lT0tqby0/3ez0STuJ\n" + -+ "ESBQLQD56XYdb4VFSuqA6xTtiuSVHLoiv2xyISN9FvX3A5VtifkJ00JEaLQJiSsE\n" + -+ "wGDkYGl1DT7SsqtAVKdMAuCM+e0j0/RV3hZ6kcrM7/wFccHwM+/TiurR9lgZDzB4\n" + -+ "a7++A4XrYyKx9vc9ZwBEnD1nrAe7++gg9cuZgP7e+QL0FBHMjpw+gnCDjr2dzBZC\n" + -+ "4r+b8SOqlbPRPexBuNghlc7PfcPIyFis2LJXDRMWiAd3TcfdALwRsuKMR/T+cwyr\n" + -+ "asy69OEGHplLT57otQ524BDctDXNzlH9bHEh52QzqkWvIDqs42910IUy1nYNPIUG\n" + -+ "yYJV/T7H8Jb6vfMZWe47iUFvtNZCi8+b542gRUwdi+ca+hGviBC9Qr4Wv1pl7CBQ\n" + -+ "Hy1axTkHiQawUo/hgmoetCpftugl9yJTfvsBorUV1ZMxn9B1JLSGtWnbUsFRla7G\n" + -+ "fNa0IsUkzmmha8XCzvNu0d1PDGtcQyUqmDOE1Hx4cIBeuF8ipuIXkrVCr9zAZ4ZC\n" + -+ "hgz6aA1gDTW8whSRJqYEYEQ0pcMEFLyXE+Nz3O8NinO2AuxqKhjMk13203xA7lPY\n" + -+ "MnBQ0v7S3qqbp/pvPMiUhOz/VaYted6QmOY5EATBnFiLCuw87JXoAyp382eJ3WX1\n" + -+ "hOiR4IX9Tg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ // The fraudulent certificate issued by above compromised CA -+ static String targetCertStr = -+ "-----BEGIN CERTIFICATE-----\n" + -+ "MIIFKDCCBBCgAwIBAgIQBeLmpM0J6lTWZbB1/iKiVjANBgkqhkiG9w0BAQUFADBm\n" + -+ "MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdp\n" + -+ "Tm90YXIgUHVibGljIENBIDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5v\n" + -+ "dGFyLm5sMB4XDTExMDcxMDE5MDYzMFoXDTEzMDcwOTE5MDYzMFowajELMAkGA1UE\n" + -+ "BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxFjAUBgNVBAcTDU1vdW50YWluIFZp\n" + -+ "ZXcxFzAVBgNVBAUTDlBLMDAwMjI5MjAwMDAyMRUwEwYDVQQDEwwqLmdvb2dsZS5j\n" + -+ "b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNbeKubCV0aCxhOiOS\n" + -+ "CSQ/w9HXTYuD5BLKuiqXNw3setdTymeJz2L8aWOHo3nicFNDVwWTgwWomGNr2J6Q\n" + -+ "7g1iINNSW0rR4E1l2szRkcnAY6c6i/Eke93nF4i2hDsnIBveolF5yjpuRm73uQQD\n" + -+ "ulHjA3BFRF/PTi0fw2/Yt+8ieoMuNcMWN6Eou5Gqt5YZkWv176ofeCbsBmMrP87x\n" + -+ "OhhtTDckCapk4VQZG2XrfzZcV6tdzCp5TI8uHdu17cdzXm1imZ8tyvzFeiCEOQN8\n" + -+ "vPNzB/fIr3CJQ5q4uM5aKT3DD5PeVzf4rfJKQNgCTWiIBc9XcWEUuszwAsnmg7e2\n" + -+ "EJRdAgMBAAGjggHMMIIByDA6BggrBgEFBQcBAQQuMCwwKgYIKwYBBQUHMAGGHmh0\n" + -+ "dHA6Ly92YWxpZGF0aW9uLmRpZ2lub3Rhci5ubDAfBgNVHSMEGDAWgBTfM8Cvkv43\n" + -+ "/LbYFhbQ2bGR1fpupTAJBgNVHRMEAjAAMIHGBgNVHSAEgb4wgbswgbgGDmCEEAGH\n" + -+ "aQEBAQIEAQICMIGlMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2lub3Rhci5u\n" + -+ "bC9jcHMwegYIKwYBBQUHAgIwbhpsQ29uZGl0aW9ucywgYXMgbWVudGlvbmVkIG9u\n" + -+ "IG91ciB3ZWJzaXRlICh3d3cuZGlnaW5vdGFyLm5sKSwgYXJlIGFwcGxpY2FibGUg\n" + -+ "dG8gYWxsIG91ciBwcm9kdWN0cyBhbmQgc2VydmljZXMuMEkGA1UdHwRCMEAwPqA8\n" + -+ "oDqGOGh0dHA6Ly9zZXJ2aWNlLmRpZ2lub3Rhci5ubC9jcmwvcHVibGljMjAyNS9s\n" + -+ "YXRlc3RDUkwuY3JsMA4GA1UdDwEB/wQEAwIEsDAbBgNVHREEFDASgRBhZG1pbkBn\n" + -+ "b29nbGUuY29tMB0GA1UdDgQWBBQHSn0WJzIo0eMBMQUNsMqN6eF/7TANBgkqhkiG\n" + -+ "9w0BAQUFAAOCAQEAAs5dL7N9wzRJkI4Aq4lC5t8j5ZadqnqUcgYLADzSv4ExytNH\n" + -+ "UY2nH6iVTihC0UPSsILWraoeApdT7Rphz/8DLQEBRGdeKWAptNM3EbiXtQaZT2uB\n" + -+ "pidL8UoafX0kch3f71Y1scpBEjvu5ZZLnjg0A8AL0tnsereOVdDpU98bKqdbbrnM\n" + -+ "FRmBlSf7xdaNca6JJHeEpga4E9Ty683CmccrSGXdU2tTCuHEJww+iOAUtPIZcsum\n" + -+ "U7/eYeY1pMyGLyIjbNgRY7nDzRwvM/BsbL9eh4/mSQj/4nncqJd22sVQpCggQiVK\n" + -+ "baB2sVGcVNBkK55bT8gPqnx8JypubyUvayzZGg==\n" + -+ "-----END CERTIFICATE-----"; -+ -+ private static String tmAlgorithm; // trust manager -+ -+ public static void main(String args[]) throws Exception { -+ // Get the customized arguments. -+ parseArguments(args); -+ -+ X509TrustManager tm = getTrustManager(); -+ X509Certificate[] chain = getFraudulentChain(); -+ -+ Exception reservedException = null; -+ try { -+ tm.checkClientTrusted(chain, "RSA"); -+ } catch (CertificateException ce) { -+ reservedException = ce; -+ } -+ -+ if (reservedException == null) { -+ throw new Exception("Unable to block fraudulent certificate"); -+ } -+ -+ reservedException = null; -+ try { -+ tm.checkServerTrusted(chain, "RSA"); -+ } catch (CertificateException ce) { -+ reservedException = ce; -+ } -+ -+ if (reservedException == null) { -+ throw new Exception("Unable to block fraudulent certificate"); -+ } -+ -+ System.out.println( -+ "The expected untrusted cert exception: " + reservedException); -+ } -+ -+ private static void parseArguments(String[] args) { -+ tmAlgorithm = args[0]; -+ } -+ -+ private static X509TrustManager getTrustManager() throws Exception { -+ // generate certificate from cert string -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ // create a key store -+ KeyStore ks = KeyStore.getInstance("JKS"); -+ ks.load(null, null); -+ -+ // import the trusted cert -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(trustedCertStr.getBytes())) { -+ Certificate trustedCert = cf.generateCertificate(is); -+ ks.setCertificateEntry("RSA Export Signer", trustedCert); -+ } -+ -+ // create the trust manager -+ TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlgorithm); -+ tmf.init(ks); -+ -+ return (X509TrustManager)tmf.getTrustManagers()[0]; -+ } -+ -+ private static X509Certificate[] getFraudulentChain() throws Exception { -+ // generate certificate from cert string -+ CertificateFactory cf = CertificateFactory.getInstance("X.509"); -+ -+ X509Certificate[] chain = new X509Certificate[4]; -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(targetCertStr.getBytes())) { -+ chain[0] = (X509Certificate)cf.generateCertificate(is); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(intermediateCertStr.getBytes())) { -+ chain[1] = (X509Certificate)cf.generateCertificate(is); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(compromisedCertStr.getBytes())) { -+ chain[2] = (X509Certificate)cf.generateCertificate(is); -+ } -+ -+ try (ByteArrayInputStream is = -+ new ByteArrayInputStream(untrustedCrossCertStr.getBytes())) { -+ chain[3] = (X509Certificate)cf.generateCertificate(is); -+ } -+ -+ return chain; -+ } -+} -+ diff --git a/java/openjdk7/files/patch-zzz-nio-kqueue b/java/openjdk7/files/patch-zzz-nio-kqueue deleted file mode 100644 index 86ac1f474ef6..000000000000 --- a/java/openjdk7/files/patch-zzz-nio-kqueue +++ /dev/null @@ -1,1227 +0,0 @@ ---- jdk/src/share/classes/sun/nio/ch/KqueueSelectorProvider.java (revision 0) -+++ jdk/src/share/classes/sun/nio/ch/KqueueSelectorProvider.java (revision 16) -@@ -0,0 +1,17 @@ -+package sun.nio.ch; -+ -+import java.io.IOException; -+import java.nio.channels.*; -+import java.nio.channels.spi.*; -+ -+public class KqueueSelectorProvider -+ extends SelectorProviderImpl -+{ -+ public AbstractSelector openSelector() throws IOException { -+ return new KqueueSelectorImpl(this); -+ } -+ -+ public Channel inheritedChannel() throws IOException { -+ return InheritedChannel.getChannel(); -+ } -+} ---- jdk/src/solaris/native/sun/nio/ch/KqueuePort.c (revision 0) -+++ jdk/src/solaris/native/sun/nio/ch/KqueuePort.c (revision 16) -@@ -0,0 +1,67 @@ -+/* -+ * Scratched by davidxu@freebsd.org -+ */ -+ -+#include "jni.h" -+#include "jni_util.h" -+#include "jvm.h" -+#include "jlong.h" -+#include "nio_util.h" -+ -+#include "sun_nio_ch_KqueuePort.h" -+ -+#include <unistd.h> -+#include <sys/types.h> -+#include <sys/socket.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+JNIEXPORT void JNICALL -+Java_sun_nio_ch_KqueuePort_socketpair -+ (JNIEnv *env, jclass cls, jintArray sv) -+{ -+ int sp[2]; -+ if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) == -1) { -+ JNU_ThrowIOExceptionWithLastError(env, "socketpair failed"); -+ } else { -+ jint res[2]; -+ res[0] = (jint)sp[0]; -+ res[1] = (jint)sp[1]; -+ (*env)->SetIntArrayRegion(env, sv, 0, 2, &res[0]); -+ } -+} -+ -+JNIEXPORT void JNICALL Java_sun_nio_ch_KqueuePort_interrupt -+ (JNIEnv *env, jclass cls, jint fd) -+{ -+ int res; -+ int buf[1]; -+ buf[0] = 1; -+ RESTARTABLE(write(fd, buf, 1), res); -+ if (res < 0) { -+ JNU_ThrowIOExceptionWithLastError(env, "write failed"); -+ } -+} -+ -+JNIEXPORT void JNICALL Java_sun_nio_ch_KqueuePort_drain1 -+ (JNIEnv *env, jclass cls, jint fd) -+{ -+ int res; -+ char buf[1]; -+ RESTARTABLE(read(fd, buf, 1), res); -+ if (res < 0) { -+ JNU_ThrowIOExceptionWithLastError(env, "drain1 failed"); -+ } -+} -+ -+JNIEXPORT void JNICALL Java_sun_nio_ch_KqueuePort_close0 -+ (JNIEnv *env, jclass cls, jint fd) -+{ -+ int res; -+ RESTARTABLE(close(fd), res); -+} -+ -+#ifdef __cplusplus -+} -+#endif ---- jdk/src/solaris/native/sun/nio/ch/Kqueue.c (revision 0) -+++ jdk/src/solaris/native/sun/nio/ch/Kqueue.c (revision 16) -@@ -0,0 +1,174 @@ -+/* -+ * Scratched by davidxu@freebsd.org -+ */ -+ -+#include "jni.h" -+#include "jni_util.h" -+#include "jvm.h" -+#include "jlong.h" -+ -+#include "sun_nio_ch_Kqueue.h" -+ -+#include <errno.h> -+#include <sys/types.h> -+#include <sys/event.h> -+#include <sys/time.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+static int -+restartable_kevent(int kqfd, struct kevent *changelist, int nchanges, -+ struct kevent *eventlist, int nevents); -+ -+static int -+timeout_kevent(int kqfd, struct kevent *changelist, int nchanges, -+ struct kevent *eventlist, int nevents, int timo); -+ -+JNIEXPORT jint JNICALL Java_sun_nio_ch_Kqueue_kqueue -+ (JNIEnv *env, jclass cls) -+{ -+ int kqfd = kqueue(); -+ if (kqfd < 0) { -+ JNU_ThrowIOExceptionWithLastError(env, "Error opening kqueue"); -+ return -1; -+ } -+ return kqfd; -+} -+ -+JNIEXPORT jint JNICALL Java_sun_nio_ch_Kqueue_keventChange -+ (JNIEnv *env, jclass cls, jint kqfd, jint fd, jshort flags, jshort filter) -+{ -+ struct kevent ev; -+ struct timespec ts; -+ -+ ev.ident = fd; -+ ev.flags = flags; -+ ev.filter = filter; -+ ev.fflags = 0; -+ ev.data = 0; -+ ev.udata = NULL; -+ ts.tv_sec = 0; -+ ts.tv_nsec = 0; -+ if (kevent(kqfd, &ev, 1, NULL, 0, &ts) < 0) -+ JNU_ThrowIOExceptionWithLastError(env, "Error changing kevent"); -+ return (0); -+} -+ -+JNIEXPORT jint JNICALL Java_sun_nio_ch_Kqueue_kevent -+ (JNIEnv *env, jclass cls, jint kqfd , jlong changelist_addr, jint nchanges, -+ jlong eventlist_addr, jint nevents, jlong timeout) -+{ -+ struct kevent *changelist = (struct kevent *)jlong_to_ptr(changelist_addr); -+ struct kevent *eventlist = (struct kevent *)jlong_to_ptr(eventlist_addr); -+ int result; -+ -+ if (timeout < 0) { -+ result = restartable_kevent(kqfd, changelist, nchanges, -+ eventlist, nevents); -+ } else { -+ result = timeout_kevent(kqfd, changelist, nchanges, eventlist, -+ nevents, timeout); -+ } -+ -+ if (result < 0) { -+ JNU_ThrowIOExceptionWithLastError(env, "Error reading driver"); -+ return -1; -+ } -+ return result; -+} -+ -+static int -+restartable_kevent(int kqfd, struct kevent *changelist, int nchanges, -+ struct kevent *eventlist, int nevents) -+{ -+ int result; -+ -+ for (;;) { -+ result = kevent(kqfd, changelist, nchanges, eventlist, -+ nevents, NULL); -+ if (result == -1 && errno == EINTR) { -+ continue; -+ } else { -+ return result; -+ } -+ } -+} -+ -+static int -+timeout_kevent(int kqfd, struct kevent *changelist, int nchanges, -+ struct kevent *eventlist, int nevents, int timo) -+{ -+ struct timeval timeout, now, end; -+ int result; -+ -+ timeout.tv_sec = timo / 1000; -+ timeout.tv_usec = (timo % 1000) * 1000; -+ gettimeofday(&now, NULL); -+ timeradd(&now, &timeout, &end); -+ -+ for (;;) { -+ struct timespec ts; -+ -+ ts.tv_sec = timeout.tv_sec; -+ ts.tv_nsec = timeout.tv_usec * 1000; -+ result = kevent(kqfd, changelist, nchanges, eventlist, nevents, -+ &ts); -+ if (result == -1 && (errno == EINTR)) { -+ gettimeofday(&now, NULL); -+ if (timercmp(&now, &end, >=)) -+ return 0; -+ timersub(&end, &now, &timeout); -+ } else { -+ return result; -+ } -+ } -+} -+ -+JNIEXPORT jint JNICALL Java_sun_nio_ch_Kqueue_keventSize -+ (JNIEnv *env, jclass cls) -+{ -+ return sizeof(struct kevent); -+} -+ -+JNIEXPORT void JNICALL Java_sun_nio_ch_Kqueue_putKevent -+ (JNIEnv *env, jclass cls, jlong address, jint index, jint fd, jshort flags, jshort filter) -+{ -+ struct kevent *ev = (struct kevent *)jlong_to_ptr(address); -+ -+ ev[index].ident = fd; -+ ev[index].flags = flags; -+ ev[index].filter = filter; -+ ev[index].fflags = 0; -+ ev[index].data = 0; -+ ev[index].udata = NULL; -+} -+ -+JNIEXPORT jshort JNICALL Java_sun_nio_ch_Kqueue_getKeventFilter -+ (JNIEnv *env, jclass cls, jlong address, jint index) -+{ -+ struct kevent *ev = (struct kevent *)jlong_to_ptr(address); -+ -+ return ev[index].filter; -+} -+ -+JNIEXPORT jshort JNICALL Java_sun_nio_ch_Kqueue_getKeventFlags -+ (JNIEnv *env, jclass cls, jlong address, jint index) -+{ -+ struct kevent *ev = (struct kevent *)jlong_to_ptr(address); -+ -+ return ev[index].flags; -+} -+ -+JNIEXPORT jint JNICALL Java_sun_nio_ch_Kqueue_getKeventIdent -+ (JNIEnv *env, jclass cls, jlong address, jint index) -+{ -+ struct kevent *ev = (struct kevent *)jlong_to_ptr(address); -+ -+ return (int)ev[index].ident; -+} -+ -+#ifdef __cplusplus -+} -+#endif ---- jdk/src/solaris/native/sun/nio/ch/KqueueArrayWrapper.c (revision 0) -+++ jdk/src/solaris/native/sun/nio/ch/KqueueArrayWrapper.c (revision 16) -@@ -0,0 +1,30 @@ -+/* -+ * Scratched by davidxu@freebsd.org -+ */ -+ -+#include "jni.h" -+#include "jni_util.h" -+#include "jvm.h" -+#include "jlong.h" -+#include "nio_util.h" -+ -+#include "sun_nio_ch_KqueueArrayWrapper.h" -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+JNIEXPORT void JNICALL Java_sun_nio_ch_KqueueArrayWrapper_interrupt -+ (JNIEnv *env, jclass cls, jint fd) -+{ -+ int fakebuf[1]; -+ fakebuf[0] = 1; -+ if (write(fd, fakebuf, 1) < 0) { -+ JNU_ThrowIOExceptionWithLastError(env, -+ "Write to interrupt fd failed"); -+ } -+} -+ -+#ifdef __cplusplus -+} -+#endif ---- jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java (revision 1) -+++ jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java (revision 16) -@@ -47,6 +47,10 @@ - public static SelectorProvider create() { - String osname = AccessController.doPrivileged( - new GetPropertyAction("os.name")); -+ if ("FreeBSD".equals(osname)) { -+ return new sun.nio.ch.KqueueSelectorProvider(); -+ } -+ - if ("SunOS".equals(osname)) { - return new sun.nio.ch.DevPollSelectorProvider(); - } ---- jdk/src/solaris/classes/sun/nio/ch/KqueueSelectorImpl.java (revision 0) -+++ jdk/src/solaris/classes/sun/nio/ch/KqueueSelectorImpl.java (revision 16) -@@ -0,0 +1,203 @@ -+/* -+ * scratched by davidxu@freebsd.org -+ */ -+ -+package sun.nio.ch; -+ -+import java.io.IOException; -+import java.nio.channels.*; -+import java.nio.channels.spi.*; -+import java.util.*; -+import sun.misc.*; -+ -+ -+/** -+ * An implementation of Selector for FreeBSD. -+ */ -+class KqueueSelectorImpl -+ extends SelectorImpl -+{ -+ -+ // File descriptors used for interrupt -+ protected int fd0; -+ protected int fd1; -+ -+ // The kqueue object -+ KqueueArrayWrapper kqueueWrapper; -+ -+ // The number of valid channels in this Selector's poll array -+ private int totalChannels; -+ -+ // Maps from file descriptors to keys -+ private HashMap fdToKey; -+ -+ // True if this Selector has been closed -+ private boolean closed = false; -+ -+ // Lock for interrupt triggering and clearing -+ private Object interruptLock = new Object(); -+ private boolean interruptTriggered = false; -+ -+ private BitSet updatedSet; -+ -+ /** -+ * Package private constructor called by factory method in -+ * the abstract superclass Selector. -+ */ -+ KqueueSelectorImpl(SelectorProvider sp) { -+ super(sp); -+ long pipeFds = IOUtil.makePipe(false); -+ fd0 = (int) (pipeFds >>> 32); -+ fd1 = (int) pipeFds; -+ kqueueWrapper = new KqueueArrayWrapper(); -+ totalChannels = 1; -+ kqueueWrapper.initInterrupt(fd0, fd1); -+ updatedSet = new BitSet(); -+ fdToKey = new HashMap(); -+ } -+ -+ protected int doSelect(long timeout) -+ throws IOException -+ { -+ if (closed) -+ throw new ClosedSelectorException(); -+ processDeregisterQueue(); -+ try { -+ begin(); -+ kqueueWrapper.poll(timeout); -+ } finally { -+ end(); -+ } -+ processDeregisterQueue(); -+ int numKeysUpdated = updateSelectedKeys(); -+ if (kqueueWrapper.interrupted()) { -+ // Clear the wakeup pipe -+ synchronized (interruptLock) { -+ kqueueWrapper.clearInterrupted(); -+ IOUtil.drain(fd0); -+ interruptTriggered = false; -+ } -+ } -+ return numKeysUpdated; -+ } -+ -+ /** -+ * Update the keys whose fd's have been selected by the kqueue. -+ * Add the ready keys to the ready queue. -+ */ -+ private int updateSelectedKeys() { -+ int entries = kqueueWrapper.updated; -+ int numKeysUpdated = 0; -+ SelectionKeyImpl ski; -+ int fd; -+ int i; -+ -+ updatedSet.clear(); -+ for (i = 0; i < entries; i++) { -+ fd = kqueueWrapper.getDescriptor(i); -+ ski = (SelectionKeyImpl) fdToKey.get(new Integer(fd)); -+ // ski is null in the case of an interrupt -+ if (ski != null) -+ ski.nioReadyOps(0); -+ } -+ -+ for (i = 0; i < entries; i++) { -+ fd = kqueueWrapper.getDescriptor(i); -+ ski = (SelectionKeyImpl) fdToKey.get(new Integer(fd)); -+ // ski is null in the case of an interrupt -+ if (ski != null) { -+ int rOps = kqueueWrapper.getReventOps(i); -+ if (selectedKeys.contains(ski)) { -+ if (ski.channel.translateAndUpdateReadyOps(rOps, ski)) { -+ if (!updatedSet.get(fd)) { -+ updatedSet.set(fd); -+ numKeysUpdated++; -+ } -+ } -+ } else { -+ ski.channel.translateAndSetReadyOps(rOps, ski); -+ if ((ski.nioReadyOps() & ski.nioInterestOps()) != 0) { -+ selectedKeys.add(ski); -+ if (!updatedSet.get(fd)) { -+ updatedSet.set(fd); -+ numKeysUpdated++; -+ } -+ } -+ } -+ } -+ } -+ return numKeysUpdated; -+ } -+ -+ protected void implClose() throws IOException { -+ if (!closed) { -+ closed = true; -+ FileDispatcherImpl.closeIntFD(fd0); -+ FileDispatcherImpl.closeIntFD(fd1); -+ if (kqueueWrapper != null) { -+ kqueueWrapper.release(fd0); -+ kqueueWrapper.closeKqueueFD(); -+ kqueueWrapper = null; -+ selectedKeys = null; -+ -+ // Deregister channels -+ Iterator<SelectionKey> i = keys.iterator(); -+ while (i.hasNext()) { -+ SelectionKeyImpl ski = (SelectionKeyImpl)i.next(); -+ deregister(ski); -+ SelectableChannel selch = ski.channel(); -+ if (!selch.isOpen() && !selch.isRegistered()) -+ ((SelChImpl)selch).kill(); -+ i.remove(); -+ } -+ totalChannels = 0; -+ -+ } -+ fd0 = -1; -+ fd1 = -1; -+ } -+ } -+ -+ protected void implRegister(SelectionKeyImpl ski) { -+ int fd = IOUtil.fdVal(ski.channel.getFD()); -+ fdToKey.put(new Integer(fd), ski); -+ totalChannels++; -+ keys.add(ski); -+ } -+ -+ protected void implDereg(SelectionKeyImpl ski) throws IOException { -+ int i = ski.getIndex(); -+ assert (i >= 0); -+ int fd = ski.channel.getFDVal(); -+ fdToKey.remove(new Integer(fd)); -+ kqueueWrapper.release(fd); -+ totalChannels--; -+ ski.setIndex(-1); -+ keys.remove(ski); -+ selectedKeys.remove(ski); -+ deregister((AbstractSelectionKey)ski); -+ SelectableChannel selch = ski.channel(); -+ if (!selch.isOpen() && !selch.isRegistered()) -+ ((SelChImpl)selch).kill(); -+ } -+ -+ void putEventOps(SelectionKeyImpl sk, int ops) { -+ int fd = IOUtil.fdVal(sk.channel.getFD()); -+ kqueueWrapper.setInterest(fd, ops); -+ } -+ -+ public Selector wakeup() { -+ synchronized (interruptLock) { -+ if (!interruptTriggered) { -+ kqueueWrapper.interrupt(); -+ interruptTriggered = true; -+ } -+ } -+ return this; -+ } -+ -+ static { -+ Util.load(); -+ } -+ -+} ---- jdk/src/solaris/classes/sun/nio/ch/Kqueue.java (revision 0) -+++ jdk/src/solaris/classes/sun/nio/ch/Kqueue.java (revision 16) -@@ -0,0 +1,49 @@ -+/* -+ * Scratched by davidxu@freebsd.org -+ */ -+ -+package sun.nio.ch; -+ -+import java.io.IOException; -+import sun.misc.Unsafe; -+ -+class Kqueue { -+ // Kevent filters -+ static final short EVFILT_READ = -1; -+ static final short EVFILT_WRITE = -2; -+ -+ // Kevent flags -+ static final short EV_ADD = 0x0001; -+ static final short EV_DELETE = 0x0002; -+ static final short EV_ONESHOT = 0x0010; -+ static final short EV_ERROR = 0x4000; -+ -+ private static final Unsafe unsafe = Unsafe.getUnsafe(); -+ static final int SIZEOF_KEVENT = keventSize(); -+ -+ private Kqueue() {} -+ -+ /** -+ * Allocates a poll array to handle up to {@code count} events. -+ */ -+ static long allocatePollArray(int count) { -+ return unsafe.allocateMemory(count * SIZEOF_KEVENT); -+ } -+ -+ /** -+ * Free a poll array -+ */ -+ static void freePollArray(long address) { -+ unsafe.freeMemory(address); -+ } -+ -+ static native int kqueue(); -+ static native int keventChange(int kqfd, int fd, short flags, short filter); -+ static native int kevent(int kqfd, long changeList, int nchanges, long eventList, -+ int nevents, long timeout); -+ static native int keventSize(); -+ static native void putKevent(long address, int index, int fd, short flag, short filter); -+ static native short getKeventFilter(long address, int index); -+ static native short getKeventFlags(long address, int index); -+ static native int getKeventIdent(long address, int index); -+} ---- jdk/src/solaris/classes/sun/nio/ch/KqueueArrayWrapper.java (revision 0) -+++ jdk/src/solaris/classes/sun/nio/ch/KqueueArrayWrapper.java (revision 16) -@@ -0,0 +1,211 @@ -+/* -+ * Scratched by davidxu@freebsd.org -+ */ -+ -+package sun.nio.ch; -+ -+import sun.misc.*; -+import java.io.IOException; -+import java.util.HashMap; -+import java.util.Set; -+import java.util.Arrays; -+import static sun.nio.ch.Kqueue.*; -+ -+class KqueueArrayWrapper { -+ -+ // Event masks copied from class AbstractPollArrayWrapper -+ static final short POLLIN = 0x0001; -+ static final short POLLOUT = 0x0004; -+ static final short POLLERR = 0x0008; -+ static final short POLLHUP = 0x0010; -+ static final short POLLNVAL = 0x0020; -+ static final short POLLREMOVE = 0x0800; -+ -+ // Zero mask to unregister events from kqueue -+ static final Integer ZERO_MASK = new Integer(0); -+ -+ // Capacity increment of some arrays -+ static final int capacityIncr = 100; -+ -+ KqueueArrayWrapper() { -+ int allocationSize; -+ -+ // initial size of event array -+ pollKeventSize = capacityIncr * 2; -+ allocationSize = pollKeventSize * SIZEOF_KEVENT; -+ pollKeventArray = new AllocatedNativeObject(allocationSize, true); -+ kqfd = kqueue(); -+ } -+ -+ // Machinery for remembering fd registration changes -+ private HashMap<Integer, Integer> updateMap = new HashMap<Integer, Integer>(); -+ private int[] oldMasks = new int[capacityIncr]; -+ -+ // kevent array to receive -+ private AllocatedNativeObject pollKeventArray; -+ -+ // current size of pollKeventArray -+ int pollKeventSize; -+ -+ // the pollKeventSize should be larger than this -+ int nextKeventSize; -+ -+ // The fd of the kqueue() -+ int kqfd; -+ -+ // The fd of the interrupt line going out -+ int outgoingInterruptFD; -+ -+ // The fd of the interrupt line coming in -+ int incomingInterruptFD; -+ -+ // The index of the interrupt FD -+ int interruptedIndex; -+ -+ // Number of updated kevent entries -+ int updated; -+ -+ // ensure some array sizes are large enough with a given file handle -+ void ensureFd(int fd) { -+ ensureNextEventFd(fd); -+ if (oldMasks.length < fd+1) -+ oldMasks = Arrays.copyOf(oldMasks, fd+capacityIncr); -+ } -+ -+ void ensureNextEventFd(int fd) { -+ // each file handle may have two filters, read and write. -+ if (nextKeventSize / 2 < fd+1) -+ nextKeventSize = (fd+1) * 2; -+ } -+ -+ void resizeEventBuffer() { -+ if (nextKeventSize > pollKeventSize) { -+ pollKeventArray.free(); -+ pollKeventSize = nextKeventSize + capacityIncr * 2; -+ int allocationSize = pollKeventSize * SIZEOF_KEVENT; -+ pollKeventArray = new AllocatedNativeObject(allocationSize, true); -+ } -+ } -+ -+ void initInterrupt(int fd0, int fd1) { -+ outgoingInterruptFD = fd1; -+ incomingInterruptFD = fd0; -+ ensureFd(fd0); -+ keventChange(kqfd, fd0, EV_ADD, EVFILT_READ); -+ } -+ -+ int getReventOps(int i) { -+ short filter = getKeventFilter(pollKeventArray.address(), i); -+ short flags = getKeventFlags(pollKeventArray.address(), i); -+ if ((flags & EV_ERROR) != 0) -+ return POLLERR; -+ if (filter == EVFILT_READ) -+ return POLLIN; -+ if (filter == EVFILT_WRITE) -+ return POLLOUT; -+ return (0); -+ } -+ -+ int getDescriptor(int i) { -+ return getKeventIdent(pollKeventArray.address(), i); -+ } -+ -+ void setInterest(int fd, int mask) { -+ if (fd <0) -+ throw new IllegalArgumentException("file handle less than 0"); -+ synchronized (updateMap) { -+ ensureFd(fd); -+ updateMap.put(new Integer(fd), new Integer(mask)); -+ } -+ } -+ -+ void release(int fd) { -+ synchronized (updateMap) { -+ updateMap.put(new Integer(fd), ZERO_MASK); -+ } -+ } -+ -+ void closeKqueueFD() throws IOException { -+ FileDispatcherImpl.closeIntFD(kqfd); -+ pollKeventArray.free(); -+ } -+ -+ int poll(long timeout) { -+ int changeCount = updateRegistrations(); -+ updated = kevent(kqfd, pollKeventArray.address(), changeCount, -+ pollKeventArray.address(), pollKeventSize, timeout); -+ for (int i = 0; i < updated; i++) { -+ if (getDescriptor(i) == incomingInterruptFD) { -+ interruptedIndex = i; -+ interrupted = true; -+ break; -+ } -+ } -+ return updated; -+ } -+ -+ int updateRegistrations() { -+ int index = 0; -+ synchronized (updateMap) { -+ resizeEventBuffer(); -+ -+ Set<Integer> s = updateMap.keySet(); -+ /* -+ * Because resizeEventBuffer may reallocate event buffer, -+ * we must retrieve fresh address here. -+ */ -+ long address = pollKeventArray.address(); -+ -+ for (Integer fd : s) { -+ Integer newmask = updateMap.get(fd); -+ int oldmask = oldMasks[fd]; -+ if ((oldmask & POLLIN) != 0) { -+ if ((newmask & POLLIN) == 0) { -+ putKevent(address, index, fd.intValue(), EV_DELETE, EVFILT_READ); -+ index++; -+ } -+ } else { -+ if ((newmask & POLLIN) != 0) { -+ putKevent(address, index, fd.intValue(), EV_ADD, EVFILT_READ); -+ index++; -+ } -+ } -+ -+ if ((oldmask & POLLOUT) != 0) { -+ if ((newmask & POLLOUT) == 0) { -+ putKevent(address, index, fd.intValue(), EV_DELETE, EVFILT_WRITE); -+ index++; -+ } -+ } else { -+ if ((newmask & POLLOUT) != 0) { -+ putKevent(address, index, fd.intValue(), EV_ADD, EVFILT_WRITE); -+ index++; -+ } -+ } -+ oldMasks[fd] = newmask; -+ } -+ updateMap.clear(); -+ } -+ return index; -+ } -+ -+ boolean interrupted = false; -+ -+ public void interrupt() { -+ interrupt(outgoingInterruptFD); -+ } -+ -+ public int interruptedIndex() { -+ return interruptedIndex; -+ } -+ -+ boolean interrupted() { -+ return interrupted; -+ } -+ -+ void clearInterrupted() { -+ interrupted = false; -+ } -+ -+ private static native void interrupt(int fd); -+} ---- jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java (revision 1) -+++ jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java (revision 16) -@@ -46,6 +46,8 @@ - public static AsynchronousChannelProvider create() { - String osname = AccessController - .doPrivileged(new GetPropertyAction("os.name")); -+ if (osname.equals("FreeBSD")) -+ return new FreeBSDAsynchronousChannelProvider(); - if (osname.equals("SunOS")) - return new SolarisAsynchronousChannelProvider(); - if (osname.equals("Linux")) ---- jdk/src/solaris/classes/sun/nio/ch/KqueuePort.java (revision 0) -+++ jdk/src/solaris/classes/sun/nio/ch/KqueuePort.java (revision 16) -@@ -0,0 +1,321 @@ -+/* -+ * Scratched by davidxu@FreeBSD.org -+ */ -+ -+package sun.nio.ch; -+ -+import java.nio.channels.spi.AsynchronousChannelProvider; -+import java.io.IOException; -+import java.util.concurrent.ArrayBlockingQueue; -+import java.util.concurrent.RejectedExecutionException; -+import java.util.concurrent.atomic.AtomicInteger; -+import static sun.nio.ch.Kqueue.*; -+ -+/** -+ * AsynchronousChannelGroup implementation based on the FreeBSD kqueue facility. -+ */ -+ -+final class KqueuePort -+ extends Port -+{ -+/* -+ // Kevent filters -+ static final short EVFILT_READ = -1; -+ static final short EVFILT_WRITE = -2; -+ -+ // Kevent flags -+ static final char EV_ADD = 0x0001; -+ static final char EV_DELETE = 0x0002; -+ static final char EV_EOF = 0x8000; -+ static final char EV_ERROR = 0x4000; -+*/ -+ -+ // maximum number of events to poll at a time -+ private static final int MAX_KEVENTS = 512; -+ -+ // kqueue file descriptor -+ private final int kqfd; -+ -+ // true if kqueue closed -+ private boolean closed; -+ -+ // socket pair used for wakeup -+ private final int sp[]; -+ -+ // number of wakeups pending -+ private final AtomicInteger wakeupCount = new AtomicInteger(); -+ -+ // address of the poll array passed to kevent() -+ private final long address; -+ -+ // encapsulates an event for a channel -+ static class Event { -+ final PollableChannel channel; -+ final int events; -+ -+ Event(PollableChannel channel, int events) { -+ this.channel = channel; -+ this.events = events; -+ } -+ -+ PollableChannel channel() { return channel; } -+ int events() { return events; } -+ } -+ -+ // queue of events for cases that a polling thread dequeues more than one -+ // event -+ private final ArrayBlockingQueue<Event> queue; -+ private final Event NEED_TO_POLL = new Event(null, 0); -+ private final Event EXECUTE_TASK_OR_SHUTDOWN = new Event(null, 0); -+ -+ KqueuePort(AsynchronousChannelProvider provider, ThreadPool pool) -+ throws IOException -+ { -+ super(provider, pool); -+ -+ // open kqueue -+ this.kqfd = kqueue(); -+ -+ // create socket pair for wakeup mechanism -+ int[] sv = new int[2]; -+ try { -+ socketpair(sv); -+ // register one end with epoll -+ keventChange(kqfd, sv[0], EV_ADD, EVFILT_READ); -+ } catch (IOException x) { -+ close0(kqfd); -+ throw x; -+ } -+ this.sp = sv; -+ -+ // allocate the poll array -+ this.address = allocatePollArray(MAX_KEVENTS); -+ -+ // create the queue and offer the special event to ensure that the first -+ // threads polls -+ this.queue = new ArrayBlockingQueue<Event>(MAX_KEVENTS); -+ this.queue.offer(NEED_TO_POLL); -+ } -+ -+ KqueuePort start() { -+ startThreads(new EventHandlerTask()); -+ return this; -+ } -+ -+ /** -+ * Release all resources -+ */ -+ private void implClose() { -+ synchronized (this) { -+ if (closed) -+ return; -+ closed = true; -+ } -+ freePollArray(address); -+ close0(sp[0]); -+ close0(sp[1]); -+ close0(kqfd); -+ } -+ -+ private void wakeup() { -+ if (wakeupCount.incrementAndGet() == 1) { -+ // write byte to socketpair to force wakeup -+ try { -+ interrupt(sp[1]); -+ } catch (IOException x) { -+ throw new AssertionError(x); -+ } -+ } -+ } -+ -+ @Override -+ void executeOnHandlerTask(Runnable task) { -+ synchronized (this) { -+ if (closed) -+ throw new RejectedExecutionException(); -+ offerTask(task); -+ wakeup(); -+ } -+ } -+ -+ @Override -+ void shutdownHandlerTasks() { -+ /* -+ * If no tasks are running then just release resources; otherwise -+ * write to the one end of the socketpair to wakeup any polling threads. -+ */ -+ int nThreads = threadCount(); -+ if (nThreads == 0) { -+ implClose(); -+ } else { -+ // send interrupt to each thread -+ while (nThreads-- > 0) { -+ wakeup(); -+ } -+ } -+ } -+ -+ // invoke by clients to register a file descriptor -+ @Override -+ void startPoll(int fd, int events) { -+ -+ if ((events & POLLIN) != 0) -+ keventChange(kqfd, fd, (short)(EV_ONESHOT|EV_ADD), EVFILT_READ); -+ if ((events & POLLOUT) != 0) -+ keventChange(kqfd, fd, (short)(EV_ONESHOT|EV_ADD), EVFILT_WRITE); -+ } -+ -+ /* -+ * Task to process events from kevent and dispatch to the channel's -+ * onEvent handler. -+ * -+ * Events are retreived from kevent in batch and offered to a BlockingQueue -+ * where they are consumed by handler threads. A special "NEED_TO_POLL" -+ * event is used to signal one consumer to re-poll when all events have -+ * been consumed. -+ */ -+ private class EventHandlerTask implements Runnable { -+ private Event poll() throws IOException { -+ try { -+ for (;;) { -+ int n = kevent(kqfd, 0, 0, address, MAX_KEVENTS, -1); -+ /* -+ * 'n' events have been read. Here we map them to their -+ * corresponding channel in batch and queue n-1 so that -+ * they can be handled by other handler threads. The last -+ * event is handled by this thread (and so is not queued). -+ */ -+ fdToChannelLock.readLock().lock(); -+ try { -+ while (n-- > 0) { -+ int fd = getKeventIdent(address, n); -+ -+ // wakeup -+ if (fd == sp[0]) { -+ if (wakeupCount.decrementAndGet() == 0) { -+ // no more wakeups so drain pipe -+ drain1(sp[0]); -+ } -+ -+ // queue special event if there are more events -+ // to handle. -+ if (n > 0) { -+ queue.offer(EXECUTE_TASK_OR_SHUTDOWN); -+ continue; -+ } -+ return EXECUTE_TASK_OR_SHUTDOWN; -+ } -+ -+ PollableChannel channel = fdToChannel.get(fd); -+ if (channel != null) { -+ int events = getEvents(address, n); -+ Event ev = new Event(channel, events); -+ -+ // n-1 events are queued; This thread handles -+ // the last one except for the wakeup -+ if (n > 0) { -+ queue.offer(ev); -+ } else { -+ return ev; -+ } -+ } -+ } -+ } finally { -+ fdToChannelLock.readLock().unlock(); -+ } -+ } -+ } finally { -+ // to ensure that some thread will poll when all events have -+ // been consumed -+ queue.offer(NEED_TO_POLL); -+ } -+ } -+ -+ public void run() { -+ Invoker.GroupAndInvokeCount myGroupAndInvokeCount = -+ Invoker.getGroupAndInvokeCount(); -+ final boolean isPooledThread = (myGroupAndInvokeCount != null); -+ boolean replaceMe = false; -+ Event ev; -+ try { -+ for (;;) { -+ // reset invoke count -+ if (isPooledThread) -+ myGroupAndInvokeCount.resetInvokeCount(); -+ -+ try { -+ replaceMe = false; -+ ev = queue.take(); -+ -+ // no events and this thread has been "selected" to -+ // poll for more. -+ if (ev == NEED_TO_POLL) { -+ try { -+ ev = poll(); -+ } catch (IOException x) { -+ x.printStackTrace(); -+ return; -+ } -+ } -+ } catch (InterruptedException x) { -+ continue; -+ } -+ -+ // handle wakeup to execute task or shutdown -+ if (ev == EXECUTE_TASK_OR_SHUTDOWN) { -+ Runnable task = pollTask(); -+ if (task == null) { -+ // shutdown request -+ return; -+ } -+ // run task (may throw error/exception) -+ replaceMe = true; -+ task.run(); -+ continue; -+ } -+ -+ // process event -+ try { -+ ev.channel().onEvent(ev.events(), isPooledThread); -+ } catch (Error x) { -+ replaceMe = true; throw x; -+ } catch (RuntimeException x) { -+ replaceMe = true; throw x; -+ } -+ } -+ } finally { -+ // last handler to exit when shutdown releases resources -+ int remaining = threadExit(this, replaceMe); -+ if (remaining == 0 && isShutdown()) { -+ implClose(); -+ } -+ } -+ } -+ } -+ -+ static int getEvents(long address, int index) { -+ short filter = getKeventFilter(address, index); -+ short flags = getKeventFlags(address, index); -+ if ((flags & EV_ERROR) != 0) -+ return POLLERR; -+ if (filter == EVFILT_READ) -+ return POLLIN; -+ if (filter == EVFILT_WRITE) -+ return POLLOUT; -+ return (0); -+ } -+ -+ // -- Native methods -- -+ -+ private static native void socketpair(int[] sv) throws IOException; -+ -+ private static native void interrupt(int fd) throws IOException; -+ -+ private static native void drain1(int fd) throws IOException; -+ -+ private static native void close0(int fd); -+ -+ static { -+ Util.load(); -+ } -+} ---- jdk/src/solaris/classes/sun/nio/ch/FreeBSDAsynchronousChannelProvider.java (revision 0) -+++ jdk/src/solaris/classes/sun/nio/ch/FreeBSDAsynchronousChannelProvider.java (revision 16) -@@ -0,0 +1,67 @@ -+ -+package sun.nio.ch; -+ -+import java.nio.channels.*; -+import java.nio.channels.spi.AsynchronousChannelProvider; -+import java.util.concurrent.ExecutorService; -+import java.util.concurrent.ThreadFactory; -+import java.net.ProtocolFamily; -+import java.io.IOException; -+ -+public class FreeBSDAsynchronousChannelProvider -+ extends AsynchronousChannelProvider -+{ -+ private static volatile KqueuePort defaultPort; -+ -+ private KqueuePort defaultEventPort() throws IOException { -+ if (defaultPort == null) { -+ synchronized (FreeBSDAsynchronousChannelProvider.class) { -+ if (defaultPort == null) { -+ defaultPort = new KqueuePort(this, ThreadPool.getDefault()).start(); -+ } -+ } -+ } -+ return defaultPort; -+ } -+ -+ public FreeBSDAsynchronousChannelProvider() { -+ } -+ -+ @Override -+ public AsynchronousChannelGroup openAsynchronousChannelGroup(int nThreads, ThreadFactory factory) -+ throws IOException -+ { -+ return new KqueuePort(this, ThreadPool.create(nThreads, factory)).start(); -+ } -+ -+ @Override -+ public AsynchronousChannelGroup openAsynchronousChannelGroup(ExecutorService executor, int initialSize) -+ throws IOException -+ { -+ return new KqueuePort(this, ThreadPool.wrap(executor, initialSize)).start(); -+ } -+ -+ private Port toPort(AsynchronousChannelGroup group) throws IOException { -+ if (group == null) { -+ return defaultEventPort(); -+ } else { -+ if (!(group instanceof KqueuePort)) -+ throw new IllegalChannelGroupException(); -+ return (Port)group; -+ } -+ } -+ -+ @Override -+ public AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(AsynchronousChannelGroup group) -+ throws IOException -+ { -+ return new UnixAsynchronousServerSocketChannelImpl(toPort(group)); -+ } -+ -+ @Override -+ public AsynchronousSocketChannel openAsynchronousSocketChannel(AsynchronousChannelGroup group) -+ throws IOException -+ { -+ return new UnixAsynchronousSocketChannelImpl(toPort(group)); -+ } -+} -$FreeBSD$ - ---- jdk/make/java/nio/Makefile (revision 1) -+++ jdk/make/java/nio/Makefile (revision 16) -@@ -264,7 +264,12 @@ - ifeq ($(PLATFORM), bsd) - FILES_java += \ - sun/nio/ch/AbstractPollSelectorImpl.java \ -+ sun/nio/ch/FreeBSDAsynchronousChannelProvider.java \ - sun/nio/ch/InheritedChannel.java \ -+ sun/nio/ch/Kqueue.java \ -+ sun/nio/ch/KqueueArrayWrapper.java \ -+ sun/nio/ch/KqueueSelectorProvider.java \ -+ sun/nio/ch/KqueueSelectorImpl.java \ - sun/nio/ch/PollSelectorProvider.java \ - sun/nio/ch/PollSelectorImpl.java \ - sun/nio/ch/Port.java \ -@@ -299,6 +304,9 @@ - - FILES_c += \ - InheritedChannel.c \ -+ Kqueue.c \ -+ KqueueArrayWrapper.c \ -+ KqueuePort.c \ - NativeThread.c \ - PollArrayWrapper.c \ - UnixAsynchronousServerSocketChannelImpl.c \ -@@ -311,6 +319,9 @@ - - FILES_export += \ - sun/nio/ch/InheritedChannel.java \ -+ sun/nio/ch/Kqueue.java \ -+ sun/nio/ch/KqueueArrayWrapper.java \ -+ sun/nio/ch/KqueuePort.java \ - sun/nio/ch/NativeThread.java \ - sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \ - sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \ |