~angelsl/ubuntu/wily/gcc-5/mips-cross

« back to all changes in this revision

Viewing changes to debian/patches/ada-hurd.diff

  • Committer: angelsl
  • Date: 2015-10-30 03:30:35 UTC
  • Revision ID: angelsl-20151030033035-rmug41zm8hyjgisg
Original import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: b/src/gcc/ada/s-osinte-gnu.ads
 
2
===================================================================
 
3
--- /dev/null
 
4
+++ b/src/gcc/ada/s-osinte-gnu.ads
 
5
@@ -0,0 +1,802 @@
 
6
+------------------------------------------------------------------------------
 
7
+--                                                                          --
 
8
+--                GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS               --
 
9
+--                                                                          --
 
10
+--                   S Y S T E M . O S _ I N T E R F A C E                  --
 
11
+--                                                                          --
 
12
+--                                  S p e c                                 --
 
13
+--                                                                          --
 
14
+--             Copyright (C) 1991-1994, Florida State University            --
 
15
+--          Copyright (C) 1995-2014, Free Software Foundation, Inc.         --
 
16
+--                                                                          --
 
17
+-- GNAT is free software;  you can  redistribute it  and/or modify it under --
 
18
+-- terms of the  GNU General Public License as published  by the Free Soft- --
 
19
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
 
20
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
 
21
+-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
 
22
+-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
 
23
+--                                                                          --
 
24
+-- As a special exception under Section 7 of GPL version 3, you are granted --
 
25
+-- additional permissions described in the GCC Runtime Library Exception,   --
 
26
+-- version 3.1, as published by the Free Software Foundation.               --
 
27
+--                                                                          --
 
28
+-- You should have received a copy of the GNU General Public License and    --
 
29
+-- a copy of the GCC Runtime Library Exception along with this program;     --
 
30
+-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
 
31
+-- <http://www.gnu.org/licenses/>.                                          --
 
32
+--                                                                          --
 
33
+-- GNARL was developed by the GNARL team at Florida State University.       --
 
34
+-- Extensive contributions were provided by Ada Core Technologies, Inc.     --
 
35
+--                                                                          --
 
36
+------------------------------------------------------------------------------
 
37
+
 
38
+--  This is the GNU/Hurd (POSIX Threads) version of this package
 
39
+
 
40
+--  This package encapsulates all direct interfaces to OS services
 
41
+--  that are needed by children of System.
 
42
+
 
43
+--  PLEASE DO NOT add any with-clauses to this package or remove the pragma
 
44
+--  Preelaborate. This package is designed to be a bottom-level (leaf) package
 
45
+
 
46
+with Interfaces.C;
 
47
+with Unchecked_Conversion;
 
48
+
 
49
+package System.OS_Interface is
 
50
+   pragma Preelaborate;
 
51
+
 
52
+   pragma Linker_Options ("-lpthread");
 
53
+   pragma Linker_Options ("-lrt");
 
54
+
 
55
+   subtype int            is Interfaces.C.int;
 
56
+   subtype char           is Interfaces.C.char;
 
57
+   subtype short          is Interfaces.C.short;
 
58
+   subtype long           is Interfaces.C.long;
 
59
+   subtype unsigned       is Interfaces.C.unsigned;
 
60
+   subtype unsigned_short is Interfaces.C.unsigned_short;
 
61
+   subtype unsigned_long  is Interfaces.C.unsigned_long;
 
62
+   subtype unsigned_char  is Interfaces.C.unsigned_char;
 
63
+   subtype plain_char     is Interfaces.C.plain_char;
 
64
+   subtype size_t         is Interfaces.C.size_t;
 
65
+
 
66
+   -----------
 
67
+   -- Errno --
 
68
+   -----------
 
69
+   --  From /usr/include/i386-gnu/bits/errno.h
 
70
+
 
71
+   function errno return int;
 
72
+   pragma Import (C, errno, "__get_errno");
 
73
+
 
74
+   EAGAIN   : constant := 1073741859;
 
75
+   EINTR    : constant := 1073741828;
 
76
+   EINVAL   : constant := 1073741846;
 
77
+   ENOMEM   : constant := 1073741836;
 
78
+   EPERM    : constant := 1073741825;
 
79
+   ETIMEDOUT    : constant := 1073741884;
 
80
+
 
81
+   -------------
 
82
+   -- Signals --
 
83
+   -------------
 
84
+   --  From /usr/include/i386-gnu/bits/signum.h
 
85
+
 
86
+   Max_Interrupt : constant := 32;
 
87
+   type Signal is new int range 0 .. Max_Interrupt;
 
88
+   for Signal'Size use int'Size;
 
89
+
 
90
+   SIGHUP     : constant := 1; --  hangup
 
91
+   SIGINT     : constant := 2; --  interrupt (rubout)
 
92
+   SIGQUIT    : constant := 3; --  quit (ASCD FS)
 
93
+   SIGILL     : constant := 4; --  illegal instruction (not reset)
 
94
+   SIGTRAP    : constant := 5; --  trace trap (not reset)
 
95
+   SIGIOT     : constant := 6; --  IOT instruction
 
96
+   SIGABRT    : constant := 6; --  used by abort, replace SIGIOT in the  future
 
97
+   SIGEMT     : constant := 7; --  EMT instruction
 
