Author: wade
Date: 2006-10-05 15:28:16 -0400 (Thu, 05 Oct 2006)
New Revision: 66308

Modified:
   branches/mono-1-1-13-8/mono/ChangeLog
   branches/mono-1-1-13-8/mono/mono/io-layer/ChangeLog
   branches/mono-1-1-13-8/mono/mono/io-layer/atomic.h
   branches/mono-1-1-13-8/mono/mono/mini/ChangeLog
   branches/mono-1-1-13-8/mono/mono/mini/cpu-s390.md
   branches/mono-1-1-13-8/mono/mono/mini/cpu-s390x.md
   branches/mono-1-1-13-8/mono/mono/mini/mini-exceptions.c
   branches/mono-1-1-13-8/mono/mono/mini/mini-s390.c
   branches/mono-1-1-13-8/mono/mono/mini/mini-s390.h
   branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.c
   branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.h
   branches/mono-1-1-13-8/mono/mono/utils/ChangeLog
   branches/mono-1-1-13-8/mono/mono/utils/mono-compiler.h
   branches/mono-1-1-13-8/mono/scripts/mono-find-provides.in
   branches/mono-1-1-13-8/mono/scripts/mono-find-requires.in
Log:
Pull in patches from what SLE10 ships on top of 1.1.13.8:

2006-06-14 Neale Ferguson <[EMAIL PROTECTED]>

       * atomic.h: Fix atomic exchange pointer operations for s390x - these
       were broken as they used 32-bit instructions rather than their 64-bit
       versions.

2006-06-09 Neale Ferguson <[EMAIL PROTECTED]>

       * atomic.h: Fix atomic operations for s390x (not really broken
       but changed to use full 64-bit opcodes).

2006-06-09  Neale Ferguson <[EMAIL PROTECTED]>

       * mini-exceptions.c (ves_icall_get_frame_info): Fix this function on 
s390/s390x.
       * mono/io-layer/atomic.h: Fix atomic operations for s390x (not really 
broken
       but changed to use full 64-bit opcodes).
       * mono/mini/mini-s390x.c: Correct ATOMIC operations (incorrect register 
for CS
       instruction).
       * mono/mini/mini-s390x.h: Simplify MCONTEXT_GET_BP.
       * mono/mini/cpu-s390x.md: Fix max. length values for a couple of 
instructions.

2006-08-10  Zoltan Varga  <[EMAIL PROTECTED]>

       * mono-compiler.h: Fix TLS definitions so libmono can be loaded 
dynamically as a
       module. Fixes #78767.

2006-07-19  Wade Berrier <[EMAIL PROTECTED]>

       * scripts/mono-find-provides.in: Remove support for only scanning files 
in the gac.
       The problem is that mono apps are often broken up into subpackages, and 
deps can only
       be resolved if the assemblies are in the gac, even when they sometimes 
