vm: memory locking rewritten

Added vm::lock_sudo method (wrapper for utils::memory_lock).
Put locking outside of vm::g_mutex scope.
Prelock sudo memory for RSX, vm::stack, vm::main.
Prelock sudo memory for shared memory objects.
Don't check for TSX path.
This commit is contained in:
Nekotekina 2020-11-15 03:26:43 +03:00
parent eaf0bbc108
commit ea5f5aea5f
6 changed files with 52 additions and 35 deletions

View file

@ -434,7 +434,7 @@ error_code cellCameraOpenEx(s32 dev_num, vm::ptr<CellCameraInfoEx> info)
if (info->read_mode != CELL_CAMERA_READ_DIRECT && !info->buffer)
{
info->buffer = vm::cast(vm::alloc(vbuf_size, vm::memory_location_t::main));
info->buffer = vm::cast(vm::alloc(vbuf_size, vm::main));
info->bytesize = vbuf_size;
}
@ -480,7 +480,7 @@ error_code cellCameraClose(s32 dev_num)
return CELL_CAMERA_ERROR_NOT_OPEN;
}
vm::dealloc(g_camera->info.buffer.addr(), vm::memory_location_t::main);
vm::dealloc(g_camera->info.buffer.addr(), vm::main);
g_camera->is_open = false;
return CELL_OK;