diff options
Diffstat (limited to 'meta/packages/gcc/gcc-4.3.1/debian/ada-alpha.dpatch')
-rw-r--r-- | meta/packages/gcc/gcc-4.3.1/debian/ada-alpha.dpatch | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-4.3.1/debian/ada-alpha.dpatch b/meta/packages/gcc/gcc-4.3.1/debian/ada-alpha.dpatch new file mode 100644 index 0000000000..1e2c47d670 --- /dev/null +++ b/meta/packages/gcc/gcc-4.3.1/debian/ada-alpha.dpatch | |||
@@ -0,0 +1,88 @@ | |||
1 | #! /bin/sh -e | ||
2 | |||
3 | # DP: Fix GNAT on alpha. | ||
4 | |||
5 | dir= | ||
6 | if [ $# -eq 3 -a "$2" = '-d' ]; then | ||
7 | pdir="-d $3" | ||
8 | dir="$3/" | ||
9 | elif [ $# -ne 1 ]; then | ||
10 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
11 | exit 1 | ||
12 | fi | ||
13 | case "$1" in | ||
14 | -patch) | ||
15 | patch $pdir -f --no-backup-if-mismatch -p0 < $0 | ||
16 | ;; | ||
17 | -unpatch) | ||
18 | patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 | ||
19 | ;; | ||
20 | *) | ||
21 | echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" | ||
22 | exit 1 | ||
23 | esac | ||
24 | exit 0 | ||
25 | |||
26 | 2008-04-01 Aurelien Jarno <aurelien@aurel32.net> | ||
27 | |||
28 | * s-osinte-linux-alpha.ads (SC_NPROCESSORS_ONLN): New constant | ||
29 | for sysconf call. | ||
30 | (bit_field): New packed boolean type used by cpu_set_t. | ||
31 | (cpu_set_t): New type corresponding to the C type with | ||
32 | the same name. Note that on the Ada side we use a bit | ||
33 | field array for the affinity mask. There is not need | ||
34 | for the C macro for setting individual bit. | ||
35 | (pthread_setaffinity_np): New imported routine. | ||
36 | |||
37 | Index: gcc/ada/s-osinte-linux-alpha.ads | ||
38 | =================================================================== | ||
39 | --- gcc/ada/s-osinte-linux-alpha.ads (révision 133772) | ||
40 | +++ gcc/ada/s-osinte-linux-alpha.ads (copie de travail) | ||
41 | @@ -237,6 +237,7 @@ | ||
42 | pragma Import (C, sysconf); | ||
43 | |||
44 | SC_CLK_TCK : constant := 2; | ||
45 | + SC_NPROCESSORS_ONLN : constant := 84; | ||
46 | |||
47 | ------------------------- | ||
48 | -- Priority Scheduling -- | ||
49 | @@ -268,6 +269,7 @@ | ||
50 | |||
51 | type Thread_Body is access | ||
52 | function (arg : System.Address) return System.Address; | ||
53 | + pragma Convention (C, Thread_Body); | ||
54 | |||
55 | function Thread_Body_Access is new | ||
56 | Unchecked_Conversion (System.Address, Thread_Body); | ||
57 | @@ -448,12 +450,31 @@ | ||
58 | pragma Import (C, pthread_getspecific, "pthread_getspecific"); | ||
59 | |||
60 | type destructor_pointer is access procedure (arg : System.Address); | ||
61 | + pragma Convention (C, destructor_pointer); | ||
62 | |||
63 | function pthread_key_create | ||
64 | (key : access pthread_key_t; | ||
65 | destructor : destructor_pointer) return int; | ||
66 | pragma Import (C, pthread_key_create, "pthread_key_create"); | ||
67 | |||
68 | + CPU_SETSIZE : constant := 1_024; | ||
69 | + | ||
70 | + type bit_field is array (1 .. CPU_SETSIZE) of Boolean; | ||
71 | + for bit_field'Size use CPU_SETSIZE; | ||
72 | + pragma Pack (bit_field); | ||
73 | + pragma Convention (C, bit_field); | ||
74 | + | ||
75 | + type cpu_set_t is record | ||
76 | + bits : bit_field; | ||
77 | + end record; | ||
78 | + pragma Convention (C, cpu_set_t); | ||
79 | + | ||
80 | + function pthread_setaffinity_np | ||
81 | + (thread : pthread_t; | ||
82 | + cpusetsize : size_t; | ||
83 | + cpuset : access cpu_set_t) return int; | ||
84 | + pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np"); | ||
85 | + | ||
86 | private | ||
87 | |||
88 | type sigset_t is record | ||