Remove some compile time warnings about duplicate definitions.
[official-gcc.git] / gcc / ada / 5gintman.adb
blobad3ef44169f30b4050e450958a05160040c34cee
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.6 $ --
10 -- --
11 -- Copyright (C) 1997-1998, 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 an Irix (old pthread library) 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 System.OS_Interface;
49 -- used for various Constants, Signal and types
51 package body System.Interrupt_Management is
53 use System.OS_Interface;
55 type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID;
57 Exception_Interrupts : constant Interrupt_List :=
58 (SIGILL,
59 SIGABRT,
60 SIGFPE,
61 SIGSEGV,
62 SIGBUS);
64 Reserved_Interrupts : constant Interrupt_List :=
65 (0,
66 SIGTRAP,
67 SIGKILL,
68 SIGSYS,
69 SIGALRM,
70 SIGSTOP,
71 SIGPTINTR,
72 SIGPTRESCHED);
74 Abort_Signal : constant := 48;
76 -- Serious MOJO: The SGI pthreads library only supports the
77 -- unnamed signal number 48 for pthread_kill!
80 ----------------------
81 -- Notify_Exception --
82 ----------------------
84 -- This function identifies the Ada exception to be raised using the
85 -- information when the system received a synchronous signal.
86 -- Since this function is machine and OS dependent, different code has to
87 -- be provided for different target.
88 -- On SGI, the signal handling is done is a-init.c, even when tasking is
89 -- involved.
91 ---------------------------
92 -- Initialize_Interrupts --
93 ---------------------------
95 -- Nothing needs to be done on this platform.
97 procedure Initialize_Interrupts is
98 begin
99 null;
100 end Initialize_Interrupts;
102 begin
103 Abort_Task_Interrupt := Abort_Signal;
105 for I in Reserved_Interrupts'Range loop
106 Keep_Unmasked (Reserved_Interrupts (I)) := True;
107 Reserve (Reserved_Interrupts (I)) := True;
108 end loop;
110 for I in Exception_Interrupts'Range loop
111 Keep_Unmasked (Exception_Interrupts (I)) := True;
112 Reserve (Reserved_Interrupts (I)) := True;
113 end loop;
115 end System.Interrupt_Management;