shouldn't be.
       (See https://bugzilla.novell.com/show_bug.cgi?id=144655)



Modified: branches/mono-1-1-13-8/mono/ChangeLog
===================================================================
--- branches/mono-1-1-13-8/mono/ChangeLog       2006-10-05 18:51:51 UTC (rev 
66307)
+++ branches/mono-1-1-13-8/mono/ChangeLog       2006-10-05 19:28:16 UTC (rev 
66308)
@@ -1,3 +1,10 @@
+2006-07-19  Wade Berrier <[EMAIL PROTECTED]>
+
+       * scripts/mono-find-provides.in: Remove support for only scanning files 
in the gac.
+       The problem is that mono apps are often broken up into subpackages, and 
deps can only
+       be resolved if the assemblies are in the gac, even when they sometimes 
shouldn't be.
+       (See https://bugzilla.novell.com/show_bug.cgi?id=144655)
+
 2006-04-25  Wade Berrier <[EMAIL PROTECTED]>
 
        * scripts/mono-find-provides.in: Only scan files that are in the gac.

Modified: branches/mono-1-1-13-8/mono/mono/io-layer/ChangeLog
===================================================================
--- branches/mono-1-1-13-8/mono/mono/io-layer/ChangeLog 2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/io-layer/ChangeLog 2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -1,3 +1,14 @@
+2006-06-14 Neale Ferguson <[EMAIL PROTECTED]>
+
+       * atomic.h: Fix atomic exchange pointer operations for s390x - these
+       were broken as they used 32-bit instructions rather than their 64-bit
+       versions.
+
+2006-06-09 Neale Ferguson <[EMAIL PROTECTED]>
+
+       * atomic.h: Fix atomic operations for s390x (not really broken
+       but changed to use full 64-bit opcodes).
+
 2006-04-26  Dick Porter  <[EMAIL PROTECTED]>
 
        * sockets.c (WSAIoctl): Check the output buffer is valid before

Modified: branches/mono-1-1-13-8/mono/mono/io-layer/atomic.h
===================================================================
--- branches/mono-1-1-13-8/mono/mono/io-layer/atomic.h  2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/io-layer/atomic.h  2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -286,12 +286,8 @@
        gint32 old;
 
        __asm__ __volatile__ ("\tLA\t1,%0\n"
-                             "0:\tL\t%1,%0\n"
-                             "\tCR\t%1,%3\n"
-                             "\tJNE\t1f\n"
+                             "\tLR\t%1,%3\n"
                              "\tCS\t%1,%2,0(1)\n"
-                             "\tJNZ\t0b\n"
-                             "1:\n"
                              : "+m" (*dest), "=r" (old)
                              : "r" (exch), "r" (comp)
                              : "1", "cc");     
@@ -306,12 +302,8 @@
        gpointer old;
 
        __asm__ __volatile__ ("\tLA\t1,%0\n"
-                             "0:\tL\t%1,%0\n"
-                             "\tCR\t%1,%3\n"
-                             "\tJNE\t1f\n"
+                             "\tLR\t%1,%3\n"
                              "\tCS\t%1,%2,0(1)\n"
-                             "\tJNZ\t0b\n"
-                             "1:\n"
                              : "+m" (*dest), "=r" (old)
                              : "r" (exch), "r" (comp)
                              : "1", "cc");     
@@ -326,12 +318,8 @@
        gpointer old;
 
        __asm__ __volatile__ ("\tLA\t1,%0\n"
-                             "0:\tLG\t%1,%0\n"
-                             "\tCGR\t%1,%3\n"
-                             "\tJNE\t1f\n"
+                             "\tLGR\t%1,%3\n"
                              "\tCSG\t%1,%2,0(1)\n"
-                             "\tJNZ\t0b\n"
-                             "1:\n"
                              : "+m" (*dest), "=r" (old)
                              : "r" (exch), "r" (comp)
                              : "1", "cc");
@@ -340,7 +328,7 @@
 }
 # endif
 
-
+# ifndef __s390x__
 static inline gint32 
 InterlockedIncrement(volatile gint32 *val)
 {
@@ -358,7 +346,27 @@
 
        return(tmp);
 }
+# else
+static inline gint32 
+InterlockedIncrement(volatile gint32 *val)
+{
+       gint32 tmp;
+       
+       __asm__ __volatile__ ("\tLA\t2,%1\n"
+                             "0:\tLGF\t%0,%1\n"
+                             "\tLGFR\t1,%0\n"
+                             "\tAGHI\t1,1\n"
+                             "\tCS\t%0,1,0(2)\n"
+                             "\tJNZ\t0b\n"
+                             "\tLGFR\t%0,1"
+                             : "=r" (tmp), "+m" (*val)
+                             : : "1", "2", "cc");
 
+       return(tmp);
+}
+# endif
+
+# ifndef __s390x__
 static inline gint32 
 InterlockedDecrement(volatile gint32 *val)
 {
@@ -376,7 +384,25 @@
 
        return(tmp);
 }
+# else
+static inline gint32 
+InterlockedDecrement(volatile gint32 *val)
+{
+       gint32 tmp;
+       
+       __asm__ __volatile__ ("\tLA\t2,%1\n"
+                             "0:\tLGF\t%0,%1\n"
+                             "\tLGFR\t1,%0\n"
+                             "\tAGHI\t1,-1\n"
+                             "\tCS\t%0,1,0(2)\n"
+                             "\tJNZ\t0b\n"
+                             "\tLGFR\t%0,1"
+                             : "=r" (tmp), "+m" (*val)
+                             : : "1", "2", "cc");
 
+       return(tmp);
+}
+# endif
 
 static inline gint32 
 InterlockedExchange(volatile gint32 *val, gint32 new_val)
@@ -428,6 +454,7 @@
 }
 # endif
 
+# ifndef __s390x__
 static inline gint32 
 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
 {
@@ -445,7 +472,26 @@
        
        return(ret);
 }
