Commit d53b565f authored by yoogx's avatar yoogx

* Added Null_Task task category

parent e5da9d64
------------------------------------------------------------------------------
-- --
-- PolyORB HI COMPONENTS --
-- --
-- P O L Y O R B _ H I . N U L L _ T A S K --
-- --
-- B o d y --
-- --
-- Copyright (C) 2014 ESA & ISAE. --
-- --
-- PolyORB HI is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later. --
-- PolyORB HI 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 distributed with PolyORB HI; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02111-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- PolyORB-HI/Ada is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
with Ada.Synchronous_Task_Control;
with PolyORB_HI.Output;
with PolyORB_HI.Suspenders;
package body PolyORB_HI.Null_Task is
use PolyORB_HI.Errors;
use PolyORB_HI.Output;
use PolyORB_HI_Generated.Deployment;
use PolyORB_HI.Suspenders;
use Ada.Real_Time;
use Ada.Synchronous_Task_Control;
-------------------
-- The_Null_Task --
-------------------
procedure The_Null_Task is
Error : Error_Kind;
begin
-- Run the initialize entrypoint (if any)
Activate_Entrypoint;
-- Wait for the network initialization to be finished
pragma Debug
(Put_Line
(Verbose,
"Null Task "
+ Entity_Image (Entity)
+ ": Wait initialization"));
pragma Debug (Put_Line
(Verbose,
"Null task initialized for entity "
+ Entity_Image (Entity)));
pragma Debug
(Put_Line
(Verbose,
"Null Task "
+ Entity_Image (Entity)
+ ": Run job"));
Error := Job;
if Error /= Error_None then
Recover_Entrypoint;
end if;
end The_Null_Task;
-------------------
-- Next_Deadline --
-------------------
function Next_Deadline return Ada.Real_Time.Time is
begin
return Ada.Real_Time.Clock;
end Next_Deadline;
end PolyORB_HI.Null_Task;
------------------------------------------------------------------------------
-- --
-- PolyORB HI COMPONENTS --
-- --
-- P O L Y O R B _ H I . N U L L _ T A S K --
-- --
-- S p e c --
-- --
-- Copyright (C) 2014 ESA & ISAE. --
-- --
-- PolyORB HI is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later. --
-- PolyORB HI 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 distributed with PolyORB HI; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02111-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- PolyORB-HI/Ada is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
with System;
with Ada.Real_Time;
with PolyORB_HI_Generated.Deployment;
with PolyORB_HI.Errors;
generic
Entity : in PolyORB_HI_Generated.Deployment.Entity_Type;
-- So that the task know from which AADL entity it has been
-- mapped.
Task_Priority : in System.Any_Priority;
-- Task priority
Task_Stack_Size : in Natural;
-- Task stack size
Task_Period : in Ada.Real_Time.Time_Span;
-- Task period
Task_Deadline : in Ada.Real_Time.Time_Span;
-- Task deadline
with function Job return PolyORB_HI.Errors.Error_Kind;
-- Procedure to call at each dispatch of the sporadic thread
with procedure Activate_Entrypoint is null;
-- If given, the task run Activate_Entrypoint after the global
-- initialization and before the task main loop.
with procedure Recover_Entrypoint is null;
-- If given, the task runs Recover_Entrypoint when an error is
-- detected.
package PolyORB_HI.Null_Task is
procedure The_Null_Task;
function Next_Deadline return Ada.Real_Time.Time;
-- Return the value of the next deadline (in absolute time)
end PolyORB_HI.Null_Task;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment