Re: protected type interrupts
- From: Jean-Pierre Rosen <rosen@xxxxxxxxx>
- Date: Thu, 24 Aug 2006 17:39:28 +0200
REH a écrit :
I am having a disagreement with a compiler vendor. I am using aC.3.1 (17) allows them to pretty much anything. Apparently, a ceiling_priority is in effect (either because you specified it, or by default), thus your task inherits the ceiling of the protected type (which is an interrupt_priority), and this implementation seems to forbid an entry to be called at an interrupt level.
protected type for an interrupt handler (see below). The handler
simply sets a boolean to true that an entry is using as a guard. The
entry is called by a task. Basically, the task is blocked until
signaled by the interrupt to do the processing. With newer versions of
their compiler, the computer resets. They say it is because they are
calling the entry at the interrupt level, and not the task level (we
process this in a task because we have to do things you cannot do in a
interrupt). They say the LRM allows them to do this. Is that true?
A work-around could be:
protected Relay_Object is
procedure Isr;
entry Process_Interrupt;
private
Triggered : Boolean := False;
end Relay_Object;
protected Interrupt_Object is
procedure Isr;
pragma Attach_Handler(Isr, XXX);
pragma Interrupt_Priority(XXX);
private
pragma Suppress(All_Checks, On => Isr);
end Interrupt_Object;
protected body Relay_Object is
procedure Isr is
begin
Triggered := True;
end Isr;
entry Process_Interrupt when Triggered is
begin
Triggered := False;
-- process interrrupt
end Process_Interrupt;
end Relay_Object;
protected body Interrupt_Object is
procedure Isr is
begin
Relay_Object.Isr;
end Isr;
end Interrupt_Object;
This way, the task is not calling a PO that serves as an interrupt handler, thus C.3.1 (17) does not apply.
--
---------------------------------------------------------
J-P. Rosen (rosen@xxxxxxxxx)
Visit Adalog's web site at http://www.adalog.fr
.
- Follow-Ups:
- Re: protected type interrupts
- From: REH
- Re: protected type interrupts
- References:
- protected type interrupts
- From: REH
- protected type interrupts
- Prev by Date: Re: Usage of \ in Ada
- Next by Date: Re: protected type interrupts
- Previous by thread: protected type interrupts
- Next by thread: Re: protected type interrupts
- Index(es):
Relevant Pages
|