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-2013, AdaCore --
12 -- GNAT 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 3, or (at your option) any later ver- --
15 -- sion. GNAT 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. --
19 -- As a special exception under Section 7 of GPL version 3, you are granted --
20 -- additional permissions described in the GCC Runtime Library Exception, --
21 -- version 3.1, as published by the Free Software Foundation. --
23 -- You should have received a copy of the GNU General Public License and --
24 -- a copy of the GCC Runtime Library Exception along with this program; --
25 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
26 -- <http://www.gnu.org/licenses/>. --
28 -- GNARL was developed by the GNARL team at Florida State University. --
29 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
31 ------------------------------------------------------------------------------
33 -- This version is for systems that do not support interrupts (or signals)
35 package body System
.Interrupts
is
37 pragma Warnings
(Off
); -- kill warnings on unreferenced formals
41 -----------------------
42 -- Local Subprograms --
43 -----------------------
45 procedure Unimplemented
;
46 -- This procedure raises a Program_Error with an appropriate message
47 -- indicating that an unimplemented feature has been used.
53 procedure Attach_Handler
54 (New_Handler
: Parameterless_Handler
;
55 Interrupt
: Interrupt_ID
;
56 Static
: Boolean := False)
62 -----------------------------
63 -- Bind_Interrupt_To_Entry --
64 -----------------------------
66 procedure Bind_Interrupt_To_Entry
69 Int_Ref
: System
.Address
)
73 end Bind_Interrupt_To_Entry
;
79 procedure Block_Interrupt
(Interrupt
: Interrupt_ID
) is
88 function Current_Handler
89 (Interrupt
: Interrupt_ID
) return Parameterless_Handler
100 procedure Detach_Handler
101 (Interrupt
: Interrupt_ID
;
102 Static
: Boolean := False)
108 ------------------------------
109 -- Detach_Interrupt_Entries --
110 ------------------------------
112 procedure Detach_Interrupt_Entries
(T
: Task_Id
) is
115 end Detach_Interrupt_Entries
;
117 ----------------------
118 -- Exchange_Handler --
119 ----------------------
121 procedure Exchange_Handler
122 (Old_Handler
: out Parameterless_Handler
;
123 New_Handler
: Parameterless_Handler
;
124 Interrupt
: Interrupt_ID
;
125 Static
: Boolean := False)
130 end Exchange_Handler
;
136 procedure Finalize
(Object
: in out Static_Interrupt_Protection
) is
141 -------------------------------------
142 -- Has_Interrupt_Or_Attach_Handler --
143 -------------------------------------
145 function Has_Interrupt_Or_Attach_Handler
146 (Object
: access Dynamic_Interrupt_Protection
)
149 pragma Warnings
(Off
, Object
);
153 end Has_Interrupt_Or_Attach_Handler
;
155 function Has_Interrupt_Or_Attach_Handler
156 (Object
: access Static_Interrupt_Protection
)
159 pragma Warnings
(Off
, Object
);
163 end Has_Interrupt_Or_Attach_Handler
;
165 ----------------------
166 -- Ignore_Interrupt --
167 ----------------------
169 procedure Ignore_Interrupt
(Interrupt
: Interrupt_ID
) is
172 end Ignore_Interrupt
;
174 ----------------------
175 -- Install_Handlers --
176 ----------------------
178 procedure Install_Handlers
179 (Object
: access Static_Interrupt_Protection
;
180 New_Handlers
: New_Handler_Array
)
184 end Install_Handlers
;
186 ---------------------------------
187 -- Install_Restricted_Handlers --
188 ---------------------------------
190 procedure Install_Restricted_Handlers
191 (Prio
: Any_Priority
;
192 Handlers
: New_Handler_Array
)
196 end Install_Restricted_Handlers
;
202 function Is_Blocked
(Interrupt
: Interrupt_ID
) return Boolean is
208 -----------------------
209 -- Is_Entry_Attached --
210 -----------------------
212 function Is_Entry_Attached
(Interrupt
: Interrupt_ID
) return Boolean is
216 end Is_Entry_Attached
;
218 -------------------------
219 -- Is_Handler_Attached --
220 -------------------------
222 function Is_Handler_Attached
(Interrupt
: Interrupt_ID
) return Boolean is
226 end Is_Handler_Attached
;
232 function Is_Ignored
(Interrupt
: Interrupt_ID
) return Boolean is
242 function Is_Reserved
(Interrupt
: Interrupt_ID
) return Boolean is
252 function Reference
(Interrupt
: Interrupt_ID
) return System
.Address
is
255 return Interrupt
'Address;
258 --------------------------------
259 -- Register_Interrupt_Handler --
260 --------------------------------
262 procedure Register_Interrupt_Handler
263 (Handler_Addr
: System
.Address
)
267 end Register_Interrupt_Handler
;
269 -----------------------
270 -- Unblock_Interrupt --
271 -----------------------
273 procedure Unblock_Interrupt
(Interrupt
: Interrupt_ID
) is
276 end Unblock_Interrupt
;
282 function Unblocked_By
(Interrupt
: Interrupt_ID
)
283 return System
.Tasking
.Task_Id
is
289 ------------------------
290 -- Unignore_Interrupt --
291 ------------------------
293 procedure Unignore_Interrupt
(Interrupt
: Interrupt_ID
) is
296 end Unignore_Interrupt
;
302 procedure Unimplemented
is
304 raise Program_Error
with "interrupts/signals not implemented";
307 end System
.Interrupts
;