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--                                                                          --
9--             Copyright (C) 2009-2014, 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 3,  or (at your option) any later ver- --
14-- sion.  GNAT 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.                                     --
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--                                                                          --
27------------------------------------------------------------------------------
28
29--  This is the mipsel version of this package
30
31--  This package encapsulates cpu specific differences between implementations
32--  of GNU/Linux, in order to share s-osinte-linux.ads.
33
34--  PLEASE DO NOT add any with-clauses to this package or remove the pragma
35--  Preelaborate. This package is designed to be a bottom-level (leaf) package
36
37with Interfaces.C;
38
39package System.Linux is
40   pragma Preelaborate;
41
42   ----------
43   -- Time --
44   ----------
45
46   subtype long        is Interfaces.C.long;
47   subtype suseconds_t is Interfaces.C.long;
48   subtype time_t      is Interfaces.C.long;
49
50   type timespec is record
51      tv_sec  : time_t;
52      tv_nsec : long;
53   end record;
54   pragma Convention (C, timespec);
55
56   type timeval is record
57      tv_sec  : time_t;
58      tv_usec : suseconds_t;
59   end record;
60   pragma Convention (C, timeval);
61
62   -----------
63   -- Errno --
64   -----------
65
66   EAGAIN    : constant := 11;
67   EINTR     : constant := 4;
68   EINVAL    : constant := 22;
69   ENOMEM    : constant := 12;
70   EPERM     : constant := 1;
71   ETIMEDOUT : constant := 110;
72
73   -------------
74   -- Signals --
75   -------------
76
77   SIGHUP     : constant := 1; --  hangup
78   SIGINT     : constant := 2; --  interrupt (rubout)
79   SIGQUIT    : constant := 3; --  quit (ASCD FS)
80   SIGILL     : constant := 4; --  illegal instruction (not reset)
81   SIGTRAP    : constant := 5; --  trace trap (not reset)
82   SIGIOT     : constant := 6; --  IOT instruction
83   SIGABRT    : constant := 6; --  used by abort, replace SIGIOT in the  future
84   SIGFPE     : constant := 8; --  floating point exception
85   SIGKILL    : constant := 9; --  kill (cannot be caught or ignored)
86   SIGBUS     : constant := 7; --  bus error
87   SIGSEGV    : constant := 11; --  segmentation violation
88   SIGPIPE    : constant := 13; --  write on a pipe with no one to read it
89   SIGALRM    : constant := 14; --  alarm clock
90   SIGTERM    : constant := 15; --  software termination signal from kill
91   SIGUSR1    : constant := 10; --  user defined signal 1
92   SIGUSR2    : constant := 12; --  user defined signal 2
93   SIGCLD     : constant := 17; --  alias for SIGCHLD
94   SIGCHLD    : constant := 17; --  child status change
95   SIGPWR     : constant := 30; --  power-fail restart
96   SIGWINCH   : constant := 28; --  window size change
97   SIGURG     : constant := 23; --  urgent condition on IO channel
98   SIGPOLL    : constant := 29; --  pollable event occurred
99   SIGIO      : constant := 29; --  I/O now possible (4.2 BSD)
100   SIGLOST    : constant := 29; --  File lock lost
101   SIGSTOP    : constant := 19; --  stop (cannot be caught or ignored)
102   SIGTSTP    : constant := 20; --  user stop requested from tty
103   SIGCONT    : constant := 18; --  stopped process has been continued
104   SIGTTIN    : constant := 21; --  background tty read attempted
105   SIGTTOU    : constant := 22; --  background tty write attempted
106   SIGVTALRM  : constant := 26; --  virtual timer expired
107   SIGPROF    : constant := 27; --  profiling timer expired
108   SIGXCPU    : constant := 24; --  CPU time limit exceeded
109   SIGXFSZ    : constant := 25; --  filesize limit exceeded
110   SIGUNUSED  : constant := 31; --  unused signal (GNU/Linux)
111   SIGSTKFLT  : constant := 16; --  coprocessor stack fault (Linux)
112   SIGLTHRRES : constant := 32; --  GNU/LinuxThreads restart signal
113   SIGLTHRCAN : constant := 33; --  GNU/LinuxThreads cancel signal
114   SIGLTHRDBG : constant := 34; --  GNU/LinuxThreads debugger signal
115
116   --  struct_sigaction offsets
117
118   sa_handler_pos : constant := Standard'Address_Size / 8;
119   sa_mask_pos    : constant := 2 * Standard'Address_Size / 8;
120   sa_flags_pos   : constant := 0;
121
122   SA_SIGINFO  : constant := 16#04#;
123   SA_ONSTACK  : constant := 16#08000000#;
124
125end System.Linux;
126