98
+   SIGFPE     : constant := 8; --  floating point exception
 
99
+   SIGKILL    : constant := 9; --  kill (cannot be caught or ignored)
 
100
+   SIGBUS     : constant := 10; --  bus error
 
101
+   SIGSEGV    : constant := 11; --  segmentation violation
 
102
+   SIGSYS     : constant := 12; --  bad argument to system call
 
103
+   SIGPIPE    : constant := 13; --  write on a pipe with no one to read it
 
104
+   SIGALRM    : constant := 14; --  alarm clock
 
105
+   SIGTERM    : constant := 15; --  software termination signal from kill
 
106
+   SIGURG     : constant := 16; --  urgent condition on IO channel
 
107
+   SIGSTOP    : constant := 17; --  stop (cannot be caught or ignored)
 
108
+   SIGTSTP    : constant := 18; --  user stop requested from tty
 
109
+   SIGCONT    : constant := 19; --  stopped process has been continued
 
110
+   SIGCLD     : constant := 20; --  alias for SIGCHLD
 
111
+   SIGCHLD    : constant := 20; --  child status change
 
112
+   SIGTTIN    : constant := 21; --  background tty read attempted
 
113
+   SIGTTOU    : constant := 22; --  background tty write attempted
 
114
+   SIGIO      : constant := 23; --  I/O possible (Solaris SIGPOLL alias)
 
115
+   SIGPOLL    : constant := 23; --  I/O possible (same as SIGIO?)
 
116
+   SIGXCPU    : constant := 24; --  CPU time limit exceeded
 
117
+   SIGXFSZ    : constant := 25; --  filesize limit exceeded
 
118
+   SIGVTALRM  : constant := 26; --  virtual timer expired
 
119
+   SIGPROF    : constant := 27; --  profiling timer expired
 
120
+   SIGWINCH   : constant := 28; --  window size change
 
121
+   SIGINFO    : constant := 29; --  information request (NetBSD/FreeBSD)
 
122
+   SIGUSR1    : constant := 30; --  user defined signal 1
 
123
+   SIGUSR2    : constant := 31; --  user defined signal 2
 
124
+   SIGLOST    : constant := 32; --  Resource lost (Sun); server died (GNU)
 
125
+
 
126
+   SIGADAABORT : constant := SIGABRT;
 
127
+   --  Change this if you want to use another signal for task abort.
 
128
+   --  SIGTERM might be a good one.
 
129
+
 
130
+   type Signal_Set is array (Natural range <>) of Signal;
 
131
+
 
132
+   Unmasked    : constant Signal_Set := (
 
133
+      SIGTRAP,
 
134
+      --  To enable debugging on multithreaded applications, mark SIGTRAP to
 
135
+      --  be kept unmasked.
 
136
+
 
137
+      SIGBUS,
 
138
+
 
139
+      SIGTTIN, SIGTTOU, SIGTSTP,
 
140
+      --  Keep these three signals unmasked so that background processes
 
141
+      --  and IO behaves as normal "C" applications
 
142
+
 
143
+      SIGPROF,
 
144
+      --  To avoid confusing the profiler
 
145
+
 
146
+      SIGKILL, SIGSTOP);
 
147
+      --  These two signals actually cannot be masked;
 
148
+      --  POSIX simply won't allow it.
 
149
+
 
150
+   Reserved    : constant Signal_Set :=
 
151
+   --  I am not sure why the following signal is reserved.
 
152
+   --  I guess they are not supported by this version of GNU/Hurd.
 
153
+     (0 .. 0 => SIGVTALRM);
 
154
+
 
155
+   type sigset_t is private;
 
156
+
 
157
+   --  From /usr/include/signal.h /usr/include/i386-gnu/bits/sigset.h
 
158
+   function sigaddset (set : access sigset_t; sig : Signal) return int;
 
159
+   pragma Import (C, sigaddset, "sigaddset");
 
160
+
 
161
+   function sigdelset (set : access sigset_t; sig : Signal) return int;
 
162
+   pragma Import (C, sigdelset, "sigdelset");
 
163
+
 
164
+   function sigfillset (set : access sigset_t) return int;
 
165
+   pragma Import (C, sigfillset, "sigfillset");
 
166
+
 
167
+   function sigismember (set : access sigset_t; sig : Signal) return int;
 
168
+   pragma Import (C, sigismember, "sigismember");
 
169
+
 
170
+   function sigemptyset (set : access sigset_t) return int;
 
171
+   pragma Import (C, sigemptyset, "sigemptyset");
 
172
+
 
173
+   --  sigcontext is architecture dependent, so define it private
 
174
+   type struct_sigcontext is private;
 
175
+
 
176
+   --  From /usr/include/i386-gnu/bits/sigaction.h: Note: arg. order differs
 
177
+   type struct_sigaction is record
 
178
+      sa_handler : System.Address;
 
179
+      sa_mask    : sigset_t;
 
180
+      sa_flags   : int;
 
181
+   end record;
 
182
+   pragma Convention (C, struct_sigaction);
 
183
+
 
184
+   type struct_sigaction_ptr is access all struct_sigaction;
 
185
+
 
186
+   --  From /usr/include/i386-gnu/bits/sigaction.h
 
187
+   SIG_BLOCK   : constant := 1;
 
