mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
_lv2prx mutex implemented
This commit is contained in:
parent
5ba23ac4c4
commit
a5c431c2b7
@ -14,6 +14,7 @@ extern logs::channel sysPrxForUser;
|
||||
vm::gvar<sys_lwmutex_t> g_ppu_atexit_lwm;
|
||||
vm::gvar<vm::ptr<void()>[8]> g_ppu_atexit;
|
||||
vm::gvar<u32> g_ppu_once_mutex;
|
||||
vm::gvar<sys_lwmutex_t> g_ppu_prx_lwm;
|
||||
|
||||
static u32 s_tls_addr = 0; // TLS image address
|
||||
static u32 s_tls_file = 0; // TLS image size
|
||||
@ -110,6 +111,12 @@ void sys_initialize_tls(ppu_thread& ppu, u64 main_thread_id, u32 tls_seg_addr, u
|
||||
attr->flags = 0;
|
||||
attr->name_u64 = "_lv2ppu\0"_u64;
|
||||
sys_mutex_create(g_ppu_once_mutex, attr);
|
||||
|
||||
lwa->protocol = SYS_SYNC_PRIORITY;
|
||||
lwa->recursive = SYS_SYNC_RECURSIVE;
|
||||
lwa->name_u64 = "_lv2prx\0"_u64;
|
||||
sys_lwmutex_create(g_ppu_prx_lwm, lwa);
|
||||
// TODO: missing prx initialization
|
||||
}
|
||||
|
||||
error_code sys_ppu_thread_create(ppu_thread& ppu, vm::ptr<u64> thread_id, u32 entry, u64 arg, s32 prio, u32 stacksize, u64 flags, vm::cptr<char> threadname)
|
||||
@ -262,6 +269,7 @@ void sysPrxForUser_sys_ppu_thread_init()
|
||||
REG_VNID(sysPrxForUser, 0x00000000u, g_ppu_atexit_lwm);
|
||||
REG_VNID(sysPrxForUser, 0x00000001u, g_ppu_once_mutex);
|
||||
REG_VNID(sysPrxForUser, 0x00000002u, g_ppu_atexit);
|
||||
REG_VNID(sysPrxForUser, 0x00000003u, g_ppu_prx_lwm);
|
||||
|
||||
REG_FUNC(sysPrxForUser, sys_initialize_tls);
|
||||
REG_FUNC(sysPrxForUser, sys_ppu_thread_create);
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
extern logs::channel sysPrxForUser;
|
||||
|
||||
extern vm::gvar<sys_lwmutex_t> g_ppu_prx_lwm;
|
||||
|
||||
// Convert the array of 32-bit pointers to 64-bit pointers using stack allocation
|
||||
static auto convert_path_list(vm::cpptr<char> path_list, s32 count)
|
||||
{
|
||||
@ -36,51 +38,57 @@ static void entryx(ppu_thread& ppu, vm::ptr<sys_prx_start_stop_module_option_t>
|
||||
}
|
||||
}
|
||||
|
||||
error_code sys_prx_load_module(vm::cptr<char> path, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
error_code sys_prx_load_module(ppu_thread& ppu, vm::cptr<char> path, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
{
|
||||
sysPrxForUser.warning("sys_prx_load_module(path=%s, flags=0x%x, pOpt=*0x%x)", path, flags, pOpt);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_load_module(path, flags, pOpt);
|
||||
}
|
||||
|
||||
error_code sys_prx_load_module_by_fd(s32 fd, u64 offset, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
error_code sys_prx_load_module_by_fd(ppu_thread& ppu, s32 fd, u64 offset, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
{
|
||||
sysPrxForUser.warning("sys_prx_load_module_by_fd(fd=%d, offset=0x%x, flags=0x%x, pOpt=*0x%x)", fd, offset, flags, pOpt);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_load_module_by_fd(fd, offset, flags, pOpt);
|
||||
}
|
||||
|
||||
error_code sys_prx_load_module_on_memcontainer(vm::cptr<char> path, u32 mem_ct, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
error_code sys_prx_load_module_on_memcontainer(ppu_thread& ppu, vm::cptr<char> path, u32 mem_ct, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
{
|
||||
sysPrxForUser.warning("sys_prx_load_module_on_memcontainer(path=%s, mem_ct=0x%x, flags=0x%x, pOpt=*0x%x)", path, mem_ct, flags, pOpt);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_load_module_on_memcontainer(path, mem_ct, flags, pOpt);
|
||||
}
|
||||
|
||||
error_code sys_prx_load_module_on_memcontainer_by_fd(s32 fd, u64 offset, u32 mem_ct, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
error_code sys_prx_load_module_on_memcontainer_by_fd(ppu_thread& ppu, s32 fd, u64 offset, u32 mem_ct, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt)
|
||||
{
|
||||
sysPrxForUser.warning("sys_prx_load_module_on_memcontainer_by_fd(fd=%d, offset=0x%x, mem_ct=0x%x, flags=0x%x, pOpt=*0x%x)", fd, offset, mem_ct, flags, pOpt);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_load_module_on_memcontainer_by_fd(fd, offset, mem_ct, flags, pOpt);
|
||||
}
|
||||
|
||||
error_code sys_prx_load_module_list(s32 count, vm::cpptr<char> path_list, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt, vm::ptr<u32> id_list)
|
||||
error_code sys_prx_load_module_list(ppu_thread& ppu, s32 count, vm::cpptr<char> path_list, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt, vm::ptr<u32> id_list)
|
||||
{
|
||||
sysPrxForUser.todo("sys_prx_load_module_list(count=%d, path_list=**0x%x, flags=0x%x, pOpt=*0x%x, id_list=*0x%x)", count, path_list, flags, pOpt, id_list);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_load_module_list(count, convert_path_list(path_list, count), flags, pOpt, id_list);
|
||||
}
|
||||
|
||||
error_code sys_prx_load_module_list_on_memcontainer(s32 count, vm::cpptr<char> path_list, u32 mem_ct, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt, vm::ptr<u32> id_list)
|
||||
error_code sys_prx_load_module_list_on_memcontainer(ppu_thread& ppu, s32 count, vm::cpptr<char> path_list, u32 mem_ct, u64 flags, vm::ptr<sys_prx_load_module_option_t> pOpt, vm::ptr<u32> id_list)
|
||||
{
|
||||
sysPrxForUser.todo("sys_prx_load_module_list_on_memcontainer(count=%d, path_list=**0x%x, mem_ct=0x%x, flags=0x%x, pOpt=*0x%x, id_list=*0x%x)", count, path_list, mem_ct, flags, pOpt, id_list);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_load_module_list_on_memcontainer(count, convert_path_list(path_list, count), mem_ct, flags, pOpt, id_list);
|
||||
}
|
||||
|
||||
@ -93,7 +101,7 @@ error_code sys_prx_start_module(ppu_thread& ppu, u32 id, u32 args, vm::ptr<void>
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
vm::var<sys_prx_start_stop_module_option_t> opt;
|
||||
opt->size = opt.size();
|
||||
@ -126,7 +134,7 @@ error_code sys_prx_stop_module(ppu_thread& ppu, u32 id, u32 args, vm::ptr<void>
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
vm::var<sys_prx_start_stop_module_option_t> opt;
|
||||
opt->size = opt.size();
|
||||
@ -150,27 +158,30 @@ error_code sys_prx_stop_module(ppu_thread& ppu, u32 id, u32 args, vm::ptr<void>
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_prx_unload_module(u32 id, u64 flags, vm::ptr<sys_prx_unload_module_option_t> pOpt)
|
||||
error_code sys_prx_unload_module(ppu_thread& ppu, u32 id, u64 flags, vm::ptr<sys_prx_unload_module_option_t> pOpt)
|
||||
{
|
||||
sysPrxForUser.warning("sys_prx_unload_module(id=0x%x, flags=0x%x, pOpt=*0x%x)", id, flags, pOpt);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_unload_module(id, flags, pOpt);
|
||||
}
|
||||
|
||||
error_code sys_prx_register_library(vm::ptr<void> lib_entry)
|
||||
error_code sys_prx_register_library(ppu_thread& ppu, vm::ptr<void> lib_entry)
|
||||
{
|
||||
sysPrxForUser.warning("sys_prx_register_library(lib_entry=*0x%x)", lib_entry);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_register_library(lib_entry);
|
||||
}
|
||||
|
||||
error_code sys_prx_unregister_library(vm::ptr<void> lib_entry)
|
||||
error_code sys_prx_unregister_library(ppu_thread& ppu, vm::ptr<void> lib_entry)
|
||||
{
|
||||
sysPrxForUser.warning("sys_prx_unregister_library(lib_entry=*0x%x)", lib_entry);
|
||||
|
||||
// TODO
|
||||
sys_lwmutex_locker(ppu, g_ppu_prx_lwm);
|
||||
|
||||
return _sys_prx_unregister_library(lib_entry);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user