1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
5 -- S Y S T E M . I N T E R R U P T S --
9 -- Copyright (C) 1991-1994, Florida State University --
10 -- Copyright (C) 1995-2008, AdaCore --
12 -- GNARL is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNARL; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
21 -- Boston, MA 02110-1301, USA. --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
30 -- GNARL was developed by the GNARL team at Florida State University. --
31 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
33 ------------------------------------------------------------------------------
35 -- This version is for systems that do not support interrupts (or signals)
37 package body System.Interrupts is
39 pragma Warnings (Off); -- kill warnings on unreferenced formals
43 -----------------------
44 -- Local Subprograms --
45 -----------------------
47 procedure Unimplemented;
48 -- This procedure raises a Program_Error with an appropriate message
49 -- indicating that an unimplemented feature has been used.
55 procedure Attach_Handler
56 (New_Handler : Parameterless_Handler;
57 Interrupt : Interrupt_ID;
58 Static : Boolean := False)
64 -----------------------------
65 -- Bind_Interrupt_To_Entry --
66 -----------------------------
68 procedure Bind_Interrupt_To_Entry
71 Int_Ref : System.Address)
75 end Bind_Interrupt_To_Entry;
81 procedure Block_Interrupt (Interrupt : Interrupt_ID) is
90 function Current_Handler
91 (Interrupt : Interrupt_ID) return Parameterless_Handler
102 procedure Detach_Handler
103 (Interrupt : Interrupt_ID;
104 Static : Boolean := False)
110 ------------------------------
111 -- Detach_Interrupt_Entries --
112 ------------------------------
114 procedure Detach_Interrupt_Entries (T : Task_Id) is
117 end Detach_Interrupt_Entries;
119 ----------------------
120 -- Exchange_Handler --
121 ----------------------
123 procedure Exchange_Handler
124 (Old_Handler : out Parameterless_Handler;
125 New_Handler : Parameterless_Handler;
126 Interrupt : Interrupt_ID;
127 Static : Boolean := False)
132 end Exchange_Handler;
138 procedure Finalize (Object : in out Static_Interrupt_Protection) is
143 -------------------------------------
144 -- Has_Interrupt_Or_Attach_Handler --
145 -------------------------------------
147 function Has_Interrupt_Or_Attach_Handler
148 (Object : access Dynamic_Interrupt_Protection)
151 pragma Warnings (Off, Object);
155 end Has_Interrupt_Or_Attach_Handler;
157 function Has_Interrupt_Or_Attach_Handler
158 (Object : access Static_Interrupt_Protection)
161 pragma Warnings (Off, Object);
165 end Has_Interrupt_Or_Attach_Handler;
167 ----------------------
168 -- Ignore_Interrupt --
169 ----------------------
171 procedure Ignore_Interrupt (Interrupt : Interrupt_ID) is
174 end Ignore_Interrupt;
176 ----------------------
177 -- Install_Handlers --
178 ----------------------
180 procedure Install_Handlers
181 (Object : access Static_Interrupt_Protection;
182 New_Handlers : New_Handler_Array)
186 end Install_Handlers;
188 ---------------------------------
189 -- Install_Restricted_Handlers --
190 ---------------------------------
192 procedure Install_Restricted_Handlers (Handlers : New_Handler_Array) is
195 end Install_Restricted_Handlers;
201 function Is_Blocked (Interrupt : Interrupt_ID) return Boolean is
207 -----------------------
208 -- Is_Entry_Attached --
209 -----------------------
211 function Is_Entry_Attached (Interrupt : Interrupt_ID) return Boolean is
215 end Is_Entry_Attached;
217 -------------------------
218 -- Is_Handler_Attached --
219 -------------------------
221 function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean is
225 end Is_Handler_Attached;
231 function Is_Ignored (Interrupt : Interrupt_ID) return Boolean is
241 function Is_Reserved (Interrupt : Interrupt_ID) return Boolean is
251 function Reference (Interrupt : Interrupt_ID) return System.Address is
254 return Interrupt'Address;
257 --------------------------------
258 -- Register_Interrupt_Handler --
259 --------------------------------
261 procedure Register_Interrupt_Handler
262 (Handler_Addr : System.Address)
266 end Register_Interrupt_Handler;
268 -----------------------
269 -- Unblock_Interrupt --
270 -----------------------
272 procedure Unblock_Interrupt (Interrupt : Interrupt_ID) is
275 end Unblock_Interrupt;
281 function Unblocked_By (Interrupt : Interrupt_ID)
282 return System.Tasking.Task_Id is
288 ------------------------
289 -- Unignore_Interrupt --
290 ------------------------
292 procedure Unignore_Interrupt (Interrupt : Interrupt_ID) is
295 end Unignore_Interrupt;
301 procedure Unimplemented is
303 raise Program_Error with "interrupts/signals not implemented";
306 end System.Interrupts;