From 99a3a4005bda23f3d38bafcbd68c5ed494b60e36 Mon Sep 17 00:00:00 2001 From: DH Date: Sun, 30 Jul 2023 00:34:05 +0300 Subject: [PATCH] [rpcsx-os] shm: do abort on unknown shm open --- rpcsx-os/iodev/shm.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rpcsx-os/iodev/shm.cpp b/rpcsx-os/iodev/shm.cpp index d2d23121e..694a41679 100644 --- a/rpcsx-os/iodev/shm.cpp +++ b/rpcsx-os/iodev/shm.cpp @@ -2,6 +2,7 @@ #include "orbis/KernelAllocator.hpp" #include "orbis/error/ErrorCode.hpp" #include "orbis/file.hpp" +#include "orbis/thread/Thread.hpp" #include "orbis/utils/Logs.hpp" #include #include @@ -31,10 +32,20 @@ orbis::ErrorCode ShmDevice::open(orbis::Ref *file, // TODO realFlags |= O_CREAT; size = 0x4000; + } else if (name == "/rpcsx-vmicDdShmAin") { + // TODO + realFlags |= O_CREAT; + size = 0x4000; + } else if (name == "/rpcsx-SceNpPlusLogger") { + realFlags |= O_CREAT; + size = 0x4400; + thread->where(); + } else if (~flags & 0x200) { + ORBIS_LOG_ERROR("SHM: unknown shared memory", path); + thread->where(); + std::abort(); } - realFlags |= O_CREAT; // TODO - int fd = shm_open(name.c_str(), realFlags, S_IRUSR | S_IWUSR); if (fd < 0) { std::printf("shm_open: error %u\n", errno);