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: System Services -- Memory management interface
25 Desc: Data structure definitions required for the memory
30 *********************************************************************21*/
41 /* region entry structure */
42 typedef struct ssRegionEntry
44 SsdRegionEntry dep; /* implementation specific */
47 Bool used; /* entry used? */
49 Data *start; /* start address */
52 Void *regCb; /* control block */
54 U32 flags; /* flags */
56 SsPoolEntry poolTbl[SS_MAX_POOLS_PER_REG]; /* pool table */
57 SsCntr numPools; /* count of pools */
59 SsAlloc alloc; /* allocator function */
60 SsFree free; /* de-allocator function */
61 SsCtl ctl; /* ctl function */
63 SLockId mBufRefLock; /* per region lock used for
67 /* ss036.103 - addition of data type to return the memory statistics data
68 * this is used in SGetRegInfo
70 typedef struct ssMemBktDbgInfo
72 Size size; /* Size of the block */
73 U32 numBlks; /* Total number of blocks in the bucket */
74 U32 numAlloc; /* Number of blocks allocated */
77 typedef struct ssMemDbgInfo
79 Region region; /* Region Id of the memory */
80 U16 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 */
85 #if (ERRCLASS & ERRCLS_DEBUG)
86 U16 numFragBlk; /* Number of fragmented block */
87 #endif /* ERRCLASS & ERRCLS_DEBUG */
90 /* ss036.103 - Addition of prototypes for memory statistics */
91 EXTERN S16 SRegInfoShow ARGS((Region region, U32 *availmem));
92 EXTERN S16 SGetRegInfo ARGS((Region region, SsMemDbgInfo *dbgInfo));
93 #ifdef XEON_SPECIFIC_CHANGES
94 EXTERN S16 SRegReachedMemThreshold ARGS((Region region, U8 maxBkt));
96 #ifdef SSI_DEBUG_LEVEL1
97 EXTERN S16 SPrintRegMemStatusInfo ARGS((Region region, U8 typeFlag));
98 EXTERN Void SRegMemErrHdlr ARGS((Region region, Data *ptr, S16 errCode));
99 EXTERN S16 SPrintRegMemProfile ARGS((Region region));
100 #endif /* SSI_DEBUG_LEVEL1 */
102 /* ss001.301: additions */
103 #ifdef SS_HISTOGRAM_SUPPORT
104 EXTERN S16 SGetTapaTskEntIds ARGS((Ent *ent));
105 EXTERN S16 SGetHstGrmInfo ARGS((Ent *entId, Bool *hstReg));
106 #endif /* SS_HISTOGRAM_SUPPORT */
112 #endif /* __SSMEMX__ */
116 /********************************************************************30**
119 **********************************************************************/