------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- This Ada package was automatically generated by the meta CASE tool Platypus -- see http://cassoulet.univ-brest.fr/mme -- -- Any modification of this file will be lost. -- Please see the "platypus" directory instead : it contains the Cheddar's -- model and its meta-model. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a free real time scheduling tool. -- This program provides services to automatically check temporal constraints -- of real time tasks. -- -- Copyright (C) 2002-2009 Frank Singhoff -- Cheddar is developed by the LISYC Team, University of Brest -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- ---- Contact : F. Singhoff (singhoff@univ-brest.fr) -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ WITH Text_Io; USE Text_Io; PACKAGE BODY Scheduler.User_Defined.Generated IS PROCEDURE Run_Priority_Section ( My_Scheduler : IN OUT Generated_User_Defined_Scheduler; Si : IN OUT Scheduling_Information; Current_Time : IN Natural; Processor_Name : IN Unbounded_String; My_Dependencies : IN Tasks_Dependencies_Ptr; Msg : IN OUT Unbounded_String) IS I : Tasks_Range; BEGIN -- put(tasks.capacity); -- Put("- Line 5, "); I:=0; LOOP IF (Si.Tcbs (I).Tsk.Cpu_Name = Processor_Name) THEN Put(Si.Tcbs (I).Tsk.Capacity'Img & " "); END IF; I := I + 1; EXIT WHEN Si.Tcbs (I) = NULL; END LOOP; New_Line; END Run_Priority_Section; PROCEDURE Run_Start_Section ( My_Scheduler : IN OUT Generated_User_Defined_Scheduler; Processor_Name : IN Unbounded_String; Msg : IN OUT Unbounded_String) IS BEGIN NULL; END Run_Start_Section; PROCEDURE Run_Election_Section ( My_Scheduler : IN OUT Generated_User_Defined_Scheduler; Si : IN OUT Scheduling_Information; Current_Time : IN Natural; Processor_Name : IN Unbounded_String; My_Dependencies : IN Tasks_Dependencies_Ptr; With_Offsets : IN Boolean; With_Precedencies : IN Boolean; With_Resources : IN Boolean; Elected : IN OUT Tasks_Range; No_Task : IN OUT Boolean) IS Highest : Natural := Natural'First; Found : Boolean := False; I : Tasks_Range := 0; BEGIN -- return max_to_index(tasks.capacity); -- LOOP IF (Si.Tcbs (I).Tsk.Cpu_Name = Processor_Name) THEN IF (Si.Tcbs (I).Wake_Up_Time <= Current_Time) AND (Si.Tcbs (I).Tsk.Capacity > Highest) AND (Si.Tcbs (I).Rest_Of_Capacity /= 0) THEN IF (With_Offsets = False) OR Check_Offset (Si.Tcbs (I), Current_Time) THEN IF (With_Precedencies = False) OR Check_Precedencies (Si, My_Dependencies, Current_Time, Si.Tcbs (I)) THEN Highest :=Si.Tcbs (I).Tsk.Capacity; Elected := I; Found:=True; END IF; END IF; END IF; END IF; I := I + 1; EXIT WHEN Si.Tcbs (I) = NULL; END LOOP; IF NOT Found THEN No_Task := True; ELSE No_Task := False; END IF; END Run_Election_Section; END Scheduler.User_Defined.Generated ;