Memory: remove IsValidVirtualAddress with current process

This commit is contained in:
Weiyi Wang 2018-11-17 14:31:00 -05:00
parent 36cf104a02
commit 7308b8d294
4 changed files with 7 additions and 10 deletions

View file

@ -346,7 +346,7 @@ ResultCode SVC::UnmapMemoryBlock(Handle handle, u32 addr) {
/// Connect to an OS service given the port name, returns the handle to the port to out
ResultCode SVC::ConnectToPort(Handle* out_handle, VAddr port_name_address) {
if (!Memory::IsValidVirtualAddress(port_name_address))
if (!Memory::IsValidVirtualAddress(*kernel.GetCurrentProcess(), port_name_address))
return ERR_NOT_FOUND;
static constexpr std::size_t PortNameMaxLength = 11;
@ -451,7 +451,7 @@ ResultCode SVC::WaitSynchronizationN(s32* out, VAddr handles_address, s32 handle
bool wait_all, s64 nano_seconds) {
Thread* thread = kernel.GetThreadManager().GetCurrentThread();
if (!Memory::IsValidVirtualAddress(handles_address))
if (!Memory::IsValidVirtualAddress(*kernel.GetCurrentProcess(), handles_address))
return ERR_INVALID_POINTER;
// NOTE: on real hardware, there is no nullptr check for 'out' (tested with firmware 4.4). If
@ -622,7 +622,7 @@ static ResultCode ReceiveIPCRequest(SharedPtr<ServerSession> server_session,
/// In a single operation, sends a IPC reply and waits for a new request.
ResultCode SVC::ReplyAndReceive(s32* index, VAddr handles_address, s32 handle_count,
Handle reply_target) {
if (!Memory::IsValidVirtualAddress(handles_address))
if (!Memory::IsValidVirtualAddress(*kernel.GetCurrentProcess(), handles_address))
return ERR_INVALID_POINTER;
// Check if 'handle_count' is invalid