Remove some compile time warnings about duplicate definitions.
[official-gcc.git] / gcc / ada / 5fintman.adb
blob919562dfc5ac30097d1238c954d493d8bbd93097
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T --
6 -- --
7 -- B o d y --
8 -- --
9 -- $Revision: 1.5 $
10 -- --
11 -- Copyright (C) 1991-2001, Florida State University --
12 -- --
13 -- GNARL is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNARL; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
23 -- --
24 -- As a special exception, if other files instantiate generics from this --
25 -- unit, or you link this unit with other files to produce an executable, --
26 -- this unit does not by itself cause the resulting executable to be --
27 -- covered by the GNU General Public License. This exception does not --
28 -- however invalidate any other reasons why the executable file might be --
29 -- covered by the GNU Public License. --
30 -- --
31 -- GNARL was developed by the GNARL team at Florida State University. It is --
32 -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
33 -- State University (http://www.gnat.com). --
34 -- --
35 ------------------------------------------------------------------------------
37 -- This is a SGI Pthread version of this package.
39 -- PLEASE DO NOT add any dependences on other packages.
40 -- This package is designed to work with or without tasking support.
42 -- Make a careful study of all signals available under the OS,
43 -- to see which need to be reserved, kept always unmasked,
44 -- or kept always unmasked.
45 -- Be on the lookout for special signals that
46 -- may be used by the thread library.
48 with Interfaces.C;
49 -- used for int
51 with System.OS_Interface;
52 -- used for various Constants, Signal and types
54 package body System.Interrupt_Management is
56 use System.OS_Interface;
58 type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID;
59 Exception_Interrupts : constant Interrupt_List :=
60 (SIGTSTP, SIGILL, SIGTRAP, SIGEMT, SIGFPE, SIGBUS, SIGSTOP, SIGKILL,
61 SIGSEGV, SIGSYS, SIGXCPU, SIGXFSZ, SIGPROF, SIGPTINTR, SIGPTRESCHED,
62 SIGABRT, SIGPIPE);
64 ---------------------------
65 -- Initialize_Interrupts --
66 ---------------------------
68 -- Nothing needs to be done on this platform.
70 procedure Initialize_Interrupts is
71 begin
72 null;
73 end Initialize_Interrupts;
75 Unreserve_All_Interrupts : Interfaces.C.int;
76 pragma Import
77 (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
79 use type Interfaces.C.int;
81 begin
82 Abort_Task_Interrupt := SIGABRT;
83 -- Change this if you want to use another signal for task abort.
84 -- SIGTERM might be a good one.
86 for I in Exception_Interrupts'Range loop
87 Keep_Unmasked (Exception_Interrupts (I)) := True;
88 end loop;
90 -- By keeping SIGINT unmasked, allow the user to do a Ctrl-C, but in the
91 -- same time, disable the ability of handling this signal via
92 -- Ada.Interrupts.
93 -- The pragma Unreserve_All_Interrupts let the user the ability to
94 -- change this behavior.
96 if Unreserve_All_Interrupts = 0 then
97 Keep_Unmasked (SIGINT) := True;
98 end if;
100 Keep_Unmasked (Abort_Task_Interrupt) := True;
102 Reserve := Keep_Unmasked or Keep_Masked;
103 Reserve (0) := True;
104 end System.Interrupt_Management;