From 28dc7356a8eaeac1c9d25334827a46991f77c7b2 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi <18193363+elad335@users.noreply.github.com> Date: Sat, 12 Oct 2024 10:40:13 +0300 Subject: [PATCH] sys_memory: Fix argument size type --- rpcs3/Emu/Cell/lv2/sys_memory.cpp | 14 +++++++------- rpcs3/Emu/Cell/lv2/sys_memory.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.cpp b/rpcs3/Emu/Cell/lv2/sys_memory.cpp index 6f519c0f69..71d98447d5 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_memory.cpp @@ -93,7 +93,7 @@ std::shared_ptr reserve_map(u32 alloc_size, u32 align) // Todo: fix order of error checks -error_code sys_memory_allocate(cpu_thread& cpu, u32 size, u64 flags, vm::ptr alloc_addr) +error_code sys_memory_allocate(cpu_thread& cpu, u64 size, u64 flags, vm::ptr alloc_addr) { cpu.state += cpu_flag::wait; @@ -155,7 +155,7 @@ error_code sys_memory_allocate(cpu_thread& cpu, u32 size, u64 flags, vm::ptr alloc_addr) +error_code sys_memory_allocate_from_container(cpu_thread& cpu, u64 size, u32 cid, u64 flags, vm::ptr alloc_addr) { cpu.state += cpu_flag::wait; @@ -203,15 +203,15 @@ error_code sys_memory_allocate_from_container(cpu_thread& cpu, u32 size, u32 cid return {ct.ret, ct->size - ct->used}; } - if (const auto area = reserve_map(size, align)) + if (const auto area = reserve_map(static_cast(size), align)) { - if (const u32 addr = area->alloc(size)) + if (const u32 addr = area->alloc(static_cast(size))) { ensure(!g_fxo->get().addrs[addr >> 16].exchange(ct.ptr.get())); if (alloc_addr) { - vm::lock_sudo(addr, size); + vm::lock_sudo(addr, static_cast(size)); cpu.check_state(); *alloc_addr = addr; return CELL_OK; @@ -320,7 +320,7 @@ error_code sys_memory_get_user_memory_stat(cpu_thread& cpu, vm::ptr cid, u32 size) +error_code sys_memory_container_create(cpu_thread& cpu, vm::ptr cid, u64 size) { cpu.state += cpu_flag::wait; @@ -345,7 +345,7 @@ error_code sys_memory_container_create(cpu_thread& cpu, vm::ptr cid, u32 si } // Create the memory container - if (const u32 id = idm::make(size, true)) + if (const u32 id = idm::make(static_cast(size), true)) { cpu.check_state(); *cid = id; diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.h b/rpcs3/Emu/Cell/lv2/sys_memory.h index 6143edc6df..5184aeed43 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.h +++ b/rpcs3/Emu/Cell/lv2/sys_memory.h @@ -128,13 +128,13 @@ struct sys_memory_user_memory_stat_t }; // SysCalls -error_code sys_memory_allocate(cpu_thread& cpu, u32 size, u64 flags, vm::ptr alloc_addr); -error_code sys_memory_allocate_from_container(cpu_thread& cpu, u32 size, u32 cid, u64 flags, vm::ptr alloc_addr); +error_code sys_memory_allocate(cpu_thread& cpu, u64 size, u64 flags, vm::ptr alloc_addr); +error_code sys_memory_allocate_from_container(cpu_thread& cpu, u64 size, u32 cid, u64 flags, vm::ptr alloc_addr); error_code sys_memory_free(cpu_thread& cpu, u32 start_addr); error_code sys_memory_get_page_attribute(cpu_thread& cpu, u32 addr, vm::ptr attr); error_code sys_memory_get_user_memory_size(cpu_thread& cpu, vm::ptr mem_info); error_code sys_memory_get_user_memory_stat(cpu_thread& cpu, vm::ptr mem_stat); -error_code sys_memory_container_create(cpu_thread& cpu, vm::ptr cid, u32 size); +error_code sys_memory_container_create(cpu_thread& cpu, vm::ptr cid, u64 size); error_code sys_memory_container_destroy(cpu_thread& cpu, u32 cid); error_code sys_memory_container_get_size(cpu_thread& cpu, vm::ptr mem_info, u32 cid); error_code sys_memory_container_destroy_parent_with_childs(cpu_thread& cpu, u32 cid, u32 must_0, vm::ptr mc_child);