~ubuntu-branches/ubuntu/quantal/libgc/quantal

« back to all changes in this revision

Viewing changes to debian/patches/03-add-avr32-support.diff

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2011-02-19 12:19:56 UTC
  • mfrom: (1.3.2 upstream) (0.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110219121956-67rb69xlt5nud3v2
Tags: 1:7.1-5
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: libgc-7.1.new/include/private/gcconfig.h
 
2
===================================================================
 
3
--- libgc-7.1.new.orig/include/private/gcconfig.h       2009-08-12 20:10:04.000000000 +0100
 
4
+++ libgc-7.1.new/include/private/gcconfig.h    2009-08-12 20:10:18.000000000 +0100
 
5
@@ -258,6 +258,10 @@
 
6
 #    define ARM32
 
7
 #    define mach_type_known
 
8
 # endif
 
9
+# if defined(LINUX) && defined(__avr32__)
 
10
+#    define AVR32
 
11
+#    define mach_type_known
 
12
+# endif
 
13
 # if defined(LINUX) && defined(__sh__)
 
14
 #    define SH
 
15
 #    define mach_type_known
 
16
@@ -1781,6 +1785,19 @@
 
17
 #   endif
 
18
 #endif
 
19
 
 
20
+# ifdef AVR32
 
21
+#   define MACH_TYPE "AVR32"
 
22
+#   define CPP_WORDSZ 32
 
23
+#   define ALIGNMENT 4
 
24
+#   define OS_TYPE "LINUX"
 
25
+#   define DYNAMIC_LOADING
 
26
+#   define LINUX_STACKBOTTOM
 
27
+#   define USE_GENERIC_PUSH_REGS
 
28
+#   define SEARCH_FOR_DATA_START
 
29
+      extern int _end[];
 
30
+#   define DATAEND (_end)
 
31
+# endif
 
32
+
 
33
 # ifdef CRIS
 
34
 #   define MACH_TYPE "CRIS"
 
35
 #   define CPP_WORDSZ 32
 
36
Index: libgc-7.1.new/include/private/thread_local_alloc.h
 
37
===================================================================
 
38
--- libgc-7.1.new.orig/include/private/thread_local_alloc.h     2009-08-12 20:10:04.000000000 +0100
 
39
+++ libgc-7.1.new/include/private/thread_local_alloc.h  2009-08-12 20:10:18.000000000 +0100
 
40
@@ -39,7 +39,7 @@
 
41
 #     else
 
42
 #       define USE_WIN32_COMPILER_TLS
 
43
 #     endif /* !GNU */
 
44
-#   elif defined(LINUX) && !defined(ARM32) && \
 
45
+#   elif defined(LINUX) && !defined(ARM32) && !defined(AVR32) && \
 
46
                 (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >=3))
 
47
 #     define USE_COMPILER_TLS
 
48
 #   elif (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
 
49
Index: libgc-7.1.new/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/avr32.h
 
50
===================================================================
 
51
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
 
52
+++ libgc-7.1.new/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/avr32.h  2009-08-12 20:10:18.000000000 +0100
 
53
@@ -0,0 +1,44 @@
 
54
+/*
 
55
+ * Copyright (C) 2009 Bradley Smith <brad@brad-smith.co.uk>
 
56
+ *
 
57
+ * Permission is hereby granted, free of charge, to any person obtaining a
 
58
+ * copy of this software and associated documentation files (the
 
59
+ * "Software"), to deal in the Software without restriction, including
 
60
+ * without limitation the rights to use, copy, modify, merge, publish,
 
61
+ * distribute, sublicense, and/or sell copies of the Software, and to
 
62
+ * permit persons to whom the Software is furnished to do so, subject to
 
63
+ * the following conditions:
 
64
+ *
 
65
+ * The above copyright notice and this permission notice shall be included
 
66
+ * in all copies or substantial portions of the Software.
 
67
+ *
 
68
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
69
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
70
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
71
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 
72
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 
73
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 
74
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
75
+ *
 
76
+ */
 
77
+
 
78
+#include "../all_atomic_load_store.h"
 
79
+
 
80
+#include "../ordered.h"  /* There are no multiprocessor implementations. */
 
81
+
 
82
+#include "../test_and_set_t_is_ao_t.h"
 
83
+
 
84
+AO_INLINE AO_TS_VAL_t
 
85
+AO_test_and_set(volatile AO_TS_t *addr) {
 
86
+       int ret;
 
87
+
 
88
+       __asm__ __volatile__(
 
89
+               "xchg %[old], %[mem], %[newv]"
 
90
+               : [old] "=&r"(ret)
 
91
+               : [mem] "r"(addr), [newv] "r"(1)
 
92
+               : "memory");
 
93
+
 
94
+       return ret;
 
95
+}
 
96
+
 
97
+#define AO_HAVE_test_and_set
 
98
Index: libgc-7.1.new/libatomic_ops-1.2/src/atomic_ops.h
 
99
===================================================================
 
100
--- libgc-7.1.new.orig/libatomic_ops-1.2/src/atomic_ops.h       2009-08-12 20:10:04.000000000 +0100
 
101
+++ libgc-7.1.new/libatomic_ops-1.2/src/atomic_ops.h    2009-08-12 20:10:18.000000000 +0100
 
102
@@ -229,6 +229,9 @@
 
103
 # if defined(__cris__) || defined(CRIS)
 
104
 #   include "atomic_ops/sysdeps/gcc/cris.h"
 
105
 # endif
 
106
+# if defined(__avr32__)
 
107
+#   include "atomic_ops/sysdeps/gcc/avr32.h"
 
108
+# endif
 
109
 #endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
 
110
 
 
111
 #if defined(__INTEL_COMPILER) && !defined(AO_USE_PTHREAD_DEFS)
 
112
Index: libgc-7.1.new/mach_dep.c
 
113
===================================================================
 
114
--- libgc-7.1.new.orig/mach_dep.c       2009-08-12 20:10:25.000000000 +0100
 
115
+++ libgc-7.1.new/mach_dep.c    2009-08-12 20:10:46.000000000 +0100
 
116
@@ -175,7 +175,7 @@
 
117
 #   if defined(HAVE_PUSH_REGS)
 
118
       GC_push_regs();
 
119
 #   elif defined(UNIX_LIKE) && !defined(DARWIN) && !defined(ARM32) && \
 
120
-        !defined(HURD)
 
121
+        !defined(HURD) && !defined(AVR32)
 
122
       /* Older versions of Darwin seem to lack getcontext(). */
 
123
       /* ARM Linux often doesn't support a real getcontext(). */
 
124
       ucontext_t ctxt;