Adding new commiter to ODU-High repo
[o-du/l2.git] / src / mt / ss_mem.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 -- Memory management interface
22  
23      Type:     C include file
24  
25      Desc:     Data structure definitions required for the memory
26                management interface.
27  
28      File:     ss_mem.x
29
30 *********************************************************************21*/
31
32
33 #ifndef __SSMEMX__
34 #define __SSMEMX__
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40
41 /* region entry structure */
42 typedef struct ssRegionEntry
43 {
44    SsdRegionEntry dep;                          /* implementation specific */
45
46
47    Bool         used;                           /* entry used? */
48
49    Data         *start;                         /* start address */
50    Size         size;                           /* size */
51
52    Void         *regCb;                         /* control block */
53
54    uint32_t          flags;                          /* flags */
55
56    SsPoolEntry  poolTbl[SS_MAX_POOLS_PER_REG];  /* pool table */
57    SsCntr       numPools;                       /* count of pools */
58
59    SsAlloc      alloc;                          /* allocator function */
60    SsFree       free;                           /* de-allocator function */
61    SsCtl        ctl;                            /* ctl function */
62         /* ss006.301 */
63         SLockId      mBufRefLock;                    /* per region lock used for 
64                                                        data block sharing */
65 } SsRegionEntry;
66
67 /* ss036.103 - addition of data type to return the memory statistics data
68 * this is used in SGetRegInfo 
69 */
70 typedef struct ssMemBktDbgInfo
71 {
72    Size         size;         /* Size of the block */
73    uint32_t          numBlks;      /* Total number of blocks in the bucket */
74    uint32_t          numAlloc;     /* Number of blocks allocated */
75 }SsMemBktDbgInfo;
76
77 typedef struct ssMemDbgInfo
78 {
79    Region       region;        /* Region  Id of the memory */
80    uint16_t          numBkts;       /* Number of buckets in bktDbgTbl */
81    SsMemBktDbgInfo      bktDbgTbl[SS_MAX_BKT_PER_DBGTBL];
82    Size         heapSize;      /* Size of the heap pool */
83    Size         heapAlloc;          /* Total allocated memory */
84    uint32_t          availmem;
85 #if (ERRCLASS & ERRCLS_DEBUG)
86    uint16_t       numFragBlk;       /* Number of fragmented block */
87 #endif /* ERRCLASS & ERRCLS_DEBUG */
88 }SsMemDbgInfo;
89
90 /* ss036.103 - Addition of  prototypes for memory statistics */
91 S16 SRegInfoShow  ARGS((Region region, uint32_t *availmem));
92 S16 SGetRegInfo ARGS((Region region, SsMemDbgInfo *dbgInfo));
93 #ifdef XEON_SPECIFIC_CHANGES
94 S16 SRegReachedMemThreshold ARGS((Region region, uint8_t maxBkt));
95 #endif
96 #ifdef SSI_DEBUG_LEVEL1
97 S16 SPrintRegMemStatusInfo ARGS((Region region, uint8_t typeFlag));
98 Void SRegMemErrHdlr ARGS((Region region, Data *ptr, S16 errCode));
99 S16 SPrintRegMemProfile ARGS((Region region));
100 #endif /* SSI_DEBUG_LEVEL1 */
101
102 /* ss001.301: additions */
103 #ifdef SS_HISTOGRAM_SUPPORT 
104 S16 SGetTapaTskEntIds ARGS((Ent *ent));
105 S16 SGetHstGrmInfo ARGS((Ent *entId, Bool *hstReg));
106 #endif /* SS_HISTOGRAM_SUPPORT */
107
108 #ifdef __cplusplus
109 }
110 #endif
111
112 #endif  /*  __SSMEMX__  */
113
114
115 \f  
116 /********************************************************************30**
117
118          End of file
119 **********************************************************************/