mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 06:55:09 +00:00
split rpcs3 and hle libraries
merge rpcs3 utilities
This commit is contained in:
parent
b33e2662b6
commit
62ad27d1e2
1233 changed files with 7004 additions and 3819 deletions
96
ps3fw/sys_heap.cpp
Normal file
96
ps3fw/sys_heap.cpp
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
#include "stdafx.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(sysPrxForUser);
|
||||
|
||||
struct HeapInfo
|
||||
{
|
||||
static const u32 id_base = 1;
|
||||
static const u32 id_step = 1;
|
||||
static const u32 id_count = 1023;
|
||||
SAVESTATE_INIT_POS(22);
|
||||
|
||||
const std::string name;
|
||||
|
||||
HeapInfo(const char* name)
|
||||
: name(name)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
u32 _sys_heap_create_heap(vm::cptr<char> name, u32 arg2, u32 arg3, u32 arg4)
|
||||
{
|
||||
sysPrxForUser.warning("_sys_heap_create_heap(name=%s, arg2=0x%x, arg3=0x%x, arg4=0x%x)", name, arg2, arg3, arg4);
|
||||
|
||||
return idm::make<HeapInfo>(name.get_ptr());
|
||||
}
|
||||
|
||||
error_code _sys_heap_delete_heap(u32 heap)
|
||||
{
|
||||
sysPrxForUser.warning("_sys_heap_delete_heap(heap=0x%x)", heap);
|
||||
|
||||
idm::remove<HeapInfo>(heap);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
u32 _sys_heap_malloc(u32 heap, u32 size)
|
||||
{
|
||||
sysPrxForUser.warning("_sys_heap_malloc(heap=0x%x, size=0x%x)", heap, size);
|
||||
|
||||
return vm::alloc(size, vm::main);
|
||||
}
|
||||
|
||||
u32 _sys_heap_memalign(u32 heap, u32 align, u32 size)
|
||||
{
|
||||
sysPrxForUser.warning("_sys_heap_memalign(heap=0x%x, align=0x%x, size=0x%x)", heap, align, size);
|
||||
|
||||
return vm::alloc(size, vm::main, std::max<u32>(align, 0x10000));
|
||||
}
|
||||
|
||||
error_code _sys_heap_free(u32 heap, u32 addr)
|
||||
{
|
||||
sysPrxForUser.warning("_sys_heap_free(heap=0x%x, addr=0x%x)", heap, addr);
|
||||
|
||||
vm::dealloc(addr, vm::main);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code _sys_heap_alloc_heap_memory()
|
||||
{
|
||||
sysPrxForUser.todo("_sys_heap_alloc_heap_memory()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code _sys_heap_get_mallinfo()
|
||||
{
|
||||
sysPrxForUser.todo("_sys_heap_get_mallinfo()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code _sys_heap_get_total_free_size()
|
||||
{
|
||||
sysPrxForUser.todo("_sys_heap_get_total_free_size()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code _sys_heap_stats()
|
||||
{
|
||||
sysPrxForUser.todo("_sys_heap_stats()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void sysPrxForUser_sys_heap_init()
|
||||
{
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_create_heap);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_delete_heap);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_malloc);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_memalign);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_free);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_alloc_heap_memory);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_get_mallinfo);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_get_total_free_size);
|
||||
REG_FUNC(sysPrxForUser, _sys_heap_stats);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue