Index: /trunk/openjdk/hotspot/make/os2/makefiles/compile.make
===================================================================
--- /trunk/openjdk/hotspot/make/os2/makefiles/compile.make	(revision 312)
+++ /trunk/openjdk/hotspot/make/os2/makefiles/compile.make	(revision 313)
@@ -56,5 +56,7 @@
 endif
 
-# Used for platform dispatching
+# Used for platform dispatching. Note that on OS/2 we pretend to be 'windows'
+# (it works in most cases and all differences are usually handled by
+# TARGET_COMPILER_gcc).
 CPP_FLAGS += -DTARGET_OS_FAMILY_windows
 CPP_FLAGS += -DTARGET_ARCH_$(Platform_arch)
@@ -63,4 +65,7 @@
 CPP_FLAGS += -DTARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
 CPP_FLAGS += -DTARGET_COMPILER_gcc
+
+# Additional define for differences not covered by TARGET_COMPILER_gcc
+CPP_FLAGS += -DTARGET_OS_FAMILY_os2
 
 # Generic linker settings
Index: /trunk/openjdk/hotspot/src/cpu/x86/vm/bytes_x86.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/cpu/x86/vm/bytes_x86.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/cpu/x86/vm/bytes_x86.hpp	(revision 313)
@@ -80,5 +80,9 @@
 #endif
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "bytes_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "bytes_os2_x86.inline.hpp"
+# else
+#  include "bytes_windows_x86.inline.hpp"
+# endif
 #endif
 
Index: /trunk/openjdk/hotspot/src/cpu/x86/vm/copy_x86.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/cpu/x86/vm/copy_x86.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/cpu/x86/vm/copy_x86.hpp	(revision 313)
@@ -36,5 +36,9 @@
 #endif
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "copy_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "copy_os2_x86.inline.hpp"
+# else
+#  include "copy_windows_x86.inline.hpp"
+# endif
 #endif
 
Index: /trunk/openjdk/hotspot/src/os/windows/vm/os_windows.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os/windows/vm/os_windows.inline.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/os/windows/vm/os_windows.inline.hpp	(revision 313)
@@ -29,6 +29,11 @@
 #include "runtime/os.hpp"
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "atomic_windows_x86.inline.hpp"
-# include "orderAccess_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "atomic_os2_x86.inline.hpp"
+#  include "orderAccess_os2_x86.inline.hpp"
+# else
+#  include "atomic_windows_x86.inline.hpp"
+#  include "orderAccess_windows_x86.inline.hpp"
+# endif
 #endif
 
Index: /trunk/openjdk/hotspot/src/os/windows/vm/thread_windows.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os/windows/vm/thread_windows.inline.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/os/windows/vm/thread_windows.inline.hpp	(revision 313)
@@ -31,6 +31,11 @@
 #include "runtime/threadLocalStorage.hpp"
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "atomic_windows_x86.inline.hpp"
-# include "orderAccess_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "atomic_os2_x86.inline.hpp"
+#  include "orderAccess_os2_x86.inline.hpp"
+# else
+#  include "atomic_windows_x86.inline.hpp"
+#  include "orderAccess_windows_x86.inline.hpp"
+# endif
 # include "prefetch_windows_x86.inline.hpp"
 #endif
Index: /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/atomic_os2_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/atomic_os2_x86.inline.hpp	(revision 313)
+++ /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/atomic_os2_x86.inline.hpp	(revision 313)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_OS2_X86_VM_ATOMIC_OS2_X86_INLINE_HPP
+#define OS_CPU_OS2_X86_VM_ATOMIC_OS2_X86_INLINE_HPP
+
+#ifdef TARGET_COMPILER_gcc
+#include "../../linux_x86/vm/atomic_linux_x86.inline.hpp"
+#else
+#error "Compiler not supported."
+#endif
+
+#endif // OS_CPU_OS2_X86_VM_ATOMIC_OS2_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/bytes_os2_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/bytes_os2_x86.inline.hpp	(revision 313)
+++ /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/bytes_os2_x86.inline.hpp	(revision 313)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_OS2_X86_VM_BYTES_OS2_X86_INLINE_HPP
+#define OS_CPU_OS2_X86_VM_BYTES_OS2_X86_INLINE_HPP
+
+#ifdef TARGET_COMPILER_gcc
+#include "../../linux_x86/vm/bytes_linux_x86.inline.hpp"
+#else
+#error "Compiler not supported."
+#endif
+
+#endif // OS_CPU_OS2_X86_VM_BYTES_OS2_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/copy_os2_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/copy_os2_x86.inline.hpp	(revision 313)
+++ /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/copy_os2_x86.inline.hpp	(revision 313)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_OS2_X86_VM_COPY_OS2_X86_INLINE_HPP
+#define OS_CPU_OS2_X86_VM_COPY_OS2_X86_INLINE_HPP
+
+#ifdef TARGET_COMPILER_gcc
+#include "../../linux_x86/vm/copy_linux_x86.inline.hpp"
+#else
+#error "Compiler not supported."
+#endif
+
+#endif // OS_CPU_OS2_X86_VM_COPY_OS2_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/orderAccess_os2_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/orderAccess_os2_x86.inline.hpp	(revision 313)
+++ /trunk/openjdk/hotspot/src/os_cpu/os2_x86/vm/orderAccess_os2_x86.inline.hpp	(revision 313)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef OS_CPU_OS2_X86_VM_ORDERACCESS_OS2_X86_INLINE_HPP
+#define OS_CPU_OS2_X86_VM_ORDERACCESS_OS2_X86_INLINE_HPP
+
+#ifdef TARGET_COMPILER_gcc
+#include "../../linux_x86/vm/orderAccess_linux_x86.inline.hpp"
+#else
+#error "Compiler not supported."
+#endif
+
+#endif // OS_CPU_OS2_X86_VM_ORDERACCESS_OS2_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp	(revision 313)
@@ -25,10 +25,4 @@
 #ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
 #define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
