40#ifndef MEMMGRTYPES_H_INCLUDED
41#define MEMMGRTYPES_H_INCLUDED
53#include <sdk/config.h>
54#include "memutils/common_utils/common_types.h"
55#include "memutils/os_utils/cpp_util.h"
61#ifdef USE_MEMMGR_MULTI_CORE
62#include "SpinLockManager.h"
65#define MEMMGR_SIGNATURE "MML"
77typedef uint32_t MemHandleProxy;
83typedef uint8_t NumSection;
85const NumSection BadSectionNo = 0xff;
92const PoolId NullPoolId = {0,0};
117typedef uint32_t PoolAddr;
118const PoolAddr BadPoolAddr = 0xffffffff;
120typedef uint32_t PoolSize;
122#ifdef USE_MEMMGR_OVER255_SEGMENTS
123typedef uint16_t NumSeg;
125typedef uint8_t NumSeg;
127const NumSeg NullSegNo = 0;
129typedef uint8_t SegRefCnt;
131#ifdef USE_MEMMGR_MULTI_CORE
136typedef uint8_t LockId;
137const LockId NullLockId = 0;
141typedef uint8_t CpuId;
142const CpuId MaskCpuId = 0x0f;
143const CpuId MaxCpuId = MaskCpuId;
153#ifdef CONFIG_MEMUTILS_MEMORY_MANAGER_USE_FENCE
156#ifdef USE_MEMMGR_MULTI_CORE
162#ifdef USE_MEMMGR_DEBUG_OUTPUT
163 void printInfo(
bool newline =
true)
const {
164 printf(
"PoolId=%d Type=%d NumSegs=%3d Addr=%08x Size=%08x",
165 id, type, num_segs, addr, size);
166#ifdef CONFIG_MEMUTILS_MEMORY_MANAGER_USE_FENCE
167 printf(
" fence=%d", fence);
169#ifdef USE_MEMMGR_MULTI_CORE
170 printf(
" Spinlock=%d", spl_id);
172 if (newline) printf(
"\n");
181#ifdef CONFIG_MEMUTILS_MEMORY_MANAGER_USE_FENCE
184#ifdef USE_MEMMGR_MULTI_CORE
190#ifdef USE_MEMMGR_DEBUG_OUTPUT
191 void printInfo(
bool newline =
true)
const {
192 printf(
"PoolId=%d Type=%d NumSegs=%3d Addr=%08x Size=%08x",
193 id, type, num_segs, addr, size);
194#ifdef CONFIG_MEMUTILS_MEMORY_MANAGER_USE_FENCE
195 printf(
" fence=%d", fence);
197#ifdef USE_MEMMGR_MULTI_CORE
198 printf(
" Spinlock=%d", spl_id);
200 if (newline) printf(
"\n");
207 return (id1.sec == id2.sec && id1.pool == id2.pool);
210inline bool operator != (PoolId id1, PoolId id2)
212 return !(id1.sec == id2.sec && id1.pool == id2.pool);
namespace for "Memory Manager".
uint8_t PoolType
Definition: MemMgrTypes.h:95
@ BasicType
Definition: MemMgrTypes.h:106
@ NumPoolTypes
Definition: MemMgrTypes.h:109
uint8_t NumLayout
Definition: MemMgrTypes.h:82
Definition: MemMgrTypes.h:149
Definition: MemMgrTypes.h:88
Definition: MemMgrTypes.h:177