Here is a complete diff of changes I had to make to get Virtualbox to
build for OS/2.
I don't know if in all cases this is the best route but it worked. In
the case for emgca.asm it is not a solution in fact but I don't
remember enough assembly to even start to remember the equivalent of
an #ifdef.
As this is mostly fixing syntax errors or copying code from other
sections in the code I don't think it is required but just in case I
allow this to be MIT license or public domain; whichever is simplest
to use.
Andy
Index: include/VBox/com/array.h
===================================================================
--- include/VBox/com/array.h (revision 8167)
+++ include/VBox/com/array.h (working copy)
@@ -32,7 +32,20 @@
#define ___VBox_com_array_h
#include <VBox/com/ptr.h>
+#ifdef RT_OS_OS2
+/* Undefine RT_MAX since there is an unfortunate clash with the max
+ resource type define in os2.h. */
+# undef RT_MAX
+/** @def RT_MAX
+ * Finds the maximum value.
+ * @returns The higher of the two.
+ * @param Value1 Value 1
+ * @param Value2 Value 2
+ */
+#define RT_MAX(Value1, Value2) ((Value1) >= (Value2) ? (Value1) : (Value2))
+#endif
+
/** @defgroup grp_COM_arrays COM/XPCOM Arrays
* @{
*
Index: src/VBox/VMM/VMMGC/EMGCA.asm
===================================================================
--- src/VBox/VMM/VMMGC/EMGCA.asm (revision 8167)
+++ src/VBox/VMM/VMMGC/EMGCA.asm (working copy)
@@ -194,7 +194,8 @@
mov ebx, [esp + 10h + 8] ; EBX
mov ecx, [esp + 14h + 8] ; ECX
- lock cmpxchg8b qword [ebp] ; do CMPXCHG8B
+; lock cmpxchg8b qword [ebp] ; do CMPXCHG8B
+ lock cmpxchg8b [ebp] ; do CMPXCHG8B
mov dword [esp + 08h + 8], eax
mov dword [esp + 0ch + 8], edx
@@ -244,7 +245,8 @@
mov ebx, [esp + 10h + 8] ; EBX
mov ecx, [esp + 14h + 8] ; ECX
- cmpxchg8b qword [ebp] ; do CMPXCHG8B
+; cmpxchg8b qword [ebp] ; do CMPXCHG8B
+ cmpxchg8b [ebp] ; do CMPXCHG8B
mov dword [esp + 08h + 8], eax
mov dword [esp + 0ch + 8], edx
Index: src/VBox/Runtime/r3/os2/thread-os2.cpp
===================================================================
--- src/VBox/Runtime/r3/os2/thread-os2.cpp (revision 8167)
+++ src/VBox/Runtime/r3/os2/thread-os2.cpp (working copy)
@@ -235,6 +235,7 @@
RTR3DECL(int) RTTlsAllocEx(PRTTLS piTls, PFNRTTLSDTOR pfnDestructor)
{
int rc;
+ unsigned fFlags;
int iTls = __libc_TLSAlloc();
if (iTls != -1)
{
Index: src/VBox/Runtime/r3/os2/mp-os2.cpp
===================================================================
--- src/VBox/Runtime/r3/os2/mp-os2.cpp (revision 8167)
+++ src/VBox/Runtime/r3/os2/mp-os2.cpp (working copy)
@@ -95,7 +95,7 @@
}
-RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet);
+RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet)
{
union
{
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev