]>
Commit | Line | Data |
---|---|---|
770db697 EB |
1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- | |
4 | -- -- | |
5 | -- S Y S T E M . L I N U X -- | |
6 | -- -- | |
7 | -- S p e c -- | |
8 | -- -- | |
748086b7 | 9 | -- Copyright (C) 2009, Free Software Foundation, Inc. -- |
770db697 EB |
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- -- | |
748086b7 JJ |
13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- |
14 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- | |
770db697 | 15 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- |
748086b7 JJ |
16 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- |
17 | -- -- | |
18 | -- As a special exception under Section 7 of GPL version 3, you are granted -- | |
19 | -- additional permissions described in the GCC Runtime Library Exception, -- | |
20 | -- version 3.1, as published by the Free Software Foundation. -- | |
21 | -- -- | |
22 | -- You should have received a copy of the GNU General Public License and -- | |
23 | -- a copy of the GCC Runtime Library Exception along with this program; -- | |
24 | -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- | |
25 | -- <http://www.gnu.org/licenses/>. -- | |
26 | -- -- | |
770db697 EB |
27 | -- -- |
28 | ------------------------------------------------------------------------------ | |
29 | ||
30 | -- This is the hppa version of this package | |
31 | ||
32 | -- This package encapsulates cpu specific differences between implementations | |
33 | -- of GNU/Linux, in order to share s-osinte-linux.ads. | |
34 | ||
35 | -- PLEASE DO NOT add any with-clauses to this package or remove the pragma | |
36 | -- Preelaborate. This package is designed to be a bottom-level (leaf) package. | |
37 | ||
38 | package System.Linux is | |
39 | pragma Preelaborate; | |
40 | ||
41 | ----------- | |
42 | -- Errno -- | |
43 | ----------- | |
44 | ||
45 | EAGAIN : constant := 11; | |
46 | EINTR : constant := 4; | |
47 | EINVAL : constant := 22; | |
48 | ENOMEM : constant := 12; | |
49 | EPERM : constant := 1; | |
50 | ETIMEDOUT : constant := 238; | |
51 | ||
52 | ------------- | |
53 | -- Signals -- | |
54 | ------------- | |
55 | ||
56 | SIGHUP : constant := 1; -- hangup | |
57 | SIGINT : constant := 2; -- interrupt (rubout) | |
58 | SIGQUIT : constant := 3; -- quit (ASCD FS) | |
59 | SIGILL : constant := 4; -- illegal instruction (not reset) | |
60 | SIGTRAP : constant := 5; -- trace trap (not reset) | |
61 | SIGIOT : constant := 6; -- IOT instruction | |
62 | SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future | |
63 | SIGEMT : constant := 7; -- EMT | |
64 | SIGFPE : constant := 8; -- floating point exception | |
65 | SIGKILL : constant := 9; -- kill (cannot be caught or ignored) | |
66 | SIGBUS : constant := 10; -- bus error | |
67 | SIGSEGV : constant := 11; -- segmentation violation | |
68 | SIGSYS : constant := 12; -- bad system call | |
69 | SIGPIPE : constant := 13; -- write on a pipe with no one to read it | |
70 | SIGALRM : constant := 14; -- alarm clock | |
71 | SIGTERM : constant := 15; -- software termination signal from kill | |
72 | SIGUSR1 : constant := 16; -- user defined signal 1 | |
73 | SIGUSR2 : constant := 17; -- user defined signal 2 | |
74 | SIGCLD : constant := 18; -- alias for SIGCHLD | |
75 | SIGCHLD : constant := 18; -- child status change | |
76 | SIGPWR : constant := 19; -- power-fail restart | |
77 | SIGVTALRM : constant := 20; -- virtual timer expired | |
78 | SIGPROF : constant := 21; -- profiling timer expired | |
79 | SIGPOLL : constant := 22; -- pollable event occurred | |
80 | SIGIO : constant := 22; -- I/O now possible (4.2 BSD) | |
81 | SIGWINCH : constant := 23; -- window size change | |
82 | SIGSTOP : constant := 24; -- stop (cannot be caught or ignored) | |
83 | SIGTSTP : constant := 25; -- user stop requested from tty | |
84 | SIGCONT : constant := 26; -- stopped process has been continued | |
85 | SIGTTIN : constant := 27; -- background tty read attempted | |
86 | SIGTTOU : constant := 28; -- background tty write attempted | |
87 | SIGURG : constant := 29; -- urgent condition on IO channel | |
88 | SIGLOST : constant := 30; -- File lock lost | |
89 | SIGUNUSED : constant := 31; -- unused signal (GNU/Linux) | |
90 | SIGXCPU : constant := 33; -- CPU time limit exceeded | |
91 | SIGXFSZ : constant := 34; -- filesize limit exceeded | |
92 | SIGSTKFLT : constant := 36; -- coprocessor stack fault (Linux) | |
93 | SIGLTHRRES : constant := 37; -- GNU/LinuxThreads restart signal | |
94 | SIGLTHRCAN : constant := 38; -- GNU/LinuxThreads cancel signal | |
95 | SIGLTHRDBG : constant := 39; -- GNU/LinuxThreads debugger signal | |
96 | ||
97 | -- struct_sigaction offsets | |
98 | ||
0e5b1d0b AC |
99 | sa_flags_pos : constant := Standard'Address_Size / 8; |
100 | sa_mask_pos : constant := sa_flags_pos * 2; | |
770db697 | 101 | |
0e5b1d0b AC |
102 | SA_SIGINFO : constant := 16#10#; |
103 | SA_ONSTACK : constant := 16#01#; | |
770db697 | 104 | |
1e273538 | 105 | type lock_array is array (1 .. 4) of Integer; |
770db697 EB |
106 | type atomic_lock_t is record |
107 | lock : lock_array; | |
108 | end record; | |
109 | pragma Convention (C, atomic_lock_t); | |
0e5b1d0b | 110 | for atomic_lock_t'Alignment use 16; |
770db697 EB |
111 | |
112 | type struct_pthread_fast_lock is record | |
113 | spinlock : atomic_lock_t; | |
114 | status : Long_Integer; | |
115 | end record; | |
116 | pragma Convention (C, struct_pthread_fast_lock); | |
117 | ||
118 | type pthread_mutex_t is record | |
119 | m_reserved : Integer; | |
120 | m_count : Integer; | |
121 | m_owner : System.Address; | |
122 | m_kind : Integer; | |
123 | m_lock : struct_pthread_fast_lock; | |
124 | end record; | |
125 | pragma Convention (C, pthread_mutex_t); | |
126 | ||
127 | end System.Linux; |