This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Add missing Ravenscar restrictions


This patch enforces the restrictions No_Local_Timing_Events and
No_Specific_Termination_Handlers when the Ravenscar restrictions
are in effect, as required by D.13(6/3).

The following tests must trigger the following errors:

$ gcc -c tev.adb
tev.adb:6:04: violation of restriction "NO_LOCAL_TIMING_EVENTS"
tev.adb:6:04: from profile "RAVENSCAR" at line 1

$ gcc -c sth.adb
sth.adb:13:24: violation of restriction "NO_SPECIFIC_TERMINATION_HANDLERS"
sth.adb:13:24: from profile "RAVENSCAR" at line 1
sth.adb:16:30: violation of restriction "NO_SPECIFIC_TERMINATION_HANDLERS"
sth.adb:16:30: from profile "RAVENSCAR" at line 1

pragma Profile (Ravenscar);

with Ada.Real_Time.Timing_Events;

procedure TEV is
   E : Ada.Real_Time.Timing_Events.Timing_Event;
begin
   null;
end TEV;

pragma Profile (Ravenscar);

with Ada.Task_Termination;
with Ada.Task_Identification;
with Tasking;

procedure STH is
   TH : Ada.Task_Termination.Termination_Handler;
   Self : constant Ada.Task_Identification.Task_Id :=
      Ada.Task_Identification.Current_Task;

begin
   Ada.Task_Termination.Set_Specific_Handler
      (Self, Tasking.Termination_Controller.Handler'Access);

   TH := Ada.Task_Termination.Specific_Handler (Self);
end STH;

with Ada.Exceptions;
with Ada.Task_Identification;
with Ada.Task_Termination;

package Tasking is
   protected Termination_Controller is
      procedure Handler
         (Cause : Ada.Task_Termination.Cause_Of_Termination;
          T     : Ada.Task_Identification.Task_Id;
          X     : Ada.Exceptions.Exception_Occurrence);
   end Termination_Controller;
end Tasking;

package body Tasking is
   protected body Termination_Controller is
      procedure Handler
         (Cause : Ada.Task_Termination.Cause_Of_Termination;
          T     : Ada.Task_Identification.Task_Id;
          X     : Ada.Exceptions.Exception_Occurrence) is
      begin
         null;
      end Handler;
   end Termination_Controller;
end Tasking;

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-02-24  Jose Ruiz  <ruiz@adacore.com>

	* s-rident.ads (Profile_Info): For Ravenscar, the restrictions
	No_Local_Timing_Events and No_Specific_Termination_Handlers
	must be set, according to the Ravenscar profile definition
	in D.13(6/3).

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]