+# else
+static inline gint32 
+InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
+{
+       gint32 ret;
 
+       __asm__ __volatile__ ("\tLA\t2,%1\n"
+                             "0:\tLGF\t%0,%1\n"
+                             "\tLGFR\t1,%0\n"
+                             "\tAGR\t1,%2\n"
+                             "\tCS\t%0,1,0(2)\n"
+                             "\tJNZ\t0b"
+                             : "=r" (ret), "+m" (*val)
+                             : "r" (add) 
+                             : "1", "2", "cc");
+       
+       return(ret);
+}
+# endif
+
 #elif defined(__ppc__) || defined (__powerpc__)
 #define WAPI_ATOMIC_ASM
 

Modified: branches/mono-1-1-13-8/mono/mono/mini/ChangeLog
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/ChangeLog     2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/ChangeLog     2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -1,3 +1,13 @@
+2006-06-09  Neale Ferguson <[EMAIL PROTECTED]>
+
+       * mini-exceptions.c (ves_icall_get_frame_info): Fix this function on 
s390/s390x.
+       * mono/io-layer/atomic.h: Fix atomic operations for s390x (not really 
broken
+       but changed to use full 64-bit opcodes).
+       * mono/mini/mini-s390x.c: Correct ATOMIC operations (incorrect register 
for CS
+       instruction).
+       * mono/mini/mini-s390x.h: Simplify MCONTEXT_GET_BP.
+       * mono/mini/cpu-s390x.md: Fix max. length values for a couple of 
instructions.
+
 2006-05-10  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * mini-x86.c (mono_arch_instrument_epilog): Fix handling of 

Modified: branches/mono-1-1-13-8/mono/mono/mini/cpu-s390.md
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/cpu-s390.md   2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/cpu-s390.md   2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -152,7 +152,7 @@
 conv.r4: dest:f src1:i len:4
 conv.r8: dest:f src1:i len:4
 conv.u1: dest:i src1:i len:8
-conv.u2: dest:i src1:i len:14
+conv.u2: dest:i src1:i len:16
 conv.u4: dest:i src1:i
 conv.u8:
 conv.u: dest:i src1:i len:4

Modified: branches/mono-1-1-13-8/mono/mono/mini/cpu-s390x.md
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/cpu-s390x.md  2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/cpu-s390x.md  2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -60,12 +60,12 @@
 aot_const: dest:i len:8
 arg:
 arglist:
-atomic_add_i4: src1:b src2:i dest:i len:20
+atomic_add_i4: src1:b src2:i dest:i len:28
 atomic_add_i8: src1:b src2:i dest:i len:30
-atomic_add_new_i4: src1:b src2:i dest:i len:20
+atomic_add_new_i4: src1:b src2:i dest:i len:28
 atomic_add_new_i8: src1:b src2:i dest:i len:30
-atomic_exchange_i4: src1:b src2:i dest:i len:14
-atomic_exchange_i8: src1:b src2:i dest:i len:20
+atomic_exchange_i4: src1:b src2:i dest:i len:18
+atomic_exchange_i8: src1:b src2:i dest:i len:24
 beq.s:
 beq: len:8
 bge.s:
@@ -269,7 +269,7 @@
 int_div_un: dest:a src1:i src2:i len:16
 int_div_un_imm: dest:a src1:i len:24
 int_mul: dest:i src1:i src2:i len:16
-int_mul_imm: dest:i src1:i len:20
+int_mul_imm: dest:i src1:i len:24
 int_mul_ovf: dest:i src1:i src2:i len:44
 int_mul_ovf_un: dest:i src1:i src2:i len:22
 int_neg: dest:i src1:i len:12

