Adding new commiter to ODU-High repo
[o-du/l2.git] / src / mt / ss_task.x
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /********************************************************************20**
20  
21      Name:     System Services -- Task Management
22  
23      Type:     C include file
24  
25      Desc:     Data structure definitions required for the task mgmt.
26  
27      File:     ss_task.x
28  
29 *********************************************************************21*/
30
31
32 #ifndef __SSTASKX__
33 #define __SSTASKX__
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39
40 /* miscellaneous types */
41 /* ss029.103: modification: 
42    data type changed to allow more number of TAPA tasks */ 
43 #ifndef SS_MULTIPLE_PROCS
44 typedef uint8_t                      SsCntr;
45 typedef uint8_t                      SsIdx;
46 #else /* SS_MULTIPLE_PROCS */
47 typedef uint16_t                      SsCntr;
48 typedef uint16_t                      SsIdx;
49 #endif /* SS_MULTIPLE_PROCS */
50
51
52 /* forward declaration */
53 typedef struct ssSTskEntry      SsSTskEntry;
54
55
56 /* individual entry in the table of TAPA tasks */
57 typedef struct ssTTskEntry
58 {
59    SsdTTskEntry dep;                    /* implementation specific */
60
61
62    Bool         used;                   /* entry is used? */
63 /* ss029.103: addition: procId added */ 
64 #ifdef SS_MULTIPLE_PROCS
65    ProcId       proc;                   /* task processor ID */
66 #endif /* SS_MULTIPLE_PROCS */
67    Ent          ent;                    /* task entity ID */
68    Inst         inst;                   /* task instance ID */
69    Ttype        tskType;                /* normal/permanent/driver */
70    Prior        tskPrior;               /* priority of task */
71    PAIFS16      initTsk;                /* initialization function */
72    ActvTsk      actvTsk;                /* activation function */
73
74    SsSTskEntry  *sTsk;                  /* system task */
75
76
77    SsIdx        nxt;                    /* table implementation */
78 /* ss029.103: addition: TAPA task control block (user level) added */ 
79 #ifdef SS_MULTIPLE_PROCS
80    Void         *xxCb;                  /* protocol control block */
81 #endif /* SS_MULTIPLE_PROCS */
82
83 /* ss001.301: additions */
84 #ifdef SS_HISTOGRAM_SUPPORT
85    Bool         hstReg;
86 #endif /* SS_HISTOGRAM_SUPPORT */
87
88 /* ss001.301: additions */
89 /* ss002.301: Modifications */
90 #ifdef SS_THREAD_PROFILE
91    Bool        updated;
92    Event       curEvent;
93    uint32_t    curEvtTime;
94    uint64_t    totTime;
95 #endif /* SS_THREAD_PROFILE */
96         /* ss02.301 */
97    ActvTsk     cbTsk; /* call back function pointer */
98
99 } SsTTskEntry;
100
101
102
103 /* individual entry in the table of system tasks */
104 struct ssSTskEntry
105 {
106    SsdSTskEntry dep;                    /* implementation specific */
107    Bool         used;                   /* entry is used or not */
108    Bool         termPend;               /* termination pending */
109    SSTskId      tskId;                  /* system task ID */
110    SSTskPrior   tskPrior;               /* system task priority */
111    SsDmndQ      dQ;                     /* demand queue */
112
113
114    /* TAPA task information: the TAPA tasks being handled by
115     *  this system task.
116     */
117    SsIdx        tTsks[SS_MAX_TTSKS];    /* indices into TAPA task table */
118    SsCntr       numTTsks;               /* count of TAPA tasks */
119    SLockId      lock;                   /* lock for table access */
120
121
122    SsIdx        nxt;                    /* table implementation */
123 #ifdef SS_MULTICORE_SUPPORT
124    Region       region;
125 #endif
126
127 };
128
129
130 #ifdef __cplusplus
131 }
132 #endif
133
134 #endif  /*  __SSTASKX__  */
135
136
137 \f  
138 /********************************************************************30**
139
140          End of file
141 **********************************************************************/