41#ifndef MEMMANAGER_H_INCLUDED
42#define MEMMANAGER_H_INCLUDED
68static inline void* translatePoolAddrToVa(PoolAddr addr)
70 return reinterpret_cast<void*
>(addr);
73static inline void* translateVaToPa(
void* addr)
79 if (addr <
reinterpret_cast<void*
>(0x00100000))
89 tileId = (va >> 16) & 0xf;
90 cpuId = *(
volatile uint32_t *)((0x4c000000 | 0x02002000) + 0x40);
91 reg = (0x02012000 + 0x04) + (0x04 * (tileId / 2)) + ((cpuId - 2) * 0x20);
92 pa = *(
volatile uint32_t *)(reg);
93 tileVal = ((pa >> ((tileId & 0x1) * 16)) & 0x01ff) << 16;
95 return (
void *)(0x0c000000 | tileVal | (va & 0xffff));
110#ifdef USE_MEMMGR_SEG_DELETER
122 void*
getVa()
const {
return translatePoolAddrToVa(getAddr()); }
133 void fill(
unsigned char c) { memset(
getVa(), c, getSize()); }
135#ifdef USE_MEMMGR_DEBUG_OUTPUT
136 void printInfo(
bool newline =
true)
const {
137 printf(
"PoolId=%3d, SegNo=%3d, Flags=%02x", getPoolId(), getSegNo(), getFlags());
139 printf(
", VA=%08x(%08x), Size=%08x, SegRefCnt=%3d",
140 getVa(), getAddr(), getSize(), getRefCnt());
142 if (newline) printf(
"\n");
148S_ASSERT(
sizeof(MemHandle) == 4);
Memory Manager Lite Memory Handle Base class API.
Types definitions for "Memory Manager".
Memory Handler Base Class for Memory Handler Base Class. This class`s methods can called only from Me...
Definition: MemHandleBase.h:66
Memory Handler Class for "Memory Manager Lite". This is only wrapper class for convert project-specif...
Definition: MemManager.h:107
void * getVa() const
Definition: MemManager.h:122
void * getPa() const
Definition: MemManager.h:127
void fill(unsigned char c)
Definition: MemManager.h:133
namespace for "Memory Manager".
Definition: MemMgrTypes.h:88