-
-#ifdef __EMX__
-
-#include "../../linux_x86/vm/atomic_linux_x86.inline.hpp"
-
-#else // __EMX__
 
 #include "orderAccess_windows_x86.inline.hpp"
@@ -292,5 +286,3 @@
 #pragma warning(default: 4035) // Enables warnings reporting missing return statement
 
-#endif // __EMX__
-
 #endif // OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/bytes_windows_x86.inline.hpp	(revision 313)
@@ -25,10 +25,4 @@
 #ifndef OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
 #define OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
-
-#ifdef __EMX__
-
-#include "../../linux_x86/vm/bytes_linux_x86.inline.hpp"
-
-#else // __EMX__
 
 #pragma warning(disable: 4035) // Disable warning 4035: no return value
@@ -91,5 +85,3 @@
 #pragma warning(default: 4035) // Enable warning 4035: no return value
 
-#endif // __EMX__
-
 #endif // OS_CPU_WINDOWS_X86_VM_BYTES_WINDOWS_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp	(revision 313)
@@ -25,10 +25,4 @@
 #ifndef OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
 #define OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
-
-#ifdef __EMX__
-
-#include "../../linux_x86/vm/copy_linux_x86.inline.hpp"
-
-#else // __EMX__
 
 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
@@ -175,5 +169,3 @@
 }
 
-#endif // __EMX__
-
 #endif // OS_CPU_WINDOWS_X86_VM_COPY_WINDOWS_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	(revision 313)
@@ -25,10 +25,4 @@
 #ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
 #define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
-
-#ifdef __EMX__
-
-#include "../../linux_x86/vm/orderAccess_linux_x86.inline.hpp"
-
-#else // __EMX__
 
 #include "runtime/atomic.hpp"
@@ -223,5 +217,3 @@
 #pragma warning(default: 4035) // Enables warnings reporting missing return statement
 
-#endif // __EMX__
-
 #endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
Index: /trunk/openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	(revision 313)
@@ -58,5 +58,9 @@
 #endif
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "orderAccess_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "orderAccess_os2_x86.inline.hpp"
+# else
+#  include "orderAccess_windows_x86.inline.hpp"
+# endif
 #endif
 
Index: /trunk/openjdk/hotspot/src/share/vm/oops/typeArrayOop.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/oops/typeArrayOop.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/share/vm/oops/typeArrayOop.hpp	(revision 313)
@@ -44,5 +44,9 @@
 #endif
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "orderAccess_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "orderAccess_os2_x86.inline.hpp"
+# else
+#  include "orderAccess_windows_x86.inline.hpp"
+# endif
 #endif
 
Index: /trunk/openjdk/hotspot/src/share/vm/runtime/atomic.cpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/runtime/atomic.cpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/share/vm/runtime/atomic.cpp	(revision 313)
@@ -50,5 +50,9 @@
 #endif
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "atomic_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "atomic_os2_x86.inline.hpp"
+# else
+#  include "atomic_windows_x86.inline.hpp"
+# endif
 #endif
 
Index: /trunk/openjdk/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp	(revision 313)
@@ -43,5 +43,9 @@
 #endif
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "orderAccess_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "orderAccess_os2_x86.inline.hpp"
+# else
+#  include "orderAccess_windows_x86.inline.hpp"
+# endif
 #endif
 //
Index: /trunk/openjdk/hotspot/src/share/vm/utilities/taskqueue.hpp
===================================================================
--- /trunk/openjdk/hotspot/src/share/vm/utilities/taskqueue.hpp	(revision 312)
+++ /trunk/openjdk/hotspot/src/share/vm/utilities/taskqueue.hpp	(revision 313)
@@ -46,5 +46,9 @@
 #endif
 #ifdef TARGET_OS_ARCH_windows_x86
-# include "orderAccess_windows_x86.inline.hpp"
+# ifdef TARGET_OS_FAMILY_os2
+#  include "orderAccess_os2_x86.inline.hpp"
+# else
+#  include "orderAccess_windows_x86.inline.hpp"
+# endif
 #endif
 
