+ ---------------------------
+ -- Set_Ravenscar_Profile --
+ ---------------------------
+
+ -- The tasks to be done here are
+
+ -- Set required policies
+
+ -- pragma Task_Dispatching_Policy (FIFO_Within_Priorities)
+ -- pragma Locking_Policy (Ceiling_Locking)
+
+ -- Set Detect_Blocking mode
+
+ -- Set required restrictions (see System.Rident for detailed list)
+
+ procedure Set_Ravenscar_Profile (N : Node_Id) is
+ begin
+ -- pragma Task_Dispatching_Policy (FIFO_Within_Priorities)
+
+ if Task_Dispatching_Policy /= ' '
+ and then Task_Dispatching_Policy /= 'F'
+ then
+ Error_Msg_Sloc := Task_Dispatching_Policy_Sloc;
+ Error_Pragma ("Profile (Ravenscar) incompatible with policy#");
+
+ -- Set the FIFO_Within_Priorities policy, but always
+ -- preserve System_Location since we like the error
+ -- message with the run time name.
+
+ else
+ Task_Dispatching_Policy := 'F';
+
+ if Task_Dispatching_Policy_Sloc /= System_Location then
+ Task_Dispatching_Policy_Sloc := Loc;
+ end if;
+ end if;
+
+ -- pragma Locking_Policy (Ceiling_Locking)
+
+ if Locking_Policy /= ' '
+ and then Locking_Policy /= 'C'
+ then
+ Error_Msg_Sloc := Locking_Policy_Sloc;
+ Error_Pragma ("Profile (Ravenscar) incompatible with policy#");
+
+ -- Set the Ceiling_Locking policy, but always preserve
+ -- System_Location since we like the error message with the
+ -- run time name.
+
+ else
+ Locking_Policy := 'C';
+
+ if Locking_Policy_Sloc /= System_Location then
+ Locking_Policy_Sloc := Loc;
+ end if;
+ end if;
+
+ -- pragma Detect_Blocking
+
+ Detect_Blocking := True;
+
+ -- Set the corresponding restrictions
+
+ Set_Profile_Restrictions (Ravenscar, N, Warn => False);
+ end Set_Ravenscar_Profile;
+