File: /home/oboss/Users/gec/sources/Basic_Services/Control_Structures/sporadic_task.ads

1     --% Compilation Unit:	Sporadic_Task
2     --
3     --% Category: Generic Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 2.0 $
8     --
9     --% Author:   $Author: gec $
10     --
11     --% Revision Log:
12     --    $Log: sporadic_task.ads,v $
13     --    Revision 2.0  2003/04/04 08:49:59  gec
14     --    Initial release of source files serving as baseline for OBOSS-III project.
15     --
16     --    Revision 1.1.1.1  2003/04/04 08:13:01  gec
17     --    Imported using TkCVS
18     --
19     --
20     --
21     --% Project: OBOSS
22     --
23     --% Copyright (C) 2003 by Terma A/S
24     --  Proprietary and intellectual rights of Terma A/S, Denmark,
25     --  are involved in the subject-matter of this material and
26     --  all manufacturing, reproduction, use, disclosure, and
27     --  sales rights pertaining to such subject-matter are
28     --  expressly reserved. This material is submitted for a
29     --  specific purpose as agreed, and the recipient by
30     --  accepting this material agrees that this material will
31     --  not be used, copied, or reproduced in whole or in part
32     --  nor its contents revealed in any manner or to any person,
33     --  except to meet the purpose for which it was submitted and
34     --  subject to the terms of the agreement.
35     --
36     --% Target Dependencies:
37     --    None
38     --% Compiler Dependencies:
39     --    None
40     
41     --~-----------------------------------------------------------------------------
42     
43     with Task_Priority_Control;
44     with Mission_Parameters;
45     with Globals;
46     generic
47     
48        --% Generic Parameter Constraints:
49        -->   Sporadic_Operation  - Must not propagate any exceptions out of the
50        --+    call.
51     
52        -- My_Application_ID is application ID for associated application process.
53        -- Used for generation of event reports in case of unhandled exceptions
54        --+    propagated out of Sporadic_Operation
55        My_Application_ID : in     Mission_Parameters.APID;
56     
57        -- Priority of protected object implementing buffer of start events
58        Event_Buffer_Task_Priority
59                                   : in     Task_Priority_Control.
60                                     Passive_Task_Priority;
61     
62        -- Priority and stack size of Sporadic object performing Sporadic_Operation
63        Sporadic_Task_Priority : in     Task_Priority_Control.Active_Task_Priority;
64        Sporadic_Task_Stack_Size : in     Natural;
65     
66        -- Sporadic_Operation is an HRT-HOOD ASER type of operation
67        type Sporadic_Operation_Parameter_Type is private;
68        Sporadic_Event_Buffer_Size : in     Positive := 1;
69     
70        -- No violation of minimum inter-arrival time is detected.
71        -- Only Sporadic_Event_Buffer_Size number of calls are buffered.
72        with procedure Sporadic_Operation
73              (Sporadic_Parameter : in     Sporadic_Operation_Parameter_Type);
74     
75     package Sporadic_Task is
76     
77        --% Library Package:
78        --    Implementation of control structure corresponding to sporadic task as
79        --+    defined in HRT-HOOD.
80        --% Active Tasks:
81        -->   The_Sporadic_Task - Sporadic
82        --% Passive Tasks:
83        -->   Event_Buffer.Queue_Task - Critical region ensuring atomic execution on
84        --+    operations on queue of execution requests.
85        task Sporadic_Task is
86     
87           pragma Priority (Integer(Sporadic_Task_Priority));
88     
89           pragma Storage_Size (Globals.Stack_Size); -- Dirty trick Sporadic_Task_Stack_Size);
90     
91           --% Internal Task Type:
92           --    Implementation of sporadic control structure using Ada tasks
93     
94           --% Task Entry:
95           --    None.
96           --% Parameter Constraints:
97           -->   None
98           --% Exceptions Raised:
99           -->   None
100     
101        end Sporadic_Task;
102     
103        --~--------------------------------------------------------------------------
104     
105         --% Subprogram:
106        --    Request execution of Sporadic_Operation using parameter
107        --+    Sporadic_Parameter.
108        --    If Sporadic_Event_Buffer_Size requests are already buffered for
109        --+    execution, request is ignored and result of operation is false.
110        --+    Otherwise request is buffered, and result is true.
111        --% Parameter Constraints:
112        -->   None
113        --% Exceptions Raised:
114        -->   None
115        function Start
116              (Sporadic_Parameter :        Sporadic_Operation_Parameter_Type)
117              return Boolean;
118     
119     
120     end Sporadic_Task;
121     
122     --~-----------------------------------------------------------------------------
123