[73766] trunk/dports/java/openjdk6

landonf at macports.org landonf at macports.org
Wed Nov 24 12:36:52 PST 2010


Revision: 73766
          http://trac.macports.org/changeset/73766
Author:   landonf at macports.org
Date:     2010-11-24 12:36:48 -0800 (Wed, 24 Nov 2010)
Log Message:
-----------
Update to OpenJDK6 b20, based on FreeBSD's latest openjdk6 patchset.
Additional review of the font configuration is required.

Submitted by: johnsonlau at netbeans.org, landonf at macports.org

Modified Paths:
--------------
    trunk/dports/java/openjdk6/Portfile
    trunk/dports/java/openjdk6/files/patch-10.4-ucontext
    trunk/dports/java/openjdk6/files/patch-disable_test_gamma
    trunk/dports/java/openjdk6/files/patch-null_word_intptr_t
    trunk/dports/java/openjdk6/files/patch-set

Added Paths:
-----------
    trunk/dports/java/openjdk6/files/patch-10.6-ucontext
    trunk/dports/java/openjdk6/files/patch-compile-W-format
    trunk/dports/java/openjdk6/files/patch-cross-compile
    trunk/dports/java/openjdk6/files/patch-darwin-arch
    trunk/dports/java/openjdk6/files/patch-dock-args
    trunk/dports/java/openjdk6/files/patch-nio-kqueue
    trunk/dports/java/openjdk6/files/patch-solaris-timezone-md-return-typo
    trunk/dports/java/openjdk6/files/patch-ucontext-vm.make
    trunk/dports/java/openjdk6/files/sun_xawt_icons_Makefile

Modified: trunk/dports/java/openjdk6/Portfile
===================================================================
--- trunk/dports/java/openjdk6/Portfile	2010-11-24 20:07:51 UTC (rev 73765)
+++ trunk/dports/java/openjdk6/Portfile	2010-11-24 20:36:48 UTC (rev 73766)
@@ -3,49 +3,90 @@
 PortSystem 1.0
 
 name                openjdk6
-version             b16
+version             b20
 revision            1
-set builddate 24_apr_2009
+set builddate 21_jun_2010
 
 categories          java
 maintainers         landonf openmaintainer
 platforms           darwin
 
 homepage            http://openjdk.java.net/
-description         Sun's java 6 virtual machine release under the GNUV2 license
+description         Oracle's Java 6 virtual machine release under the GPL v2
 long_description \
                     OpenJDK is an open-source implementation of the Java Platform, Standard Edition. \
-                    The version has all of Sun's bug fixes up to JDK 6 Release 11 and should be \
-                    the runtime equivelent to JDK6 Release 11. \
                     \
                     Much of the OpenJDK code is licensed under the GPL version 2 with the \
                     Classpath exception. The Java Hotspot virtual machine source code is \
                     licensed under the GPL version 2 only.
 
 distname            openjdk-6-src-${version}-${builddate}
-master_sites        http://download.java.net/openjdk/jdk6/promoted/${version}/
-checksums           md5     850a29b70206bc7fa083cd26acc781f3 \
-                    sha256  96159489d8b70db275c125b627c6e6912e6c078279d76b968d2e0969359c9420
 
+set jaxp_build b20
+set jaxp_file jdk6-jaxp-${jaxp_build}.zip
+set jaxws_build b20
+set jaxws_file jdk6-jaxws-${jaxws_build}.zip
+set jaf_build  b20
+set jaf_file jdk6-jaf-${jaf_build}.zip
+
+distfiles           ${distname}${extract.suffix} \
+                    ${jaxp_file}:jaxp \
+                    ${jaxws_file}:jaxws \
+                    ${jaf_file}:jaf
+extract.only        ${distname}${extract.suffix}
+
+master_sites        http://download.java.net/openjdk/jdk6/promoted/${version}/ \
+                    https://jaxp.dev.java.net/files/documents/913/150648/:jaxp \
+                    https://jax-ws.dev.java.net/files/documents/4202/150724/:jaxws \
+                    https://jax-ws.dev.java.net/files/documents/4202/150725/:jaf \
+                    http://icedtea.classpath.org/builds/icedtea6/src/ \
+                    http://icedtea.classpath.org/builds/icedtea6/src/drops/:jaxp \
+                    http://icedtea.classpath.org/builds/icedtea6/src/drops/:jaxws \
+                    http://icedtea.classpath.org/builds/icedtea6/src/drops/:jaf
+
+checksums           ${distname}${extract.suffix} \
+                    md5     0b36adbf67e4f261e1b827ed4be4f447 \
+                    sha256  fcf8f1d614e5965e90ef1b1a6d5eecc2bcc3078eaffbb62b83dfba52da62e54b \
+                    \
+                    ${jaxp_file} \
+                    md5     22e95fbdb9fb7d8b6b6fc0a1d76d1fbd \
+                    sha256  d097627d4059d488c5a09d4e33cec275a193d4d8bc0fea8ef4f1337170904156 \
+                    \
+                    ${jaxws_file} \
+                    md5     91adfd41e6f001add4f92ae31216b1e3 \
+                    sha256  0c460583898b968a58bf88eb53f90a0e34369e2562d65fb3a143512dfcaeb3eb \
+                    \
+                    ${jaf_file} \
+                    md5     bc95c133620bd68c161cac9891592901 \
+                    sha256  78c7b5c9d6271e88ee46abadd018a61f1e9645f8936cc8df1617e5f4f5074012
+
 patchfiles          patch-set \
-                    patch-null_word_intptr_t \
+                    patch-nio-kqueue \
+                    patch-compile-W-format \
                     patch-jdk_src_solaris_javavm_include_typedefs__md.h \
-                    patch-jvm_base_addr \
                     patch-jdk_src_share_java.c \
                     patch-jdk_src_solaris_native_common_gdefs__md.h \
                     patch-10.4-ucontext \
-                    patch-disable_test_gamma
+                    patch-ucontext-vm.make \
+                    patch-disable_test_gamma \
+                    patch-darwin-arch \
+                    patch-dock-args \
+                    patch-solaris-timezone-md-return-typo \
+                    patch-cross-compile
 
-use_configure        no
+use_configure       no
+use_parallel_build  no
 
-depends_lib         port:freetype \
+depends_lib         port:libiconv \
+                    port:freetype \
                     port:openmotif \
                     port:xorg-libX11 \
-                    port:xorg-libXtst
+                    port:xorg-libXtst \
+                    port:dejavu-fonts
 depends_build       port:icedtea6-plugs \
                     port:apache-ant
 
-# Check if the boostrap is required
+# Check if the bootstrap is required
 if {[file exists ${prefix}/share/java/openjdk6/bin/java]} {
     # A previous OpenJDK6 release is already installed
     set bootstrapvm "${prefix}/share/java/openjdk6"
@@ -59,11 +100,18 @@
 
 post-extract {
     set copydirs { \
+        hotspot/agent/src/os/linux \
+        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux \
+        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64 \
+        hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86 \
+        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux \
+        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86 \
+        hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64 \
         hotspot/src/os/linux/launcher \
         hotspot/src/os/linux/vm \
         hotspot/src/os_cpu/linux_x86/vm \
-        hotspot/build/linux \
-        hotspot/build/linux/makefiles \
+        hotspot/make/linux \
+        hotspot/make/linux/makefiles \
         jdk/src/linux/doc/man
     }
 
@@ -76,9 +124,11 @@
         jdk/make/netbeans/common/architectures/name-Linux.properties \
         jdk/make/sun/awt/mapfile-vers-linux \
         jdk/make/tools/sharing/classlist.linux \
+        jdk/make/com/sun/tools/attach/mapfile-linux \
         jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux \
         jdk/src/solaris/classes/sun/awt/fontconfigs/linux.fontconfig.properties \
         jdk/src/solaris/classes/sun/tools/attach/LinuxAttachProvider.java \
+        jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java \
         jdk/src/solaris/hpi/include/largefile_linux.h \
         jdk/src/solaris/native/java/net/linux_close.c \
         jdk/src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c
@@ -93,7 +143,7 @@
 
         # Copy the contents, adjust file contents
         foreach srcfile [glob -types f "${worksrcpath}/${src}/*"] {
-            set destfile "${dest}/[strsed [file tail ${srcfile}] g/linux/bsd/]"
+            set destfile [exec echo "${srcfile}" | sed "s/linux/bsd/g; s/Linux/Bsd/g"]
             copy "${srcfile}" "${destfile}"
             reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
             reinplace "s/linux/bsd/g; s/Linux/Bsd/g" "${destfile}"
@@ -115,11 +165,75 @@
 
     copy "${worksrcpath}/jdk/src/share/lib/security/java.security" \
          "${worksrcpath}/jdk/src/share/lib/security/java.security-openbsd"
+
+    # Workaround for cross compiling
+    file mkdir "${worksrcpath}/jdk/make/sun/xawt_icons"
+    copy "${filespath}/sun_xawt_icons_Makefile" \
+         "${worksrcpath}/jdk/make/sun/xawt_icons/Makefile"
+    copy "${worksrcpath}/jdk/make/sun/xawt/ToBin.java" \
+         "${worksrcpath}/jdk/make/sun/xawt_icons/ToBin.java"
+
+    # Configure font paths.
+#    copy "${filespath}/fontconfig.properties" \
+#        "${worksrcpath}/jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties"
+#    reinplace "s|@PREFIX@|${prefix}|g" \
+#        "${worksrcpath}/jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties"
 }
 
+post-patch {
+    reinplace "s|/lib:/usr/lib|/lib:/usr/lib:${prefix}/lib|" \
+        "${worksrcpath}/hotspot/src/os/bsd/vm/os_bsd.cpp"
+
+    # Enable the unlimited strength policy file
+    reinplace "s|build-policy install-limited|build-policy install-unlimited|g" \
+        "${worksrcpath}/jdk/make/javax/crypto/Makefile"
+}
+
+post-patch {
+    # Work-around small bugs in the b20 patchset:
+
+    # The agent is only supported on FreeBSD
+    file delete -force "${worksrcpath}/hotspot/agent"
+}
+
+# Override the overzealous setting of build environmental variables and settings. These
+# assume the use of (a well-behaved) autoconf, and cause an assortment of odd build failures when
+# used with OpenJDK's build system.
+#
+# Unfortunately there's no simple knob to turn the argument insertion off, so this will
+# probably have to be updated in the future
+build.env {}
+build.pre_args {}
+build.post_args {}
+
+# Determine the OpenJDK architecture
+#
+# XXX:
+# The OpenJDK build scripts currently rely on uname -m, which may return i386 or x86_64
+# regardless of the actual supported architecture. I'll be fixing this upstream (using ARCH_DATA_MODEL to
+# let the user select between amd64/i586 on any x86 target), but in the meantime, we use UNAME_MACHINE
+# to override what uname -m returns.
+supported_archs i386 x86_64
+if {${build_arch} == "i386"} {
+    build.env-append "UNAME_MACHINE=i386"
+    set openjdk_datamodel "32"
+    set openjdk_build_arch "i586"
+
+} elseif {${build_arch} == "x86_64"} {
+    build.env-append "UNAME_MACHINE=amd64"
+    set openjdk_datamodel "64"
+    set openjdk_build_arch "amd64"
+
+} elseif {${build_arch} == "ppc"} {
+    # Currently unsupported
+}
+
 build.args \
+    ARCH_DATA_MODEL="${openjdk_datamodel}" \
     ALT_BOOTDIR="${bootstrapvm}" \
+    ALT_JDK_IMPORT_PATH="${bootstrapvm}" \
     ALT_BINARY_PLUGS_PATH="${prefix}/share/java/icedtea6-plugs/jre/lib/rt-closed.jar" \
+    ALT_DROPS_DIR="${distpath}" \
     ANT_HOME="${prefix}/share/java/apache-ant" \
     ALT_FREETYPE_HEADERS_PATH="${prefix}/include" \
     ALT_FREETYPE_LIB_PATH="${prefix}/lib" \
@@ -129,10 +243,17 @@
     ALT_DEVTOOLS_PATH=/usr \
     ALT_CACERTS_FILE=/System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts \
     NO_DOCS=true \
-    HOTSPOT_BUILD_JOBS=${build.jobs}
+    LANG="C" \
+    BUILD_NUMBER="${version}" \
+    MILESTONE=fcs \
+    HOTSPOT_BUILD_JOBS="${build.jobs}"
 
+variant fastdebug {
+    build.post_args FASTDEBUG=true
+}
+
 destroot {
     set path "${destroot}${prefix}/share/java/${name}/"
     xinstall -m 755 -d ${path}
-    system "(cd ${worksrcpath}/build/bsd-i586/j2sdk-image && tar cf - *) | (tar -C ${path} -xf -)"
+    system "(cd ${worksrcpath}/build/bsd-${openjdk_build_arch}/j2sdk-image && tar cf - *) | (tar -C ${path} -xf -)"
 }

Modified: trunk/dports/java/openjdk6/files/patch-10.4-ucontext
===================================================================
--- trunk/dports/java/openjdk6/files/patch-10.4-ucontext	2010-11-24 20:07:51 UTC (rev 73765)
+++ trunk/dports/java/openjdk6/files/patch-10.4-ucontext	2010-11-24 20:36:48 UTC (rev 73766)
@@ -1,6 +1,6 @@
---- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp.orig	2009-05-17 13:52:42.000000000 -0700
-+++ hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2009-05-17 13:58:46.000000000 -0700
-@@ -111,7 +111,7 @@
+--- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp.orig	2010-10-28 04:29:34.000000000 +0800
++++ hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2010-10-28 04:29:35.000000000 +0800
+@@ -108,7 +108,7 @@
    // 10.5 UNIX03 member name prefixes
    #define DU3_PREFIX(s, m) __ ## s.__ ## m
  # else

Added: trunk/dports/java/openjdk6/files/patch-10.6-ucontext
===================================================================
--- trunk/dports/java/openjdk6/files/patch-10.6-ucontext	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-10.6-ucontext	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,32 @@
+diff -u -r ../work-orig/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp ./hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
+--- ../work-orig/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2010-10-30 00:44:14.000000000 +0800
++++ ./hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2010-10-30 00:54:55.000000000 +0800
+@@ -45,8 +45,12 @@
+ # include <pwd.h>
+ # include <poll.h>
+ #ifndef __OpenBSD__
++#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
++# include <sys/ucontext.h>
++#else
+ # include <ucontext.h>
+ #endif
++#endif
+ 
+ #if defined(_ALLBSD_SOURCE) && !defined(__APPLE__)
+ # include <pthread_np.h>
+diff -u -r ../work-orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+--- ../work-orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2010-10-30 00:44:16.000000000 +0800
++++ ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2010-10-30 00:55:15.000000000 +0800
+@@ -75,8 +75,12 @@
+ #include <inttypes.h>
+ #include <signal.h>
+ #ifndef __OpenBSD__
++#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
++# include <sys/ucontext.h>
++#else
+ #include <ucontext.h>
+ #endif
++#endif
+ #ifdef __APPLE__
+   #include <AvailabilityMacros.h>
+   #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)

Added: trunk/dports/java/openjdk6/files/patch-compile-W-format
===================================================================
--- trunk/dports/java/openjdk6/files/patch-compile-W-format	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-compile-W-format	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,73 @@
+# Fix build failure on Darwin due to -Wformat errors.
+# Alexander Strange <astrange at apple.com>
+diff -u -r ../work-orig/hotspot/src/cpu/x86/vm/jni_x86.h ./hotspot/src/cpu/x86/vm/jni_x86.h
+--- ../work-orig/hotspot/src/cpu/x86/vm/jni_x86.h	2010-11-04 21:15:16.000000000 +0800
++++ ./hotspot/src/cpu/x86/vm/jni_x86.h	2010-11-04 21:20:08.000000000 +0800
+@@ -32,8 +32,7 @@
+   #define JNICALL
+ 
+   typedef int jint;
+-
+-#ifdef _LP64
++#if defined(_LP64) && !defined(__APPLE__)
+   typedef long jlong;
+ #else
+   typedef long long jlong;
+diff -u -r ../work-orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp ./hotspot/src/share/vm/utilities/globalDefinitions.hpp
+--- ../work-orig/hotspot/src/share/vm/utilities/globalDefinitions.hpp	2010-11-04 21:15:17.000000000 +0800
++++ ./hotspot/src/share/vm/utilities/globalDefinitions.hpp	2010-11-04 21:20:11.000000000 +0800
+@@ -1110,6 +1110,8 @@
+ // Format 32-bit quantities.
+ #define INT32_FORMAT  "%d"
+ #define UINT32_FORMAT "%u"
++#define LONG_FORMAT "%ld"
++#define ULONG_FORMAT "%lu"
+ #define INT32_FORMAT_W(width)   "%" #width "d"
+ #define UINT32_FORMAT_W(width)  "%" #width "u"
+ 
+@@ -1145,16 +1147,30 @@
+ // GCC 4.3.2, however requires the data to be converted to "intptr_t" when
+ // using "%x".
+ #ifdef  _LP64
++#ifdef __APPLE__
++#define PTR_FORMAT    LONG_FORMAT
++#define UINTX_FORMAT  ULONG_FORMAT
++#define INTX_FORMAT   LONG_FORMAT
++#define SIZE_FORMAT   LONG_FORMAT
++#else
+ #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
++#endif
+ #else   // !_LP64
++#ifdef __APPLE__
++#define PTR_FORMAT    LONG_FORMAT
++#define UINTX_FORMAT  ULONG_FORMAT
++#define INTX_FORMAT   LONG_FORMAT
++#define SIZE_FORMAT   LONG_FORMAT
++#else
+ #define PTR_FORMAT    PTR32_FORMAT
+ #define UINTX_FORMAT  UINT32_FORMAT
+ #define INTX_FORMAT   INT32_FORMAT
+ #define SIZE_FORMAT   UINT32_FORMAT
++#endif
+ #define SSIZE_FORMAT  INT32_FORMAT
+ #endif  // _LP64
+ 
+diff -u -r ../work-orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+--- ../work-orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2010-11-04 21:15:17.000000000 +0800
++++ ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2010-11-04 21:20:11.000000000 +0800
+@@ -275,7 +275,11 @@
+ 
+ // Formatting.
+ #ifdef _LP64
++#ifdef __APPLE__
++#define FORMAT64_MODIFIER "ll"
++#else /* __APPLE__ */
+ #define FORMAT64_MODIFIER "l"
++#endif /* __APPLE__ */
+ #else // !_LP64
+ #define FORMAT64_MODIFIER "ll"
+ #endif // _LP64

Added: trunk/dports/java/openjdk6/files/patch-cross-compile
===================================================================
--- trunk/dports/java/openjdk6/files/patch-cross-compile	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-cross-compile	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,64 @@
+# Fixes native dylib loading issues on cross-compiling.
+diff -u -r ../work-orig/jdk/make/javax/swing/beaninfo/SwingBeans.gmk ./jdk/make/javax/swing/beaninfo/SwingBeans.gmk
+--- ../work-orig/jdk/make/javax/swing/beaninfo/SwingBeans.gmk	2010-11-19 01:32:54.000000000 +0800
++++ ./jdk/make/javax/swing/beaninfo/SwingBeans.gmk	2010-11-19 01:25:13.000000000 +0800
+@@ -44,7 +44,13 @@
+ 	$(MAKE) DEBUG_FLAG=true make-swing-beans
+ 
+ 
+-LOCAL_JAVADOC   = $(JAVADOC_CMD) $(JAVADOCFLAGS)
++BUILT_JAVAC_CMD = "$(OUTPUTDIR)/bin/java" \
++		"-Xbootclasspath/p:$(JAVAC_JAR)" \
++		-jar $(JAVAC_JAR) $(JAVACFLAGS)
++BUILT_JAVADOC_CMD = "$(OUTPUTDIR)/bin/java" \
++		"-Xbootclasspath/p:$(JAVADOC_JAR)$(CLASSPATH_SEPARATOR)$(JAVAC_JAR)$(CLASSPATH_SEPARATOR)$(DOCLETS_JAR)" \
++		-jar $(JAVADOC_JAR)
++LOCAL_JAVADOC   = $(BUILT_JAVADOC_CMD) $(JAVADOCFLAGS)
+ # get the absolute path to the jar command.
+ PREFIX          = 1.2
+ JAVADOCFLAGS    = $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION)
+@@ -86,7 +92,7 @@
+ 	@$(MKDIR) -p $@
+ 
+ $(DOCLETDST)/%.class: $(DOCLETSRC)/%.java
+-	$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath "$(CLASSBINDIR)$(CLASSPATH_SEPARATOR)$(DOCLETSRC)" -d $(DOCLETDST) $?
++	$(BUILT_JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath "$(CLASSBINDIR)$(CLASSPATH_SEPARATOR)$(DOCLETSRC)" -d $(DOCLETDST) $?
+ 	@$(java-vm-cleanup)
+ 
+ # To run, the doclet needs SwingBeanInfoBase class.  Also Notice the lie
+@@ -95,11 +101,11 @@
+ .SwingBeanInfo: $(OBJDIR) $(BEANCLASSDIR) $(BEANSRCDIR) $(SWINGPKG)/BeanInfoUtils.class $(SWINGPKG)/SwingBeanInfoBase.class 
+ 
+ $(SWINGPKG)/BeanInfoUtils.class: $(BEANSRCDIR)/BeanInfoUtils.java
+-	$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -d $(BEANCLASSDIR) $<
++	$(BUILT_JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -d $(BEANCLASSDIR) $<
+ 	@$(java-vm-cleanup)
+ 
+ $(SWINGPKG)/SwingBeanInfoBase.class: $(BEANSRCDIR)/SwingBeanInfoBase.java $(BEANSRCDIR)/BeanInfoUtils.java
+-	$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath $(BEANCLASSDIR) -d $(BEANCLASSDIR) $<
++	$(BUILT_JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath $(BEANCLASSDIR) -d $(BEANCLASSDIR) $<
+ 	@$(java-vm-cleanup)
+ 
+ #
+@@ -155,7 +161,7 @@
+ 
+ .compile.classlist:
+ 	if [ -s $(TEMPDIR)/.classes.list ] ; then \
+-	    $(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath $(LOCAL_CLASSPATH) -d $(BEANCLASSDIR) \
++	    $(BUILT_JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath $(LOCAL_CLASSPATH) -d $(BEANCLASSDIR) \
+ 	    $(shell if [ -s $(TEMPDIR)/.classes.list ] ; then $(CAT) $(TEMPDIR)/.classes.list; fi ) ; \
+ 	fi
+ 	@$(java-vm-cleanup)
+diff -u -r ../work-orig/jdk/make/sun/Makefile ./jdk/make/sun/Makefile
+--- ../work-orig/jdk/make/sun/Makefile	2010-11-19 01:32:54.000000000 +0800
++++ ./jdk/make/sun/Makefile	2010-11-19 01:40:16.000000000 +0800
+@@ -66,7 +66,8 @@
+           $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
+ 	  font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
+ 	  jawt text nio launcher management $(ORG_SUBDIR) \
+-          native2ascii serialver tools jconsole
++          native2ascii serialver tools jconsole \
++          xawt_icons
+ 
+ all build clean clobber::
+ 	$(SUBDIRS-loop)

Added: trunk/dports/java/openjdk6/files/patch-darwin-arch
===================================================================
--- trunk/dports/java/openjdk6/files/patch-darwin-arch	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-darwin-arch	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,284 @@
+diff -u -r ../work-orig/corba/make/common/Defs-bsd.gmk ./corba/make/common/Defs-bsd.gmk
+--- ../work-orig/corba/make/common/Defs-bsd.gmk	2010-11-04 21:49:08.000000000 +0800
++++ ./corba/make/common/Defs-bsd.gmk	2010-11-04 21:53:16.000000000 +0800
+@@ -90,7 +90,11 @@
+ CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
+ ifeq ($(OS_VENDOR),Apple)
+   # 16-byte stack re-alignment on 32-bit Darwin
+-  CFLAGS_REQUIRED_i586 += -mstackrealign
++  CFLAGS_REQUIRED_i586 += -mstackrealign -m32
++  LDFLAGS_COMMON_i586 += -m32
++
++  CFLAGS_REQUIRED_amd64 += -m64
++  LDFLAGS_COMMON_amd64 += -m64
+ endif
+ CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
+ CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
+diff -u -r ../work-orig/hotspot/make/bsd/makefiles/defs.make ./hotspot/make/bsd/makefiles/defs.make
+--- ../work-orig/hotspot/make/bsd/makefiles/defs.make	2010-11-04 21:49:10.000000000 +0800
++++ ./hotspot/make/bsd/makefiles/defs.make	2010-11-04 21:57:49.000000000 +0800
+@@ -30,6 +30,33 @@
+ 
+ # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
+ ARCH:=$(shell uname -m)
++OS_VENDOR:=$(shell uname -s)
++ifeq ($(OS_VENDOR),Darwin)
++  # Darwin returns i386 for 32bit kernel mode and x86_64 for 64bit kernel mode
++  # regardless of the actual supported architecture.
++  ifndef UNAME_MACHINE
++    # UNAME_MACHINE not passed in
++    ifdef ARCH_DATA_MODEL
++      # Overrides ARCH with proper value when ARCH_DATA_MODEL passed
++      ifeq ($(ARCH_DATA_MODEL), 32)
++        UNAME_MACHINE = i386
++      else
++        UNAME_MACHINE = amd64
++      endif
++
++    else
++      # Defaults to 64bit on Darwin 9+ when ARCH_DATA_MODEL is not passed
++      ifneq (,$(findstring $(shell uname -r | cut -d '.' -f1), 9 10))
++        UNAME_MACHINE = amd64
++      else
++        UNAME_MACHINE = i386
++      endif
++    endif
++  endif
++  
++  ARCH = $(UNAME_MACHINE)
++endif
++
+ PATH_SEP = :
+ ifeq ($(LP64), 1)
+   ARCH_DATA_MODEL ?= 64
+@@ -72,8 +99,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,46 +112,54 @@
+     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
+ 
+-# amd64
+-ifeq ($(ARCH), amd64)
+-  ARCH_DATA_MODEL = 64
+-  MAKE_ARGS       += LP64=1
+-  PLATFORM        = bsd-amd64
+-  VM_PLATFORM     = bsd_amd64
+-  HS_ARCH         = x86
+-endif
+-
+ # i386
+ ifeq ($(ARCH), i386)
+-  ARCH_DATA_MODEL  = 32
+-  PLATFORM         = bsd-i586
+-  VM_PLATFORM      = bsd_i486
+-  HS_ARCH          = x86
++  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
+ 
+-# i486
+-ifeq ($(ARCH), i486)
++# ARM
++ifeq ($(ARCH), arm)
+   ARCH_DATA_MODEL  = 32
+-  PLATFORM         = bsd-i586
+-  VM_PLATFORM      = bsd_i486
+-  HS_ARCH          = x86
++  PLATFORM         = bsd-arm
++  VM_PLATFORM      = bsd_arm
++  HS_ARCH          = arm
+ endif
+ 
+-# i686
+-ifeq ($(ARCH), i686)
++# PPC
++ifeq ($(ARCH), ppc)
+   ARCH_DATA_MODEL  = 32
+-  PLATFORM         = bsd-i586
+-  VM_PLATFORM      = bsd_i486
+-  HS_ARCH          = x86
++  PLATFORM         = bsd-ppc
++  VM_PLATFORM      = bsd_ppc
++  HS_ARCH          = ppc
+ endif
+ 
+ JDK_INCLUDE_SUBDIR=bsd
+ 
++# Library suffix
++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
+ 
+@@ -132,22 +167,32 @@
+ 
+ # client and server subdirectories have symbolic links to ../libjsig.so
+ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
+-
+ EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
++
++ifndef BUILD_CLIENT_ONLY
+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
+ EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
++endif
++
+ ifneq ($(ZERO_BUILD), true)
+   ifeq ($(ARCH_DATA_MODEL), 32)
+     EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
+     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
+     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
+-    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX)
+-    EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 
+-  else
+-    ifeq ($(ARCH),ia64)
+-      else
+-        EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX)
+-        EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
+-    endif
+   endif
+ endif
++
++# Serviceability Binaries
++# No SA Support for PPC, IA64, ARM or zero and Darwin
++ifneq ($(OS_VENDOR),Darwin)
++ADD_SA_BINARIES/x86   = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
++                        $(EXPORT_LIB_DIR)/sa-jdi.jar
++endif
++ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
++                        $(EXPORT_LIB_DIR)/sa-jdi.jar
++ADD_SA_BINARIES/ppc   =
++ADD_SA_BINARIES/ia64  =
++ADD_SA_BINARIES/arm   =
++ADD_SA_BINARIES/zero  =
++
++EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
+diff -u -r ../work-orig/hotspot/make/bsd/makefiles/gcc.make ./hotspot/make/bsd/makefiles/gcc.make
+--- ../work-orig/hotspot/make/bsd/makefiles/gcc.make	2010-11-04 21:49:10.000000000 +0800
++++ ./hotspot/make/bsd/makefiles/gcc.make	2010-11-04 21:53:17.000000000 +0800
+@@ -76,9 +76,6 @@
+ ifeq ($(OS_VENDOR), Darwin)
+   # Ineffecient 16-byte stack re-alignment on Darwin/IA32
+   ARCHFLAG/i486 += -mstackrealign
+-
+-  # -arch compiler flag required for x64_64
+-  ARCHFLAGS/amd64 += -arch x86_64
+ endif
+ 
+ CFLAGS     += $(ARCHFLAG)
+@@ -183,6 +180,13 @@
+ 
+   # Keep symbols even they are not used
+   #AOUT_FLAGS += -export-dynamic
++
++  ifeq ($(ARCH_DATA_MODEL), 32)
++    LFLAGS += -m32
++  else
++    LFLAGS += -m64
++  endif
++
+ else
+   # Enable linker optimization
+   LFLAGS += -Xlinker -O1
+diff -u -r ../work-orig/jdk/make/common/Defs-bsd.gmk ./jdk/make/common/Defs-bsd.gmk
+--- ../work-orig/jdk/make/common/Defs-bsd.gmk	2010-11-04 21:49:12.000000000 +0800
++++ ./jdk/make/common/Defs-bsd.gmk	2010-11-04 21:53:20.000000000 +0800
+@@ -100,7 +100,11 @@
+ CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
+ ifeq ($(OS_VENDOR),Apple)
+   # 16-byte stack re-alignment on 32-bit Darwin
+-  CFLAGS_REQUIRED_i586 += -mstackrealign
++  CFLAGS_REQUIRED_i586 += -mstackrealign -m32
++  LDFLAGS_COMMON_i586 += -m32
++
++  CFLAGS_REQUIRED_amd64 += -m64
++  LDFLAGS_COMMON_amd64 += -m64
+ endif
+ CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
+ CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
+diff -u -r ../work-orig/jdk/make/common/shared/Platform.gmk ./jdk/make/common/shared/Platform.gmk
+--- ../work-orig/jdk/make/common/shared/Platform.gmk	2010-11-04 21:49:12.000000000 +0800
++++ ./jdk/make/common/shared/Platform.gmk	2010-11-04 21:53:20.000000000 +0800
+@@ -308,6 +308,32 @@
+   OS_VERSION := $(shell uname -r)
+   # Arch and OS name/version
+   mach := $(shell uname -m)
++  ifeq ($(OS_VENDOR),Apple)
++    # Darwin returns i386 for 32bit kernel mode and x86_64 for 64bit kernel mode
++    # regardless of the actual supported architecture.
++    ifndef UNAME_MACHINE
++      # UNAME_MACHINE not passed in
++      ifdef ARCH_DATA_MODEL
++        # Overrides ARCH with proper value when ARCH_DATA_MODEL passed
++        ifeq ($(ARCH_DATA_MODEL), 32)
++          UNAME_MACHINE = i386
++        else
++          UNAME_MACHINE = amd64
++        endif
++
++      else
++        # Defaults to 64bit on Darwin 9+ when ARCH_DATA_MODEL is not passed
++        ifneq (,$(findstring $(shell echo $(OS_VERSION) | cut -d '.' -f1), 9 10))
++          UNAME_MACHINE = amd64
++        else
++          UNAME_MACHINE = i386
++        endif
++      endif
++    endif
++    
++    mach = $(UNAME_MACHINE)
++  endif
++
+   archExpr = case "$(mach)" in \
+                 i[3-9]86) \
+                     echo i586 \
+@@ -319,11 +345,13 @@
+   ARCH        := $(shell $(archExpr) )
+   ARCH_FAMILY := $(ARCH)
+ 
+-  # i586 and sparc are 32 bit, amd64 and sparc64 are 64
+-  ifneq (,$(findstring $(ARCH), i586 sparc))
+-    ARCH_DATA_MODEL=32
+-  else
+-    ARCH_DATA_MODEL=64
++  ifndef ARCH_DATA_MODEL
++    # i586 and sparc are 32 bit, amd64 and sparc64 are 64
++    ifneq (,$(findstring $(ARCH), i586 sparc))
++      ARCH_DATA_MODEL=32
++    else
++      ARCH_DATA_MODEL=64
++    endif
+   endif
+ 
+   # Need to maintain the jre/lib/i386 location for 32-bit Intel

Modified: trunk/dports/java/openjdk6/files/patch-disable_test_gamma
===================================================================
--- trunk/dports/java/openjdk6/files/patch-disable_test_gamma	2010-11-24 20:07:51 UTC (rev 73765)
+++ trunk/dports/java/openjdk6/files/patch-disable_test_gamma	2010-11-24 20:36:48 UTC (rev 73766)
@@ -1,6 +1,6 @@
---- hotspot/build/bsd/Makefile.orig	2009-05-15 12:12:31.000000000 -0700
-+++ hotspot/build/bsd/Makefile	2009-05-15 12:12:57.000000000 -0700
-@@ -245,28 +245,24 @@
+--- hotspot/make/bsd/Makefile.orig	2010-10-28 04:29:34.000000000 +0800
++++ hotspot/make/bsd/Makefile	2010-10-28 04:29:35.000000000 +0800
+@@ -276,28 +276,24 @@
  
  $(TARGETS_C2):  $(SUBDIRS_C2)
  	cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)

Added: trunk/dports/java/openjdk6/files/patch-dock-args
===================================================================
--- trunk/dports/java/openjdk6/files/patch-dock-args	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-dock-args	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,17 @@
+--- hotspot/src/share/vm/runtime/arguments.cpp.orig	2010-11-03 03:58:55.000000000 +0800
++++ hotspot/src/share/vm/runtime/arguments.cpp	2010-11-03 03:57:20.000000000 +0800
+@@ -2552,6 +2552,14 @@
+           return JNI_EINVAL;
+         }
+       }
++#ifdef __APPLE__
++    } else if (match_option(option, "-Xdock:name=", &tail) || // -Xdock:name=
++            match_option(option, "-Xdock:icon=", &tail)) { // -Xdock:icon
++        // Certain application like NetBeans might need to set this option.
++        // However, OpenJDK 6 on Darwin is an X11 application which may stop
++        // the application setting these options stop working.
++        // Simply ignore them to resolve this.
++#endif // __APPLE__
+     // Unknown option
+     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
+       return JNI_ERR;

Added: trunk/dports/java/openjdk6/files/patch-nio-kqueue
===================================================================
--- trunk/dports/java/openjdk6/files/patch-nio-kqueue	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-nio-kqueue	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,697 @@
+$FreeBSD: ports/java/openjdk6/files/patch-nio-kqueue,v 1.1 2010/08/15 05:23:07 glewis Exp $
+
+--- jdk/src/share/classes/sun/nio/ch/KqueueSelectorProvider.java	(revision 0)
++++ jdk/src/share/classes/sun/nio/ch/KqueueSelectorProvider.java	(revision 0)
+@@ -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/KqueueArrayWrapper.c	(revision 0)
++++ jdk/src/solaris/native/sun/nio/ch/KqueueArrayWrapper.c	(revision 6)
+@@ -0,0 +1,186 @@
++/*
++ * Scratched by davidxu at freebsd.org
++ */
++
++#include "jni.h"
++#include "jni_util.h"
++#include "jvm.h"
++#include "jlong.h"
++
++#include "sun_nio_ch_KqueueArrayWrapper.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_KqueueArrayWrapper_kqueue
++  (JNIEnv *env, jclass cls)
++{
++	int kqfd = kqueue();
++	if (kqfd < 0) {
++		JNU_ThrowIOExceptionWithLastError(env, "Error creating kqueue");
++		return -1;
++    	}
++	return kqfd;
++}
++
++JNIEXPORT void JNICALL Java_sun_nio_ch_KqueueArrayWrapper_register
++  (JNIEnv *env, jclass cls, jint kqfd, jint fd, jshort filter)
++{
++	struct kevent ev;
++	struct timespec ts;
++	
++	ev.ident = fd;
++	ev.filter = filter; 
++	ev.flags = EV_ADD; 
++	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 register kqueue event");
++	}
++}
++
++JNIEXPORT jint JNICALL Java_sun_nio_ch_KqueueArrayWrapper_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 polling kevent");
++		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_KqueueArrayWrapper_keventSize
++  (JNIEnv *env, jclass cls)
++{
++	return sizeof(struct kevent);
++}
++
++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");
++	}
++}
++
++JNIEXPORT void JNICALL Java_sun_nio_ch_KqueueArrayWrapper_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_KqueueArrayWrapper_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_KqueueArrayWrapper_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_KqueueArrayWrapper_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/classes/sun/nio/ch/KqueueArrayWrapper.java	(revision 0)
++++ jdk/src/solaris/classes/sun/nio/ch/KqueueArrayWrapper.java	(revision 6)
+@@ -0,0 +1,231 @@
++/*
++ * Scratched by davidxu at 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;
++
++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;
++
++    // 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_ERROR     = 0x4000;
++
++    // Miscellaneous constants
++    static final int SIZE_KEVENT   = keventSize();
++
++    // 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 * SIZE_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 * SIZE_KEVENT;
++	    pollKeventArray = new AllocatedNativeObject(allocationSize, true);
++	}
++    }
++
++    void initInterrupt(int fd0, int fd1) {
++        outgoingInterruptFD = fd1;
++        incomingInterruptFD = fd0;
++	ensureFd(fd0);
++	register(kqfd, fd0, 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 IndexOutOfBoundsException("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 {
++        FileDispatcher.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 int  kqueue();
++    private static native void register(int kqfd, int fd, short filter);
++    private static native int  kevent(int kqfd, long changeList, int nchanges, long eventList,
++	int nevents, long timeout);
++    private static native int  keventSize();
++    private static native void interrupt(int fd);
++    private static native void putKevent(long address, int index, int fd, short flag, short filter);
++    private static native short getKeventFilter(long address, int index);
++    private static native short getKeventFlags(long address, int index);
++    private static native int getKeventIdent(long address, int index);
++}
+--- jdk/src/solaris/classes/sun/nio/ch/KqueueSelectorImpl.java	(revision 0)
++++ jdk/src/solaris/classes/sun/nio/ch/KqueueSelectorImpl.java	(revision 6)
+@@ -0,0 +1,205 @@
++/*
++ * scratched by davidxu at 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;
++
++    // Trace number of file handles are updated.
++    private BitSet updatedSet;
++
++    /**
++     * Package private constructor called by factory method in
++     * the abstract superclass Selector.
++     */
++    KqueueSelectorImpl(SelectorProvider sp) {
++	super(sp);
++	int[] fdes = new int[2];
++	IOUtil.initPipe(fdes, false);
++	fd0 = fdes[0];
++	fd1 = fdes[1];
++	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.translateAndUpdateReadyOps(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;
++            FileDispatcher.closeIntFD(fd0);
++            FileDispatcher.closeIntFD(fd1);
++            if (kqueueWrapper != null) {
++                kqueueWrapper.release(fd0);
++                kqueueWrapper.closeKqueueFD();
++                kqueueWrapper = null;
++                selectedKeys = null;
++
++                // Deregister channels
++		Iterator 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/make/java/nio/Makefile
++++ jdk/make/java/nio/Makefile
+@@ -104,6 +104,28 @@
+ 	sun/nio/ch/NativeThread.java
+ endif # PLATFORM = linux
+ 
++ifeq ($(PLATFORM), bsd)
++FILES_java += \
++	sun/nio/ch/AbstractPollSelectorImpl.java \
++	sun/nio/ch/InheritedChannel.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
++
++FILES_c += \
++	KqueueArrayWrapper.c \
++	PollArrayWrapper.c \
++	InheritedChannel.c \
++	NativeThread.c
++
++FILES_export += \
++	sun/nio/ch/KqueueArrayWrapper.java \
++	sun/nio/ch/InheritedChannel.java \
++	sun/nio/ch/NativeThread.java
++endif # PLATFORM = bsd
++
+ # Find platform-specific C source files
+ #
+ vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch
+--- jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java
++++ jdk/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java
+@@ -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();
+         }

Modified: trunk/dports/java/openjdk6/files/patch-null_word_intptr_t
===================================================================
--- trunk/dports/java/openjdk6/files/patch-null_word_intptr_t	2010-11-24 20:07:51 UTC (rev 73765)
+++ trunk/dports/java/openjdk6/files/patch-null_word_intptr_t	2010-11-24 20:36:48 UTC (rev 73766)
@@ -1,9 +1,6 @@
-Only in hotspot/build/bsd: bsd_i486_compiler2
-Only in hotspot: cscope.out
-diff -ru hotspot.orig/src/share/vm/utilities/globalDefinitions_gcc.hpp hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
---- hotspot.orig/src/share/vm/utilities/globalDefinitions_gcc.hpp	2009-05-14 23:51:41.000000000 -0700
-+++ hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2009-05-15 00:40:45.000000000 -0700
-@@ -132,9 +132,7 @@
+--- hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp.orig	2010-10-28 04:29:34.000000000 +0800
++++ hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2010-10-28 04:29:35.000000000 +0800
+@@ -129,9 +129,7 @@
    #ifdef _LP64
      #define NULL_WORD  0L
    #else

Modified: trunk/dports/java/openjdk6/files/patch-set
===================================================================
--- trunk/dports/java/openjdk6/files/patch-set	2010-11-24 20:07:51 UTC (rev 73765)
+++ trunk/dports/java/openjdk6/files/patch-set	2010-11-24 20:36:48 UTC (rev 73766)
@@ -1,29 +1,26 @@
-/*
- * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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.
- *
- */
-diff -upr ../orig/corba/make/common/Defs-bsd.gmk ./corba/make/common/Defs-bsd.gmk
---- ../orig/corba/make/common/Defs-bsd.gmk	2009-05-04 18:32:16.000000000 -0400
-+++ ./corba/make/common/Defs-bsd.gmk	2009-05-05 14:33:21.000000000 -0400
+--- Makefile	2010-06-21 14:11:11.000000000 -0700
++++ Makefile	2010-06-20 21:56:15.000000000 -0700
+@@ -236,6 +236,18 @@
+ 
+ clean: clobber
+ 
++# Add location of iconv headers & libs
++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
++  endif
++endif
++
+ #
+ # Dev builds
+ #
+--- corba/make/common/Defs-bsd.gmk	2010-06-27 11:37:43.000000000 -0700
++++ corba/make/common/Defs-bsd.gmk	2010-06-20 21:56:15.000000000 -0700
 @@ -40,18 +40,12 @@
  # Get shared JDK settings
  include $(BUILDDIR)/common/shared/Defs.gmk
@@ -44,7 +41,7 @@
  PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
  
  # suffix used for make dependencies files.
-@@ -94,6 +88,10 @@ endif
+@@ -94,6 +88,10 @@
  #    as the default.
  CFLAGS_REQUIRED_amd64   += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
  CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
@@ -55,7 +52,7 @@
  CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
  CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
  LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
-@@ -168,7 +166,7 @@ ifeq ($(FASTDEBUG), true)
+@@ -176,7 +174,7 @@
    CXXFLAGS_DBG	+= $(CC_LOWER_OPT)
  endif
  
@@ -64,7 +61,7 @@
  		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
  
  ifeq ($(ARCH_DATA_MODEL), 64)
-@@ -178,33 +176,15 @@ endif
+@@ -186,33 +184,16 @@
  CPPFLAGS_OPT    = 
  CPPFLAGS_DBG    = -DDEBUG
  
@@ -86,23 +83,23 @@
 -
 -EXTRA_LIBS += -lc
 -
--LDFLAGS_DEFS_OPTION  = -z defs
+-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)
+ LDFLAGS_OPT     = -Xlinker -O1
 +
 +ifneq ($(OS_VENDOR), Apple)
-+LDFLAGS_OPT     = -Xlinker -O1
+ LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
  LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
 +endif
++
  
  #
  # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
-@@ -235,13 +215,9 @@ endif
+@@ -243,13 +224,9 @@
  #
  LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker
  
@@ -119,7 +116,7 @@
  endif
  
  #
-@@ -270,7 +246,9 @@ override HAVE_ALTZONE            = false
+@@ -278,7 +255,9 @@
  override HAVE_FILIOH             = false
  override HAVE_GETHRTIME          = false
  override HAVE_GETHRVTIME         = false
@@ -129,7 +126,7 @@
  override LEX_LIBRARY             = -lfl
  ifeq ($(STATIC_CXX),true)
  override LIBCXX                  = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
-@@ -281,13 +259,9 @@ override LIBPOSIX4               =
+@@ -289,13 +268,9 @@
  override LIBSOCKET               =
  override LIBTHREAD               =
  override MOOT_PRIORITIES         = true
@@ -145,10 +142,9 @@
  override OTHER_M4FLAGS           = -D__GLIBC__ -DGNU_ASSEMBLER
  override SUN_CMM_SUBDIR          =
  override THREADS_FLAG            = native
-diff -upr ../orig/corba/make/common/Defs-linux.gmk ./corba/make/common/Defs-linux.gmk
---- ../orig/corba/make/common/Defs-linux.gmk	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/common/Defs-linux.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -282,7 +282,7 @@ override LIBSOCKET               =
+--- corba/make/common/Defs-linux.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/Defs-linux.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -290,7 +290,7 @@
  override LIBTHREAD               =
  override MOOT_PRIORITIES         = true
  override NO_INTERRUPTIBLE_IO     = true
@@ -157,10 +153,9 @@
  ifeq ($(ARCH), amd64)
  override OPENWIN_LIB             = $(OPENWIN_HOME)/lib64
  else
-diff -upr ../orig/corba/make/common/Defs.gmk ./corba/make/common/Defs.gmk
---- ../orig/corba/make/common/Defs.gmk	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/common/Defs.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -53,6 +53,24 @@ endif
+--- corba/make/common/Defs.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/Defs.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -53,6 +53,24 @@
  
  _OUTPUTDIR=$(TOPDIR)/build/$(PLATFORM)-$(ARCH)
  
@@ -185,7 +180,7 @@
  #
  # Get platform definitions
  #
-@@ -97,6 +115,9 @@ ifdef PROGRAM
+@@ -97,6 +115,9 @@
      LDLIBS_COMMON = -ldl
    endif
  
@@ -195,10 +190,9 @@
  endif # PROGRAM
  
  LDLIBS_COMMON += $(EXTRA_LIBS)
-diff -upr ../orig/corba/make/common/Mapfile-vers.gmk ./corba/make/common/Mapfile-vers.gmk
---- ../orig/corba/make/common/Mapfile-vers.gmk	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/common/Mapfile-vers.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -77,7 +77,7 @@ endif
+--- corba/make/common/Mapfile-vers.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/Mapfile-vers.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -77,7 +77,7 @@
  endif # PLATFORM
  
  
@@ -207,10 +201,9 @@
  
  ifeq ($(VARIANT), OPT)
    # OPT build MUST have a mapfile?
-diff -upr ../orig/corba/make/common/shared/Compiler-gcc.gmk ./corba/make/common/shared/Compiler-gcc.gmk
---- ../orig/corba/make/common/shared/Compiler-gcc.gmk	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/common/shared/Compiler-gcc.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -99,6 +99,24 @@ ifeq ($(PLATFORM), linux)
+--- corba/make/common/shared/Compiler-gcc.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/shared/Compiler-gcc.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -100,6 +100,24 @@
  
  endif
  
@@ -235,10 +228,9 @@
  ifeq ($(PLATFORM), solaris)
  
    # Settings specific to Solaris
-diff -upr ../orig/corba/make/common/shared/Compiler.gmk ./corba/make/common/shared/Compiler.gmk
---- ../orig/corba/make/common/shared/Compiler.gmk	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/common/shared/Compiler.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -42,6 +42,11 @@ ifeq ($(PLATFORM), linux)
+--- corba/make/common/shared/Compiler.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/shared/Compiler.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -42,6 +42,11 @@
    override CC_VERSION = gcc
  endif
  
@@ -250,10 +242,9 @@
  # Get the compiler specific settings
  include $(BUILDDIR)/common/shared/Compiler-$(CC_VERSION).gmk
  
-diff -upr ../orig/corba/make/common/shared/Defs-bsd.gmk ./corba/make/common/shared/Defs-bsd.gmk
---- ../orig/corba/make/common/shared/Defs-bsd.gmk	2009-05-04 18:32:16.000000000 -0400
-+++ ./corba/make/common/shared/Defs-bsd.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -54,7 +54,7 @@ $(shell if [ "$1" != "" -a -d "$1" ]; th
+--- corba/make/common/shared/Defs-bsd.gmk	2010-06-27 11:37:43.000000000 -0700
++++ corba/make/common/shared/Defs-bsd.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -54,7 +54,7 @@
  endef
  
  # Location on system where jdk installs might be
@@ -262,7 +253,7 @@
  
  # 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 @@ endif
+@@ -107,7 +107,7 @@
  ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
    DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH))
  else
@@ -271,10 +262,20 @@
  endif
  
  # _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
-diff -upr ../orig/corba/make/common/shared/Defs-utils.gmk ./corba/make/common/shared/Defs-utils.gmk
---- ../orig/corba/make/common/shared/Defs-utils.gmk	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/common/shared/Defs-utils.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -53,6 +53,13 @@ ifeq ($(PLATFORM),linux)
+--- corba/make/common/shared/Defs-java.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/shared/Defs-java.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -38,7 +38,7 @@
+   #   Suspect this may not be needed anymore.
+   JAVA_MEM_FLAGS   += -Xms$(MAX_VM_MEMORY)m -XX:-Inline
+ else
+-  JAVA_MEM_FLAGS   += -Xms$(MIN_VM_MEMORY)m -XX:PermSize=32m -XX:MaxPermSize=160m
++  JAVA_MEM_FLAGS   += -Xms$(MIN_VM_MEMORY)m
+ endif
+ 
+ # 
+--- corba/make/common/shared/Defs-utils.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/shared/Defs-utils.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -53,6 +53,13 @@
    UTILS_DEVTOOL_PATH=$(USRBIN_PATH)
  endif
  
@@ -288,7 +289,7 @@
  ifeq ($(PLATFORM),solaris)
    UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
    UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH)
-@@ -209,3 +216,32 @@ ifeq ($(PLATFORM),solaris)
+@@ -199,3 +206,32 @@
    ECHO           = /usr/bin/echo
  endif
  
@@ -321,10 +322,9 @@
 +    TAR        = $(UTILS_USR_BIN_PATH)tar
 +  endif
 +endif
-diff -upr ../orig/corba/make/common/shared/Platform.gmk ./corba/make/common/shared/Platform.gmk
---- ../orig/corba/make/common/shared/Platform.gmk	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/common/shared/Platform.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -262,6 +262,76 @@ ifeq ($(SYSTEM_UNAME), Linux)
+--- corba/make/common/shared/Platform.gmk	2010-06-21 14:11:20.000000000 -0700
++++ corba/make/common/shared/Platform.gmk	2010-06-20 21:56:15.000000000 -0700
+@@ -261,6 +261,76 @@
    MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2)
  endif
  
@@ -401,7 +401,7 @@
  # Windows with and without CYGWIN will be slightly different
  ifeq ($(SYSTEM_UNAME), Windows_NT)
    PLATFORM = windows
-@@ -373,7 +443,14 @@ endif
+@@ -375,7 +445,14 @@
  #    build machines and adjustments will be made to prevent excessing
  #    system swapping during the build.
  #    If we don't know, assume 512. Subtract 128 from MB for VM MAX.
@@ -417,7 +417,7 @@
  ifneq ($(MB_OF_MEMORY),)
    LOW_MEMORY_MACHINE := $(shell \
      if [ $(MB_OF_MEMORY) -le 512 ] ; then \
-@@ -385,7 +462,7 @@ ifneq ($(MB_OF_MEMORY),)
+@@ -387,7 +464,7 @@
      if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
        expr $(MB_OF_MEMORY) '-' 128 ; \
      else \
@@ -426,46 +426,2057 @@
      fi)
    MIN_VM_MEMORY := $(shell \
      if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
-diff -upr ../orig/corba/make/sun/corba/core/Makefile ./corba/make/sun/corba/core/Makefile
---- ../orig/corba/make/sun/corba/core/Makefile	2009-01-27 15:40:31.000000000 -0500
-+++ ./corba/make/sun/corba/core/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -53,11 +53,19 @@ include $(CORBA_JMK_DIRECTORY)sun_corba.
- ifdef STANDALONE_CORBA_WS
- # FIXUP: What is this all about?
- OTHER_LDFLAGS=-L$(BOOTDIR)/jre/lib/$(ARCH) -L$(BOOTDIR)/jre/lib/$(LIBARCH)/native_threads -ljvm
-+ifeq ($(PLATFORM), bsd)
-+OTHER_INCLUDES+=-ICClassHeaders -I$(BOOTDIR)/include -I$(BOOTDIR)/include/$(OS_NAME)
-+else
- OTHER_INCLUDES+=-ICClassHeaders -I$(BOOTDIR)/include -I$(BOOTDIR)/include/$(PLATFORM)
-+endif
- else
- OTHER_LDLIBS=$(JVMLIB)
-+ifeq ($(PLATFORM), bsd)
-+OTHER_INCLUDES+=-ICClassHeaders -I$(BOOTDIR)/include -I$(BOOTDIR)/include/$(OS_NAME)
-+else
- OTHER_INCLUDES+=-ICClassHeaders -I$(BOOTDIR)/include -I$(BOOTDIR)/include/$(PLATFORM)
+--- hotspot/agent/make/Makefile	2010-06-21 14:12:09.000000000 -0700
++++ hotspot/agent/make/Makefile	2010-06-20 21:56:15.000000000 -0700
+@@ -52,6 +52,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.oops \
+ sun.jvm.hotspot.runtime \
+ sun.jvm.hotspot.runtime.amd64 \
++sun.jvm.hotspot.runtime.bsd \
++sun.jvm.hotspot.runtime.bsd_amd64 \
++sun.jvm.hotspot.runtime.bsd_x86 \
+ sun.jvm.hotspot.runtime.ia64 \
+ sun.jvm.hotspot.runtime.linux \
+ sun.jvm.hotspot.runtime.linux_amd64 \
+@@ -143,6 +149,9 @@
+ 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/amd64/*.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 \
+@@ -178,6 +187,9 @@
+ sun/jvm/hotspot/oops/*.java \
+ sun/jvm/hotspot/runtime/*.java \
+ sun/jvm/hotspot/runtime/amd64/*.java \
++sun/jvm/hotspot/runtime/bsd/*.java \
++sun/jvm/hotspot/runtime/bsd_amd64/*.java \
++sun/jvm/hotspot/runtime/bsd_x86/*.java \
+ sun/jvm/hotspot/runtime/ia64/*.java \
+ sun/jvm/hotspot/runtime/linux/*.java \
+ sun/jvm/hotspot/runtime/linux_amd64/*.java \
+--- hotspot/agent/src/os/bsd/BsdDebuggerLocal.c	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/BsdDebuggerLocal.c	2010-06-20 21:56:15.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,21 +317,21 @@
+ #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 */
+ 
+@@ -345,31 +345,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	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/Makefile	2010-06-20 21:56:15.000000000 -0700
+@@ -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,15 +32,16 @@
+ 	libproc_impl.c  \
+ 	ps_proc.c       \
+ 	ps_core.c       \
+-	BsdDebuggerLocal.c 
++	hsearch_r.c     \
++	BsdDebuggerLocal.c
+ 
+-INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/bsd 
++INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
+ 
+ OBJS     = $(SOURCES:.c=.o)
+ 
+-LIBS     = -lthread_db
++LIBS     = -lutil -lthread_db
+ 
+-CFLAGS   = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES)
++CFLAGS   = -c -fPIC -g -Wall -D_ALLBSD_SOURCE -D_GNU_SOURCE -D$(ARCH) $(INCLUDES)
+ 
+ LIBSA = $(ARCH)/libsaproc.so
+ 
+@@ -49,8 +50,7 @@
+ BsdDebuggerLocal.o: BsdDebuggerLocal.c
+ 	$(JAVAH) -jni -classpath ../../../build/classes  \
+ 		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:
+@@ -72,14 +72,15 @@
+ 	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/elfmacros.h	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/elfmacros.h	2010-06-20 21:56:15.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/hsearch_r.c	1969-12-31 16:00:00.000000000 -0800
++++ hotspot/agent/src/os/bsd/hsearch_r.c	2010-06-20 21:56:15.000000000 -0700
+@@ -0,0 +1,217 @@
++/* Copyright (C) 1993,1995-1997,2002,2005,2007,2008
++   Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Ulrich Drepper <drepper at gnu.ai.mit.edu>, 1993.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <errno.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include <search.h>
++
++#include "hsearch_r.h"
++
++#define __set_errno(ERRNO) errno = ERRNO
++
++/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
++   [Knuth]            The Art of Computer Programming, part 3 (6.4)  */
++
++
++/* The reentrant version has no static variables to maintain the state.
++   Instead the interface of all functions is extended to take an argument
++   which describes the current status.  */
++typedef struct _ENTRY
++{
++  unsigned int used;
++  ENTRY entry;
++}
++_ENTRY;
++
++
++/* For the used double hash method the table size has to be a prime. To
++   correct the user given table size we need a prime test.  This trivial
++   algorithm is adequate because
++   a)  the code is (most probably) called a few times per program run and
++   b)  the number is small because the table must fit in the core  */
++static int
++isprime (unsigned int number)
++{
++  /* no even number will be passed */
++  unsigned int div = 3;
++
++  while (div * div < number && number % div != 0)
++    div += 2;
++
++  return number % div != 0;
++}
++
++
++/* Before using the hash table we must allocate memory for it.
++   Test for an existing table are done. We allocate one element
++   more as the found prime number says. This is done for more effective
++   indexing as explained in the comment for the hsearch function.
++   The contents of the table is zeroed, especially the field used
++   becomes zero.  */
++int
++hcreate_r (size_t nel, struct hsearch_data *htab)
++{
++  /* Test for correct arguments.  */
++  if (htab == NULL)
++    {
++      __set_errno (EINVAL);
++      return 0;
++    }
++
++  /* There is still another table active. Return with error. */
++  if (htab->table != NULL)
++    return 0;
++
++  /* Change nel to the first prime number not smaller as nel. */
++  nel |= 1;      /* make odd */
++  while (!isprime (nel))
++    nel += 2;
++
++  htab->size = nel;
++  htab->filled = 0;
++
++  /* allocate memory and zero out */
++  htab->table = (_ENTRY *) calloc (htab->size + 1, sizeof (_ENTRY));
++  if (htab->table == NULL)
++    return 0;
++
++  /* everything went alright */
++  return 1;
++}
++
++
++/* After using the hash table it has to be destroyed. The used memory can
++   be freed and the local static variable can be marked as not used.  */
++void
++hdestroy_r (struct hsearch_data *htab)
++{
++  /* Test for correct arguments.  */
++  if (htab == NULL)
++    {
++      __set_errno (EINVAL);
++      return;
++    }
++
++  /* Free used memory.  */
++  free (htab->table);
++
++  /* the sign for an existing table is an value != NULL in htable */
++  htab->table = NULL;
++}
++
++
++/* This is the search function. It uses double hashing with open addressing.
++   The argument item.key has to be a pointer to an zero terminated, most
++   probably strings of chars. The function for generating a number of the
++   strings is simple but fast. It can be replaced by a more complex function
++   like ajw (see [Aho,Sethi,Ullman]) if the needs are shown.
++
++   We use an trick to speed up the lookup. The table is created by hcreate
++   with one more element available. This enables us to use the index zero
++   special. This index will never be used because we store the first hash
++   index in the field used where zero means not used. Every other value
++   means used. The used field can be used as a first fast comparison for
++   equality of the stored and the parameter value. This helps to prevent
++   unnecessary expensive calls of strcmp.  */
++int
++hsearch_r (ENTRY item, ACTION action, ENTRY **retval, struct hsearch_data *htab)
++{
++  unsigned int hval;
++  unsigned int count;
++  unsigned int len = strlen (item.key);
++  unsigned int idx;
++
++  /* Compute an value for the given string. Perhaps use a better method. */
++  hval = len;
++  count = len;
++  while (count-- > 0)
++    {
++      hval <<= 4;
++      hval += item.key[count];
++    }
++
++  /* First hash function: simply take the modul but prevent zero. */
++  idx = hval % htab->size + 1;
++
++  if (htab->table[idx].used)
++    {
++      /* Further action might be required according to the action value. */
++      if (htab->table[idx].used == hval
++	  && strcmp (item.key, htab->table[idx].entry.key) == 0)
++	{
++	  *retval = &htab->table[idx].entry;
++	  return 1;
++	}
++
++      /* Second hash function, as suggested in [Knuth] */
++      unsigned int hval2 = 1 + hval % (htab->size - 2);
++      unsigned int first_idx = idx;
++
++      do
++	{
++	  /* Because SIZE is prime this guarantees to step through all
++             available indeces.  */
++          if (idx <= hval2)
++	    idx = htab->size + idx - hval2;
++	  else
++	    idx -= hval2;
++
++	  /* If we visited all entries leave the loop unsuccessfully.  */
++	  if (idx == first_idx)
++	    break;
++
++            /* If entry is found use it. */
++          if (htab->table[idx].used == hval
++	      && strcmp (item.key, htab->table[idx].entry.key) == 0)
++	    {
++	      *retval = &htab->table[idx].entry;
++	      return 1;
++	    }
++	}
++      while (htab->table[idx].used);
++    }
++
++  /* An empty bucket has been found. */
++  if (action == ENTER)
++    {
++      /* If table is full and another entry should be entered return
++	 with error.  */
++      if (htab->filled == htab->size)
++	{
++	  __set_errno (ENOMEM);
++	  *retval = NULL;
++	  return 0;
++	}
++
++      htab->table[idx].used  = hval;
++      htab->table[idx].entry = item;
++
++      ++htab->filled;
++
++      *retval = &htab->table[idx].entry;
++      return 1;
++    }
++
++  __set_errno (ESRCH);
++  *retval = NULL;
++  return 0;
++}
+--- hotspot/agent/src/os/bsd/hsearch_r.h	1969-12-31 16:00:00.000000000 -0800
++++ hotspot/agent/src/os/bsd/hsearch_r.h	2010-06-20 21:56:15.000000000 -0700
+@@ -0,0 +1,42 @@
++/* Declarations for System V style searching functions.
++   Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifndef _HSEARCH_R_H_
++#define _HSEARCH_R_H_
++
++#include <search.h>
++
++struct _ENTRY;
++
++/* Data type for reentrant functions.  */
++struct hsearch_data
++  {
++    struct _ENTRY *table;
++    unsigned int size;
++    unsigned int filled;
++  };
++
++/* Reentrant versions which can handle multiple hashing tables at the
++   same time.  */
++extern int hsearch_r (ENTRY __item, ACTION __action, ENTRY **__retval,
++                      struct hsearch_data *__htab);
++extern int hcreate_r (size_t __nel, struct hsearch_data *__htab);
++extern void hdestroy_r (struct hsearch_data *__htab);
++
++#endif /* _HSEARCH_R_H_ */
+--- hotspot/agent/src/os/bsd/libproc.h	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/libproc.h	2010-06-20 21:56:15.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,19 +72,6 @@
+ 
+ *************************************************************************************/
+ 
+-#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
+ // it would be a mistake to equivalence it to C++ bool on many platforms
+ 
+@@ -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	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/libproc_impl.c	2010-06-20 21:56:15.000000000 -0700
+@@ -177,8 +177,11 @@
+    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
+    // address read functionality. lookup_symbol checks for NULL symtab.
+@@ -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);
+ }
+ 
+@@ -376,9 +379,9 @@
+ // proc service functions
+ 
+ // get process id
+-pid_t ps_getpid(struct ps_prochandle *ph) {
+-   return ph->pid;
+-}
++// 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.
+@@ -403,6 +406,24 @@
+   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.
+@@ -428,7 +449,18 @@
+ }
+ 
+ // 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_get_thread_area() {
++//  print_debug("ps_get_thread_area not implemented\n");
++//  return PS_OK;
++//}
++
++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	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/libproc_impl.h	2010-06-20 21:56:15.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
+--- hotspot/agent/src/os/bsd/mapfile	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/mapfile	2010-06-20 21:56:15.000000000 -0700
+@@ -41,15 +41,21 @@
+ 		Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0;
+ 	
+ 		# proc_service.h functions - to be used by libthread_db
+-		ps_getpid;
+ 		ps_pglobal_lookup;
+-		ps_pdread;
+-		ps_pdwrite;
++		ps_pread;
++		ps_pwrite;
++		ps_linfo;
++		ps_plog;
++
++		# dummy implementations of proc_service.h functions
++		# presumably unused but needed to avoid undefined symbols
++		# export LIBSAPROC_DEBUG=1 to see if actually used
+ 		ps_lsetfpregs;
+ 		ps_lsetregs;
+ 		ps_lgetfpregs;
+ 		ps_lgetregs;
+-		ps_get_thread_area;
++		ps_lstop;
++		ps_lcontinue;
+ 
+                 # used by attach test program
+                 init_libproc;
+--- hotspot/agent/src/os/bsd/proc_service.h	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/proc_service.h	2010-06-20 21:56:15.000000000 -0700
+@@ -22,6 +22,8 @@
+  *
+  */
+ 
++#error Should be using system proc_service.h
++
+ #ifndef _PROC_SERVICE_H_
+ #define _PROC_SERVICE_H_
+ 
+@@ -55,11 +57,11 @@
+                     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,
++ps_err_e ps_pread(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,
++ps_err_e ps_pwrite(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);
+--- hotspot/agent/src/os/bsd/ps_core.c	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/ps_core.c	2010-06-20 21:56:15.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
+@@ -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;
+@@ -507,12 +508,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,6 +521,13 @@
+    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,
+@@ -539,52 +547,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
+    }
+ 
+@@ -826,7 +834,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,19 +844,23 @@
+    // 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);
+ 
+@@ -870,14 +882,14 @@
+       // address mentioned in shared object and the actual virtual base where runtime
+       // linker loaded it. We use "base diff" in read_lib_segments call below.
+ 
+-      if (ps_pdread(ph, (psaddr_t) link_map_addr + LINK_MAP_ADDR_OFFSET,
++      if (ps_pread(ph, (psaddr_t) link_map_addr + LINK_MAP_ADDR_OFFSET,
+                    &lib_base_diff, sizeof(uintptr_t)) != PS_OK) {
+          print_debug("can't read shared object base address diff\n");
+          return false;
+       }
+ 
+       // read address of the name
+-      if (ps_pdread(ph, (psaddr_t) link_map_addr + LINK_MAP_NAME_OFFSET,
++      if (ps_pread(ph, (psaddr_t) link_map_addr + LINK_MAP_NAME_OFFSET, 
+                     &lib_name_addr, sizeof(uintptr_t)) != PS_OK) {
+          print_debug("can't read address of shared object name\n");
+          return false;
+@@ -921,7 +933,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;
+@@ -935,7 +947,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	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/ps_proc.c	2010-06-20 21:56:15.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
+@@ -54,46 +56,46 @@
+ // 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;
++    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++)
+@@ -108,45 +110,28 @@
+   return false;
+ }
+ 
+-// "user" should be a pointer to a user_regs_struct
+-static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct user_regs_struct *user) {
++// "user" should be a pointer to a reg
++static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct reg *user) {
+   // we have already attached to all thread 'pid's, just use ptrace call
+   // to get regset now. Note that we don't cache regset upfront for processes.
+-// Bsd on x86 and sparc are different.  On x86 ptrace(PTRACE_GETREGS, ...)
+-// uses pointer from 4th argument and ignores 3rd argument.  On sparc it uses
+-// pointer from 3rd argument and ignores 4th argument
+-#if defined(sparc) || defined(sparcv9)
+-#define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, addr, data)
+-#else
+-#define ptrace_getregs(request, pid, addr, data) ptrace(request, pid, data, addr)
+-#endif
+-
+-#ifdef _LP64
+-#ifdef PTRACE_GETREGS64
+-#define PTRACE_GETREGS_REQ PTRACE_GETREGS64
+-#endif
+-#else
+-#if defined(PTRACE_GETREGS) || defined(PT_GETREGS)
+-#define PTRACE_GETREGS_REQ PTRACE_GETREGS
+-#endif
+-#endif /* _LP64 */
+-
+-#ifdef PTRACE_GETREGS_REQ
+- if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) {
++ if (ptrace(PT_GETREGS, pid, (caddr_t) user, 0) < 0) {
+    print_debug("ptrace(PTRACE_GETREGS, ...) failed for lwp %d\n", pid);
+    return false;
+  }
+  return true;
+-#else
+- print_debug("ptrace(PTRACE_GETREGS, ...) not supported\n");
+- return false;
+-#endif
++}
++
++// fill in ptrace_lwpinfo for lid
++static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void *linfo) {
++  errno = 0;
++  ptrace(PT_LWPINFO, lwp_id, linfo, sizeof(struct ptrace_lwpinfo));
+ 
++  return (errno == 0)? true: false;
+ }
+ 
+ // attach to a process/thread specified by "pid"
+ static bool ptrace_attach(pid_t pid) {
+-  if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
++  if (ptrace(PT_ATTACH, pid, NULL, 0) < 0) {
+     print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
+     return false;
+   } else {
+@@ -155,10 +140,6 @@
+     do {
+       // 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.
+@@ -191,85 +172,222 @@
+ // 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;
+-       sscanf(word[0], "%lx", &base);
+-       if ((lib = add_lib_info(ph, word[5], (uintptr_t)base)) == NULL)
++  for (i = 0; i < cnt; i++) {
++    kve = &freep[i];
++    if ((kve->kve_flags & KVME_FLAG_COW) &&
++        kve->kve_path != NULL &&
++        strlen(kve->kve_path) > 0) {
++
++      if (find_lib(ph, kve->kve_path) == false) {
++        lib_info* lib;
++        if ((lib = add_lib_info(ph, kve->kve_path,
++                                (uintptr_t) kve->kve_start)) == NULL)
+           continue; // ignore, add_lib_info prints error
+ 
+-       // we don't need to keep the library open, symtab is already
+-       // built. Only for core dump we need to keep the fd open.
+-       close(lib->fd);
+-       lib->fd = -1;
++        // we don't need to keep the library open, symtab is already
++        // built. Only for core dump we need to keep the fd open.
++        close(lib->fd);
++        lib->fd = -1;
++      }
+     }
+   }
+-  fclose(fp);
++
++  free(freep);
++
+   return true;
++#else
++  char *l_name;
++  struct link_map *lmap;
++  uintptr_t lmap_addr;
++
++  if ((l_name = malloc(BUF_SIZE)) == NULL)
++    return false;
++
++  if ((lmap = malloc(sizeof(*lmap))) == NULL) {
++    free(l_name);
++    return false;
++  }
++
++  lmap_addr = linkmap_addr(ph);
++
++  if (lmap_addr == 0) {
++    free(l_name);
++    free(lmap);
++    return false;
++  }
++
++  do {
++    if (process_read_data(ph, lmap_addr, (char *)lmap, sizeof(*lmap)) != true) {
++      print_debug("process_read_data failed for lmap_addr %p\n", lmap_addr);
++      free (l_name);
++      free (lmap);
++      return false;
++    }
++
++    if (process_read_data(ph, (uintptr_t)lmap->l_name, l_name,
++        BUF_SIZE) != true) {
++      print_debug("process_read_data failed for lmap->l_name %p\n",
++          lmap->l_name);
++      free (l_name);
++      free (lmap);
++      return false;
++    }
++
++    if (find_lib(ph, l_name) == false) {
++      lib_info* lib;
++      if ((lib = add_lib_info(ph, l_name,
++                              (uintptr_t) lmap->l_addr)) == NULL)
++        continue; // ignore, add_lib_info prints error
++
++      // we don't need to keep the library open, symtab is already
++      // built. Only for core dump we need to keep the fd open.
++      close(lib->fd);
++      lib->fd = -1;
++    }
++    lmap_addr = (uintptr_t)lmap->l_next;
++  } while (lmap->l_next != NULL);
++
++  free (l_name);
++  free (lmap);
++
++  return true;
++#endif
+ }
+ 
+ // detach a given pid
+ static bool ptrace_detach(pid_t pid) {
+-  if (pid && ptrace(PTRACE_DETACH, pid, NULL, NULL) < 0) {
++  if (pid && ptrace(PT_DETACH, pid, (caddr_t)1, 0) < 0) {
+     print_debug("ptrace(PTRACE_DETACH, ..) failed for %d\n", pid);
+     return false;
+   } else {
+@@ -277,17 +395,8 @@
+   }
+ }
+ 
+-// 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 = {
+@@ -321,21 +430,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	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/salibelf.c	2010-06-20 21:56:15.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	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/symtab.c	2010-06-20 21:56:15.000000000 -0700
+@@ -23,13 +23,14 @@
+  */
+ 
+ #include <unistd.h>
+-#include <sys/procfs.h>
+ #include <search.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include "hsearch_r.h"
+ #include "symtab.h"
+ #include "salibelf.h"
+ 
++extern void print_debug(const char*,...);
+ 
+ // ----------------------------------------------------
+ // functions for symbol lookups
+@@ -56,7 +57,6 @@
+ // read symbol table from given fd.
+ struct symtab* build_symtab(int fd) {
+   ELF_EHDR ehdr;
+-  char *names = NULL;
+   struct symtab* symtab = NULL;
+ 
+   // Reading of elf header
+@@ -65,18 +65,22 @@
+   ELF_SHDR* shbuf = NULL;
+   ELF_SHDR* cursct = NULL;
+   ELF_PHDR* phbuf = NULL;
+-  ELF_PHDR* phdr = NULL;
++  int symtab_found = 0;
++  int dynsym_found = 0;
++  uint32_t symsection = SHT_SYMTAB;
+ 
+   uintptr_t baseaddr = (uintptr_t)-1;
+ 
+   lseek(fd, (off_t)0L, SEEK_SET);
+   if (! read_elf_header(fd, &ehdr)) {
++    print_debug("not an ELF header\n");
+     // not an elf
+     return NULL;
+   }
+ 
+   // read ELF header
+   if ((shbuf = read_section_header_table(fd, &ehdr)) == NULL) {
++    print_debug("can't read section header\n");
+     goto quit;
+   }
+ 
+@@ -85,23 +89,35 @@
+   scn_cache = (struct elf_section *)
+               calloc(ehdr.e_shnum * sizeof(struct elf_section), 1);
+   if (scn_cache == NULL) {
++    print_debug("can't read scn_cache\n");
+     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) {
++    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) {
++         print_debug("can't read section_data\n");
+          goto quit;
+       }
+     }
++    if (cursct->sh_type == SHT_SYMTAB)
++      symtab_found++;
++
++    if (cursct->sh_type == SHT_DYNSYM)
++      dynsym_found++;
+     cursct++;
+   }
+ 
++  if (!symtab_found && dynsym_found)
++     symsection = SHT_DYNSYM;
++
+   for (cnt = 1; cnt < ehdr.e_shnum; cnt++) {
+     ELF_SHDR *shdr = scn_cache[cnt].c_shdr;
+ 
+-    if (shdr->sh_type == SHT_SYMTAB) {
++    if (shdr->sh_type == symsection) {
+       ELF_SYM  *syms;
+       int j, n, rslt;
+       size_t size;
+@@ -113,6 +129,7 @@
+       // guarantee(symtab == NULL, "multiple symtab");
+       symtab = (struct symtab*)calloc(1, sizeof(struct symtab));
+       if (symtab == NULL) {
++         print_debug("can't allocate symtab\n");
+          goto quit;
+       }
+       // the symbol table
+--- hotspot/agent/src/os/bsd/test.c	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/os/bsd/test.c	2010-06-20 21:56:15.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");
+         return 1;
+       }
+    }
+--- hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java	2010-06-20 21:56:15.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	2010-06-27 11:37:43.000000000 -0700
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java	2010-06-20 21:56:15.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	1969-12-31 16:00:00.000000000 -0800
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/ia64/BsdIA64ThreadContext.java	2010-06-20 21:56:06.000000000 -0700
+@@ -0,0 +1,46 @@
++/*
++ * 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	1969-12-31 16:00:00.000000000 -0800
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/sparc/BsdSPARCCFrame.java	2010-06-20 21:56:06.000000000 -0700
+@@ -0,0 +1,81 @@
++/*
++ * 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	1969-12-31 16:00:00.000000000 -0800
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/sparc/BsdSPARCThreadContext.java	2010-06-20 21:56:06.000000000 -0700
+@@ -0,0 +1,46 @@
++/*
++ * 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	2010-06-21 14:12:12.000000000 -0700
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java	2010-06-20 21:56:15.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	2010-06-27 11:37:43.000000000 -0700
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java	2010-06-20 21:56:15.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&LTOSTOP) */
++    "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_x86/BsdSignals.java	2010-06-27 11:37:43.000000000 -0700
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java	2010-06-20 21:56:15.000000000 -0700
+@@ -32,33 +32,32 @@
+     "SIGQUIT",    /* quit (ASCII FS) */
+     "SIGILL",     /* illegal instruction (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&LTOSTOP) */
++    "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	2010-06-21 14:12:13.000000000 -0700
++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java	2010-06-20 21:56:15.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	2010-06-21 14:12:13.000000000 -0700
++++ hotspot/make/Makefile	2010-06-26 22:18:02.000000000 -0700
+@@ -290,11 +290,32 @@
+ # Shared Library
+ ifneq ($(OSNAME),windows)
+   ifeq ($(ZERO_BUILD), true)
++    ifeq ($(OSNAME),bsd)
++# BSD-specific LIBRARY_SUFFIX build option
++$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
++	$(install-file)
++$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
++	$(install-file)
++    else
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
+ 	$(install-file)
+ $(EXPORT_SERVER_DIR)/%.so:       $(ZERO_DIR)/%.so
+ 	$(install-file)
++    endif
+   else
++    ifeq ($(OSNAME),bsd)
++# BSD-specific LIBRARY_SUFFIX build option
++$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
++	$(install-file)
++$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX):       $(C1_DIR)/%.$(LIBRARY_SUFFIX)
++	$(install-file)
++$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX):    $(C1_DIR)/%.$(LIBRARY_SUFFIX)
++	$(install-file)
++$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(C2_DIR)/%.$(LIBRARY_SUFFIX)
++	$(install-file)
++$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX):    $(C2_DIR)/%.$(LIBRARY_SUFFIX)
++	$(install-file)
++    else
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
+ 	$(install-file)
+ $(EXPORT_CLIENT_DIR)/%.so:       $(C1_DIR)/%.so
+@@ -305,6 +326,7 @@
+ 	$(install-file)
+ $(EXPORT_SERVER_DIR)/64/%.so:    $(C2_DIR)/%.so
+ 	$(install-file)
++    endif
+   endif
  endif
-+endif
  
- 
- FILES_c = ioser.c
-diff -upr ../orig/hotspot/build/bsd/Makefile ./hotspot/build/bsd/Makefile
---- ../orig/hotspot/build/bsd/Makefile	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/build/bsd/Makefile	2009-05-04 19:16:59.000000000 -0400
-@@ -198,7 +198,8 @@ checks: check_os_version check_j2se_vers
+--- hotspot/make/bsd/Makefile	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/Makefile	2010-06-20 21:56:15.000000000 -0700
+@@ -220,7 +220,10 @@
  # 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% 2.7%
-+#SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7%
-+DISABLE_HOTSPOT_OS_VERSION_CHECK = ok
++#SUPPORTED_OS_VERSION = 6.% 7.% 8.%
++# Decided to allow all versions here, and limit using FreeBSD java/openjdk6
++# Makefile
++SUPPORTED_OS_VERSION = %
  OS_VERSION := $(shell uname -r)
  EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
  
-diff -upr ../orig/hotspot/build/bsd/makefiles/buildtree.make ./hotspot/build/bsd/makefiles/buildtree.make
---- ../orig/hotspot/build/bsd/makefiles/buildtree.make	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/buildtree.make	2009-05-05 15:01:26.000000000 -0400
-@@ -273,10 +273,11 @@ env.sh: $(BUILDTREE_MAKE)
+--- hotspot/make/bsd/makefiles/buildtree.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/buildtree.make	2010-06-20 21:56:15.000000000 -0700
+@@ -287,10 +287,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}"; \
@@ -478,10 +2489,9 @@
  	) > $@
  
  env.csh: env.sh
-diff -upr ../orig/hotspot/build/bsd/makefiles/cscope.make ./hotspot/build/bsd/makefiles/cscope.make
---- ../orig/hotspot/build/bsd/makefiles/cscope.make	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/cscope.make	2009-05-05 15:08:05.000000000 -0400
-@@ -72,7 +72,7 @@ endif
+--- hotspot/make/bsd/makefiles/cscope.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/cscope.make	2010-06-20 21:56:15.000000000 -0700
+@@ -71,7 +71,7 @@
  # 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
@@ -490,25 +2500,9 @@
  CS_PRUNE_OS	= $(patsubst %,-o -name '*%*',$(filter-out ${OS},${CS_OS}))
  endif
  
-diff -upr ../orig/hotspot/build/bsd/makefiles/defs.make ./hotspot/build/bsd/makefiles/defs.make
---- ../orig/hotspot/build/bsd/makefiles/defs.make	2009-05-04 18:32:16.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/defs.make	2009-05-04 17:37:15.000000000 -0400
-@@ -28,6 +28,14 @@
- 
- SLASH_JAVA ?= /java
- 
-+# Library suffix
-+OS_VENDOR:=$(shell uname -s)
-+ifeq ($(OS_VENDOR),Darwin)
-+  LIBRARY_SUFFIX=dylib
-+else
-+  LIBRARY_SUFFIX=so
-+endif
-+
- # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
- ARCH:=$(shell uname -m)
- PATH_SEP = :
-@@ -79,6 +87,31 @@ ifeq ($(ARCH), x86_64) 
+--- hotspot/make/bsd/makefiles/defs.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/defs.make	2010-06-22 07:49:14.000000000 -0700
+@@ -90,6 +90,31 @@
    endif
  endif
  
@@ -540,33 +2534,36 @@
  # i686
  ifeq ($(ARCH), i686)
    ARCH_DATA_MODEL  = 32
-@@ -95,19 +128,11 @@ VM_DEBUG=jvmg
+@@ -106,22 +131,22 @@
  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)
+ 
  EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
  EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
--EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so
 -EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
-+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.$(LIBRARY_SUFFIX)
 +EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
- ifeq ($(ARCH_DATA_MODEL), 32)
-   EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
-   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
--  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.so
--  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so 
--  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
--  EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 
--else
--  ifeq ($(ARCH),ia64)
--    else
--      EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
--      EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
--    endif
-+  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.$(LIBRARY_SUFFIX)
-+  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
- endif
-diff -upr ../orig/hotspot/build/bsd/makefiles/gcc.make ./hotspot/build/bsd/makefiles/gcc.make
---- ../orig/hotspot/build/bsd/makefiles/gcc.make	2009-05-04 18:32:16.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/gcc.make	2009-05-04 17:37:15.000000000 -0400
+ ifneq ($(ZERO_BUILD), true)
+   ifeq ($(ARCH_DATA_MODEL), 32)
+     EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
+     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
+-    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so 
+-    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
++    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
++    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX)
+     EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 
+   else
+     ifeq ($(ARCH),ia64)
+       else
+-        EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
++        EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX)
+         EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
+     endif
+   endif
+--- hotspot/make/bsd/makefiles/gcc.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/gcc.make	2010-06-20 21:56:15.000000000 -0700
 @@ -22,12 +22,15 @@
  #  
  #
@@ -586,7 +2583,7 @@
  
  # -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")
-@@ -62,7 +65,7 @@ endif
+@@ -58,7 +61,7 @@
  CFLAGS += $(VM_PICFLAG)
  CFLAGS += -fno-rtti
  CFLAGS += -fno-exceptions
@@ -595,9 +2592,9 @@
  CFLAGS += -fcheck-new
  
  ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
-@@ -72,6 +75,15 @@ ARCHFLAG/ia64    =
- ARCHFLAG/sparc   = -m32 -mcpu=v9
+@@ -69,6 +72,15 @@
  ARCHFLAG/sparcv9 = -m64 -mcpu=v9
+ ARCHFLAG/zero    = $(ZERO_ARCHFLAG)
  
 +# Darwin-specific build flags
 +ifeq ($(OS_VENDOR), Darwin)
@@ -611,7 +2608,7 @@
  CFLAGS     += $(ARCHFLAG)
  AOUT_FLAGS += $(ARCHFLAG)
  LFLAGS     += $(ARCHFLAG)
-@@ -96,6 +108,11 @@ ACCEPTABLE_WARNINGS = -Wpointer-arith -W
+@@ -102,6 +114,11 @@
  CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
  # Special cases
  CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 
@@ -623,13 +2620,17 @@
  
  # The flags to use for an Optimized g++ build
  OPT_CFLAGS += -O3
-@@ -126,20 +143,40 @@ ifeq ($(BUILDARCH), ia64)
+@@ -137,9 +154,6 @@
  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')
+@@ -151,14 +165,37 @@
  # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
  MAPFLAG = -Xlinker --version-script=FILENAME
  
@@ -673,42 +2674,33 @@
  
  #------------------------------------------------------------------------
  # Debug flags
-diff -upr ../orig/hotspot/build/bsd/makefiles/jsig.make ./hotspot/build/bsd/makefiles/jsig.make
---- ../orig/hotspot/build/bsd/makefiles/jsig.make	2009-05-04 18:32:16.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/jsig.make	2009-05-04 17:37:15.000000000 -0400
-@@ -26,7 +26,12 @@
+--- hotspot/make/bsd/makefiles/jsig.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/jsig.make	2010-06-22 05:33:30.000000000 -0700
+@@ -26,10 +26,10 @@
  
  # libjsig[_g].so: signal interposition library
- JSIG = jsig$(G_SUFFIX)
+ JSIG = jsig
 -LIBJSIG = lib$(JSIG).so
-+
-+ifeq ($(OS_VENDOR), Darwin)
-+  LIBJSIG = lib$(JSIG).dylib
-+else
-+  LIBJSIG = lib$(JSIG).so
-+endif
++LIBJSIG = lib$(JSIG).$(LIBRARY_SUFFIX)
  
+ JSIG_G    = $(JSIG)$(G_SUFFIX)
+-LIBJSIG_G = lib$(JSIG_G).so
++LIBJSIG_G = lib$(JSIG_G).$(LIBRARY_SUFFIX)
+ 
  JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
  
-@@ -39,12 +44,12 @@ LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfi
- # cause problems with interposing. See CR: 6466665
- # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE))
- 
--LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT
-+LFLAGS_JSIG += -D_GNU_SOURCE -pthread
- 
+@@ -57,7 +57,7 @@
  $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
  	@echo Making signal interposition lib...
  	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
--                         $(LFLAGS_JSIG) -o $@ $< -ldl
-+                         $(LFLAGS_JSIG) -o $@ $<
+-                         $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl
++                         $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $<
+ 	$(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
  
  install_jsig: $(LIBJSIG)
- 	@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
-diff -upr ../orig/hotspot/build/bsd/makefiles/launcher.make ./hotspot/build/bsd/makefiles/launcher.make
---- ../orig/hotspot/build/bsd/makefiles/launcher.make	2009-05-04 18:32:16.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/launcher.make	2009-05-04 17:37:15.000000000 -0400
-@@ -44,7 +44,7 @@ ifeq ($(LINK_INTO),AOUT)
+--- hotspot/make/bsd/makefiles/launcher.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/launcher.make	2010-06-20 21:56:15.000000000 -0700
+@@ -46,7 +46,7 @@
    LIBS_LAUNCHER             += $(STATIC_STDCXX) $(LIBS)
  else
    LAUNCHER.o                 = launcher.o
@@ -717,53 +2709,89 @@
    LIBS_LAUNCHER             += -l$(JVM) $(LIBS)
  endif
  
-diff -upr ../orig/hotspot/build/bsd/makefiles/sa.make ./hotspot/build/bsd/makefiles/sa.make
---- ../orig/hotspot/build/bsd/makefiles/sa.make	2009-05-04 18:32:16.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/sa.make	2009-05-04 17:37:17.000000000 -0400
-@@ -42,7 +42,7 @@ SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/too
+--- hotspot/make/bsd/makefiles/sa.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/sa.make	2010-06-20 21:56:15.000000000 -0700
+@@ -42,8 +42,8 @@
  
  # gnumake 3.78.1 does not accept the *s that
- # are in AGENT_ALLFILES, so use the shell to expand them
--AGENT_ALLFILES := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_ALLFILES))
-+AGENT_ALLFILES := $(shell /bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_ALLFILES))
+ # 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))
  
  SA_CLASSDIR = $(GENERATED)/saclasses
  
-diff -upr ../orig/hotspot/build/bsd/makefiles/saproc.make ./hotspot/build/bsd/makefiles/saproc.make
---- ../orig/hotspot/build/bsd/makefiles/saproc.make	2009-05-04 18:32:16.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/saproc.make	2009-05-04 17:37:15.000000000 -0400
-@@ -26,7 +26,12 @@
+--- hotspot/make/bsd/makefiles/saproc.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/saproc.make	2010-06-20 22:47:34.000000000 -0700
+@@ -27,10 +27,10 @@
+ # libsaproc[_g].so: serviceability agent
  
- # libsaproc[_g].so: serviceability agent
- SAPROC = saproc$(G_SUFFIX)
+ SAPROC = saproc
 -LIBSAPROC = lib$(SAPROC).so
-+
-+ifeq ($(OS_VENDOR), Darwin)
-+  LIBSAPROC = lib$(SAPROC).dylib
-+else
-+  LIBSAPROC = lib$(SAPROC).so
-+endif
++LIBSAPROC = lib$(SAPROC).$(LIBRARY_SUFFIX)
  
+ SAPROC_G = $(SAPROC)$(G_SUFFIX)
+-LIBSAPROC_G = lib$(SAPROC_G).so
++LIBSAPROC_G = lib$(SAPROC_G).$(LIBRARY_SUFFIX)
+ 
  AGENT_DIR = $(GAMMADIR)/agent
  
-@@ -43,11 +48,11 @@ SAMAPFILE = $(SASRCDIR)/mapfile
+@@ -41,6 +41,7 @@
+              $(SASRCDIR)/libproc_impl.c               \
+              $(SASRCDIR)/ps_proc.c                    \
+              $(SASRCDIR)/ps_core.c                    \
++             $(SASRCDIR)/hsearch_r.c                  \
+              $(SASRCDIR)/BsdDebuggerLocal.c
  
- DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
+ SAMAPFILE = $(SASRCDIR)/mapfile
+@@ -62,6 +63,25 @@
  
--# if $(AGENT_DIR) does not exist, we don't build SA
-+# if $(SASRCDIR) does not exist, we don't build SA
- # also, we don't build SA on Itanium.
+ SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
  
- checkAndBuildSA:
--	$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \
-+	$(QUIETLY) if [ -d $(SASRCDIR) -a "$(SRCARCH)" != "ia64" ] ; then \
- 	   $(MAKE) -f vm.make $(LIBSAPROC); \
- 	fi
++# This is needed to avoid picking up the proc_service.h
++# header in SASRCDIR. We want to use the system provided one.
++ifeq ($(CC_VER_MAJOR), 3)
++INCSASRCDIR=-I$(SASRCDIR) -I-
++else
++INCSASRCDIR=-iquote $(SASRCDIR)
++endif
++
++LIBUTIL=
++ifeq ($(OS_VENDOR), FreeBSD)
++# 7.0 and 6.x use ptrace
++# 7.1 and up use libutil for kinfo_getvmmap
++PTRACE_OS_VERSIONS = 5.% 6.% 7.0%
++EMPTY_IF_KINFO_GETVMMAP = $(filter $(PTRACE_OS_VERSIONS),$(shell uname -r))
++ifeq ($(EMPTY_IF_KINFO_GETVMMAP),)
++LIBUTIL=-lutil
++endif
++endif
++
+ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
+ 	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
+ 	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
+@@ -70,14 +90,15 @@
+ 	@echo Making SA debugger back-end...
+ 	$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE                   \
+                    $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG)     \
+-	           -I$(SASRCDIR)                                        \
++	           $(INCSASRCDIR)                                        \
+ 	           -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 $@                                                \
++	           $(LIBUTIL)						\
+ 	           -lthread_db
+ 	$(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
  
-diff -upr ../orig/hotspot/build/bsd/makefiles/vm.make ./hotspot/build/bsd/makefiles/vm.make
---- ../orig/hotspot/build/bsd/makefiles/vm.make	2009-05-04 18:32:16.000000000 -0400
-+++ ./hotspot/build/bsd/makefiles/vm.make	2009-05-04 17:37:17.000000000 -0400
-@@ -93,7 +93,7 @@ CFLAGS += $(CFLAGS/NOEX)
+--- hotspot/make/bsd/makefiles/vm.make	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/makefiles/vm.make	2010-06-20 22:51:02.000000000 -0700
+@@ -99,7 +99,7 @@
  # Extra flags from gnumake's invocation or environment
  CFLAGS += $(EXTRA_CFLAGS)
  
@@ -772,46 +2800,32 @@
  
  # By default, link the *.o into the library, not the executable.
  LINK_INTO$(LINK_INTO) = LIBJVM
-@@ -108,7 +108,11 @@ include $(MAKEFILES_DIR)/dtrace.make
+@@ -114,8 +114,8 @@
  # JVM
  
- JVM    = jvm$(G_SUFFIX)
--LIBJVM = lib$(JVM).so
-+ifeq ($(OS_VENDOR), Darwin)
-+  LIBJVM = lib$(JVM).dylib
-+else
-+  LIBJVM = lib$(JVM).so
-+endif
+ JVM      = jvm
+-LIBJVM   = lib$(JVM).so
+-LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
++LIBJVM   = lib$(JVM).$(LIBRARY_SUFFIX)
++LIBJVM_G = lib$(JVM)$(G_SUFFIX).$(LIBRARY_SUFFIX)
  
  JVM_OBJ_FILES = $(Obj_Files)
  
-@@ -122,7 +126,7 @@ mapfile_reorder : mapfile $(REORDERFILE)
+@@ -129,11 +129,8 @@
  	rm -f $@
  	cat $^ > $@
  
--STATIC_CXX = true
+-ifeq ($(ZERO_LIBARCH), ppc64)
+-  STATIC_CXX = false
+-else
+-  STATIC_CXX = true
+-endif
++# On BSD shared object could not be linked with static libstd++
 +STATIC_CXX = false
  
  ifeq ($(LINK_INTO),AOUT)
    LIBJVM.o                 =
-@@ -140,14 +144,14 @@ else
-   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)
- endif
- 
--LINK_VM = $(LINK_LIB.c)
- 
- # rule for building precompiled header
- $(PRECOMPILED_HEADER): $(Precompiled_Files)
-@@ -175,11 +179,6 @@ $(LD_SCRIPT): $(LIBJVM_MAPFILE)
+@@ -189,11 +186,6 @@
  LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
  endif
  
@@ -823,98 +2837,39 @@
  $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
  	$(QUIETLY) {                                                    \
  	    echo Linking vm...;                                         \
-@@ -188,15 +187,6 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE)
- 		       $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM);       \
- 	    $(LINK_LIB.CC/POST_HOOK)                                    \
- 	    rm -f $@.1; ln -s $@ $@.1;                                  \
--	    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 $@"; exit 1;                \
--		fi							\
--	      fi							\
--	    fi                                                          \
- 	}
+--- hotspot/make/bsd/platform_amd64	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/platform_amd64	2010-06-20 21:56:15.000000000 -0700
+@@ -12,4 +12,6 @@
  
- DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
-diff -upr ../orig/hotspot/build/bsd/platform_amd64 ./hotspot/build/bsd/platform_amd64
---- ../orig/hotspot/build/bsd/platform_amd64	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/build/bsd/platform_amd64	2009-05-04 17:37:17.000000000 -0400
-@@ -12,6 +12,4 @@ lib_arch = amd64
- 
  compiler = gcc
  
--gnu_dis_arch = amd64
--
 -sysdefs = -DLINUX -D_GNU_SOURCE -DAMD64
++gnu_dis_arch = amd64
++
 +sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64
-diff -upr ../orig/hotspot/build/bsd/platform_i486 ./hotspot/build/bsd/platform_i486
---- ../orig/hotspot/build/bsd/platform_i486	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/build/bsd/platform_i486	2009-05-04 17:37:17.000000000 -0400
-@@ -12,6 +12,4 @@ lib_arch = i386
+--- hotspot/make/bsd/platform_i486	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/make/bsd/platform_i486	2010-06-20 21:56:15.000000000 -0700
+@@ -12,4 +12,6 @@
  
  compiler = gcc
  
--gnu_dis_arch = i386
--
 -sysdefs = -DLINUX -D_GNU_SOURCE -DIA32
++gnu_dis_arch = i386
++
 +sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DIA32
-diff -upr ../orig/hotspot/build/bsd/platform_sparc ./hotspot/build/bsd/platform_sparc
---- ../orig/hotspot/build/bsd/platform_sparc	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/build/bsd/platform_sparc	2009-05-04 17:37:15.000000000 -0400
-@@ -12,6 +12,6 @@ lib_arch = sparc
- 
- compiler = gcc
- 
--gnu_dis_arch = sparc
-+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DSPARC
- 
- sysdefs = -DLINUX -D_GNU_SOURCE -DSPARC
-diff -upr ../orig/hotspot/make/Makefile ./hotspot/make/Makefile
---- ../orig/hotspot/make/Makefile	2009-01-27 15:40:59.000000000 -0500
-+++ ./hotspot/make/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -262,6 +262,19 @@ endif
- 
- # Shared Library
- ifneq ($(OSNAME),windows)
-+ifeq ($(OSNAME),bsd)
-+# BSD-specific LIBRARY_SUFFIX build option
-+$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
-+	$(install-file)
-+$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX):       $(C1_DIR)/%.$(LIBRARY_SUFFIX)
-+	$(install-file)
-+$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX):    $(C1_DIR)/%.$(LIBRARY_SUFFIX)
-+	$(install-file)
-+$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(C2_DIR)/%.$(LIBRARY_SUFFIX)
-+	$(install-file)
-+$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX):    $(C2_DIR)/%.$(LIBRARY_SUFFIX)
-+	$(install-file)
-+else
- $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
- 	$(install-file)
- $(EXPORT_CLIENT_DIR)/%.so:       $(C1_DIR)/%.so
-@@ -273,6 +286,7 @@ $(EXPORT_SERVER_DIR)/%.so:       $(C2_DI
- $(EXPORT_SERVER_DIR)/64/%.so:    $(C2_DIR)/%.so
- 	$(install-file)
- endif
-+endif
- 
- # Jar file (sa-jdi.jar)
- $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
-diff -upr ../orig/hotspot/make/defs.make ./hotspot/make/defs.make
---- ../orig/hotspot/make/defs.make	2009-01-27 15:40:59.000000000 -0500
-+++ ./hotspot/make/defs.make	2009-05-04 17:37:15.000000000 -0400
-@@ -118,13 +118,23 @@ endif
+--- hotspot/make/defs.make	2010-06-21 14:12:13.000000000 -0700
++++ hotspot/make/defs.make	2010-06-26 22:22:26.000000000 -0700
+@@ -119,18 +119,33 @@
  # Windows should have OS predefined
  ifeq ($(OS),)
    OS   := $(shell uname -s)
 +  ifneq ($(findstring BSD,$(OS)),)
 +    OS=bsd
++    LIBRARY_SUFFIX=so
 +  endif
 +  ifeq ($(OS), Darwin)
 +    OS=bsd
++    LIBRARY_SUFFIX=dylib
 +  endif
    HOST := $(shell uname -n)
  endif
@@ -926,37 +2881,53 @@
 -    OSNAME=windows
 +    ifneq ($(OS), bsd)
 +      OSNAME=windows
++      LIBRARY_SUFFIX=dll
 +    else
 +      OSNAME=bsd
 +    endif
    else
      OSNAME=solaris
++    LIBRARY_SUFFIX=so
    endif
-diff -upr ../orig/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp ./hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp
---- ../orig/hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp	2009-01-27 15:41:00.000000000 -0500
-+++ ./hotspot/src/cpu/x86/vm/interpreterRT_x86_32.cpp	2009-05-04 17:37:17.000000000 -0400
-@@ -57,7 +57,7 @@ void InterpreterRuntime::SignatureHandle
-   __ cmpl(Address(from(), Interpreter::local_offset_in_bytes(from_offset)), 0); // do not use temp() to avoid AGI
-   Label L;
-   __ jcc(Assembler::notZero, L);
--  __ movl(temp(), 0);
-+  __ movl(temp(), NULL_WORD);
-   __ bind(L);
-   __ movl(Address(to(), to_offset * wordSize), temp());
- }
-@@ -113,7 +113,7 @@ class SlowSignatureHandler: public Nativ
-   virtual void pass_object() { 
-     // pass address of from
-     intptr_t from_addr = (intptr_t)(_from + Interpreter::local_offset_in_bytes(0));
--    *_to++ = (*(intptr_t*)from_addr == 0) ? NULL : from_addr;
-+    *_to++ = (*(intptr_t*)from_addr == 0) ? NULL_WORD : from_addr;
-     debug_only(verify_tag(frame::TagReference));
-     _from -= Interpreter::stackElementSize();
-    }
-diff -upr ../orig/hotspot/src/cpu/x86/vm/jni_x86.h ./hotspot/src/cpu/x86/vm/jni_x86.h
---- ../orig/hotspot/src/cpu/x86/vm/jni_x86.h	2009-01-27 15:41:00.000000000 -0500
-+++ ./hotspot/src/cpu/x86/vm/jni_x86.h	2009-05-04 17:37:15.000000000 -0400
-@@ -29,7 +29,7 @@
+ else
+   OSNAME=linux
++  LIBRARY_SUFFIX=so
+ endif
+ 
+ # Determinations of default make arguments and platform specific settings
+@@ -235,6 +250,7 @@
+ MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
+ MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION)
+ MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
++MAKE_ARGS += LIBRARY_SUFFIX=$(LIBRARY_SUFFIX)
+ 
+ # Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile
+ # to overwrite the default definition since OS specific Makefile also
+--- hotspot/make/sa.files	2010-06-21 14:12:13.000000000 -0700
++++ hotspot/make/sa.files	2010-06-20 21:56:15.000000000 -0700
+@@ -59,6 +59,9 @@
+ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dbx/x86/*.java \
+ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \
+ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/ia64/*.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/linux/*.java \
+ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \
+ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/ia64/*.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/src/cpu/x86/vm/jni_x86.h	2010-06-21 14:12:14.000000000 -0700
++++ hotspot/src/cpu/x86/vm/jni_x86.h	2010-06-20 21:56:15.000000000 -0700
+@@ -26,7 +26,7 @@
  #ifndef _JAVASOFT_JNI_MD_H_
  #define _JAVASOFT_JNI_MD_H_
  
@@ -965,123 +2936,8 @@
    #define JNIEXPORT
    #define JNIIMPORT
    #define JNICALL
-diff -upr ../orig/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp ./hotspot/src/cpu/x86/vm/runtime_x86_32.cpp
---- ../orig/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp	2009-01-27 15:41:00.000000000 -0500
-+++ ./hotspot/src/cpu/x86/vm/runtime_x86_32.cpp	2009-05-04 17:37:17.000000000 -0400
-@@ -132,11 +132,11 @@ void OptoRuntime::generate_exception_blo
-   // Get the exception pc in case we are deoptimized
-   __ movl(rdx, Address(rcx, JavaThread::exception_pc_offset()));
- #ifdef ASSERT
--  __ movl(Address(rcx, JavaThread::exception_handler_pc_offset()), 0);
--  __ movl(Address(rcx, JavaThread::exception_pc_offset()), 0); 
-+  __ movl(Address(rcx, JavaThread::exception_handler_pc_offset()), NULL_WORD);
-+  __ movl(Address(rcx, JavaThread::exception_pc_offset()), NULL_WORD); 
- #endif
-   // Clear the exception oop so GC no longer processes it as a root.
--  __ movl(Address(rcx, JavaThread::exception_oop_offset()), 0);
-+  __ movl(Address(rcx, JavaThread::exception_oop_offset()), NULL_WORD);
- 
-   __ popl(rcx);
- 
-diff -upr ../orig/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp ./hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
---- ../orig/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	2009-01-27 15:41:00.000000000 -0500
-+++ ./hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	2009-05-05 16:01:30.000000000 -0400
-@@ -472,7 +472,7 @@ class StubGenerator: public StubCodeGene
-     // setup rax & rdx, remove return address & clear pending exception
-     __ popq(rdx);
-     __ movq(rax, Address(r15_thread, Thread::pending_exception_offset()));
--    __ movptr(Address(r15_thread, Thread::pending_exception_offset()), (int)NULL_WORD);
-+    __ movptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
- 
- #ifdef ASSERT
-     // make sure exception is set
-@@ -941,9 +941,9 @@ class StubGenerator: public StubCodeGene
-     __ jcc(Assembler::zero, exit); // if obj is NULL it is OK
-     // Check if the oop is in the right area of memory
-     __ movq(c_rarg2, rax);
--    __ movptr(c_rarg3, (int64_t) Universe::verify_oop_mask());
-+    __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_mask());
-     __ andq(c_rarg2, c_rarg3);
--    __ movptr(c_rarg3, (int64_t) Universe::verify_oop_bits());
-+    __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_bits());
-     __ cmpq(c_rarg2, c_rarg3);
-     __ jcc(Assembler::notZero, error);
- 
-@@ -953,9 +953,9 @@ class StubGenerator: public StubCodeGene
-     __ jcc(Assembler::zero, error); // if klass is NULL it is broken
-     // Check if the klass is in the right area of memory
-     __ movq(c_rarg2, rax);
--    __ movptr(c_rarg3, (int64_t) Universe::verify_klass_mask());
-+    __ movptr(c_rarg3, (intptr_t) Universe::verify_klass_mask());
-     __ andq(c_rarg2, c_rarg3);
--    __ movptr(c_rarg3, (int64_t) Universe::verify_klass_bits());
-+    __ movptr(c_rarg3, (intptr_t) Universe::verify_klass_bits());
-     __ cmpq(c_rarg2, c_rarg3);
-     __ jcc(Assembler::notZero, error);
- 
-@@ -964,9 +964,9 @@ class StubGenerator: public StubCodeGene
-     __ testq(rax, rax);
-     __ jcc(Assembler::zero, error); // if klass' klass is NULL it is broken
-     // Check if the klass' klass is in the right area of memory
--    __ movptr(c_rarg3, (int64_t) Universe::verify_klass_mask());
-+    __ movptr(c_rarg3, (intptr_t) Universe::verify_klass_mask());
-     __ andq(rax, c_rarg3);
--    __ movptr(c_rarg3, (int64_t) Universe::verify_klass_bits());
-+    __ movptr(c_rarg3, (intptr_t) Universe::verify_klass_bits());
-     __ cmpq(rax, c_rarg3);
-     __ jcc(Assembler::notZero, error);
- 
-diff -upr ../orig/hotspot/src/cpu/x86/vm/x86_32.ad ./hotspot/src/cpu/x86/vm/x86_32.ad
---- ../orig/hotspot/src/cpu/x86/vm/x86_32.ad	2009-01-27 15:41:00.000000000 -0500
-+++ ./hotspot/src/cpu/x86/vm/x86_32.ad	2009-05-04 17:37:17.000000000 -0400
-@@ -3364,7 +3364,7 @@ encode %{
-          masm.movl  (Address(boxReg, 0), 3) ;            // results in ST-before-CAS penalty
-          masm.get_thread (scrReg) ; 
-          masm.movl  (boxReg, tmpReg);                    // consider: LEA box, [tmp-2] 
--         masm.movl  (tmpReg, 0);                         // consider: xor vs mov
-+         masm.movl  (tmpReg, NULL_WORD);                         // consider: xor vs mov
-          if (os::is_MP()) { masm.lock(); } 
-          masm.cmpxchg (scrReg, Address(boxReg, ObjectMonitor::owner_offset_in_bytes()-2)) ; 
-       } else 
-@@ -3383,7 +3383,7 @@ encode %{
- 
-          if ((EmitSync & 64) == 0) { 
-            // Optimistic form: consider XORL tmpReg,tmpReg
--           masm.movl  (tmpReg, 0 ) ; 
-+           masm.movl  (tmpReg, NULL_WORD ) ; 
-          } else { 
-            // Can suffer RTS->RTO upgrades on shared or cold $ lines
-            // Test-And-CAS instead of CAS
-@@ -3589,7 +3589,7 @@ encode %{
-          masm.orl   (boxReg, Address (tmpReg, ObjectMonitor::EntryList_offset_in_bytes()-2)) ; 
-          masm.orl   (boxReg, Address (tmpReg, ObjectMonitor::cxq_offset_in_bytes()-2)) ; 
-          masm.jccb  (Assembler::notZero, DONE_LABEL) ; 
--         masm.movl  (Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), 0) ; 
-+         masm.movl  (Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), NULL_WORD) ; 
-          masm.jmpb  (DONE_LABEL) ; 
-       } else { 
-          masm.xorl  (boxReg, Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2)) ;  
-@@ -3598,7 +3598,7 @@ encode %{
-          masm.movl  (boxReg, Address (tmpReg, ObjectMonitor::EntryList_offset_in_bytes()-2)) ; 
-          masm.orl   (boxReg, Address (tmpReg, ObjectMonitor::cxq_offset_in_bytes()-2)) ; 
-          masm.jccb  (Assembler::notZero, CheckSucc) ; 
--         masm.movl  (Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), 0) ; 
-+         masm.movl  (Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), NULL_WORD) ; 
-          masm.jmpb  (DONE_LABEL) ; 
-       }
- 
-@@ -3646,7 +3646,7 @@ encode %{
-          // We currently use (3), although it's likely that switching to (2) 
-          // is correct for the future.
-             
--         masm.movl  (Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), 0) ; 
-+         masm.movl  (Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), NULL_WORD) ; 
-          if (os::is_MP()) { 
-             if (VM_Version::supports_sse2() && 1 == FenceInstruction) { 
-               masm.emit_raw (0x0F) ;    // MFENCE ...
-diff -upr ../orig/hotspot/src/os/bsd/launcher/java_md.c ./hotspot/src/os/bsd/launcher/java_md.c
---- ../orig/hotspot/src/os/bsd/launcher/java_md.c	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/launcher/java_md.c	2009-05-05 17:57:18.000000000 -0400
+--- hotspot/src/os/bsd/launcher/java_md.c	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/launcher/java_md.c	2010-06-20 21:56:15.000000000 -0700
 @@ -45,8 +45,15 @@
  #include "version_comp.h"
  #endif
@@ -1098,16 +2954,16 @@
  
  #ifndef GAMMA   /* launcher.make defines ARCH */
  
-@@ -112,7 +119,7 @@ extern char **environ;
+@@ -112,7 +119,7 @@
   *      A collection of useful strings. One should think of these as #define
   *      entries, but actual strings can be more efficient (with many compilers).
   */
 -#ifdef __bsd__
 +#ifdef _ALLBSD_SOURCE
- static const char *system_dir	= "/usr/java";
- static const char *user_dir	= "/java";
+ static const char *system_dir   = "/usr/java";
+ static const char *user_dir     = "/java";
  #else /* Solaris */
-@@ -456,10 +463,10 @@ CreateExecutionEnvironment(int *_argcp,
+@@ -456,10 +463,10 @@
         * If not on Solaris, assume only a single LD_LIBRARY_PATH
         * variable.
         */
@@ -1120,7 +2976,7 @@
        /*
         * On bsd, if a binary is running as sgid or suid, glibc sets
         * LD_LIBRARY_PATH to the empty string for security purposes.  (In
-@@ -836,7 +843,7 @@ GetXUsagePath(char *buf, jint bufsize)
+@@ -836,7 +843,7 @@
  jboolean
  GetApplicationHome(char *buf, jint bufsize)
  {
@@ -1128,26 +2984,26 @@
 +#ifdef _ALLBSD_SOURCE
      char *execname = GetExecname();
      if (execname) {
- 	strncpy(buf, execname, bufsize-1);
-@@ -1005,7 +1012,7 @@ SetExecname(char **argv)
- 	    }
+         strncpy(buf, execname, bufsize-1);
+@@ -1005,7 +1012,7 @@
+             }
          }
      }
 -#elif defined(__bsd__)
 +#elif defined(__linux__)
      {
- 	const char* self = "/proc/self/exe";
+         const char* self = "/proc/self/exe";
          char buf[PATH_MAX+1];
-@@ -1015,7 +1022,7 @@ SetExecname(char **argv)
- 	    exec_path = strdup(buf);
- 	}
+@@ -1015,7 +1022,7 @@
+             exec_path = strdup(buf);
+         }
      }
 -#else /* !__sun && !__bsd */
 +#else /* !__sun && !__linux */
      {
          /* Not implemented */
      }
-@@ -1220,7 +1227,7 @@ get_cpuid(uint32_t arg,
+@@ -1220,7 +1227,7 @@
  
  #endif /* __sun && i586 */
  
@@ -1156,7 +3012,7 @@
  
  /*
   * A utility method for asking the CPU about itself.
-@@ -1286,7 +1293,7 @@ get_cpuid(uint32_t arg,
+@@ -1286,7 +1293,7 @@
  #endif
  }
  
@@ -1164,8 +3020,8 @@
 +#endif /* _ALLBSD_SOURCE && i586 */
  
  #ifdef i586
- /* 
-@@ -1465,7 +1472,7 @@ solaris_i586_ServerClassMachine(void) {
+ /*
+@@ -1465,7 +1472,7 @@
  
  #endif /* __sun && i586 */
  
@@ -1174,7 +3030,7 @@
  
  /* The definition of a server-class machine for bsd-i586 */
  jboolean
-@@ -1496,7 +1503,7 @@ bsd_i586_ServerClassMachine(void) {
+@@ -1496,7 +1503,7 @@
    return result;
  }
  
@@ -1183,7 +3039,7 @@
  
  /* Dispatch to the platform-specific definition of "server-class" */
  jboolean
-@@ -1506,7 +1513,7 @@ ServerClassMachine(void) {
+@@ -1506,7 +1513,7 @@
    result = solaris_sparc_ServerClassMachine();
  #elif defined(__sun) && defined(i586)
    result = solaris_i586_ServerClassMachine();
@@ -1192,11 +3048,51 @@
    result = bsd_i586_ServerClassMachine();
  #else
    if (_launcher_debug) {
-diff -upr ../orig/hotspot/src/os/bsd/vm/attachListener_bsd.cpp ./hotspot/src/os/bsd/vm/attachListener_bsd.cpp
---- ../orig/hotspot/src/os/bsd/vm/attachListener_bsd.cpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/attachListener_bsd.cpp	2009-05-05 17:58:29.000000000 -0400
-@@ -333,6 +333,15 @@ BsdAttachOperation* BsdAttachListener::d
+--- hotspot/src/os/bsd/vm/attachListener_bsd.cpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/attachListener_bsd.cpp	2010-06-20 21:56:15.000000000 -0700
+@@ -179,32 +179,20 @@
+   struct sockaddr_un addr;
+   addr.sun_family = AF_UNIX;
  
+-  // FIXME: Prior to b39 the tool-side API expected to find the well
+-  // known file in the working directory. To allow this libjvm.so work with
+-  // a pre-b39 SDK we create it in the working directory if
+-  // +StartAttachListener is used is used. All unit tests for this feature
+-  // currently used this flag. Once b39 SDK has been promoted we can remove
+-  // this code.
+-  if (StartAttachListener) {
+-    sprintf(path, ".java_pid%d", os::current_process_id());
+-    strcpy(addr.sun_path, path);
+-    ::unlink(path);
+-    res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr));
+-  }
+-  if (res == -1) {
+-    sprintf(path, "%s/.java_pid%d", os::get_temp_directory(), os::current_process_id());
+-    strcpy(addr.sun_path, path);
+-    ::unlink(path);
+-    res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr));
+-  }
++
++  sprintf(path, "%s/.java_pid%d", os::get_temp_directory(), os::current_process_id());
++  strcpy(addr.sun_path, path);
++  ::unlink(path);
++  res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr));
+   if (res == -1) {
+     RESTARTABLE(::close(listener), res);
+     return -1;
+   }
+   set_path(path);
+ 
+-  // put in listen mode and set permission
+-  if ((::listen(listener, 5) == -1) || (::chmod(path, S_IREAD|S_IWRITE) == -1)) {
++  // put in listen mode and set permission and ownership
++  if ((::listen(listener, 5) == -1) || (::chmod(path, S_IREAD|S_IWRITE) == -1) ||
++      (::chown(path, geteuid(), getegid()) == -1)) {
+     RESTARTABLE(::close(listener), res);
+     ::unlink(path);
+     set_path(NULL);
+@@ -330,6 +318,15 @@
+ 
      // get the credentials of the peer and check the effective uid/guid
      // - check with jeff on this.
 +#ifdef _ALLBSD_SOURCE
@@ -1211,7 +3107,7 @@
      struct ucred cred_info;
      socklen_t optlen = sizeof(cred_info);
      if (::getsockopt(s, SOL_SOCKET, SO_PEERCRED, (void*)&cred_info, &optlen) == -1) {
-@@ -340,10 +349,13 @@ BsdAttachOperation* BsdAttachListener::d
+@@ -337,10 +334,13 @@
        RESTARTABLE(::close(s), res);
        continue;
      }
@@ -1226,26 +3122,30 @@
        int res;
        RESTARTABLE(::close(s), res);
        continue;
-@@ -466,11 +478,11 @@ bool AttachListener::is_init_trigger() {
-   char fn[32];
-   sprintf(fn, ".attach_pid%d", os::current_process_id());
+@@ -460,15 +460,12 @@
+   if (init_at_startup() || is_initialized()) {
+     return false;               // initialized at startup or already initialized
+   }
+-  char fn[32];
+-  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) {
+-    sprintf(fn, "/tmp/.attach_pid%d", os::current_process_id());
+-    RESTARTABLE(::stat64(fn, &st), ret);
+-  }
 +  struct stat st;
-+  RESTARTABLE(::stat(fn, &st), ret);
-   if (ret == -1) {
-     sprintf(fn, "/tmp/.attach_pid%d", os::current_process_id());
--    RESTARTABLE(::stat64(fn, &st), ret);
-+    RESTARTABLE(::stat(fn, &st), ret);
-   }
++
++  sprintf(path, "%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
-Only in ./hotspot/src/os/bsd/vm: dtraceJSDT_bsd.cpp
-diff -upr ../orig/hotspot/src/os/bsd/vm/hpi_bsd.cpp ./hotspot/src/os/bsd/vm/hpi_bsd.cpp
---- ../orig/hotspot/src/os/bsd/vm/hpi_bsd.cpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/hpi_bsd.cpp	2009-05-05 18:00:58.000000000 -0400
-@@ -31,6 +31,14 @@
+     // a bogus user creates the file
+--- hotspot/src/os/bsd/vm/hpi_bsd.cpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/hpi_bsd.cpp	2010-06-20 21:56:15.000000000 -0700
+@@ -28,6 +28,14 @@
  # include <sys/param.h>
  # include <dlfcn.h>
  
@@ -1260,9 +3160,9 @@
  typedef jint (JNICALL *init_t)(GetInterfaceFunc *, void *);
  
  void hpi::initialize_get_interface(vm_calls_t *callbacks) {
-@@ -48,11 +56,11 @@ void hpi::initialize_get_interface(vm_ca
+@@ -45,11 +53,11 @@
        os::jvm_path(buf, JVM_MAXPATHLEN);
-       
+ 
  #ifdef PRODUCT
 -      const char * hpi_lib = "/libhpi.so";
 +      const char * hpi_lib = "/" HPI_LIB;
@@ -1274,10 +3174,9 @@
  #endif
  
        *(strrchr(buf, '/')) = '\0';  /* get rid of /libjvm.so */
-diff -upr ../orig/hotspot/src/os/bsd/vm/hpi_bsd.hpp ./hotspot/src/os/bsd/vm/hpi_bsd.hpp
---- ../orig/hotspot/src/os/bsd/vm/hpi_bsd.hpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/hpi_bsd.hpp	2009-05-05 18:12:24.000000000 -0400
-@@ -39,26 +39,22 @@
+--- hotspot/src/os/bsd/vm/hpi_bsd.hpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/hpi_bsd.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -36,7 +36,7 @@
  // HPI_FileInterface
  
  inline int hpi::close(int fd) {
@@ -1286,20 +3185,7 @@
  }
  
  inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
--  size_t res;
--  RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);
--  return res;
-+  INTERRUPTIBLE_RETURN_INT(::read(fd, buf, (size_t) nBytes), os::Bsd::clear_interrupted);
- }
- 
- inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) {
--  size_t res;
--  RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
--  return res;
-+  INTERRUPTIBLE_RETURN_INT(::write(fd, buf, (size_t) nBytes), os::Bsd::clear_interrupted);
- }
- 
- 
+@@ -55,7 +55,7 @@
  // HPI_SocketInterface
  
  inline int hpi::socket_close(int fd) {
@@ -1308,87 +3194,23 @@
  }
  
  inline int hpi::socket(int domain, int type, int protocol) {
-@@ -66,11 +62,11 @@ inline int hpi::socket(int domain, int t
- }
- 
- inline int hpi::recv(int fd, char *buf, int nBytes, int flags) {
--  RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags));
-+  INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags), os::Bsd::clear_interrupted);
- }
- 
- inline int hpi::send(int fd, char *buf, int nBytes, int flags) {
--  RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags));
-+  INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags), os::Bsd::clear_interrupted);
- }
- 
- inline int hpi::timeout(int fd, long timeout) {
-@@ -81,12 +77,13 @@ inline int hpi::timeout(int fd, long tim
-   prevtime = ((julong)t.tv_sec * 1000)  +  t.tv_usec / 1000;
- 
-   for(;;) {
-+    int res;
-     struct pollfd pfd;
- 
-     pfd.fd = fd;
-     pfd.events = POLLIN | POLLERR;
-   
--    int res = ::poll(&pfd, 1, timeout);
-+    INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Bsd::clear_interrupted);
- 
-     if (res == OS_ERR && errno == EINTR) {
- 
-@@ -110,7 +107,26 @@ inline int hpi::listen(int fd, int count
- }
- 
- inline int hpi::connect(int fd, struct sockaddr *him, int len) {
--  RESTARTABLE_RETURN_INT(::connect(fd, him, len));
-+  do {
-+    int _result;
-+    INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result,
-+                           os::Bsd::clear_interrupted);
-+
-+    // Depending on when thread interruption is reset, _result could be
-+    // one of two values when errno == EINTR
-+
-+    if (((_result == OS_INTRPT) || (_result == OS_ERR)) && (errno == EINTR)) {
-+      /* restarting a connect() changes its errno semantics */
-+      INTERRUPTIBLE(::connect(fd, him, len), _result,
-+                     os::Bsd::clear_interrupted);
-+      /* undo these changes */
-+      if (_result == OS_ERR) {
-+       if (errno == EALREADY) errno = EINPROGRESS; /* fall through */
-+       else if (errno == EISCONN) { errno = 0; return OS_OK; }
-+      }
-+    }
-+    return _result;
-+  } while(false);
- }
- 
- inline int hpi::accept(int fd, struct sockaddr *him, int *len) {
-@@ -121,26 +137,33 @@ inline int hpi::accept(int fd, struct so
+@@ -120,9 +120,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
+-  // Bsd doc says this can't return EINTR, unlike accept() on Solaris
++  // At least OpenBSD and FreeBSD can return EINTR from accept.
  
 -  return ::accept(fd, him, (socklen_t *)len);
-+  if (fd < 0)
-+    return OS_ERR;
-+  INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him, (socklen_t*) len), os::Bsd::clear_interrupted);
++  RESTARTABLE_RETURN_INT(::accept(fd, him, (socklen_t *)len));
  }
  
  inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags,
- 		         sockaddr *from, int *fromlen) {
--  RESTARTABLE_RETURN_INT(::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen));
-+  INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen), os::Bsd::clear_interrupted);
+@@ -136,12 +136,16 @@
  }
  
- inline int hpi::sendto(int fd, char *buf, int len, int flags,
- 			struct sockaddr *to, int tolen) {
--  RESTARTABLE_RETURN_INT(::sendto(fd, buf, len, (unsigned int) flags, to, tolen));
-+  INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, (unsigned int) flags, to, tolen),os::Bsd::clear_interrupted);
- }
- 
  inline int hpi::socket_available(int fd, jint *pbytes) {
-   // Bsd doc says EINTR not returned, unlike Solaris
+-  // Bsd doc says EINTR not returned, unlike Solaris
 -  int ret = ::ioctl(fd, FIONREAD, pbytes);
 +  int ret;
 +
@@ -1404,21 +3226,11 @@
  }
  
  
-@@ -167,7 +190,7 @@ HPIDECL(bind, "bind", _socket, Bind, 
-         (fd, him, len));
- */
- inline int hpi::bind(int fd, struct sockaddr *him, int len){
--  return ::bind(fd, him, len);
-+  INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),os::Bsd::clear_interrupted);
+--- hotspot/src/os/bsd/vm/jsig.c	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/jsig.c	2010-06-20 21:56:15.000000000 -0700
+@@ -143,7 +143,8 @@
  }
  
- /*
-diff -upr ../orig/hotspot/src/os/bsd/vm/jsig.c ./hotspot/src/os/bsd/vm/jsig.c
---- ../orig/hotspot/src/os/bsd/vm/jsig.c	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/jsig.c	2009-05-04 17:37:15.000000000 -0400
-@@ -146,7 +146,8 @@ sa_handler_t signal(int sig, sa_handler_
- }
- 
  sa_handler_t sigset(int sig, sa_handler_t disp) {
 -  return set_signal(sig, disp, true);
 +  printf("sigset() is not supported by BSD");
@@ -1426,58 +3238,57 @@
   }
  
  static int call_os_sigaction(int sig, const struct sigaction  *act,
-diff -upr ../orig/hotspot/src/os/bsd/vm/jvm_bsd.cpp ./hotspot/src/os/bsd/vm/jvm_bsd.cpp
---- ../orig/hotspot/src/os/bsd/vm/jvm_bsd.cpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/jvm_bsd.cpp	2009-05-05 18:16:36.000000000 -0400
-@@ -141,44 +141,37 @@ struct siglabel {
+--- hotspot/src/os/bsd/vm/jvm_bsd.cpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/jvm_bsd.cpp	2010-06-20 21:56:15.000000000 -0700
+@@ -138,44 +138,37 @@
  
  struct siglabel siglabels[] = {
    /* derived from /usr/include/bits/signum.h on RH7.2 */
--   "HUP",	SIGHUP,		/* Hangup (POSIX).  */
+-   "HUP",       SIGHUP,         /* Hangup (POSIX).  */
 +  "HUP",	SIGHUP,		/* Hangup (POSIX).  */
-   "INT",	SIGINT,		/* Interrupt (ANSI).  */
-   "QUIT",	SIGQUIT,	/* Quit (POSIX).  */
-   "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).  */
+   "INT",        SIGINT,         /* Interrupt (ANSI).  */
+   "QUIT",       SIGQUIT,        /* Quit (POSIX).  */
+   "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).  */
+   "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).  */
+   "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).  */
+   "PIPE",       SIGPIPE,        /* Broken pipe (POSIX).  */
+   "ALRM",       SIGALRM,        /* Alarm clock (POSIX).  */
+   "TERM",       SIGTERM,        /* Termination (ANSI).  */
 -#ifdef SIGSTKFLT
--  "STKFLT",	SIGSTKFLT,	/* Stack fault.  */
+-  "STKFLT",     SIGSTKFLT,      /* Stack fault.  */
 -#endif
--  "CLD",	SIGCLD,		/* Same as SIGCHLD (System V).  */
--  "CHLD",	SIGCHLD,	/* Child status has changed (POSIX).  */
--  "CONT",	SIGCONT,	/* Continue (POSIX).  */
+-  "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).  */
+   "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).  */
+   "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).  */
+   "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! */
+-  "SYS",        SIGSYS          /* Bad system call. Only on some Bsden! */
 -#endif
 +  "INFO",	SIGINFO,	/* Information request.  */
 +  "USR1",	SIGUSR1,	/* User-defined signal 1 (POSIX).  */
@@ -1485,10 +3296,9 @@
    };
  
  JVM_ENTRY_NO_ENV(jint, JVM_FindSignal(const char *name))
-diff -upr ../orig/hotspot/src/os/bsd/vm/jvm_bsd.h ./hotspot/src/os/bsd/vm/jvm_bsd.h
---- ../orig/hotspot/src/os/bsd/vm/jvm_bsd.h	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/jvm_bsd.h	2009-05-05 18:16:44.000000000 -0400
-@@ -54,7 +54,11 @@
+--- hotspot/src/os/bsd/vm/jvm_bsd.h	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/jvm_bsd.h	2010-06-20 21:56:15.000000000 -0700
+@@ -51,7 +51,11 @@
  #define AGENT_ONATTACH_SYMBOLS  {"Agent_OnAttach"}
  
  #define JNI_LIB_PREFIX "lib"
@@ -1500,7 +3310,7 @@
  
  // 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 +97,20 @@
+@@ -90,6 +94,20 @@
  #define SHUTDOWN2_SIGNAL SIGINT
  #define SHUTDOWN3_SIGNAL SIGTERM
  
@@ -1521,10 +3331,9 @@
  #endif /* JVM_MD_H */
  
  // Reconciliation History
-diff -upr ../orig/hotspot/src/os/bsd/vm/osThread_bsd.cpp ./hotspot/src/os/bsd/vm/osThread_bsd.cpp
---- ../orig/hotspot/src/os/bsd/vm/osThread_bsd.cpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/osThread_bsd.cpp	2009-05-05 18:19:09.000000000 -0400
-@@ -31,8 +31,8 @@
+--- hotspot/src/os/bsd/vm/osThread_bsd.cpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/osThread_bsd.cpp	2010-06-20 21:56:15.000000000 -0700
+@@ -28,8 +28,8 @@
  
  void OSThread::pd_initialize() {
    assert(this != NULL, "check");
@@ -1535,10 +3344,9 @@
    _siginfo = NULL;
    _ucontext = NULL;
    _expanding_stack = 0;
-diff -upr ../orig/hotspot/src/os/bsd/vm/osThread_bsd.hpp ./hotspot/src/os/bsd/vm/osThread_bsd.hpp
---- ../orig/hotspot/src/os/bsd/vm/osThread_bsd.hpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/osThread_bsd.hpp	2009-05-05 20:37:04.000000000 -0400
-@@ -39,6 +39,12 @@
+--- hotspot/src/os/bsd/vm/osThread_bsd.hpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/osThread_bsd.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -36,6 +36,12 @@
  
   private:
  
@@ -1551,7 +3359,7 @@
    // _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 @@
+@@ -44,6 +50,7 @@
    // _pthread_id is the pthread id, which is used by library calls
    // (e.g. pthread_kill).
    pthread_t _pthread_id;
@@ -1559,7 +3367,7 @@
  
    sigset_t _caller_sigmask; // Caller's signal mask
  
-@@ -56,12 +63,18 @@
+@@ -53,12 +60,18 @@
    sigset_t  caller_sigmask() const       { return _caller_sigmask; }
    void    set_caller_sigmask(sigset_t sigmask)  { _caller_sigmask = sigmask; }
  
@@ -1579,7 +3387,7 @@
  #endif
  #ifdef ASSERT
    // We expect no reposition failures so kill vm if we get one.
-@@ -70,9 +83,15 @@
+@@ -67,9 +80,15 @@
      return false;
    }
  #endif // ASSERT
@@ -1595,7 +3403,7 @@
    pthread_t pthread_id() const {
      return _pthread_id;
    }
-@@ -123,6 +142,9 @@ public:
+@@ -120,6 +139,9 @@
  
  private:
    Monitor* _startThread_lock;     // sync parent and child in thread creation
@@ -1605,7 +3413,7 @@
  
  public:
  
-@@ -130,6 +152,11 @@ public:
+@@ -127,6 +149,11 @@
      return _startThread_lock;
    }
  
@@ -1617,10 +3425,15 @@
    // ***************************************************************
    // Platform dependent initialization and cleanup
    // ***************************************************************
-diff -upr ../orig/hotspot/src/os/bsd/vm/os_bsd.cpp ./hotspot/src/os/bsd/vm/os_bsd.cpp
---- ../orig/hotspot/src/os/bsd/vm/os_bsd.cpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/os_bsd.cpp	2009-05-04 17:37:17.000000000 -0400
-@@ -50,12 +50,33 @@
+--- hotspot/src/os/bsd/vm/os_bsd.cpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/os_bsd.cpp	2010-06-20 22:51:50.000000000 -0700
+@@ -42,17 +42,39 @@
+ # 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>
@@ -1639,7 +3452,7 @@
  # include <link.h>
 +#endif
 +
-+#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
 +# include <elf.h>
 +#endif
 +
@@ -1654,7 +3467,7 @@
  
  #define MAX_PATH    (2 * K)
  
-@@ -67,19 +88,25 @@
+@@ -64,19 +86,25 @@
  // global variables
  julong os::Bsd::_physical_memory = 0;
  
@@ -1680,85 +3493,16 @@
  
  static jlong initial_time_count=0;
  
-@@ -97,6 +124,77 @@ static pid_t _initial_pid = 0;
+@@ -94,8 +122,6 @@
  static int SR_signum = SIGUSR2;
  sigset_t SR_sigset;
  
-+#ifdef _ALLBSD_SOURCE
-+// XXXBSD: ported from solaris version
-+// interruptible infrastructure
-+
-+// setup_interruptible saves the thread state before going into an
-+// interruptible system call.  
-+// The saved state is used to restore the thread to
-+// its former state whether or not an interrupt is received.  
-+// Used by classloader os::read 
-+// hpi calls skip this layer and stay in _thread_in_native
-+
-+void os::Bsd::setup_interruptible(JavaThread* thread) {
-+ 
-+  JavaThreadState thread_state = thread->thread_state();
-+
-+  assert(thread_state != _thread_blocked, "Coming from the wrong thread");
-+  assert(thread_state != _thread_in_native, "Native threads skip setup_interruptible");
-+  OSThread* osthread = thread->osthread();
-+  osthread->set_saved_interrupt_thread_state(thread_state);
-+  thread->frame_anchor()->make_walkable(thread);
-+  ThreadStateTransition::transition(thread, thread_state, _thread_blocked);
-+}
-+
-+// Version of setup_interruptible() for threads that are already in
-+// _thread_blocked. Used by os_sleep().
-+void os::Bsd::setup_interruptible_already_blocked(JavaThread* thread) {
-+  thread->frame_anchor()->make_walkable(thread);
-+}
-+
-+JavaThread* os::Bsd::setup_interruptible() {
-+  JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread();
-+  setup_interruptible(thread);
-+  return thread;
-+}
-+
-+#ifdef ASSERT
-+
-+JavaThread* os::Bsd::setup_interruptible_native() {
-+  JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread();
-+  JavaThreadState thread_state = thread->thread_state();
-+  assert(thread_state == _thread_in_native, "Assumed thread_in_native");
-+  return thread;
-+}
-+
-+void os::Bsd::cleanup_interruptible_native(JavaThread* thread) {
-+  JavaThreadState thread_state = thread->thread_state();
-+  assert(thread_state == _thread_in_native, "Assumed thread_in_native");
-+}
-+#endif
-+
-+// cleanup_interruptible reverses the effects of setup_interruptible
-+// setup_interruptible_already_blocked() does not need any cleanup.
-+
-+void os::Bsd::cleanup_interruptible(JavaThread* thread) {
-+  OSThread* osthread = thread->osthread();
-+
-+  ThreadStateTransition::transition(thread, _thread_blocked, osthread->saved_interrupt_thread_state());
-+}
-+
-+// I/O interruption related counters called in _INTERRUPTIBLE
-+
-+void os::Bsd::bump_interrupted_before_count() {
-+  RuntimeService::record_interrupted_before_count();
-+}
-+
-+void os::Bsd::bump_interrupted_during_count() {
-+  RuntimeService::record_interrupted_during_count();
-+}
-+#endif
-+
-+
+-/* Used to protect dlsym() calls */
+-static pthread_mutex_t dl_mutex;
+ 
  ////////////////////////////////////////////////////////////////////////////////
  // utility functions
- 
-@@ -108,11 +206,17 @@ julong os::available_memory() {
+@@ -108,11 +134,16 @@
  }
  
  julong os::Bsd::available_memory() {
@@ -1766,17 +3510,16 @@
 +  // 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() {
-@@ -160,6 +264,7 @@ bool os::have_special_privileges() {
+@@ -160,6 +191,7 @@
  }
  
  
@@ -1784,15 +3527,15 @@
  #ifndef SYS_gettid
  // i386: 224, ia64: 1105, amd64: 186, sparc 143
  #ifdef __ia64__
-@@ -174,6 +279,7 @@ bool os::have_special_privileges() {
+@@ -174,6 +206,7 @@
  #error define gettid for the arch
  #endif
  #endif
 +#endif
  
  // Cpu architecture string
- #if   defined(IA64)
-@@ -193,6 +299,7 @@ static char cpu_arch[] = "sparc";
+ #if   defined(ZERO)
+@@ -195,6 +228,7 @@
  #endif
  
  
@@ -1800,10 +3543,10 @@
  // pid_t gettid()
  //
  // Returns the kernel thread id of the currently running thread. Kernel
-@@ -219,7 +326,47 @@ static bool unsafe_chroot_detected = fal
+@@ -221,7 +255,47 @@
  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.";
+                      "Java may be unstable running multithreaded in a chroot "
+                      "environment on Bsd when /proc filesystem is not mounted.";
 +#endif
  
 +#ifdef _ALLBSD_SOURCE
@@ -1846,30 +3589,42 @@
 +}
 +#else
  void os::Bsd::initialize_system_info() {
-   _processor_count = sysconf(_SC_NPROCESSORS_CONF);
-   if (_processor_count == 1) {
-@@ -236,6 +383,7 @@ void os::Bsd::initialize_system_info() {
+   set_processor_count(sysconf(_SC_NPROCESSORS_CONF));
+   if (processor_count() == 1) {
+@@ -238,6 +312,7 @@
    _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE);
-   assert(_processor_count > 0, "bsd error");
+   assert(processor_count() > 0, "bsd error");
  }
 +#endif
  
  void os::init_system_properties_values() {
  //  char arch[12];
-@@ -356,7 +504,12 @@ void os::init_system_properties_values()
- 	 * should always exist (until the legacy problem cited above is
- 	 * addressed).
- 	 */
+@@ -281,10 +356,8 @@
+  *        ...
+  *        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
+-#define DEFAULT_LIBPATH "/lib:/usr/lib"
++#ifndef DEFAULT_LIBPATH
++#define DEFAULT_LIBPATH "/lib:/usr/lib"
+ #endif
+ 
+ #define EXTENSIONS_DIR  "/lib/ext"
+@@ -362,7 +435,11 @@
+          * should always exist (until the legacy problem cited above is
+          * addressed).
+          */
 +#ifdef __APPLE__
-+   char *v = getenv("DYLD_LIBRARY_PATH");
++        char *v = getenv("DYLD_LIBRARY_PATH");
 +#else
- 	char *v = getenv("LD_LIBRARY_PATH");
+         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' */
-@@ -515,6 +668,7 @@ void os::Bsd::hotspot_sigmask(Thread* th
+         if (v != NULL) {
+             char *t = ld_library_path;
+             /* That's +1 for the colon and +1 for the trailing '\0' */
+@@ -521,6 +598,7 @@
    }
  }
  
@@ -1877,25 +3632,44 @@
  //////////////////////////////////////////////////////////////////////////////
  // detecting pthread library
  
-@@ -679,6 +833,7 @@ bool os::Bsd::manually_expand_stack(Java
+@@ -573,15 +651,15 @@
    }
+ 
+   if (strstr(libpthread_version(), "NPTL")) {
+-    os::Bsd::set_is_NPTL();
++     os::Bsd::set_is_NPTL();
+   } else {
+-    os::Bsd::set_is_BsdThreads();
++     os::Bsd::set_is_BsdThreads();
+   }
+ 
+   // BsdThreads have two flavors: floating-stack mode, which allows variable
+   // stack size; and fixed-stack mode. NPTL is always floating-stack.
+   if (os::Bsd::is_NPTL() || os::Bsd::supports_variable_stack_size()) {
+-    os::Bsd::set_is_floating_stack();
++     os::Bsd::set_is_floating_stack();
+   }
+ }
+ 
+@@ -684,6 +762,7 @@
+   }
    return false;
  }
 +#endif
  
  //////////////////////////////////////////////////////////////////////////////
  // create new thread
-@@ -687,6 +842,9 @@ static address highest_vm_reserved_addre
+@@ -692,6 +771,9 @@
  
  // check if it's safe to start a new thread
  static bool _thread_safety_check(Thread* thread) {
 +#ifdef _ALLBSD_SOURCE
-+  return true;
++    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
-@@ -720,6 +878,7 @@ static bool _thread_safety_check(Thread*
+@@ -725,6 +807,7 @@
      //   here, that means enough space has been reserved for stack.
      return true;
    }
@@ -1903,7 +3677,7 @@
  }
  
  // Thread start routine for all newly created threads
-@@ -747,6 +906,10 @@ static void *java_start(Thread *thread) 
+@@ -752,6 +835,10 @@
      return NULL;
    }
  
@@ -1914,7 +3688,7 @@
    // thread_id is kernel thread id (similar to Solaris LWP id)
    osthread->set_thread_id(os::Bsd::gettid());
  
-@@ -756,6 +919,7 @@ static void *java_start(Thread *thread) 
+@@ -761,6 +848,7 @@
        thread->set_lgrp_id(lgrp_id);
      }
    }
@@ -1922,7 +3696,7 @@
    // initialize signal mask for this thread
    os::Bsd::hotspot_sigmask(thread);
  
-@@ -836,17 +1000,22 @@ bool os::create_thread(Thread* thread, T
+@@ -841,17 +929,22 @@
      // let pthread_create() pick the default value.
    }
  
@@ -1945,7 +3719,7 @@
  
      pthread_t tid;
      int ret = pthread_create(&tid, &attr, (void* (*)(void*)) java_start, thread);
-@@ -860,7 +1029,9 @@ bool os::create_thread(Thread* thread, T
+@@ -865,7 +958,9 @@
        // Need to clean up stuff we've allocated so far
        thread->set_osthread(NULL);
        delete osthread;
@@ -1955,7 +3729,7 @@
        return false;
      }
  
-@@ -876,9 +1047,11 @@ bool os::create_thread(Thread* thread, T
+@@ -881,9 +976,11 @@
        }
      }
  
@@ -1967,7 +3741,7 @@
    }
  
    // Aborted due to thread limit being reached
-@@ -916,7 +1089,11 @@ bool os::create_attached_thread(JavaThre
+@@ -921,7 +1018,11 @@
    }
  
    // Store pthread info into the OSThread
@@ -1979,7 +3753,7 @@
    osthread->set_pthread_id(::pthread_self());
  
    // initialize floating point control register
-@@ -927,6 +1104,7 @@ bool os::create_attached_thread(JavaThre
+@@ -932,6 +1033,7 @@
  
    thread->set_osthread(osthread);
  
@@ -1987,7 +3761,7 @@
    if (UseNUMA) {
      int lgrp_id = os::numa_get_group_id();
      if (lgrp_id != -1) {
-@@ -953,6 +1131,7 @@ bool os::create_attached_thread(JavaThre
+@@ -958,6 +1060,7 @@
      os::Bsd::manually_expand_stack(jt, addr);
      osthread->clear_expanding_stack();
    }
@@ -1995,7 +3769,7 @@
  
    // initialize signal mask for this thread
    // and save the caller's signal mask
-@@ -1011,6 +1190,7 @@ extern "C" Thread* get_thread() {
+@@ -1016,6 +1119,7 @@
  //////////////////////////////////////////////////////////////////////////////
  // initial thread
  
@@ -2003,7 +3777,7 @@
  // Check if current thread is the initial thread, similar to Solaris thr_main.
  bool os::Bsd::is_initial_thread(void) {
    char dummy;
-@@ -1241,6 +1421,7 @@ void os::Bsd::capture_initial_stack(size
+@@ -1249,6 +1353,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;
  }
@@ -2011,7 +3785,18 @@
  
  ////////////////////////////////////////////////////////////////////////////////
  // time support
-@@ -1279,6 +1460,21 @@ jlong os::javaTimeMillis() {
+@@ -1270,9 +1375,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; }
+@@ -1292,6 +1395,21 @@
  #define CLOCK_MONOTONIC (1)
  #endif
  
@@ -2033,7 +3818,7 @@
  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
-@@ -1314,7 +1510,9 @@ void os::Bsd::clock_init() {
+@@ -1327,7 +1445,9 @@
      }
    }
  }
@@ -2043,7 +3828,7 @@
  #ifndef SYS_clock_getres
  
  #if defined(IA32) || defined(AMD64)
-@@ -1353,6 +1551,7 @@ void os::Bsd::fast_thread_clock_init() {
+@@ -1366,6 +1486,7 @@
      _pthread_getcpuclockid = pthread_getcpuclockid_func;
    }
  }
@@ -2051,7 +3836,7 @@
  
  jlong os::javaTimeNanos() {
    if (Bsd::supports_monotonic_clock()) {
-@@ -1499,7 +1698,14 @@ int os::current_process_id() {
+@@ -1516,7 +1637,14 @@
  
  // DLL functions
  
@@ -2067,10 +3852,47 @@
  
  const char* os::get_temp_directory() { return "/tmp/"; }
  
-@@ -1540,6 +1746,23 @@ bool os::dll_address_to_function_name(ad
+@@ -1534,13 +1662,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) {
+-    *buffer = '\0';
+-    return;
++  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);
+@@ -1549,7 +1677,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;
+       }
+@@ -1564,7 +1693,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);
+   }
  }
  
+@@ -1605,6 +1734,23 @@
+   }
+ }
+ 
 +#ifdef _ALLBSD_SOURCE
 +// ported from solaris version
 +bool os::dll_address_to_library_name(address addr, char* buf,
@@ -2091,13 +3913,13 @@
  struct _address_to_library_name {
    address addr;          // input : memory address
    size_t  buflen;        //         size of fname
-@@ -1614,11 +1837,27 @@ bool os::dll_address_to_library_name(add
+@@ -1679,11 +1825,27 @@
       return false;
    }
  }
 +#endif
  
-   // Loads .dll/.so and 
+   // Loads .dll/.so and
    // in case of error it checks if .dll/.so was built for the
    // same architecture as Hotspot is running on
 + 
@@ -2108,18 +3930,18 @@
 +    // 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);
-@@ -1671,6 +1910,20 @@ void * os::dll_load(const char *filename
+@@ -1736,6 +1898,18 @@
    #define EM_486          6               /* Intel 80486 */
    #endif
  
@@ -2135,21 +3957,31 @@
 +  #define EM_X86_64       62              /* AMD x86-64 */ 
 +  #endif
 +
-+
-+
-   static const arch_t arch_array[]={ 
+   static const arch_t arch_array[]={
      {EM_386,         EM_386,     ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
      {EM_486,         EM_386,     ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
-@@ -1751,7 +2004,7 @@ void * os::dll_load(const char *filename
+@@ -1839,17 +2013,11 @@
  
    return NULL;
  }
--
-+#endif /* !__APPLE__  */
++#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);
+ }
  
  
-@@ -1774,7 +2027,51 @@ bool _print_ascii_file(const char* filen
+@@ -1872,7 +2040,51 @@
  
  void os::print_dll_info(outputStream *st) {
     st->print_cr("Dynamic libraries:");
@@ -2202,7 +4034,7 @@
     char fname[32];
     pid_t pid = os::Bsd::gettid();
  
-@@ -1783,6 +2080,7 @@ void os::print_dll_info(outputStream *st
+@@ -1881,6 +2093,7 @@
     if (!_print_ascii_file(fname, st)) {
       st->print("Can not get library information for pid = %d\n", pid);
     }
@@ -2210,7 +4042,7 @@
  }
  
  
-@@ -1815,6 +2113,7 @@ void os::print_os_info(outputStream* st)
+@@ -1913,6 +2126,7 @@
    st->print(name.machine);
    st->cr();
  
@@ -2218,7 +4050,7 @@
    // Print warning if unsafe chroot environment detected
    if (unsafe_chroot_detected) {
      st->print("WARNING!! ");
-@@ -1829,6 +2128,7 @@ void os::print_os_info(outputStream* st)
+@@ -1927,6 +2141,7 @@
       st->print("(%s stack)", os::Bsd::is_floating_stack() ? "floating" : "fixed");
    }
    st->cr();
@@ -2226,7 +4058,7 @@
  
    // rlimit
    st->print("rlimit:");
-@@ -1854,6 +2154,7 @@ void os::print_os_info(outputStream* st)
+@@ -1952,6 +2167,7 @@
    if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
    else st->print("%d", rlim.rlim_cur);
  
@@ -2234,7 +4066,7 @@
    st->print(", AS ");
    getrlimit(RLIMIT_AS, &rlim);
    if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-@@ -1866,6 +2167,7 @@ void os::print_os_info(outputStream* st)
+@@ -1964,6 +2180,7 @@
    os::loadavg(loadavg, 3);
    st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
    st->cr();
@@ -2242,7 +4074,7 @@
  }
  
  void os::print_memory_info(outputStream* st) {
-@@ -1873,18 +2175,22 @@ void os::print_memory_info(outputStream*
+@@ -1971,18 +2188,22 @@
    st->print("Memory:");
    st->print(" %dk page", os::vm_page_size()>>10);
  
@@ -2251,7 +4083,7 @@
    struct sysinfo si;
    sysinfo(&si);
 +#endif
-   
+ 
    st->print(", physical " UINT64_FORMAT "k",
              os::physical_memory() >> 10);
    st->print("(" UINT64_FORMAT "k free)",
@@ -2265,7 +4097,7 @@
    st->cr();
  }
  
-@@ -2108,19 +2414,29 @@ int os::sigexitnum_pd() {
+@@ -2209,19 +2430,29 @@
  static volatile jint pending_signals[NSIG+1] = { 0 };
  
  // Bsd(POSIX) specific hand shaking semaphore.
@@ -2297,7 +4129,7 @@
  }
  
  static int check_pending_signals(bool wait) {
-@@ -2142,7 +2458,7 @@ static int check_pending_signals(bool wa
+@@ -2243,7 +2474,7 @@
      do {
        thread->set_suspend_equivalent();
        // cleared by handle_special_suspend_equivalent_condition() or java_suspend_self()
@@ -2306,7 +4138,7 @@
  
        // were we externally suspended while we were waiting?
        threadIsSuspended = thread->handle_special_suspend_equivalent_condition();
-@@ -2153,7 +2469,7 @@ static int check_pending_signals(bool wa
+@@ -2254,7 +2485,7 @@
          // while suspended because that would surprise the thread that
          // suspended us.
          //
@@ -2315,34 +4147,105 @@
  
          thread->java_suspend_self();
        }
-@@ -2224,10 +2540,16 @@ void bsd_wrap_code(char* base, size_t si
- //       left at the time of mmap(). This could be a potential  
- //       problem.                                               
- bool os::commit_memory(char* addr, size_t size) {
+@@ -2324,11 +2555,18 @@
+ //       All it does is to check if there are enough free pages
+ //       left at the time of mmap(). This could be a potential
+ //       problem.
++// modified to keep intact with openjdk6
+ bool os::commit_memory(char* addr, size_t size, bool exec) {
+-  int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
++//  int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
++  int prot = PROT_READ|PROT_WRITE|PROT_EXEC;
 +#ifdef __OpenBSD__
 +  // XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
-+  return mprotect(addr, size, PROT_READ|PROT_WRITE|PROT_EXEC) == 0;
++  return ::mprotect(addr, size, prot) == 0;
 +#else
-+
-   uintptr_t res = (uintptr_t) ::mmap(addr, size,
-                                    PROT_READ|PROT_WRITE|PROT_EXEC,
+   uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
                                     MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
    return res != (uintptr_t) MAP_FAILED;
 +#endif
  }
  
- bool os::commit_memory(char* addr, size_t size, size_t alignment_hint) {
-@@ -2351,6 +2673,9 @@ bool os::unguard_memory(char* addr, size
+ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
+@@ -2344,36 +2582,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) {
+@@ -2384,6 +2613,7 @@
+   return end;
+ }
+ 
++#ifndef _ALLBSD_SOURCE
+ extern "C" void numa_warn(int number, char *where, ...) { }
+ extern "C" void numa_error(char *where) { }
+ 
+@@ -2485,11 +2715,17 @@
+ 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
+   return ::mmap(addr, size, PROT_NONE,
+                 MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0)
+     != MAP_FAILED;
++#endif
+ }
+ 
+ static address _highest_vm_reserved_address = NULL;
+@@ -2593,6 +2829,9 @@
  static size_t _large_page_size = 0;
  
  bool os::large_page_init() {
 +#ifdef _ALLBSD_SOURCE
-+ return false;
++  return false;
 +#else
    if (!UseLargePages) return false;
  
    if (LargePageSizeInBytes) {
-@@ -2405,6 +2730,7 @@ bool os::large_page_init() {
+@@ -2649,6 +2888,7 @@
    // We optimistically assume the support is available. If later it turns out
    // not true, VM will automatically switch to use regular page size.
    return true;
@@ -2350,16 +4253,16 @@
  }
  
  #ifndef SHM_HUGETLB
-@@ -2575,7 +2901,7 @@ char* os::attempt_reserve_memory_at(size
+@@ -2825,7 +3065,7 @@
  }
  
  size_t os::read(int fd, void *buf, unsigned int nBytes) {
 -  return ::read(fd, buf, nBytes);
-+  INTERRUPTIBLE_RETURN_INT_VM(::read(fd, buf, nBytes), os::Bsd::clear_interrupted);
- }  
++  RESTARTABLE_RETURN_INT(::read(fd, buf, nBytes));
+ }
  
  // TODO-FIXME: reconcile Solaris' os::sleep with the bsd variation.
-@@ -2711,6 +3037,44 @@ void os::loop_breaker(int attempts) {
+@@ -2961,6 +3201,44 @@
  // this reason, the code should not be used as default (ThreadPriorityPolicy=0).
  // It is only used when ThreadPriorityPolicy=1 and requires root privilege.
  
@@ -2404,7 +4307,7 @@
  int os::java_to_os_priority[MaxPriority + 1] = {
    19,              // 0 Entry should never be used
  
-@@ -2728,6 +3092,7 @@ int os::java_to_os_priority[MaxPriority 
+@@ -2978,6 +3256,7 @@
  
    -5               // 10 MaxPriority
  };
@@ -2412,7 +4315,7 @@
  
  static int prio_init() {
    if (ThreadPriorityPolicy == 1) {
-@@ -2747,8 +3112,28 @@ static int prio_init() {
+@@ -2997,8 +3276,28 @@
  OSReturn os::set_native_priority(Thread* thread, int newpri) {
    if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) return OS_OK;
  
@@ -2421,7 +4324,7 @@
 +  return OS_OK;
 +#elif defined(__FreeBSD__)
 +  int ret = pthread_setprio(thread->osthread()->pthread_id(), newpri);
-+#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__NetBSD__)
 +  struct sched_param sp;
 +  int policy;
 +  pthread_t self = pthread_self();
@@ -2441,13 +4344,13 @@
  }
  
  OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) {
-@@ -2758,7 +3143,17 @@ OSReturn os::get_native_priority(const T
+@@ -3008,7 +3307,17 @@
    }
  
    errno = 0;
 +#if defined(__OpenBSD__) || defined(__FreeBSD__)
 +  *priority_ptr = pthread_getprio(thread->osthread()->pthread_id());
-+#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__NetBSD__)
 +  int policy;
 +  struct sched_param sp;
 +
@@ -2459,16 +4362,16 @@
    return (*priority_ptr != -1 || errno == 0 ? OS_OK : OS_ERR);
  }
  
-@@ -2868,7 +3263,7 @@ static int SR_initialize() {
+@@ -3118,7 +3427,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;
+         SR_signum = sig;
      }
    }
-@@ -3211,6 +3606,28 @@ void os::Bsd::install_signal_handlers() 
+@@ -3461,6 +3770,28 @@
      set_signal_handler(SIGFPE, true);
      set_signal_handler(SIGXFSZ, true);
  
@@ -2497,7 +4400,7 @@
      if (libjsig_is_loaded) {
        // Tell libjsig jvm finishes setting signal handlers
        (*end_signal_setting)();
-@@ -3231,6 +3648,7 @@ void os::Bsd::install_signal_handlers() 
+@@ -3481,6 +3812,7 @@
    }
  }
  
@@ -2505,7 +4408,7 @@
  // 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+.
-@@ -3245,6 +3663,7 @@ jlong os::Bsd::fast_thread_cpu_time(cloc
+@@ -3495,6 +3827,7 @@
  
    return (tp.tv_sec * SEC_IN_NANOSECS) + tp.tv_nsec;
  }
@@ -2513,7 +4416,7 @@
  
  /////
  // glibc on Bsd platform uses non-documented flag
-@@ -3466,13 +3885,13 @@ void os::init(void) {
+@@ -3716,13 +4049,13 @@
  
    _initial_pid = (java_launcher_pid > 0) ? java_launcher_pid : getpid();
  
@@ -2529,10 +4432,11 @@
    if (Bsd::page_size() == -1) {
      fatal1("os_bsd.cpp: os::init: sysconf failed (%s)", strerror(errno));
    }
-@@ -3485,6 +3904,16 @@ void os::init(void) {
+@@ -3735,7 +4068,16 @@
  
    Bsd::clock_init();
    initial_time_count = os::elapsed_counter();
+-  pthread_mutex_init(&dl_mutex, NULL);
 +
 +#ifdef __APPLE__
 +  // XXXDARWIN
@@ -2546,7 +4450,7 @@
  }
  
  // To install functions for atexit system call
-@@ -3497,7 +3926,9 @@ extern "C" {
+@@ -3748,7 +4090,9 @@
  // this is called _after_ the global arguments have been parsed
  jint os::init_2(void)
  {
@@ -2556,7 +4460,7 @@
  
    // 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);
-@@ -3546,6 +3977,7 @@ jint os::init_2(void)
+@@ -3797,6 +4141,7 @@
    JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
          vm_page_size()));
  
@@ -2564,15 +4468,15 @@
    Bsd::capture_initial_stack(JavaThread::stack_size_at_create());
  
    Bsd::libpthread_init();
-@@ -3554,6 +3986,7 @@ jint os::init_2(void)
-           Bsd::glibc_version(), Bsd::libpthread_version(), 
-           Bsd::is_floating_stack() ? "floating stack" : "fixed stack");
+@@ -3819,6 +4164,7 @@
+       UseNUMA = true;
+     }
    }
 +#endif
  
    if (MaxFDLimit) {
      // set the number of file descriptors to max. print out error
-@@ -3565,6 +3998,14 @@ jint os::init_2(void)
+@@ -3830,6 +4176,14 @@
          perror("os::init_2 getrlimit failed");
      } else {
        nbr_files.rlim_cur = nbr_files.rlim_max;
@@ -2587,7 +4491,7 @@
        status = setrlimit(RLIMIT_NOFILE, &nbr_files);
        if (status != 0) {
          if (PrintMiscellaneous && (Verbose || WizardMode))
-@@ -3573,8 +4014,10 @@ jint os::init_2(void)
+@@ -3838,8 +4192,10 @@
      }
    }
  
@@ -2598,14 +4502,13 @@
  
    // Initialize HPI.
    jint hpi_result = hpi::initialize();
-@@ -3621,11 +4064,16 @@ void os::make_polling_page_readable(void
+@@ -3887,11 +4243,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);
@@ -2615,7 +4518,7 @@
  }
  
  bool os::distribute_processes(uint length, uint* distribution) {
-@@ -3667,6 +4115,9 @@ ExtendedPC os::get_thread_pc(Thread* thr
+@@ -3933,6 +4293,9 @@
  
  int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime)
  {
@@ -2625,7 +4528,7 @@
     if (is_NPTL()) {
        return pthread_cond_timedwait(_cond, _mutex, _abstime);
     } else {
-@@ -3682,6 +4133,7 @@ int os::Bsd::safe_cond_timedwait(pthread
+@@ -3948,6 +4311,7 @@
  #endif // IA64
        return status;
     }
@@ -2633,7 +4536,7 @@
  }
  
  ////////////////////////////////////////////////////////////////////////////////
-@@ -3817,17 +4269,17 @@ int os::create_binary_file(const char* p
+@@ -4083,17 +4447,17 @@
    if (!rewrite_existing) {
      oflags |= O_EXCL;
    }
@@ -2654,7 +4557,7 @@
  }
  
  // Map a block of memory.
-@@ -3877,6 +4329,7 @@ bool os::unmap_memory(char* addr, size_t
+@@ -4143,6 +4507,7 @@
    return munmap(addr, bytes) == 0;
  }
  
@@ -2662,15 +4565,15 @@
  static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time);
  
  static clockid_t thread_cpu_clockid(Thread* thread) {
-@@ -3888,6 +4341,7 @@ static clockid_t thread_cpu_clockid(Thre
+@@ -4154,6 +4519,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) 
+ // 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
-@@ -3897,39 +4351,71 @@ static clockid_t thread_cpu_clockid(Thre
+@@ -4163,39 +4529,71 @@
  // the fast estimate available on the platform.
  
  jlong os::current_thread_cpu_time() {
@@ -2741,8 +4644,8 @@
 +#ifndef _ALLBSD_SOURCE
  //
  //  -1 on error.
- // 
-@@ -4018,6 +4504,7 @@ static jlong slow_thread_cpu_time(Thread
+ //
+@@ -4284,6 +4682,7 @@
      return (jlong)user_time * (1000000000 / clock_tics_per_sec);
    }
  }
@@ -2750,7 +4653,7 @@
  
  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
-@@ -4034,7 +4521,13 @@ void os::thread_cpu_time_info(jvmtiTimer
+@@ -4300,7 +4699,13 @@
  }
  
  bool os::is_thread_cpu_time_supported() {
@@ -2764,7 +4667,7 @@
  }
  
  // System loadavg support.  Returns -1 if load average cannot be obtained.
-@@ -4167,7 +4660,7 @@ jdk_pthread_sigmask(int how , const sigs
+@@ -4433,7 +4838,7 @@
  // abstime will be the absolute timeout time
  // TODO: replace compute_abstime() with unpackTime()
  
@@ -2773,29 +4676,29 @@
    if (millis < 0)  millis = 0;
    struct timeval now;
    int status = gettimeofday(&now, NULL);
-@@ -4219,7 +4712,7 @@ void os::PlatformEvent::park() {       /
+@@ -4485,7 +4890,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 == ETIME) { status = EINTR; }
 +        if (status == ETIMEDOUT) { status = EINTR; } 
          assert_status(status == 0 || status == EINTR, status, "cond_wait");
       }
-      -- _nParked ; 
-@@ -4277,10 +4770,10 @@ int os::PlatformEvent::park(jlong millis
+      -- _nParked ;
+@@ -4543,10 +4948,10 @@
        pthread_cond_init (_cond, NULL) ;
      }
-     assert_status(status == 0 || status == EINTR || 
--		  status == ETIME || status == ETIMEDOUT, 
+     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 ; 
+                   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.   
+     // We consume and ignore EINTR and spurious wakeups.
    }
    --_nParked ;
-@@ -4372,7 +4865,7 @@ void os::PlatformEvent::unpark() {
+@@ -4638,7 +5043,7 @@
   * years from "now".
   */
  
@@ -2804,25 +4707,25 @@
    assert (time > 0, "convertTime");
  
    struct timeval now;
-@@ -4431,7 +4924,7 @@ void Parker::park(bool isAbsolute, jlong
+@@ -4698,7 +5103,7 @@
    }
  
    // Next, demultiplex/decode time arguments
 -  timespec absTime;
 +  struct timespec absTime;
    if (time < 0) { // don't wait at all
-     return; 
+     return;
    }
-@@ -4484,7 +4977,7 @@ void Parker::park(bool isAbsolute, jlong
+@@ -4752,7 +5157,7 @@
      }
    }
-   assert_status(status == 0 || status == EINTR || 
--                status == ETIME || status == ETIMEDOUT, 
+   assert_status(status == 0 || status == EINTR ||
+-                status == ETIME || status == ETIMEDOUT,
 +                status == ETIMEDOUT, 
                  status, "cond_timedwait");
  
  #ifdef ASSERT
-@@ -4526,14 +5019,12 @@ void Parker::unpark() {
+@@ -4795,14 +5200,12 @@
  }
  
  
@@ -2842,19 +4745,19 @@
  #endif
  
  // Run the specified command in a separate process. Return its exit value,
-@@ -4548,8 +5039,7 @@ int os::fork_and_exec(char* cmd) {
+@@ -4817,8 +5220,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);) 
+-  pid_t pid = NOT_IA64(syscall(__NR_fork);)
 -              IA64_ONLY(fork();)
 +  pid_t pid = fork();
  
    if (pid < 0) {
      // fork failed
-@@ -4565,8 +5055,7 @@ int os::fork_and_exec(char* cmd) {
+@@ -4834,8 +5236,7 @@
      // in the new process, so make a system call directly.
-     // IA64 should use normal execve() from glibc to match the glibc fork() 
+     // 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);)
@@ -2862,10 +4765,9 @@
  
      // execve failed
      _exit(-1);
-diff -upr ../orig/hotspot/src/os/bsd/vm/os_bsd.hpp ./hotspot/src/os/bsd/vm/os_bsd.hpp
---- ../orig/hotspot/src/os/bsd/vm/os_bsd.hpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/os_bsd.hpp	2009-05-06 10:55:43.000000000 -0400
-@@ -30,6 +30,12 @@
+--- hotspot/src/os/bsd/vm/os_bsd.hpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/os_bsd.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -27,6 +27,12 @@
  /* pthread_getattr_np comes with BsdThreads-0.9-7 on RedHat 7.1 */
  typedef int (*pthread_getattr_func_type) (pthread_t, pthread_attr_t *);
  
@@ -2878,7 +4780,7 @@
  class Bsd {
    friend class os;
  
-@@ -50,6 +56,7 @@ class Bsd {
+@@ -47,6 +53,7 @@
    static int sigflags[MAXSIGNUM];
  
    static int (*_clock_gettime)(clockid_t, struct timespec *);
@@ -2886,14 +4788,16 @@
    static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
  
    static address   _initial_thread_stack_bottom;
-@@ -61,42 +68,79 @@ class Bsd {
+@@ -58,6 +65,7 @@
    static bool _is_floating_stack;
    static bool _is_NPTL;
    static bool _supports_fast_thread_cpu_time;
 +#endif
  
-  protected:
+   static GrowableArray<int>* _cpu_to_node;
  
+@@ -65,38 +73,52 @@
+ 
    static julong _physical_memory;
    static pthread_t _main_thread;
 +#ifndef _ALLBSD_SOURCE
@@ -2918,30 +4822,10 @@
    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; }
   public:
-+#ifdef _ALLBSD_SOURCE
-+//XXXBSD: ported from solaris version
-+  enum {
-+    clear_interrupted = true
-+  };
-+  static void setup_interruptible(JavaThread* thread);
-+  static void setup_interruptible_already_blocked(JavaThread* thread);
-+  static JavaThread* setup_interruptible();
-+  static void cleanup_interruptible(JavaThread* thread);
 +
-+  // perf counter incrementers used by _INTERRUPTIBLE 
-+
-+  static void bump_interrupted_before_count();
-+  static void bump_interrupted_during_count();
-+
-+#ifdef ASSERT
-+  static JavaThread* setup_interruptible_native();
-+  static void cleanup_interruptible_native(JavaThread* thread);
-+#endif
-+
-+#endif
-+
- 
    static void init_thread_fpu_state();
 +#ifndef _ALLBSD_SOURCE
    static int  get_fpu_control_word();
@@ -2962,11 +4846,10 @@
    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; }
-@@ -133,6 +177,7 @@ class Bsd {
+@@ -133,6 +155,7 @@
    static struct sigaction *get_chained_signal_action(int sig);
    static bool chained_handler(int sig, siginfo_t* siginfo, void* context);
  
@@ -2974,15 +4857,15 @@
    // GNU libc and libpthread version strings
    static const char *glibc_version()          { return _glibc_version; }
    static const char *libpthread_version()     { return _libpthread_version; }
-@@ -146,6 +191,7 @@ class Bsd {
-   static bool is_floating_stack()             { return _is_floating_stack; }
- 
+@@ -148,6 +171,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)
-@@ -155,17 +201,21 @@ class Bsd {
+   static size_t min_stack_allowed;
+@@ -156,17 +180,21 @@
    static size_t default_stack_size(os::ThreadType thr_type);
    static size_t default_guard_size(os::ThreadType thr_type);
  
@@ -3004,7 +4887,7 @@
  
    static bool supports_monotonic_clock() {
      return _clock_gettime != NULL;
-@@ -175,6 +225,7 @@ class Bsd {
+@@ -176,6 +204,7 @@
      return _clock_gettime ? _clock_gettime(clock_id, tp) : -1;
    }
  
@@ -3012,7 +4895,7 @@
    static int pthread_getcpuclockid(pthread_t tid, clockid_t *clock_id) {
      return _pthread_getcpuclockid ? _pthread_getcpuclockid(tid, clock_id) : -1;
    }
-@@ -184,6 +235,7 @@ class Bsd {
+@@ -185,6 +214,7 @@
    }
  
    static jlong fast_thread_cpu_time(clockid_t clockid);
@@ -3020,10 +4903,9 @@
  
    // Stack repair handling
  
-diff -upr ../orig/hotspot/src/os/bsd/vm/os_bsd.inline.hpp ./hotspot/src/os/bsd/vm/os_bsd.inline.hpp
---- ../orig/hotspot/src/os/bsd/vm/os_bsd.inline.hpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os/bsd/vm/os_bsd.inline.hpp	2009-05-06 10:57:31.000000000 -0400
-@@ -64,7 +64,15 @@ inline bool os::uses_stack_guard_pages()
+--- hotspot/src/os/bsd/vm/os_bsd.inline.hpp	2010-06-27 11:37:41.000000000 -0700
++++ hotspot/src/os/bsd/vm/os_bsd.inline.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -61,7 +61,15 @@
  
  inline bool os::allocate_stack_guard_pages() {
    assert(uses_stack_guard_pages(), "sanity check");
@@ -3039,7 +4921,7 @@
  }
  
  
-@@ -112,6 +120,107 @@ inline int os::closedir(DIR *dirp)
+@@ -109,6 +117,107 @@
    return ::closedir(dirp);
  }
  
@@ -3147,34 +5029,15 @@
  // macros for restartable system calls
  
  #define RESTARTABLE(_cmd, _result) do { \
-Only in ./hotspot/src/os_cpu/bsd_x86/vm: assembler_bsd_x86.cpp
-diff -upr ../orig/hotspot/src/os_cpu/bsd_x86/vm/assembler_bsd_x86_64.cpp ./hotspot/src/os_cpu/bsd_x86/vm/assembler_bsd_x86_64.cpp
---- ../orig/hotspot/src/os_cpu/bsd_x86/vm/assembler_bsd_x86_64.cpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os_cpu/bsd_x86/vm/assembler_bsd_x86_64.cpp	2009-05-06 11:53:03.000000000 -0400
-@@ -69,8 +69,9 @@ void MacroAssembler::get_thread(Register
-    }
- }
- 
--// NOTE: since the bsd kernel resides at the low end of
--// user address space, no null pointer check is needed.
- bool MacroAssembler::needs_explicit_null_check(int offset) {
--  return offset < 0 || offset >= 0x100000;
-+  // Bsd kernel guarantees that the first page is always unmapped. Don't
-+  // assume anything more than that.
-+  bool offset_in_first_page =   0 <= offset  &&  offset < os::vm_page_size();
-+  return !offset_in_first_page;
- }
-diff -upr ../orig/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s
---- ../orig/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s	2009-05-04 17:37:17.000000000 -0400
-@@ -21,49 +21,82 @@
- # have any questions.
+--- hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s	2010-06-20 21:56:15.000000000 -0700
+@@ -21,6 +21,22 @@
+ # questions.
  # 
  
 +
 +
- .ident	"@(#)bsd_x86_32.s	1.10 07/05/17 15:48:59 JVM"
--	
++  .ident        "@(#)bsd_x86_32.s       1.10 07/05/17 15:48:59 JVM"
 +
 +#ifdef __APPLE__
 +# Darwin uses _ prefixed global symbols
@@ -3187,9 +5050,11 @@
 +
 +        .globl SYMBOL(fixcw)
 +
++
+ 	
          # NOTE WELL!  The _Copy functions are called directly
  	# from server-compiler-generated code via CallLeafNoFP,
- 	# which means that they *must* either not use floating
+@@ -28,41 +44,62 @@
  	# point or use it in the same manner as does the server
  	# compiler.
  	
@@ -3223,13 +5088,13 @@
 +#ifdef __APPLE__
 +        .align   4
 +#else
-+	.align   16
++      .align   16
 +#endif
 +SYMBOL(fixcw):
-+	pushl    $0x27f
-+	fldcw    0(%esp)
-+	popl     %eax
-+	ret
++      pushl    $0x27f
++      fldcw    0(%esp)
++      popl     %eax
++      ret
 +
 +#ifdef __APPLE__
 +        .align   4
@@ -3237,6 +5102,7 @@
 +        .align   16
 +#endif
 +
++
 +        .globl  SYMBOL(SafeFetch32), SYMBOL(Fetch32PFI), SYMBOL(Fetch32Resume)
 +        .globl  SYMBOL(SafeFetchN)
          ## TODO: avoid exposing Fetch32PFI and Fetch32Resume.
@@ -3270,7 +5136,7 @@
          rep
          nop
          movl    $1, %eax
-@@ -73,8 +106,8 @@ SpinPause:
+@@ -72,8 +109,8 @@
          #                                       void* to,
          #                                       size_t count)
          .p2align 4,,15
@@ -3281,7 +5147,7 @@
          pushl    %esi
          movl     4+12(%esp),%ecx      # count
          pushl    %edi
-@@ -181,8 +214,8 @@ cb_CopyLeft:
+@@ -180,8 +217,8 @@
          #
          # Same as _Copy_conjoint_bytes, except no source alignment check.
          .p2align 4,,15
@@ -3292,7 +5158,7 @@
          pushl    %esi
          movl     4+12(%esp),%ecx      # count
          pushl    %edi
-@@ -269,8 +302,8 @@ acb_CopyLeft:
+@@ -268,8 +305,8 @@
          #                                                void* to,
          #                                                size_t count)
          .p2align 4,,15
@@ -3303,7 +5169,7 @@
          pushl    %esi
          movl     4+12(%esp),%ecx      # count
          pushl    %edi
-@@ -355,8 +388,8 @@ cs_CopyLeft:
+@@ -354,8 +391,8 @@
          #                                                 void* to,
          #                                                 size_t count)
          .p2align 4,,15
@@ -3314,7 +5180,7 @@
          pushl    %esi
          movl     4+12(%esp),%ecx      # count
          pushl    %edi
-@@ -432,10 +465,10 @@ acs_CopyLeft:
+@@ -431,10 +468,10 @@
          # Equivalent to
          #   arrayof_conjoint_jints
          .p2align 4,,15
@@ -3329,7 +5195,7 @@
          pushl    %esi
          movl     4+12(%esp),%ecx      # count
          pushl    %edi
-@@ -495,7 +528,7 @@ ci_CopyLeft:
+@@ -494,7 +531,7 @@
          #
          # count treated as signed
          #
@@ -3338,7 +5204,7 @@
          #   while (--count >= 0) {
          #     *to++ = *from++;
          #   }
-@@ -505,8 +538,8 @@ ci_CopyLeft:
+@@ -504,8 +541,8 @@
          #   }
          # }
          .p2align 4,,15
@@ -3349,7 +5215,7 @@
          movl     4+8(%esp),%ecx       # count
          movl     4+0(%esp),%eax       # from
          movl     4+4(%esp),%edx       # to
-@@ -534,8 +567,8 @@ cla_CopyLeft:
+@@ -533,8 +570,8 @@
          #                                                 void* to,
          #                                                 size_t count)
          .p2align 4,,15
@@ -3360,7 +5226,7 @@
          pushl    %esi
          movl     4+12(%esp),%ecx
          pushl    %edi
-@@ -633,8 +666,8 @@ mmx_acs_CopyLeft:
+@@ -632,8 +669,8 @@
          #                                   bool is_MP)
          #
          .p2align 4,,15
@@ -3371,12 +5237,11 @@
                                     #  8(%esp) : return PC
          pushl    %ebx              #  4(%esp) : old %ebx
          pushl    %edi              #  0(%esp) : old %edi
-diff -upr ../orig/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s
---- ../orig/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s	2009-05-06 11:56:15.000000000 -0400
-@@ -23,48 +23,70 @@
+--- hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s	2010-06-20 21:56:15.000000000 -0700
+@@ -22,48 +22,70 @@
+ #
  
- .ident	"@(#)bsd_x86_64.s	1.7 07/05/05 17:04:47 JVM"
  
 +#ifdef __APPLE__
 +# Darwin uses _ prefixed global symbols
@@ -3466,7 +5331,7 @@
          rep
          nop
          movq   $1, %rax
-@@ -78,8 +100,8 @@ SpinPause:
+@@ -77,8 +99,8 @@
          # rdx - count, treated as ssize_t
          #
          .p2align 4,,15
@@ -3477,7 +5342,7 @@
          movq     %rdx,%r8             # byte count
          shrq     $3,%rdx              # qword count
          cmpq     %rdi,%rsi
-@@ -180,10 +202,10 @@ acb_CopyLeft:
+@@ -179,10 +201,10 @@
          # rdx - count, treated as ssize_t
          #
          .p2align 4,,15
@@ -3492,7 +5357,7 @@
          movq     %rdx,%r8             # word count
          shrq     $2,%rdx              # qword count
          cmpq     %rdi,%rsi
-@@ -270,10 +292,10 @@ acs_CopyLeft:
+@@ -269,10 +291,10 @@
          # rdx - count, treated as ssize_t
          #
          .p2align 4,,15
@@ -3507,7 +5372,7 @@
          movq     %rdx,%r8             # dword count
          shrq     %rdx                 # qword count
          cmpq     %rdi,%rsi
-@@ -349,10 +371,10 @@ aci_CopyLeft:
+@@ -348,10 +370,10 @@
          # rdx - count, treated as ssize_t
          #
          .p2align 4,,15
@@ -3522,11 +5387,10 @@
          cmpq     %rdi,%rsi
          leaq     -8(%rdi,%rdx,8),%rax # from + count*8 - 8
          jbe      acl_CopyRight
-diff -upr ../orig/hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp ./hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp
---- ../orig/hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp	2009-05-06 12:15:02.000000000 -0400
-@@ -25,7 +25,29 @@
-  *  
+--- hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -22,7 +22,29 @@
+  *
   */
  
 +#ifndef _ALLBSD_SOURCE
@@ -3555,10 +5419,9 @@
  
  // Efficient swapping of data bytes from Java byte
  // ordering to native byte ordering and vice versa.
-diff -upr ../orig/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp ./hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
---- ../orig/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2009-05-04 17:37:17.000000000 -0400
-@@ -47,23 +47,158 @@
+--- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	2010-06-20 21:56:15.000000000 -0700
+@@ -44,23 +44,158 @@
  # include <sys/wait.h>
  # include <pwd.h>
  # include <poll.h>
@@ -3722,9 +5585,9 @@
 +#endif
 +
  address os::current_stack_pointer() {
-   register void *esp __asm__ (SPELL_REG_SP);
-   return (address) esp;
-@@ -82,15 +217,15 @@ void os::initialize_thread() {
+ #ifdef SPARC_WORKS
+   register void *esp;
+@@ -85,15 +220,15 @@
  }
  
  address os::Bsd::ucontext_get_pc(ucontext_t * uc) {
@@ -3743,20 +5606,20 @@
  }
  
  // For Forte Analyzer AsyncGetCallTrace profiling support - thread
-@@ -237,18 +372,18 @@ JVM_handle_bsd_signal(int sig,
+@@ -245,18 +380,18 @@
      pc = (address) os::Bsd::ucontext_get_pc(uc);
  
-     if (pc == (address) Fetch32PFI) { 
--       uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ; 
+     if (pc == (address) Fetch32PFI) {
+-       uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ;
 +       uc->context_pc = intptr_t(Fetch32Resume) ;
-        return 1 ;  
+        return 1 ;
      }
  #ifdef AMD64
-     if (pc == (address) FetchNPFI) { 
--       uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ; 
+     if (pc == (address) FetchNPFI) {
+-       uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ;
 +       uc->context_pc = intptr_t (FetchNResume) ;
-        return 1 ; 
-     } 
+        return 1 ;
+     }
  #endif // AMD64
  
      // Handle ALL stack overflow variations here
@@ -3765,7 +5628,7 @@
        address addr = (address) info->si_addr;
  
        // check if fault address is within thread stack
-@@ -270,6 +405,7 @@ JVM_handle_bsd_signal(int sig,
+@@ -278,6 +413,7 @@
            // to handle_unexpected_exception way down below.
            thread->disable_stack_red_zone();
            tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
@@ -3773,7 +5636,7 @@
          } else {
            // Accessing stack address below sp may cause SEGV if current
            // thread has MAP_GROWSDOWN stack. This should only happen when
-@@ -285,6 +421,7 @@ JVM_handle_bsd_signal(int sig,
+@@ -293,6 +429,7 @@
            } else {
               fatal("recursive segv. expanding stack.");
            }
@@ -3781,7 +5644,7 @@
          }
        }
      }
-@@ -293,9 +430,16 @@ JVM_handle_bsd_signal(int sig,
+@@ -301,9 +438,16 @@
        // Java thread running in Java code => find exception handler if any
        // a fault inside compiled code, the interpreter, or a stub
  
@@ -3796,11 +5659,11 @@
 +#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.
-@@ -316,6 +460,28 @@ JVM_handle_bsd_signal(int sig,
-                                               pc, 
+         // 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.
+@@ -324,6 +468,28 @@
+                                               pc,
                                                SharedRuntime::
                                                IMPLICIT_DIVIDE_BY_ZERO);
 +#ifdef __APPLE__
@@ -3828,7 +5691,7 @@
  #else
        if (sig == SIGFPE /* && info->si_code == FPE_INTDIV */) {
          // HACK: si_code does not work on bsd 2.2.12-20!!!
-@@ -343,7 +509,7 @@ JVM_handle_bsd_signal(int sig,
+@@ -351,7 +517,7 @@
            fatal("please update this code.");
          }
  #endif // AMD64
@@ -3837,7 +5700,7 @@
                 !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);
-@@ -367,7 +533,7 @@ JVM_handle_bsd_signal(int sig,
+@@ -375,7 +541,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.
@@ -3846,7 +5709,7 @@
          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();
-@@ -388,7 +554,7 @@ JVM_handle_bsd_signal(int sig,
+@@ -396,7 +562,7 @@
    // Furthermore, a false-positive should be harmless.
    if (UnguardOnExecutionViolation > 0 &&
        (sig == SIGSEGV || sig == SIGBUS) &&
@@ -3855,7 +5718,7 @@
      int page_size = os::vm_page_size();
      address addr = (address) info->si_addr;
      address pc = os::Bsd::ucontext_get_pc(uc);
-@@ -457,7 +623,7 @@ JVM_handle_bsd_signal(int sig,
+@@ -466,7 +632,7 @@
      // save all thread context in case we need to restore it
      if (thread != NULL) thread->set_saved_exception_pc(pc);
  
@@ -3864,7 +5727,7 @@
      return true;
    }
  
-@@ -487,13 +653,24 @@ JVM_handle_bsd_signal(int sig,
+@@ -496,13 +662,24 @@
    ShouldNotReachHere();
  }
  
@@ -3889,7 +5752,7 @@
  int os::Bsd::get_fpu_control_word(void) {
  #ifdef AMD64
    return 0;
-@@ -509,11 +686,12 @@ void os::Bsd::set_fpu_control_word(int f
+@@ -518,11 +695,12 @@
    _FPU_SETCW(fpu_control);
  #endif // !AMD64
  }
@@ -3903,28 +5766,25 @@
    return true;
  #else
    struct utsname uts;
-@@ -565,8 +743,11 @@ size_t os::Bsd::min_stack_allowed  =  (4
- 
+@@ -576,6 +754,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 fixed stack mode allocates 2M fixed slot for each thread. BsdThreads
+ // in fixed stack mode allocates 2M fixed slot for each thread. BsdThreads
  // in floating stack mode and NPTL support variable stack size.
- bool os::Bsd::supports_variable_stack_size() {
-   if (os::Bsd::is_NPTL()) {
-@@ -597,6 +778,7 @@ bool os::Bsd::supports_variable_stack_si
-     return (GET_GS() != 0);
+@@ -612,6 +793,7 @@
+ #endif
    }
  }
 +#endif
  #endif // AMD64
  
  // return default stack size for thr_type
-@@ -650,6 +832,41 @@ size_t os::Bsd::default_guard_size(os::T
+@@ -665,6 +847,41 @@
  //    pthread_attr_getstack()
  
  static void current_stack_region(address * bottom, size_t * size) {
@@ -3966,7 +5826,7 @@
    if (os::Bsd::is_initial_thread()) {
       // initial thread needs special handling because pthread_getattr_np()
       // may return bogus value.
-@@ -676,6 +893,7 @@ static void current_stack_region(address
+@@ -691,6 +908,7 @@
       pthread_attr_destroy(&attr);
  
    }
@@ -3974,7 +5834,7 @@
    assert(os::current_stack_pointer() >= *bottom &&
           os::current_stack_pointer() < *bottom + *size, "just checking");
  }
-@@ -704,46 +922,44 @@ void os::print_context(outputStream *st,
+@@ -719,46 +937,44 @@
    ucontext_t *uc = (ucontext_t*)context;
    st->print_cr("Registers:");
  #ifdef AMD64
@@ -4051,10 +5911,9 @@
  #endif // AMD64
    st->cr();
    st->cr();
-diff -upr ../orig/hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp ./hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp
---- ../orig/hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp	2009-05-06 12:03:40.000000000 -0400
-@@ -30,8 +30,10 @@
+--- hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -27,8 +27,10 @@
  #ifndef AMD64
    // map stack pointer to thread pointer - see notes in threadLS_bsd_x86.cpp
    #define SP_BITLENGTH  32
@@ -4065,10 +5924,9 @@
    static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)];
  #endif // !AMD64
  
-diff -upr ../orig/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp ./hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp
---- ../orig/hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp	2009-05-04 18:32:15.000000000 -0400
-+++ ./hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp	2009-05-06 12:04:27.000000000 -0400
-@@ -34,7 +34,7 @@
+--- hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp	2010-06-27 11:37:42.000000000 -0700
++++ hotspot/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -31,7 +31,7 @@
    /******************************/                                                                                                   \
    /* Threads (NOTE: incomplete) */                                                                                                   \
    /******************************/                                                                                                   \
@@ -4077,10 +5935,9 @@
    nonstatic_field(OSThread,                      _pthread_id,                                     pthread_t)                         \
    /* This must be the last entry, and must be present */                                                                             \
    last_entry()
-diff -upr ../orig/hotspot/src/share/vm/adlc/adlc.hpp ./hotspot/src/share/vm/adlc/adlc.hpp
---- ../orig/hotspot/src/share/vm/adlc/adlc.hpp	2009-01-27 15:41:01.000000000 -0500
-+++ ./hotspot/src/share/vm/adlc/adlc.hpp	2009-05-04 17:37:15.000000000 -0400
-@@ -76,9 +76,9 @@ typedef unsigned int uintptr_t;
+--- hotspot/src/share/vm/adlc/adlc.hpp	2010-06-21 14:12:17.000000000 -0700
++++ hotspot/src/share/vm/adlc/adlc.hpp	2010-06-20 21:56:15.000000000 -0700
+@@ -69,9 +69,9 @@
  #endif
  #endif // _WIN32
  
@@ -4090,44 +5947,22 @@
 -#endif // LINUX
 +#endif // LINUX || _ALLBSD_SOURCE
  
- // Macros 
+ // Macros
  #define uint32 unsigned int
-diff -upr ../orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep ./hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep
---- ../orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep	2009-01-27 15:41:01.000000000 -0500
-+++ ./hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep	2009-05-04 17:37:17.000000000 -0400
-@@ -28,6 +28,7 @@ binaryTreeDictionary.cpp                
- binaryTreeDictionary.cpp                binaryTreeDictionary.hpp
- binaryTreeDictionary.cpp                globals.hpp
- binaryTreeDictionary.cpp                ostream.hpp
-+binaryTreeDictionary.cpp                space.inline.hpp
- 
- binaryTreeDictionary.hpp                freeBlockDictionary.hpp
- binaryTreeDictionary.hpp                freeList.hpp
-diff -upr ../orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew ./hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew
---- ../orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew	2009-01-27 15:41:01.000000000 -0500
-+++ ./hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew	2009-05-04 17:37:17.000000000 -0400
-@@ -30,6 +30,8 @@ asParNewGeneration.cpp			cmsAdaptiveSize
- asParNewGeneration.cpp                  cmsGCAdaptivePolicyCounters.hpp
- asParNewGeneration.cpp			defNewGeneration.inline.hpp
- asParNewGeneration.cpp			oop.pcgc.inline.hpp
+--- hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew	2010-06-21 14:12:18.000000000 -0700
++++ hotspot/src/share/vm/gc_implementation/includeDB_gc_parNew	2010-06-20 21:56:16.000000000 -0700
+@@ -32,6 +32,8 @@
+ asParNewGeneration.cpp                  markOop.inline.hpp
+ asParNewGeneration.cpp                  markSweep.inline.hpp
+ asParNewGeneration.cpp                  oop.pcgc.inline.hpp
 +asParNewGeneration.cpp                  markOop.inline.hpp
 +asParNewGeneration.cpp                  markSweep.inline.hpp
- asParNewGeneration.cpp			parNewGeneration.hpp
+ asParNewGeneration.cpp                  parNewGeneration.hpp
  asParNewGeneration.cpp                  referencePolicy.hpp
- 
-@@ -39,7 +41,7 @@ parCardTableModRefBS.cpp                
- parCardTableModRefBS.cpp                java.hpp
- parCardTableModRefBS.cpp                mutexLocker.hpp
- parCardTableModRefBS.cpp                sharedHeap.hpp
--parCardTableModRefBS.cpp                space.hpp
-+parCardTableModRefBS.cpp                space.inline.hpp
- parCardTableModRefBS.cpp                universe.hpp
- parCardTableModRefBS.cpp                virtualspace.hpp
- 
-diff -upr ../orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge ./hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge
---- ../orig/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge	2009-01-27 15:41:01.000000000 -0500
-+++ ./hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge	2009-05-04 17:37:15.000000000 -0400
-@@ -302,6 +302,8 @@ psPermGen.cpp                           
+ asParNewGeneration.cpp                  spaceDecorator.hpp
+--- hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge	2010-06-21 14:12:18.000000000 -0700
++++ hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge	2010-06-20 21:56:16.000000000 -0700
+@@ -314,6 +314,8 @@
  psPermGen.cpp                           psMarkSweepDecorator.hpp
  psPermGen.cpp                           psParallelCompact.hpp
  psPermGen.cpp                           psPermGen.hpp
@@ -4136,62 +5971,9 @@
  
  psPermGen.hpp                           psOldGen.hpp
  
-diff -upr ../orig/hotspot/src/share/vm/includeDB_compiler2 ./hotspot/src/share/vm/includeDB_compiler2
---- ../orig/hotspot/src/share/vm/includeDB_compiler2	2009-01-27 15:41:02.000000000 -0500
-+++ ./hotspot/src/share/vm/includeDB_compiler2	2009-05-04 17:37:15.000000000 -0400
-@@ -140,6 +140,7 @@ c2_globals_<os_family>.hpp              
- c2_globals_<os_family>.hpp              macros.hpp
- 
- c2_init_<arch>.cpp                      compile.hpp
-+c2_init_<arch>.cpp                      node.hpp
- 
- c2compiler.cpp                          ad_<arch_model>.hpp
- c2compiler.cpp                          c2compiler.hpp
-@@ -833,6 +834,7 @@ parseHelper.cpp                         
- phase.cpp                               compile.hpp
- phase.cpp                               compileBroker.hpp
- phase.cpp                               nmethod.hpp
-+phase.cpp                               node.hpp
- phase.cpp                               phase.hpp
- 
- phase.hpp                               port.hpp
-diff -upr ../orig/hotspot/src/share/vm/includeDB_core ./hotspot/src/share/vm/includeDB_core
---- ../orig/hotspot/src/share/vm/includeDB_core	2009-01-27 15:41:02.000000000 -0500
-+++ ./hotspot/src/share/vm/includeDB_core	2009-05-04 17:37:15.000000000 -0400
-@@ -476,7 +476,7 @@ cardTableModRefBS.cpp                   
- cardTableModRefBS.cpp                   java.hpp
- cardTableModRefBS.cpp                   mutexLocker.hpp
- cardTableModRefBS.cpp                   sharedHeap.hpp
--cardTableModRefBS.cpp                   space.hpp
-+cardTableModRefBS.cpp                   space.inline.hpp
- cardTableModRefBS.cpp                   universe.hpp
- cardTableModRefBS.cpp                   virtualspace.hpp
- 
-@@ -1978,7 +1978,7 @@ instanceKlass.cpp                       
- instanceKlass.cpp                       vmSymbols.hpp
- 
- instanceKlass.hpp                       accessFlags.hpp
--instanceKlass.hpp                       bitMap.hpp
-+instanceKlass.hpp                       bitMap.inline.hpp
- instanceKlass.hpp                       constMethodOop.hpp
- instanceKlass.hpp                       constantPoolOop.hpp
- instanceKlass.hpp                       handles.hpp
-diff -upr ../orig/hotspot/src/share/vm/includeDB_features ./hotspot/src/share/vm/includeDB_features
---- ../orig/hotspot/src/share/vm/includeDB_features	2009-01-27 15:41:02.000000000 -0500
-+++ ./hotspot/src/share/vm/includeDB_features	2009-05-04 17:37:15.000000000 -0400
-@@ -58,6 +58,8 @@ dump.cpp                                
- 
- dump_<arch_model>.cpp                   assembler_<arch_model>.inline.hpp
- dump_<arch_model>.cpp                   compactingPermGenGen.hpp
-+dump_<arch_model>.cpp                   generation.inline.hpp
-+dump_<arch_model>.cpp                   space.inline.hpp
- 
- forte.cpp                               collectedHeap.inline.hpp
- forte.cpp                               debugInfoRec.hpp
-diff -upr ../orig/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp ./hotspot/src/share/vm/interpreter/bytecodeTracer.cpp
---- ../orig/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	2009-01-27 15:41:02.000000000 -0500
-+++ ./hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	2009-05-04 17:37:15.000000000 -0400
-@@ -77,7 +77,7 @@ class BytecodePrinter: public BytecodeCl
+--- hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	2010-06-21 14:12:19.000000000 -0700
++++ hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	2010-06-20 21:56:16.000000000 -0700
+@@ -77,7 +77,7 @@
        // the incoming method.  We could lose a line of trace output.
        // This is acceptable in a debug-only feature.
        st->cr();
@@ -4200,19 +5982,18 @@
        method->print_name(st);
        st->cr();
        _current_method = method();
-@@ -90,7 +90,7 @@ class BytecodePrinter: public BytecodeCl
+@@ -90,7 +90,7 @@
        code = Bytecodes::code_at(bcp);
      }
      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));
-diff -upr ../orig/hotspot/src/share/vm/prims/forte.cpp ./hotspot/src/share/vm/prims/forte.cpp
---- ../orig/hotspot/src/share/vm/prims/forte.cpp	2009-01-27 15:41:03.000000000 -0500
-+++ ./hotspot/src/share/vm/prims/forte.cpp	2009-05-04 17:37:15.000000000 -0400
-@@ -872,6 +872,11 @@ void AsyncGetCallTrace(ASGCT_CallTrace *
+       st->print("%8d  %4d  " INTPTR_FORMAT " " INTPTR_FORMAT " %s",
+            BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
+--- hotspot/src/share/vm/prims/forte.cpp	2010-06-21 14:12:20.000000000 -0700
++++ hotspot/src/share/vm/prims/forte.cpp	2010-06-20 21:56:16.000000000 -0700
+@@ -626,6 +626,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.
@@ -4224,7 +6005,7 @@
  void    collector_func_load(char* name,
                              void* null_argument_1,
                              void* null_argument_2,
-@@ -882,6 +887,7 @@ void    collector_func_load(char* name,
+@@ -636,6 +641,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 )
@@ -4232,10 +6013,9 @@
  #endif // !_WINDOWS
  
  } // end extern "C"
-diff -upr ../orig/hotspot/src/share/vm/runtime/globals.hpp ./hotspot/src/share/vm/runtime/globals.hpp
---- ../orig/hotspot/src/share/vm/runtime/globals.hpp	2009-01-27 15:41:03.000000000 -0500
-+++ ./hotspot/src/share/vm/runtime/globals.hpp	2009-05-06 12:07:35.000000000 -0400
-@@ -294,7 +294,7 @@ class CommandLineFlags {
+--- hotspot/src/share/vm/runtime/globals.hpp	2010-06-21 14:12:20.000000000 -0700
++++ hotspot/src/share/vm/runtime/globals.hpp	2010-06-20 21:56:16.000000000 -0700
+@@ -324,7 +324,7 @@
    /* UseMembar is theoretically a temp flag used for memory barrier         \
     * removal testing.  It was supposed to be removed before FCS but has     \
     * been re-added (see 6401008) */                                         \
@@ -4243,26 +6023,25 @@
 +  product(bool, UseMembar, true,                                           \
            "(Unstable) Issues membars on thread state transitions")          \
                                                                              \
-   product(bool, PrintCommandLineFlags, false,                               \
-diff -upr ../orig/hotspot/src/share/vm/runtime/os.cpp ./hotspot/src/share/vm/runtime/os.cpp
---- ../orig/hotspot/src/share/vm/runtime/os.cpp	2009-01-27 15:41:03.000000000 -0500
-+++ ./hotspot/src/share/vm/runtime/os.cpp	2009-05-04 17:37:17.000000000 -0400
-@@ -155,7 +155,11 @@ char* os::iso8601_time(char* buffer, siz
+   diagnostic(bool, UnlockDiagnosticVMOptions, trueInDebug,                  \
+--- hotspot/src/share/vm/runtime/os.cpp	2010-06-21 14:12:21.000000000 -0700
++++ hotspot/src/share/vm/runtime/os.cpp	2010-06-20 21:56:16.000000000 -0700
+@@ -79,7 +79,12 @@
+     assert(false, "Failed localtime_pd");
+     return NULL;
    }
-   // Save the results of localtime
-   const struct tm time_struct = *time_struct_temp;
++
 +#if defined(_ALLBSD_SOURCE)
-+  const time_t zone = (time_t) time_struct_temp->tm_gmtoff;
++  const time_t zone = (time_t) time_struct.tm_gmtoff;
 +#else
    const time_t zone = timezone;
 +#endif
-   
-   // If daylight savings time is in effect, 
+ 
+   // If daylight savings time is in effect,
    // we are 1 hour East of our time zone
-diff -upr ../orig/hotspot/src/share/vm/runtime/vm_version.cpp ./hotspot/src/share/vm/runtime/vm_version.cpp
---- ../orig/hotspot/src/share/vm/runtime/vm_version.cpp	2009-01-27 15:41:03.000000000 -0500
-+++ ./hotspot/src/share/vm/runtime/vm_version.cpp	2009-05-04 17:37:15.000000000 -0400
-@@ -141,7 +141,8 @@ const char* Abstract_VM_Version::vm_rele
+--- hotspot/src/share/vm/runtime/vm_version.cpp	2010-06-21 14:12:21.000000000 -0700
++++ hotspot/src/share/vm/runtime/vm_version.cpp	2010-06-20 21:56:16.000000000 -0700
+@@ -144,7 +144,8 @@
  
  #define OS       LINUX_ONLY("linux")             \
                   WINDOWS_ONLY("windows")         \
@@ -4270,12 +6049,11 @@
 +                 SOLARIS_ONLY("solaris")         \
 +                 BSD_ONLY("bsd")
  
- #define CPU      IA32_ONLY("x86")                \
-                  IA64_ONLY("ia64")               \
-diff -upr ../orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
---- ../orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2009-01-27 15:41:03.000000000 -0500
-+++ ./hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2009-05-04 17:37:17.000000000 -0400
-@@ -74,12 +74,25 @@
+ #ifdef ZERO
+ #define CPU      ZERO_LIBARCH
+--- hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2010-06-21 14:12:21.000000000 -0700
++++ hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2010-06-20 21:56:16.000000000 -0700
+@@ -71,12 +71,25 @@
  # include <sys/procfs.h>
  # endif
  
@@ -4303,7 +6081,7 @@
  
  // 4810578: varargs unsafe on 32-bit integer/64-bit pointer architectures
  // When __cplusplus is defined, NULL is defined as 0 (32-bit constant) in
-@@ -115,17 +128,20 @@
+@@ -112,7 +125,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.
@@ -4312,22 +6090,16 @@
    #ifdef _LP64
      #define NULL_WORD  0L
    #else
--    #define NULL_WORD  0
-+    // Cast 0 to intptr_t rather than int32_t since they are not the same type
-+    // on platforms such as Mac OS X.
-+    #define NULL_WORD  ((intptr_t)0)
-   #endif
- #else
+@@ -124,7 +137,7 @@
    #define NULL_WORD  NULL
  #endif
  
--#ifndef	LINUX
-+
+-#ifndef LINUX
 +#if !defined(LINUX) && !defined(_ALLBSD_SOURCE)
  // Compiler-specific primitive types
  typedef unsigned short     uint16_t;
  #ifndef _UINT32_T
-@@ -145,7 +161,7 @@ typedef unsigned int		uintptr_t;
+@@ -144,7 +157,7 @@
  // prior definition of intptr_t, and add "&& !defined(XXX)" above.
  #endif // _SYS_INT_TYPES_H
  
@@ -4336,7 +6108,7 @@
  
  // Additional Java basic types
  
-@@ -229,7 +245,9 @@ inline int g_isnan(float  f) { return is
+@@ -228,7 +241,9 @@
  inline int g_isnan(float  f) { return isnand(f); }
  #endif
  inline int g_isnan(double f) { return isnand(f); }
@@ -4347,11 +6119,10 @@
  inline int g_isnan(float  f) { return isnanf(f); }
  inline int g_isnan(double f) { return isnan(f); }
  #else
-diff -upr ../orig/hotspot/src/share/vm/utilities/macros.hpp ./hotspot/src/share/vm/utilities/macros.hpp
---- ../orig/hotspot/src/share/vm/utilities/macros.hpp	2009-01-27 15:41:03.000000000 -0500
-+++ ./hotspot/src/share/vm/utilities/macros.hpp	2009-05-04 17:37:17.000000000 -0400
-@@ -147,6 +147,16 @@
- #define NOT_WINDOWS(code) code
+--- hotspot/src/share/vm/utilities/macros.hpp	2010-06-21 14:12:21.000000000 -0700
++++ hotspot/src/share/vm/utilities/macros.hpp	2010-06-20 21:56:16.000000000 -0700
+@@ -156,6 +156,16 @@
+ #define X86_ONLY(code)
  #endif
  
 +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
@@ -4367,10 +6138,9 @@
  #ifdef IA32
  #define IA32_ONLY(code) code
  #define NOT_IA32(code)
-diff -upr ../orig/hotspot/src/share/vm/utilities/ostream.cpp ./hotspot/src/share/vm/utilities/ostream.cpp
---- ../orig/hotspot/src/share/vm/utilities/ostream.cpp	2009-01-27 15:41:03.000000000 -0500
-+++ ./hotspot/src/share/vm/utilities/ostream.cpp	2009-05-04 17:37:15.000000000 -0400
-@@ -780,7 +780,7 @@ bufferedStream::~bufferedStream() {
+--- hotspot/src/share/vm/utilities/ostream.cpp	2010-06-21 14:12:21.000000000 -0700
++++ hotspot/src/share/vm/utilities/ostream.cpp	2010-06-20 21:56:16.000000000 -0700
+@@ -827,7 +827,7 @@
  
  #ifndef PRODUCT
  
@@ -4379,16 +6149,15 @@
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
-diff -upr ../orig/hotspot/src/share/vm/utilities/vmError.cpp ./hotspot/src/share/vm/utilities/vmError.cpp
---- ../orig/hotspot/src/share/vm/utilities/vmError.cpp	2009-01-27 15:41:04.000000000 -0500
-+++ ./hotspot/src/share/vm/utilities/vmError.cpp	2009-05-04 17:37:17.000000000 -0400
-@@ -34,13 +34,18 @@ const char *env_list[] = {
-   "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH", 
+--- hotspot/src/share/vm/utilities/vmError.cpp	2010-06-21 14:12:21.000000000 -0700
++++ hotspot/src/share/vm/utilities/vmError.cpp	2010-06-20 21:56:16.000000000 -0700
+@@ -31,13 +31,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", 
+   "LD_LIBRARY_PATH", "LD_PRELOAD", "SHELL", "DISPLAY",
    "HOSTTYPE", "OSTYPE", "ARCH", "MACHTYPE",
  
    // defined on Linux
@@ -4402,19 +6171,7 @@
    // defined on Windows
    "OS", "PROCESSOR_IDENTIFIER", "_ALT_JAVA_HOME_DIR",
  
-@@ -673,6 +678,11 @@ void VMError::report_and_die() {
-     reset_signal_handlers();
- 
-   } else {
-+    // If UseOsErrorReporting we call this for each level of the call stack
-+    // while searching for the exception handler.  Only the first level needs
-+    // to be reported.
-+    if (UseOSErrorReporting && log_done) return;
-+
-     // This is not the first error, see if it happened in a different thread
-     // or in the same thread during error reporting.
-     if (first_error_tid != mytid) {
-@@ -793,7 +803,7 @@ void VMError::report_and_die() {
+@@ -848,7 +853,7 @@
      const char* ptr = OnError;
      while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){
        out.print_raw   ("#   Executing ");
@@ -4423,10 +6180,9 @@
        out.print_raw   ("/bin/sh -c ");
  #elif defined(SOLARIS)
        out.print_raw   ("/usr/bin/sh -c ");
-diff -upr ../orig/jdk/make/com/sun/java/pack/Makefile ./jdk/make/com/sun/java/pack/Makefile
---- ../orig/jdk/make/com/sun/java/pack/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/com/sun/java/pack/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -61,6 +61,7 @@ vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR
+--- jdk/make/com/sun/java/pack/Makefile	2010-06-21 14:15:07.000000000 -0700
++++ jdk/make/com/sun/java/pack/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -61,6 +61,7 @@
  
  
  ifeq ($(STANDALONE),true)
@@ -4434,7 +6190,7 @@
    ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
  
    ZIPOBJS =  $(ZIPOBJDIR)/zcrc32.$(OBJECT_SUFFIX) \
-@@ -78,6 +79,10 @@ ifeq ($(STANDALONE),true)
+@@ -78,6 +79,10 @@
    ZINCLUDE=-I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
    OTHER_CXXFLAGS += $(ZINCLUDE)
    LDDFLAGS += $(ZIPOBJS)
@@ -4445,7 +6201,7 @@
  else
    OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
    OTHER_LDLIBS += $(JVMLIB)
-@@ -102,7 +107,11 @@ ifeq ($(PLATFORM), windows) 
+@@ -102,7 +107,11 @@
    COMPILER_WARNINGS_FATAL=false
  else
    LDOUTPUT = -o #Have a space 
@@ -4457,10 +6213,9 @@
    OTHER_LDLIBS  += $(LIBCXX)
  # setup the list of libraries to link in...
  ifeq ($(PLATFORM), linux)
-diff -upr ../orig/jdk/make/com/sun/security/auth/module/Makefile ./jdk/make/com/sun/security/auth/module/Makefile
---- ../orig/jdk/make/com/sun/security/auth/module/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/com/sun/security/auth/module/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -70,7 +70,7 @@ ifeq ($(PLATFORM), solaris)
+--- jdk/make/com/sun/security/auth/module/Makefile	2010-06-21 14:15:07.000000000 -0700
++++ jdk/make/com/sun/security/auth/module/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -70,7 +70,7 @@
    include FILES_c_solaris.gmk
  endif # solaris
  
@@ -4469,10 +6224,21 @@
    LIBRARY = jaas_unix
    include FILES_export_unix.gmk
    include FILES_c_unix.gmk
-diff -upr ../orig/jdk/make/com/sun/tools/attach/FILES_c.gmk ./jdk/make/com/sun/tools/attach/FILES_c.gmk
---- ../orig/jdk/make/com/sun/tools/attach/FILES_c.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/com/sun/tools/attach/FILES_c.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -39,4 +39,7 @@ FILES_c = \
+--- jdk/make/com/sun/tools/attach/Exportedfiles.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/com/sun/tools/attach/Exportedfiles.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -43,5 +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	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/com/sun/tools/attach/FILES_c.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -39,4 +39,7 @@
  	LinuxVirtualMachine.c
  endif
  
@@ -4481,24 +6247,52 @@
 +FILES_c = \
 +	BsdVirtualMachine.c
 +endif
-diff -upr ../orig/jdk/make/com/sun/tools/attach/FILES_java.gmk ./jdk/make/com/sun/tools/attach/FILES_java.gmk
---- ../orig/jdk/make/com/sun/tools/attach/FILES_java.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/com/sun/tools/attach/FILES_java.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -43,6 +43,11 @@ FILES_java += \
+--- jdk/make/com/sun/tools/attach/FILES_java.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/com/sun/tools/attach/FILES_java.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -43,6 +43,11 @@
  	sun/tools/attach/LinuxAttachProvider.java
  endif
  
 +ifeq ($(PLATFORM), bsd)
 +FILES_java += \
-+	$(TARGDIR)/sun/tools/attach/BsdAttachProvider.java
++	sun/tools/attach/BsdAttachProvider.java
 +endif
 +
  #
  # Files that need to be copied
  #
-diff -upr ../orig/jdk/make/common/Defs-bsd.gmk ./jdk/make/common/Defs-bsd.gmk
---- ../orig/jdk/make/common/Defs-bsd.gmk	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/make/common/Defs-bsd.gmk	2009-05-04 17:37:15.000000000 -0400
+--- jdk/make/com/sun/tools/attach/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/com/sun/tools/attach/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -36,6 +36,9 @@
+ ifeq ($(PLATFORM), linux)
+ FILES_m = mapfile-linux
+ endif
++ifeq ($(PLATFORM), bsd)
++FILES_m = mapfile-bsd
++endif
+ include $(BUILDDIR)/common/Mapfile-vers.gmk
+ 
+ #
+--- jdk/make/com/sun/tools/attach/mapfile-bsd	2010-06-27 11:37:43.000000000 -0700
++++ jdk/make/com/sun/tools/attach/mapfile-bsd	2010-06-20 21:56:16.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	2010-06-27 11:37:43.000000000 -0700
++++ jdk/make/common/Defs-bsd.gmk	2010-06-20 22:48:15.000000000 -0700
 @@ -43,12 +43,6 @@
  # Get shared JDK settings
  include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
@@ -4512,7 +6306,7 @@
  ifndef PLATFORM_SRC
    PLATFORM_SRC = $(BUILDDIR)/../src/solaris
  endif # PLATFORM_SRC
-@@ -61,7 +55,7 @@ ifndef OPENJDK
+@@ -61,7 +55,7 @@
  endif
  
  # platform specific include files
@@ -4521,7 +6315,7 @@
  PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
  
  # suffix used for make dependencies files.
-@@ -104,6 +98,10 @@ endif
+@@ -104,6 +98,10 @@
  #    as the default.
  CFLAGS_REQUIRED_amd64   += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
  CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
@@ -4532,16 +6326,16 @@
  CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
  CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
  LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
-@@ -178,7 +176,7 @@ ifeq ($(FASTDEBUG), true)
-   CXXFLAGS_DBG	+= $(CC_LOWER_OPT)
+@@ -201,7 +199,7 @@
+   CPP_ARCH_FLAGS += -D_$(ARCH)_
  endif
  
--CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
-+CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -D_ALLBSD_SOURCE $(VERSION_DEFINES) \
+-CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
++CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -D_ALLBSD_SOURCE $(VERSION_DEFINES) \
  		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
  
  ifeq ($(ARCH_DATA_MODEL), 64)
-@@ -188,33 +186,15 @@ endif
+@@ -211,33 +209,15 @@
  CPPFLAGS_OPT    = 
  CPPFLAGS_DBG    = -DDEBUG
  
@@ -4563,7 +6357,7 @@
 -
 -EXTRA_LIBS += -lc
 -
--LDFLAGS_DEFS_OPTION  = -z defs
+-LDFLAGS_DEFS_OPTION  = -Xlinker -z -Xlinker defs
 -LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
 -
  #
@@ -4579,18 +6373,19 @@
  
  #
  # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
-@@ -235,8 +215,8 @@ AUTOMATIC_PCH_OPTION = 
- #
+@@ -259,9 +239,9 @@
  ifeq ($(VARIANT), OPT)
    ifneq ($(NO_STRIP), true)
--    # Debug 'strip -g' leaves local function Elf symbols (better stack traces)
--    POST_STRIP_PROCESS = $(STRIP) -g
-+    # Debug 'strip -S' leaves local function Elf symbols (better stack traces)
-+    POST_STRIP_PROCESS = $(STRIP) -S
+     ifneq ($(DEBUG_BINARIES), true)
+-      # Debug 'strip -g' leaves local function Elf symbols (better stack
++      # Debug 'strip -S' leaves local function Elf symbols (better stack
+       # traces)
+-      POST_STRIP_PROCESS = $(STRIP) -g
++      POST_STRIP_PROCESS = $(STRIP) -S
+     endif
    endif
  endif
- 
-@@ -245,13 +225,9 @@ endif
+@@ -271,13 +251,9 @@
  #
  LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker
  
@@ -4607,7 +6402,7 @@
  endif
  
  #
-@@ -280,7 +256,9 @@ override HAVE_ALTZONE            = false
+@@ -306,7 +282,9 @@
  override HAVE_FILIOH             = false
  override HAVE_GETHRTIME          = false
  override HAVE_GETHRVTIME         = false
@@ -4617,7 +6412,7 @@
  override LEX_LIBRARY             = -lfl
  ifeq ($(STATIC_CXX),true)
  override LIBCXX                  = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
-@@ -291,13 +269,9 @@ override LIBPOSIX4               =
+@@ -317,13 +295,9 @@
  override LIBSOCKET               =
  override LIBTHREAD               =
  override MOOT_PRIORITIES         = true
@@ -4633,7 +6428,7 @@
  override OTHER_M4FLAGS           = -D__GLIBC__ -DGNU_ASSEMBLER
  override SUN_CMM_SUBDIR          =
  override THREADS_FLAG            = native
-@@ -318,6 +292,14 @@ override USE_EXECNAME            = true
+@@ -344,6 +318,14 @@
  # DPS (Displayable PostScript) is available on Solaris machines
  HAVE_DPS = no
  
@@ -4648,10 +6443,9 @@
  #
  # Japanese manpages
  #
-diff -upr ../orig/jdk/make/common/Defs-linux.gmk ./jdk/make/common/Defs-linux.gmk
---- ../orig/jdk/make/common/Defs-linux.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/Defs-linux.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -292,7 +292,7 @@ override LIBSOCKET               =
+--- jdk/make/common/Defs-linux.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/Defs-linux.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -318,7 +318,7 @@
  override LIBTHREAD               =
  override MOOT_PRIORITIES         = true
  override NO_INTERRUPTIBLE_IO     = true
@@ -4660,10 +6454,9 @@
  ifeq ($(ARCH), amd64)
  override OPENWIN_LIB             = $(OPENWIN_HOME)/lib64
  else
-diff -upr ../orig/jdk/make/common/Defs.gmk ./jdk/make/common/Defs.gmk
---- ../orig/jdk/make/common/Defs.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/Defs.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -188,6 +188,24 @@ else
+--- jdk/make/common/Defs.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/Defs.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -188,6 +188,24 @@
  _OUTPUTDIR=$(JDK_TOPDIR)/build/$(PLATFORM)-$(ARCH)
  endif
  
@@ -4688,7 +6481,7 @@
  #
  # Get platform definitions
  #
-@@ -223,6 +241,7 @@ DEVTOOLS_FT_DIR_EXISTS = $(shell \
+@@ -223,6 +241,7 @@
  
    ifdef ALT_FREETYPE_LIB_PATH
      FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
@@ -4696,7 +6489,7 @@
    else
      ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
        FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
-@@ -287,6 +306,10 @@ ifdef PROGRAM
+@@ -287,6 +306,10 @@
      LDLIBS_COMMON = -ldl
    endif
  
@@ -4707,10 +6500,9 @@
  endif # PROGRAM
  
  LDLIBS_COMMON += $(EXTRA_LIBS)
-diff -upr ../orig/jdk/make/common/Program.gmk ./jdk/make/common/Program.gmk
---- ../orig/jdk/make/common/Program.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/Program.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -67,11 +67,27 @@ endif
+--- jdk/make/common/Program.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/Program.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -67,11 +67,27 @@
  # Create a dependency on libjli (Java Launcher Infrastructure)
  #
  # On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
@@ -4739,7 +6531,7 @@
  ifneq (,$(findstring $(PLATFORM), linux solaris))	# UNIX systems
      LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
      OTHER_LDLIBS += -ljli
-@@ -175,6 +191,10 @@ else # USE_PTHREADS
+@@ -175,6 +191,10 @@
    THREADLIBS = $(LIBTHREAD)
  endif # USE_PTHREADS
  
@@ -4750,7 +6542,7 @@
  #
  # This rule only applies on unix.  It supports quantify and its ilk.
  #
-@@ -243,15 +263,19 @@ endif
+@@ -243,15 +263,19 @@
  
  
  ifneq ($(PLATFORM), windows)
@@ -4768,12 +6560,11 @@
  OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
 +endif
  
- # this may not be necessary...
- ifeq ($(PLATFORM), windows)
-diff -upr ../orig/jdk/make/common/Release.gmk ./jdk/make/common/Release.gmk
---- ../orig/jdk/make/common/Release.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/Release.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -147,14 +147,13 @@ JRE_MAN_PAGES =         \
+ OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
+ VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
+--- jdk/make/common/Release.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/Release.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -145,14 +145,13 @@
  	tnameserv.1     \
  	unpack200.1
  
@@ -4789,7 +6580,7 @@
  	extcheck.1         \
  	idlj.1             \
  	jar.1              \
-@@ -193,6 +192,11 @@ ifeq ($(PLATFORM), linux)
+@@ -191,6 +190,11 @@
    JA_DIRNAME=ja_JP.$(JA_SOURCE_ENCODING)
  endif # linux
  
@@ -4801,7 +6592,7 @@
  define copy-man-pages
  $(MKDIR) -p $1/man/man1
  for manbase in $(MANBASEDIRS:%=%/$(MAN1SUBDIR)) ; do \
-@@ -325,6 +329,12 @@ ifndef OPENJDK
+@@ -323,6 +327,12 @@
    SOURCE_DIRS += $(CLOSED_SRC)/share/classes
  endif
  
@@ -4814,7 +6605,16 @@
  
  #
  # Specific files and directories that will be filtered out from above areas.
-@@ -982,7 +992,7 @@ initial-image-jdk:: initial-image-jdk-se
+@@ -637,6 +647,8 @@
+ 	$(BOOT_JAVA_CMD) -jar $(JARSPLIT_JARFILE) \
+ 		$(TOTAL_JAR_FILELIST) \
+ 		-o  $(RT_JAR_FILELIST) $(RES_JAR_FILELIST)
++	$(EGREP) -v hotspot.log $(RES_JAR_FILELIST) > $(RES_JAR_FILELIST).temp
++	$(MV) $(RES_JAR_FILELIST).temp $(RES_JAR_FILELIST)
+ 	@$(java-vm-cleanup)
+ 
+ # Create the manifest file.
+@@ -982,7 +994,7 @@
  	@# generated by the more efficient solaris/windows method of copying files.
  	@# 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.
@@ -4823,7 +6623,7 @@
  	for d in $(SOURCE_DIRS); do \
  	  $(RM) $(ABS_TEMPDIR)/src-files.list; \
  	  ($(CD) $$d &&  \
-@@ -995,7 +1005,7 @@ initial-image-jdk:: initial-image-jdk-se
+@@ -995,7 +1007,7 @@
  	    done ; \
  	  ) ; \
  	  if [ -f  $(ABS_TEMPDIR)/src-files.list ] ; then \
@@ -4832,10 +6632,9 @@
  	       | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \
  	  fi; \
  	done
-diff -upr ../orig/jdk/make/common/internal/BinaryPlugs.gmk ./jdk/make/common/internal/BinaryPlugs.gmk
---- ../orig/jdk/make/common/internal/BinaryPlugs.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/internal/BinaryPlugs.gmk	2009-05-04 17:37:17.000000000 -0400
-@@ -49,8 +49,6 @@ PLUG_JMF_CLASS_NAMES = \
+--- jdk/make/common/internal/BinaryPlugs.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/internal/BinaryPlugs.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -49,8 +49,6 @@
  com/sun/jmx/snmp/SnmpDataTypeEnums.class \
  com/sun/jmx/snmp/SnmpDefinitions.class \
  com/sun/jmx/snmp/SnmpOid.class \
@@ -4844,7 +6643,7 @@
  com/sun/jmx/snmp/SnmpOidRecord.class \
  com/sun/jmx/snmp/SnmpOidTable.class \
  com/sun/jmx/snmp/SnmpOidTableSupport.class \
-@@ -60,22 +58,16 @@ com/sun/jmx/snmp/SnmpPeer.class \
+@@ -60,22 +58,16 @@
  com/sun/jmx/snmp/SnmpTimeticks.class \
  com/sun/jmx/snmp/SnmpVarBind.class \
  com/sun/jmx/snmp/SnmpVarBindList.class \
@@ -4871,7 +6670,7 @@
  PLUG_CLISTS = $(PLUG_CLASS_AREAS:%=$(PLUG_TEMPDIR)/%.clist)
  
  # Create jargs file command
-@@ -93,11 +85,18 @@ $(PLUG_TEMPDIR)/jmf.clist:
+@@ -93,11 +85,18 @@
  	@for i in $(PLUG_JMF_CLASS_NAMES) ; do \
  	  $(ECHO) "$$i" >> $@; \
  	done
@@ -4890,7 +6689,7 @@
  $(PLUG_TEMPDIR)/all.jargs: $(PLUG_TEMPDIR)/all.clist
  	$(plug-create-jargs)
  
-@@ -153,11 +152,16 @@ endif # IMPORT_BINARY_PLUGS
+@@ -153,11 +152,16 @@
  
  import-binary-plug-jmf-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/jmf.clist
  	$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/jmf.clist)
@@ -4908,7 +6707,7 @@
  
  # Binary plug start/complete messages
  
-@@ -169,14 +173,12 @@ import-binary-plugs-completed:
+@@ -169,14 +173,12 @@
  
  # Import lib files (only if they don't exist already)
  
@@ -4924,10 +6723,9 @@
      import-binary-plug-jar \
      import-binary-plugs-completed
  
-diff -upr ../orig/jdk/make/common/shared/Compiler-gcc.gmk ./jdk/make/common/shared/Compiler-gcc.gmk
---- ../orig/jdk/make/common/shared/Compiler-gcc.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/shared/Compiler-gcc.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -99,6 +99,24 @@ ifeq ($(PLATFORM), linux)
+--- jdk/make/common/shared/Compiler-gcc.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Compiler-gcc.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -99,6 +99,24 @@
  
  endif
  
@@ -4952,10 +6750,9 @@
  ifeq ($(PLATFORM), solaris)
  
    # Settings specific to Solaris
-diff -upr ../orig/jdk/make/common/shared/Compiler.gmk ./jdk/make/common/shared/Compiler.gmk
---- ../orig/jdk/make/common/shared/Compiler.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/shared/Compiler.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -37,8 +37,8 @@ ifeq ($(PLATFORM), solaris)
+--- jdk/make/common/shared/Compiler.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Compiler.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -37,8 +37,8 @@
    override CC_VERSION = sun
  endif
  
@@ -4966,10 +6763,9 @@
    override CC_VERSION = gcc
  endif
  
-diff -upr ../orig/jdk/make/common/shared/Defs-bsd.gmk ./jdk/make/common/shared/Defs-bsd.gmk
---- ../orig/jdk/make/common/shared/Defs-bsd.gmk	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/make/common/shared/Defs-bsd.gmk	2009-05-04 22:40:38.000000000 -0400
-@@ -70,7 +70,7 @@ $(shell if [ "$1" != "" -a -d "$1" ]; th
+--- jdk/make/common/shared/Defs-bsd.gmk	2010-06-27 11:37:43.000000000 -0700
++++ jdk/make/common/shared/Defs-bsd.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -70,7 +70,7 @@
  endef
  
  # Location on system where jdk installs might be
@@ -4978,7 +6774,7 @@
  
  # UNIXCOMMAND_PATH: path to where the most common Unix commands are.
  #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
-@@ -123,7 +123,7 @@ endif
+@@ -123,7 +123,7 @@
  ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
    DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH))
  else
@@ -4987,7 +6783,7 @@
  endif
  
  # _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
-@@ -162,16 +162,12 @@ else
+@@ -162,16 +162,12 @@
  endif
  MOTIF_INCLUDE = $(MOTIF_DIR)/include
  
@@ -5007,13 +6803,23 @@
  # Import JDK images allow for partial builds, components not built are
  #    imported (or copied from) these import areas when needed.
  
-diff -upr ../orig/jdk/make/common/shared/Defs-utils.gmk ./jdk/make/common/shared/Defs-utils.gmk
---- ../orig/jdk/make/common/shared/Defs-utils.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/shared/Defs-utils.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -77,6 +77,13 @@ ifndef FINDBUGS_HOME
+--- jdk/make/common/shared/Defs-java.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Defs-java.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -42,7 +42,7 @@
+   #   Suspect this may not be needed anymore.
+   JAVA_MEM_FLAGS   += -Xms$(MAX_VM_MEMORY)m -XX:-Inline
+ else
+-  JAVA_MEM_FLAGS   += -Xms$(MIN_VM_MEMORY)m -XX:PermSize=32m -XX:MaxPermSize=160m
++  JAVA_MEM_FLAGS   += -Xms$(MIN_VM_MEMORY)m
  endif
- FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
  
+ # 
+--- jdk/make/common/shared/Defs-utils.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Defs-utils.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -80,6 +80,13 @@
+   endif
+ endif
+ 
 +ifeq ($(PLATFORM),bsd)
 +  UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
 +  UTILS_USR_BIN_PATH=$(USRBIN_PATH)
@@ -5024,7 +6830,7 @@
  # Utilities
  ADB            = $(UTILS_COMMAND_PATH)adb
  AR             = $(UTILS_CCS_BIN_PATH)ar
-@@ -198,3 +205,32 @@ ifeq ($(PLATFORM),solaris)
+@@ -201,3 +208,32 @@
    ECHO           = /usr/bin/echo
  endif
  
@@ -5057,10 +6863,9 @@
 +    TAR        = $(UTILS_USR_BIN_PATH)tar
 +  endif
 +endif
-diff -upr ../orig/jdk/make/common/shared/Defs.gmk ./jdk/make/common/shared/Defs.gmk
---- ../orig/jdk/make/common/shared/Defs.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/shared/Defs.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -143,7 +143,7 @@ $(shell \
+--- jdk/make/common/shared/Defs.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Defs.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -143,7 +143,7 @@
          echo older; \
        else \
  	if [ $(call MajorVersion,$1) -eq $(call MajorVersion,$2) -a \
@@ -5069,10 +6874,9 @@
            echo older; \
          else \
            echo newer; \
-diff -upr ../orig/jdk/make/common/shared/Platform.gmk ./jdk/make/common/shared/Platform.gmk
---- ../orig/jdk/make/common/shared/Platform.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/shared/Platform.gmk	2009-05-04 17:37:17.000000000 -0400
-@@ -276,6 +276,76 @@ ifeq ($(SYSTEM_UNAME), Linux)
+--- jdk/make/common/shared/Platform.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Platform.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -275,6 +275,76 @@
    MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2)
  endif
  
@@ -5149,7 +6953,7 @@
  # Windows with and without CYGWIN will be slightly different
  ifeq ($(SYSTEM_UNAME), Windows_NT)
    PLATFORM = windows
-@@ -392,6 +462,13 @@ endif
+@@ -394,6 +464,13 @@
  #    system swapping during the build.
  #    If we don't know, assume 512. Subtract 128 from MB for VM MAX.
  #    Don't set VM max over 1024-128=896.
@@ -5163,7 +6967,7 @@
  ifneq ($(MB_OF_MEMORY),)
    LOW_MEMORY_MACHINE := $(shell \
      if [ $(MB_OF_MEMORY) -le 512 ] ; then \
-@@ -403,7 +480,7 @@ ifneq ($(MB_OF_MEMORY),)
+@@ -405,7 +482,7 @@
      if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
        expr $(MB_OF_MEMORY) '-' 128 ; \
      else \
@@ -5172,7 +6976,7 @@
      fi)
    MIN_VM_MEMORY := $(shell \
      if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
-@@ -455,6 +532,15 @@ ifneq ($(PLATFORM), windows)
+@@ -457,6 +534,15 @@
    ARCH_VM_SUBDIR=jre/lib/$(LIBARCH)
  endif
  
@@ -5188,10 +6992,9 @@
  # If blanks in the username, use the first 4 words and pack them together
  _USER1:=$(subst ', ,$(_USER))
  _USER2:=$(subst ", ,$(_USER1))
-diff -upr ../orig/jdk/make/common/shared/Sanity-Settings.gmk ./jdk/make/common/shared/Sanity-Settings.gmk
---- ../orig/jdk/make/common/shared/Sanity-Settings.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/shared/Sanity-Settings.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -257,6 +257,7 @@ ifdef OPENJDK
+--- jdk/make/common/shared/Sanity-Settings.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Sanity-Settings.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -243,6 +243,7 @@
    ALL_SETTINGS+=$(call addHeading,OpenJDK-specific settings)
    ALL_SETTINGS+=$(call addAltSetting,FREETYPE_HEADERS_PATH)
    ALL_SETTINGS+=$(call addAltSetting,FREETYPE_LIB_PATH)
@@ -5199,10 +7002,9 @@
    ALL_SETTINGS+=$(call addHeading,OPENJDK Import Binary Plug Settings)
    ALL_SETTINGS+=$(call addAltSetting,BINARY_PLUGS_JARFILE)
    ALL_SETTINGS+=$(call addAltSetting,BINARY_PLUGS_PATH)
-diff -upr ../orig/jdk/make/common/shared/Sanity.gmk ./jdk/make/common/shared/Sanity.gmk
---- ../orig/jdk/make/common/shared/Sanity.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/common/shared/Sanity.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -96,6 +96,11 @@ ifeq ($(PLATFORM), windows)
+--- jdk/make/common/shared/Sanity.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/common/shared/Sanity.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -96,6 +96,11 @@
      $(EGREP) "\#define" | $(NAWK) '{print $$3}')
  endif
  
@@ -5214,22 +7016,9 @@
  # 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')
-diff -upr ../orig/jdk/make/docs/Makefile ./jdk/make/docs/Makefile
---- ../orig/jdk/make/docs/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/docs/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -232,7 +232,7 @@ JDI_HEADER      = "Java Debug Interface"
- #       you get "No packages or classes specified." due to $(CLASSPATH_SEPARATOR)
- #       being interpreted as an end of command (newline)
- 
--JAAS_SOURCEPATH  = "$(TOPDIR)/src/share/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/solaris/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/windows/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/linux/classes"
-+JAAS_SOURCEPATH  = "$(TOPDIR)/src/share/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/solaris/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/windows/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/linux/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/bsd/classes"
- JAAS_DOCDIR	 = $(DOCSDIR)/jre/api/security/jaas/spec
- JAAS_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			 \
- 		   -encoding ascii			         \
-diff -upr ../orig/jdk/make/java/Makefile ./jdk/make/java/Makefile
---- ../orig/jdk/make/java/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/java/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -49,7 +49,7 @@ ifeq ($(PLATFORM), solaris)
+--- jdk/make/java/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -49,7 +49,7 @@
    endif
  endif # PLATFORM
  
@@ -5238,10 +7027,9 @@
    SUBDIRS += jexec
  endif # PLATFORM
  
-diff -upr ../orig/jdk/make/java/hpi/hpi_common.gmk ./jdk/make/java/hpi/hpi_common.gmk
---- ../orig/jdk/make/java/hpi/hpi_common.gmk	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/java/hpi/hpi_common.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -86,5 +86,9 @@ endif
+--- jdk/make/java/hpi/hpi_common.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/hpi/hpi_common.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -86,5 +86,9 @@
  # Things that must be linked in.
  #
  ifneq ($(PLATFORM), windows)
@@ -5251,10 +7039,9 @@
  OTHER_LDLIBS += $(LIBSOCKET) -lnsl $(LIBM) -ldl
  endif
 +endif
-diff -upr ../orig/jdk/make/java/hpi/native/Makefile ./jdk/make/java/hpi/native/Makefile
---- ../orig/jdk/make/java/hpi/native/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/java/hpi/native/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -72,11 +72,18 @@ OTHER_CPPFLAGS += -DUSE_PTHREADS
+--- jdk/make/java/hpi/native/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/hpi/native/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -72,11 +72,18 @@
  ifeq ($(MOOT_PRIORITIES),true)
  OTHER_CPPFLAGS += -DMOOT_PRIORITIES
  endif
@@ -5273,10 +7060,9 @@
  ifeq ($(HAVE_GETHRVTIME),true)
  OTHER_CPPFLAGS += -DHAVE_GETHRVTIME
  endif
-diff -upr ../orig/jdk/make/java/instrument/Makefile ./jdk/make/java/instrument/Makefile
---- ../orig/jdk/make/java/instrument/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/java/instrument/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -102,6 +102,21 @@ ifeq ($(PLATFORM), windows)
+--- jdk/make/java/instrument/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/instrument/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -102,6 +102,21 @@
    # equivalent of strcasecmp is stricmp on Windows
    CPPFLAGS_COMMON += -Dstrcasecmp=stricmp
  else
@@ -5298,7 +7084,7 @@
    LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
    OTHER_LDLIBS += -ljli
    OTHER_LDLIBS += -ldl 
-@@ -114,6 +129,7 @@ else
+@@ -114,6 +129,7 @@
      LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
    endif
  endif
@@ -5306,10 +7092,9 @@
  
  #
  # Library to compile.
-diff -upr ../orig/jdk/make/java/java/Makefile ./jdk/make/java/java/Makefile
---- ../orig/jdk/make/java/java/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/java/java/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -167,8 +167,10 @@ OTHER_INCLUDES += -I$(PLATFORM_SRC)/nati
+--- jdk/make/java/java/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/java/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -167,8 +167,10 @@
  # Is the altzone extern documented in ctime(3C) available?
  #
  ifneq ($(PLATFORM), windows)
@@ -5320,7 +7105,7 @@
  
  ifeq ($(HAVE_ALTZONE),true)
  OTHER_CPPFLAGS += -DHAVE_ALTZONE
-@@ -205,9 +207,14 @@ ifeq ($(PLATFORM),windows)
+@@ -205,9 +207,14 @@
  OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
  		       -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
  else
@@ -5335,10 +7120,51 @@
  
  #
  # Rules.
-diff -upr ../orig/jdk/make/java/java/localegen.sh ./jdk/make/java/java/localegen.sh
---- ../orig/jdk/make/java/java/localegen.sh	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/java/java/localegen.sh	2009-05-05 08:21:41.000000000 -0400
-@@ -55,9 +55,9 @@ sed_script="$SED -e \"s@^#warn .*@// -- 
+--- jdk/make/java/java/genlocales.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/java/genlocales.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -76,11 +76,16 @@
+ $(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;
+-	NAWK="$(NAWK)" SED="$(SED)" $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \
++	@$(ECHO) $(Euro_Resources_properties) | $(SED) -e s at .properties@'\
++'@g > $@.tmp.euro;
++	@$(ECHO) $(Euro_Resources_java) | $(SED) -e s at .java@'\
++'@g >> $@.tmp.euro;
++	@$(ECHO) $(NonEuro_Resources_properties) | $(SED) -e s at .properties@'\
++'@g > $@.tmp.noneuro;
++	@$(ECHO) $(NonEuro_Resources_java) | $(SED) -e s at .java@'\
++'@g >> $@.tmp.noneuro;
++	NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
++	     $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \
+ 		$@.tmp.noneuro $< $@
+ 	@$(RM) $@.tmp.euro $@.tmp.noneuro;
+ 	
+--- jdk/make/java/java/localegen.sh	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/java/localegen.sh	2010-06-20 21:56:16.000000000 -0700
+@@ -29,7 +29,7 @@
+ # This script is to generate the supported locale list string and replace the
+ # LocaleDataMetaInfo-XLocales.java in <ws>/src/share/classes/sun/util
+ # 
+-# NAWK & SED is passed in as environment variables.
++# SORT, NAWK & SED is passed in as environment variables.
+ #
+ 
+ # A list of resource base name list;
+@@ -47,7 +47,7 @@
+ localelist=
+ getlocalelist() {
+     localelist=""
+-    localelist=`$NAWK -F$1_ '{print $2}' $2 | sort`
++    localelist=`$NAWK -F$1_ '{print $2}' $2 | $SORT`
+ }
+ 
+ sed_script="$SED -e \"s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@\" " 
+@@ -55,9 +55,9 @@
  for FILE in $RESOURCE_NAMES 
  do
      getlocalelist $FILE $EURO_FILES_LIST
@@ -5350,10 +7176,9 @@
  done
  
  sed_script=$sed_script"$INPUT_FILE > $OUTPUT_FILE"
-diff -upr ../orig/jdk/make/java/java_hprof_demo/Makefile ./jdk/make/java/java_hprof_demo/Makefile
---- ../orig/jdk/make/java/java_hprof_demo/Makefile	2009-01-27 15:44:38.000000000 -0500
-+++ ./jdk/make/java/java_hprof_demo/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -83,8 +83,10 @@ OTHER_INCLUDES = -I$(SRCDIR) \
+--- jdk/make/java/java_hprof_demo/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/java_hprof_demo/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -83,8 +83,10 @@
  ifeq ($(PLATFORM), windows)
    OTHER_LDLIBS += wsock32.lib winmm.lib
  else
@@ -5364,10 +7189,9 @@
  
  #
  # Tell library.gmk to copy the txt file first
-diff -upr ../orig/jdk/make/java/jli/Makefile ./jdk/make/java/jli/Makefile
---- ../orig/jdk/make/java/jli/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/jli/Makefile	2009-05-05 08:26:57.000000000 -0400
-@@ -44,8 +44,10 @@ MS_RUNTIME_STATIC = true
+--- jdk/make/java/jli/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/jli/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -44,8 +44,10 @@
  
  include $(BUILDDIR)/common/Defs.gmk
  
@@ -5378,7 +7202,7 @@
  LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
  LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
  
-@@ -56,7 +58,10 @@ FILES_c = \
+@@ -56,7 +58,10 @@
  	parse_manifest.c \
  	version_comp.c \
  	wildcard.c \
@@ -5390,7 +7214,7 @@
  	inflate.c \
  	infblock.c \
  	inftrees.c \
-@@ -65,6 +70,7 @@ FILES_c = \
+@@ -65,6 +70,7 @@
  	infutil.c \
  	zadler32.c \
  	zutil.c
@@ -5398,7 +7222,7 @@
  
  OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
  
-@@ -98,7 +104,11 @@ endif
+@@ -98,7 +104,11 @@
  
  OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
  OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
@@ -5411,7 +7235,7 @@
  
  #
  # Library to compile.
-@@ -136,8 +146,29 @@ library:: $(STATIC_LIBRARY)
+@@ -136,8 +146,29 @@
  
  endif	# PLATFORM
  
@@ -5442,10 +7266,9 @@
 +endif
 +
  
-diff -upr ../orig/jdk/make/java/management/Makefile ./jdk/make/java/management/Makefile
---- ../orig/jdk/make/java/management/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/management/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -85,6 +85,11 @@ vpath %.c $(PLATFORM_SRC)/native/com/sun
+--- jdk/make/java/management/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/management/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -85,6 +85,11 @@
  OTHER_INCLUDES += \
    -I$(SHARE_SRC)/native/sun/management 
  
@@ -5457,10 +7280,9 @@
  ifeq ($(PLATFORM),windows)
    OTHER_LDLIBS += $(JVMLIB)
  endif
-diff -upr ../orig/jdk/make/java/net/FILES_c.gmk ./jdk/make/java/net/FILES_c.gmk
---- ../orig/jdk/make/java/net/FILES_c.gmk	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/net/FILES_c.gmk	2009-05-05 08:29:02.000000000 -0400
-@@ -43,6 +43,10 @@ ifeq ($(PLATFORM), linux)
+--- jdk/make/java/net/FILES_c.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/net/FILES_c.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -43,6 +43,10 @@
      FILES_c += linux_close.c
  endif
  
@@ -5471,10 +7293,9 @@
  ifeq ($(PLATFORM), windows)
      FILES_c += TwoStacksPlainSocketImpl.c
      FILES_c += DualStackPlainSocketImpl.c
-diff -upr ../orig/jdk/make/java/net/Makefile ./jdk/make/java/net/Makefile
---- ../orig/jdk/make/java/net/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/net/Makefile	2009-05-05 08:30:25.000000000 -0400
-@@ -92,6 +92,12 @@ include $(BUILDDIR)/common/Mapfile-vers.
+--- jdk/make/java/net/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/net/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -92,6 +92,12 @@
  
  include $(BUILDDIR)/common/Library.gmk
  
@@ -5487,7 +7308,7 @@
  ifeq ($(PLATFORM), windows)
    OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
    # Will not compile at warning level 3 if warnings are fatal
-@@ -102,6 +108,7 @@ endif
+@@ -102,6 +108,7 @@
  ifeq ($(PLATFORM), linux)
    OTHER_LDLIBS += -lpthread
  endif
@@ -5495,19 +7316,9 @@
  
  CLASSES.export += java.lang.Integer java.io.FileDescriptor java.net.InetAddressImplFactory java.net.Inet4AddressImpl java.net.Inet6AddressImpl
  
-diff -upr ../orig/jdk/make/java/nio/Makefile ./jdk/make/java/nio/Makefile
---- ../orig/jdk/make/java/nio/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/nio/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -82,7 +82,7 @@ FILES_export += \
- 	sun/nio/ch/WindowsSelectorImpl.java
- endif # PLATFORM = windows
- 
--ifeq ($(PLATFORM), linux)
-+ifneq (,$(findstring $(PLATFORM), linux bsd))
- FILES_java += \
-         sun/nio/ch/AbstractPollSelectorImpl.java \
- 	sun/nio/ch/EPollArrayWrapper.java \
-@@ -126,6 +126,11 @@ OTHER_INCLUDES += \
+--- jdk/make/java/nio/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/nio/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -126,6 +126,11 @@
    -I$(PLATFORM_SRC)/native/java/net \
    -I$(CLASSHDRDIR)/../../../java.lang/java/CClassHeaders
  
@@ -5519,7 +7330,7 @@
  ifeq ($(PLATFORM),windows)
    OTHER_LDLIBS += $(JVMLIB) ws2_32.lib \
       -libpath:$(LIBDIR) java.lib \
-@@ -137,6 +142,9 @@ ifeq ($(PLATFORM), linux)
+@@ -137,6 +142,9 @@
  COMPILER_WARNINGS_FATAL=true
  OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl
  endif
@@ -5529,7 +7340,7 @@
  ifeq ($(PLATFORM), solaris)
  OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 -ldl \
  		-L$(LIBDIR)/$(LIBARCH) -ljava -lnet
-@@ -159,6 +167,9 @@ endif
+@@ -159,6 +167,9 @@
  ifeq ($(PLATFORM), linux)
  FILES_m = mapfile-linux
  endif
@@ -5539,10 +7350,9 @@
  include $(BUILDDIR)/common/Mapfile-vers.gmk
  include $(BUILDDIR)/common/Library.gmk
  
-diff -upr ../orig/jdk/make/java/npt/Makefile ./jdk/make/java/npt/Makefile
---- ../orig/jdk/make/java/npt/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/npt/Makefile	2009-05-05 09:08:01.000000000 -0400
-@@ -70,6 +70,18 @@ ifeq ($(PLATFORM), windows)
+--- jdk/make/java/npt/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/npt/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -70,6 +70,18 @@
    OTHER_LCF += -export:nptInitialize -export:nptTerminate
  endif
  
@@ -5561,10 +7371,9 @@
  #
  # Add to ambient vpath so we pick up the library files
  #
-diff -upr ../orig/jdk/make/java/redist/FILES.gmk ./jdk/make/java/redist/FILES.gmk
---- ../orig/jdk/make/java/redist/FILES.gmk	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/redist/FILES.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -38,6 +38,14 @@ SHARED_FONTFILES =					\
+--- jdk/make/java/redist/FILES.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/redist/FILES.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -38,6 +38,14 @@
  	$(LIBDIR)/fonts/LucidaSansDemiBold.ttf       	\
  
  ifeq ($(PLATFORM), linux)
@@ -5579,22 +7388,9 @@
  
  # The oblique versions of the font are derived from the base versions
  # and since 2D can do this derivation on the fly at run time there is no
-diff -upr ../orig/jdk/make/java/redist/Makefile ./jdk/make/java/redist/Makefile
---- ../orig/jdk/make/java/redist/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/redist/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -85,6 +85,11 @@ ifeq ($(SA_EXISTS), false)
-   INCLUDE_SA := false
- endif
- 
-+# FIXME: Remove when the build of libsaproc is fixed.
-+ifeq ($(PLATFORM), bsd)
-+  INCLUDE_SA := false
-+endif
-+
- ifeq ($(INCLUDE_SA), true)
-   IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
-                  $(LIB_LOCATION)/$(SALIB_NAME)
-@@ -312,7 +317,7 @@ $(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/sha
+--- jdk/make/java/redist/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/redist/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -317,7 +317,7 @@
  $(FONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.fonts.dir
  	$(install-file)
  
@@ -5603,7 +7399,7 @@
  
  # The oblique fonts are only needed/wanted on Linux.
  
-@@ -326,7 +331,7 @@ $(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_
+@@ -331,7 +331,7 @@
  $(OBLFONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.oblique-fonts.dir
  	$(install-file)
  
@@ -5612,10 +7408,9 @@
  endif # !OPENJDK
  
  # Import internal files (ones that are stashed in this source tree)
-diff -upr ../orig/jdk/make/java/security/Makefile ./jdk/make/java/security/Makefile
---- ../orig/jdk/make/java/security/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/security/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -51,7 +51,15 @@ ifeq ($(PLATFORM), windows)
+--- jdk/make/java/security/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/security/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -51,7 +51,15 @@
    ifneq ($(ARCH_DATA_MODEL), 64)
      PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-windows
    endif
@@ -5631,10 +7426,9 @@
  endif # PLATFORM
  
  
-diff -upr ../orig/jdk/make/java/zip/FILES_c.gmk ./jdk/make/java/zip/FILES_c.gmk
---- ../orig/jdk/make/java/zip/FILES_c.gmk	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/zip/FILES_c.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -30,6 +30,10 @@ FILES_c = \
+--- jdk/make/java/zip/FILES_c.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/zip/FILES_c.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -30,6 +30,10 @@
  	Inflater.c \
  	ZipFile.c \
  	ZipEntry.c \
@@ -5645,7 +7439,7 @@
  	zadler32.c \
  	zcrc32.c \
  	deflate.c \
-@@ -40,5 +44,5 @@ FILES_c = \
+@@ -40,5 +44,5 @@
  	inftrees.c \
  	infcodes.c \
  	infutil.c \
@@ -5653,10 +7447,9 @@
 -	zip_util.c
 +	inffast.c
 +endif
-diff -upr ../orig/jdk/make/java/zip/Makefile ./jdk/make/java/zip/Makefile
---- ../orig/jdk/make/java/zip/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/java/zip/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -72,16 +72,24 @@ else
+--- jdk/make/java/zip/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/java/zip/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -72,16 +72,24 @@
  CPPFLAGS += -UDEBUG 
  endif
  
@@ -5682,11 +7475,21 @@
  OTHER_LDLIBS = $(JVMLIB)
 +endif
 +
-diff -upr ../orig/jdk/make/javax/sound/FILES_c.gmk ./jdk/make/javax/sound/FILES_c.gmk
---- ../orig/jdk/make/javax/sound/FILES_c.gmk	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/javax/sound/FILES_c.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -34,6 +34,8 @@ FILES_solaris = \
+--- jdk/make/javax/crypto/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/javax/crypto/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -155,7 +155,7 @@
+ #
  
+ ifdef OPENJDK
+-all: build-jar install-jar build-policy install-limited
++all: build-jar install-jar build-policy install-unlimited
+ else  # OPENJDK
+ ifeq ($(strip $(FILES_java)),)
+ all:
+--- jdk/make/javax/sound/FILES_c.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/javax/sound/FILES_c.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -34,6 +34,8 @@
+ 
  FILES_linux = 
  
 +FILES_bsd =
@@ -5694,10 +7497,9 @@
  FILES_windows = \
  	PLATFORM_API_WinOS_MidiIn.c \
  	PLATFORM_API_WinOS_MidiOut.c \
-diff -upr ../orig/jdk/make/javax/sound/Makefile ./jdk/make/javax/sound/Makefile
---- ../orig/jdk/make/javax/sound/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/javax/sound/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -107,6 +107,19 @@ ifeq ($(PLATFORM), linux)
+--- jdk/make/javax/sound/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/javax/sound/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -107,6 +107,19 @@
    #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
  endif # PLATFORM linux
  
@@ -5717,10 +7519,9 @@
  ifeq ($(PLATFORM), solaris)
    ifneq ($(ARCH), amd64)
      # build with ports and direct audio
-diff -upr ../orig/jdk/make/javax/sound/SoundDefs.gmk ./jdk/make/javax/sound/SoundDefs.gmk
---- ../orig/jdk/make/javax/sound/SoundDefs.gmk	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/javax/sound/SoundDefs.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -40,6 +40,10 @@ ifeq ($(PLATFORM), linux)
+--- jdk/make/javax/sound/SoundDefs.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/javax/sound/SoundDefs.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -40,6 +40,10 @@
    CPPFLAGS += -DX_PLATFORM=X_LINUX
  endif # PLATFORM linux
  
@@ -5731,10 +7532,9 @@
  ifeq ($(PLATFORM), solaris)
    CPPFLAGS += -DX_PLATFORM=X_SOLARIS
  
-diff -upr ../orig/jdk/make/jpda/back/Makefile ./jdk/make/jpda/back/Makefile
---- ../orig/jdk/make/jpda/back/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/jpda/back/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -49,8 +49,10 @@ OTHER_INCLUDES = -I$(SHARE_SRC)/transpor
+--- jdk/make/jpda/back/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/jpda/back/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -49,8 +49,10 @@
                   -I$(GENNATIVESRCDIR)/jdwp
  
  ifneq ($(PLATFORM), windows)
@@ -5745,25 +7545,9 @@
  
  #
  # This turns off all assert() checking in the optimized library
-diff -upr ../orig/jdk/make/jpda/transport/socket/Makefile ./jdk/make/jpda/transport/socket/Makefile
---- ../orig/jdk/make/jpda/transport/socket/Makefile	2009-01-27 15:44:39.000000000 -0500
-+++ ./jdk/make/jpda/transport/socket/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -45,6 +45,11 @@ ifeq ($(PLATFORM), linux)
-   OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread
- endif
- 
-+ifeq ($(PLATFORM), bsd)
-+  LIBSOCKET =
-+  OTHER_LDLIBS += -pthread
-+endif
-+
- ifeq ($(PLATFORM), solaris)
-   OTHER_LDLIBS += -lnsl $(LIBSOCKET)
- endif
-diff -upr ../orig/jdk/make/sun/awt/Makefile ./jdk/make/sun/awt/Makefile
---- ../orig/jdk/make/sun/awt/Makefile	2009-01-27 15:44:42.000000000 -0500
-+++ ./jdk/make/sun/awt/Makefile	2009-05-05 09:13:17.000000000 -0400
-@@ -129,6 +129,14 @@ OTHER_CFLAGS += -DMOTIF_VERSION=2
+--- jdk/make/sun/awt/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/sun/awt/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -129,6 +129,14 @@
  OTHER_LDLIBS = $(JVMLIB) $(LIBM) -ldl
  endif
  
@@ -5778,7 +7562,7 @@
  FILES_c += initIDs.c
  
  # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SOLARIS/LINUX
-@@ -241,7 +249,7 @@ vpath %.c     $(SHARE_SRC)/native/$(PKGD
+@@ -241,7 +249,7 @@
  # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ WINDOWS
  endif # PLATFORM
  
@@ -5787,7 +7571,7 @@
  # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv LINUX
  vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl
  vpath %.c   $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl
-@@ -421,6 +429,19 @@ FONTCONFIGS_SRC_PREFIX = $(PLATFORM).
+@@ -421,6 +429,19 @@
  # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SOLARIS
  endif # PLATFORM
  
@@ -5807,7 +7591,7 @@
  FONTCONFIGS     = $(_FONTCONFIGS:%=$(LIBDIR)/%.src)
  BINARYFONTCONFIGS = $(_FONTCONFIGS:%.properties=$(LIBDIR)/%.bfc)
  
-@@ -514,6 +535,9 @@ CPPFLAGS += -I$(MOTIF_DIR)/include \
+@@ -514,6 +535,9 @@
              -I$(OPENWIN_HOME)/include/X11/extensions \
              -I$(PLATFORM_SRC)/native/$(PKGDIR)/font 
  endif
@@ -5817,7 +7601,7 @@
  CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
              -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
              -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \
-@@ -535,7 +559,13 @@ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGD
+@@ -535,7 +559,13 @@
              -I$(PLATFORM_SRC)/native/$(PKGDIR) \
  	    $(EVENT_MODEL)
  
@@ -5832,10 +7616,9 @@
  LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
  endif
  
-diff -upr ../orig/jdk/make/sun/awt/mawt.gmk ./jdk/make/sun/awt/mawt.gmk
---- ../orig/jdk/make/sun/awt/mawt.gmk	2009-01-27 15:44:42.000000000 -0500
-+++ ./jdk/make/sun/awt/mawt.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -172,7 +172,7 @@ ifeq ($(PLATFORM), solaris)
+--- jdk/make/sun/awt/mawt.gmk	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/sun/awt/mawt.gmk	2010-06-20 21:56:16.000000000 -0700
+@@ -174,7 +174,7 @@
  OTHER_LDLIBS = $(LIBXM) -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi
  endif
  
@@ -5844,7 +7627,7 @@
  OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
  OTHER_CFLAGS += -DMOTIF_VERSION=2
  OTHER_CFLAGS += -DXMSTRINGDEFINES=1
-@@ -183,7 +183,11 @@ endif
+@@ -185,7 +185,11 @@
  # !HEADLESS
  
  OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \
@@ -5857,7 +7640,7 @@
  
  #
  # Sun CC with -Xa misdefines __STDC__ to 0 (zero).
-@@ -227,16 +231,33 @@ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGD
+@@ -229,16 +233,33 @@
          -I$(PLATFORM_SRC)/native/$(PKGDIR) \
          $(EVENT_MODEL)
  
@@ -5891,10 +7674,9 @@
  
  LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \
  	   $(AWT_RUNPATH)
-diff -upr ../orig/jdk/make/sun/font/Makefile ./jdk/make/sun/font/Makefile
---- ../orig/jdk/make/sun/font/Makefile	2009-01-27 15:44:42.000000000 -0500
-+++ ./jdk/make/sun/font/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -177,6 +177,15 @@ else # PLATFORM
+--- jdk/make/sun/font/Makefile	2010-06-21 14:15:08.000000000 -0700
++++ jdk/make/sun/font/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -177,6 +177,15 @@
  # Libraries to link, and other C flags.
  #
  
@@ -5910,7 +7692,7 @@
  ifeq ($(PLATFORM), solaris)
    # Note that on Solaris, fontmanager is built against the headless library.
    LDFLAGS      += -L$(LIBDIR)/$(LIBARCH)/headless
-@@ -187,6 +196,7 @@ else # PLATFORM is linux
+@@ -187,6 +196,7 @@
      OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
    endif                           
  endif
@@ -5918,10 +7700,9 @@
  
  endif # PLATFORM
  
-diff -upr ../orig/jdk/make/sun/image/generic/Makefile ./jdk/make/sun/image/generic/Makefile
---- ../orig/jdk/make/sun/image/generic/Makefile	2009-01-27 15:44:43.000000000 -0500
-+++ ./jdk/make/sun/image/generic/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -69,5 +69,9 @@ CPPFLAGS += \
+--- jdk/make/sun/image/generic/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/image/generic/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -69,5 +69,9 @@
              -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib 
  
  OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES
@@ -5932,10 +7713,9 @@
 +endif
 +
  
-diff -upr ../orig/jdk/make/sun/jawt/Makefile ./jdk/make/sun/jawt/Makefile
---- ../orig/jdk/make/sun/jawt/Makefile	2009-01-27 15:44:43.000000000 -0500
-+++ ./jdk/make/sun/jawt/Makefile	2009-05-05 08:50:43.000000000 -0400
-@@ -98,9 +98,7 @@ else # PLATFORM
+--- jdk/make/sun/jawt/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/jawt/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -98,9 +98,7 @@
  #
  # Other extra flags needed for compiling.
  #
@@ -5946,7 +7726,7 @@
              -I$(SHARE_SRC)/native/$(PKGDIR)/image \
  	    -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \
  	    -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \
-@@ -114,6 +112,8 @@ CPPFLAGS += -I$(OPENWIN_HOME)/include \
+@@ -114,6 +112,8 @@
  	    -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \
  	    -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \
              -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \
@@ -5955,7 +7735,7 @@
  	    $(EVENT_MODEL)
  #
  # Libraries to link in.
-@@ -122,7 +122,7 @@ ifeq ($(PLATFORM), solaris)
+@@ -122,7 +122,7 @@
  OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt
  endif # PLATFORM
  
@@ -5964,10 +7744,9 @@
  OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt
  endif # PLATFORM
  
-diff -upr ../orig/jdk/make/sun/security/jgss/wrapper/Makefile ./jdk/make/sun/security/jgss/wrapper/Makefile
---- ../orig/jdk/make/sun/security/jgss/wrapper/Makefile	2009-01-27 15:44:44.000000000 -0500
-+++ ./jdk/make/sun/security/jgss/wrapper/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -71,6 +71,10 @@ include $(BUILDDIR)/common/Library.gmk
+--- jdk/make/sun/security/jgss/wrapper/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/security/jgss/wrapper/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -71,6 +71,10 @@
  #
  # Libraries to link
  #
@@ -5979,10 +7758,9 @@
 +ifeq ($(PLATFORM), bsd)
 +  OTHER_LDLIBS = $(JVMLIB)
 +endif
-diff -upr ../orig/jdk/make/sun/security/pkcs11/Makefile ./jdk/make/sun/security/pkcs11/Makefile
---- ../orig/jdk/make/sun/security/pkcs11/Makefile	2009-01-27 15:44:44.000000000 -0500
-+++ ./jdk/make/sun/security/pkcs11/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -155,7 +155,7 @@ include $(BUILDDIR)/common/Library.gmk
+--- jdk/make/sun/security/pkcs11/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/security/pkcs11/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -155,7 +155,7 @@
  #
  # Libraries to link
  #
@@ -5991,10 +7769,9 @@
    OTHER_LDLIBS = $(JVMLIB)
  else
    OTHER_LDLIBS = -ldl $(JVMLIB)
-diff -upr ../orig/jdk/make/sun/security/smartcardio/Makefile ./jdk/make/sun/security/smartcardio/Makefile
---- ../orig/jdk/make/sun/security/smartcardio/Makefile	2009-01-27 15:44:44.000000000 -0500
-+++ ./jdk/make/sun/security/smartcardio/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -75,6 +75,10 @@ include $(BUILDDIR)/common/Library.gmk
+--- jdk/make/sun/security/smartcardio/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/security/smartcardio/Makefile	2010-06-20 21:56:16.000000000 -0700
+@@ -75,6 +75,10 @@
  ifeq ($(PLATFORM), windows)
    OTHER_LDLIBS = $(JVMLIB) winscard.lib
  else
@@ -6006,10 +7783,9 @@
 +  endif
    OTHER_CFLAGS = -D__sun_jdk
  endif
-diff -upr ../orig/jdk/make/sun/splashscreen/FILES_c.gmk ./jdk/make/sun/splashscreen/FILES_c.gmk
---- ../orig/jdk/make/sun/splashscreen/FILES_c.gmk	2009-01-27 15:44:45.000000000 -0500
-+++ ./jdk/make/sun/splashscreen/FILES_c.gmk	2009-05-04 17:37:15.000000000 -0400
-@@ -49,20 +49,6 @@ FILES_c = \
+--- jdk/make/sun/splashscreen/FILES_c.gmk	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/splashscreen/FILES_c.gmk	2010-06-20 21:56:17.000000000 -0700
+@@ -49,20 +49,6 @@
  	dgif_lib.c \
  	gif_err.c \
  	gifalloc.c \
@@ -6030,7 +7806,7 @@
  	jcomapi.c \
  	jdapimin.c \
  	jdapistd.c \
-@@ -108,3 +94,20 @@ FILES_c = \
+@@ -108,3 +94,20 @@
  	jfdctfst.c \
  	jfdctint.c
  
@@ -6051,10 +7827,9 @@
 +	zcrc32.c \
 +	zutil.c
 +endif
-diff -upr ../orig/jdk/make/sun/splashscreen/Makefile ./jdk/make/sun/splashscreen/Makefile
---- ../orig/jdk/make/sun/splashscreen/Makefile	2009-01-27 15:44:45.000000000 -0500
-+++ ./jdk/make/sun/splashscreen/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -61,10 +61,26 @@ JAVALIB=
+--- jdk/make/sun/splashscreen/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/splashscreen/Makefile	2010-06-20 21:56:17.000000000 -0700
+@@ -61,10 +61,26 @@
  
  CFLAGS += -DSPLASHSCREEN
  
@@ -6083,7 +7858,7 @@
  else # PLATFORM
    CFLAGS += -DWITH_WIN32
    OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib 
-@@ -77,14 +93,13 @@ endif # PLATFORM
+@@ -77,14 +93,13 @@
  vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/splashscreen
  vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)
  vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/giflib
@@ -6101,10 +7876,9 @@
  ifeq ($(PLATFORM), linux)
    ifeq ($(ARCH_DATA_MODEL), 64)
      # 64-bit gcc has problems compiling MMX instructions.
-diff -upr ../orig/jdk/make/sun/xawt/Makefile ./jdk/make/sun/xawt/Makefile
---- ../orig/jdk/make/sun/xawt/Makefile	2009-01-27 15:44:45.000000000 -0500
-+++ ./jdk/make/sun/xawt/Makefile	2009-05-04 17:37:15.000000000 -0400
-@@ -53,6 +53,11 @@ LDFLAGS += -lpthread
+--- jdk/make/sun/xawt/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/sun/xawt/Makefile	2010-06-20 21:56:17.000000000 -0700
+@@ -53,6 +53,11 @@
  dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
  endif
  
@@ -6116,7 +7890,7 @@
  # 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.
-@@ -86,7 +91,12 @@ vpath %.c   $(SHARE_SRC)/native/sun/java
+@@ -86,7 +91,12 @@
  vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/opengl
  vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/x11
  
@@ -6130,7 +7904,7 @@
                     $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
  
  ifeq  ($(PLATFORM), solaris)
-@@ -94,8 +104,6 @@ CPPFLAGS += -DFUNCPROTO=15
+@@ -94,8 +104,6 @@
  dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
  endif
  
@@ -6139,7 +7913,7 @@
  CPPFLAGS += -DXAWT -DXAWT_HACK \
          -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \
          -I$(PLATFORM_SRC)/native/sun/awt \
-@@ -122,9 +130,11 @@ CPPFLAGS += -DXAWT -DXAWT_HACK \
+@@ -122,9 +130,11 @@
          -I$(SHARE_SRC)/native/sun/awt \
          -I$(PLATFORM_SRC)/native/sun/awt 
  
@@ -6152,7 +7926,7 @@
                -I/usr/include/X11/extensions \
                -I$(MOTIF_DIR)/include \
                -I$(OPENWIN_HOME)/include 
-@@ -134,6 +144,14 @@ ifeq ($(PLATFORM), solaris)
+@@ -134,6 +144,14 @@
    CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions -I$(MOTIF_DIR)/include 
  endif
  
@@ -6167,10 +7941,9 @@
  ifeq ($(MILESTONE), internal)
    CPPFLAGS += -DINTERNAL_BUILD
  endif
-diff -upr ../orig/jdk/make/tools/freetypecheck/Makefile ./jdk/make/tools/freetypecheck/Makefile
---- ../orig/jdk/make/tools/freetypecheck/Makefile	2009-01-27 15:44:46.000000000 -0500
-+++ ./jdk/make/tools/freetypecheck/Makefile	2009-05-04 17:37:17.000000000 -0400
-@@ -60,8 +60,12 @@ else
+--- jdk/make/tools/freetypecheck/Makefile	2010-06-21 14:15:09.000000000 -0700
++++ jdk/make/tools/freetypecheck/Makefile	2010-06-20 21:56:17.000000000 -0700
+@@ -60,8 +60,12 @@
    #add runtime lib search path to ensure test will be runnable
    ifeq ($(PLATFORM), solaris)
      FT_OPTIONS += -R $(FT_LIB) -lfreetype
@@ -6185,11 +7958,10 @@
    endif
  endif
  
-diff -upr ../orig/jdk/src/share/back/commonRef.c ./jdk/src/share/back/commonRef.c
---- ../orig/jdk/src/share/back/commonRef.c	2009-01-27 15:44:50.000000000 -0500
-+++ ./jdk/src/share/back/commonRef.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/back/commonRef.c	2010-06-21 14:15:10.000000000 -0700
++++ jdk/src/share/back/commonRef.c	2010-06-20 21:56:17.000000000 -0700
 @@ -23,6 +23,10 @@
-  * have any questions.
+  * questions.
   */
  
 +#if defined(_ALLBSD_SOURCE)
@@ -6199,10 +7971,9 @@
  #include "util.h"
  #include "commonRef.h"
  
-diff -upr ../orig/jdk/src/share/bin/java.c ./jdk/src/share/bin/java.c
---- ../orig/jdk/src/share/bin/java.c	2009-01-27 15:44:50.000000000 -0500
-+++ ./jdk/src/share/bin/java.c	2009-05-04 17:37:17.000000000 -0400
-@@ -104,6 +104,11 @@ static char *progname;
+--- jdk/src/share/bin/java.c	2010-06-21 14:15:10.000000000 -0700
++++ jdk/src/share/bin/java.c	2010-06-20 21:56:17.000000000 -0700
+@@ -104,6 +104,11 @@
  static char *launchername;
  jboolean _launcher_debug = JNI_FALSE;
  
@@ -6214,7 +7985,7 @@
  /*
   * Entries for splash screen environment variables.
   * putenv is performed in SelectVersion. We need
-@@ -146,6 +151,10 @@ static void PrintUsage(JNIEnv* env, jboo
+@@ -146,6 +151,10 @@
  static void SetPaths(int argc, char **argv);
  
  
@@ -6225,7 +7996,7 @@
  /* Maximum supported entries from jvm.cfg. */
  #define INIT_MAX_KNOWN_VMS      10
  /* Values for vmdesc.flag */
-@@ -184,13 +193,13 @@ static jlong threadStackSize = 0;  /* st
+@@ -184,13 +193,13 @@
  
  int JNICALL JavaMain(void * args); /* entry point                  */
  
@@ -6241,7 +8012,7 @@
  
  /*
   * Entry point.
-@@ -332,49 +341,24 @@ main(int argc, char ** argv)
+@@ -332,49 +341,24 @@
      /* Show the splash screen if needed */
      ShowSplashScreen();
  
@@ -6300,7 +8071,7 @@
      int argc = args->argc;
      char **argv = args->argv;
      char *jarfile = args->jarfile;
-@@ -1159,6 +1143,10 @@ ParseArguments(int *pargc, char ***pargv
+@@ -1159,6 +1143,10 @@
          } else if (strcmp(arg, "-X") == 0) {
              printXUsage = JNI_TRUE;
              return JNI_TRUE;
@@ -6311,7 +8082,7 @@
  /*
   * The following case provide backward compatibility with old-style
   * command line options.
-@@ -1979,6 +1967,84 @@ KnownVMIndex(const char* name)
+@@ -1979,6 +1967,84 @@
      return -1;
  }
  
@@ -6396,10 +8167,9 @@
  static void
  FreeKnownVMs()
  {
-diff -upr ../orig/jdk/src/share/bin/java.h ./jdk/src/share/bin/java.h
---- ../orig/jdk/src/share/bin/java.h	2009-01-27 15:44:50.000000000 -0500
-+++ ./jdk/src/share/bin/java.h	2009-05-04 17:37:17.000000000 -0400
-@@ -91,11 +91,17 @@ jboolean RemovableMachineDependentOption
+--- jdk/src/share/bin/java.h	2010-06-21 14:15:10.000000000 -0700
++++ jdk/src/share/bin/java.h	2010-06-20 21:56:17.000000000 -0700
+@@ -91,11 +91,17 @@
  void PrintMachineDependentOptions();
  
  const char *jlong_format_specifier();
@@ -6419,10 +8189,9 @@
  
  /* sun.java.launcher.* platform properties. */
  void SetJavaLauncherPlatformProps(void);
-diff -upr ../orig/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java
---- ../orig/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	2009-01-27 15:44:52.000000000 -0500
-+++ ./jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	2009-05-04 17:37:16.000000000 -0400
-@@ -477,6 +477,10 @@ class Metacity implements SynthConstants
+--- jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	2010-06-21 14:15:11.000000000 -0700
++++ jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	2010-06-20 21:56:17.000000000 -0700
+@@ -477,6 +477,10 @@
                  String[] dirs = new String[] {
                      userHome + sep + ".themes",
                      System.getProperty("swing.metacitythemedir"),
@@ -6433,10 +8202,9 @@
                      "/usr/share/themes",
                      "/usr/gnome/share/themes",  // Debian/Redhat/Solaris
                      "/opt/gnome2/share/themes"  // SuSE
-diff -upr ../orig/jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java ./jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java
---- ../orig/jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java	2009-01-27 15:44:56.000000000 -0500
-+++ ./jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java	2009-05-04 17:37:16.000000000 -0400
-@@ -78,6 +78,9 @@ public class SnmpPduTrap extends SnmpPdu
+--- jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java	2010-06-21 14:15:13.000000000 -0700
++++ jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java	2010-06-20 21:56:17.000000000 -0700
+@@ -78,6 +78,9 @@
       */
      public long            timeStamp ;
  
@@ -6446,10 +8214,37 @@
  
  
      /**
-diff -upr ../orig/jdk/src/share/classes/java/awt/GraphicsEnvironment.java ./jdk/src/share/classes/java/awt/GraphicsEnvironment.java
---- ../orig/jdk/src/share/classes/java/awt/GraphicsEnvironment.java	2009-01-27 15:45:05.000000000 -0500
-+++ ./jdk/src/share/classes/java/awt/GraphicsEnvironment.java	2009-05-04 17:37:16.000000000 -0400
-@@ -148,7 +148,12 @@ public abstract class GraphicsEnvironmen
+--- jdk/src/share/classes/java/awt/Font.java	2010-06-21 14:15:16.000000000 -0700
++++ jdk/src/share/classes/java/awt/Font.java	2010-06-20 21:56:17.000000000 -0700
+@@ -445,18 +445,19 @@
+      */
+     private AttributeValues getAttributeValues() {
+         if (values == null) {
+-            values = new AttributeValues();
+-            values.setFamily(name);
+-            values.setSize(pointSize); // expects the float value.
++            AttributeValues valuesTmp = new AttributeValues();
++            valuesTmp.setFamily(name);
++            valuesTmp.setSize(pointSize); // expects the float value.
+ 
+             if ((style & BOLD) != 0) {
+-                values.setWeight(2); // WEIGHT_BOLD
++                valuesTmp.setWeight(2); // WEIGHT_BOLD
+             }
+ 
+             if ((style & ITALIC) != 0) {
+-                values.setPosture(.2f); // POSTURE_OBLIQUE
++                valuesTmp.setPosture(.2f); // POSTURE_OBLIQUE
+             }
+-            values.defineAll(PRIMARY_MASK); // for streaming compatibility
++            valuesTmp.defineAll(PRIMARY_MASK); // for streaming compatibility
++            values = valuesTmp;
+         }
+ 
+         return values;
+--- jdk/src/share/classes/java/awt/GraphicsEnvironment.java	2010-06-21 14:15:16.000000000 -0700
++++ jdk/src/share/classes/java/awt/GraphicsEnvironment.java	2010-06-20 21:56:17.000000000 -0700
+@@ -148,7 +148,12 @@
                          } else {
                              String osName = System.getProperty("os.name");
                              headless = defaultHeadless =
@@ -6463,10 +8258,9 @@
                                                  (System.getenv("DISPLAY") == null));
                          }
                      } else if (nm.equals("true")) {
-diff -upr ../orig/jdk/src/share/classes/java/util/TimeZone.java ./jdk/src/share/classes/java/util/TimeZone.java
---- ../orig/jdk/src/share/classes/java/util/TimeZone.java	2009-01-27 15:45:18.000000000 -0500
-+++ ./jdk/src/share/classes/java/util/TimeZone.java	2009-05-04 17:37:16.000000000 -0400
-@@ -779,15 +779,13 @@ abstract public class TimeZone implement
+--- jdk/src/share/classes/java/util/TimeZone.java	2010-06-21 14:15:21.000000000 -0700
++++ jdk/src/share/classes/java/util/TimeZone.java	2010-06-20 21:56:17.000000000 -0700
+@@ -776,15 +776,13 @@
          }
          int gmtOffset =  (hours * 60 + num) * 60 * 1000;
  
@@ -6483,10 +8277,9 @@
          }
          return zi;
      }
-diff -upr ../orig/jdk/src/share/classes/sun/awt/FontConfiguration.java ./jdk/src/share/classes/sun/awt/FontConfiguration.java
---- ../orig/jdk/src/share/classes/sun/awt/FontConfiguration.java	2009-01-27 15:45:29.000000000 -0500
-+++ ./jdk/src/share/classes/sun/awt/FontConfiguration.java	2009-05-04 17:37:16.000000000 -0400
-@@ -1073,7 +1073,7 @@ public abstract class FontConfiguration 
+--- jdk/src/share/classes/sun/awt/FontConfiguration.java	2010-06-21 14:15:27.000000000 -0700
++++ jdk/src/share/classes/sun/awt/FontConfiguration.java	2010-06-20 21:56:17.000000000 -0700
+@@ -1073,7 +1073,7 @@
       */
      HashMap<String, Boolean> existsMap;
      public boolean needToSearchForFile(String fileName) {
@@ -6495,7 +8288,7 @@
              return false;
          } else if (existsMap == null) {
             existsMap = new HashMap<String, Boolean>();
-@@ -1309,7 +1309,7 @@ public abstract class FontConfiguration 
+@@ -1309,7 +1309,7 @@
                                     + "<filename."
                                     + getString(table_componentFontNameIDs[ii])
                                     + "> entry is missing!!!");
@@ -6504,10 +8297,121 @@
                      errors++;
                  }
              }
-diff -upr ../orig/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java ./jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java
---- ../orig/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	2009-01-27 15:45:30.000000000 -0500
-+++ ./jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	2009-05-04 17:37:16.000000000 -0400
-@@ -76,7 +76,7 @@ import sun.font.NativeFont;
+--- jdk/src/share/classes/sun/font/TrueTypeFont.java	2010-06-21 14:15:28.000000000 -0700
++++ jdk/src/share/classes/sun/font/TrueTypeFont.java	2010-06-20 21:56:17.000000000 -0700
+@@ -159,6 +159,13 @@
+     private boolean supportsJA;
+     private boolean supportsCJK;
+ 
++    /* These are for faster access to the name of the font as
++     * typically exposed via API to applications.
++     */
++    private Locale nameLocale;
++    private String localeFamilyName;
++    private String localeFullName;
++
+     /**
+      * - does basic verification of the file
+      * - reads the header table for this font (within a collection)
+@@ -1058,6 +1065,10 @@
+              * greater than 32767, so read and store those as ints
+              */
+             int stringPtr = sbuffer.get() & 0xffff;
++
++            nameLocale = sun.awt.SunToolkit.getStartupLocale();
++            short nameLocaleID = FontManager.getLCIDFromLocale(nameLocale);
++
+             for (int i=0; i<numRecords; i++) {
+                 short platformID = sbuffer.get();
+                 if (platformID != MS_PLATFORM_ID) {
+@@ -1069,15 +1080,24 @@
+                 short nameID     = sbuffer.get();
+                 int nameLen    = ((int) sbuffer.get()) & 0xffff;
+                 int namePtr    = (((int) sbuffer.get()) & 0xffff) + stringPtr;
+-
++                String tmpName = null;
+                 switch (nameID) {
+ 
+                 case FAMILY_NAME_ID:
+ 
+-                    if (familyName == null || langID == ENGLISH_LOCALE_ID) {
++                    if (familyName == null || langID == ENGLISH_LOCALE_ID ||
++                        langID == nameLocaleID)
++                    {
+                         buffer.position(namePtr);
+                         buffer.get(name, 0, nameLen);
+-                        familyName = makeString(name, nameLen, encodingID);
++                        tmpName = makeString(name, nameLen, encodingID);
++
++                        if (familyName == null || langID == ENGLISH_LOCALE_ID){
++                            familyName = tmpName;
++                        }
++                        if (langID == nameLocaleID) {
++                            localeFamilyName = tmpName;
++                        }
+                     }
+ /*
+                     for (int ii=0;ii<nameLen;ii++) {
+@@ -1095,15 +1115,29 @@
+ 
+                 case FULL_NAME_ID:
+ 
+-                    if (fullName == null || langID == ENGLISH_LOCALE_ID) {
++                    if (fullName == null || langID == ENGLISH_LOCALE_ID ||
++                        langID == nameLocaleID)
++                    {
+                         buffer.position(namePtr);
+                         buffer.get(name, 0, nameLen);
+-                        fullName = makeString(name, nameLen, encodingID);
++                        tmpName = makeString(name, nameLen, encodingID);
++
++                        if (fullName == null || langID == ENGLISH_LOCALE_ID) {
++                            fullName = tmpName;
++                        }
++                        if (langID == nameLocaleID) {
++                            localeFullName = tmpName;
++                        }
+                     }
+                     break;
+-
+                 }
+             }
++            if (localeFamilyName == null) {
++                localeFamilyName = familyName;
++            }
++            if (localeFullName == null) {
++                localeFullName = fullName;
++            }
+         }
+     }
+ 
+@@ -1186,6 +1220,8 @@
+     public String getFontName(Locale locale) {
+         if (locale == null) {
+             return fullName;
++        } else if (locale.equals(nameLocale) && localeFullName != null) {
++            return localeFullName;
+         } else {
+             short localeID = FontManager.getLCIDFromLocale(locale);
+             String name = lookupName(localeID, FULL_NAME_ID);
+@@ -1200,11 +1236,13 @@
+     public String getFamilyName(Locale locale) {
+         if (locale == null) {
+             return familyName;
++        } else if (locale.equals(nameLocale) && localeFamilyName != null) {
++            return localeFamilyName;
+         } else {
+             short localeID = FontManager.getLCIDFromLocale(locale);
+             String name = lookupName(localeID, FAMILY_NAME_ID);
+             if (name == null) {
+-                return familyName;
++               return familyName;
+             } else {
+                 return name;
+             }
+--- jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	2010-06-21 14:15:29.000000000 -0700
++++ jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	2010-06-20 21:56:17.000000000 -0700
+@@ -76,7 +76,7 @@
  public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
      implements FontSupport, DisplayChangedListener {
  
@@ -6516,7 +8420,7 @@
      public static boolean isSolaris;
      public static boolean isWindows;
      public static boolean noType1Font;
-@@ -164,7 +164,15 @@ public abstract class SunGraphicsEnviron
+@@ -164,7 +164,15 @@
              public Object run() {
                  String osName = System.getProperty("os.name");
                  if ("Linux".equals(osName)) {
@@ -6533,7 +8437,7 @@
                  } else if ("SunOS".equals(osName)) {
                      isSolaris = true;
                  } else if ("Windows".equals(osName)) {
-@@ -227,8 +235,8 @@ public abstract class SunGraphicsEnviron
+@@ -227,8 +235,8 @@
                   * Pass "true" to registerFonts method as on-screen these
                   * JRE fonts always go through the T2K rasteriser.
                   */
@@ -6544,10 +8448,9 @@
                      registerFontDir(jreFontDirName);
                  }
                  registerFontsInDir(jreFontDirName, true, Font2D.JRE_RANK,
-diff -upr ../orig/jdk/src/share/classes/sun/print/PSPrinterJob.java ./jdk/src/share/classes/sun/print/PSPrinterJob.java
---- ../orig/jdk/src/share/classes/sun/print/PSPrinterJob.java	2009-01-27 15:45:34.000000000 -0500
-+++ ./jdk/src/share/classes/sun/print/PSPrinterJob.java	2009-05-04 17:37:16.000000000 -0400
-@@ -1531,7 +1531,9 @@ public class PSPrinterJob extends Raster
+--- jdk/src/share/classes/sun/print/PSPrinterJob.java	2010-06-21 14:15:33.000000000 -0700
++++ jdk/src/share/classes/sun/print/PSPrinterJob.java	2010-06-20 21:56:27.000000000 -0700
+@@ -1531,7 +1531,9 @@
              pFlags |= NOSHEET;
              ncomps+=1;
          }
@@ -6558,38 +8461,105 @@
              execCmd = new String[ncomps];
              execCmd[n++] = "/usr/bin/lpr";
              if ((pFlags & PRINTER) != 0) {
-diff -upr ../orig/jdk/src/share/classes/sun/tools/jar/Main.java ./jdk/src/share/classes/sun/tools/jar/Main.java
---- ../orig/jdk/src/share/classes/sun/tools/jar/Main.java	2009-01-27 15:45:40.000000000 -0500
-+++ ./jdk/src/share/classes/sun/tools/jar/Main.java	2009-05-04 17:37:17.000000000 -0400
-@@ -46,6 +46,7 @@ class Main {
+--- jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java	2010-06-21 14:15:34.000000000 -0700
++++ jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java	2010-06-20 21:56:27.000000000 -0700
+@@ -49,8 +49,12 @@
+             AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+                     public Boolean run() {
+                             String osname = System.getProperty("os.name");
+-                            if (osname.startsWith("SunOS") ||
+-                                osname.startsWith("Linux")) {
++                            if (osname.startsWith("SunOS")
++                                    || osname.startsWith("Linux")
++                                    || osname.startsWith("FreeBSD")
++                                    || osname.startsWith("NetBSD")
++                                    || osname.startsWith("OpenBSD")
++                                    || osname.startsWith("Darwin")) {
+                                 return new Boolean(System.getProperty
+                                     (USE_NATIVE_PROP));
+                             }
+--- jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java	2010-06-21 14:15:34.000000000 -0700
++++ jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java	2010-06-20 21:56:27.000000000 -0700
+@@ -82,7 +82,11 @@
+                             String osname = System.getProperty("os.name");
+                             if (osname.startsWith("SunOS")) {
+                                 gssLib = "libgss.so";
+-                            } else if (osname.startsWith("Linux")) {
++                            } else if (osname.startsWith("Linux")
++                                    || osname.startsWith("FreeBSD")
++                                    || osname.startsWith("NetBSD")
++                                    || osname.startsWith("OpenBSD")
++                                    || osname.startsWith("Darwin")) {
+                                 gssLib = "libgssapi.so";
+                             }
+                         }
+--- jdk/src/share/classes/sun/security/krb5/Config.java	2010-06-21 14:15:34.000000000 -0700
++++ jdk/src/share/classes/sun/security/krb5/Config.java	2010-06-20 21:56:27.000000000 -0700
+@@ -711,7 +711,11 @@
+                     }
+                 } else if (osname.startsWith("SunOS")) {
+                     name =  "/etc/krb5/krb5.conf";
+-                } else if (osname.startsWith("Linux")) {
++                } else if (osname.startsWith("Linux")
++                        || osname.startsWith("FreeBSD")
++                        || osname.startsWith("NetBSD")
++                        || osname.startsWith("OpenBSD")
++                        || osname.startsWith("Darwin")) {
+                     name =  "/etc/krb5.conf";
+                 }
+             }
+--- jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	2010-06-21 14:15:34.000000000 -0700
++++ jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java	2010-06-20 21:56:27.000000000 -0700
+@@ -383,8 +383,12 @@
+             String uidStr = null;
+             long uid = 0;
+ 
+-            if (osname.startsWith("SunOS") ||
+-                (osname.startsWith("Linux"))) {
++            if (osname.startsWith("SunOS")
++                    || osname.startsWith("Linux")
++                    || osname.startsWith("FreeBSD")
++                    || osname.startsWith("NetBSD")
++                    || osname.startsWith("OpenBSD")
++                    || osname.startsWith("Darwin")) {
+                 try {
+                     Class<?> c = Class.forName
+                         ("com.sun.security.auth.module.UnixSystem");
+--- jdk/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider	2010-06-21 14:15:36.000000000 -0700
++++ jdk/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider	2010-06-20 21:56:27.000000000 -0700
+@@ -30,3 +30,4 @@
+ #[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	2010-06-21 14:15:37.000000000 -0700
++++ jdk/src/share/classes/sun/tools/jar/Main.java	2010-06-20 21:56:27.000000000 -0700
+@@ -48,6 +48,7 @@
      String zname = "";
      String[] files;
      String rootjar = null;
 +    String cwd;
-     Hashtable filesTable = new Hashtable();
-     Vector paths = new Vector();
-     Vector v;
-@@ -770,6 +771,19 @@ class Main {
-      * Extracts specified entries from JAR file.
-      */
-     void extract(InputStream in, String files[]) throws IOException {
-+        // Current working directory
-+
-+        cwd = System.getProperty("user.dir");
-+        if (cwd == null) {
-+            fatalError(getMsg("error.no.cwd"));
-+        }
-+        cwd = (new File(cwd)).getCanonicalPath();
-+        if (!cwd.endsWith(File.separator)) {
-+            cwd += File.separator;
-+        }
-+
-+        // Extract the files
-+
-         ZipInputStream zis = new ZipInputStream(in);
-         ZipEntry e;
-         // Set of all directory entries specified in archive.  Dissallows
-@@ -817,6 +831,10 @@ class Main {
+ 
+     // An entryName(path)->File map generated during "expand", it helps to
+     // decide whether or not an existing entry in a jar file needs to be
+@@ -249,6 +250,16 @@
+                     }
+                 }
+             } else if (xflag) {
++                // Current working directory
++                cwd = System.getProperty("user.dir");
++                if (cwd == null) {
++                    fatalError(getMsg("error.no.cwd"));
++                }
++                cwd = (new File(cwd)).getCanonicalPath();
++                if (!cwd.endsWith(File.separator)) {
++                    cwd += File.separator;
++                }
++                // Extract the files
+                 replaceFSC(files);
+                 if (fname != null && files != null) {
+                     extract(fname, files);
+@@ -921,6 +932,10 @@
          ZipEntry rc = null;
          String name = e.getName();
          File f = new File(e.getName().replace('/', File.separatorChar));
@@ -6600,7 +8570,7 @@
          if (e.isDirectory()) {
              if (f.exists()) {
                  if (!f.isDirectory()) {
-@@ -838,6 +856,10 @@ class Main {
+@@ -942,6 +957,10 @@
          } else {
              if (f.getParent() != null) {
                  File d = new File(f.getParent());
@@ -6611,10 +8581,9 @@
                  if (!d.exists() && !d.mkdirs() || !d.isDirectory()) {
                      throw new IOException(formatMsg(
                          "error.create.dir", d.getPath()));
-diff -upr ../orig/jdk/src/share/classes/sun/tools/jar/resources/jar.properties ./jdk/src/share/classes/sun/tools/jar/resources/jar.properties
---- ../orig/jdk/src/share/classes/sun/tools/jar/resources/jar.properties	2009-01-27 15:45:40.000000000 -0500
-+++ ./jdk/src/share/classes/sun/tools/jar/resources/jar.properties	2009-05-04 17:37:16.000000000 -0400
-@@ -44,6 +44,8 @@ error.create.dir=\
+--- jdk/src/share/classes/sun/tools/jar/resources/jar.properties	2010-06-21 14:15:37.000000000 -0700
++++ jdk/src/share/classes/sun/tools/jar/resources/jar.properties	2010-06-20 21:56:27.000000000 -0700
+@@ -44,6 +44,8 @@
          {0} : could not create directory
  error.incorrect.length=\
          incorrect length while processing: {0}
@@ -6623,10 +8592,9 @@
  out.added.manifest=\
          added manifest
  out.update.manifest=\
-diff -upr ../orig/jdk/src/share/hpi/include/hpi_impl.h ./jdk/src/share/hpi/include/hpi_impl.h
---- ../orig/jdk/src/share/hpi/include/hpi_impl.h	2009-01-27 15:45:43.000000000 -0500
-+++ ./jdk/src/share/hpi/include/hpi_impl.h	2009-05-04 17:37:16.000000000 -0400
-@@ -138,7 +138,11 @@ int sysConnect(int fd, struct sockaddr *
+--- jdk/src/share/hpi/include/hpi_impl.h	2010-06-21 14:15:39.000000000 -0700
++++ jdk/src/share/hpi/include/hpi_impl.h	2010-06-20 21:56:27.000000000 -0700
+@@ -138,7 +138,11 @@
  int sysBind(int fd, struct sockaddr *him, int len);
  int sysAccept(int fd, struct sockaddr *him, int *len);
  int sysGetSockName(int fd, struct sockaddr *him, int *len);
@@ -6639,28 +8607,8 @@
  ssize_t sysSendTo(int fd, char *buf, int len, int flags, struct sockaddr *to,
                int tolen);
  ssize_t sysRecvFrom(int fd, char *buf, int nbytes, int flags,
-diff -upr ../orig/jdk/src/share/lib/security/java.security-openbsd ./jdk/src/share/lib/security/java.security-openbsd
---- ../orig/jdk/src/share/lib/security/java.security-openbsd	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/src/share/lib/security/java.security-openbsd	2009-05-05 09:50:18.000000000 -0400
-@@ -66,7 +66,14 @@ security.provider.8=sun.security.smartca
- # On Windows systems, the URLs file:/dev/random and file:/dev/urandom
- # enables use of the Microsoft CryptoAPI seed functionality.
- #
--securerandom.source=file:/dev/urandom
-+# On OpenBSD use file:///dev/srandom for strong but blocking random
-+# generator, file:/dev/random for hardware random generators,
-+# file:///dev/arandom for non-blocking high-quality pseudo-random
-+# data and file:///dev/urandom for non-blocking random data that
-+# does not guarantee the data to be strong. See random(4) for more
-+# info.
-+#
-+securerandom.source=file:///dev/arandom
- #
- # The entropy gathering device is described as a URL and can also
- # be specified with the system property "java.security.egd". For example,
-diff -upr ../orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h ./jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
---- ../orig/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/com/sun/java/util/jar/pack/defines.h	2010-06-20 21:56:27.000000000 -0700
 @@ -32,6 +32,10 @@
  #include <unistd.h>
  #endif
@@ -6672,7 +8620,7 @@
  #ifndef FULL
  #define FULL 1 /* Adds <500 bytes to the zipped final product. */
  #endif
-@@ -89,11 +93,13 @@ extern void assert_failed(const char*);
+@@ -89,11 +93,13 @@
  // bytes and byte arrays
  
  typedef unsigned int uint;
@@ -6686,9 +8634,8 @@
  #ifdef _MSC_VER
  typedef LONGLONG        jlong;
  typedef DWORDLONG       julong;
-diff -upr ../orig/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp ./jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
---- ../orig/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp	2010-06-20 21:56:27.000000000 -0700
 @@ -33,9 +33,14 @@
  #include <limits.h>
  #include <time.h>
@@ -6705,7 +8652,7 @@
  #endif
  
  #include "defines.h"
-@@ -58,9 +63,9 @@ int main(int argc, char **argv) {
+@@ -58,9 +63,9 @@
  // Single-threaded, implementation, not reentrant.
  // Includes a weak error check against MT access.
  #ifndef THREAD_SELF
@@ -6717,7 +8664,7 @@
  
  unpacker* unpacker::non_mt_current = null;
  unpacker* unpacker::current() {
-@@ -69,7 +74,7 @@ unpacker* unpacker::current() {
+@@ -69,7 +74,7 @@
  }
  static void set_current_unpacker(unpacker* u) {
    unpacker::non_mt_current = u;
@@ -6726,9 +8673,8 @@
            true));
  }
  
-diff -upr ../orig/jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c ./jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c
---- ../orig/jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/com/sun/media/sound/DirectAudioDevice.c	2010-06-20 21:56:27.000000000 -0700
 @@ -33,7 +33,11 @@
  
  #include <jni.h>
@@ -6741,10 +8687,9 @@
  #include "SoundDefs.h"
  #include "DirectAudio.h"
  #include "Utilities.h"
-diff -upr ../orig/jdk/src/share/native/com/sun/media/sound/Platform.c ./jdk/src/share/native/com/sun/media/sound/Platform.c
---- ../orig/jdk/src/share/native/com/sun/media/sound/Platform.c	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/com/sun/media/sound/Platform.c	2009-05-04 17:37:16.000000000 -0400
-@@ -99,5 +99,17 @@ JNIEXPORT jint JNICALL Java_com_sun_medi
+--- jdk/src/share/native/com/sun/media/sound/Platform.c	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/com/sun/media/sound/Platform.c	2010-06-20 21:56:27.000000000 -0700
+@@ -99,5 +99,17 @@
          return com_sun_media_sound_Platform_LIB_ALSA;
      }
  #endif
@@ -6762,9 +8707,8 @@
 +#endif
      return 0;
  }
-diff -upr ../orig/jdk/src/share/native/com/sun/media/sound/SoundDefs.h ./jdk/src/share/native/com/sun/media/sound/SoundDefs.h
---- ../orig/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/com/sun/media/sound/SoundDefs.h	2010-06-20 21:56:27.000000000 -0700
 @@ -31,6 +31,7 @@
  #define X_WINDOWS       1
  #define X_SOLARIS       2
@@ -6773,7 +8717,7 @@
  
  // types for X_ARCH
  #define X_I586          1
-@@ -49,7 +50,7 @@
+@@ -50,7 +51,7 @@
  
  
  // following is needed for _LP64
@@ -6782,7 +8726,7 @@
  #include <sys/types.h>
  #endif
  
-@@ -129,4 +130,9 @@ typedef char            SBYTE;
+@@ -130,4 +131,9 @@
  #endif
  
  
@@ -6792,10 +8736,9 @@
 +
 +
  #endif  // __SOUNDDEFS_INCLUDED__
-diff -upr ../orig/jdk/src/share/native/common/check_code.c ./jdk/src/share/native/common/check_code.c
---- ../orig/jdk/src/share/native/common/check_code.c	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/common/check_code.c	2009-05-04 17:37:17.000000000 -0400
-@@ -1069,7 +1069,7 @@ verify_method(context_type *context, jcl
+--- jdk/src/share/native/common/check_code.c	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/common/check_code.c	2010-06-20 21:56:27.000000000 -0700
+@@ -1069,7 +1069,7 @@
   * Make sure that branches don't go into the middle of nowhere.
   */
  
@@ -6804,7 +8747,7 @@
  {
      unsigned char *p = (unsigned char *)&n;
      return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
-@@ -1148,26 +1148,26 @@ verify_opcode_operands(context_type *con
+@@ -1148,26 +1148,26 @@
              }
          }
          if (opcode == opc_tableswitch) {
@@ -6838,7 +8781,7 @@
              if (!isLegalTarget(context, target))
                  CCerror(context, "Illegal branch in opc_tableswitch");
              saved_operand[k + 1] = code_data[target];
-@@ -1615,7 +1615,7 @@ static int instruction_length(unsigned c
+@@ -1615,7 +1615,7 @@
              if (lpc + 2 >= (int *)end) {
                  return -1; /* do not read pass the end */
              }
@@ -6847,7 +8790,7 @@
              if ((index < 0) || (index > 65535)) {
                  return -1;      /* illegal */
              } else {
-@@ -1628,7 +1628,7 @@ static int instruction_length(unsigned c
+@@ -1628,7 +1628,7 @@
              int npairs;
              if (lpc + 1 >= (int *)end)
                  return -1; /* do not read pass the end */
@@ -6856,9 +8799,8 @@
              /* There can't be more than 64K labels because of the limit
               * on per-method byte code length.
               */
-diff -upr ../orig/jdk/src/share/native/java/io/io_util.h ./jdk/src/share/native/java/io/io_util.h
---- ../orig/jdk/src/share/native/java/io/io_util.h	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/java/io/io_util.h	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/java/io/io_util.h	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/java/io/io_util.h	2010-06-20 21:56:27.000000000 -0700
 @@ -29,7 +29,15 @@
  extern jfieldID IO_fd_fdID;
  extern jfieldID IO_handle_fdID;
@@ -6876,11 +8818,10 @@
  #define O_SYNC  (0x0800)
  #define O_DSYNC (0x2000)
  #endif
-diff -upr ../orig/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h ./jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h
---- ../orig/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h	2010-06-20 21:56:27.000000000 -0700
 @@ -25,6 +25,10 @@
-  * have any questions.
+  * questions.
   */
  
 +#ifdef __OpenBSD__
@@ -6904,9 +8845,8 @@
  
  /*
   * ANSI/POSIX
-diff -upr ../orig/jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h ./jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h
---- ../orig/jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h	2010-06-20 21:56:27.000000000 -0700
 @@ -61,7 +61,7 @@
  #define log1p   jlog1p
  #define expm1   jexpm1
@@ -6916,23 +8856,22 @@
  #define __ieee754_sqrt          __j__ieee754_sqrt
  #define __ieee754_acos          __j__ieee754_acos
  #define __ieee754_acosh         __j__ieee754_acosh
-diff -upr ../orig/jdk/src/share/native/java/util/zip/Inflater.c ./jdk/src/share/native/java/util/zip/Inflater.c
---- ../orig/jdk/src/share/native/java/util/zip/Inflater.c	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/java/util/zip/Inflater.c	2009-05-04 17:37:16.000000000 -0400
-@@ -67,6 +67,10 @@ Java_java_util_zip_Inflater_init(JNIEnv 
-         return jlong_zero;
+--- jdk/src/share/native/java/util/zip/Inflater.c	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/java/util/zip/Inflater.c	2010-06-20 21:56:27.000000000 -0700
+@@ -65,6 +65,10 @@
+ 	return jlong_zero;
      } else {
-         char *msg;
+ 	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);
-@@ -202,6 +206,10 @@ Java_java_util_zip_Inflater_reset(JNIEnv
-     if (inflateReset(jlong_to_ptr(strm)) != Z_OK) {
-         JNU_ThrowInternalError(env, 0);
+ 	switch (inflateInit2(strm, nowrap ? -MAX_WBITS : MAX_WBITS)) {
+ 	  case Z_OK:
+ 	    return ptr_to_jlong(strm);
+@@ -197,6 +201,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
@@ -6941,9 +8880,8 @@
  }
  
  JNIEXPORT void JNICALL
-diff -upr ../orig/jdk/src/share/native/java/util/zip/zlib-1.1.3/zconf.h ./jdk/src/share/native/java/util/zip/zlib-1.1.3/zconf.h
---- ../orig/jdk/src/share/native/java/util/zip/zlib-1.1.3/zconf.h	2009-01-27 15:45:44.000000000 -0500
-+++ ./jdk/src/share/native/java/util/zip/zlib-1.1.3/zconf.h	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/java/util/zip/zlib-1.1.3/zconf.h	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/java/util/zip/zlib-1.1.3/zconf.h	2010-06-20 21:56:27.000000000 -0700
 @@ -42,44 +42,49 @@
  /* for _LP64 */
  #include <sys/types.h>
@@ -7027,10 +8965,9 @@
  #endif
  
  #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-diff -upr ../orig/jdk/src/share/native/sun/awt/debug/debug_util.h ./jdk/src/share/native/sun/awt/debug/debug_util.h
---- ../orig/jdk/src/share/native/sun/awt/debug/debug_util.h	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/debug/debug_util.h	2009-05-04 17:37:16.000000000 -0400
-@@ -50,7 +50,9 @@ typedef void * dmutex_t;
+--- jdk/src/share/native/sun/awt/debug/debug_util.h	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/sun/awt/debug/debug_util.h	2010-06-20 21:56:27.000000000 -0700
+@@ -50,7 +50,9 @@
  #include <stdio.h>
  #include <string.h>
  #include <assert.h>
@@ -7040,9 +8977,8 @@
  #include <limits.h>
  
  /* keep these after the other headers */
-diff -upr ../orig/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c ./jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c
---- ../orig/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c	2010-06-20 21:56:27.000000000 -0700
 @@ -24,7 +24,11 @@
   */
  
@@ -7055,11 +8991,10 @@
  
  #include "sun_awt_image_BufImgSurfaceData.h"
  
-diff -upr ../orig/jdk/src/share/native/sun/awt/image/DataBufferNative.c ./jdk/src/share/native/sun/awt/image/DataBufferNative.c
---- ../orig/jdk/src/share/native/sun/awt/image/DataBufferNative.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/image/DataBufferNative.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/image/DataBufferNative.c	2010-06-21 14:15:40.000000000 -0700
++++ jdk/src/share/native/sun/awt/image/DataBufferNative.c	2010-06-20 21:56:27.000000000 -0700
 @@ -23,7 +23,11 @@
-  * have any questions.
+  * questions.
   */
  
 +#ifdef _ALLBSD_SOURCE
@@ -7070,10 +9005,9 @@
  
  #include "SurfaceData.h"
  #include "sun_awt_image_DataBufferNative.h"
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c	2009-05-04 17:37:16.000000000 -0400
-@@ -86,7 +86,7 @@ typedef struct {
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv2x2_f.c	2010-06-20 21:56:27.000000000 -0700
+@@ -86,7 +86,7 @@
  #endif /* MLIB_USE_FTOI_CLAMPING */
  
  /***************************************************************/
@@ -7082,7 +9016,7 @@
  
  /* NB: Explicit cast to DTYPE is necessary to avoid warning from Microsoft VC compiler.
        And we need to explicitly define cast behavior if source exceeds destination range.
-@@ -103,7 +103,7 @@ typedef struct {
+@@ -103,7 +103,7 @@
    dp[0    ] = (DTYPE) ((res0) & DTYPE_MASK);                      \
    dp[chan1] = (DTYPE) ((res1) & DTYPE_MASK)
  
@@ -7091,7 +9025,7 @@
  
  /***************************************************************/
  #ifdef _NO_LONGLONG
-@@ -114,17 +114,17 @@ typedef struct {
+@@ -114,17 +114,17 @@
  
  #else /* _NO_LONGLONG */
  
@@ -7112,9 +9046,8 @@
  
  #endif /* _NO_LONGLONG */
  
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16ext.c	2010-06-20 21:56:27.000000000 -0700
 @@ -126,7 +126,7 @@
  #define D2I(x) CLAMP_S32((x) SAT_OFF)
  
@@ -7154,9 +9087,8 @@
  #endif /* _NO_LONGLONG */
  
  /***************************************************************/
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_16nw.c	2010-06-20 21:56:27.000000000 -0700
 @@ -94,7 +94,7 @@
  #define D2I(x) CLAMP_S32((x) SAT_OFF)
  
@@ -7196,9 +9128,8 @@
  #endif /* _NO_LONGLONG */
  
  /***************************************************************/
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8ext.c	2010-06-20 21:56:27.000000000 -0700
 @@ -126,7 +126,7 @@
  #define D2I(x) CLAMP_S32((x) SAT_OFF)
  
@@ -7238,9 +9169,8 @@
  #endif /* _NO_LONGLONG */
  
  /***************************************************************/
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_8nw.c	2010-06-20 21:56:27.000000000 -0700
 @@ -95,7 +95,7 @@
  #define D2I(x) CLAMP_S32((x) SAT_OFF)
  
@@ -7280,9 +9210,8 @@
  #endif /* _NO_LONGLONG */
  
  /***************************************************************/
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16ext.c	2010-06-20 21:56:27.000000000 -0700
 @@ -126,7 +126,7 @@
  #define D2I(x) CLAMP_S32((x) SAT_OFF)
  
@@ -7322,9 +9251,8 @@
  #endif /* _NO_LONGLONG */
  
  /***************************************************************/
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageConv_u16nw.c	2010-06-20 21:56:27.000000000 -0700
 @@ -94,7 +94,7 @@
  #define D2I(x) CLAMP_S32((x) SAT_OFF)
  
@@ -7364,10 +9292,9 @@
  #endif /* _NO_LONGLONG */
  
  /***************************************************************/
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c	2009-01-27 15:45:45.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c	2009-05-04 17:37:16.000000000 -0400
-@@ -95,7 +95,7 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageCopy_Bit.c	2010-06-20 21:56:27.000000000 -0700
+@@ -95,7 +95,7 @@
      dst = dp[0];
      if (ld_offset + size < 32) {
        dmask = (mask0 << (32 - size)) >> ld_offset;
@@ -7376,7 +9303,7 @@
        src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
        src = (src0 >> (ld_offset - ls_offset));
        dst = (dst << 24) | ((dst & 0xFF00) << 8) | ((dst >> 8) & 0xFF00) | (dst >> 24);
-@@ -104,12 +104,12 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -104,12 +104,12 @@
  #else
        src = (src0 >> (ld_offset - ls_offset));
        dp[0] = (dst & (~dmask)) | (src & dmask);
@@ -7391,7 +9318,7 @@
      src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
      src = (src0 >> (ld_offset - ls_offset));
      dst = (dst << 24) | ((dst & 0xFF00) << 8) | ((dst >> 8) & 0xFF00) | (dst >> 24);
-@@ -118,7 +118,7 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -118,7 +118,7 @@
  #else
      src = (src0 >> (ld_offset - ls_offset));
      dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7400,7 +9327,7 @@
      j = 32 - ld_offset;
      dp++;
      ls_offset += j;
-@@ -131,7 +131,7 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -131,7 +131,7 @@
  
      if (ld_offset + size < 32) {
        dmask = (mask0 << (32 - size)) >> ld_offset;
@@ -7409,7 +9336,7 @@
        src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
        src1 = (src1 << 24) | ((src1 & 0xFF00) << 8) | ((src1 >> 8) & 0xFF00) | (src1 >> 24);
        src = (src0 << shift) | (src1 >> (32 - shift));
-@@ -141,12 +141,12 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -141,12 +141,12 @@
  #else
        src = (src0 << shift) | (src1 >> (32 - shift));
        dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7424,7 +9351,7 @@
      src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
      src1 = (src1 << 24) | ((src1 & 0xFF00) << 8) | ((src1 >> 8) & 0xFF00) | (src1 >> 24);
      src = (src0 << shift) | (src1 >> (32 - shift));
-@@ -156,7 +156,7 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -156,7 +156,7 @@
  #else
      src = (src0 << shift) | (src1 >> (32 - shift));
      dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7433,7 +9360,7 @@
      j = 32 - ld_offset;
      dp++;
      sp++;
-@@ -164,19 +164,19 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -164,19 +164,19 @@
    }
  
    if (j < size) src1 = sp[0];
@@ -7457,7 +9384,7 @@
      sp++;
      dp++;
    }
-@@ -187,7 +187,7 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -187,7 +187,7 @@
      if (ls_offset + j > 32) src1 = sp[1];
      dst = dp[0];
      dmask = mask0 << (32 - j);
@@ -7466,7 +9393,7 @@
      src1 = (src1 << 24) | ((src1 & 0xFF00) << 8) | ((src1 >> 8) & 0xFF00) | (src1 >> 24);
      src = (src0 << ls_offset) | (src1 >> (32 - ls_offset));
      dst = (dst << 24) | ((dst & 0xFF00) << 8) | ((dst >> 8) & 0xFF00) | (dst >> 24);
-@@ -196,7 +196,7 @@ void mlib_ImageCopy_bit_na(const mlib_u8
+@@ -196,7 +196,7 @@
  #else
      src = (src0 << ls_offset) | (src1 >> (32 - ls_offset));
      dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7475,7 +9402,7 @@
    }
  
  #else /* _LONGLONG */
-@@ -315,7 +315,7 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -315,7 +315,7 @@
      dst = dp[0];
      if (ld_offset >= size) {
        dmask = (lmask0 << (32 - size)) >> (ld_offset - size);
@@ -7484,7 +9411,7 @@
        src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
        src = (src0 << (ls_offset - ld_offset));
        dst = (dst << 24) | ((dst & 0xFF00) << 8) | ((dst >> 8) & 0xFF00) | (dst >> 24);
-@@ -324,12 +324,12 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -324,12 +324,12 @@
  #else
        src = (src0 << (ls_offset - ld_offset));
        dp[0] = (dst & (~dmask)) | (src & dmask);
@@ -7499,7 +9426,7 @@
      src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
      src = (src0 << (ls_offset - ld_offset));
      dst = (dst << 24) | ((dst & 0xFF00) << 8) | ((dst >> 8) & 0xFF00) | (dst >> 24);
-@@ -338,7 +338,7 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -338,7 +338,7 @@
  #else
      src = (src0 << (ls_offset - ld_offset));
      dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7508,7 +9435,7 @@
      j = ld_offset;
      dp--;
      ls_offset -= j;
-@@ -351,7 +351,7 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -351,7 +351,7 @@
  
      if (ld_offset >= size) {
        dmask = (lmask0 << (32 - size)) >> (ld_offset - size);
@@ -7517,7 +9444,7 @@
        src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
        src1 = (src1 << 24) | ((src1 & 0xFF00) << 8) | ((src1 >> 8) & 0xFF00) | (src1 >> 24);
        src = (src0 >> shift) | (src1 << (32 - shift));
-@@ -361,12 +361,12 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -361,12 +361,12 @@
  #else
        src = (src0 >> shift) | (src1 << (32 - shift));
        dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7532,7 +9459,7 @@
      src0 = (src0 << 24) | ((src0 & 0xFF00) << 8) | ((src0 >> 8) & 0xFF00) | (src0 >> 24);
      src1 = (src1 << 24) | ((src1 & 0xFF00) << 8) | ((src1 >> 8) & 0xFF00) | (src1 >> 24);
      src = (src0 >> shift) | (src1 << (32 - shift));
-@@ -376,7 +376,7 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -376,7 +376,7 @@
  #else
      src = (src0 >> shift) | (src1 << (32 - shift));
      dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7541,7 +9468,7 @@
      j = ld_offset;
      dp--;
      sp--;
-@@ -384,22 +384,22 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -384,22 +384,22 @@
    }
  
    if (j < size) src1 = sp[0];
@@ -7568,7 +9495,7 @@
      sp--;
      dp--;
    }
-@@ -410,7 +410,7 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -410,7 +410,7 @@
      if (ls_offset < j) src1 = sp[-1];
      dst = dp[0];
      dmask = lmask0 >> (32 - j);
@@ -7577,7 +9504,7 @@
      src1 = (src1 << 24) | ((src1 & 0xFF00) << 8) | ((src1 >> 8) & 0xFF00) | (src1 >> 24);
      src = (src0 >> (32 - ls_offset)) | (src1 << ls_offset);
      dst = (dst << 24) | ((dst & 0xFF00) << 8) | ((dst >> 8) & 0xFF00) | (dst >> 24);
-@@ -419,7 +419,7 @@ void mlib_ImageCopy_bit_na_r(const mlib_
+@@ -419,7 +419,7 @@
  #else
      src = (src0 >> (32 - ls_offset)) | (src1 << ls_offset);
      dp[0] = (dst & ~dmask) | (src & dmask);
@@ -7586,9 +9513,8 @@
    }
  
  #else  /* _LONGLONG */
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c	2010-06-20 21:56:27.000000000 -0700
 @@ -168,7 +168,7 @@
  }
  
@@ -7607,7 +9533,7 @@
  
  /***************************************************************/
  void mlib_ImageLookUp_U8_D64(const mlib_u8  *src,
-@@ -612,7 +612,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -612,7 +612,7 @@
  #pragma pipeloop(0)
  #endif /* __SUNPRO_C */
        for (i = 0; i < size - 7; i += 4, dp += 8, sa++) {
@@ -7616,7 +9542,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 5) & 0x7F8));
-@@ -622,12 +622,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -622,12 +622,12 @@
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 21) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
@@ -7631,7 +9557,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 21) & 0x7F8));
-@@ -637,7 +637,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -637,7 +637,7 @@
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 5) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
@@ -7640,7 +9566,7 @@
          s0 = sa[0];
          dp[4] = t0;
          dp[5] = t1;
-@@ -645,7 +645,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -645,7 +645,7 @@
          dp[7] = t3;
        }
  
@@ -7649,7 +9575,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 5) & 0x7F8));
-@@ -655,12 +655,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -655,12 +655,12 @@
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 21) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
@@ -7664,7 +9590,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 21) & 0x7F8));
-@@ -670,7 +670,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -670,7 +670,7 @@
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 5) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
@@ -7673,7 +9599,7 @@
        dp[4] = t0;
        dp[5] = t1;
        dp[6] = t2;
-@@ -718,7 +718,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -718,7 +718,7 @@
  #pragma pipeloop(0)
  #endif /* __SUNPRO_C */
        for (i = 0; i < size - 7; i += 4, dp += 12, sa++) {
@@ -7682,7 +9608,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
-@@ -732,14 +732,14 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -732,14 +732,14 @@
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
          t4 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
          t5 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
@@ -7699,7 +9625,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
-@@ -753,7 +753,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -753,7 +753,7 @@
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
          t4 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
          t5 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
@@ -7708,7 +9634,7 @@
          s0 = sa[0];
          dp[6] = t0;
          dp[7] = t1;
-@@ -763,7 +763,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -763,7 +763,7 @@
          dp[11] = t5;
        }
  
@@ -7717,7 +9643,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
-@@ -777,14 +777,14 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -777,14 +777,14 @@
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
        t4 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
        t5 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
@@ -7734,7 +9660,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
-@@ -798,7 +798,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -798,7 +798,7 @@
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
        t4 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
        t5 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
@@ -7743,7 +9669,7 @@
        dp[6] = t0;
        dp[7] = t1;
        dp[8] = t2;
-@@ -851,7 +851,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -851,7 +851,7 @@
  #pragma pipeloop(0)
  #endif /* __SUNPRO_C */
        for (i = 0; i < size - 7; i += 4, dp += 16, sa++) {
@@ -7752,7 +9678,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
-@@ -861,12 +861,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -861,12 +861,12 @@
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 21) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 21) & 0x7F8));
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 >> 21) & 0x7F8));
@@ -7767,7 +9693,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 5) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 5) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 5) & 0x7F8));
-@@ -876,12 +876,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -876,12 +876,12 @@
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 >> 13) & 0x7F8));
@@ -7782,7 +9708,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
-@@ -891,12 +891,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -891,12 +891,12 @@
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 5) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 5) & 0x7F8));
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 >> 5) & 0x7F8));
@@ -7797,7 +9723,7 @@
          t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 21) & 0x7F8));
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 21) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 21) & 0x7F8));
-@@ -906,7 +906,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -906,7 +906,7 @@
          t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
          t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
          t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 << 3) & 0x7F8));
@@ -7806,7 +9732,7 @@
          s0 = sa[0];
          dp[12] = t0;
          dp[13] = t1;
-@@ -914,7 +914,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -914,7 +914,7 @@
          dp[15] = t3;
        }
  
@@ -7815,7 +9741,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 << 3) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
-@@ -924,12 +924,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -924,12 +924,12 @@
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 21) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 21) & 0x7F8));
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 >> 21) & 0x7F8));
@@ -7830,7 +9756,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 5) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 5) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 5) & 0x7F8));
-@@ -939,12 +939,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -939,12 +939,12 @@
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 >> 13) & 0x7F8));
@@ -7845,7 +9771,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 13) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 13) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 13) & 0x7F8));
-@@ -954,12 +954,12 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -954,12 +954,12 @@
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 5) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 5) & 0x7F8));
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 >> 5) & 0x7F8));
@@ -7860,7 +9786,7 @@
        t0 = *(mlib_d64 *) ((mlib_u8 *) tab0 + ((s0 >> 21) & 0x7F8));
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 >> 21) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 >> 21) & 0x7F8));
-@@ -969,7 +969,7 @@ void mlib_ImageLookUpSI_U8_D64(const mli
+@@ -969,7 +969,7 @@
        t1 = *(mlib_d64 *) ((mlib_u8 *) tab1 + ((s0 << 3) & 0x7F8));
        t2 = *(mlib_d64 *) ((mlib_u8 *) tab2 + ((s0 << 3) & 0x7F8));
        t3 = *(mlib_d64 *) ((mlib_u8 *) tab3 + ((s0 << 3) & 0x7F8));
@@ -7869,10 +9795,9 @@
        dp[12] = t0;
        dp[13] = t1;
        dp[14] = t2;
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c	2009-05-04 17:37:16.000000000 -0400
-@@ -88,7 +88,7 @@ typedef union {
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageLookUp_Bit.c	2010-06-20 21:56:27.000000000 -0700
+@@ -88,7 +88,7 @@
  } d64_2_f32;
  
  /***************************************************************/
@@ -7881,7 +9806,7 @@
  
  static const mlib_u32 mlib_bit_mask[16] = {
    0x00000000u, 0xFF000000u, 0x00FF0000u, 0xFFFF0000u,
-@@ -126,7 +126,7 @@ static const mlib_u32 mlib_bit_mask_3[3*
+@@ -126,7 +126,7 @@
    0x00000000u, 0x00FFFFFFu, 0xFF000000u, 0xFFFFFFFFu
  };
  
@@ -7890,7 +9815,7 @@
  
  /***************************************************************/
  mlib_status mlib_ImageLookUp_Bit_U8_1(const mlib_u8 *src,
-@@ -228,13 +228,13 @@ mlib_status mlib_ImageLookUp_Bit_U8_1(co
+@@ -228,13 +228,13 @@
  #endif /* __SUNPRO_C */
      for (; i <= (size - 16); i += 16) {
        s0 = *(mlib_u16*)sa;
@@ -7906,7 +9831,7 @@
        sa += 2;
      }
  
-@@ -258,20 +258,20 @@ mlib_status mlib_ImageLookUp_Bit_U8_1(co
+@@ -258,20 +258,20 @@
          val1 = p_dd[2*val0+1];
        }
  
@@ -7931,7 +9856,7 @@
  
        ((mlib_u64*)da)[0] = (((mlib_u64*)dd_array)[sa[0]] & emask) | (((mlib_u64*)da)[0] &~ emask);
  
-@@ -323,13 +323,13 @@ mlib_status mlib_ImageLookUp_Bit_U8_2(co
+@@ -323,13 +323,13 @@
  
    val0 = table[0][0];
    val1 = table[0][1];
@@ -7947,7 +9872,7 @@
    val0 |= (val0 << 16);
    val1 |= (val1 << 16);
  
-@@ -394,11 +394,11 @@ mlib_status mlib_ImageLookUp_Bit_U8_2(co
+@@ -394,11 +394,11 @@
          dd1 = dd2;
        }
  
@@ -7961,7 +9886,7 @@
        ((mlib_u32*)da)[0] = (dd1 & emask) | (((mlib_u32*)da)[0] &~ emask);
  
  #else /* _NO_LONGLONG */
-@@ -412,11 +412,11 @@ mlib_status mlib_ImageLookUp_Bit_U8_2(co
+@@ -412,11 +412,11 @@
          dd = ((mlib_u64*)dd_array)[s0 & 0xf];
        }
  
@@ -7975,7 +9900,7 @@
        ((mlib_u64*)da)[0] = (dd & emask) | (((mlib_u64*)da)[0] &~ emask);
  
  #endif /* _NO_LONGLONG */
-@@ -462,7 +462,7 @@ mlib_status mlib_ImageLookUp_Bit_U8_3(co
+@@ -462,7 +462,7 @@
  
    buffs = buff + size;
  
@@ -7984,7 +9909,7 @@
    l0 = (table[0][0] << 24) | (table[2][0] << 16) | (table[1][0] << 8) | (table[0][0]);
    h0 = (table[0][1] << 24) | (table[2][1] << 16) | (table[1][1] << 8) | (table[0][1]);
    l1 = (l0 >> 8); l1 |= (l1 << 24);
-@@ -476,7 +476,7 @@ mlib_status mlib_ImageLookUp_Bit_U8_3(co
+@@ -476,7 +476,7 @@
    h1 = (h0 << 8); h1 |= (h1 >> 24);
    l2 = (l1 << 8); l2 |= (l2 >> 24);
    h2 = (h1 << 8); h2 |= (h2 >> 24);
@@ -7993,7 +9918,7 @@
  
    /* calculate lookup table */
  #ifdef __SUNPRO_C
-@@ -564,11 +564,11 @@ mlib_status mlib_ImageLookUp_Bit_U8_3(co
+@@ -564,11 +564,11 @@
          dd = ((mlib_u32*)(d_array12 + (s0 & 0xF)))[1];
        }
  
@@ -8007,7 +9932,7 @@
        da[0] = (dd & emask) | (da[0] &~ emask);
      }
  
-@@ -611,13 +611,13 @@ mlib_status mlib_ImageLookUp_Bit_U8_4(co
+@@ -611,13 +611,13 @@
  
    buffs = buff + size;
  
@@ -8023,9 +9948,8 @@
  
    ((mlib_u32*)lh)[0] = l;  ((mlib_u32*)lh)[1] = l;
    ((mlib_u32*)lh)[2] = l;  ((mlib_u32*)lh)[3] = h;
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c ./jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_ImageUtils.c	2010-06-20 21:56:27.000000000 -0700
 @@ -30,7 +30,7 @@
  typedef union {
    mlib_d64 db;
@@ -8035,10 +9959,9 @@
      mlib_s32 int1, int0;
  #else
      mlib_s32 int0, int1;
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c	2009-05-04 17:37:16.000000000 -0400
-@@ -275,11 +275,11 @@ void mlib_ImageCopy_bit_al(const mlib_u8
+--- jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_c_ImageCopy.c	2010-06-20 21:56:27.000000000 -0700
+@@ -275,11 +275,11 @@
        for (i = 0; j <= (b_size - 4); j += 4, i++) {
          src0 = src1;
          src1 = pws[i + 1];
@@ -8052,7 +9975,7 @@
        }
  
        sa += i << 2;
-@@ -381,11 +381,11 @@ void mlib_c_ImageCopy_u8(const mlib_imag
+@@ -381,11 +381,11 @@
          for (; j <= (src_width - 4); j += 4) {
            src0 = src1;
            src1 = ps[1];
@@ -8066,7 +9989,7 @@
            ps++;
          }
        }
-@@ -414,11 +414,11 @@ void mlib_c_ImageCopy_u8(const mlib_imag
+@@ -414,11 +414,11 @@
          for (; j <= (src_width - 8); j += 8) {
            src0 = src1;
            src1 = ps[1];
@@ -8080,7 +10003,7 @@
            ps++;
          }
        }
-@@ -484,11 +484,11 @@ void mlib_c_ImageCopy_s16(const mlib_ima
+@@ -484,11 +484,11 @@
          for (; j <= (src_width - 2); j += 2) {
            src0 = src1;
            src1 = ps[1];
@@ -8094,7 +10017,7 @@
            ps++;
          }
        }
-@@ -516,11 +516,11 @@ void mlib_c_ImageCopy_s16(const mlib_ima
+@@ -516,11 +516,11 @@
          for (; j <= (src_width - 4); j += 4) {
            src0 = src1;
            src1 = ps[1];
@@ -8108,7 +10031,7 @@
            ps++;
          }
        }
-@@ -585,11 +585,11 @@ void mlib_c_ImageCopy_s32(const mlib_ima
+@@ -585,11 +585,11 @@
          for (; j <= (src_width - 2); j += 2) {
            src0 = src1;
            src1 = ps[1];
@@ -8122,7 +10045,7 @@
            ps++;
          }
        }
-@@ -687,11 +687,11 @@ void mlib_ImageCopy_na(const mlib_u8 *sp
+@@ -687,11 +687,11 @@
  #endif /* __SUNPRO_C */
        for (; n > SIZE; n -= SIZE) {
          s1 = *tmp++;
@@ -8136,9 +10059,8 @@
          s0 = s1;
          dp += SIZE;
          sp += SIZE;
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_c_ImageLookUp_f.c	2010-06-20 21:56:27.000000000 -0700
 @@ -120,7 +120,7 @@
    }                                                               \
  }
@@ -8166,7 +10088,7 @@
  
  /***************************************************************/
  void mlib_c_ImageLookUp_U8_U8(const mlib_u8 *src,
-@@ -297,11 +297,11 @@ void mlib_c_ImageLookUp_U8_U8(const mlib
+@@ -297,11 +297,11 @@
          da[0] = t;
          da++;
          dp = (mlib_u8 *) da;
@@ -8180,7 +10102,7 @@
          sp = (mlib_u8 *) sa;
          i += 5;
          for (; i < size; i++, dp++, sp++)
-@@ -403,11 +403,11 @@ void mlib_c_ImageLookUp_U8_U8(const mlib
+@@ -403,11 +403,11 @@
          da[0] = t;
          da++;
          dp = (mlib_u8 *) da;
@@ -8194,7 +10116,7 @@
          sp = (mlib_u8 *) sa;
          i += 5;
  
-@@ -544,11 +544,11 @@ void mlib_c_ImageLookUp_U8_U8(const mlib
+@@ -544,11 +544,11 @@
          da[0] = t;
          da++;
          dp = (mlib_u8 *) da;
@@ -8208,7 +10130,7 @@
          sp = (mlib_u8 *) sa;
          i += 5;
  
-@@ -694,11 +694,11 @@ void mlib_c_ImageLookUp_U8_U8(const mlib
+@@ -694,11 +694,11 @@
          da[0] = t;
          da++;
          dp = (mlib_u8 *) da;
@@ -8222,7 +10144,7 @@
          sp = (mlib_u8 *) sa;
          i += 5;
  
-@@ -1852,21 +1852,21 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -1852,21 +1852,21 @@
      s0 = tab0[0];
      s1 = tab1[0];
      for (i = 1; i < 256; i++) {
@@ -8248,7 +10170,7 @@
      tab[255] = (mlib_u16) s2;
  
      for (j = 0; j < ysize; j++, dst += dlb, src += slb) {
-@@ -1897,11 +1897,11 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -1897,11 +1897,11 @@
          for (i = 0; i < size - 3; i += 2, da++, sa += 2) {
            t0 = tab[s0];
            t1 = tab[s1];
@@ -8262,7 +10184,7 @@
            s0 = sa[0];
            s1 = sa[1];
            da[0] = t;
-@@ -1909,11 +1909,11 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -1909,11 +1909,11 @@
  
          t0 = tab[s0];
          t1 = tab[s1];
@@ -8276,7 +10198,7 @@
          da[0] = t;
          da++;
  
-@@ -1927,13 +1927,13 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -1927,13 +1927,13 @@
  
          if (off > 1) {
            t0 = tab[sa[0]];
@@ -8292,7 +10214,7 @@
            sa++;
            size--;
            dp += 2;
-@@ -1941,11 +1941,11 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -1941,11 +1941,11 @@
  
          t0 = tab[sa[0]];
          sa++;
@@ -8306,7 +10228,7 @@
  
          da = (mlib_s32 *) dp;
  
-@@ -1959,11 +1959,11 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -1959,11 +1959,11 @@
          for (i = 0; i < size - 4; i += 2, da++, sa += 2) {
            t1 = tab[s0];
            t2 = tab[s1];
@@ -8320,7 +10242,7 @@
            t0 = t2;
            s0 = sa[0];
            s1 = sa[1];
-@@ -1972,29 +1972,29 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -1972,29 +1972,29 @@
  
          t1 = tab[s0];
          t2 = tab[s1];
@@ -8356,7 +10278,7 @@
          }
        }
      }
-@@ -2012,22 +2012,22 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2012,22 +2012,22 @@
      s1 = tab1[0];
      s2 = tab2[0];
      for (i = 1; i < 256; i++) {
@@ -8383,7 +10305,7 @@
      tab[255] = s3;
  
      for (j = 0; j < ysize; j++, dst += dlb, src += slb) {
-@@ -2064,24 +2064,24 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2064,24 +2064,24 @@
        for (i = 0; i < size - 7; i += 4, da += 3, sa += 4) {
          t0 = tab[s0];
          t1 = tab[s1];
@@ -8412,7 +10334,7 @@
          s0 = sa[2];
          s1 = sa[3];
          da[1] = res2;
-@@ -2090,24 +2090,24 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2090,24 +2090,24 @@
  
        t0 = tab[s0];
        t1 = tab[s1];
@@ -8441,7 +10363,7 @@
        da[1] = res2;
        da[2] = res1;
        da += 3;
-@@ -2143,11 +2143,11 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2143,11 +2143,11 @@
      s2 = tab2[0];
      s3 = tab3[0];
      for (i = 1; i < 256; i++) {
@@ -8455,7 +10377,7 @@
        s0 = tab0[i];
        s1 = tab1[i];
        s2 = tab2[i];
-@@ -2155,11 +2155,11 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2155,11 +2155,11 @@
        tab[i - 1] = s4;
      }
  
@@ -8469,7 +10391,7 @@
      tab[255] = s4;
  
      for (j = 0; j < ysize; j++, dst += dlb, src += slb) {
-@@ -2225,13 +2225,13 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2225,13 +2225,13 @@
          for (i = 0; i < size - 4; i += 2, da += 2, sa += 2) {
            t1 = tab[s0];
            t2 = tab[s1];
@@ -8485,7 +10407,7 @@
            t0 = t2;
            s0 = sa[0];
            s1 = sa[1];
-@@ -2241,28 +2241,28 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2241,28 +2241,28 @@
  
          t1 = tab[s0];
          t2 = tab[s1];
@@ -8519,7 +10441,7 @@
            dp[3] = (mlib_u8) (t0 >> 24);
            dp[2] = (mlib_u8) (t0 >> 16);
            dp[1] = (mlib_u8) (t0 >> 8);
-@@ -2272,7 +2272,7 @@ void mlib_c_ImageLookUpSI_U8_U8(const ml
+@@ -2272,7 +2272,7 @@
            dp[1] = (mlib_u8) (t0 >> 16);
            dp[2] = (mlib_u8) (t0 >> 8);
            dp[3] = (mlib_u8) t0;
@@ -8528,7 +10450,7 @@
          }
        }
      }
-@@ -2348,13 +2348,13 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2348,13 +2348,13 @@
          t3 = tab0[s1];
          t4 = tab1[s1];
          t5 = tab2[s1];
@@ -8544,7 +10466,7 @@
          s0 = sa[0];
          s1 = sa[1];
          t0 = tab0[s0];
-@@ -2363,13 +2363,13 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2363,13 +2363,13 @@
          t3 = tab0[s1];
          t4 = tab1[s1];
          t5 = tab2[s1];
@@ -8560,7 +10482,7 @@
          s0 = sa[2];
          s1 = sa[3];
          da[1] = res2;
-@@ -2382,13 +2382,13 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2382,13 +2382,13 @@
        t3 = tab0[s1];
        t4 = tab1[s1];
        t5 = tab2[s1];
@@ -8576,7 +10498,7 @@
        s0 = sa[0];
        s1 = sa[1];
        t0 = tab0[s0];
-@@ -2397,13 +2397,13 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2397,13 +2397,13 @@
        t3 = tab0[s1];
        t4 = tab1[s1];
        t5 = tab2[s1];
@@ -8592,7 +10514,7 @@
        da[1] = res2;
        da[2] = res1;
        da += 3;
-@@ -2455,11 +2455,11 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2455,11 +2455,11 @@
            t1 = tab1[s0];
            t2 = tab2[s0];
            t3 = tab3[s0];
@@ -8606,7 +10528,7 @@
            s0 = sa[0];
            da[0] = res;
          }
-@@ -2468,11 +2468,11 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2468,11 +2468,11 @@
          t1 = tab1[s0];
          t2 = tab2[s0];
          t3 = tab3[s0];
@@ -8620,7 +10542,7 @@
          da[0] = res;
  
        }
-@@ -2496,11 +2496,11 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2496,11 +2496,11 @@
          t2 = tab2[s0];
          t3 = tab3[s0];
  
@@ -8634,7 +10556,7 @@
  
          s0 = sa[0];
          sa++;
-@@ -2513,13 +2513,13 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2513,13 +2513,13 @@
            t1 = tab1[s0];
            t2 = tab2[s0];
            t3 = tab3[s0];
@@ -8650,7 +10572,7 @@
            res1 = res2;
            s0 = sa[0];
            da[0] = res;
-@@ -2529,21 +2529,21 @@ void mlib_c_ImageLookUpSI_S16_U8(const m
+@@ -2529,21 +2529,21 @@
          t1 = tab1[s0];
          t2 = tab2[s0];
          t3 = tab3[s0];
@@ -8676,7 +10598,7 @@
        }
      }
    }
-@@ -2617,13 +2617,13 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2617,13 +2617,13 @@
          t3 = tab0[s1];
          t4 = tab1[s1];
          t5 = tab2[s1];
@@ -8692,7 +10614,7 @@
          s0 = sa[0];
          s1 = sa[1];
          t0 = tab0[s0];
-@@ -2632,13 +2632,13 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2632,13 +2632,13 @@
          t3 = tab0[s1];
          t4 = tab1[s1];
          t5 = tab2[s1];
@@ -8708,7 +10630,7 @@
          s0 = sa[2];
          s1 = sa[3];
          da[1] = res2;
-@@ -2651,13 +2651,13 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2651,13 +2651,13 @@
        t3 = tab0[s1];
        t4 = tab1[s1];
        t5 = tab2[s1];
@@ -8724,7 +10646,7 @@
        s0 = sa[0];
        s1 = sa[1];
        t0 = tab0[s0];
-@@ -2666,13 +2666,13 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2666,13 +2666,13 @@
        t3 = tab0[s1];
        t4 = tab1[s1];
        t5 = tab2[s1];
@@ -8740,7 +10662,7 @@
        da[1] = res2;
        da[2] = res1;
        da += 3;
-@@ -2724,11 +2724,11 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2724,11 +2724,11 @@
            t1 = tab1[s0];
            t2 = tab2[s0];
            t3 = tab3[s0];
@@ -8754,7 +10676,7 @@
            s0 = sa[0];
            da[0] = res;
          }
-@@ -2737,11 +2737,11 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2737,11 +2737,11 @@
          t1 = tab1[s0];
          t2 = tab2[s0];
          t3 = tab3[s0];
@@ -8768,7 +10690,7 @@
          da[0] = res;
  
        }
-@@ -2765,11 +2765,11 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2765,11 +2765,11 @@
          t2 = tab2[s0];
          t3 = tab3[s0];
  
@@ -8782,7 +10704,7 @@
  
          s0 = sa[0];
          sa++;
-@@ -2782,13 +2782,13 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2782,13 +2782,13 @@
            t1 = tab1[s0];
            t2 = tab2[s0];
            t3 = tab3[s0];
@@ -8798,7 +10720,7 @@
            res1 = res2;
            s0 = sa[0];
            da[0] = res;
-@@ -2798,21 +2798,21 @@ void mlib_c_ImageLookUpSI_U16_U8(const m
+@@ -2798,21 +2798,21 @@
          t1 = tab1[s0];
          t2 = tab2[s0];
          t3 = tab3[s0];
@@ -8824,7 +10746,7 @@
        }
      }
    }
-@@ -2863,21 +2863,21 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -2863,21 +2863,21 @@
      s0 = tab0[0];
      s1 = tab1[0];
      for (i = 1; i < 256; i++) {
@@ -8850,7 +10772,7 @@
      tab[255] = s2;
  
      for (j = 0; j < ysize; j++, dst += dlb, src += slb) {
-@@ -2919,11 +2919,11 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -2919,11 +2919,11 @@
        else {
  
          t0 = tab[*sa++];
@@ -8864,7 +10786,7 @@
          da = (mlib_u32 *) dp;
          s0 = sa[0];
          s1 = sa[1];
-@@ -2935,13 +2935,13 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -2935,13 +2935,13 @@
          for (i = 0; i < size - 4; i += 2, da += 2, sa += 2) {
            t1 = tab[s0];
            t2 = tab[s1];
@@ -8880,7 +10802,7 @@
            t0 = t2;
            s0 = sa[0];
            s1 = sa[1];
-@@ -2951,32 +2951,32 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -2951,32 +2951,32 @@
  
          t1 = tab[s0];
          t2 = tab[s1];
@@ -8919,7 +10841,7 @@
          }
        }
      }
-@@ -2994,13 +2994,13 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -2994,13 +2994,13 @@
      s1 = tab1[0];
      s2 = tab2[0];
      for (i = 1; i < 256; i++) {
@@ -8935,7 +10857,7 @@
        s0 = tab0[i];
        s1 = tab1[i];
        s2 = tab2[i];
-@@ -3008,13 +3008,13 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3008,13 +3008,13 @@
        tab[2 * i - 1] = s4;
      }
  
@@ -8951,7 +10873,7 @@
      tab[511] = s4;
  
      for (j = 0; j < ysize; j++, dst += dlb, src += slb) {
-@@ -3050,13 +3050,13 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3050,13 +3050,13 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab + s0 + 4);
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab + s1);
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab + s1 + 4);
@@ -8967,7 +10889,7 @@
          s0 = sa[0] << 3;
          s1 = sa[1] << 3;
          da[0] = res1;
-@@ -3068,13 +3068,13 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3068,13 +3068,13 @@
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab + s0 + 4);
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab + s1);
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab + s1 + 4);
@@ -8983,7 +10905,7 @@
        da[0] = res1;
        da[1] = res2;
        da[2] = t3;
-@@ -3105,13 +3105,13 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3105,13 +3105,13 @@
      s2 = tab2[0];
      s3 = tab3[0];
      for (i = 1; i < 256; i++) {
@@ -8999,7 +10921,7 @@
        s0 = tab0[i];
        s1 = tab1[i];
        s2 = tab2[i];
-@@ -3120,13 +3120,13 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3120,13 +3120,13 @@
        tab[2 * i - 1] = s5;
      }
  
@@ -9015,7 +10937,7 @@
      tab[510] = s4;
      tab[511] = s5;
  
-@@ -3181,18 +3181,18 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3181,18 +3181,18 @@
  
          t4 = tab[2 * sa[0]];
          t5 = tab[2 * sa[0] + 1];
@@ -9038,7 +10960,7 @@
          s0 = sa[0] << 3;
          s1 = sa[1] << 3;
          sa += 2;
-@@ -3205,7 +3205,7 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3205,7 +3205,7 @@
            t1 = *(mlib_u32 *) ((mlib_u8 *) tab + s0 + 4);
            t2 = *(mlib_u32 *) ((mlib_u8 *) tab + s1);
            t3 = *(mlib_u32 *) ((mlib_u8 *) tab + s1 + 4);
@@ -9047,7 +10969,7 @@
            res1 = (t5 >> 16) + (t0 << 16);
            res2 = (t0 >> 16) + (t1 << 16);
            res3 = (t1 >> 16) + (t2 << 16);
-@@ -3215,7 +3215,7 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3215,7 +3215,7 @@
            res2 = (t0 << 16) + (t1 >> 16);
            res3 = (t1 << 16) + (t2 >> 16);
            res4 = (t2 << 16) + (t3 >> 16);
@@ -9056,7 +10978,7 @@
            s0 = sa[0] << 3;
            s1 = sa[1] << 3;
            da[0] = res1;
-@@ -3229,7 +3229,7 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3229,7 +3229,7 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab + s0 + 4);
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab + s1);
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab + s1 + 4);
@@ -9065,7 +10987,7 @@
          res1 = (t5 >> 16) + (t0 << 16);
          res2 = (t0 >> 16) + (t1 << 16);
          res3 = (t1 >> 16) + (t2 << 16);
-@@ -3239,36 +3239,36 @@ void mlib_c_ImageLookUpSI_U8_S16(const m
+@@ -3239,36 +3239,36 @@
          res2 = (t0 << 16) + (t1 >> 16);
          res3 = (t1 << 16) + (t2 >> 16);
          res4 = (t2 << 16) + (t3 >> 16);
@@ -9109,7 +11031,7 @@
          }
        }
      }
-@@ -3439,7 +3439,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3439,7 +3439,7 @@
  #pragma pipeloop(0)
  #endif /* __SUNPRO_C */
        for (i = 0; i < size - 7; i += 4, dp += 8, sa++) {
@@ -9118,7 +11040,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 6) & 0x3FC));
-@@ -3449,12 +3449,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3449,12 +3449,12 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 22) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
@@ -9133,7 +11055,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 22) & 0x3FC));
-@@ -3464,7 +3464,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3464,7 +3464,7 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 6) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
@@ -9142,7 +11064,7 @@
          s0 = sa[0];
          dp[4] = t0;
          dp[5] = t1;
-@@ -3472,7 +3472,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3472,7 +3472,7 @@
          dp[7] = t3;
        }
  
@@ -9151,7 +11073,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 6) & 0x3FC));
-@@ -3482,12 +3482,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3482,12 +3482,12 @@
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 22) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
@@ -9166,7 +11088,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 22) & 0x3FC));
-@@ -3497,7 +3497,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3497,7 +3497,7 @@
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 6) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
@@ -9175,7 +11097,7 @@
        dp[4] = t0;
        dp[5] = t1;
        dp[6] = t2;
-@@ -3545,7 +3545,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3545,7 +3545,7 @@
  #pragma pipeloop(0)
  #endif /* __SUNPRO_C */
        for (i = 0; i < size - 7; i += 4, dp += 12, sa++) {
@@ -9184,7 +11106,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
-@@ -3559,14 +3559,14 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3559,14 +3559,14 @@
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
          t4 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
          t5 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
@@ -9201,7 +11123,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
-@@ -3580,7 +3580,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3580,7 +3580,7 @@
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
          t4 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
          t5 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
@@ -9210,7 +11132,7 @@
          s0 = sa[0];
          dp[6] = t0;
          dp[7] = t1;
-@@ -3590,7 +3590,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3590,7 +3590,7 @@
          dp[11] = t5;
        }
  
@@ -9219,7 +11141,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
-@@ -3604,14 +3604,14 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3604,14 +3604,14 @@
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
        t4 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
        t5 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
@@ -9236,7 +11158,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
-@@ -3625,7 +3625,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3625,7 +3625,7 @@
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
        t4 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
        t5 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
@@ -9245,7 +11167,7 @@
        dp[6] = t0;
        dp[7] = t1;
        dp[8] = t2;
-@@ -3678,7 +3678,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3678,7 +3678,7 @@
  #pragma pipeloop(0)
  #endif /* __SUNPRO_C */
        for (i = 0; i < size - 7; i += 4, dp += 16, sa++) {
@@ -9254,7 +11176,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
-@@ -3688,12 +3688,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3688,12 +3688,12 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 22) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 22) & 0x3FC));
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 >> 22) & 0x3FC));
@@ -9269,7 +11191,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 6) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 6) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 6) & 0x3FC));
-@@ -3703,12 +3703,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3703,12 +3703,12 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 >> 14) & 0x3FC));
@@ -9284,7 +11206,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
-@@ -3718,12 +3718,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3718,12 +3718,12 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 6) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 6) & 0x3FC));
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 >> 6) & 0x3FC));
@@ -9299,7 +11221,7 @@
          t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 22) & 0x3FC));
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 22) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 22) & 0x3FC));
-@@ -3733,7 +3733,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3733,7 +3733,7 @@
          t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
          t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
          t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 << 2) & 0x3FC));
@@ -9308,7 +11230,7 @@
          s0 = sa[0];
          dp[12] = t0;
          dp[13] = t1;
-@@ -3741,7 +3741,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3741,7 +3741,7 @@
          dp[15] = t3;
        }
  
@@ -9317,7 +11239,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 << 2) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
-@@ -3751,12 +3751,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3751,12 +3751,12 @@
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 22) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 22) & 0x3FC));
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 >> 22) & 0x3FC));
@@ -9332,7 +11254,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 6) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 6) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 6) & 0x3FC));
-@@ -3766,12 +3766,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3766,12 +3766,12 @@
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 >> 14) & 0x3FC));
@@ -9347,7 +11269,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 14) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 14) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 14) & 0x3FC));
-@@ -3781,12 +3781,12 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3781,12 +3781,12 @@
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 6) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 6) & 0x3FC));
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 >> 6) & 0x3FC));
@@ -9362,7 +11284,7 @@
        t0 = *(mlib_u32 *) ((mlib_u8 *) tab0 + ((s0 >> 22) & 0x3FC));
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 >> 22) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 >> 22) & 0x3FC));
-@@ -3796,7 +3796,7 @@ void mlib_c_ImageLookUpSI_U8_S32(const m
+@@ -3796,7 +3796,7 @@
        t1 = *(mlib_u32 *) ((mlib_u8 *) tab1 + ((s0 << 2) & 0x3FC));
        t2 = *(mlib_u32 *) ((mlib_u8 *) tab2 + ((s0 << 2) & 0x3FC));
        t3 = *(mlib_u32 *) ((mlib_u8 *) tab3 + ((s0 << 2) & 0x3FC));
@@ -9371,9 +11293,8 @@
        dp[12] = t0;
        dp[13] = t1;
        dp[14] = t2;
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_image.h ./jdk/src/share/native/sun/awt/medialib/mlib_image.h
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_image.h	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_image.h	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_image.h	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_image.h	2010-06-20 21:56:27.000000000 -0700
 @@ -27,6 +27,11 @@
  #ifndef MLIB_IMAGE_H
  #define MLIB_IMAGE_H
@@ -9386,9 +11307,8 @@
  #include <mlib_types.h>
  #include <mlib_status.h>
  #include <mlib_sys.h>
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_sys.c ./jdk/src/share/native/sun/awt/medialib/mlib_sys.c
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_sys.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_sys.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/awt/medialib/mlib_sys.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_sys.c	2010-06-20 21:56:27.000000000 -0700
 @@ -26,9 +26,15 @@
  
  #include <stdlib.h>
@@ -9405,7 +11325,7 @@
  
  /***************************************************************/
  
-@@ -86,7 +92,12 @@ void *__mlib_malloc(mlib_u32 size)
+@@ -86,7 +92,12 @@
     * alignment. -- from stdlib.h of MS VC++5.0.
     */
    return (void *) malloc(size);
@@ -9419,10 +11339,9 @@
    return (void *) memalign(8, size);
  #endif /* _MSC_VER */
  }
-diff -upr ../orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h ./jdk/src/share/native/sun/awt/medialib/mlib_types.h
---- ../orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/awt/medialib/mlib_types.h	2009-05-04 17:37:16.000000000 -0400
-@@ -59,7 +59,10 @@ typedef double             mlib_d64;
+--- jdk/src/share/native/sun/awt/medialib/mlib_types.h	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/awt/medialib/mlib_types.h	2010-06-20 21:56:27.000000000 -0700
+@@ -59,7 +59,10 @@
  
  #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__)
  
@@ -9434,11 +11353,10 @@
  #include <stdint.h>                     /* for uintptr_t */
  #include <malloc.h>                     /* for ptrdiff_t */
  #else
-diff -upr ../orig/jdk/src/share/native/sun/font/AccelGlyphCache.c ./jdk/src/share/native/sun/font/AccelGlyphCache.c
---- ../orig/jdk/src/share/native/sun/font/AccelGlyphCache.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/font/AccelGlyphCache.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/font/AccelGlyphCache.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/font/AccelGlyphCache.c	2010-06-20 21:56:27.000000000 -0700
 @@ -23,7 +23,11 @@
-  * have any questions.
+  * questions.
   */
  
 +#ifdef _ALLBSD_SOURCE
@@ -9449,9 +11367,8 @@
  #include "jni.h"
  #include "AccelGlyphCache.h"
  #include "Trace.h"
-diff -upr ../orig/jdk/src/share/native/sun/font/DrawGlyphList.c ./jdk/src/share/native/sun/font/DrawGlyphList.c
---- ../orig/jdk/src/share/native/sun/font/DrawGlyphList.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/font/DrawGlyphList.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/font/DrawGlyphList.c	2010-06-21 14:15:41.000000000 -0700
++++ jdk/src/share/native/sun/font/DrawGlyphList.c	2010-06-20 21:56:27.000000000 -0700
 @@ -26,7 +26,11 @@
  #include "jlong.h"
  #include "math.h"
@@ -9464,9 +11381,8 @@
  #include "sunfontids.h"
  #include "fontscalerdefs.h"
  #include "glyphblitting.h"
-diff -upr ../orig/jdk/src/share/native/sun/font/sunFont.c ./jdk/src/share/native/sun/font/sunFont.c
---- ../orig/jdk/src/share/native/sun/font/sunFont.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/font/sunFont.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/font/sunFont.c	2010-06-21 14:15:42.000000000 -0700
++++ jdk/src/share/native/sun/font/sunFont.c	2010-06-20 21:56:27.000000000 -0700
 @@ -24,7 +24,9 @@
   */
  
@@ -9477,9 +11393,8 @@
  #include "string.h"
  #include "gdefs.h"
  #include "jlong.h"
-diff -upr ../orig/jdk/src/share/native/sun/java2d/SurfaceData.c ./jdk/src/share/native/sun/java2d/SurfaceData.c
---- ../orig/jdk/src/share/native/sun/java2d/SurfaceData.c	2009-01-27 15:45:46.000000000 -0500
-+++ ./jdk/src/share/native/sun/java2d/SurfaceData.c	2009-05-04 17:37:16.000000000 -0400
+--- jdk/src/share/native/sun/java2d/SurfaceData.c	2010-06-21 14:15:42.000000000 -0700
++++ jdk/src/share/native/sun/java2d/SurfaceData.c	2010-06-20 21:56:27.000000000 -0700
 @@ -28,7 +28,11 @@
  #include "jni_util.h"
  #include "Disposer.h"
@@ -9492,9 +11407,8 @@
  #include "string.h"
  
  /**
-diff -upr ../orig/jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h ./jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h
---- ../orig/jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h	2009-01-27 15:45:47.000000000 -0500
-+++ ./jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h	2010-06-21 14:15:42.000000000 -0700
++++ jdk/src/share/native/sun/java2d/opengl/OGLFuncs.h	2010-06-20 21:56:27.000000000 -0700
 @@ -26,6 +26,9 @@
  #ifndef OGLFuncs_h_Included
  #define OGLFuncs_h_Included
@@ -9505,9 +11419,8 @@
  #include "jni.h"
  #include "J2D_GL/gl.h"
  #include "J2D_GL/glext.h"
-diff -upr ../orig/jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c ./jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c
---- ../orig/jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c	2009-01-27 15:45:47.000000000 -0500
-+++ ./jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c	2010-06-21 14:15:42.000000000 -0700
++++ jdk/src/share/native/sun/java2d/opengl/OGLRenderQueue.c	2010-06-20 21:56:27.000000000 -0700
 @@ -25,7 +25,11 @@
  
  #ifndef HEADLESS
@@ -9520,9 +11433,8 @@
  
  #include "sun_java2d_pipe_BufferedOpCodes.h"
  
-diff -upr ../orig/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c ./jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c
---- ../orig/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	2009-01-27 15:45:47.000000000 -0500
-+++ ./jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	2010-06-21 14:15:42.000000000 -0700
++++ jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	2010-06-20 21:56:27.000000000 -0700
 @@ -25,7 +25,11 @@
  
  #ifndef HEADLESS
@@ -9535,10 +11447,9 @@
  #include <math.h>
  #include <jlong.h>
  
-diff -upr ../orig/jdk/src/share/transport/socket/socketTransport.c ./jdk/src/share/transport/socket/socketTransport.c
---- ../orig/jdk/src/share/transport/socket/socketTransport.c	2009-01-27 15:45:48.000000000 -0500
-+++ ./jdk/src/share/transport/socket/socketTransport.c	2009-05-04 17:37:17.000000000 -0400
-@@ -65,6 +65,9 @@ static jdwpTransportEnv single_env = (jd
+--- jdk/src/share/transport/socket/socketTransport.c	2010-06-21 14:15:43.000000000 -0700
++++ jdk/src/share/transport/socket/socketTransport.c	2010-06-20 21:56:27.000000000 -0700
+@@ -65,6 +65,9 @@
  #define HEADER_SIZE     11
  #define MAX_DATA_SIZE 1000
  
@@ -9548,25 +11459,25 @@
  /*
   * Record the last error for this thread.
   */
-@@ -153,7 +156,7 @@ handshake(int fd, jlong timeout) {
+@@ -155,7 +158,7 @@
          }
          buf = b;
          buf += received;
--        n = dbgsysRecv(fd, buf, strlen(hello)-received, 0);
-+        n = recv_fully(fd, buf, strlen(hello)-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;
-@@ -179,7 +182,7 @@ handshake(int fd, jlong timeout) {
-         }
+@@ -180,7 +183,7 @@
+         return JDWPTRANSPORT_ERROR_IO_ERROR;
      }
  
--    if (dbgsysSend(fd, hello, strlen(hello), 0) != (int)strlen(hello)) {
-+    if (send_fully(fd, hello, strlen(hello)) != (int)strlen(hello)) {
+-    if (dbgsysSend(fd, (char*)hello, helloLen, 0) != helloLen) {
++    if (send_fully(fd, hello,  helloLen) != helloLen) {
          RETURN_IO_ERROR("send failed during handshake");
      }
      return JDWPTRANSPORT_ERROR_NONE;
-@@ -554,19 +557,19 @@ socketTransport_writePacket(jdwpTranspor
+@@ -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);
@@ -9590,7 +11501,7 @@
              RETURN_IO_ERROR("send failed");
          }
      }
-@@ -574,13 +577,33 @@ socketTransport_writePacket(jdwpTranspor
+@@ -575,13 +578,33 @@
      return JDWPTRANSPORT_ERROR_NONE;
  }
  
@@ -9625,9 +11536,8 @@
              return res;
          } else if (res == 0) {
              break; /* eof, return nbytes which is less than len */
-diff -upr ../orig/jdk/src/solaris/back/exec_md.c ./jdk/src/solaris/back/exec_md.c
---- ../orig/jdk/src/solaris/back/exec_md.c	2009-01-27 15:45:48.000000000 -0500
-+++ ./jdk/src/solaris/back/exec_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/back/exec_md.c	2010-06-21 14:15:43.000000000 -0700
++++ jdk/src/solaris/back/exec_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -30,7 +30,7 @@
  #include "sys.h"
  #include "util.h"
@@ -9637,9 +11547,8 @@
    /* Linux */
    #define FORK() fork()
  #else
-diff -upr ../orig/jdk/src/solaris/back/linker_md.c ./jdk/src/solaris/back/linker_md.c
---- ../orig/jdk/src/solaris/back/linker_md.c	2009-01-27 15:45:48.000000000 -0500
-+++ ./jdk/src/solaris/back/linker_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/back/linker_md.c	2010-06-21 14:15:43.000000000 -0700
++++ jdk/src/solaris/back/linker_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -48,6 +48,12 @@
  #include "threads_md.h"
  #endif
@@ -9653,7 +11562,7 @@
  /*
   * create a string for the JNI native function name by adding the
   * appropriate decorations.
-@@ -77,9 +83,9 @@ dbgsysBuildLibName(char *holder, int hol
+@@ -77,9 +83,9 @@
      }
  
      if (pnamelen == 0) {
@@ -9665,18 +11574,26 @@
      }
  }
  
-diff -upr ../orig/jdk/src/solaris/back/util_md.h ./jdk/src/solaris/back/util_md.h
---- ../orig/jdk/src/solaris/back/util_md.h	2009-01-27 15:45:48.000000000 -0500
-+++ ./jdk/src/solaris/back/util_md.h	2009-05-04 17:37:17.000000000 -0400
-@@ -28,6 +28,7 @@
+--- jdk/src/solaris/back/util_md.h	2010-06-21 14:15:43.000000000 -0700
++++ jdk/src/solaris/back/util_md.h	2010-06-20 21:56:27.000000000 -0700
+@@ -29,7 +29,7 @@
+ #include <stddef.h>
  
+ /* To get uintptr_t */
+-#ifdef LINUX
++#if defined(LINUX) || defined(_ALLBSD_SOURCE)
+ #include <stdint.h>
+ #else
+ /* The file stdint.h is not on Solaris 8 machines. */
+@@ -40,6 +40,7 @@
+ 
  #include <limits.h>
  #include <sys/types.h>
 +#include <machine/endian.h>
  
  #ifdef _LP64
  typedef unsigned long UNSIGNED_JLONG;
-@@ -43,7 +44,7 @@ typedef unsigned long UNSIGNED_JINT;
+@@ -55,7 +56,7 @@
  
  /* On little endian machines, convert java big endian numbers. */
  
@@ -9685,9 +11602,8 @@
  
  #define HOST_TO_JAVA_CHAR(x) (((x & 0xff) << 8) | ((x >> 8) & (0xff)))
  #define HOST_TO_JAVA_SHORT(x) (((x & 0xff) << 8) | ((x >> 8) & (0xff)))
-diff -upr ../orig/jdk/src/solaris/bin/java_md.c ./jdk/src/solaris/bin/java_md.c
---- ../orig/jdk/src/solaris/bin/java_md.c	2009-01-27 15:45:48.000000000 -0500
-+++ ./jdk/src/solaris/bin/java_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/bin/java_md.c	2010-06-21 14:15:43.000000000 -0700
++++ jdk/src/solaris/bin/java_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -24,6 +24,7 @@
   */
  
@@ -9765,7 +11681,7 @@
  static const char *user_dir     = "/java";
  #else /* Solaris */
  static const char *system_dir   = "/usr/jdk";
-@@ -404,10 +438,10 @@ CreateExecutionEnvironment(int *_argcp,
+@@ -404,10 +438,10 @@
         * If not on Solaris, assume only a single LD_LIBRARY_PATH
         * variable.
         */
@@ -9778,7 +11694,7 @@
        /*
         * On linux, if a binary is running as sgid or suid, glibc sets
         * LD_LIBRARY_PATH to the empty string for security purposes.  (In
-@@ -431,7 +465,7 @@ CreateExecutionEnvironment(int *_argcp,
+@@ -431,7 +465,7 @@
        new_runpath = JLI_MemAlloc( ((runpath!=NULL)?strlen(runpath):0) +
                                2*strlen(jrepath) + 2*strlen(arch) +
                                strlen(jvmpath) + 52);
@@ -9787,7 +11703,7 @@
  
  
        /*
-@@ -446,7 +480,7 @@ CreateExecutionEnvironment(int *_argcp,
+@@ -446,7 +480,7 @@
  
          /* jvmpath, ((running != wanted)?((wanted==64)?"/"LIBARCH64NAME:"/.."):""), */
  
@@ -9796,7 +11712,7 @@
                  "%s:"
                  "%s/lib/%s:"
                  "%s/../lib/%s",
-@@ -977,6 +1011,7 @@ jboolean RemovableMachineDependentOption
+@@ -977,6 +1011,7 @@
  /* Compute physical memory by asking the OS */
  uint64_t
  physical_memory(void) {
@@ -9804,7 +11720,7 @@
    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;
-@@ -988,6 +1023,28 @@ physical_memory(void) {
+@@ -988,6 +1023,28 @@
             "  physical memory: " UINT64_FORMAT " (%.3fGB)\n",
             pages, page_size, result, result / (double) GB);
    }
@@ -9833,7 +11749,7 @@
    return result;
  }
  
-@@ -1083,7 +1140,7 @@ get_cpuid(uint32_t arg,
+@@ -1083,7 +1140,7 @@
  
  #endif /* __sun && i586 */
  
@@ -9842,7 +11758,7 @@
  
  /*
   * A utility method for asking the CPU about itself.
-@@ -1692,9 +1749,23 @@ UnsetEnv(char *name)
+@@ -1692,9 +1749,23 @@
      return(borrowed_unsetenv(name));
  }
  
@@ -9867,7 +11783,7 @@
  
  static void* hSplashLib = NULL;
  
-@@ -1722,13 +1793,15 @@ jlong_format_specifier() {
+@@ -1722,13 +1793,15 @@
      return "%lld";
  }
  
@@ -9885,7 +11801,7 @@
      pthread_t tid;
      pthread_attr_t attr;
      pthread_attr_init(&attr);
-@@ -1765,13 +1838,11 @@ ContinueInNewThread(int (JNICALL *contin
+@@ -1765,13 +1838,11 @@
        rslt = continuation(args);
      }
  #endif
@@ -9902,9 +11818,8 @@
  /* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */
  #define MAX_PID_STR_SZ   20
  
-diff -upr ../orig/jdk/src/solaris/bin/java_md.h ./jdk/src/solaris/bin/java_md.h
---- ../orig/jdk/src/solaris/bin/java_md.h	2009-01-27 15:45:48.000000000 -0500
-+++ ./jdk/src/solaris/bin/java_md.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/bin/java_md.h	2010-06-21 14:15:43.000000000 -0700
++++ jdk/src/solaris/bin/java_md.h	2010-06-20 21:56:27.000000000 -0700
 @@ -58,10 +58,14 @@
  #include <sys/time.h>
  #define CounterGet()              (gethrtime()/1000)
@@ -9921,10 +11836,9 @@
  
  /*
   * Function prototypes.
-diff -upr ../orig/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java ./jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
---- ../orig/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	2009-01-27 15:45:48.000000000 -0500
-+++ ./jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	2009-05-04 17:37:17.000000000 -0400
-@@ -403,7 +403,7 @@ public class X11GraphicsEnvironment
+--- jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	2010-06-21 14:15:43.000000000 -0700
++++ jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	2010-06-20 21:56:27.000000000 -0700
+@@ -403,7 +403,7 @@
          if (fontID != null) {
              fileName = (String)fontNameMap.get(fontID);
              /* On Linux check for the Lucida Oblique fonts */
@@ -9933,7 +11847,7 @@
                  if (oblmap == null) {
                      initObliqueLucidaFontMap();
                  }
-@@ -639,7 +639,7 @@ public class X11GraphicsEnvironment
+@@ -639,7 +639,7 @@
          if (fontConfigDirs == null) {
              return;
          }
@@ -9942,10 +11856,9 @@
              fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
          }
          fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
-diff -upr ../orig/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java ./jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
---- ../orig/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	2009-05-04 17:37:17.000000000 -0400
-@@ -119,7 +119,11 @@ public class UnixPrintServiceLookup exte
+--- jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	2010-06-20 21:56:27.000000000 -0700
+@@ -119,7 +119,11 @@
      }
  
      static boolean isBSD() {
@@ -9958,46 +11871,113 @@
      }
  
      static final int UNINITIALIZED = -1;
-diff -upr ../orig/jdk/src/solaris/classes/sun/tools/attach/BsdAttachProvider.java ./jdk/src/solaris/classes/sun/tools/attach/BsdAttachProvider.java
---- ../orig/jdk/src/solaris/classes/sun/tools/attach/BsdAttachProvider.java	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/src/solaris/classes/sun/tools/attach/BsdAttachProvider.java	2009-05-04 17:37:15.000000000 -0400
-@@ -54,31 +54,13 @@ public class BsdAttachProvider extends H
-     public VirtualMachine attachVirtualMachine(String vmid)
-         throws AttachNotSupportedException, IOException
-     {
--        checkAttachPermission();
+--- jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java	2010-06-27 11:37:43.000000000 -0700
++++ jdk/src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java	2010-06-20 21:56:27.000000000 -0700
+@@ -38,9 +38,6 @@
+  */
+ public class BsdVirtualMachine extends HotSpotVirtualMachine {
+ 
+-    // Indicates if this machine uses the old BsdThreads
+-    static boolean isBsdThreads;
 -
--        // AttachNotSupportedException will be thrown if the target VM can be determined
--        // to be not attachable.
--        testAttachable(vmid);
--
--        return new BsdVirtualMachine(this, vmid);
-+        throw new AttachNotSupportedException("Attach not yet supported on BSD");
+     // The patch to the socket file created by the target VM
+     String path;
+ 
+@@ -65,25 +62,10 @@
+         // Then we attempt to find the socket file again.
+         path = findSocketFile(pid);
+         if (path == null) {
+-            File f = createAttachFile(pid);
++            File f = new File("/tmp/.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;
+@@ -265,37 +247,14 @@
+         // 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;
++        String path = "/tmp/" + fn;
+         File f = new File(path);
+         if (!f.exists()) {
+-            // Not found, so try /tmp
+-            path = "/tmp/" + fn;
+-            f = new File(path);
+-            if (!f.exists()) {
+-                return null;            // not found
+-            }
++            return null;            // not found
+         }
+         return path;
      }
  
-     public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd)
-         throws AttachNotSupportedException, IOException
-     {
--        if (vmd.provider() != this) {
--            throw new AttachNotSupportedException("provider mismatch");
+-    // 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 /tmp), 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) {
+-            path = "/tmp/" + fn;
+-            f = new File(path);
+-            f.createNewFile();
 -        }
--        // To avoid re-checking if the VM if attachable, we check if the descriptor
--        // is for a hotspot VM - these descriptors are created by the listVirtualMachines
--        // implementation which only returns a list of attachable VMs.
--        if (vmd instanceof HotSpotVirtualMachineDescriptor) {
--            assert ((HotSpotVirtualMachineDescriptor)vmd).isAttachable();
--            checkAttachPermission();
--            return new BsdVirtualMachine(this, vmd.id());
--        } else {
--            return attachVirtualMachine(vmd.id());
--        }
-+        throw new AttachNotSupportedException("Attach not yet supported on BSD");
+-        return f;
+-    }
+-
+     /*
+      * Write/sends the given to the target VM. String is transmitted in
+      * UTF-8 encoding.
+@@ -318,12 +277,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;
+@@ -338,8 +291,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();
      }
- 
  }
-diff -upr ../orig/jdk/src/solaris/demo/jvmti/hprof/hprof_md.c ./jdk/src/solaris/demo/jvmti/hprof/hprof_md.c
---- ../orig/jdk/src/solaris/demo/jvmti/hprof/hprof_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/demo/jvmti/hprof/hprof_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/demo/jvmti/hprof/hprof_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/demo/jvmti/hprof/hprof_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -33,7 +33,7 @@
  #include <sys/stat.h>
  #include <fcntl.h>
@@ -10007,7 +11987,7 @@
  #include <procfs.h>
  #endif
  
-@@ -76,7 +76,7 @@ md_sleep(unsigned seconds)
+@@ -76,7 +76,7 @@
  void
  md_init(void)
  {
@@ -10016,7 +11996,7 @@
      /* No Hi-Res timer option? */
  #else
      if ( gdata->micro_state_accounting ) {
-@@ -238,7 +238,7 @@ md_timeofday(void)
+@@ -238,7 +238,7 @@
  jlong
  md_get_microsecs(void)
  {
@@ -10025,7 +12005,7 @@
      return (jlong)(md_timeofday() * (jlong)1000); /* Milli to micro */
  #else
      return (jlong)(gethrtime()/(hrtime_t)1000); /* Nano seconds to micro seconds */
-@@ -256,7 +256,7 @@ md_get_timemillis(void)
+@@ -256,7 +256,7 @@
  jlong
  md_get_thread_cpu_timemillis(void)
  {
@@ -10034,7 +12014,7 @@
      return md_timeofday();
  #else
      return (jlong)(gethrvtime()/1000); /* Nano seconds to milli seconds */
-@@ -271,7 +271,7 @@ md_get_prelude_path(char *path, int path
+@@ -271,7 +271,7 @@
      Dl_info dlinfo;
  
      libdir[0] = 0;
@@ -10043,10 +12023,9 @@
      addr = (void*)&Agent_OnLoad;
  #else
      /* Just using &Agent_OnLoad will get the first external symbol with
-diff -upr ../orig/jdk/src/solaris/hpi/include/interrupt.h ./jdk/src/solaris/hpi/include/interrupt.h
---- ../orig/jdk/src/solaris/hpi/include/interrupt.h	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/include/interrupt.h	2009-05-04 17:37:17.000000000 -0400
-@@ -75,7 +75,7 @@ void intrDispatch(int interrupt, void *s
+--- jdk/src/solaris/hpi/include/interrupt.h	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/include/interrupt.h	2010-06-20 21:56:27.000000000 -0700
+@@ -75,7 +75,7 @@
   *      N_INTERRUPTS  - The number of interrupt channels.  These
   *                      are numbered from 0 to (N_INTERRUPTS - 1).
   */
@@ -10055,7 +12034,7 @@
  #define       N_INTERRUPTS    NSIG    /* 0 to NSIG - 1*/
  #else
  #define N_INTERRUPTS    32      /* 0 to 31 */
-@@ -111,6 +111,10 @@ void intrInitMD(void);
+@@ -111,6 +111,10 @@
  #error signal.h has not been included?
  #endif
  
@@ -10066,9 +12045,8 @@
  #ifdef SA_SIGINFO
  /* Thread implementation dependent interrupt dispatcher. */
  void intrDispatchMD(int sig, siginfo_t *info, void *uc);
-diff -upr ../orig/jdk/src/solaris/hpi/include/largefile.h ./jdk/src/solaris/hpi/include/largefile.h
---- ../orig/jdk/src/solaris/hpi/include/largefile.h	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/include/largefile.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/hpi/include/largefile.h	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/include/largefile.h	2010-06-20 21:56:27.000000000 -0700
 @@ -34,6 +34,10 @@
  #include "largefile_linux.h"
  #endif
@@ -10080,11 +12058,10 @@
  /*
   * Prototypes for wrappers that we define.  These wrapper functions
   * are low-level I/O routines that will use 64 bit versions if
-diff -upr ../orig/jdk/src/solaris/hpi/include/largefile_bsd.h ./jdk/src/solaris/hpi/include/largefile_bsd.h
---- ../orig/jdk/src/solaris/hpi/include/largefile_bsd.h	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/src/solaris/hpi/include/largefile_bsd.h	2009-05-04 17:37:15.000000000 -0400
+--- jdk/src/solaris/hpi/include/largefile_bsd.h	2010-06-27 11:37:43.000000000 -0700
++++ jdk/src/solaris/hpi/include/largefile_bsd.h	2010-06-20 21:56:27.000000000 -0700
 @@ -23,14 +23,28 @@
-  * have any questions.
+  * questions.
   */
  
 -#ifndef _JAVASOFT_LINUX_LARGEFILE_SUPPORT_H_
@@ -10119,9 +12096,8 @@
 +#define                pwrite64        pwrite
 +
 +#endif /* _JAVASOFT_BSD_LARGEFILE_SUPPORT_H_ */
-diff -upr ../orig/jdk/src/solaris/hpi/native_threads/include/threads_md.h ./jdk/src/solaris/hpi/native_threads/include/threads_md.h
---- ../orig/jdk/src/solaris/hpi/native_threads/include/threads_md.h	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/native_threads/include/threads_md.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/hpi/native_threads/include/threads_md.h	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/native_threads/include/threads_md.h	2010-06-20 21:56:27.000000000 -0700
 @@ -36,6 +36,8 @@
  #define N_TRACED_REGS 12
  #elif i386
@@ -10144,7 +12120,7 @@
  
  /*
   * Thread C stack overflow check
-@@ -132,7 +136,7 @@ struct sys_thread {
+@@ -132,7 +136,7 @@
      lwpid_t lwpid;
  #endif
  
@@ -10153,7 +12129,7 @@
      void *sp;
  #else
      unsigned long  sp;   /* sp at time of last (native) thread switch */
-@@ -186,12 +190,14 @@ struct sys_thread {
+@@ -186,12 +190,14 @@
  
  #define SYS_THREAD_NULL         ((sys_thread_t *) 0)
  
@@ -10168,10 +12144,9 @@
  
  #ifdef __linux__
  extern thread_key_t intrJmpbufkey;
-diff -upr ../orig/jdk/src/solaris/hpi/native_threads/src/condvar_md.c ./jdk/src/solaris/hpi/native_threads/src/condvar_md.c
---- ../orig/jdk/src/solaris/hpi/native_threads/src/condvar_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/native_threads/src/condvar_md.c	2009-05-04 17:37:17.000000000 -0400
-@@ -58,7 +58,7 @@ condvarDestroy(condvar_t *condvar)
+--- jdk/src/solaris/hpi/native_threads/src/condvar_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/native_threads/src/condvar_md.c	2010-06-20 21:56:27.000000000 -0700
+@@ -58,7 +58,7 @@
  {
      int err;
  
@@ -10180,10 +12155,9 @@
      err = pthread_cond_destroy((cond_t *) &condvar->cond);
  #else
      err = cond_destroy((cond_t *) condvar);
-diff -upr ../orig/jdk/src/solaris/hpi/native_threads/src/monitor_md.c ./jdk/src/solaris/hpi/native_threads/src/monitor_md.c
---- ../orig/jdk/src/solaris/hpi/native_threads/src/monitor_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/native_threads/src/monitor_md.c	2009-05-04 17:37:17.000000000 -0400
-@@ -147,7 +147,7 @@ sysMonitorEnter(sys_thread_t *self, sys_
+--- jdk/src/solaris/hpi/native_threads/src/monitor_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/native_threads/src/monitor_md.c	2010-06-20 21:56:27.000000000 -0700
+@@ -147,7 +147,7 @@
          mid->monitor_owner = self;
          mid->entry_count = 1;
          return SYS_OK;
@@ -10192,9 +12166,8 @@
          if (mid->monitor_owner == self) {
              mid->entry_count++;
              return SYS_OK;
-diff -upr ../orig/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c ./jdk/src/solaris/hpi/native_threads/src/sys_api_td.c
---- ../orig/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/native_threads/src/sys_api_td.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/hpi/native_threads/src/sys_api_td.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/native_threads/src/sys_api_td.c	2010-06-20 21:56:27.000000000 -0700
 @@ -39,6 +39,10 @@
  #include <sys/ioctl.h>
  #endif
@@ -10217,11 +12190,10 @@
  #ifdef NO_INTERRUPTIBLE_IO
  #undef CLOSEIO
  #else
-diff -upr ../orig/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c ./jdk/src/solaris/hpi/native_threads/src/threads_bsd.c
---- ../orig/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/src/solaris/hpi/native_threads/src/threads_bsd.c	2009-05-04 17:37:15.000000000 -0400
+--- jdk/src/solaris/hpi/native_threads/src/threads_bsd.c	2010-06-27 11:37:43.000000000 -0700
++++ jdk/src/solaris/hpi/native_threads/src/threads_bsd.c	2010-06-20 21:56:27.000000000 -0700
 @@ -23,79 +23,44 @@
-  * have any questions.
+  * questions.
   */
  
 -/*
@@ -10325,7 +12297,7 @@
  /*
   * Suspend said thread.  Used to implement java.lang.Thread.suspend(),
   * which is deprecated.
-@@ -103,10 +68,16 @@ static void checkForCorrectLibthread() _
+@@ -103,10 +68,16 @@
  int
  np_suspend(sys_thread_t *tid)
  {
@@ -10344,7 +12316,7 @@
  /*
   * Resume a suspended thread.  Used to implement java.lang.Thread.resume(),
   * which is deprecated.
-@@ -114,7 +85,14 @@ np_suspend(sys_thread_t *tid)
+@@ -114,7 +85,14 @@
  int
  np_continue(sys_thread_t *tid)
  {
@@ -10360,7 +12332,7 @@
  }
  
  /*
-@@ -127,26 +105,74 @@ void np_initialize_thread(sys_thread_t *
+@@ -127,26 +105,74 @@
  
  
  /*
@@ -10448,7 +12420,7 @@
  }
  
  /*
-@@ -155,309 +181,194 @@ np_stackinfo(void **addr, long *size)
+@@ -155,309 +181,194 @@
  void
  np_profiler_init(sys_thread_t *tid)
  {
@@ -10883,7 +12855,7 @@
  
      tid = ThreadQueue;
      for (i = 0; i < ActiveThreadCount && tid != 0; i++) {
-@@ -466,7 +377,14 @@ record_thread_regs()
+@@ -466,7 +377,14 @@
  
              if (tid->sys_thread != 0) {
                  /* if thread has already been initialized */
@@ -10899,7 +12871,7 @@
              } else {
                  /*
                   * thread is still in the process of being initalized.
-@@ -475,192 +393,11 @@ record_thread_regs()
+@@ -475,192 +393,11 @@
                   */
                  tid->sp = 0;
              }
@@ -11095,10 +13067,9 @@
 -
 -    print_lwps();
  }
-diff -upr ../orig/jdk/src/solaris/hpi/native_threads/src/threads_md.c ./jdk/src/solaris/hpi/native_threads/src/threads_md.c
---- ../orig/jdk/src/solaris/hpi/native_threads/src/threads_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/native_threads/src/threads_md.c	2009-05-04 17:37:17.000000000 -0400
-@@ -54,6 +54,10 @@ extern int InitializeIO(rlim_t limit);
+--- jdk/src/solaris/hpi/native_threads/src/threads_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/native_threads/src/threads_md.c	2010-06-20 21:56:27.000000000 -0700
+@@ -54,6 +54,10 @@
  #error That can NOT possibly be right.
  #endif
  
@@ -11109,7 +13080,7 @@
  #ifdef SA_SIGINFO
  static void sigusr1Handler(int sig, siginfo_t *info, void *uc);
  #else
-@@ -97,9 +101,14 @@ static thread_key_t tid_key = (thread_ke
+@@ -97,9 +101,14 @@
  #ifdef __linux__
  thread_key_t intrJmpbufkey;
  static sigset_t squm = {{sigmask(SIGUSR1), 0, 0, 0}};
@@ -11124,7 +13095,7 @@
  #endif
  
  /*
-@@ -170,9 +179,6 @@ sysThreadCheckStack()
+@@ -170,9 +179,6 @@
      }
  }
  
@@ -11134,7 +13105,7 @@
  
  
  /*
-@@ -187,7 +193,7 @@ sysThreadAlloc(sys_thread_t **tidP)
+@@ -187,7 +193,7 @@
      if (tid == NULL) {
          return SYS_NOMEM;
      }
@@ -11143,7 +13114,7 @@
      memset((char *)tid, 0, sizeof(sys_thread_t));
  #endif
  
-@@ -474,7 +480,7 @@ sysThreadCreate(sys_thread_t **tidP, lon
+@@ -474,7 +480,7 @@
      }
      *tidP = tid;
  
@@ -11152,7 +13123,7 @@
      memset((char *)tid, 0, sizeof(sys_thread_t));
  #endif
      /* Install the backpointer to the Thread object */
-@@ -517,6 +523,7 @@ sysThreadCreate(sys_thread_t **tidP, lon
+@@ -517,6 +523,7 @@
      }
      /* Create the thread. The thread will block waiting to be suspended */
      err = pthread_create(&tid->sys_thread, &attr, _start, (void *)tid);
@@ -11160,7 +13131,7 @@
      sysAssert(err == 0);
      if (err == 0) {
          err = sem_wait(&tid->sem_suspended);
-@@ -1049,7 +1056,18 @@ sysGetSysInfo()
+@@ -1049,7 +1056,18 @@
           * we want the number of processors configured not the number online
           * since processors may be turned on and off dynamically.
           */
@@ -11179,9 +13150,8 @@
  
          info.isMP = (cpus < 0) ? 1 : (cpus > 1);
          info.name = "native threads";
-diff -upr ../orig/jdk/src/solaris/hpi/src/linker_md.c ./jdk/src/solaris/hpi/src/linker_md.c
---- ../orig/jdk/src/solaris/hpi/src/linker_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/src/linker_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/hpi/src/linker_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/src/linker_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -44,11 +44,19 @@
  #include "threads_md.h"
  #endif
@@ -11202,7 +13172,7 @@
  
  /*
   * glibc-2.0 libdl is not MT safe.  If you are building with any glibc,
-@@ -66,6 +74,14 @@ sys_mon_t _dl_lock;
+@@ -66,6 +74,14 @@
      #define NEED_DL_LOCK
  #endif
  
@@ -11217,7 +13187,7 @@
  /*
   * create a string for the JNI native function name by adding the
   * appropriate decorations.
-@@ -95,14 +111,14 @@ sysBuildLibName(char *holder, int holder
+@@ -95,14 +111,14 @@
      }
  
      if (pnamelen == 0) {
@@ -11235,7 +13205,7 @@
      static int thr_main(void)
      {
          return -1;
-@@ -120,10 +136,10 @@ sysLoadLibrary(const char *name, char *e
+@@ -120,10 +136,10 @@
  
  #ifdef NEED_DL_LOCK
      sysMonitorEnter(sysThreadSelf(), &_dl_lock);
@@ -11248,9 +13218,8 @@
  #endif
      /*
       * This is a bit of bulletproofing to catch the commonly occurring
-diff -upr ../orig/jdk/src/solaris/hpi/src/memory_md.c ./jdk/src/solaris/hpi/src/memory_md.c
---- ../orig/jdk/src/solaris/hpi/src/memory_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/src/memory_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/hpi/src/memory_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/src/memory_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -50,12 +50,24 @@
  #include <stdlib.h>
  #include <stdio.h>      /* For perror() */
@@ -11276,7 +13245,7 @@
  #include <sys/mman.h>
  #include <fcntl.h>
  #ifdef __linux__
-@@ -73,6 +85,18 @@ static int devZeroFD;
+@@ -73,6 +85,18 @@
  #define MAP_FAILED ((caddr_t)-1)
  #endif
  static size_t memGrainSize;     /* A page for Linux */
@@ -11295,7 +13264,7 @@
  #else
  static unsigned int memGrainSize;       /* A page for Solaris */
  #endif
-@@ -154,7 +178,7 @@ mapChunk(long length)
+@@ -154,7 +178,7 @@
  {
      char *ret;
  
@@ -11304,7 +13273,7 @@
       ret = (char *) mmap(0, length, PROT_ALL,
                           MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS,
                           -1, (off_t) 0);
-@@ -176,7 +200,7 @@ static char *
+@@ -176,7 +200,7 @@
  mapChunkReserve(char *addr, long length)
  {
      char *ret;
@@ -11313,7 +13282,7 @@
       ret = (char *) mmap(addr, length, PROT_ALL,
                           MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS,
                           -1, (off_t) 0);
-@@ -199,7 +223,7 @@ mapChunkNoreserve(char *addr, long lengt
+@@ -199,7 +223,7 @@
  {
      char *ret;
  
@@ -11322,7 +13291,7 @@
       ret = (char *) mmap(addr, length, PROT_ALL,
                         MAP_FIXED | MAP_PRIVATE |
                           MAP_NORESERVE | MAP_ANONYMOUS,
-@@ -242,7 +266,7 @@ sysMapMem(size_t requestedSize, size_t *
+@@ -242,7 +266,7 @@
      *mappedSize = roundUpToGrain(requestedSize);
  #ifdef USE_MALLOC
      mappedAddr = (void *) sysMalloc(*mappedSize); /* Returns 0 on failure */
@@ -11331,7 +13300,7 @@
       if (mappedAddr) {
         memset(mappedAddr, 0, *mappedSize);
         mappedAddr = (void *) roundUpToGrain(mappedAddr);
-@@ -331,7 +355,7 @@ sysCommitMem(void *requestedAddr, size_t
+@@ -331,7 +355,7 @@
      *committedSize = roundUpToGrain(requestedSize);
      committedAddr = (void *) roundDownToGrain((long) requestedAddr);
  #ifdef USE_MALLOC
@@ -11340,9 +13309,8 @@
      ret = committedAddr;
  #else
      ret = requestedAddr;
-diff -upr ../orig/jdk/src/solaris/hpi/src/system_md.c ./jdk/src/solaris/hpi/src/system_md.c
---- ../orig/jdk/src/solaris/hpi/src/system_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/hpi/src/system_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/hpi/src/system_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/hpi/src/system_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -41,6 +41,7 @@
  #include <dlfcn.h>
  
@@ -11361,7 +13329,7 @@
  int sysThreadBootstrap(sys_thread_t **tidP, sys_mon_t **lockP, int nb)
  {
      threadBootstrapMD(tidP, lockP, nb);
-@@ -85,7 +83,7 @@ sysGetMilliTicks()
+@@ -85,7 +83,7 @@
  {
      struct timeval tv;
  
@@ -11370,7 +13338,7 @@
      return((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
  }
  
-@@ -93,7 +91,7 @@ jlong
+@@ -93,7 +91,7 @@
  sysTimeMillis()
  {
      struct timeval t;
@@ -11379,7 +13347,7 @@
      return ((jlong)t.tv_sec) * 1000 + (jlong)(t.tv_usec/1000);
  }
  
-@@ -122,13 +120,13 @@ sysGetLastErrorString(char *buf, int len
+@@ -122,13 +120,13 @@
  
  /*
   * Open a file. Unlink the file immediately after open returns
@@ -11396,9 +13364,8 @@
      fd = open64_w(path, oflag, mode);
      if (delete != 0) {
          unlink(path);
-diff -upr ../orig/jdk/src/solaris/instrument/EncodingSupport_md.c ./jdk/src/solaris/instrument/EncodingSupport_md.c
---- ../orig/jdk/src/solaris/instrument/EncodingSupport_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/instrument/EncodingSupport_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/instrument/EncodingSupport_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/instrument/EncodingSupport_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -28,7 +28,10 @@
  #include <string.h>
  #include <ctype.h>
@@ -11410,7 +13377,7 @@
  #include <iconv.h>
  
  /* Routines to convert back and forth between Platform Encoding and UTF-8 */
-@@ -63,6 +66,7 @@ utfInitialize(void)
+@@ -63,6 +66,7 @@
      /* Set the locale from the environment */
      (void)setlocale(LC_ALL, "");
  
@@ -11418,7 +13385,7 @@
      /* Get the codeset name */
      codeset = (char*)nl_langinfo(CODESET);
      if ( codeset == NULL || codeset[0] == 0 ) {
-@@ -77,6 +81,9 @@ utfInitialize(void)
+@@ -77,6 +81,9 @@
          UTF_DEBUG(("NO iconv() being used because it is not needed\n"));
          return;
      }
@@ -11428,9 +13395,8 @@
  
      /* Open conversion descriptors */
      iconvToPlatform   = iconv_open(codeset, "UTF-8");
-diff -upr ../orig/jdk/src/solaris/javavm/export/jvm_md.h ./jdk/src/solaris/javavm/export/jvm_md.h
---- ../orig/jdk/src/solaris/javavm/export/jvm_md.h	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/javavm/export/jvm_md.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/javavm/export/jvm_md.h	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/javavm/export/jvm_md.h	2010-06-20 21:56:27.000000000 -0700
 @@ -39,7 +39,14 @@
  #define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"}
  
@@ -11455,9 +13421,8 @@
  
  /* Signals */
  
-diff -upr ../orig/jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c ./jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c
---- ../orig/jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c	2009-01-27 15:45:49.000000000 -0500
-+++ ./jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/com/sun/management/UnixOperatingSystem_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -32,10 +32,16 @@
  
  #include <sys/types.h>
@@ -11499,7 +13464,7 @@
      struct dirent* p;
      if (readdir_r(dirp, entry, &p) == 0) {
          return p;
-@@ -124,7 +136,7 @@ static jlong get_total_or_available_swap
+@@ -124,7 +136,7 @@
      free(strtab);
      return available ? ((jlong)avail * page_size) :
                         ((jlong)total * page_size);
@@ -11508,7 +13473,7 @@
      int ret;
      FILE *fp;
      jlong total = 0, avail = 0;
-@@ -138,6 +150,13 @@ static jlong get_total_or_available_swap
+@@ -138,6 +150,13 @@
      avail = (jlong)si.freeswap * si.mem_unit;
  
      return available ? avail : total;
@@ -11522,7 +13487,7 @@
  #endif
  }
  
-@@ -179,7 +198,7 @@ Java_com_sun_management_UnixOperatingSys
+@@ -179,7 +198,7 @@
  
      JVM_Close(fd);
      return (jlong) psinfo.pr_size * 1024;
@@ -11531,7 +13496,7 @@
      FILE *fp;
      unsigned long vsize = 0;
  
-@@ -197,6 +216,12 @@ Java_com_sun_management_UnixOperatingSys
+@@ -197,6 +216,12 @@
  
      fclose(fp);
      return (jlong)vsize;
@@ -11544,7 +13509,7 @@
  #endif
  }
  
-@@ -222,9 +247,13 @@ Java_com_sun_management_UnixOperatingSys
+@@ -222,9 +247,13 @@
      jlong cpu_time_ns;
      struct tms time;
  
@@ -11560,7 +13525,7 @@
      clk_tck = 100;
  #endif
      if (clk_tck == -1) {
-@@ -244,22 +273,51 @@ JNIEXPORT jlong JNICALL
+@@ -244,22 +273,51 @@
  Java_com_sun_management_UnixOperatingSystem_getFreePhysicalMemorySize
    (JNIEnv *env, jobject mbean)
  {
@@ -11612,7 +13577,7 @@
      DIR *dirp;
      struct dirent dbuf;
      struct dirent* dentp;
-@@ -282,6 +340,7 @@ Java_com_sun_management_UnixOperatingSys
+@@ -282,6 +340,7 @@
      closedir(dirp);
      // subtract by 1 which was the fd open for this implementation
      return (fds - 1);
@@ -11620,9 +13585,8 @@
  }
  
  JNIEXPORT jlong JNICALL
-diff -upr ../orig/jdk/src/solaris/native/java/io/UnixFileSystem_md.c ./jdk/src/solaris/native/java/io/UnixFileSystem_md.c
---- ../orig/jdk/src/solaris/native/java/io/UnixFileSystem_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/io/UnixFileSystem_md.c	2009-05-06 10:46:09.000000000 -0400
+--- jdk/src/solaris/native/java/io/UnixFileSystem_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/io/UnixFileSystem_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -41,6 +41,11 @@
  #include "java_io_FileSystem.h"
  #include "java_io_UnixFileSystem.h"
@@ -11635,7 +13599,7 @@
  
  /* -- Field IDs -- */
  
-@@ -58,7 +63,7 @@ Java_java_io_UnixFileSystem_initIDs(JNIE
+@@ -58,7 +63,7 @@
                                    "path", "Ljava/lang/String;");
  }
  
@@ -11644,7 +13608,7 @@
  /* -- Large-file support -- */
  
  /* LINUX_FIXME: ifdef __solaris__ here is wrong.  We need to move the
-@@ -98,6 +103,7 @@ struct  stat64 {
+@@ -98,6 +103,7 @@
  };
  
  #endif  /* !_LFS_LARGEFILE */
@@ -11652,7 +13616,7 @@
  
  typedef int (*STAT64)(const char *, struct stat64 *);
  
-@@ -107,6 +113,7 @@ static STAT64 stat64_ptr = &stat64;
+@@ -107,6 +113,7 @@
  static STAT64 stat64_ptr = NULL;
  #endif
  
@@ -11660,7 +13624,7 @@
  #ifndef __linux__
  #ifdef __GNUC__
  static void init64IO(void) __attribute__((constructor));
-@@ -120,7 +127,7 @@ static void init64IO(void) {
+@@ -120,7 +127,7 @@
      stat64_ptr = (STAT64) dlsym(handle, "_stat64");
      dlclose(handle);
  }
@@ -11669,7 +13633,7 @@
  
  /* -- Path operations -- */
  
-@@ -483,7 +490,7 @@ Java_java_io_UnixFileSystem_setLastModif
+@@ -483,7 +490,7 @@
  #endif
  
          /* Preserve access time */
@@ -11678,9 +13642,8 @@
          struct stat sb;
  
          if (stat(path, &sb) == 0) {
-diff -upr ../orig/jdk/src/solaris/native/java/io/canonicalize_md.c ./jdk/src/solaris/native/java/io/canonicalize_md.c
---- ../orig/jdk/src/solaris/native/java/io/canonicalize_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/io/canonicalize_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/io/canonicalize_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/io/canonicalize_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -33,7 +33,9 @@
  #include <sys/stat.h>
  #include <errno.h>
@@ -11691,10 +13654,9 @@
  
  
  /* Note: The comments in this file use the terminology
-diff -upr ../orig/jdk/src/solaris/native/java/io/io_util_md.c ./jdk/src/solaris/native/java/io/io_util_md.c
---- ../orig/jdk/src/solaris/native/java/io/io_util_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/io/io_util_md.c	2009-05-04 17:37:17.000000000 -0400
-@@ -36,7 +36,7 @@ fileOpen(JNIEnv *env, jobject this, jstr
+--- jdk/src/solaris/native/java/io/io_util_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/io/io_util_md.c	2010-06-20 21:56:27.000000000 -0700
+@@ -36,7 +36,7 @@
      WITH_PLATFORM_STRING(env, path, ps) {
          FD fd;
  
@@ -11703,9 +13665,8 @@
          /* Remove trailing slashes, since the kernel won't */
          char *p = (char *)ps + strlen(ps) - 1;
          while ((p > ps) && (*p == '/'))
-diff -upr ../orig/jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c ./jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c
---- ../orig/jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -28,6 +28,11 @@
  #include "jni.h"
  #include "jni_util.h"
@@ -11718,7 +13679,7 @@
  JNIEXPORT jobjectArray JNICALL
  Java_java_lang_ProcessEnvironment_environ(JNIEnv *env, jclass ign)
  {
-@@ -37,7 +42,9 @@ Java_java_lang_ProcessEnvironment_enviro
+@@ -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 */
@@ -11728,7 +13689,7 @@
  
      jsize count = 0;
      jsize i, j;
-@@ -46,7 +53,7 @@ Java_java_lang_ProcessEnvironment_enviro
+@@ -46,7 +53,7 @@
  
      for (i = 0; environ[i]; i++) {
          /* Ignore corrupted environment variables */
@@ -11737,7 +13698,7 @@
              count++;
      }
  
-@@ -56,7 +63,7 @@ Java_java_lang_ProcessEnvironment_enviro
+@@ -56,7 +63,7 @@
      for (i = 0, j = 0; environ[i]; i++) {
          const char * varEnd = strchr(environ[i], '=');
          /* Ignore corrupted environment variables */
@@ -11746,9 +13707,8 @@
              jbyteArray var, val;
              const char * valBeg = varEnd + 1;
              jsize varLength = varEnd - environ[i];
-diff -upr ../orig/jdk/src/solaris/native/java/lang/UNIXProcess_md.c ./jdk/src/solaris/native/java/lang/UNIXProcess_md.c
---- ../orig/jdk/src/solaris/native/java/lang/UNIXProcess_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/lang/UNIXProcess_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/lang/UNIXProcess_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/lang/UNIXProcess_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -40,7 +40,11 @@
  #include <stdlib.h>
  #include <sys/types.h>
@@ -11779,7 +13739,7 @@
  #ifndef STDIN_FILENO
  #define STDIN_FILENO 0
  #endif
-@@ -259,11 +274,89 @@ Java_java_lang_UNIXProcess_waitForProces
+@@ -259,11 +274,89 @@
      }
  }
  
@@ -11870,7 +13830,7 @@
      int from_fd = FAIL_FILENO + 1;
  
      /* We're trying to close all file descriptors, but opendir() might
-@@ -276,13 +369,13 @@ closeDescriptors(void)
+@@ -276,13 +369,13 @@
      close(from_fd);             /* for possible use by opendir() */
      close(from_fd + 1);         /* another one for good luck */
  
@@ -11886,7 +13846,7 @@
          int fd;
          if (isdigit(dirp->d_name[0]) &&
              (fd = strtol(dirp->d_name, NULL, 10)) >= from_fd + 2)
-@@ -293,6 +386,7 @@ closeDescriptors(void)
+@@ -293,6 +386,7 @@
  
      return 1;
  }
@@ -11894,7 +13854,7 @@
  
  static void
  moveDescriptor(int fd_from, int fd_to)
-@@ -438,7 +532,9 @@ execvpe(const char *file, const char *co
+@@ -449,7 +543,9 @@
       * "All identifiers in this volume of IEEE Std 1003.1-2001, except
       * environ, are defined in at least one of the headers" (!)
       */
@@ -11904,7 +13864,7 @@
  
      if (envp != NULL)
          environ = (char **) envp;
-@@ -502,10 +598,15 @@ readFully(int fd, void *buf, size_t nbyt
+@@ -513,10 +609,15 @@
      }
  }
  
@@ -11920,7 +13880,7 @@
  
  JNIEXPORT jint JNICALL
  Java_java_lang_UNIXProcess_forkAndExec(JNIEnv *env,
-@@ -567,6 +668,30 @@ Java_java_lang_UNIXProcess_forkAndExec(J
+@@ -578,6 +679,30 @@
      if (resultPid == 0) {
          /* Child process */
  
@@ -11951,11 +13911,10 @@
          /* Close the parent sides of the pipe.
             Give the child sides of the pipes the right fileno's.
             Closing pipe fds here is redundant, since closeDescriptors()
-diff -upr ../orig/jdk/src/solaris/native/java/lang/java_props_md.c ./jdk/src/solaris/native/java/lang/java_props_md.c
---- ../orig/jdk/src/solaris/native/java/lang/java_props_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/lang/java_props_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/lang/java_props_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/lang/java_props_md.c	2010-06-20 21:56:27.000000000 -0700
 @@ -23,7 +23,7 @@
-  * have any questions.
+  * questions.
   */
  
 -#ifdef __linux__
@@ -11989,7 +13948,7 @@
  
  /* Take an array of string pairs (map of key->value) and a string (key).
   * Examine each pair in the map to see if the first string (key) matches the
-@@ -188,7 +197,12 @@ GetJavaProperties(JNIEnv *env)
+@@ -188,7 +197,12 @@
      {
          char *lc;
          lc = setlocale(LC_CTYPE, "");
@@ -12003,7 +13962,7 @@
          if (lc == NULL) {
              /*
               * 'lc == null' means system doesn't support user's environment
-@@ -219,7 +233,7 @@ GetJavaProperties(JNIEnv *env)
+@@ -219,7 +233,7 @@
              char *p, encoding_variant[64];
              int i, found;
  
@@ -12012,7 +13971,7 @@
              /*
               * Workaround for Solaris bug 4201684: Xlib doesn't like @euro
               * locales. Since we don't depend on the libc @euro behavior,
-@@ -236,6 +250,13 @@ GetJavaProperties(JNIEnv *env)
+@@ -236,6 +250,13 @@
                  *p = '\0';
              setlocale(LC_ALL, temp);
  #endif
@@ -12026,7 +13985,7 @@
  
              strcpy(temp, lc);
  
-@@ -316,6 +337,9 @@ GetJavaProperties(JNIEnv *env)
+@@ -316,6 +337,9 @@
              else
                  p = nl_langinfo(CODESET);
  
@@ -12036,7 +13995,7 @@
              /* Convert the bare "646" used on Solaris to a proper IANA name */
              if (strcmp(p, "646") == 0)
                  p = "ISO646-US";
-@@ -325,6 +349,7 @@ GetJavaProperties(JNIEnv *env)
+@@ -325,6 +349,7 @@
              std_encoding = (*p != '\0') ? p : "ISO8859-1";
  
  
@@ -12044,7 +14003,7 @@
  #ifdef __linux__
              /*
               * Remap the encoding string to a different value for japanese
-@@ -355,11 +380,19 @@ GetJavaProperties(JNIEnv *env)
+@@ -355,11 +380,19 @@
                      std_encoding = "Big5_Solaris";
              }
  #endif
@@ -12064,7 +14023,7 @@
  #ifdef __linux__
  #if __BYTE_ORDER == __LITTLE_ENDIAN
      sprops.unicode_encoding = "UnicodeLittle";
-@@ -369,6 +402,7 @@ GetJavaProperties(JNIEnv *env)
+@@ -369,6 +402,7 @@
  #else
      sprops.unicode_encoding = "UnicodeBig";
  #endif
@@ -12072,7 +14031,7 @@
  
      /* user properties */
      {
-@@ -405,12 +439,14 @@ GetJavaProperties(JNIEnv *env)
+@@ -405,12 +439,14 @@
      sprops.path_separator = ":";
      sprops.line_separator = "\n";
  
@@ -12087,9 +14046,8 @@
  
      return &sprops;
  }
-diff -upr ../orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c ./jdk/src/solaris/native/java/net/Inet4AddressImpl.c
---- ../orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/net/Inet4AddressImpl.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/net/Inet4AddressImpl.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/net/Inet4AddressImpl.c	2010-06-20 21:56:27.000000000 -0700
 @@ -35,17 +35,293 @@
  #include <stdlib.h>
  #include <ctype.h>
@@ -12385,7 +14343,7 @@
  /* gethostname() is in libc.so but I can't find a header file for it */
  extern int gethostname(char *buf, int buf_len);
  #endif
-@@ -85,13 +361,13 @@ Java_java_net_Inet4AddressImpl_getLocalH
+@@ -85,13 +361,13 @@
          char buf2[HENT_BUF_SIZE];
          int h_error=0;
  
@@ -12401,7 +14359,7 @@
              gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET,
                              &res2, buf2, sizeof(buf2), &hp, &h_error);
  #else
-@@ -178,7 +454,7 @@ Java_java_net_Inet4AddressImpl_lookupAll
+@@ -178,7 +454,7 @@
      }
  
      /* Try once, with our static buffer. */
@@ -12410,7 +14368,7 @@
      gethostbyname_r(hostname, &res, buf, sizeof(buf), &hp, &h_error);
  #else
      hp = gethostbyname_r(hostname, &res, buf, sizeof(buf), &h_error);
-@@ -191,7 +467,7 @@ Java_java_net_Inet4AddressImpl_lookupAll
+@@ -191,7 +467,7 @@
       */
      if (hp == NULL && errno == ERANGE) {
          if ((tmp = (char*)malloc(BIG_HENT_BUF_SIZE))) {
@@ -12419,7 +14377,7 @@
              gethostbyname_r(hostname, &res, tmp, BIG_HENT_BUF_SIZE,
                              &hp, &h_error);
  #else
-@@ -281,7 +557,7 @@ Java_java_net_Inet4AddressImpl_getHostBy
+@@ -281,7 +557,7 @@
      addr |= ((caddr[2] <<8) & 0xff00);
      addr |= (caddr[3] & 0xff);
      addr = htonl(addr);
@@ -12428,7 +14386,7 @@
      gethostbyaddr_r((char *)&addr, sizeof(addr), AF_INET, &hent,
                      buf, sizeof(buf), &hp, &h_error);
  #else
-@@ -295,7 +571,7 @@ Java_java_net_Inet4AddressImpl_getHostBy
+@@ -295,7 +571,7 @@
       */
      if (hp == NULL && errno == ERANGE) {
          if ((tmp = (char*)malloc(BIG_HENT_BUF_SIZE))) {
@@ -12437,7 +14395,7 @@
              gethostbyaddr_r((char *)&addr, sizeof(addr), AF_INET,
                              &hent, tmp, BIG_HENT_BUF_SIZE, &hp, &h_error);
  #else
-@@ -317,6 +593,8 @@ Java_java_net_Inet4AddressImpl_getHostBy
+@@ -317,6 +593,8 @@
      return ret;
  }
  
@@ -12446,9 +14404,8 @@
  #define SET_NONBLOCKING(fd) {           \
          int flags = fcntl(fd, F_GETFL); \
          flags |= O_NONBLOCK;            \
-diff -upr ../orig/jdk/src/solaris/native/java/net/Inet6AddressImpl.c ./jdk/src/solaris/native/java/net/Inet6AddressImpl.c
---- ../orig/jdk/src/solaris/native/java/net/Inet6AddressImpl.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/net/Inet6AddressImpl.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/net/Inet6AddressImpl.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/net/Inet6AddressImpl.c	2010-06-20 21:56:28.000000000 -0700
 @@ -32,6 +32,9 @@
  #include <strings.h>
  #include <stdlib.h>
@@ -12468,7 +14425,7 @@
  /* gethostname() is in libc.so but I can't find a header file for it */
  extern int gethostname(char *buf, int buf_len);
  #endif
-@@ -71,10 +74,18 @@ Java_java_net_Inet6AddressImpl_getLocalH
+@@ -71,10 +74,18 @@
          /* Something went wrong, maybe networking is not setup? */
          strcpy(hostname, "localhost");
      } else {
@@ -12489,7 +14446,7 @@
  #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
-@@ -110,7 +121,7 @@ Java_java_net_Inet6AddressImpl_getLocalH
+@@ -110,7 +121,7 @@
              }
          }
  #endif /* AF_INET6 */
@@ -12498,11 +14455,10 @@
      }
      return (*env)->NewStringUTF(env, hostname);
  }
-diff -upr ../orig/jdk/src/solaris/native/java/net/NetworkInterface.c ./jdk/src/solaris/native/java/net/NetworkInterface.c
---- ../orig/jdk/src/solaris/native/java/net/NetworkInterface.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/net/NetworkInterface.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/net/NetworkInterface.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/net/NetworkInterface.c	2010-06-20 21:56:28.000000000 -0700
 @@ -23,13 +23,13 @@
-  * have any questions.
+  * questions.
   */
  
 +#include <sys/types.h>
@@ -12537,7 +14493,7 @@
  
  #ifdef __linux__
  #define ifr_index ifr_ifindex
-@@ -584,6 +597,7 @@ static netif *enumInterfaces(JNIEnv *env
+@@ -584,6 +597,7 @@
  }
  
  
@@ -12545,7 +14501,7 @@
  /*
   * Enumerates and returns all IPv4 interfaces
   */
-@@ -694,6 +708,176 @@ static netif *enumIPv4Interfaces(JNIEnv 
+@@ -694,6 +708,176 @@
      return ifs;
  }
  
@@ -12722,7 +14678,7 @@
  
  #if defined(__solaris__) && defined(AF_INET6)
  /*
-@@ -1014,7 +1198,13 @@ netif *addif(JNIEnv *env, netif *ifs, ch
+@@ -1014,7 +1198,13 @@
              JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
              return ifs;
          }
@@ -12736,7 +14692,7 @@
          currif->addr = NULL;
          currif->childs = NULL;
          currif->virtual = isVirtual;
-@@ -1302,6 +1492,31 @@ int getMacAddress(JNIEnv *env, const str
+@@ -1302,6 +1492,31 @@
     * All bytes to 0 means no hardware address.
     */
    return -1;
@@ -12768,7 +14724,7 @@
  #else
    struct arpreq arpreq;
    struct sockaddr_in* sin;
-@@ -1467,7 +1682,7 @@ JNIEXPORT jint JNICALL Java_java_net_Net
+@@ -1467,7 +1682,7 @@
                                   "Socket creation failed");
    } else {
  
@@ -12777,11 +14733,10 @@
      memset((char *) &if2, 0, sizeof(if2));
      strcpy(if2.ifr_name, name_utf);
  
-diff -upr ../orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c ./jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
---- ../orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	2010-06-20 21:56:28.000000000 -0700
 @@ -23,12 +23,12 @@
-  * have any questions.
+  * questions.
   */
  
 +#include <sys/types.h>
@@ -12795,7 +14750,7 @@
  
  #ifdef __solaris__
  #include <fcntl.h>
-@@ -335,7 +335,7 @@ Java_java_net_PlainDatagramSocketImpl_di
+@@ -335,7 +335,7 @@
      /* The fdObj'fd */
      jint fd;
  
@@ -12804,7 +14759,7 @@
      SOCKADDR addr;
      int len;
  #endif
-@@ -345,26 +345,39 @@ Java_java_net_PlainDatagramSocketImpl_di
+@@ -345,26 +345,39 @@
      }
      fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
  
@@ -12844,7 +14799,7 @@
          // 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.
-@@ -387,6 +400,7 @@ Java_java_net_PlainDatagramSocketImpl_di
+@@ -387,6 +400,7 @@
              NET_Bind(fd, (struct sockaddr *)&addr, len);
          }
      }
@@ -12852,7 +14807,7 @@
  #else
      JVM_Connect(fd, 0, 0);
  #endif
-@@ -2374,18 +2388,30 @@ static void mcast_join_leave(JNIEnv *env
+@@ -2374,18 +2388,30 @@
              mname6.ipv6mr_interface = idx;
          }
  
@@ -12886,10 +14841,9 @@
                  }
              }
          }
-diff -upr ../orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c ./jdk/src/solaris/native/java/net/PlainSocketImpl.c
---- ../orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/net/PlainSocketImpl.c	2009-05-04 17:37:17.000000000 -0400
-@@ -528,9 +528,11 @@ Java_java_net_PlainSocketImpl_socketConn
+--- jdk/src/solaris/native/java/net/PlainSocketImpl.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/net/PlainSocketImpl.c	2010-06-20 21:56:28.000000000 -0700
+@@ -528,9 +528,11 @@
          if (connect_rv == JVM_IO_INTR) {
              JNU_ThrowByName(env, JNU_JAVAIOPKG "InterruptedIOException",
                              "operation interrupted");
@@ -12901,10 +14855,9 @@
          } else if (errno == ECONNREFUSED) {
              NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "ConnectException",
                             "Connection refused");
-diff -upr ../orig/jdk/src/solaris/native/java/net/bsd_close.c ./jdk/src/solaris/native/java/net/bsd_close.c
---- ../orig/jdk/src/solaris/native/java/net/bsd_close.c	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/src/solaris/native/java/net/bsd_close.c	2009-05-04 17:37:15.000000000 -0400
-@@ -57,7 +57,7 @@ typedef struct {
+--- jdk/src/solaris/native/java/net/bsd_close.c	2010-06-27 11:37:43.000000000 -0700
++++ jdk/src/solaris/native/java/net/bsd_close.c	2010-06-20 21:56:28.000000000 -0700
+@@ -57,7 +57,7 @@
  /*
   * Signal to unblock thread
   */
@@ -12913,9 +14866,8 @@
  
  /*
   * The fd table and the number of file descriptors
-diff -upr ../orig/jdk/src/solaris/native/java/net/net_util_md.c ./jdk/src/solaris/native/java/net/net_util_md.c
---- ../orig/jdk/src/solaris/native/java/net/net_util_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/net/net_util_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/net/net_util_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/net/net_util_md.c	2010-06-20 21:56:28.000000000 -0700
 @@ -34,6 +34,15 @@
  #include <stdlib.h>
  #include <dlfcn.h>
@@ -12932,7 +14884,7 @@
  #ifdef __solaris__
  #include <sys/sockio.h>
  #include <stropts.h>
-@@ -219,6 +228,14 @@ NET_GetFileDescriptorID(JNIEnv *env)
+@@ -219,6 +228,14 @@
      return (*env)->GetFieldID(env, cls, "fd", "I");
  }
  
@@ -12947,7 +14899,7 @@
  jint  IPv6_supported()
  {
  #ifndef AF_INET6
-@@ -355,6 +372,7 @@ jint  IPv6_supported()
+@@ -355,6 +372,7 @@
      close(fd);
      return JNI_TRUE;
  }
@@ -12955,7 +14907,7 @@
  
  void
  NET_AllocSockaddr(struct sockaddr **him, int *len) {
-@@ -689,6 +707,10 @@ NET_InetAddressToSockaddr(JNIEnv *env, j
+@@ -689,6 +707,10 @@
          him6->sin6_family = AF_INET6;
          *len = sizeof(struct sockaddr_in6) ;
  
@@ -12966,7 +14918,7 @@
          /*
           * 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)
-@@ -1133,6 +1155,24 @@ NET_SetSockOpt(int fd, int level, int  o
+@@ -1133,6 +1155,24 @@
  #define IPTOS_PREC_MASK 0xe0
  #endif
  
@@ -12991,7 +14943,7 @@
      /*
       * IPPROTO/IP_TOS :-
       * 1. IPv6 on Solaris: no-op and will be set in flowinfo
-@@ -1165,6 +1205,10 @@ NET_SetSockOpt(int fd, int level, int  o
+@@ -1165,6 +1205,10 @@
          *iptos &= (IPTOS_TOS_MASK | IPTOS_PREC_MASK);
      }
  
@@ -13002,7 +14954,7 @@
      /*
       * SOL_SOCKET/{SO_SNDBUF,SO_RCVBUF} - On Solaris need to
       * ensure that value is <= max_buf as otherwise we get
-@@ -1212,6 +1256,83 @@ NET_SetSockOpt(int fd, int level, int  o
+@@ -1212,6 +1256,83 @@
      }
  #endif
  
@@ -13086,9 +15038,8 @@
      return setsockopt(fd, level, opt, arg, len);
  }
  
-diff -upr ../orig/jdk/src/solaris/native/java/net/net_util_md.h ./jdk/src/solaris/native/java/net/net_util_md.h
---- ../orig/jdk/src/solaris/native/java/net/net_util_md.h	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/net/net_util_md.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/java/net/net_util_md.h	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/net/net_util_md.h	2010-06-20 21:56:28.000000000 -0700
 @@ -37,7 +37,7 @@
  #endif
  
@@ -13098,10 +15049,9 @@
  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,
-diff -upr ../orig/jdk/src/solaris/native/java/nio/MappedByteBuffer.c ./jdk/src/solaris/native/java/nio/MappedByteBuffer.c
---- ../orig/jdk/src/solaris/native/java/nio/MappedByteBuffer.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/nio/MappedByteBuffer.c	2009-05-04 17:37:17.000000000 -0400
-@@ -38,7 +38,11 @@ Java_java_nio_MappedByteBuffer_isLoaded0
+--- jdk/src/solaris/native/java/nio/MappedByteBuffer.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/nio/MappedByteBuffer.c	2010-06-20 21:56:28.000000000 -0700
+@@ -38,7 +38,11 @@
                                          jlong address, jlong len)
  {
      jboolean loaded = JNI_TRUE;
@@ -13113,7 +15063,7 @@
      jint numPages = (len + pageSize - 1) / pageSize;
      int result = 0;
      int i = 0;
-@@ -92,7 +96,11 @@ JNIEXPORT void JNICALL
+@@ -92,7 +96,11 @@
  Java_java_nio_MappedByteBuffer_force0(JNIEnv *env, jobject obj, jlong address,
                                        jlong len)
  {
@@ -13125,10 +15075,9 @@
      unsigned long lAddress = address;
  
      jlong offset = lAddress % pageSize;
-diff -upr ../orig/jdk/src/solaris/native/java/util/FileSystemPreferences.c ./jdk/src/solaris/native/java/util/FileSystemPreferences.c
---- ../orig/jdk/src/solaris/native/java/util/FileSystemPreferences.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/util/FileSystemPreferences.c	2009-05-04 17:37:17.000000000 -0400
-@@ -47,8 +47,11 @@ Java_java_util_prefs_FileSystemPreferenc
+--- jdk/src/solaris/native/java/util/FileSystemPreferences.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/util/FileSystemPreferences.c	2010-06-20 21:56:28.000000000 -0700
+@@ -47,8 +47,11 @@
      return (jint) result;
  }
  
@@ -13141,7 +15090,7 @@
  
  /**
   * Try to open a named lock file.
-@@ -86,7 +89,11 @@ Java_java_util_prefs_FileSystemPreferenc
+@@ -86,7 +89,11 @@
      if (fd < 0) {
          result[0] = 0;
      } else {
@@ -13153,7 +15102,7 @@
          result[1] = errno;
          if (rc < 0) {
              result[0]= 0;
-@@ -116,7 +123,11 @@ Java_java_util_prefs_FileSystemPreferenc
+@@ -116,7 +123,11 @@
      fl.l_start = 0;
      fl.l_type = F_UNLCK;
  
@@ -13165,9 +15114,8 @@
  
      if (rc < 0) {
          close(fd);
-diff -upr ../orig/jdk/src/solaris/native/java/util/TimeZone_md.c ./jdk/src/solaris/native/java/util/TimeZone_md.c
---- ../orig/jdk/src/solaris/native/java/util/TimeZone_md.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/java/util/TimeZone_md.c	2009-05-05 17:44:22.000000000 -0400
+--- jdk/src/solaris/native/java/util/TimeZone_md.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/java/util/TimeZone_md.c	2010-06-20 21:56:28.000000000 -0700
 @@ -31,7 +31,7 @@
  #include <errno.h>
  #include <stddef.h>
@@ -13177,24 +15125,16 @@
  #include <string.h>
  #include <dirent.h>
  #include <sys/stat.h>
-@@ -49,11 +49,14 @@
+@@ -49,7 +49,7 @@
  #define fileclose       fclose
  #endif
  
 -#ifdef __linux__
-+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
++#if defined(__linux__)  || defined(_ALLBSD_SOURCE)
  
-+#ifdef __linux__
- static const char *sysconfig_clock_file = "/etc/sysconfig/clock";
-+#endif
-+
- static const char *zoneinfo_dir = "/usr/share/zoneinfo";
--static const char *defailt_zoneinfo_file = "/etc/localtime";
-+static const char *default_zoneinfo_file = "/etc/localtime";
- 
- /*
-  * Returns a point to the zone ID portion of the given zoneinfo file
-@@ -199,7 +202,9 @@ getPlatformTimeZoneID()
+ static const char *ETC_TIMEZONE_FILE = "/etc/timezone";
+ static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
+@@ -199,7 +199,9 @@
      int fd;
      char *buf;
      size_t size;
@@ -13202,9 +15142,9 @@
  
 +#ifdef __linux__
      /*
-      * First, try the ZONE entry in /etc/sysconfig/clock. However, the
-      * ZONE entry is not set up after initial Red Hat Linux
-@@ -254,14 +259,18 @@ getPlatformTimeZoneID()
+      * Try reading the /etc/timezone file for Debian distros. There's
+      * no spec of the file format available. This parsing assumes that
+@@ -223,6 +225,7 @@
              return tz;
          }
      }
@@ -13212,43 +15152,40 @@
  
      /*
       * Next, try /etc/localtime to find the zone ID.
-      */
--    if (lstat(defailt_zoneinfo_file, &statbuf) == -1) {
-+    if (lstat(default_zoneinfo_file, &statbuf) == -1) {
+@@ -231,6 +234,9 @@
          return NULL;
      }
  
-+    strlcpy(zoneinfo_file, default_zoneinfo_file, PATH_MAX+1);
++    strlcpy(zoneinfo_file, DEFAULT_ZONEINFO_FILE, PATH_MAX+1);
 +
 +#if defined(__linux__) || defined(_ALLBSD_SOURCE)
      /*
       * 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
-@@ -270,21 +279,25 @@ getPlatformTimeZoneID()
+@@ -239,21 +245,25 @@
       * from /etc/localtime.)
       */
      if (S_ISLNK(statbuf.st_mode)) {
 -        char linkbuf[PATH_MAX+1];
          int len;
  
--        if ((len = readlink(defailt_zoneinfo_file, linkbuf, sizeof(linkbuf)-1)) == -1) {
-+	if ((len = readlink(default_zoneinfo_file, zoneinfo_file, sizeof(zoneinfo_file)-1)) == -1) {
+-        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",
--                        defailt_zoneinfo_file);
-+                        default_zoneinfo_file);
+                         DEFAULT_ZONEINFO_FILE);
              return NULL;
          }
 -        linkbuf[len] = '\0';
 -        tz = getZoneName(linkbuf);
-+	zoneinfo_file[len] = '\0';
-+	tz = getZoneName(zoneinfo_file);
++        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;
++        } else {
++            if (lstat(zoneinfo_file, &statbuf) == -1) {
++                retuen NULL;
++            }
          }
 -        return tz;
      }
@@ -13256,16 +15193,16 @@
  
      /*
       * If it's a regular file, we need to find out the same zoneinfo file
-@@ -295,7 +308,7 @@ getPlatformTimeZoneID()
+@@ -264,7 +274,7 @@
      if (buf == NULL) {
          return NULL;
      }
--    if ((fd = open(defailt_zoneinfo_file, O_RDONLY)) == -1) {
+-    if ((fd = open(DEFAULT_ZONEINFO_FILE, O_RDONLY)) == -1) {
 +    if ((fd = open(zoneinfo_file, O_RDONLY)) == -1) {
          free((void *) buf);
          return NULL;
      }
-@@ -524,7 +537,7 @@ findJavaTZ_md(const char *java_home_dir,
+@@ -493,7 +503,7 @@
  
      tz = getenv("TZ");
  
@@ -13274,7 +15211,7 @@
      if (tz == NULL) {
  #else
  #ifdef __solaris__
-@@ -563,19 +576,32 @@ getGMTOffsetID()
+@@ -532,19 +542,32 @@
  {
      time_t offset;
      char sign, buf[16];
@@ -13311,9 +15248,8 @@
      sprintf(buf, (const char *)"GMT%c%02d:%02d",
              sign, (int)(offset/3600), (int)((offset%3600)/60));
      return strdup(buf);
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/CUPSfuncs.c ./jdk/src/solaris/native/sun/awt/CUPSfuncs.c
---- ../orig/jdk/src/solaris/native/sun/awt/CUPSfuncs.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/CUPSfuncs.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/CUPSfuncs.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/CUPSfuncs.c	2010-06-20 21:56:28.000000000 -0700
 @@ -25,6 +25,7 @@
  
  #include <jni.h>
@@ -13322,7 +15258,7 @@
  #include <dlfcn.h>
  #include <cups/cups.h>
  #include <cups/ppd.h>
-@@ -65,10 +66,11 @@ fn_ppdPageSize j2d_ppdPageSize;
+@@ -65,10 +66,11 @@
  JNIEXPORT jboolean JNICALL
  Java_sun_print_CUPSPrinter_initIDs(JNIEnv *env,
                                           jobject printObj) {
@@ -13336,9 +15272,8 @@
      if (handle == NULL) {
        return JNI_FALSE;
      }
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/VDrawingArea.c ./jdk/src/solaris/native/sun/awt/VDrawingArea.c
---- ../orig/jdk/src/solaris/native/sun/awt/VDrawingArea.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/VDrawingArea.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/VDrawingArea.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/VDrawingArea.c	2010-06-20 21:56:28.000000000 -0700
 @@ -31,7 +31,11 @@
  #endif /* !HEADLESS */
  
@@ -13351,9 +15286,8 @@
  
  #ifdef __linux__
  /* XXX: Shouldn't be necessary. */
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/X11Color.c ./jdk/src/solaris/native/sun/awt/X11Color.c
---- ../orig/jdk/src/solaris/native/sun/awt/X11Color.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/X11Color.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/X11Color.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/X11Color.c	2010-06-20 21:56:28.000000000 -0700
 @@ -33,7 +33,9 @@
  #include <math.h>
  #include <sys/time.h>
@@ -13364,9 +15298,8 @@
  #ifndef HEADLESS
  #include <X11/Xlib.h>
  #include <X11/Xatom.h>
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/XDrawingArea.c ./jdk/src/solaris/native/sun/awt/XDrawingArea.c
---- ../orig/jdk/src/solaris/native/sun/awt/XDrawingArea.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/XDrawingArea.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/XDrawingArea.c	2010-06-21 14:15:44.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/XDrawingArea.c	2010-06-20 21:56:28.000000000 -0700
 @@ -30,7 +30,11 @@
  #include <Xm/XmP.h>
  
@@ -13379,10 +15312,9 @@
  
  #ifdef DEBUG
  #include <jvm.h>  /* To get jio_fprintf() */
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_Font.c ./jdk/src/solaris/native/sun/awt/awt_Font.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_Font.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_Font.c	2009-05-04 17:37:17.000000000 -0400
-@@ -334,7 +334,7 @@ loadFont(Display * display, char *name, 
+--- jdk/src/solaris/native/sun/awt/awt_Font.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_Font.c	2010-06-20 21:56:28.000000000 -0700
+@@ -334,7 +334,7 @@
              if (strcmp(style, "regular") == 0) {
                  altstyle = "roman";
              }
@@ -13391,9 +15323,8 @@
              if (!strcmp(family, "lucidasans")) {
                  family = "lucida";
              }
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c ./jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	2010-06-20 21:56:28.000000000 -0700
 @@ -40,6 +40,7 @@
  #include <jni.h>
  #include <jni_util.h>
@@ -13411,7 +15342,7 @@
  #ifdef NETSCAPE
  #include <signal.h>
  extern int awt_init_xt;
-@@ -122,7 +125,7 @@ static char *x11GraphicsConfigClassName 
+@@ -122,7 +125,7 @@
   */
  
  #define MAXFRAMEBUFFERS 16
@@ -13420,7 +15351,7 @@
  typedef struct {
     int   screen_number;
     short x_org;
-@@ -631,19 +634,22 @@ void checkNewXineramaScreen(JNIEnv* env,
+@@ -631,19 +634,22 @@
  #endif /* HEADLESS */
  
  #ifndef HEADLESS
@@ -13448,7 +15379,7 @@
          XineramaQueryScreens = (XineramaQueryScreensFunc*)
              dlsym(libHandle, XineramaQueryScreensName);
  
-@@ -679,11 +685,10 @@ static void xinerama_init_linux()
+@@ -679,11 +685,10 @@
      }
  }
  #endif
@@ -13462,7 +15393,7 @@
      unsigned char fbhints[MAXFRAMEBUFFERS];
      int32_t locNumScr = 0;
      /* load and run XineramaGetInfo */
-@@ -692,8 +697,8 @@ static void xinerama_init_solaris()
+@@ -692,8 +697,8 @@
      XineramaGetInfoFunc* XineramaSolarisFunc = NULL;
  
      /* load library */
@@ -13473,7 +15404,7 @@
          XineramaSolarisFunc = (XineramaGetInfoFunc*)dlsym(libHandle, XineramaGetInfoName);
          XineramaSolarisCenterFunc =
              (XineramaGetCenterHintFunc*)dlsym(libHandle, XineramaGetCenterHintName);
-@@ -740,11 +745,11 @@ static void xineramaInit(void) {
+@@ -740,11 +745,11 @@
      }
  
      DTRACE_PRINTLN("Xinerama extension is available");
@@ -13487,7 +15418,7 @@
  }
  #endif /* HEADLESS */
  
-@@ -1600,7 +1605,7 @@ Java_sun_awt_X11GraphicsEnvironment_getX
+@@ -1600,7 +1605,7 @@
  {
      jobject point = NULL;
  #ifndef HEADLESS    /* return NULL in HEADLESS, Linux */
@@ -13496,7 +15427,7 @@
      int x,y;
  
      AWT_LOCK();
-@@ -1613,7 +1618,7 @@ Java_sun_awt_X11GraphicsEnvironment_getX
+@@ -1613,7 +1618,7 @@
          DTRACE_PRINTLN("unable to call XineramaSolarisCenterFunc: symbol is null");
      }
      AWT_FLUSH_UNLOCK();
@@ -13505,7 +15436,7 @@
  #endif /* HEADLESS */
      return point;
  }
-@@ -1678,7 +1683,11 @@ X11GD_InitXrandrFuncs(JNIEnv *env)
+@@ -1678,7 +1683,11 @@
  {
      int rr_maj_ver = 0, rr_min_ver = 0;
  
@@ -13518,10 +15449,9 @@
      if (pLibRandR == NULL) {
          J2dRlsTraceLn(J2D_TRACE_ERROR,
                        "X11GD_InitXrandrFuncs: Could not open libXrandr.so.2");
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_InputMethod.c ./jdk/src/solaris/native/sun/awt/awt_InputMethod.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_InputMethod.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_InputMethod.c	2009-05-04 17:37:17.000000000 -0400
-@@ -69,7 +69,7 @@ static void PreeditDrawCallback(XIC, XPo
+--- jdk/src/solaris/native/sun/awt/awt_InputMethod.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_InputMethod.c	2010-06-20 21:56:28.000000000 -0700
+@@ -69,7 +69,7 @@
                                  XIMPreeditDrawCallbackStruct *);
  static void PreeditCaretCallback(XIC, XPointer,
                                   XIMPreeditCaretCallbackStruct *);
@@ -13530,7 +15460,7 @@
  static void StatusStartCallback(XIC, XPointer, XPointer);
  static void StatusDoneCallback(XIC, XPointer, XPointer);
  static void StatusDrawCallback(XIC, XPointer,
-@@ -83,7 +83,7 @@ static void StatusDrawCallback(XIC, XPoi
+@@ -83,7 +83,7 @@
  #define PreeditDoneIndex        1
  #define PreeditDrawIndex        2
  #define PreeditCaretIndex       3
@@ -13539,7 +15469,7 @@
  #define StatusStartIndex        4
  #define StatusDoneIndex         5
  #define StatusDrawIndex         6
-@@ -101,14 +101,14 @@ static XIMProc callback_funcs[NCALLBACKS
+@@ -101,14 +101,14 @@
      (XIMProc)PreeditDoneCallback,
      (XIMProc)PreeditDrawCallback,
      (XIMProc)PreeditCaretCallback,
@@ -13556,7 +15486,7 @@
  #define MAX_STATUS_LEN  100
  typedef struct {
      Window   w;                /*status window id        */
-@@ -148,7 +148,7 @@ typedef struct _X11InputMethodData {
+@@ -148,7 +148,7 @@
  #endif /* XAWT */
      jobject     x11inputmethod; /* global ref to X11InputMethod instance */
                                  /* associated with the XIC */
@@ -13565,7 +15495,7 @@
      StatusWindow *statusWindow; /* our own status window  */
  #else
  #ifndef XAWT
-@@ -427,7 +427,7 @@ destroyX11InputMethodData(JNIEnv *env, X
+@@ -427,7 +427,7 @@
  static void
  freeX11InputMethodData(JNIEnv *env, X11InputMethodData *pX11IMData)
  {
@@ -13574,7 +15504,7 @@
      if (pX11IMData->statusWindow != NULL){
          StatusWindow *sw = pX11IMData->statusWindow;
          XFreeGC(awt_display, sw->lightGC);
-@@ -533,7 +533,7 @@ awt_x11inputmethod_lookupString(XKeyPres
+@@ -533,7 +533,7 @@
      pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance);
  
      if (pX11IMData == NULL) {
@@ -13583,7 +15513,7 @@
          return False;
  #else
          return result;
-@@ -541,7 +541,7 @@ awt_x11inputmethod_lookupString(XKeyPres
+@@ -541,7 +541,7 @@
      }
  
      if ((ic = pX11IMData->current_ic) == (XIC)0){
@@ -13592,7 +15522,7 @@
          return False;
  #else
          return result;
-@@ -650,7 +650,7 @@ awt_x11inputmethod_lookupString(XKeyPres
+@@ -650,7 +650,7 @@
      return result;
  }
  
@@ -13601,7 +15531,7 @@
  static StatusWindow *createStatusWindow(
  #ifdef XAWT
                                  Window parent) {
-@@ -994,7 +994,7 @@ void adjustStatusWindow(Widget shell){
+@@ -994,7 +994,7 @@
          }
      }
  }
@@ -13610,7 +15540,7 @@
  /*
   * Creates two XICs, one for active clients and the other for passive
   * clients. All information on those XICs are stored in the
-@@ -1051,7 +1051,7 @@ createXIC(Widget w, X11InputMethodData *
+@@ -1051,7 +1051,7 @@
          return FALSE ;
      }
  
@@ -13619,7 +15549,7 @@
      on_the_spot_styles |= XIMStatusNothing;
  
      /*kinput does not support XIMPreeditCallbacks and XIMStatusArea
-@@ -1064,7 +1064,7 @@ createXIC(Widget w, X11InputMethodData *
+@@ -1064,7 +1064,7 @@
              break;
          }
      }
@@ -13628,7 +15558,7 @@
  #ifdef XAWT
      on_the_spot_styles |= XIMStatusNothing;
  #else /* !XAWT */
-@@ -1087,7 +1087,7 @@ createXIC(Widget w, X11InputMethodData *
+@@ -1087,7 +1087,7 @@
          on_the_spot_styles |= XIMStatusNothing;
  
  #endif /* XAWT */
@@ -13637,7 +15567,7 @@
  
      for (i = 0; i < im_styles->count_styles; i++) {
          active_styles |= im_styles->supported_styles[i] & on_the_spot_styles;
-@@ -1135,7 +1135,7 @@ createXIC(Widget w, X11InputMethodData *
+@@ -1135,7 +1135,7 @@
                          NULL);
          if (preedit == (XVaNestedList)NULL)
              goto err;
@@ -13646,7 +15576,7 @@
          /*always try XIMStatusCallbacks for active client...*/
          {
              status = (XVaNestedList)XVaCreateNestedList(0,
-@@ -1157,7 +1157,7 @@ createXIC(Widget w, X11InputMethodData *
+@@ -1157,7 +1157,7 @@
              XFree((void *)status);
              XFree((void *)preedit);
          }
@@ -13655,7 +15585,7 @@
  #ifndef XAWT
          if (on_the_spot_styles & XIMStatusArea) {
              Widget parent;
-@@ -1185,7 +1185,7 @@ createXIC(Widget w, X11InputMethodData *
+@@ -1185,7 +1185,7 @@
          }
  #endif /* XAWT */
          XFree((void *)preedit);
@@ -13664,7 +15594,7 @@
          pX11IMData->ic_passive = XCreateIC(X11im,
                                             XNClientWindow, XtWindow(w),
                                             XNFocusWindow, XtWindow(w),
-@@ -1344,7 +1344,7 @@ PreeditCaretCallback(XIC ic, XPointer cl
+@@ -1344,7 +1344,7 @@
  
  }
  
@@ -13673,7 +15603,7 @@
  static void
  StatusStartCallback(XIC ic, XPointer client_data, XPointer call_data)
  {
-@@ -1412,7 +1412,7 @@ StatusDrawCallback(XIC ic, XPointer clie
+@@ -1412,7 +1412,7 @@
   finally:
      AWT_UNLOCK();
  }
@@ -13682,7 +15612,7 @@
  
  static void CommitStringCallback(XIC ic, XPointer client_data, XPointer call_data) {
      JNIEnv *env = GetJNIEnv();
-@@ -1522,14 +1522,14 @@ Java_sun_awt_motif_MInputMethod_openXIMN
+@@ -1522,14 +1522,14 @@
  /* Use IMInstantiate call back only on Linux, as there is a bug in Solaris
     (4768335)
  */
@@ -13699,7 +15629,7 @@
      }
  #endif
  
-@@ -1593,13 +1593,13 @@ Java_sun_awt_motif_MInputMethod_createXI
+@@ -1593,13 +1593,13 @@
  #endif /* XAWT */
      globalRef = (*env)->NewGlobalRef(env, this);
      pX11IMData->x11inputmethod = globalRef;
@@ -13716,7 +15646,7 @@
  
      pX11IMData->lookup_buf = 0;
      pX11IMData->lookup_buf_len = 0;
-@@ -1746,14 +1746,14 @@ Java_sun_awt_X11_XInputMethod_setXICFocu
+@@ -1746,14 +1746,14 @@
          setXICFocus(pX11IMData->current_ic, req);
          currentX11InputMethodInstance = pX11IMData->x11inputmethod;
          currentFocusWindow =  XtWindow(w);
@@ -13733,7 +15663,7 @@
          onoffStatusWindow(pX11IMData, 0, False);
          if (pX11IMData->current_ic != NULL)
  #endif
-@@ -1770,7 +1770,7 @@ JNIEXPORT void JNICALL
+@@ -1770,7 +1770,7 @@
  Java_sun_awt_X11InputMethod_turnoffStatusWindow(JNIEnv *env,
                                                  jobject this)
  {
@@ -13742,7 +15672,7 @@
      X11InputMethodData *pX11IMData;
      StatusWindow *statusWindow;
  
-@@ -1867,7 +1867,7 @@ Java_sun_awt_motif_MInputMethod_configur
+@@ -1867,7 +1867,7 @@
      X11InputMethodData *pX11IMData;
      XVaNestedList status;
  
@@ -13751,7 +15681,7 @@
        /*do nothing for linux? */
  #else
      AWT_LOCK();
-@@ -1973,7 +1973,7 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_
+@@ -1973,7 +1973,7 @@
  JNIEXPORT void JNICALL Java_sun_awt_X11_XInputMethod_adjustStatusWindow
    (JNIEnv *env, jobject this, jlong window)
  {
@@ -13760,10 +15690,9 @@
      AWT_LOCK();
      adjustStatusWindow(window);
      AWT_UNLOCK();
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c ./jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c	2009-05-04 17:37:17.000000000 -0400
-@@ -260,7 +260,11 @@ AWT_OnLoad(JavaVM *vm, void *reserved)
+--- jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c	2010-06-20 21:56:28.000000000 -0700
+@@ -260,7 +260,11 @@
          }
      }
  
@@ -13775,9 +15704,8 @@
  
      JNU_CallStaticMethodByName(env, NULL, "java/lang/System", "load",
                                 "(Ljava/lang/String;)V",
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_MToolkit.c ./jdk/src/solaris/native/sun/awt/awt_MToolkit.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_MToolkit.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_MToolkit.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/awt_MToolkit.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_MToolkit.c	2010-06-20 21:56:28.000000000 -0700
 @@ -63,8 +63,9 @@
  extern JavaVM *jvm;
  
@@ -13789,7 +15717,7 @@
  #endif
  #endif /* !HEADLESS */
  
-@@ -1642,7 +1643,7 @@ processOneEvent(XtInputMask iMask) {
+@@ -1642,7 +1643,7 @@
                */
                Widget widget=XtWindowToWidget(awt_display, xev.xany.window);
                eventNumber++;
@@ -13798,9 +15726,8 @@
                statusWindowEventHandler(xev);
  #endif
                xembed_eventHandler(&xev);
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_Mlib.c ./jdk/src/solaris/native/sun/awt/awt_Mlib.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_Mlib.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_Mlib.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/awt_Mlib.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_Mlib.c	2010-06-20 21:56:28.000000000 -0700
 @@ -32,6 +32,7 @@
  #include <dlfcn.h>
  #include "jni.h"
@@ -13809,7 +15736,7 @@
  #include "awt_Mlib.h"
  #include "java_awt_image_BufferedImage.h"
  
-@@ -67,11 +68,11 @@ mlib_status awt_getImagingLib(JNIEnv *en
+@@ -67,11 +68,11 @@
          ((strncmp(name.machine, "sun4v" , 5) == 0) &&
           (getenv("USE_VIS_ON_SUN4V") != NULL)))
      {
@@ -13823,9 +15750,8 @@
      }
  
      if (handle == NULL) {
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_Robot.c ./jdk/src/solaris/native/sun/awt/awt_Robot.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_Robot.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_Robot.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/awt_Robot.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_Robot.c	2010-06-20 21:56:28.000000000 -0700
 @@ -45,7 +45,7 @@
  #include "wsutils.h"
  #include "list.h"
@@ -13835,10 +15761,9 @@
  #include <sys/socket.h>
  #endif
  
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_util.h ./jdk/src/solaris/native/sun/awt/awt_util.h
---- ../orig/jdk/src/solaris/native/sun/awt/awt_util.h	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_util.h	2009-05-04 17:37:17.000000000 -0400
-@@ -187,15 +187,20 @@ JNU_GetCharField(JNIEnv *env, jobject se
+--- jdk/src/solaris/native/sun/awt/awt_util.h	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_util.h	2010-06-20 21:56:28.000000000 -0700
+@@ -187,15 +187,20 @@
  #ifdef __solaris__
  extern Widget awt_util_getXICStatusAreaWindow(Widget w);
  #else
@@ -13860,10 +15785,9 @@
  typedef struct _XmImRefRec {
    Cardinal      num_refs;       /* Number of referencing widgets. */
    Cardinal      max_refs;       /* Maximum length of refs array. */
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_wm.c ./jdk/src/solaris/native/sun/awt/awt_wm.c
---- ../orig/jdk/src/solaris/native/sun/awt/awt_wm.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_wm.c	2009-05-04 17:37:17.000000000 -0400
-@@ -121,12 +121,19 @@ static Atom XA_KWM_WIN_ICONIFIED;
+--- jdk/src/solaris/native/sun/awt/awt_wm.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_wm.c	2010-06-20 21:56:28.000000000 -0700
+@@ -121,12 +121,19 @@
  static Atom XA_KWM_WIN_MAXIMIZED;
  
  /* OpenLook */
@@ -13883,7 +15807,7 @@
  /* For _NET_WM_STATE ClientMessage requests */
  #define _NET_WM_STATE_REMOVE    0 /* remove/unset property */
  #define _NET_WM_STATE_ADD       1 /* add/set property      */
-@@ -193,7 +200,12 @@ awt_wm_initAtoms(void)
+@@ -193,7 +200,12 @@
          { &_XA_OL_DECOR_HEADER,              "_OL_DECOR_HEADER"              },
          { &_XA_OL_DECOR_RESIZE,              "_OL_DECOR_RESIZE"              },
          { &_XA_OL_DECOR_PIN,                 "_OL_DECOR_PIN"                 },
@@ -13897,7 +15821,7 @@
      };
  #define ATOM_LIST_LENGTH (sizeof(atom_list)/sizeof(atom_list[0]))
  
-@@ -942,6 +954,39 @@ awt_wm_isMotif(void)
+@@ -942,6 +954,39 @@
      return True;
  }
  
@@ -13937,7 +15861,7 @@
  
  static Boolean
  awt_wm_isNetWMName(char *name)
-@@ -1280,6 +1325,12 @@ awt_wm_getRunningWM(void)
+@@ -1280,6 +1325,12 @@
      else if (awt_wm_isKDE2()) {
          awt_wmgr = KDE2_WM;
      }
@@ -13950,7 +15874,7 @@
      /*
       * We don't check for legacy WM when we already know that WM
       * supports WIN or _NET wm spec.
-@@ -1302,6 +1353,9 @@ awt_wm_getRunningWM(void)
+@@ -1302,6 +1353,9 @@
          awt_wmgr = MOTIF_WM;
      }
      else if (awt_wm_isOpenLook()) {
@@ -13960,10 +15884,9 @@
          awt_wmgr = OPENLOOK_WM;
      }
      else {
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/awt_wm.h ./jdk/src/solaris/native/sun/awt/awt_wm.h
---- ../orig/jdk/src/solaris/native/sun/awt/awt_wm.h	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/awt_wm.h	2009-05-04 17:37:17.000000000 -0400
-@@ -45,7 +45,10 @@ enum wmgr_t {
+--- jdk/src/solaris/native/sun/awt/awt_wm.h	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/awt_wm.h	2010-06-20 21:56:28.000000000 -0700
+@@ -45,7 +45,10 @@
      KDE2_WM,
      SAWFISH_WM,
      ICE_WM,
@@ -13975,10 +15898,9 @@
  };
  
  extern void awt_wm_init(void);
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/extutil.h ./jdk/src/solaris/native/sun/awt/extutil.h
---- ../orig/jdk/src/solaris/native/sun/awt/extutil.h	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/extutil.h	2009-05-04 17:37:17.000000000 -0400
-@@ -58,7 +58,7 @@ in this Software without prior written a
+--- jdk/src/solaris/native/sun/awt/extutil.h	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/extutil.h	2010-06-20 21:56:28.000000000 -0700
+@@ -58,7 +58,7 @@
   */
  /* $XFree86: xc/include/extensions/extutil.h,v 1.5 2001/01/17 17:53:20 dawes Exp $ */
  
@@ -13987,17 +15909,16 @@
  
  #ifndef _EXTUTIL_H_
  #define _EXTUTIL_H_
-@@ -248,4 +248,4 @@ char *proc (Display *dpy, int code, XExt
+@@ -248,4 +248,4 @@
          char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
  #endif
  
 -#endif /* __linux__ */
 +#endif /* __linux__ || _ALLBSD_SOURCE */
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/fontpath.c ./jdk/src/solaris/native/sun/awt/fontpath.c
---- ../orig/jdk/src/solaris/native/sun/awt/fontpath.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/fontpath.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/fontpath.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/fontpath.c	2010-06-20 21:56:28.000000000 -0700
 @@ -23,7 +23,7 @@
-  * have any questions.
+  * questions.
   */
  
 -#ifdef __linux__
@@ -14039,7 +15960,7 @@
  /*
   * This can be set in the makefile to "/usr/X11" if so desired.
   */
-@@ -111,24 +126,40 @@ static char *fullSolarisFontPath[] = {
+@@ -111,24 +126,40 @@
      NULL, /* terminates the list */
  };
  
@@ -14092,7 +16013,7 @@
      NULL, /* terminates the list */
  };
  #endif
-@@ -351,7 +382,7 @@ static char **getX11FontPath ()
+@@ -351,7 +382,7 @@
  
  #endif /* !HEADLESS */
  
@@ -14101,7 +16022,7 @@
  /* from awt_LoadLibrary.c */
  JNIEXPORT jboolean JNICALL AWTIsHeadless();
  #endif
-@@ -476,8 +507,10 @@ static char *getPlatformFontPathChars(JN
+@@ -476,8 +507,10 @@
       */
      fcdirs = getFontConfigLocations();
  
@@ -14113,7 +16034,7 @@
  #else /* IF SOLARIS */
      knowndirs = fullSolarisFontPath;
  #endif
-@@ -488,7 +521,8 @@ static char *getPlatformFontPathChars(JN
+@@ -488,7 +521,8 @@
       * be initialised.
       */
  #ifndef HEADLESS
@@ -14123,7 +16044,7 @@
      if (!AWTIsHeadless()) { /* .. so need to call a function to check */
  #endif
      AWT_LOCK();
-@@ -496,7 +530,7 @@ static char *getPlatformFontPathChars(JN
+@@ -496,7 +530,7 @@
          x11dirs = getX11FontPath();
      }
      AWT_UNLOCK();
@@ -14132,7 +16053,7 @@
      }
  #endif
  #endif /* !HEADLESS */
-@@ -608,7 +642,7 @@ Java_sun_font_FontManager_populateFontFi
+@@ -608,7 +642,7 @@
  }
  
  #include <dlfcn.h>
@@ -14141,7 +16062,7 @@
  #include <link.h>
  #endif
  
-@@ -654,9 +688,9 @@ static void* openFontConfig() {
+@@ -654,9 +688,9 @@
       * certain symbols - and functionality - to be available.
       * Also add explicit search for .so.1 in case .so symlink doesn't exist.
       */
@@ -14153,9 +16074,8 @@
          if (libfontconfig == NULL) {
              return NULL;
          }
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/gtk2_interface.c ./jdk/src/solaris/native/sun/awt/gtk2_interface.c
---- ../orig/jdk/src/solaris/native/sun/awt/gtk2_interface.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/gtk2_interface.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/gtk2_interface.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/gtk2_interface.c	2010-06-20 21:56:28.000000000 -0700
 @@ -30,8 +30,9 @@
  #include <string.h>
  #include "gtk2_interface.h"
@@ -14167,10 +16087,9 @@
  
  #define G_TYPE_INVALID                  G_TYPE_MAKE_FUNDAMENTAL (0)
  #define G_TYPE_NONE                     G_TYPE_MAKE_FUNDAMENTAL (1)
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/list.c ./jdk/src/solaris/native/sun/awt/list.c
---- ../orig/jdk/src/solaris/native/sun/awt/list.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/list.c	2009-05-04 17:37:17.000000000 -0400
-@@ -66,7 +66,11 @@ from the X Consortium.
+--- jdk/src/solaris/native/sun/awt/list.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/list.c	2010-06-20 21:56:28.000000000 -0700
+@@ -66,7 +66,11 @@
    ----------------------------------------------------------------------- **/
  
  #include <stdio.h>
@@ -14182,9 +16101,8 @@
  #include "list.h"
  
  
-diff -upr ../orig/jdk/src/solaris/native/sun/awt/robot_common.c ./jdk/src/solaris/native/sun/awt/robot_common.c
---- ../orig/jdk/src/solaris/native/sun/awt/robot_common.c	2009-01-27 15:45:50.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/awt/robot_common.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/awt/robot_common.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/awt/robot_common.c	2010-06-20 21:56:28.000000000 -0700
 @@ -27,6 +27,9 @@
      #error This file should not be included in headless library
  #endif
@@ -14195,9 +16113,8 @@
  #include "robot_common.h"
  
  /*
-diff -upr ../orig/jdk/src/solaris/native/sun/font/X11FontScaler.c ./jdk/src/solaris/native/sun/font/X11FontScaler.c
---- ../orig/jdk/src/solaris/native/sun/font/X11FontScaler.c	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/font/X11FontScaler.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/font/X11FontScaler.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/font/X11FontScaler.c	2010-06-20 21:56:28.000000000 -0700
 @@ -32,7 +32,11 @@
   * into X11FontScaler_md.c, which is compiled into another library.
   */
@@ -14210,9 +16127,8 @@
  #include <ctype.h>
  #include <sys/utsname.h>
  
-diff -upr ../orig/jdk/src/solaris/native/sun/font/X11TextRenderer.c ./jdk/src/solaris/native/sun/font/X11TextRenderer.c
---- ../orig/jdk/src/solaris/native/sun/font/X11TextRenderer.c	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/font/X11TextRenderer.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/font/X11TextRenderer.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/font/X11TextRenderer.c	2010-06-20 21:56:28.000000000 -0700
 @@ -39,7 +39,11 @@
  #include "GraphicsPrimitiveMgr.h"
  #include "glyphblitting.h"
@@ -14225,9 +16141,8 @@
  
  
  JNIEXPORT void JNICALL AWTDrawGlyphList
-diff -upr ../orig/jdk/src/solaris/native/sun/java2d/j2d_md.h ./jdk/src/solaris/native/sun/java2d/j2d_md.h
---- ../orig/jdk/src/solaris/native/sun/java2d/j2d_md.h	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/java2d/j2d_md.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/java2d/j2d_md.h	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/java2d/j2d_md.h	2010-06-20 21:56:28.000000000 -0700
 @@ -28,11 +28,11 @@
  #include <sys/types.h>
  
@@ -14243,9 +16158,8 @@
  
  typedef unsigned char   jubyte;
  typedef unsigned short  jushort;
-diff -upr ../orig/jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c ./jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c
---- ../orig/jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c	2010-06-20 21:56:28.000000000 -0700
 @@ -66,6 +66,10 @@
   *    MLIB_EDGE_SRC_PADDED
   */
@@ -14257,7 +16171,7 @@
  #include <mlib_image.h>
  #include <mlib_ImageZoom.h>
  
-@@ -102,7 +106,7 @@ typedef union {
+@@ -102,7 +106,7 @@
  
  /***************************************************************/
  
@@ -14266,7 +16180,7 @@
  
  static const mlib_u32 mlib_bit_mask4[16] = {
    0x00000000u, 0xFF000000u, 0x00FF0000u, 0xFFFF0000u,
-@@ -111,7 +115,7 @@ static const mlib_u32 mlib_bit_mask4[16]
+@@ -111,7 +115,7 @@
    0x0000FFFFu, 0xFF00FFFFu, 0x00FFFFFFu, 0xFFFFFFFFu
  };
  
@@ -14275,7 +16189,7 @@
  
  static const mlib_u32 mlib_bit_mask4[16] = {
    0x00000000u, 0x000000FFu, 0x0000FF00u, 0x0000FFFFu,
-@@ -120,7 +124,7 @@ static const mlib_u32 mlib_bit_mask4[16]
+@@ -120,7 +124,7 @@
    0xFFFF0000u, 0xFFFF00FFu, 0xFFFFFF00u, 0xFFFFFFFFu
  };
  
@@ -14284,7 +16198,7 @@
  
  /***************************************************************/
  
-@@ -344,11 +348,11 @@ mlib_status mlib_ImageZoom_BIT_1_Nearest
+@@ -344,11 +348,11 @@
  #ifdef _NO_LONGLONG
  
  typedef struct {
@@ -14299,7 +16213,7 @@
  } two_uint;
  
  /***************************************************************/
-@@ -511,11 +515,11 @@ mlib_status mlib_ImageZoom_BitToGray_1_N
+@@ -511,11 +515,11 @@
          DTYPE mask;
          MASK(mask);
          off *= 8;
@@ -14314,7 +16228,7 @@
  
  #ifdef __SUNPRO_C
  #pragma pipeloop(0)
-@@ -540,30 +544,30 @@ mlib_status mlib_ImageZoom_BitToGray_1_N
+@@ -540,30 +544,30 @@
  
            res = (res & 0xff) | (res >> 8);
            dd = gray_mask[res];
@@ -14351,10 +16265,9 @@
          LOGIC(da[0], dtmp, dtmp1, |);
        }
        else {                                               /* aligned */
-diff -upr ../orig/jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c ./jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c
---- ../orig/jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c	2009-05-04 17:37:17.000000000 -0400
-@@ -794,7 +794,7 @@ static AnyFunc* hash_table_vis[HASH_SIZE
+--- jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/java2d/loops/vis_FuncArray.c	2010-06-20 21:56:28.000000000 -0700
+@@ -794,7 +794,7 @@
  static int initialized;
  static int usevis = JNI_TRUE;
  
@@ -14363,9 +16276,8 @@
  #   define ULTRA_CHIP   "sparc64"
  #else
  #   define ULTRA_CHIP   "sun4u"
-diff -upr ../orig/jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h ./jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h
---- ../orig/jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h	2010-06-20 21:56:28.000000000 -0700
 @@ -27,7 +27,10 @@
  #define OGLFuncs_md_h_Included
  
@@ -14377,7 +16289,7 @@
  #include "J2D_GL/glx.h"
  #include "OGLFuncMacros.h"
  
-@@ -113,7 +116,7 @@ do { \
+@@ -113,7 +116,7 @@
      { \
          char *libGLPath = getenv("J2D_ALT_LIBGL_PATH"); \
          if (libGLPath == NULL) { \
@@ -14386,9 +16298,8 @@
          } \
          OGL_LIB_HANDLE = dlopen(libGLPath, RTLD_LAZY | RTLD_LOCAL); \
      } \
-diff -upr ../orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c ./jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c
---- ../orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	2010-06-20 21:56:28.000000000 -0700
 @@ -32,6 +32,7 @@
  #include "gdefs.h"
  
@@ -14397,7 +16308,7 @@
  #include "awt_Component.h"
  #include "awt_GraphicsEnv.h"
  
-@@ -128,7 +129,7 @@ Java_sun_java2d_x11_X11SurfaceData_initI
+@@ -128,7 +129,7 @@
  
      if (tryDGA && (getenv("NO_J2D_DGA") == NULL)) {
      /* we use RTLD_NOW because of bug 4032715 */
@@ -14406,9 +16317,8 @@
      }
      dgaAvailable = JNI_FALSE;
      if (lib != NULL) {
-diff -upr ../orig/jdk/src/solaris/native/sun/jdga/dgalock.c ./jdk/src/solaris/native/sun/jdga/dgalock.c
---- ../orig/jdk/src/solaris/native/sun/jdga/dgalock.c	2009-01-27 15:45:51.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/jdga/dgalock.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/jdga/dgalock.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/jdga/dgalock.c	2010-06-20 21:56:28.000000000 -0700
 @@ -44,6 +44,7 @@
  #include <X11/Xlib.h>
  
@@ -14417,7 +16327,7 @@
  #include "jdga.h"
  #include "jdgadevice.h"
  
-@@ -84,10 +85,10 @@ Drawable GetVirtualDrawableStub(Display 
+@@ -84,10 +85,10 @@
  static GetVirtualDrawableFunc * GetVirtualDrawable = GetVirtualDrawableStub;
  
  static void Solaris_DGA_XineramaInit(Display *display) {
@@ -14431,9 +16341,8 @@
              void *sym = dlsym(handle, "IsXineramaOn");
              IsXineramaOn = (IsXineramaOnFunc *)sym;
              if (IsXineramaOn != 0 && (*IsXineramaOn)(display)) {
-diff -upr ../orig/jdk/src/solaris/native/sun/management/FileSystemImpl.c ./jdk/src/solaris/native/sun/management/FileSystemImpl.c
---- ../orig/jdk/src/solaris/native/sun/management/FileSystemImpl.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/management/FileSystemImpl.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/management/FileSystemImpl.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/management/FileSystemImpl.c	2010-06-20 21:56:28.000000000 -0700
 @@ -26,6 +26,10 @@
  #include <sys/types.h>
  #include <sys/stat.h>
@@ -14445,9 +16354,8 @@
  #include "jni.h"
  #include "jni_util.h"
  #include "sun_management_FileSystemImpl.h"
-diff -upr ../orig/jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c ./jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c
---- ../orig/jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c	2010-06-20 21:56:28.000000000 -0700
 @@ -33,7 +33,7 @@
  #include <strings.h>
  #endif
@@ -14457,9 +16365,8 @@
  #include <string.h>
  #endif
  
-diff -upr ../orig/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c ./jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c
---- ../orig/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c	2010-06-20 21:56:28.000000000 -0700
 @@ -26,11 +26,12 @@
  #include "jni.h"
  #include "jni_util.h"
@@ -14474,7 +16381,7 @@
  #include <string.h>
  #else
  #include <strings.h>
-@@ -109,8 +110,9 @@ Java_sun_net_spi_DefaultProxySelector_in
+@@ -109,8 +110,9 @@
    /**
     * Let's try to load le GConf-2 library
     */
@@ -14486,9 +16393,8 @@
      gconf_ver = 2;
    }
    if (gconf_ver > 0) {
-diff -upr ../orig/jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c ./jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c
---- ../orig/jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	2010-06-20 21:56:28.000000000 -0700
 @@ -35,7 +35,7 @@
  #include <string.h>
  #include <errno.h>
@@ -14498,7 +16404,7 @@
  #include <netinet/in.h>
  #endif
  
-@@ -86,7 +86,7 @@ Java_sun_nio_ch_DatagramChannelImpl_disc
+@@ -86,7 +86,7 @@
      rv = connect(fd, 0, 0);
  #endif
  
@@ -14507,7 +16413,7 @@
      {
          int len;
          SOCKADDR sa;
-@@ -96,17 +96,30 @@ Java_sun_nio_ch_DatagramChannelImpl_disc
+@@ -96,17 +96,30 @@
  #ifdef AF_INET6
          if (ipv6_available()) {
              struct sockaddr_in6 *him6 = (struct sockaddr_in6 *)&sa;
@@ -14538,9 +16444,28 @@
      }
  #endif
  
-diff -upr ../orig/jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c ./jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c
---- ../orig/jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/nio/ch/DatagramDispatcher.c	2010-06-20 21:56:28.000000000 -0700
+@@ -72,7 +72,7 @@
+     m.msg_accrightslen = 0;
+ #endif
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(_ALLBSD_SOURCE)
+     m.msg_control = NULL;
+     m.msg_controllen = 0;
+ #endif
+@@ -120,7 +120,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	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c	2010-06-20 21:56:28.000000000 -0700
 @@ -26,15 +26,21 @@
  #include "jni.h"
  #include "jni_util.h"
@@ -14563,18 +16488,32 @@
  static jfieldID chan_fd;        /* jobject 'fd' in sun.io.FileChannelImpl */
  
  #ifdef __solaris__
-@@ -59,6 +65,10 @@ sendfile_func* my_sendfile_func = NULL;
+@@ -59,6 +65,24 @@
  typedef ssize_t sendfile64_func(int out_fd, int in_fd, off64_t *offset, size_t count);
  
  sendfile64_func* my_sendfile64_func = NULL;
 +#elif defined(_ALLBSD_SOURCE)
++#include <sys/types.h>
 +#include <sys/socket.h>
++#include <sys/uio.h>
 +#include <errno.h>
 +#include <stdlib.h>
++
++#ifdef __APPLE__
++typedef int sendfile_func(int fd, int s, off_t offset, off_t *len,
++                          struct sf_hdtr *hdtr, int flags);
++#elif defined(__FreeBSD__)
++typedef int sendfile_func(int fd, int s, off_t offset, size_t nbytes,
++                          struct sf_hdtr *hdtr, off_t *sbytes, int flags);
++#endif
++
++#if defined(__APPLE__) || defined(__FreeBSD__)
++sendfile_func* my_sendfile_func = NULL;
++#endif
  #endif
  
  JNIEXPORT jlong JNICALL
-@@ -68,7 +78,8 @@ Java_sun_nio_ch_FileChannelImpl_initIDs(
+@@ -68,7 +92,8 @@
      chan_fd = (*env)->GetFieldID(env, clazz, "fd", "Ljava/io/FileDescriptor;");
  
  #ifdef __solaris__
@@ -14584,66 +16523,67 @@
          my_sendfile_func = (sendfile_func*) dlsym(RTLD_DEFAULT, "sendfilev64");
      }
  #endif
-@@ -278,6 +289,58 @@ Java_sun_nio_ch_FileChannelImpl_transfer
+@@ -77,6 +102,10 @@
+     my_sendfile64_func = (sendfile64_func*) dlsym(RTLD_DEFAULT, "sendfile64");
+ #endif
+ 
++#if defined(__APPLE__) || defined(__FreeBSD__)
++    my_sendfile_func = (sendfile_func*) dlsym(RTLD_DEFAULT, "sendfile");
++#endif
++
+     return pageSize;
+ }
+ 
+@@ -278,6 +307,48 @@
          return result;
      }
  #endif
 +
 +#ifdef _ALLBSD_SOURCE
-+    /*
-+     * XXXBSD: make sure that we're returning what java class may understand
-+     *
-+     * XXXBSD: I'd prefer to have it implemented with sendfile(), but since
-+     *         FreeBSD's sendfile() is only supposed to be used in file->socket
-+     *         schema we need to provide some kind of fall-back operation, if
-+     *         sendfile() failed with ENOTSOCK error only.
-+     */
-+    void *buf;
-+    off_t offset = (off_t)position;
-+    int r, w = 0;
++#if defined(__APPLE__) || defined(__FreeBSD__)
++    if (my_sendfile_func == NULL)
++        return IOS_UNSUPPORTED;
 +
-+    buf = malloc(4096);
-+    if (buf == NULL) {
-+        JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-+        return IOS_THROWN;
-+    }
++    off_t numBytes;
++    int result;
 +
-+    while ((r = pread(srcFD, buf, 4096, offset)) > 0) {
-+        w = write(dstFD, buf, r);
-+        if (w == -1)
-+	    break;
-+        offset += w;
-+    }
-+    free(buf);
++    numBytes = count;
 +
-+    /*
-+     * Similar to solaris if we've transferred any data return
-+     * the number of bytes and ignore any error
-+    */
-+    if (offset - (off_t)position > 0)
-+	return (offset - (off_t)position);
++#ifdef __APPLE__
++    result = (*my_sendfile_func)(srcFD, dstFD, position,
++                                     &numBytes, NULL, 0);
++#elif defined(__FreeBSD__)
++    result = (*my_sendfile_func)(srcFD, dstFD, position,
++                                     count, NULL, &numBytes, 0);
++#else
++    Add an #elif for your BSD flavor
++#endif
 +
-+    /*
-+     * Deal with NBIO EAGAIN & EINTR the same as solaris. 
-+     */
-+    if (r == -1 || w == -1) {
-+        switch (errno) {
-+	    case EAGAIN:
-+	        return IOS_UNAVAILABLE;
-+	    case EINTR:
-+	        return IOS_INTERRUPTED;
-+	    default:
-+		JNU_ThrowIOExceptionWithLastError(env, "Transfer failed");
-+		return IOS_THROWN;
-+        }
++    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 (0);
++    return result;
++#else
++    return IOS_UNSUPPORTED;
 +#endif
++#endif
  }
  
  JNIEXPORT jint JNICALL
-@@ -329,6 +392,23 @@ Java_sun_nio_ch_FileChannelImpl_release0
+@@ -329,6 +400,23 @@
      fl.l_start = (off64_t)pos;
      fl.l_type = F_UNLCK;
      lockResult = fcntl(fd, cmd, &fl);
@@ -14667,9 +16607,8 @@
      if (lockResult < 0) {
          JNU_ThrowIOExceptionWithLastError(env, "Release failed");
      }
-diff -upr ../orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcher.c ./jdk/src/solaris/native/sun/nio/ch/FileDispatcher.c
---- ../orig/jdk/src/solaris/native/sun/nio/ch/FileDispatcher.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/nio/ch/FileDispatcher.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/nio/ch/FileDispatcher.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/nio/ch/FileDispatcher.c	2010-06-20 21:56:28.000000000 -0700
 @@ -32,8 +32,12 @@
  #include <sys/socket.h>
  #include <fcntl.h>
@@ -14683,9 +16622,8 @@
  
  static int preCloseFD = -1;     /* File descriptor to which we dup other fd's
                                     before closing them for real */
-diff -upr ../orig/jdk/src/solaris/native/sun/nio/ch/FileKey.c ./jdk/src/solaris/native/sun/nio/ch/FileKey.c
---- ../orig/jdk/src/solaris/native/sun/nio/ch/FileKey.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/nio/ch/FileKey.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/nio/ch/FileKey.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/nio/ch/FileKey.c	2010-06-20 21:56:28.000000000 -0700
 @@ -30,6 +30,10 @@
  #include "nio_util.h"
  #include "sun_nio_ch_FileKey.h"
@@ -14697,10 +16635,9 @@
  static jfieldID key_st_dev;    /* id for FileKey.st_dev */
  static jfieldID key_st_ino;    /* id for FileKey.st_ino */
  
-diff -upr ../orig/jdk/src/solaris/native/sun/nio/ch/Net.c ./jdk/src/solaris/native/sun/nio/ch/Net.c
---- ../orig/jdk/src/solaris/native/sun/nio/ch/Net.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/nio/ch/Net.c	2009-05-04 17:37:17.000000000 -0400
-@@ -140,8 +140,31 @@ Java_sun_nio_ch_Net_localPort(JNIEnv *en
+--- jdk/src/solaris/native/sun/nio/ch/Net.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/nio/ch/Net.c	2010-06-20 21:56:28.000000000 -0700
+@@ -140,8 +140,31 @@
      SOCKADDR sa;
      int sa_len = SOCKADDR_LEN;
      if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) {
@@ -14732,7 +16669,7 @@
      }
      return NET_GetPortFromSockaddr((struct sockaddr *)&sa);
  }
-@@ -153,12 +176,76 @@ Java_sun_nio_ch_Net_localInetAddress(JNI
+@@ -153,12 +176,76 @@
      int sa_len = SOCKADDR_LEN;
      int port;
      if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) {
@@ -14811,7 +16748,7 @@
  
  #ifdef NEEDED
  
-@@ -224,7 +311,7 @@ Java_sun_nio_ch_Net_getIntOption0(JNIEnv
+@@ -224,7 +311,7 @@
      int result;
      struct linger linger;
      void *arg;
@@ -14820,7 +16757,7 @@
  
      if (NET_MapSocketOption(opt, &klevel, &kopt) < 0) {
          JNU_ThrowByNameWithLastError(env,
-@@ -262,7 +349,7 @@ Java_sun_nio_ch_Net_setIntOption0(JNIEnv
+@@ -262,7 +349,7 @@
      int result;
      struct linger linger;
      void *parg;
@@ -14829,7 +16766,7 @@
  
      if (NET_MapSocketOption(opt, &klevel, &kopt) < 0) {
          JNU_ThrowByNameWithLastError(env,
-@@ -304,9 +391,11 @@ handleSocketError(JNIEnv *env, jint erro
+@@ -304,9 +391,11 @@
      switch (errorValue) {
          case EINPROGRESS:       /* Non-blocking connect */
              return 0;
@@ -14841,9 +16778,8 @@
          case ECONNREFUSED:
              xn = JNU_JAVANETPKG "ConnectException";
              break;
-diff -upr ../orig/jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c ./jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c
---- ../orig/jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c	2010-06-20 21:56:28.000000000 -0700
 @@ -26,7 +26,9 @@
  #include <stdio.h>
  #include <stdlib.h>
@@ -14854,9 +16790,8 @@
  #include "NativeFunc.h"
  
  /* standard GSS method names (ordering is from mapfile) */
-diff -upr ../orig/jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c ./jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c
---- ../orig/jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c	2010-06-20 21:56:28.000000000 -0700
 @@ -28,12 +28,19 @@
  #include <string.h>
  
@@ -14877,7 +16812,7 @@
  void *findFunction(JNIEnv *env, jlong jHandle, const char *functionName) {
      void *hModule = (void*)jHandle;
      void *fAddress = dlsym(hModule, functionName);
-@@ -51,7 +58,11 @@ JNIEXPORT jlong JNICALL Java_sun_securit
+@@ -51,7 +58,11 @@
  {
      const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL);
      // look up existing handle only, do not load
@@ -14889,7 +16824,7 @@
      dprintf2("-handle for %s: %u\n", libName, hModule);
      (*env)->ReleaseStringUTFChars(env, jLibName, libName);
      return (jlong)hModule;
-@@ -65,6 +76,9 @@ JNIEXPORT jlong JNICALL Java_sun_securit
+@@ -65,6 +76,9 @@
  
      dprintf1("-lib %s\n", libName);
      hModule = dlopen(libName, RTLD_LAZY);
@@ -14899,9 +16834,8 @@
      (*env)->ReleaseStringUTFChars(env, jLibName, libName);
      dprintf2("-handle: %u (0X%X)\n", hModule, hModule);
  
-diff -upr ../orig/jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c ./jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c
---- ../orig/jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c	2010-06-20 21:56:28.000000000 -0700
 @@ -64,7 +64,9 @@
  #include <assert.h>
  
@@ -14912,9 +16846,8 @@
  
  #include <jni.h>
  
-diff -upr ../orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c ./jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c
---- ../orig/jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	2010-06-21 14:15:45.000000000 -0700
++++ jdk/src/solaris/native/sun/security/smartcardio/pcsc_md.c	2010-06-20 21:56:28.000000000 -0700
 @@ -29,7 +29,9 @@
  #include <assert.h>
  
@@ -14925,62 +16858,24 @@
  
  #include <winscard.h>
  
-diff -upr ../orig/jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c ./jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c
---- ../orig/jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c	2009-05-04 18:32:16.000000000 -0400
-+++ ./jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c	2009-05-04 17:37:15.000000000 -0400
-@@ -1,461 +1,3 @@
+--- jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c	2010-06-27 11:37:43.000000000 -0700
++++ jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c	2010-06-20 21:56:28.000000000 -0700
+@@ -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)
+ 
  /*
-- * 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.  Sun designates this
-- * particular file as subject to the "Classpath" exception as provided
-- * 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
-- * 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.
-+ * Dummy file - needs to be implemented for bsd
-  */
--
--#include "jni.h"
--#include "jni_util.h"
--
--#include <stdio.h>
--#include <stdlib.h>
--#include <string.h>
--#include <errno.h>
--#include <unistd.h>
--#include <signal.h>
--#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 "sun_tools_attach_BsdVirtualMachine.h"
--
--#define RESTARTABLE(_cmd, _result) do { \
--  do { \
--    _result = _cmd; \
--  } while((_result == -1) && (errno == EINTR)); \
--} while(0)
--
--/*
 - * Defines a callback that is invoked for each process
 - */
 -typedef void (*ProcessCallback)(const pid_t pid, void* user_data);
@@ -15060,66 +16955,13 @@
 -
 -
 -/*
-- * Class:     sun_tools_attach_BsdVirtualMachine
-- * Method:    socket
-- * Signature: ()I
-- */
--JNIEXPORT jint JNICALL Java_sun_tools_attach_BsdVirtualMachine_socket
--  (JNIEnv *env, jclass cls)
--{
--    int fd = socket(PF_UNIX, SOCK_STREAM, 0);
--    if (fd == -1) {
--        JNU_ThrowIOExceptionWithLastError(env, "socket");
--    }
--    return (jint)fd;
--}
--
--/*
-- * Class:     sun_tools_attach_BsdVirtualMachine
-- * Method:    connect
-- * Signature: (ILjava/lang/String;)I
-- */
--JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_connect
--  (JNIEnv *env, jclass cls, jint fd, jstring path)
--{
--    jboolean isCopy;
--    const char* p = GetStringPlatformChars(env, path, &isCopy);
--    if (p != NULL) {
--        struct sockaddr_un addr;
--        int err = 0;
--
--        addr.sun_family = AF_UNIX;
--        strcpy(addr.sun_path, p);
--
--        if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
--            err = errno;
--        }
--
--        if (isCopy) {
--            JNU_ReleaseStringPlatformChars(env, path, p);
--        }
--
--        /*
--         * If the connect failed then we throw the appropriate exception
--         * here (can't throw it before releasing the string as can't call
--         * JNI with pending exception)
--         */
--        if (err != 0) {
--            if (err == ENOENT) {
--                JNU_ThrowByName(env, "java/io/FileNotFoundException", NULL);
--            } else {
--                char* msg = strdup(strerror(err));
--                JNU_ThrowIOException(env, msg);
--                if (msg != NULL) {
--                    free(msg);
--                }
--            }
--        }
--    }
--}
--
--/*
-- * Class:     sun_tools_attach_BsdVirtualMachine
+  * Class:     sun_tools_attach_BsdVirtualMachine
+  * Method:    socket
+  * Signature: ()I
+@@ -188,146 +109,6 @@
+ 
+ /*
+  * Class:     sun_tools_attach_BsdVirtualMachine
 - * Method:    isBsdThreads
 - * Signature: ()V
 - */
@@ -15260,141 +17102,71 @@
 -
 -/*
 - * Class:     sun_tools_attach_BsdVirtualMachine
-- * Method:    sendQuitTo
-- * Signature: (I)V
-- */
--JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_sendQuitTo
--  (JNIEnv *env, jclass cls, jint pid)
--{
--    if (kill((pid_t)pid, SIGQUIT)) {
--        JNU_ThrowIOExceptionWithLastError(env, "kill");
--    }
--}
--
--/*
-- * Class:     sun_tools_attach_BsdVirtualMachine
-- * Method:    checkPermissions
-- * Signature: (Ljava/lang/String;)V
-- */
--JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_checkPermissions
--  (JNIEnv *env, jclass cls, jstring path)
--{
--    jboolean isCopy;
--    const char* p = GetStringPlatformChars(env, path, &isCopy);
--    if (p != NULL) {
+  * Method:    sendQuitTo
+  * Signature: (I)V
+  */
+@@ -350,7 +131,7 @@
+     jboolean isCopy;
+     const char* p = GetStringPlatformChars(env, path, &isCopy);
+     if (p != NULL) {
 -        struct stat64 sb;
--        uid_t uid, gid;
--        int res;
--
--        /*
--         * Check that the path is owned by the effective uid/gid of this
--         * process. Also check that group/other access is not allowed.
--         */
--        uid = geteuid();
--        gid = getegid();
--
++        struct stat sb;
+         uid_t uid, gid;
+         int res;
+ 
+@@ -361,7 +142,7 @@
+         uid = geteuid();
+         gid = getegid();
+ 
 -        res = stat64(p, &sb);
--        if (res != 0) {
--            /* save errno */
--            res = errno;
--        }
--
--        /* release p here before we throw an I/O exception */
--        if (isCopy) {
--            JNU_ReleaseStringPlatformChars(env, path, p);
--        }
--
--        if (res == 0) {
--            if ( (sb.st_uid != uid) || (sb.st_gid != gid) ||
--                 ((sb.st_mode & (S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) != 0) ) {
--                JNU_ThrowIOException(env, "well-known file is not secure");
--            }
--        } else {
--            char* msg = strdup(strerror(res));
--            JNU_ThrowIOException(env, msg);
--            if (msg != NULL) {
--                free(msg);
--            }
--        }
--    }
--}
--
--/*
-- * Class:     sun_tools_attach_BsdVirtualMachine
-- * Method:    close
-- * Signature: (I)V
-- */
--JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_close
--  (JNIEnv *env, jclass cls, jint fd)
--{
--    int res;
--    RESTARTABLE(close(fd), res);
--}
--
--/*
-- * Class:     sun_tools_attach_BsdVirtualMachine
-- * Method:    read
-- * Signature: (I[BI)I
-- */
--JNIEXPORT jint JNICALL Java_sun_tools_attach_BsdVirtualMachine_read
--  (JNIEnv *env, jclass cls, jint fd, jbyteArray ba, jint off, jint baLen)
--{
--    unsigned char buf[128];
--    size_t len = sizeof(buf);
--    ssize_t n;
--
--    size_t remaining = (size_t)(baLen - off);
--    if (len > remaining) {
--        len = remaining;
--    }
--
--    RESTARTABLE(read(fd, buf+off, len), n);
--    if (n == -1) {
--        JNU_ThrowIOExceptionWithLastError(env, "read");
--    } else {
--        if (n == 0) {
--            n = -1;     // EOF
--        } else {
--            (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf+off));
--        }
--    }
--    return n;
--}
--
--/*
-- * Class:     sun_tools_attach_BsdVirtualMachine
-- * Method:    write
-- * Signature: (I[B)V
-- */
--JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_write
--  (JNIEnv *env, jclass cls, jint fd, jbyteArray ba, jint off, jint bufLen)
--{
--    size_t remaining = bufLen;
--    do {
--        unsigned char buf[128];
--        size_t len = sizeof(buf);
--        int n;
--
--        if (len > remaining) {
--            len = remaining;
--        }
--        (*env)->GetByteArrayRegion(env, ba, off, len, (jbyte *)buf);
--
--        RESTARTABLE(write(fd, buf, len), n);
--        if (n > 0) {
--           off += n;
--           remaining -= n;
--        } else {
--            JNU_ThrowIOExceptionWithLastError(env, "write");
--            return;
--        }
--
--    } while (remaining > 0);
--}
-diff -upr ../orig/jdk/src/solaris/native/sun/xawt/XWindow.c ./jdk/src/solaris/native/sun/xawt/XWindow.c
---- ../orig/jdk/src/solaris/native/sun/xawt/XWindow.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/xawt/XWindow.c	2009-05-04 17:37:17.000000000 -0400
-@@ -228,10 +228,10 @@ KeymapEntry keymapTable[] =
++        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	2010-06-21 14:15:46.000000000 -0700
++++ jdk/src/solaris/native/sun/xawt/XWindow.c	2010-06-20 21:56:28.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 */
@@ -15409,7 +17181,7 @@
  
      /* Other vendor-specific Triangular Navigation Block */
      {java_awt_event_KeyEvent_VK_LEFT, osfXK_Left, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
-@@ -865,7 +865,7 @@ handleKeyEventWithNumLockMask(XEvent *ev
+@@ -865,7 +865,7 @@
  {
      KeySym originalKeysym = *keysym;
  
@@ -15418,9 +17190,8 @@
      /* 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.
-diff -upr ../orig/jdk/src/solaris/native/sun/xawt/awt_Desktop.c ./jdk/src/solaris/native/sun/xawt/awt_Desktop.c
---- ../orig/jdk/src/solaris/native/sun/xawt/awt_Desktop.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/native/sun/xawt/awt_Desktop.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/native/sun/xawt/awt_Desktop.c	2010-06-21 14:15:46.000000000 -0700
++++ jdk/src/solaris/native/sun/xawt/awt_Desktop.c	2010-06-20 21:56:28.000000000 -0700
 @@ -24,6 +24,7 @@
   */
  
@@ -15429,7 +17200,7 @@
  #include <dlfcn.h>
  
  typedef int gboolean;
-@@ -36,7 +37,7 @@ int init(){
+@@ -36,7 +37,7 @@
      gboolean (*gnome_vfs_init) (void);
      const char *errmsg;
  
@@ -15438,7 +17209,7 @@
      if (vfs_handle == NULL) {
  #ifdef INTERNAL_BUILD
          fprintf(stderr, "can not load libgnomevfs-2.so\n");
-@@ -54,7 +55,7 @@ int init(){
+@@ -54,7 +55,7 @@
      // call gonme_vfs_init()
      (*gnome_vfs_init)();
  
@@ -15447,9 +17218,8 @@
      if (gnome_handle == NULL) {
  #ifdef INTERNAL_BUILD
          fprintf(stderr, "can not load libgnome-2.so\n");
-diff -upr ../orig/jdk/src/solaris/npt/npt_md.h ./jdk/src/solaris/npt/npt_md.h
---- ../orig/jdk/src/solaris/npt/npt_md.h	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/npt/npt_md.h	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/npt/npt_md.h	2010-06-21 14:15:46.000000000 -0700
++++ jdk/src/solaris/npt/npt_md.h	2010-06-20 21:56:28.000000000 -0700
 @@ -32,9 +32,10 @@
  #include <string.h>
  #include <errno.h>
@@ -15472,9 +17242,8 @@
          if ( _handle == NULL ) NPT_ERROR("Cannot open library");        \
          _sym = dlsym(_handle, "nptInitialize");                         \
          if ( _sym == NULL ) NPT_ERROR("Cannot find nptInitialize");     \
-diff -upr ../orig/jdk/src/solaris/transport/socket/socket_md.c ./jdk/src/solaris/transport/socket/socket_md.c
---- ../orig/jdk/src/solaris/transport/socket/socket_md.c	2009-01-27 15:45:52.000000000 -0500
-+++ ./jdk/src/solaris/transport/socket/socket_md.c	2009-05-04 17:37:17.000000000 -0400
+--- jdk/src/solaris/transport/socket/socket_md.c	2010-06-21 14:15:46.000000000 -0700
++++ jdk/src/solaris/transport/socket/socket_md.c	2010-06-20 21:56:28.000000000 -0700
 @@ -36,7 +36,7 @@
  #ifdef __solaris__
  #include <thread.h>
@@ -15484,7 +17253,7 @@
  #include <pthread.h>
  #include <sys/poll.h>
  #endif
-@@ -283,7 +283,7 @@ dbgsysTlsGet(int index) {
+@@ -283,7 +283,7 @@
  
  #endif
  
@@ -15493,10 +17262,9 @@
  int
  dbgsysTlsAlloc() {
      pthread_key_t key;
-diff -upr ../orig/langtools/src/share/classes/com/sun/tools/javah/Util.java ./langtools/src/share/classes/com/sun/tools/javah/Util.java
---- ../orig/langtools/src/share/classes/com/sun/tools/javah/Util.java	2009-01-27 15:46:42.000000000 -0500
-+++ ./langtools/src/share/classes/com/sun/tools/javah/Util.java	2009-05-04 17:37:17.000000000 -0400
-@@ -180,6 +180,14 @@ public class Util {
+--- langtools/src/share/classes/com/sun/tools/javah/Util.java	2010-06-21 14:16:21.000000000 -0700
++++ langtools/src/share/classes/com/sun/tools/javah/Util.java	2010-06-20 21:56:28.000000000 -0700
+@@ -180,6 +180,14 @@
              os = "win32";
          } else if (os.indexOf("Linux") >= 0) {
              os = "Linux";

Added: trunk/dports/java/openjdk6/files/patch-solaris-timezone-md-return-typo
===================================================================
--- trunk/dports/java/openjdk6/files/patch-solaris-timezone-md-return-typo	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-solaris-timezone-md-return-typo	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,11 @@
+--- ../work-orig/jdk/src/solaris/native/java/util/TimeZone_md.c	2010-10-30 03:38:09.000000000 +0800
++++ ./jdk/src/solaris/native/java/util/TimeZone_md.c	2010-10-30 04:18:47.000000000 +0800
+@@ -259,7 +259,7 @@
+             return tz;
+         } else {
+             if (lstat(zoneinfo_file, &statbuf) == -1) {
+-                retuen NULL;
++                return NULL;
+             }
+         }
+     }

Added: trunk/dports/java/openjdk6/files/patch-ucontext-vm.make
===================================================================
--- trunk/dports/java/openjdk6/files/patch-ucontext-vm.make	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/patch-ucontext-vm.make	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,15 @@
+diff -u -r ../work-orig/hotspot/make/bsd/makefiles/vm.make ./hotspot/make/bsd/makefiles/vm.make
+--- ../work-orig/hotspot/make/bsd/makefiles/vm.make	2010-11-04 19:45:35.000000000 +0800
++++ ./hotspot/make/bsd/makefiles/vm.make	2010-11-04 19:51:45.000000000 +0800
+@@ -99,6 +99,11 @@
+ # Extra flags from gnumake's invocation or environment
+ CFLAGS += $(EXTRA_CFLAGS)
+ 
++# Required for <ucontext.h> and pthread_*np() functions.
++ifeq ($(OS_VENDOR), Darwin)
++  CFLAGS  += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
++endif
++
+ LIBS += -lm -pthread
+ 
+ # By default, link the *.o into the library, not the executable.

Added: trunk/dports/java/openjdk6/files/sun_xawt_icons_Makefile
===================================================================
--- trunk/dports/java/openjdk6/files/sun_xawt_icons_Makefile	                        (rev 0)
+++ trunk/dports/java/openjdk6/files/sun_xawt_icons_Makefile	2010-11-24 20:36:48 UTC (rev 73766)
@@ -0,0 +1,116 @@
+#
+# Copyright (c) 2002, 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.
+#
+
+BUILDDIR = ../..
+PACKAGE = sun.awt.X11
+PRODUCT = sun
+
+include $(BUILDDIR)/common/Defs.gmk
+
+PACKAGE_DIR=sun/awt/X11
+GEN_DIR=$(GENSRCDIR)/$(PACKAGE_DIR)
+
+CLASSES_INIT += $(TEMPDIR)/.gen_icons
+
+.PHONY: generated.clean
+
+#
+# Files
+#
+ifdef OPENJDK
+    ICONS_PATH_PREFIX=$(PLATFORM_SRC)
+else
+    ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris
+endif
+
+ICONS = \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
+
+FILES_java := $(shell \
+        for i in $(ICONS); do \
+            filename=`basename $$i`; \
+            name=`$(ECHO) $$filename | $(TR) '\-.' '__'`;  \
+            classname=$(PACKAGE_DIR)/XAWTIcon32_$$name.java; \
+            $(ECHO) $$classname;  \
+            classname=$(PACKAGE_DIR)/XAWTIcon64_$$name.java; \
+            $(ECHO) $$classname;  \
+        done \
+    )
+
+#
+# Rules.
+#
+include $(BUILDDIR)/common/Classes.gmk
+
+generated.clean:	
+	$(RM) -r $(GEN_DIR)/*.java
+
+TEMPDIR_CLASSES = $(TEMPDIR)/classes
+
+$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
+	@$(prep-target)
+	$(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<
+
+# Switch to the java we just built to avoid dylib (freetype) loading issue on crossing-compiling
+BUILT_JAVA_CMD = $(OUTPUTDIR)/bin/java
+
+$(TEMPDIR)/.gen_icons: generated.FORCE $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS)
+	$(prep-target)
+	for i in $(ICONS); do \
+            filename=`basename $$i`; \
+	    name=`$(ECHO) $$filename | $(TR) '\-.' '__'`;  \
+            classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \
+	    $(RM) $$classname; \
+	    $(ECHO) "package sun.awt.X11;" >> $$classname ; \
+	    $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \
+	    $(ECHO) "public static int[] $$name = { " >> $$classname;  \
+	    $(CAT) $$i | \
+	      $(BUILT_JAVA_CMD) -cp $(TEMPDIR_CLASSES)  \
+		-Dawt.toolkit=sun.awt.motif.MToolkit \
+		-Djava.awt.headless=true \
+		sun.awt.X11.ToBin >> $$classname; \
+	    $(ECHO) "}; }" >> $$classname;  \
+            classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \
+	    $(RM) $$classname; \
+	    $(ECHO) "package sun.awt.X11;" >> $$classname ; \
+	    $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \
+	    $(ECHO) "public static long[] $$name = { " >> $$classname;  \
+	    $(CAT) $$i | \
+	      $(BUILT_JAVA_CMD) -cp $(TEMPDIR_CLASSES)  \
+		-Dawt.toolkit=sun.awt.motif.MToolkit \
+		-Djava.awt.headless=true \
+		sun.awt.X11.ToBin >> $$classname; \
+	    $(ECHO) "}; }" >> $$classname;  \
+	done
+	$(TOUCH) $@
+
+clean clobber:: generated.clean
+
+generated.FORCE:
+
+.PHONY: generated.clean robot_child generated.FORCE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101124/c0317ef0/attachment-0001.html>


More information about the macports-changes mailing list