Recent Posts
None | 14 sec ago
None | 23 sec ago
Bash | 53 sec ago
Java | 1 min ago
None | 1 min ago
None | 2 min ago
None | 2 min ago
JavaScript | 2 min ago
None | 2 min ago
C | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By asac on the 9th of Feb 2010 09:53:34 PM Download | Raw | Embed | Report
  1. #! /bin/sh /usr/share/dpatch/dpatch-run
  2. ## mono-arm-thumb2-ftbfs.dpatch by  <asac@ubuntu.com>
  3. ##
  4. ## All lines beginning with `## DP:' are a description of the patch.
  5. ## DP: No description.
  6.  
  7. @DPATCH@
  8. diff -urNad mono-2.4.3+dfsg~/libgc/include/private/gc_locks.h mono-2.4.3+dfsg/libgc/include/private/gc_locks.h
  9. --- mono-2.4.3+dfsg~/libgc/include/private/gc_locks.h   2009-10-26 21:44:09.000000000 +0100
  10. +++ mono-2.4.3+dfsg/libgc/include/private/gc_locks.h    2010-01-29 16:08:49.000000000 +0100
  11.  -218,16 +218,20 @@
  12.  #    endif /* ALPHA */
  13.  #    ifdef ARM32
  14.          inline static int GC_test_and_set(volatile unsigned int *addr) {
  15. -          int oldval;
  16. -          /* SWP on ARM is very similar to XCHG on x86.  Doesn't lock the
  17. -           * bus because there are no SMP ARM machines.  If/when there are,
  18. -           * this code will likely need to be updated. */
  19. -          /* See linuxthreads/sysdeps/arm/pt-machine.h in glibc-2.1 */
  20. -          __asm__ __volatile__("swp %0, %1, [%2]"
  21. -                            : "=&r"(oldval)
  22. -                            : "r"(1), "r"(addr)
  23. -                            : "memory");
  24. -          return oldval;
  25. +#         ifdef __thumb__
  26. +               return __sync_lock_test_and_set (addr, 1);
  27. +#         else
  28. +               int oldval;
  29. +               /* SWP on ARM is very similar to XCHG on x86.  Doesn't lock the
  30. +                * bus because there are no SMP ARM machines.  If/when there are,
  31. +                * this code will likely need to be updated. */
  32. +               /* See linuxthreads/sysdeps/arm/pt-machine.h in glibc-2.1 */
  33. +               __asm__ __volatile__("swp %0, %1, [%2]"
  34. +                                    : "=&r"(oldval)
  35. +                                    : "r"(1), "r"(addr)
  36. +                            : "memory");
  37. +               return oldval;
  38. +#         endif
  39.          }
  40.  #       define GC_TEST_AND_SET_DEFINED
  41.  #    endif /* ARM32 */
  42. diff -urNad mono-2.4.3+dfsg~/mono/io-layer/atomic.h mono-2.4.3+dfsg/mono/io-layer/atomic.h
  43. --- mono-2.4.3+dfsg~/mono/io-layer/atomic.h     2009-10-26 21:44:10.000000000 +0100
  44. +++ mono-2.4.3+dfsg/mono/io-layer/atomic.h      2010-01-29 16:06:55.000000000 +0100
  45.  -746,6 +746,9 @@
  46.  
  47.  static inline gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch, gint32 comp)
  48.  {
  49. +#ifdef __thumb__
  50. +       return __sync_val_compare_and_swap (dest, comp, exch);
  51. +#else
  52.         int a, b;
  53.  
  54.         __asm__ __volatile__ (    "0:\n\t"
  55.  -763,10 +766,14 @@
  56.                                   : "cc", "memory");
  57.  
  58.         return a;
  59. +#endif /* !__thumb__ */
  60.  }
  61.  
  62.  static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
  63.  {
  64. +#ifdef __thumb__
  65. +       return __sync_val_compare_and_swap (dest, comp, exch);
  66. +#else
  67.         gpointer a, b;
  68.  
  69.         __asm__ __volatile__ (    "0:\n\t"
  70.  -784,10 +791,14 @@
  71.                                   : "cc", "memory");
  72.  
  73.         return a;
  74. +#endif
  75.  }
  76.  
  77.  static inline gint32 InterlockedIncrement(volatile gint32 *dest)
  78.  {
  79. +#ifdef __thumb__
  80. +       return __sync_add_and_fetch (dest, 1);
  81. +#else
  82.         int a, b, c;
  83.  
  84.         __asm__ __volatile__ (  "0:\n\t"
  85.  -802,10 +813,14 @@
  86.                                 : "cc", "memory");
  87.  
  88.         return b;
  89. +#endif
  90.  }
  91.  
  92.  static inline gint32 InterlockedDecrement(volatile gint32 *dest)
  93.  {
  94. +#ifdef __thumb__
  95. +       return __sync_sub_and_fetch (dest, 1);
  96. +#else
  97.         int a, b, c;
  98.  
  99.         __asm__ __volatile__ (  "0:\n\t"
  100.  -820,10 +835,14 @@
  101.                                 : "cc", "memory");
  102.  
  103.         return b;
  104. +#endif
  105.  }
  106.  
  107.  static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
  108.  {
  109. +#ifdef __thumb__
  110. +       return __sync_lock_test_and_set (dest, exch);
  111. +#else
  112.         int a;
  113.  
  114.         __asm__ __volatile__ (  "swp %0, %2, [%1]"
  115.  -831,10 +850,14 @@
  116.                                 : "r" (dest), "r" (exch));
  117.  
  118.         return a;
  119. +#endif
  120.  }
  121.  
  122.  static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
  123.  {
  124. +#ifdef __thumb__
  125. +       return __sync_lock_test_and_set (dest, exch);
  126. +#else
  127.         gpointer a;
  128.  
  129.         __asm__ __volatile__ (  "swp %0, %2, [%1]"
  130.  -842,10 +865,14 @@
  131.                                 : "r" (dest), "r" (exch));
  132.  
  133.         return a;
  134. +#endif
  135.  }
  136.  
  137.  static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
  138.  {
  139. +#ifdef __thumb__
  140. +       return __sync_fetch_and_add (dest, add);
  141. +#else
  142.         int a, b, c;
  143.  
  144.         __asm__ __volatile__ (  "0:\n\t"
  145.  -860,6 +887,7 @@
  146.                                 : "cc", "memory");
  147.  
  148.         return a;
  149. +#endif
  150.  }
  151.  
  152.  #elif defined(__ia64__)
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: