Initial commit
[o-du/l2.git] / src / cm / cm5.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:     common functions - 5
22   
23      Type:     C include file
24   
25      Desc:     Structures, variables and typedefs required for
26                common timer routines
27   
28      File:     cm5.x
29   
30 *********************************************************************21*/
31
32 #ifndef __CM5X__
33 #define __CM5X__
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 \f
40 /* typedefs */
41
42 typedef struct cmTimer         /* timer structure */
43 {
44    S16 tmrEvnt;                /* Timer Event */
45    U32 tqExpire;               /* Timing Queue Expiry */
46    PTR cb;                     /* Pointer to start of control block list */
47    struct cmTimer *next;       /* Next item in the timing queue */
48    struct cmTimer *prev;       /* Previous item in the timing queue */
49    U8     ent2bUpd;            /* TRUE, if the timer block is not in the
50                                   proper bin */
51    U16   entIdx;                /* Current entry index */
52 } CmTimer;
53
54 typedef struct cmTqCp          /*  timing queue control point */
55 {
56    U32 nxtEnt;                 /* next Entry */
57    U32 tmrLen;                 /* length of timer (MODULO is -1) */
58    CmTimer *tmp;               /* Temporary  variable used in cmPrcTmr */
59 } CmTqCp;
60
61 typedef struct cmTqType
62 {
63    CmTimer *first;             /* First Entry */
64    CmTimer *tail;              /* Last Entry */
65 } CmTqType;
66
67 typedef struct cmTmrArg
68 {
69    CmTqCp     *tqCp;           /* timing queue control point */
70    CmTqType   *tq;             /* timing queue point */
71    CmTimer    *timers;         /* timers array */
72    PTR        cb;              /* control block pointer */
73    S16        evnt;            /* event */
74    U32        wait;            /* wait */
75    U8         tNum;            /* timer number */
76    U8         max;             /* max timers */
77 } CmTmrArg;
78
79 \f
80 /* trillium supplied functions */
81
82 typedef Void (*PFV) ARGS((PTR, S16));
83
84 extern Void cmInitTimers ARGS((CmTimer* timers, U8 max));
85 extern Void cmPlcCbTq ARGS((CmTmrArg* arg));
86 extern Void cmRmvCbTq ARGS((CmTmrArg* arg));
87 extern Void cmPrcTmr ARGS((CmTqCp* tqCp, CmTqType* tq, PFV func));
88 extern Void cmRstCbTq ARGS((CmTmrArg* arg));
89
90 #ifdef __cplusplus
91 }
92 #endif /* __cplusplus */
93 #endif /* __CM3X__ */
94
95 \f
96 /********************************************************************30**
97   
98          End of file
99 **********************************************************************/