]> gcc.gnu.org Git - gcc.git/blob - gcc/ada/5gosinte.ads
1aexcept.adb, [...]: Merge header, formatting and other trivial changes from ACT.
[gcc.git] / gcc / ada / 5gosinte.ads
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . O S _ I N T E R F A C E --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1997-2001 Free Software Foundation, Inc. --
10 -- --
11 -- GNARL is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNARL; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNARL was developed by the GNARL team at Florida State University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
33
34 -- This is an Irix (old pthread library) version of this package.
35
36 -- This package encapsulates all direct interfaces to OS services
37 -- that are needed by children of System.
38
39 -- PLEASE DO NOT add any with-clauses to this package
40 -- or remove the pragma Elaborate_Body.
41 -- It is designed to be a bottom-level (leaf) package.
42
43 with Interfaces;
44 with Interfaces.C;
45 with Interfaces.C.Strings;
46
47 package System.OS_Interface is
48
49 pragma Preelaborate;
50
51 pragma Linker_Options ("-lathread");
52
53 subtype int is Interfaces.C.int;
54 subtype short is Interfaces.C.short;
55 subtype long is Interfaces.C.long;
56 subtype unsigned is Interfaces.C.unsigned;
57 subtype unsigned_short is Interfaces.C.unsigned_short;
58 subtype unsigned_long is Interfaces.C.unsigned_long;
59 subtype unsigned_char is Interfaces.C.unsigned_char;
60 subtype plain_char is Interfaces.C.plain_char;
61 subtype size_t is Interfaces.C.size_t;
62 subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
63
64 -----------
65 -- Errno --
66 -----------
67
68 function errno return int;
69 pragma Import (C, errno, "__get_errno");
70
71 EINTR : constant := 4; -- interrupted system call
72 EAGAIN : constant := 11; -- No more processes
73 ENOMEM : constant := 12; -- Not enough core
74 EINVAL : constant := 22; -- Invalid argument
75 ETIMEDOUT : constant := 145; -- Connection timed out
76
77 -------------
78 -- Signals --
79 -------------
80
81 Max_Interrupt : constant := 64;
82 type Signal is new int range 0 .. Max_Interrupt;
83 for Signal'Size use int'Size;
84
85 SIGHUP : constant := 1; -- hangup
86 SIGINT : constant := 2; -- interrupt (rubout)
87 SIGQUIT : constant := 3; -- quit (ASCD FS)
88 SIGILL : constant := 4; -- illegal instruction (not reset)
89 SIGTRAP : constant := 5; -- trace trap (not reset)
90 SIGIOT : constant := 6; -- IOT instruction
91 SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the
92 -- future
93 SIGEMT : constant := 7; -- EMT instruction
94 SIGFPE : constant := 8; -- floating point exception
95 SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
96 SIGBUS : constant := 10; -- bus error
97 SIGSEGV : constant := 11; -- segmentation violation
98 SIGSYS : constant := 12; -- bad argument to system call
99 SIGPIPE : constant := 13; -- write on a pipe with no one to read it
100 SIGALRM : constant := 14; -- alarm clock
101 SIGTERM : constant := 15; -- software termination signal from kill
102 SIGUSR1 : constant := 16; -- user defined signal 1
103 SIGUSR2 : constant := 17; -- user defined signal 2
104 SIGCLD : constant := 18; -- alias for SIGCHLD
105 SIGCHLD : constant := 18; -- child status change
106 SIGPWR : constant := 19; -- power-fail restart
107 SIGWINCH : constant := 20; -- window size change
108 SIGURG : constant := 21; -- urgent condition on IO channel
109 SIGPOLL : constant := 22; -- pollable event occurred
110 SIGIO : constant := 22; -- I/O possible (Solaris SIGPOLL alias)
111 SIGSTOP : constant := 23; -- stop (cannot be caught or ignored)
112 SIGTSTP : constant := 24; -- user stop requested from tty
113 SIGCONT : constant := 25; -- stopped process has been continued
114 SIGTTIN : constant := 26; -- background tty read attempted
115 SIGTTOU : constant := 27; -- background tty write attempted
116 SIGVTALRM : constant := 28; -- virtual timer expired
117 SIGPROF : constant := 29; -- profiling timer expired
118 SIGXCPU : constant := 30; -- CPU time limit exceeded
119 SIGXFSZ : constant := 31; -- filesize limit exceeded
120 SIGK32 : constant := 32; -- reserved for kernel (IRIX)
121 SIGCKPT : constant := 33; -- Checkpoint warning
122 SIGRESTART : constant := 34; -- Restart warning
123 SIGUME : constant := 35; -- Uncorrectable memory error
124 -- Signals defined for Posix 1003.1c.
125 SIGPTINTR : constant := 47;
126 SIGPTRESCHED : constant := 48;
127 -- Posix 1003.1b signals
128 SIGRTMIN : constant := 49; -- Posix 1003.1b signals
129 SIGRTMAX : constant := 64; -- Posix 1003.1b signals
130
131 type sigset_t is private;
132 type sigset_t_ptr is access all sigset_t;
133
134 function sigaddset (set : access sigset_t; sig : Signal) return int;
135 pragma Import (C, sigaddset, "sigaddset");
136
137 function sigdelset (set : access sigset_t; sig : Signal) return int;
138 pragma Import (C, sigdelset, "sigdelset");
139
140 function sigfillset (set : access sigset_t) return int;
141 pragma Import (C, sigfillset, "sigfillset");
142
143 function sigismember (set : access sigset_t; sig : Signal) return int;
144 pragma Import (C, sigismember, "sigismember");
145
146 function sigemptyset (set : access sigset_t) return int;
147 pragma Import (C, sigemptyset, "sigemptyset");
148
149 type siginfo_t is record
150 si_signo : int;
151 si_code : int;
152 si_errno : int;
153 bit_field_substitute_1 : String (1 .. 116);
154 end record;
155 pragma Convention (C, siginfo_t);
156
157 type array_type_2 is array (Integer range 0 .. 1) of int;
158 type struct_sigaction is record
159 sa_flags : int;
160 sa_handler : System.Address;
161 sa_mask : sigset_t;
162 sa_resv : array_type_2;
163 end record;
164 pragma Convention (C, struct_sigaction);
165 type struct_sigaction_ptr is access all struct_sigaction;
166
167 SIG_BLOCK : constant := 1;
168 SIG_UNBLOCK : constant := 2;
169 SIG_SETMASK : constant := 3;
170
171 SIG_DFL : constant := 0;
172 SIG_IGN : constant := 1;
173
174 function sigaction
175 (sig : Signal;
176 act : struct_sigaction_ptr;
177 oact : struct_sigaction_ptr := null) return int;
178 pragma Import (C, sigaction, "sigaction");
179
180 ----------
181 -- Time --
182 ----------
183
184 type time_t is new int;
185
186 type timespec is record
187 tv_sec : time_t;
188 tv_nsec : long;
189 end record;
190 pragma Convention (C, timespec);
191 type timespec_ptr is access all timespec;
192
193 function To_Duration (TS : timespec) return Duration;
194 pragma Inline (To_Duration);
195
196 function To_Timespec (D : Duration) return timespec;
197 pragma Inline (To_Timespec);
198
199 type timer_t is new Integer;
200 type clockid_t is private;
201
202 CLOCK_REALTIME : constant clockid_t;
203 CLOCK_SGI_FAST : constant clockid_t;
204 CLOCK_SGI_CYCLE : constant clockid_t;
205
206 SGI_CYCLECNTR_SIZE : constant := 165;
207 function syssgi (request : Interfaces.C.int) return Interfaces.C.ptrdiff_t;
208
209 pragma Import (C, syssgi, "syssgi");
210
211 function clock_gettime
212 (clock_id : clockid_t;
213 tp : access timespec) return int;
214 pragma Import (C, clock_gettime, "clock_gettime");
215
216 function clock_getres
217 (clock_id : clockid_t; tp : access timespec) return int;
218 pragma Import (C, clock_getres, "clock_getres");
219
220 type struct_timeval is record
221 tv_sec : time_t;
222 tv_usec : time_t;
223 end record;
224 pragma Convention (C, struct_timeval);
225
226 function To_Duration (TV : struct_timeval) return Duration;
227 pragma Inline (To_Duration);
228
229 function To_Timeval (D : Duration) return struct_timeval;
230 pragma Inline (To_Timeval);
231
232 function gettimeofday
233 (tv : access struct_timeval;
234 tz : System.Address := System.Null_Address) return int;
235 pragma Import (C, gettimeofday, "gettimeofday");
236
237 -------------------------
238 -- Priority Scheduling --
239 -------------------------
240
241 SCHED_FIFO : constant := 0;
242 SCHED_RR : constant := 0;
243 SCHED_OTHER : constant := 0;
244
245 -------------
246 -- Process --
247 -------------
248
249 type pid_t is private;
250
251 function kill (pid : pid_t; sig : Signal) return int;
252 pragma Import (C, kill, "kill");
253
254 function getpid return pid_t;
255 pragma Import (C, getpid, "getpid");
256
257 ---------------------------------------
258 -- Nonstandard Thread Initialization --
259 ---------------------------------------
260
261 procedure pthread_init;
262 pragma Inline (pthread_init);
263 -- This is a dummy procedure to share some GNULLI files
264
265 -------------
266 -- Threads --
267 -------------
268
269 type Thread_Body is access
270 function (arg : System.Address) return System.Address;
271
272 type pthread_t is private; -- thread identifier
273 subtype Thread_Id is pthread_t;
274
275 type pthread_mutex_t is private; -- mutex identifier
276 type pthread_cond_t is private; -- cond identifier
277 type pthread_attr_t is private; -- pthread attributes
278 type pthread_mutexattr_t is private; -- mutex attributes
279 type pthread_condattr_t is private; -- mutex attributes
280 type sem_t is private; -- semaphore identifier
281 type pthread_key_t is private; -- per thread key
282
283 subtype pthread_once_t is int; -- dynamic package initialization
284 subtype resource_t is long; -- sproc. resource info.
285 type start_addr is access function (arg : Address) return Address;
286 type sproc_start_addr is access function (arg : Address) return int;
287 type callout_addr is
288 access function (arg : Address; arg1 : Address) return Address;
289
290 -- SGI specific types
291
292 subtype sproc_t is Address; -- sproc identifier
293 subtype sproc_attr_t is Address; -- sproc attributes
294
295 subtype spcb_p is Address;
296 subtype ptcb_p is Address;
297
298 -- Pthread Error Types
299
300 FUNC_OK : constant := 0;
301 FUNC_ERR : constant := -1;
302
303 -- pthread run-time initialization data structure
304
305 type pthread_init_struct is record
306 conf_initsize : int; -- shared area size
307 max_sproc_count : int; -- maximum number of sprocs
308 sproc_stack_size : size_t; -- sproc stack size
309 os_default_priority : int; -- default IRIX pri for main process
310 os_sched_signal : int; -- default OS scheduling signal
311 guard_pages : int; -- number of guard pages per stack
312 init_sproc_count : int; -- initial number of sprocs
313 end record;
314
315 --
316 -- Pthread Attribute Initialize / Destroy
317 --
318
319 function pthread_attr_init (attr : access pthread_attr_t) return int;
320 pragma Import (C, pthread_attr_init, "pthread_attr_init");
321
322 function pthread_attr_destroy (attr : access pthread_attr_t) return int;
323 pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
324
325 --
326 -- Thread Attributes
327 --
328
329 function pthread_attr_setstacksize
330 (attr : access pthread_attr_t; stacksize : size_t) return int;
331 pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
332
333 function pthread_attr_setdetachstate
334 (attr : access pthread_attr_t; detachstate : int) return int;
335 pragma Import (C, pthread_attr_setdetachstate);
336
337 function pthread_attr_setname
338 (attr : access pthread_attr_t; name : chars_ptr) return int;
339 pragma Import (C, pthread_attr_setname, "pthread_attr_setname");
340
341 --
342 -- Thread Scheduling Attributes
343 --
344
345 function pthread_attr_setscope
346 (attr : access pthread_attr_t; contentionscope : int) return int;
347 pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
348
349 function pthread_attr_setinheritsched
350 (attr : access pthread_attr_t; inherit : int) return int;
351 pragma Import
352 (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
353
354 function pthread_attr_setsched
355 (attr : access pthread_attr_t; scheduler : int) return int;
356 pragma Import (C, pthread_attr_setsched, "pthread_attr_setsched");
357
358 function pthread_attr_setprio
359 (attr : access pthread_attr_t; priority : int) return int;
360 pragma Import (C, pthread_attr_setprio, "pthread_attr_setprio");
361
362 --
363 -- SGI Extensions to Thread Attributes
364 --
365
366 -- Bound to sproc attribute values
367
368 PTHREAD_BOUND : constant := 1;
369 PTHREAD_NOT_BOUND : constant := 0;
370
371 function pthread_attr_setresources
372 (attr : access pthread_attr_t; resources : resource_t) return int;
373 pragma Import (C, pthread_attr_setresources, "pthread_attr_setresources");
374
375 function pthread_attr_set_boundtosproc
376 (attr : access pthread_attr_t; bound_to_sproc : int) return int;
377 pragma Import
378 (C, pthread_attr_set_boundtosproc, "pthread_attr_set_boundtosproc");
379
380 function pthread_attr_set_bsproc
381 (attr : access pthread_attr_t; bsproc : spcb_p) return int;
382 pragma Import (C, pthread_attr_set_bsproc, "pthread_attr_set_bsproc");
383
384 function pthread_attr_set_tslice
385 (attr : access pthread_attr_t;
386 ts_interval : access struct_timeval) return int;
387 pragma Import (C, pthread_attr_set_tslice, "pthread_attr_set_tslice");
388
389 --
390 -- Thread Creation & Management
391 --
392
393 function pthread_create
394 (thread : access pthread_t;
395 attr : access pthread_attr_t;
396 start_routine : start_addr;
397 arg : Address) return int;
398 pragma Import (C, pthread_create, "pthread_create");
399
400 procedure pthread_exit (status : Address);
401 pragma Import (C, pthread_exit, "pthread_exit");
402
403 procedure pthread_yield (arg : Address := System.Null_Address);
404 pragma Import (C, pthread_yield, "pthread_yield");
405
406 function pthread_self return pthread_t;
407 pragma Import (C, pthread_self, "pthread_self");
408
409 function pthread_kill (thread : pthread_t; sig : int) return int;
410 pragma Import (C, pthread_kill, "pthread_kill");
411
412 --
413 -- SGI Extensions to POSIX thread operations
414 --
415
416 function pthread_setprio (thread : pthread_t; priority : int) return int;
417 pragma Import (C, pthread_setprio, "pthread_setprio");
418
419 function pthread_suspend (thread : pthread_t) return int;
420 pragma Import (C, pthread_suspend, "pthread_suspend");
421
422 function pthread_resume (thread : pthread_t) return int;
423 pragma Import (C, pthread_resume, "pthread_resume");
424
425 function pthread_get_current_ada_tcb return Address;
426 pragma Import (C, pthread_get_current_ada_tcb);
427
428 function pthread_set_ada_tcb
429 (thread : pthread_t; data : Address) return int;
430 pragma Import (C, pthread_set_ada_tcb, "pthread_set_ada_tcb");
431
432 -- Mutex Initialization / Destruction
433
434 function pthread_mutexattr_init
435 (attr : access pthread_mutexattr_t) return int;
436 pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
437
438 function pthread_mutexattr_destroy
439 (attr : access pthread_mutexattr_t) return int;
440 pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
441
442 function pthread_mutexattr_setqueueorder
443 (attr : access pthread_mutexattr_t; order : int) return int;
444 pragma Import (C, pthread_mutexattr_setqueueorder);
445
446 function pthread_mutexattr_setceilingprio
447 (attr : access pthread_mutexattr_t; priority : int) return int;
448 pragma Import (C, pthread_mutexattr_setceilingprio);
449
450 -- Mutex Attributes
451
452 -- Threads queueing order
453
454 MUTEX_PRIORITY : constant := 0; -- wait in priority order
455 MUTEX_FIFO : constant := 1; -- first-in-first-out
456 MUTEX_PRIORITY_INHERIT : constant := 2; -- priority inhertance mutex
457 MUTEX_PRIORITY_CEILING : constant := 3; -- priority ceiling mutex
458
459 -- Mutex debugging options
460
461 MUTEX_NO_DEBUG : constant := 0; -- no debugging on mutex
462 MUTEX_DEBUG : constant := 1; -- debugging is on
463
464 -- Mutex spin on lock operations
465
466 MUTEX_NO_SPIN : constant := 0; -- no spin, try once only
467 MUTEX_SPIN_ONLY : constant := -1; -- spin forever
468 -- cnt > 0, limited spin
469 -- Mutex sharing attributes
470
471 MUTEX_SHARED : constant := 0; -- shared between processes
472 MUTEX_NOTSHARED : constant := 1; -- not shared between processes
473
474 -- Mutex Operations
475
476 function pthread_mutex_init
477 (mutex : access pthread_mutex_t;
478 attr : access pthread_mutexattr_t) return int;
479 pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
480
481 function pthread_mutex_destroy
482 (mutex : access pthread_mutex_t) return int;
483 pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
484
485 function pthread_mutex_lock
486 (mutex : access pthread_mutex_t) return int;
487 pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
488
489 function pthread_mutex_unlock
490 (mutex : access pthread_mutex_t) return int;
491 pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
492
493 -- Condition Initialization / Destruction
494
495 function pthread_condattr_init
496 (attr : access pthread_condattr_t) return int;
497 pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
498
499 function pthread_condattr_destroy
500 (attr : access pthread_condattr_t) return int;
501 pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
502
503 -- Condition Attributes
504
505 COND_PRIORITY : constant := 0; -- wait in priority order
506 COND_FIFO : constant := 1; -- first-in-first-out
507
508 -- Condition debugging options
509
510 COND_NO_DEBUG : constant := 0; -- no debugging on mutex
511 COND_DEBUG : constant := 1; -- debugging is on
512
513 -- Condition sharing attributes
514
515 COND_SHARED : constant := 0; -- shared between processes
516 COND_NOTSHARED : constant := 1; -- not shared between processes
517
518 -- Condition Operations
519
520 function pthread_cond_init
521 (cond : access pthread_cond_t;
522 attr : access pthread_condattr_t) return int;
523 pragma Import (C, pthread_cond_init, "pthread_cond_init");
524
525 function pthread_cond_destroy
526 (cond : access pthread_cond_t) return int;
527 pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
528
529 function pthread_cond_signal (cond : access pthread_cond_t) return int;
530 pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
531
532 function pthread_cond_wait
533 (cond : access pthread_cond_t;
534 mutex : access pthread_mutex_t) return int;
535 pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
536
537 function pthread_cond_timedwait
538 (cond : access pthread_cond_t;
539 mutex : access pthread_mutex_t;
540 abstime : access struct_timeval) return int;
541 pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
542
543 -- Thread-Specific Data
544
545 type foo_h_proc_1 is access procedure (value : Address);
546
547 function pthread_key_create
548 (key : access pthread_key_t; destructor : foo_h_proc_1) return int;
549 pragma Import (C, pthread_key_create, "pthread_key_create");
550
551 function pthread_setspecific
552 (key : pthread_key_t; value : Address) return int;
553 pragma Import (C, pthread_setspecific, "pthread_setspecific");
554
555 function pthread_getspecific
556 (key : pthread_key_t; value : access Address) return int;
557 pragma Import (C, pthread_getspecific, "pthread_getspecific");
558
559 type foo_h_proc_2 is access procedure;
560
561 function pthread_exec_begin (init : access pthread_init_struct) return int;
562 pragma Import (C, pthread_exec_begin, "pthread_exec_begin");
563
564 function sproc_create
565 (sproc_id : access sproc_t;
566 attr : access sproc_attr_t;
567 start_routine : sproc_start_addr;
568 arg : Address) return int;
569 pragma Import (C, sproc_create, "sproc_create");
570
571 function sproc_self return sproc_t;
572 pragma Import (C, sproc_self, "sproc_self");
573
574 -- if equal fast TRUE is returned - common case
575 -- if not equal thread resource must NOT be null in order to compare bits
576
577 --
578 -- Sproc attribute initialize / destroy
579 --
580
581 function sproc_attr_init (attr : access sproc_attr_t) return int;
582 pragma Import (C, sproc_attr_init, "sproc_attr_init");
583
584 function sproc_attr_destroy (attr : access sproc_attr_t) return int;
585 pragma Import (C, sproc_attr_destroy, "sproc_attr_destroy");
586
587 function sproc_attr_setresources
588 (attr : access sproc_attr_t; resources : resource_t) return int;
589 pragma Import (C, sproc_attr_setresources, "sproc_attr_setresources");
590
591 function sproc_attr_getresources
592 (attr : access sproc_attr_t;
593 resources : access resource_t) return int;
594 pragma Import (C, sproc_attr_getresources, "sproc_attr_getresources");
595
596 function sproc_attr_setcpu
597 (attr : access sproc_attr_t; cpu_num : int) return int;
598 pragma Import (C, sproc_attr_setcpu, "sproc_attr_setcpu");
599
600 function sproc_attr_getcpu
601 (attr : access sproc_attr_t; cpu_num : access int) return int;
602 pragma Import (C, sproc_attr_getcpu, "sproc_attr_getcpu");
603
604 function sproc_attr_setresident
605 (attr : access sproc_attr_t; resident : int) return int;
606 pragma Import (C, sproc_attr_setresident, "sproc_attr_setresident");
607
608 function sproc_attr_getresident
609 (attr : access sproc_attr_t; resident : access int) return int;
610 pragma Import (C, sproc_attr_getresident, "sproc_attr_getresident");
611
612 function sproc_attr_setname
613 (attr : access sproc_attr_t; name : chars_ptr) return int;
614 pragma Import (C, sproc_attr_setname, "sproc_attr_setname");
615
616 function sproc_attr_getname
617 (attr : access sproc_attr_t; name : chars_ptr) return int;
618 pragma Import (C, sproc_attr_getname, "sproc_attr_getname");
619
620 function sproc_attr_setstacksize
621 (attr : access sproc_attr_t; stacksize : size_t) return int;
622 pragma Import (C, sproc_attr_setstacksize, "sproc_attr_setstacksize");
623
624 function sproc_attr_getstacksize
625 (attr : access sproc_attr_t; stacksize : access size_t) return int;
626 pragma Import (C, sproc_attr_getstacksize, "sproc_attr_getstacksize");
627
628 function sproc_attr_setprio
629 (attr : access sproc_attr_t; priority : int) return int;
630 pragma Import (C, sproc_attr_setprio, "sproc_attr_setprio");
631
632 function sproc_attr_getprio
633 (attr : access sproc_attr_t; priority : access int) return int;
634 pragma Import (C, sproc_attr_getprio, "sproc_attr_getprio");
635
636 function sproc_attr_setbthread
637 (attr : access sproc_attr_t; bthread : ptcb_p) return int;
638 pragma Import (C, sproc_attr_setbthread, "sproc_attr_setbthread");
639
640 function sproc_attr_getbthread
641 (attr : access sproc_attr_t; bthread : access ptcb_p) return int;
642 pragma Import (C, sproc_attr_getbthread, "sproc_attr_getbthread");
643
644 SPROC_NO_RESOURCES : constant := 0;
645 SPROC_ANY_CPU : constant := -1;
646 SPROC_MY_PRIORITY : constant := -1;
647 SPROC_SWAPPED : constant := 0;
648 SPROC_RESIDENT : constant := 1;
649
650 type isr_address is access procedure;
651
652 function intr_attach (sig : int; isr : isr_address) return int;
653 pragma Import (C, intr_attach, "intr_attach");
654
655 Intr_Attach_Reset : constant Boolean := False;
656 -- True if intr_attach is reset after an interrupt handler is called
657
658 function intr_exchange
659 (sig : int;
660 isr : isr_address;
661 oisr : access isr_address) return int;
662 pragma Import (C, intr_exchange, "intr_exchange");
663
664 function intr_current_isr
665 (sig : int;
666 oisr : access isr_address)
667 return int;
668 pragma Import (C, intr_current_isr, "intr_current_isr");
669
670 private
671
672 type clockid_t is new int;
673
674 CLOCK_REALTIME : constant clockid_t := 1;
675 CLOCK_SGI_CYCLE : constant clockid_t := 2;
676 CLOCK_SGI_FAST : constant clockid_t := 3;
677
678 type pthread_t is new Address; -- thread identifier
679 type pthread_mutex_t is new Address; -- mutex identifier
680 type pthread_cond_t is new Address; -- cond identifier
681 type pthread_attr_t is new Address; -- pthread attributes
682 type pthread_mutexattr_t is new Address; -- mutex attributes
683 type pthread_condattr_t is new Address; -- mutex attributes
684 type sem_t is new Address; -- semaphore identifier
685 type pthread_key_t is new Address; -- per thread key
686
687 type sigbits_t is array (Integer range 0 .. 3) of unsigned;
688 type sigset_t is record
689 sigbits : sigbits_t;
690 end record;
691 pragma Convention (C, sigset_t);
692
693 type pid_t is new long;
694
695 end System.OS_Interface;
This page took 0.067618 seconds and 5 git commands to generate.