188
+   SIG_UNBLOCK : constant := 2;
 
189
+   SIG_SETMASK : constant := 3;
 
190
+
 
191
+   --  From /usr/include/i386-gnu/bits/signum.h
 
192
+   SIG_ERR  : constant := 1;
 
193
+   SIG_DFL  : constant := 0;
 
194
+   SIG_IGN  : constant := 1;
 
195
+   SIG_HOLD : constant := 2;
 
196
+
 
197
+   --  From /usr/include/i386-gnu/bits/sigaction.h
 
198
+   SA_SIGINFO : constant := 16#0040#;
 
199
+   SA_ONSTACK : constant := 16#0001#;
 
200
+
 
201
+   function sigaction
 
202
+     (sig  : Signal;
 
203
+      act  : struct_sigaction_ptr;
 
204
+      oact : struct_sigaction_ptr) return int;
 
205
+   pragma Import (C, sigaction, "sigaction");
 
206
+
 
207
+   ----------
 
208
+   -- Time --
 
209
+   ----------
 
210
+
 
211
+   Time_Slice_Supported : constant Boolean := True;
 
212
+   --  Indicates whether time slicing is supported (i.e SCHED_RR is supported)
 
213
+
 
214
+   type timespec is private;
 
215
+
 
216
+   function nanosleep (rqtp, rmtp : access timespec) return int;
 
217
+   pragma Import (C, nanosleep, "nanosleep");
 
218
+
 
219
+   type clockid_t is new int;
 
220
+   CLOCK_REALTIME : constant clockid_t := 0;
 
221
+
 
222
+   --  From: /usr/include/time.h
 
223
+   function clock_gettime
 
224
+     (clock_id : clockid_t;
 
225
+      tp       : access timespec)
 
226
+      return int;
 
227
+   pragma Import (C, clock_gettime, "clock_gettime");
 
228
+
 
229
+   function clock_getres
 
230
+     (clock_id : clockid_t;
 
231
+      res      : access timespec) return int;
 
232
+   pragma Import (C, clock_getres, "clock_getres");
 
233
+
 
234
+   function To_Duration (TS : timespec) return Duration;
 
235
+   pragma Inline (To_Duration);
 
236
+
 
237
+   function To_Timespec (D : Duration) return timespec;
 
238
+   pragma Inline (To_Timespec);
 
239
+
 
240
+   --  From: /usr/include/unistd.h
 
241
+   function sysconf (name : int) return long;
 
242
+   pragma Import (C, sysconf);
 
243
+
 
244
+   --  From /usr/include/i386-gnu/bits/confname.h
 
245
+   SC_CLK_TCK          : constant := 2;
 
246
+   SC_NPROCESSORS_ONLN : constant := 84;
 
247
+
 
248
+   -------------------------
 
249
+   -- Priority Scheduling --
 
250
+   -------------------------
 
251
+   --  From /usr/include/i386-gnu/bits/sched.h
 
252
+
 
253
+   SCHED_OTHER : constant := 0;
 
254
+   SCHED_FIFO  : constant := 1;
 
255
+   SCHED_RR    : constant := 2;
 
256
+
 
257
+   function To_Target_Priority
 
258
+     (Prio : System.Any_Priority) return Interfaces.C.int;
 
259
+   --  Maps System.Any_Priority to a POSIX priority.
 
260
+
 
261
+   -------------
 
262
+   -- Process --
 
263
+   -------------
 
264
+
 
265
+   type pid_t is private;
 
266
+
 
267
+   --  From: /usr/include/signal.h
 
268
+   function kill (pid : pid_t; sig : Signal) return int;
 
269
+   pragma Import (C, kill, "kill");
 
270
+
 
271
+   --  From: /usr/include/unistd.h
 
272
+   function getpid return pid_t;
 
273
+   pragma Import (C, getpid, "getpid");
 
274
+
 
275
+   ---------
 
276
+   -- LWP --
 
277
+   ---------
 
278
+
 
279
+   --  From: /usr/include/pthread/pthread.h
 
280
+   function lwp_self return System.Address;
 
281
+   --  lwp_self does not exist on this thread library, revert to pthread_self
 
282
+   --  which is the closest approximation (with getpid). This function is
 
283
+   --  needed to share 7staprop.adb across POSIX-like targets.
 
284
+   pragma Import (C, lwp_self, "pthread_self");
 
285
+
 
286
+   -------------
 
287
+   -- Threads --
 
288
+   -------------
 
289
+
 
290
+   type Thread_Body is access
 
291
+     function (arg : System.Address) return System.Address;
 
292
+   pragma Convention (C, Thread_Body);
 
293
+
 
294
+   function Thread_Body_Access is new
 
295
+     Unchecked_Conversion (System.Address, Thread_Body);
 
296
+
 
297
+   --  From: /usr/include/bits/pthread.h:typedef int __pthread_t;
 
298
+   --  /usr/include/pthread/pthreadtypes.h:typedef __pthread_t pthread_t;
 
299
+   type pthread_t is new unsigned_long;
 
300
+   subtype Thread_Id        is pthread_t;
 
301
+
 
302
+   function To_pthread_t is new Unchecked_Conversion
 
303
+     (unsigned_long, pthread_t);
 
304
+
 
305
+   type pthread_mutex_t     is limited private;
 
