summaryrefslogtreecommitdiff
path: root/packages/mono/files/mono-mips-endian.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/mono/files/mono-mips-endian.patch')
-rw-r--r--packages/mono/files/mono-mips-endian.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/mono/files/mono-mips-endian.patch b/packages/mono/files/mono-mips-endian.patch
new file mode 100644
index 0000000000..c0f1d3c759
--- /dev/null
+++ b/packages/mono/files/mono-mips-endian.patch
@@ -0,0 +1,28 @@
+--- mono-1.2.20070131/mono/mini/mini-mips.c 2007-01-31 07:00:22.000000000 +0100
++++ mono-1.2.20070131.mod/mono/mini/mini-mips.c 2007-02-17 21:22:34.000000000 +0100
+@@ -238,6 +238,11 @@
+ patch_lui_addiu(guint32 *ip, guint32 val)
+ {
+ guint16 *__lui_addiu = (guint16*)(void *)(ip);
++#if G_BYTE_ORDER == G_BIG_ENDIAN
++ int index=1;
++#else
++ int index=0;
++#endif
+
+ #if 0
+ printf ("patch_lui_addiu ip=0x%08x (0x%08x, 0x%08x) to point to 0x%08x\n",
+@@ -245,10 +250,10 @@
+ fflush (stdout);
+ #endif
+ if (((guint32)(val)) & (1 << 15))
+- __lui_addiu [1] = ((((guint32)(val)) >> 16) & 0xffff) + 1;
++ __lui_addiu [index] = ((((guint32)(val)) >> 16) & 0xffff) + 1;
+ else
+- __lui_addiu [1] = (((guint32)(val)) >> 16) & 0xffff;
+- __lui_addiu [3] = ((guint32)(val)) & 0xffff;
++ __lui_addiu [index] = (((guint32)(val)) >> 16) & 0xffff;
++ __lui_addiu [index+2] = ((guint32)(val)) & 0xffff;
+ mono_arch_flush_icache ((guint8 *)ip, 8);
+ }
+