1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /********************************************************************20**
21 Name: common functions - 5
25 Desc: Structures, variables and typedefs required for
30 *********************************************************************21*/
42 typedef struct cmTimer /* timer structure */
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
51 U16 entIdx; /* Current entry index */
54 typedef struct cmTqCp /* timing queue control point */
56 U32 nxtEnt; /* next Entry */
57 U32 tmrLen; /* length of timer (MODULO is -1) */
58 CmTimer *tmp; /* Temporary variable used in cmPrcTmr */
61 typedef struct cmTqType
63 CmTimer *first; /* First Entry */
64 CmTimer *tail; /* Last Entry */
67 typedef struct cmTmrArg
69 CmTqCp *tqCp; /* timing queue control point */
70 CmTqType *tq; /* timing queue point */
71 CmTimer *timers; /* timers array */
72 PTR cb; /* control block pointer */
75 U8 tNum; /* timer number */
76 U8 max; /* max timers */
80 /* trillium supplied functions */
82 typedef Void (*PFV) ARGS((PTR, S16));
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));
92 #endif /* __cplusplus */
96 /********************************************************************30**
99 **********************************************************************/