[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[o-du/l2.git] / src / mt / ss_msg.h
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 -- Message manipulation functions
22  
23      Type:     C source file
24  
25      Desc:     Macro definitions for message related functions.
26  
27      File:     ss_msg.h
28  
29 *********************************************************************21*/
30
31 #ifndef __SSMSGH__
32 #define __SSMSGH__
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38
39 /* default SS region ID */
40 #define SS_DFLT_REGION                  0
41 #define SS_DFLT_POOL                    0
42
43 #ifdef SS_MULTICORE_SUPPORT
44 #define SS_REGION_0                     0
45 #define SS_REGION_1                     1
46 #define SS_REGION_2                     2
47 #define SS_REGION_3                     3
48 #define SS_REGION_4                     4
49 #define SS_REGION_5                     5
50 #endif /* SS_MULTICORE_SUPPORT */
51
52 /* pool types */
53 #define SS_POOL_UND                     0
54 #define SS_POOL_DYNAMIC                 1
55 #define SS_POOL_STATIC                  2
56
57 /* Bucket threshold default values */
58 #define SS_BLK_RELEASE_THRESHOLD        110
59 #define SS_BLK_ACQUIRE_THRESHOLD        20
60 #define SS_DFLT_MEM_BLK_SET_SIZE        128
61 #define SS_MEM_TYPE_SSI_ZBC 0x11
62 #ifdef XEON_SPECIFIC_CHANGES
63 #define SS_MEM_TYPE_DPDK_ZBC 0x12
64 #endif   
65
66 /* utility macros */
67 #define FIND_OFFSET(current, idx)   \
68    { \
69       MsgLen bufSiz; \
70       while (idx) \
71       { \
72          bufSiz = (current->b_wptr - current->b_rptr); \
73          if (bufSiz > idx) \
74             break; \
75          idx -= bufSiz; \
76          current = current->b_cont; \
77       } \
78    }
79  
80 #define FIND_OFFSET_AND_PREV(previous, current, idx)   \
81    { \
82       MsgLen bufSiz; \
83       while (idx) \
84       { \
85          bufSiz = (current->b_wptr - current->b_rptr); \
86          if (bufSiz > idx) \
87             break; \
88          idx -= bufSiz; \
89          previous = current; \
90          current = current->b_cont; \
91       } \
92    }
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 #endif /* __SSMSGH__ */
99
100  
101 \f
102 /********************************************************************30**
103  
104          End of file
105 **********************************************************************/