Exemplo n.º 1
0
void
Module::initialiseMembase()
{
   sMemArenas.fill(nullptr);

   MEMInitList(sForegroundMemlist, offsetof(CommonHeap, link));
   MEMInitList(sMEM1Memlist, offsetof(CommonHeap, link));
   MEMInitList(sMEM2Memlist, offsetof(CommonHeap, link));

   CoreInitDefaultHeap();

   // TODO: getAddress should not be neccessary here...
   *pMEMAllocFromDefaultHeap = sDefaultMEMAllocFromDefaultHeap.getAddress();
   *pMEMAllocFromDefaultHeapEx = sDefaultMEMAllocFromDefaultHeapEx.getAddress();
   *pMEMFreeToDefaultHeap = sDefaultMEMFreeToDefaultHeap.getAddress();
}
Exemplo n.º 2
0
void
CoreInit::initialiseMembase()
{
   CoreInitDefaultHeap();

   *pMEMAllocFromDefaultHeap = findExportAddress("sMEMAllocFromDefaultHeap");
   *pMEMAllocFromDefaultHeapEx = findExportAddress("sMEMAllocFromDefaultHeapEx");
   *pMEMFreeToDefaultHeap = findExportAddress("sMEMFreeToDefaultHeap");

   gForegroundMemlist = OSAllocFromSystem<MemoryList>();
   MEMInitList(gForegroundMemlist, offsetof(CommonHeap, link));

   gMEM1Memlist = OSAllocFromSystem<MemoryList>();
   MEMInitList(gMEM1Memlist, offsetof(CommonHeap, link));

   gMEM2Memlist = OSAllocFromSystem<MemoryList>();
   MEMInitList(gMEM2Memlist, offsetof(CommonHeap, link));
}
Exemplo n.º 3
0
void
Module::initialiseMembase()
{
   gForegroundMemlist = coreinit::internal::sysAlloc<MemoryList>();
   MEMInitList(gForegroundMemlist, offsetof(CommonHeap, link));

   gMEM1Memlist = coreinit::internal::sysAlloc<MemoryList>();
   MEMInitList(gMEM1Memlist, offsetof(CommonHeap, link));

   gMEM2Memlist = coreinit::internal::sysAlloc<MemoryList>();
   MEMInitList(gMEM2Memlist, offsetof(CommonHeap, link));

   CoreInitDefaultHeap();

   *pMEMAllocFromDefaultHeap = findExportAddress("internal_defaultAlloc");
   *pMEMAllocFromDefaultHeapEx = findExportAddress("internal_defaultAllocEx");
   *pMEMFreeToDefaultHeap = findExportAddress("internal_defaultFree");
}
Exemplo n.º 4
0
void
Module::initialiseMembase()
{
   sSystemHeap = nullptr;
   sMemArenas.fill(nullptr);

   sForegroundMemlist = coreinit::internal::sysAlloc<MemoryList>();
   MEMInitList(sForegroundMemlist, offsetof(CommonHeap, link));

   sMEM1Memlist = coreinit::internal::sysAlloc<MemoryList>();
   MEMInitList(sMEM1Memlist, offsetof(CommonHeap, link));

   sMEM2Memlist = coreinit::internal::sysAlloc<MemoryList>();
   MEMInitList(sMEM2Memlist, offsetof(CommonHeap, link));

   CoreInitDefaultHeap();

   *pMEMAllocFromDefaultHeap = findExportAddress("internal_defaultAlloc");
   *pMEMAllocFromDefaultHeapEx = findExportAddress("internal_defaultAllocEx");
   *pMEMFreeToDefaultHeap = findExportAddress("internal_defaultFree");
}
Exemplo n.º 5
0
void
MEMiInitHeapHead(CommonHeap *heap, HeapType type, uint32_t dataStart, uint32_t dataEnd)
{
   heap->tag = type;
   MEMInitList(&heap->list, offsetof(CommonHeap, link));
   heap->dataStart = dataStart;
   heap->dataEnd = dataEnd;
   OSInitSpinLock(&heap->lock);
   heap->flags = 0;

   if (auto list = findListContainingHeap(heap)) {
      MEMAppendListObject(list, heap);
   }
}