This is a discussion on Ada/Ravenscar - Interrupt handling - ADA ; Hi all I've recently started working with Ada and the Ravenscar profile, a subset of the Ada concurrency model. While trying to create a simple interrupt handling program, for handling SIGINT, in a unix platform using the latest version of ...
I've recently started working with Ada and the Ravenscar profile, a subset of the Ada concurrency model. While trying to create a simple interrupt handling program, for handling SIGINT, in a unix platform using the latest version of gnat, I've come across a problem for which I ask your help:
Ravenscar profile restricts the attachment of signals to procedures to the pragma Attach_Handler(<handler>, <interrupt_id>). But when run gnatmake I get the compilation error:
missing argument for parameter "New_Handlers" in call to "Install_Handlers" declared at s-interr.ads:272
Checking out this file I see that procedure Install_Handlers is declared this way, in s-interr.adb:
(Object : access Static_Interrupt_Protection;
New_Handlers : in New_Handler_Array)
for N in New_Handlers'Range loop
-- We need a lock around this ???
Object.Previous_Handlers (N).Interrupt := New_Handlers (N).Interrupt;
Object.Previous_Handlers (N).Static := User_Handler
-- We call Exchange_Handler and not directly Interrupt_Manager.
-- Exchange_Handler so we get the Is_Reserved check.
(Old_Handler => Object.Previous_Handlers (N).Handler,
New_Handler => New_Handlers (N).Handler,
Interrupt => New_Handlers (N).Interrupt,
Static => True);
The only way (until now) I can make compilation work is if remove pragma ravenscar from the code (of all packages), which is not what I intend....
Is it that the ravenscar profile somehow restricts the use of data structures in the call to Install_Handlers?
If someone could please enlighten me about this issue I would much appreciate it, thanks