306
+   type pthread_rwlock_t     is limited private;
 
307
+   type pthread_cond_t      is limited private;
 
308
+   type pthread_attr_t      is limited private;
 
309
+   type pthread_mutexattr_t is limited private;
 
310
+   type pthread_rwlockattr_t is limited private;
 
311
+   type pthread_condattr_t  is limited private;
 
312
+   type pthread_key_t       is private;
 
313
+
 
314
+   --  From /usr/include/pthread/pthreadtypes.h
 
315
+   PTHREAD_CREATE_DETACHED : constant := 1;
 
316
+   PTHREAD_CREATE_JOINABLE : constant := 0;
 
317
+
 
318
+   PTHREAD_SCOPE_PROCESS : constant := 1;
 
319
+   PTHREAD_SCOPE_SYSTEM  : constant := 0;
 
320
+
 
321
+   -----------
 
322
+   -- Stack --
 
323
+   -----------
 
324
+
 
325
+   --  From: /usr/include/i386-gnu/bits/sigstack.h
 
326
+   type stack_t is record
 
327
+      ss_sp    : System.Address;
 
328
+      ss_size  : size_t;
 
329
+      ss_flags : int;
 
330
+   end record;
 
331
+   pragma Convention (C, stack_t);
 
332
+
 
333
+   function sigaltstack
 
334
+     (ss  : not null access stack_t;
 
335
+      oss : access stack_t) return int;
 
336
+   pragma Import (C, sigaltstack, "sigaltstack");
 
337
+
 
338
+   Alternate_Stack : aliased System.Address;
 
339
+   --  This is a dummy definition, never used (Alternate_Stack_Size is null)
 
340
+
 
341
+   Alternate_Stack_Size : constant := 0;
 
342
+   --  No alternate signal stack is used on this platform
 
343
+
 
344
+   Stack_Base_Available : constant Boolean := False;
 
345
+   --  Indicates whether the stack base is available on this target
 
346
+
 
347
+   function Get_Stack_Base (thread : pthread_t) return Address;
 
348
+   pragma Inline (Get_Stack_Base);
 
349
+   --  returns the stack base of the specified thread. Only call this function
 
350
+   --  when Stack_Base_Available is True.
 
351
+
 
352
+   --  From: /usr/include/i386-gnu/bits/shm.h __getpagesize or getpagesize??
 
353
+   function Get_Page_Size return size_t;
 
354
+   function Get_Page_Size return Address;
 
355
+   pragma Import (C, Get_Page_Size, "__getpagesize");
 
356
+   --  Returns the size of a page
 
357
+
 
358
+   --  From /usr/include/i386-gnu/bits/mman.h
 
359
+   PROT_NONE  : constant := 0;
 
360
+   PROT_READ  : constant := 4;
 
361
+   PROT_WRITE : constant := 2;
 
362
+   PROT_EXEC  : constant := 1;
 
363
+   PROT_ALL   : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
 
364
+   PROT_ON    : constant := PROT_NONE;
 
365
+   PROT_OFF   : constant := PROT_ALL;
 
366
+
 
367
+   --  From /usr/include/i386-gnu/bits/mman.h
 
368
+   function mprotect (addr : Address; len : size_t; prot : int) return int;
 
369
+   pragma Import (C, mprotect);
 
370
+
 
371
+   ---------------------------------------
 
372
+   -- Nonstandard Thread Initialization --
 
373
+   ---------------------------------------
 
374
+
 
375
+   procedure pthread_init;
 
376
+   pragma Inline (pthread_init);
 
377
+   --  This is a dummy procedure to share some GNULLI files
 
378
+
 
379
+   -------------------------
 
380
+   -- POSIX.1c  Section 3 --
 
381
+   -------------------------
 
382
+
 
383
+   --  From: /usr/include/signal.h:
 
384
+   --  sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
 
385
+   function sigwait (set : access sigset_t; sig : access Signal) return int;
 
386
+   pragma Import (C, sigwait, "sigwait");
 
387
+
 
388
+   --  From: /usr/include/pthread/pthread.h:
 
389
+   --  extern int pthread_kill (pthread_t thread, int signo);
 
390
+   function pthread_kill (thread : pthread_t; sig : Signal) return int;
 
391
+   pragma Import (C, pthread_kill, "pthread_kill");
 
392
+
 
393
+   --  From: /usr/include/i386-gnu/bits/sigthread.h
 
394
+   --  extern int pthread_sigmask (int __how, __const __sigset_t *__newmask,
 
395
+   --  __sigset_t *__oldmask) __THROW;
 
396
+   function pthread_sigmask
 
397
+     (how  : int;
 
398
+      set  : access sigset_t;
 
399
+      oset : access sigset_t) return int;
 
400
+   pragma Import (C, pthread_sigmask, "pthread_sigmask");
 
401
+
 
402
+   --------------------------
 
403
+   -- POSIX.1c  Section 11 --
 
404
+   --------------------------
 
405
+
 
406
+   --  From: /usr/include/pthread/pthread.h and
 
407
+   --  /usr/include/pthread/pthreadtypes.h
 
408
+   function pthread_mutexattr_init
 
409
+     (attr : access pthread_mutexattr_t) return int;
 
410
+   pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
 
411
+
 
412
+   function pthread_mutexattr_destroy
 
