From 8b99eb1b02ca1efe25a573ec45f54ebe24cb0422 Mon Sep 17 00:00:00 2001 From: DH Date: Fri, 10 Nov 2023 21:06:44 +0300 Subject: [PATCH] [orbis-kernel] dmem: fix deallocation --- rpcsx-os/iodev/dmem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcsx-os/iodev/dmem.cpp b/rpcsx-os/iodev/dmem.cpp index dfb47a186..68615f942 100644 --- a/rpcsx-os/iodev/dmem.cpp +++ b/rpcsx-os/iodev/dmem.cpp @@ -81,7 +81,7 @@ static orbis::ErrorCode dmem_ioctl(orbis::File *file, std::uint64_t request, args->size); device->allocations.map(args->address, args->address + args->size, - {.memoryType = 0}); + {.memoryType = -1u}); return {}; } @@ -128,7 +128,7 @@ static orbis::ErrorCode dmem_ioctl(orbis::File *file, std::uint64_t request, auto queryInfo = *it; - if (queryInfo.payload.memoryType == 0) { + if (queryInfo.payload.memoryType == -1u) { return orbis::ErrorCode::ACCES; } @@ -201,7 +201,7 @@ orbis::ErrorCode DmemDevice::allocate(std::uint64_t *start, if (it != allocations.end()) { auto allocation = *it; - if (allocation.payload.memoryType == 0) { + if (allocation.payload.memoryType == -1u) { if (offset < allocation.beginAddress) { offset = allocation.beginAddress + alignment - 1; offset &= ~(alignment - 1); @@ -261,7 +261,7 @@ orbis::ErrorCode DmemDevice::queryMaxFreeChunkSize(std::uint64_t *start, } auto allocation = *it; - if (allocation.payload.memoryType == 0) { + if (allocation.payload.memoryType == -1u) { if (offset < allocation.beginAddress) { offset = allocation.beginAddress + alignment - 1; offset &= ~(alignment - 1);