1 ------------------------------------------------------------------------------
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
5 -- S Y S T E M . L I N U X --
9 -- Copyright (C) 2008, Free Software Foundation, Inc. --
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, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
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. --
29 ------------------------------------------------------------------------------
31 -- This is the hppa version of this package
33 -- This package encapsulates cpu specific differences between implementations
34 -- of GNU/Linux, in order to share s-osinte-linux.ads.
36 -- PLEASE DO NOT add any with-clauses to this package or remove the pragma
37 -- Preelaborate. This package is designed to be a bottom-level (leaf) package.
39 package System.Linux is
46 EAGAIN : constant := 11;
47 EINTR : constant := 4;
48 EINVAL : constant := 22;
49 ENOMEM : constant := 12;
50 EPERM : constant := 1;
51 ETIMEDOUT : constant := 238;
57 SIGHUP : constant := 1; -- hangup
58 SIGINT : constant := 2; -- interrupt (rubout)
59 SIGQUIT : constant := 3; -- quit (ASCD FS)
60 SIGILL : constant := 4; -- illegal instruction (not reset)
61 SIGTRAP : constant := 5; -- trace trap (not reset)
62 SIGIOT : constant := 6; -- IOT instruction
63 SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
64 SIGEMT : constant := 7; -- EMT
65 SIGFPE : constant := 8; -- floating point exception
66 SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
67 SIGBUS : constant := 10; -- bus error
68 SIGSEGV : constant := 11; -- segmentation violation
69 SIGSYS : constant := 12; -- bad system call
70 SIGPIPE : constant := 13; -- write on a pipe with no one to read it
71 SIGALRM : constant := 14; -- alarm clock
72 SIGTERM : constant := 15; -- software termination signal from kill
73 SIGUSR1 : constant := 16; -- user defined signal 1
74 SIGUSR2 : constant := 17; -- user defined signal 2
75 SIGCLD : constant := 18; -- alias for SIGCHLD
76 SIGCHLD : constant := 18; -- child status change
77 SIGPWR : constant := 19; -- power-fail restart
78 SIGVTALRM : constant := 20; -- virtual timer expired
79 SIGPROF : constant := 21; -- profiling timer expired
80 SIGPOLL : constant := 22; -- pollable event occurred
81 SIGIO : constant := 22; -- I/O now possible (4.2 BSD)
82 SIGWINCH : constant := 23; -- window size change
83 SIGSTOP : constant := 24; -- stop (cannot be caught or ignored)
84 SIGTSTP : constant := 25; -- user stop requested from tty
85 SIGCONT : constant := 26; -- stopped process has been continued
86 SIGTTIN : constant := 27; -- background tty read attempted
87 SIGTTOU : constant := 28; -- background tty write attempted
88 SIGURG : constant := 29; -- urgent condition on IO channel
89 SIGLOST : constant := 30; -- File lock lost
90 SIGUNUSED : constant := 31; -- unused signal (GNU/Linux)
91 SIGXCPU : constant := 33; -- CPU time limit exceeded
92 SIGXFSZ : constant := 34; -- filesize limit exceeded
93 SIGSTKFLT : constant := 36; -- coprocessor stack fault (Linux)
94 SIGLTHRRES : constant := 37; -- GNU/LinuxThreads restart signal
95 SIGLTHRCAN : constant := 38; -- GNU/LinuxThreads cancel signal
96 SIGLTHRDBG : constant := 39; -- GNU/LinuxThreads debugger signal
98 -- struct_sigaction offsets
100 sa_flags_pos : constant := Standard'Address_Size / 8;
101 sa_mask_pos : constant := sa_flags_pos * 2;
103 SA_SIGINFO : constant := 16#10#;
104 SA_ONSTACK : constant := 16#01#;
106 type lock_array is array (1 .. 4) of Integer;
107 type atomic_lock_t is record
110 pragma Convention (C, atomic_lock_t);
111 for atomic_lock_t'Alignment use 16;
113 type struct_pthread_fast_lock is record
114 spinlock : atomic_lock_t;
115 status : Long_Integer;
117 pragma Convention (C, struct_pthread_fast_lock);
119 type pthread_mutex_t is record
120 m_reserved : Integer;
122 m_owner : System.Address;
124 m_lock : struct_pthread_fast_lock;
126 pragma Convention (C, pthread_mutex_t);