413
+     (attr : access pthread_mutexattr_t) return int;
 
414
+   pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
 
415
+
 
416
+   function pthread_mutex_init
 
417
+     (mutex : access pthread_mutex_t;
 
418
+      attr  : access pthread_mutexattr_t) return int;
 
419
+   pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
 
420
+
 
421
+   function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
 
422
+   pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
 
423
+
 
424
+   function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
 
425
+   pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
 
426
+
 
427
+   function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
 
428
+   pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
 
429
+
 
430
+   function pthread_rwlockattr_init
 
431
+     (attr : access pthread_rwlockattr_t) return int;
 
432
+   pragma Import (C, pthread_rwlockattr_init, "pthread_rwlockattr_init");
 
433
+
 
434
+   function pthread_rwlockattr_destroy
 
435
+     (attr : access pthread_rwlockattr_t) return int;
 
436
+   pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy");
 
437
+   PTHREAD_RWLOCK_PREFER_READER_NP              : constant := 0;
 
438
+   PTHREAD_RWLOCK_PREFER_WRITER_NP              : constant := 1;
 
439
+   PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
 
440
+
 
441
+   function pthread_rwlockattr_setkind_np
 
442
+     (attr : access pthread_rwlockattr_t;
 
443
+      pref : int) return int;
 
444
+   pragma Import
 