Modified: branches/mono-1-1-13-8/mono/mono/mini/mini-exceptions.c
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/mini-exceptions.c     2006-10-05 
18:51:51 UTC (rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/mini-exceptions.c     2006-10-05 
19:28:16 UTC (rev 66308)
@@ -361,9 +361,20 @@
 
        mono_arch_flush_register_windows ();
 
+#ifdef MONO_INIT_CONTEXT_FROM_CURRENT
+       MONO_INIT_CONTEXT_FROM_CURRENT (&ctx);
+#else
        MONO_INIT_CONTEXT_FROM_FUNC (&ctx, ves_icall_get_frame_info);
+#endif
 
+       /* 
+        * FIXME: This is needed because of the LMF stuff which doesn't exist 
on ia64.
+        * Probably the whole mono_find_jit_info () stuff needs to be fixed so 
this isn't
+        * needed even on other platforms. This is also true for s390/s390x.
+        */
+#if    !defined(__ia64__) && !defined(__s390__) && !defined(__s390x__)
        skip++;
+#endif
 
        do {
                ji = mono_find_jit_info (domain, jit_tls, &rji, NULL, &ctx, 
&new_ctx, NULL, &lmf, native_offset, NULL);

Modified: branches/mono-1-1-13-8/mono/mono/mini/mini-s390.c
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/mini-s390.c   2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/mini-s390.c   2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -239,7 +239,6 @@
 /*                   P r o t o t y p e s                            */
 /*------------------------------------------------------------------*/
 
-static guint8 * emit_memcpy (guint8 *, int, int, int, int, int);
 static void indent (int);
 static guint8 * backUpStackPtr(MonoCompile *, guint8 *, gint);
 static void decodeParm (MonoType *, void *, int);
@@ -342,56 +341,6 @@
 
 /*------------------------------------------------------------------*/
 /*                                                                  */
-/* Name                - emit_memcpy                                       */
-/*                                                                  */
-/* Function    - Emit code to move from memory-to-memory based on  */
-/*               the size of the variable. r0 is overwritten.      */
-/*                                                                  */
-/*------------------------------------------------------------------*/
-
-static guint8 *
-emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int 
soffset)
-{
-       switch (size) {
-               case 4 :
-                       s390_l  (code, s390_r0, 0, sreg, soffset);
-                       s390_st (code, s390_r0, 0, dreg, doffset);
-                       break;
-
-               case 3 : 
-                       s390_icm  (code, s390_r0, 14, sreg, soffset);
-                       s390_stcm (code, s390_r0, 14, dreg, doffset);
-                       break;
-
-               case 2 : 
-                       s390_lh  (code, s390_r0, 0, sreg, soffset);
-                       s390_sth (code, s390_r0, 0, dreg, doffset);
-                       break;
-
-               case 1 : 
-                       s390_ic  (code, s390_r0, 0, sreg, soffset);
-                       s390_stc (code, s390_r0, 0, dreg, doffset);
-                       break;
-       
-               default : 
-                       while (size > 0) {
-                               int len;
-
-                               if (size > 256) 
-                                       len = 256;
-                               else
-                                       len = size;
-                               s390_mvc (code, len, dreg, doffset, sreg, 
soffset);
-                               size -= len;
-                       }
-       }
-       return code;
-}
-
-/*========================= End of Function ========================*/
-
-/*------------------------------------------------------------------*/
-/*                                                                  */
 /* Name                - arch_get_argument_info                            */
 /*                                                                  */
 /* Function    - Gathers information on parameters such as size,   */
@@ -2735,10 +2684,6 @@
                        }
                }
                        break;
-               case OP_X86_TEST_NULL: {
-                       s390_ltr (code, ins->sreg1, ins->sreg1);
-               }
-                       break;
                case CEE_BREAK: {
                        mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS, 
mono_arch_break);
                         s390_brasl (code, s390_r14, 0);
