1 ------------------------------------------------------------------------------
3 -- GNU ADA 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-2003, Ada Core Technologies --
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, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, 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 is an OS/2 version of this package.
37 -- This version is a stub, for systems that
38 -- do not support interrupts (or signals).
42 package body System
.Interrupts
is
44 pragma Warnings
(Off
); -- kill warnings on unreferenced formals
48 -----------------------
49 -- Local Subprograms --
50 -----------------------
52 procedure Unimplemented
;
53 -- This procedure raises a Program_Error with an appropriate message
54 -- indicating that an unimplemented feature has been used.
60 procedure Attach_Handler
61 (New_Handler
: Parameterless_Handler
;
62 Interrupt
: Interrupt_ID
;
63 Static
: Boolean := False)
69 -----------------------------
70 -- Bind_Interrupt_To_Entry --
71 -----------------------------
73 procedure Bind_Interrupt_To_Entry
76 Int_Ref
: System
.Address
)
80 end Bind_Interrupt_To_Entry
;
86 procedure Block_Interrupt
(Interrupt
: Interrupt_ID
) is
95 function Current_Handler
96 (Interrupt
: Interrupt_ID
)
97 return Parameterless_Handler
108 procedure Detach_Handler
109 (Interrupt
: Interrupt_ID
;
110 Static
: Boolean := False)
116 ------------------------------
117 -- Detach_Interrupt_Entries --
118 ------------------------------
120 procedure Detach_Interrupt_Entries
(T
: Task_ID
) is
123 end Detach_Interrupt_Entries
;
125 ----------------------
126 -- Exchange_Handler --
127 ----------------------
129 procedure Exchange_Handler
130 (Old_Handler
: out Parameterless_Handler
;
131 New_Handler
: Parameterless_Handler
;
132 Interrupt
: Interrupt_ID
;
133 Static
: Boolean := False)
138 end Exchange_Handler
;
144 procedure Finalize
(Object
: in out Static_Interrupt_Protection
) is
149 -------------------------------------
150 -- Has_Interrupt_Or_Attach_Handler --
151 -------------------------------------
153 function Has_Interrupt_Or_Attach_Handler
154 (Object
: access Dynamic_Interrupt_Protection
)
157 pragma Warnings
(Off
, Object
);
162 end Has_Interrupt_Or_Attach_Handler
;
164 function Has_Interrupt_Or_Attach_Handler
165 (Object
: access Static_Interrupt_Protection
)
168 pragma Warnings
(Off
, Object
);
173 end Has_Interrupt_Or_Attach_Handler
;
175 ----------------------
176 -- Ignore_Interrupt --
177 ----------------------
179 procedure Ignore_Interrupt
(Interrupt
: Interrupt_ID
) is
182 end Ignore_Interrupt
;
184 ----------------------
185 -- Install_Handlers --
186 ----------------------
188 procedure Install_Handlers
189 (Object
: access Static_Interrupt_Protection
;
190 New_Handlers
: New_Handler_Array
)
194 end Install_Handlers
;
200 function Is_Blocked
(Interrupt
: Interrupt_ID
) return Boolean is
206 -----------------------
207 -- Is_Entry_Attached --
208 -----------------------
210 function Is_Entry_Attached
(Interrupt
: Interrupt_ID
) return Boolean is
214 end Is_Entry_Attached
;
216 -------------------------
217 -- Is_Handler_Attached --
218 -------------------------
220 function Is_Handler_Attached
(Interrupt
: Interrupt_ID
) return Boolean is
224 end Is_Handler_Attached
;
230 function Is_Ignored
(Interrupt
: Interrupt_ID
) return Boolean is
240 function Is_Reserved
(Interrupt
: Interrupt_ID
) return Boolean is
250 function Reference
(Interrupt
: Interrupt_ID
) return System
.Address
is
253 return Interrupt
'Address;
256 --------------------------------
257 -- Register_Interrupt_Handler --
258 --------------------------------
260 procedure Register_Interrupt_Handler
261 (Handler_Addr
: System
.Address
)
265 end Register_Interrupt_Handler
;
267 -----------------------
268 -- Unblock_Interrupt --
269 -----------------------
271 procedure Unblock_Interrupt
(Interrupt
: Interrupt_ID
) is
274 end Unblock_Interrupt
;
280 function Unblocked_By
(Interrupt
: Interrupt_ID
)
281 return System
.Tasking
.Task_ID
is
287 ------------------------
288 -- Unignore_Interrupt --
289 ------------------------
291 procedure Unignore_Interrupt
(Interrupt
: Interrupt_ID
) is
294 end Unignore_Interrupt
;
300 procedure Unimplemented
is
302 Ada
.Exceptions
.Raise_Exception
303 (Program_Error
'Identity, "interrupts/signals not implemented");
307 end System
.Interrupts
;