445
+     (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
 
446
+
 
447
+   function pthread_rwlock_init
 
448
+     (mutex : access pthread_rwlock_t;
 
449
+      attr  : access pthread_rwlockattr_t) return int;
 
450
+   pragma Import (C, pthread_rwlock_init, "pthread_rwlock_init");
 
451
+
 
452
+   function pthread_rwlock_destroy
 
453
+     (mutex : access pthread_rwlock_t) return int;
 
454
+   pragma Import (C, pthread_rwlock_destroy, "pthread_rwlock_destroy");
 
455
+
 
456
+   function pthread_rwlock_rdlock (mutex : access pthread_rwlock_t) return int;
 
457
+   pragma Import (C, pthread_rwlock_rdlock, "pthread_rwlock_rdlock");
 
458
+
 
459
+   function pthread_rwlock_wrlock (mutex : access pthread_rwlock_t) return int;
 
460
+   pragma Import (C, pthread_rwlock_wrlock, "pthread_rwlock_wrlock");
 
461
+
 
462
+   function pthread_rwlock_unlock (mutex : access pthread_rwlock_t) return int;
 
463
+   pragma Import (C, pthread_rwlock_unlock, "pthread_rwlock_unlock");
 
464
+
 
465
+   function pthread_condattr_init
 
466
+     (attr : access pthread_condattr_t) return int;
 
467
+   pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
 
468
+
 
469
+   function pthread_condattr_destroy
 
470
+     (attr : access pthread_condattr_t) return int;
 
471
+   pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
 
472
+
 
473
+   function pthread_cond_init
 
474
+     (cond : access pthread_cond_t;
 
475
+      attr : access pthread_condattr_t) return int;
 
476
+   pragma Import (C, pthread_cond_init, "pthread_cond_init");
 
477
+
 
478
+   function pthread_cond_destroy (cond : access pthread_cond_t) return int;
 
479
+   pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
 
480
+
 
481
+   function pthread_cond_signal (cond : access pthread_cond_t) return int;
 
482
+   pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
 
483
+
 
484
+   function pthread_cond_wait
 
485
+     (cond  : access pthread_cond_t;
 
486
+      mutex : access pthread_mutex_t) return int;
 
487
+   pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
 
488
+
 
489
+   function pthread_cond_timedwait
 
490
+     (cond    : access pthread_cond_t;
 
491
+      mutex   : access pthread_mutex_t;
 
492
+      abstime : access timespec) return int;
 
493
+   pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
 
494
+
 
495
+   Relative_Timed_Wait : constant Boolean := False;
 
496
+   --  pthread_cond_timedwait requires an absolute delay time
 
497
+
 
498
+   --------------------------
 
499
+   -- POSIX.1c  Section 13 --
 
500
+   --------------------------
 
501
+   --  From /usr/include/pthread/pthreadtypes.h
 
502
+
 
503
+   PTHREAD_PRIO_NONE    : constant := 0;
 
504
+   PTHREAD_PRIO_PROTECT : constant := 2;
 
505
+   PTHREAD_PRIO_INHERIT : constant := 1;
 
506
+
 
507
+   --  From: /usr/include/pthread/pthread.h
 
508
+   function pthread_mutexattr_setprotocol
 
509
+     (attr     : access pthread_mutexattr_t;
 
510
+      protocol : int) return int;
 
511
+   pragma Import (C, pthread_mutexattr_setprotocol,
 
512
+     "pthread_mutexattr_setprotocol");
 
513
+
 
514
+   function pthread_mutexattr_getprotocol
 
515
+     (attr     : access pthread_mutexattr_t;
 
516
+      protocol : access int) return int;
 
517
+   pragma Import (C, pthread_mutexattr_getprotocol,
 
518
+     "pthread_mutexattr_getprotocol");
 
519
+
 
520
+   function pthread_mutexattr_setprioceiling
 
521
+     (attr     : access pthread_mutexattr_t;
 
522
+      prioceiling : int) return int;
 
523
+   pragma Import (C, pthread_mutexattr_setprioceiling,
 
524
+     "pthread_mutexattr_setprioceiling");
 
525
+
 
526
+   function pthread_mutexattr_getprioceiling
 
527
+     (attr     : access pthread_mutexattr_t;
 
528
+      prioceiling : access int) return int;
 
529
+   pragma Import (C, pthread_mutexattr_getprioceiling,
 
530
+     "pthread_mutexattr_getprioceiling");
 
531
+
 
532
+   type struct_sched_param is record
 
533
+      sched_priority : int;  --  scheduling priority
 
534
+   end record;
 
535
+   pragma Convention (C, struct_sched_param);
 
536
+
 
537
+   function pthread_setschedparam
 
538
+     (thread : pthread_t;
 
539
+      policy : int;
 
540
+      param  : access struct_sched_param) return int;
 
541
+   pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
 
542
+
 
543
+   function pthread_attr_setscope
 
544
+     (attr            : access pthread_attr_t;
 
545
+      contentionscope : int) return int;
 
546
+   pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
 
547
+
 
548
+   function pthread_attr_getscope
 
549
+     (attr            : access pthread_attr_t;
 
550
+      contentionscope : access int) return int;
 
551
+   pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
 
552
+
 
553
+   function pthread_attr_setinheritsched
 
554
+     (attr            : access pthread_attr_t;
 
555
+      inheritsched : int) return int;
 
556
+   pragma Import (C, pthread_attr_setinheritsched,
 
557
+     "pthread_attr_setinheritsched");
 
558
+
 
559
+   function pthread_attr_getinheritsched
 
560
+     (attr         : access pthread_attr_t;
 
561
+      inheritsched : access int) return int;
 
562
+   pragma Import (C, pthread_attr_getinheritsched,
 
563
+     "pthread_attr_getinheritsched");
 
564
+
 
565
+   function pthread_attr_setschedpolicy
 
566
+     (attr   : access pthread_attr_t;
 
567
+      policy : int) return int;
 
568
+   pragma Import (C, pthread_attr_setschedpolicy, "pthread_setschedpolicy");
 
569
+
 
570
+   function sched_yield return int;
 
571
+   pragma Import (C, sched_yield, "sched_yield");
 
572
+
 
573
+   ---------------------------
 
574
+   -- P1003.1c - Section 16 --
 
575
+   ---------------------------
 
576
+
 
577
+   function pthread_attr_init
 
578
+     (attributes : access pthread_attr_t) return int;
 
579
+   pragma Import (C, pthread_attr_init, "pthread_attr_init");
 
580
+
 
581
+   function pthread_attr_destroy
 
582
+     (attributes : access pthread_attr_t) return int;
 
583
+   pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
 
584
+
 
585
+   function pthread_attr_setdetachstate
 
586
+     (attr        : access pthread_attr_t;
 
587
+      detachstate : int) return int;
 
588
+   pragma Import
 
589
+     (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
 
590
+
 
591
+   function pthread_attr_setstacksize
 
592
+     (attr      : access pthread_attr_t;
 
593
+      stacksize : size_t) return int;
 
594
+   pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
 
595
+
 
596
+   --  From: /usr/include/pthread/pthread.h
 
597
+   function pthread_create
 
598
+     (thread        : access pthread_t;
 
599
+      attributes    : access pthread_attr_t;
 
600
+      start_routine : Thread_Body;
 
601
+      arg           : System.Address) return int;
 
602
+   pragma Import (C, pthread_create, "pthread_create");
 
603
+
 
604
+   procedure pthread_exit (status : System.Address);
 
605
+   pragma Import (C, pthread_exit, "pthread_exit");
 
606
+
 
607
+   function pthread_self return pthread_t;
 
608
+   pragma Import (C, pthread_self, "pthread_self");
 
609
+
 
610
+   --------------------------
 
611
+   -- POSIX.1c  Section 17 --
 
612
+   --------------------------
 
613
+
 
614
+   function pthread_setspecific
 
615
+     (key   : pthread_key_t;
 
616
+      value : System.Address) return int;
 
617
+   pragma Import (C, pthread_setspecific, "pthread_setspecific");
 
618
+
 
619
+   function pthread_getspecific (key : pthread_key_t) return System.Address;
 
620
+   pragma Import (C, pthread_getspecific, "pthread_getspecific");
 
621
+
 
622
+   type destructor_pointer is access procedure (arg : System.Address);
 
623
+   pragma Convention (C, destructor_pointer);
 
624
+
 
625
+   function pthread_key_create
 
626
+     (key        : access pthread_key_t;
 
627
+      destructor : destructor_pointer) return int;
 
628
+   pragma Import (C, pthread_key_create, "pthread_key_create");
 
629
+
 
630
+   --  From /usr/include/i386-gnu/bits/sched.h
 
631
+   CPU_SETSIZE : constant := 1_024;
 
632
+
 
633
+   type bit_field is array (1 .. CPU_SETSIZE) of Boolean;
 
634
+   for bit_field'Size use CPU_SETSIZE;
 
635
+   pragma Pack (bit_field);
 
636
+   pragma Convention (C, bit_field);
 
637
+
 
638
+   type cpu_set_t is record
 
639
+      bits : bit_field;
 
640
+   end record;
 
641
+   pragma Convention (C, cpu_set_t);
 
642
+
 
643
+private
 
644
+
 
645
+   type sigset_t is array (1 .. 4) of unsigned;
 
646
+
 
647
+   --  In GNU/Hurd the component sa_handler turns out to
 
648
+   --  be one a union type, and the selector is a macro:
 
649
+   --  #define sa_handler __sigaction_handler.sa_handler
 
650
+   --  #define sa_sigaction __sigaction_handler.sa_sigaction
 
651
+
 
652
+   --  Should we add a signal_context type here ?
 
653
+   --  How could it be done independent of the CPU architecture ?
 
654
+   --  sigcontext type is opaque, so it is architecturally neutral.
 
655
+   --  It is always passed as an access type, so define it as an empty record
 
656
+   --  since the contents are not used anywhere.
 
657
+   type struct_sigcontext is null record;
 
658
+   pragma Convention (C, struct_sigcontext);
 
659
+
 
660
+   type pid_t is new int;
 
661
+
 
662
+   type time_t is new long;
 
663
+
 
664
+   type timespec is record
 
665
+      tv_sec  : time_t;
 
666
+      tv_nsec : long;
 
667
+   end record;
 
668
+   pragma Convention (C, timespec);
 
669
+
 
670
+   --  From: /usr/include/pthread/pthreadtypes.h:
 
671
+   --  typedef struct __pthread_attr pthread_attr_t;
 
672
+   --  /usr/include/i386-gnu/bits/thread-attr.h: struct __pthread_attr...
 
673
+   --  /usr/include/pthread/pthreadtypes.h: enum __pthread_contentionscope
 
674
+   --   enum __pthread_detachstate detachstate;
 
675
+   --   enum __pthread_inheritsched inheritsched;
 
676
+   --   enum __pthread_contentionscope contentionscope;
 
677
+   --   Not used: schedpolicy   : int;
 
678
+   type pthread_attr_t is record
 
679
+      schedparam    : struct_sched_param;
 
680
+      stackaddr     : System.Address;
 
681
+      stacksize     : size_t;
 
682
+      guardsize     : size_t;
 
683
+      detachstate   : int;
 
684
+      inheritsched  : int;
 
685
+      contentionscope : int;
 
686
+      schedpolicy   : int;
 
687
+   end record;
 
688
+   pragma Convention (C, pthread_attr_t);
 
689
+
 
690
+   --  From: /usr/include/pthread/pthreadtypes.h:
 
691
+   --  typedef struct __pthread_condattr pthread_condattr_t;
 
692
+   --  From: /usr/include/i386-gnu/bits/condition-attr.h:
 
693
+   --  struct __pthread_condattr {
 
694
+   --    enum __pthread_process_shared pshared;
 
695
+   --    __Clockid_T Clock;}
 
696
+   --  From: /usr/include/pthread/pthreadtypes.h:
 
697
+   --  enum __pthread_process_shared
 
698
+   type pthread_condattr_t is record
 
699
+      pshared : int;
 
700
+      clock   : clockid_t;
 
701
+   end record;
 
702
+   pragma Convention (C, pthread_condattr_t);
 
703
+
 
704
+   --  From: /usr/include/pthread/pthreadtypes.h:
 
705
+   --  typedef struct __pthread_mutexattr pthread_mutexattr_t; and
 
706
+   --  /usr/include/i386-gnu/bits/mutex-attr.h
 
707
+   --  struct __pthread_mutexattr {
 
708
+   --  int prioceiling;
 
709
+   --  enum __pthread_mutex_protocol protocol;
 
710
+   --  enum __pthread_process_shared pshared;
 
711
+   --  enum __pthread_mutex_type mutex_type;};
 
712
+   type pthread_mutexattr_t is record
 
713
+      prioceiling : int;
 
714
+      protocol    : int;
 
715
+      pshared     : int;
 
716
+      mutex_type  : int;
 
717
+   end record;
 
718
+   pragma Convention (C, pthread_mutexattr_t);
 
719
+
 
720
+   --  From: /usr/include/pthread/pthreadtypes.h
 
721
+   --  typedef struct __pthread_mutex pthread_mutex_t; and
 
722
+   --  /usr/include/i386-gnu/bits/mutex.h:
 
723
+   --  struct __pthread_mutex {
 
724
+   --  __pthread_spinlock_t __held;
 
725
+   --  __pthread_spinlock_t __lock;
 
726
+   --  /* in cthreads, mutex_init does not initialized the third
 
727
+   --    pointer, as such, we cannot rely on its value for anything.  */
 
728
+   --    char *cthreadscompat1;
 
729
+   --  struct __pthread *__queue;
 
730
+   --  struct __pthread_mutexattr *attr;
 
731
+   --  void *data;
 
732
+   --  /*  up to this point, we are completely compatible with cthreads
 
733
+   --    and what libc expects.  */
 
734
+   --    void *owner;
 
735
+   --  unsigned locks;
 
736
+   --  /* if null then the default attributes apply.  */
 
737
+   --    };
 
738
+
 
739
+   type pthread_mutex_t is record
 
740
+      held          : int;
 
741
+      lock          : int;
 
742
+      cthreadcompat : System.Address;
 
743
+      queue         : System.Address;
 
744
+      attr          : System.Address;
 
745
+      data          : System.Address;
 
746
+      owner         : System.Address;
 
747
+      locks         : unsigned;
 
748
+   end record;
 
749
+   pragma Convention (C, pthread_mutex_t);
 
750
+   --  pointer needed?
 
751
+   --  type pthread_mutex_t_ptr is access pthread_mutex_t;
 
752
+
 
753
+   --  From: /usr/include/pthread/pthreadtypes.h:
 
754
+   --  typedef struct __pthread_cond pthread_cond_t;
 
755
+   --  typedef struct __pthread_condattr pthread_condattr_t;
 
756
+   --  /usr/include/i386-gnu/bits/condition.h:struct __pthread_cond{}
 
757
+   --  pthread_condattr_t: see above!
 
758
+   --  /usr/include/i386-gnu/bits/condition.h:
 
759
+   --  struct __pthread_condimpl *__impl;
 
760
+
 
761
+   type pthread_cond_t is record
 
762
+      lock       : int;
 
763
+      queue      : System.Address;
 
764
+      condattr   : System.Address;
 
765
+      impl       : System.Address;
 
766
+      data       : System.Address;
 
767
+   end record;
 
768
+   pragma Convention (C, pthread_cond_t);
 
769
+
 
770
+   --  From: /usr/include/pthread/pthreadtypes.h:
 
771
+   --  typedef __pthread_key pthread_key_t; and
 
772
+   --  /usr/include/i386-gnu/bits/thread-specific.h:
 
773
+   --  typedef int __pthread_key;
 
774
+
 
775
+   type pthread_key_t is new int;
 
776
+
 
777
+   --  From: /usr/include/i386-gnu/bits/rwlock-attr.h:
 
778
+   --  struct __pthread_rwlockattr {
 
779
+   --  enum __pthread_process_shared pshared; };
 
780
+
 
781
+   type pthread_rwlockattr_t is record
 
782
+      pshared : int;
 
783
+   end record;
 
784
+   pragma Convention (C, pthread_rwlockattr_t);
 
785
+
 
786
+   --  From: /usr/include/i386-gnu/bits/rwlock.h:
 
787
+   --  struct __pthread_rwlock {
 
788
+   --  __pthread_spinlock_t __held;
 
789
+   --  __pthread_spinlock_t __lock;
 
790
+   --  int readers;
 
791
+   --  struct __pthread *readerqueue;
 
792
+   --  struct __pthread *writerqueue;
 
793
+   --  struct __pthread_rwlockattr *__attr;
 
794
+   --  void *__data; };
 
795
+
 
796
+   type pthread_rwlock_t is record
 
797
+      held        : int;
 
798
+      lock        : int;
 
799
+      readers     : int;
 
800
+      readerqueue : System.Address;
 
801
+      writerqueue : System.Address;
 
802
+      attr        : pthread_rwlockattr_t;
 
803
+      data        : int;
 
804
+   end record;
 
805
+   pragma Convention (C, pthread_rwlock_t);
 
806
+
 
807
+end System.OS_Interface;
 
808
Index: b/src/gcc/ada/gcc-interface/Makefile.in
 
809
===================================================================
 
810
--- a/src/gcc/ada/gcc-interface/Makefile.in
 
811
+++ b/src/gcc/ada/gcc-interface/Makefile.in
 
812
@@ -1386,6 +1386,35 @@ ifeq ($(strip $(filter-out %86 kfreebsd%
 
813
   MISCLIB = -lutil
 
814
 endif
 
815
 
 
816
+# i[3456]86-pc-gnu i.e. GNU Hurd
 
817
+ifeq ($(strip $(filter-out %86 pc gnu,$(target_cpu) $(target_vendor) $(target_os))),)
 
818
+  LIBGNAT_TARGET_PAIRS = \
 
819
+  a-intnam.ads<a-intnam-freebsd.ads \
 
820
+  s-inmaop.adb<s-inmaop-posix.adb \
 
821
+  s-intman.adb<s-intman-posix.adb \
 
822
+  s-osinte.adb<s-osinte-posix.adb \
 
823
+  s-osinte.ads<s-osinte-gnu.ads \
 
824
+  s-osprim.adb<s-osprim-posix.adb \
 
825
+  s-taprop.adb<s-taprop-posix.adb \
 
826
+  s-taspri.ads<s-taspri-posix.ads \
 
827
+  s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
 
828
+  $(ATOMICS_TARGET_PAIRS) \
 
829
+  $(X86_TARGET_PAIRS) \
 
830
+  system.ads<system-freebsd-x86.ads
 
831
+
 
832
+  TOOLS_TARGET_PAIRS =  \
 
833
+    mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
 
834
+    indepsw.adb<indepsw-gnu.adb
 
835
+
 
836
+  EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
 
837
+
 
838
+  EH_MECHANISM=-gcc
 
839
+  THREADSLIB = -lpthread
 
840
+  GNATLIB_SHARED = gnatlib-shared-dual
 
841
+  GMEM_LIB = gmemlib
 
842
+  LIBRARY_VERSION := $(LIB_VERSION)
 
843
+endif
 
844
+
 
845
 ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(target_cpu) $(target_os))),)
 
846
   LIBGNAT_TARGET_PAIRS = \
 
847
   a-intnam.ads<a-intnam-freebsd.ads \