@@ -3984,7 +3929,7 @@
                        s390_lr  (code, s390_r1, ins->sreg2);
                        s390_l   (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
                        s390_a   (code, s390_r1, 0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_cs  (code, s390_r0, s390_r0, ins->inst_basereg, 
ins->inst_offset);
+                       s390_cs  (code, s390_r0, s390_r1, ins->inst_basereg, 
ins->inst_offset);
                        s390_jnz (code, -7);
                        s390_lr  (code, ins->dreg, s390_r1);
                }

Modified: branches/mono-1-1-13-8/mono/mono/mini/mini-s390.h
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/mini-s390.h   2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/mini-s390.h   2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -254,7 +254,7 @@
 
 #define MONO_INIT_CONTEXT_FROM_FUNC(ctx,func) do {                     \
                MonoS390StackFrame *sframe;                             \
-               __asm__ volatile("l     %0,0(15)" : "=r" (sframe));     \
+               __asm__ volatile("lr    %0,15" : "=r" (sframe));        \
                MONO_CONTEXT_SET_BP ((ctx), sframe->prev);              \
                sframe = (MonoS390StackFrame*)sframe->prev;             \
                MONO_CONTEXT_SET_IP ((ctx), sframe->return_address);    \

Modified: branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.c
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.c  2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.c  2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -599,7 +599,7 @@
                                        printf("%p [%p] ",obj,curParm);
                                        if (class == 
mono_defaults.string_class) {
                                                printf("[STRING:%p:%s]", 
-                                                      *obj, 
mono_string_to_utf8 (obj));
+                                                      obj, mono_string_to_utf8 
(obj));
                                        } else if (class == 
mono_defaults.int32_class) { 
                                                printf("[INT32:%p:%d]", 
                                                        obj, *(gint32 *)((char 
*)obj + sizeof (MonoObject)));
@@ -4111,18 +4111,18 @@
                case OP_ATOMIC_ADD_I8: {
                        s390_lgr (code, s390_r1, ins->sreg2);
                        s390_lg  (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_ag  (code, s390_r1, 0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_csg (code, s390_r0, s390_r0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_jnz (code, -11);
+                       s390_agr (code, s390_r1, s390_r0);
+                       s390_csg (code, s390_r0, s390_r1, ins->inst_basereg, 
ins->inst_offset);
+                       s390_jnz (code, -10);
                        s390_lgr (code, ins->dreg, s390_r1);
                }
                        break;  
                case OP_ATOMIC_ADD_NEW_I8: {
                        s390_lgr (code, s390_r1, ins->sreg2);
                        s390_lg  (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_ag  (code, s390_r1, 0, ins->inst_basereg, 
ins->inst_offset);
+                       s390_agr (code, s390_r1, s390_r0);
                        s390_csg (code, s390_r0, s390_r1, ins->inst_basereg, 
ins->inst_offset);
-                       s390_jnz (code, -11);
+                       s390_jnz (code, -10);
                        s390_lgr (code, ins->dreg, s390_r1);
                }
                        break;  
@@ -4134,28 +4134,28 @@
                }
                        break;  
                case OP_ATOMIC_ADD_I4: {
-                       s390_lr  (code, s390_r1, ins->sreg2);
-                       s390_l   (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_a   (code, s390_r1, 0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_cs  (code, s390_r0, s390_r0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_jnz (code, -7);
-                       s390_lr  (code, ins->dreg, s390_r1);
+                       s390_lgfr(code, s390_r1, ins->sreg2);
+                       s390_lgf (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
+                       s390_agr (code, s390_r1, s390_r0);
+                       s390_cs  (code, s390_r0, s390_r1, ins->inst_basereg, 
ins->inst_offset);
+                       s390_jnz (code, -9);
+                       s390_lgfr(code, ins->dreg, s390_r1);
                }
                        break;  
                case OP_ATOMIC_ADD_NEW_I4: {
-                       s390_lr  (code, s390_r1, ins->sreg2);
-                       s390_l   (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
-                       s390_a   (code, s390_r1, 0, ins->inst_basereg, 
ins->inst_offset);
+                       s390_lgfr(code, s390_r1, ins->sreg2);
+                       s390_lgf (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
+                       s390_agr (code, s390_r1, s390_r0);
                        s390_cs  (code, s390_r0, s390_r1, ins->inst_basereg, 
ins->inst_offset);
-                       s390_jnz (code, -7);
-                       s390_lr  (code, ins->dreg, s390_r1);
+                       s390_jnz (code, -9);
+                       s390_lgfr(code, ins->dreg, s390_r1);
                }
                        break;  
                case OP_ATOMIC_EXCHANGE_I4: {
-                       s390_l   (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
+                       s390_lg  (code, s390_r0, 0, ins->inst_basereg, 
ins->inst_offset);
                        s390_cs  (code, s390_r0, ins->sreg2, ins->inst_basereg, 
ins->inst_offset);
                        s390_jnz (code, -4);
-                       s390_lr  (code, ins->dreg, s390_r0);
+                       s390_lgfr(code, ins->dreg, s390_r0);
                }
                        break;  
                case OP_S390_BKCHAIN: {

Modified: branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.h
===================================================================
--- branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.h  2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/mini/mini-s390x.h  2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -265,7 +265,7 @@
 
 #define MONO_INIT_CONTEXT_FROM_FUNC(ctx,func) do {                     \
                MonoS390StackFrame *sframe;                             \
-               __asm__ volatile("lg    %0,0(15)" : "=r" (sframe));     \
+               __asm__ volatile("lgr   %0,15" : "=r" (sframe));        \
                MONO_CONTEXT_SET_BP ((ctx), sframe->prev);              \
                sframe = (MonoS390StackFrame*)sframe->prev;             \
                MONO_CONTEXT_SET_IP ((ctx), sframe->return_address);    \

Modified: branches/mono-1-1-13-8/mono/mono/utils/ChangeLog
===================================================================
--- branches/mono-1-1-13-8/mono/mono/utils/ChangeLog    2006-10-05 18:51:51 UTC 
(rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/utils/ChangeLog    2006-10-05 19:28:16 UTC 
(rev 66308)
@@ -1,3 +1,8 @@
+2006-08-10  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * mono-compiler.h: Fix TLS definitions so libmono can be loaded 
dynamically as a
+       module. Fixes #78767.
+
 2006-01-04  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * mono-codeman.c (new_codechunk): Fix warnings.

Modified: branches/mono-1-1-13-8/mono/mono/utils/mono-compiler.h
===================================================================
--- branches/mono-1-1-13-8/mono/mono/utils/mono-compiler.h      2006-10-05 
18:51:51 UTC (rev 66307)
+++ branches/mono-1-1-13-8/mono/mono/utils/mono-compiler.h      2006-10-05 
19:28:16 UTC (rev 66308)
@@ -9,12 +9,26 @@
 #ifdef HAVE_KW_THREAD
 #if HAVE_TLS_MODEL_ATTR
 
+/* 
+ * Define this if you want a faster libmono, which cannot be loaded 
dynamically as a 
+ * module.
+ */
+//#define PIC_INITIAL_EXEC
+
 #if defined (__powerpc__)
 #define MONO_TLS_FAST
 #elif defined(PIC)
+
+#ifdef PIC_INITIAL_EXEC
 #define MONO_TLS_FAST __attribute__((tls_model("initial-exec")))
 #else
+#define MONO_TLS_FAST __attribute__((tls_model("local-dynamic")))
+#endif
+
+#else
+
 #define MONO_TLS_FAST __attribute__((tls_model("local-exec")))
+
 #endif
 
 #else
@@ -29,6 +43,7 @@
 #endif
 #elif defined(__x86_64__)
 #if defined(PIC)
+// This only works if libmono is linked into the application
 #define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;  __asm ("movq " 
#var "@GOTTPOFF(%%rip), %0" : "=r" (foo)); offset = foo; } while (0)
 #else
 #define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;  __asm ("movq $" 
#var "@TPOFF, %0" : "=r" (foo)); offset = foo; } while (0)
@@ -39,6 +54,15 @@
 #define MONO_THREAD_VAR_OFFSET(var,offset) (offset) = -1
 #endif
 
+#if defined(PIC) && !defined(PIC_INITIAL_EXEC)
+/* 
+ * The above definitions do not seem to work if libmono is loaded dynamically 
as a module.
+ * See bug #78767.
+ */
+#undef MONO_THREAD_VAR_OFFSET
+#define MONO_THREAD_VAR_OFFSET(var,offset) (offset) = -1
+#endif
+
 #else /* no HAVE_KW_THREAD */
 
 #define MONO_THREAD_VAR_OFFSET(var,offset) (offset) = -1

Modified: branches/mono-1-1-13-8/mono/scripts/mono-find-provides.in
===================================================================
--- branches/mono-1-1-13-8/mono/scripts/mono-find-provides.in   2006-10-05 
18:51:51 UTC (rev 66307)
+++ branches/mono-1-1-13-8/mono/scripts/mono-find-provides.in   2006-10-05 
19:28:16 UTC (rev 66308)
@@ -12,10 +12,6 @@
 filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
 monolist=($(printf "%s\n" "[EMAIL PROTECTED]" | egrep "\\.(exe|dll)\$"))
 
-# Only include files with /gac/ in path
-#  (Allows packages to contain private assemblies that don't conflict with 
other packages)
-monolist=($(printf "%s\n" "[EMAIL PROTECTED]" | egrep "/gac/"))
-
 a=`which "$0"`
 d=`dirname "$a"`
 

Modified: branches/mono-1-1-13-8/mono/scripts/mono-find-requires.in
===================================================================
--- branches/mono-1-1-13-8/mono/scripts/mono-find-requires.in   2006-10-05 
18:51:51 UTC (rev 66307)
+++ branches/mono-1-1-13-8/mono/scripts/mono-find-requires.in   2006-10-05 
19:28:16 UTC (rev 66308)
@@ -80,7 +80,7 @@
 $REQUIRES" | sort | uniq -u)
 
 #
-# Of those, only choose the ones that are in REQUIRES
+# Of those, only chose the ones that are in REQUIRES
 #
 echo "$UNIQ
 $REQUIRES" | sort | uniq -d

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to