diff --git a/orbis-kernel/src/umtx.cpp b/orbis-kernel/src/umtx.cpp index 383afbd..624b653 100644 --- a/orbis-kernel/src/umtx.cpp +++ b/orbis-kernel/src/umtx.cpp @@ -448,7 +448,7 @@ orbis::ErrorCode orbis::umtx_wake_umutex(Thread *thread, ptr m) { orbis::ErrorCode orbis::umtx_sem_wait(Thread *thread, ptr sem, std::uint64_t ut) { - ORBIS_LOG_WARNING(__FUNCTION__, sem, ut); + ORBIS_LOG_TRACE(__FUNCTION__, sem, ut); auto [chain, key, lock] = g_context.getUmtxChain0(thread, sem->flags, sem); auto node = chain.enqueue(key, thread); diff --git a/rpcsx-os/CMakeLists.txt b/rpcsx-os/CMakeLists.txt index 6ea82e5..977e1f1 100644 --- a/rpcsx-os/CMakeLists.txt +++ b/rpcsx-os/CMakeLists.txt @@ -2,7 +2,8 @@ add_library(standalone-config INTERFACE) target_include_directories(standalone-config INTERFACE orbis-kernel-config) add_library(orbis::kernel::config ALIAS standalone-config) -add_executable(rpcsx-os +add_executable(rpcsx-os + iodev/ajm.cpp iodev/dce.cpp iodev/dipsw.cpp iodev/dmem.cpp diff --git a/rpcsx-os/io-devices.hpp b/rpcsx-os/io-devices.hpp index 3109c2b..92621df 100644 --- a/rpcsx-os/io-devices.hpp +++ b/rpcsx-os/io-devices.hpp @@ -17,3 +17,4 @@ IoDevice *createStdinCharacterDevice(); IoDevice *createStdoutCharacterDevice(); IoDevice *createZeroCharacterDevice(); IoDevice *createRngCharacterDevice(); +IoDevice *createAjmCharacterDevice(); diff --git a/rpcsx-os/iodev/ajm.cpp b/rpcsx-os/iodev/ajm.cpp new file mode 100644 index 0000000..3e4f895 --- /dev/null +++ b/rpcsx-os/iodev/ajm.cpp @@ -0,0 +1,33 @@ +#include "io-device.hpp" +#include "orbis/KernelAllocator.hpp" +#include "orbis/utils/Logs.hpp" +#include + +struct AjmDevice : public IoDevice {}; + +struct AjmInstance : public IoDeviceInstance {}; + +static std::int64_t ajm_instance_ioctl(IoDeviceInstance *instance, + std::uint64_t request, void *argp) { + + ORBIS_LOG_FATAL("Unhandled AJM ioctl", request); + return -1; +} + +static std::int32_t ajm_device_open(IoDevice *device, + orbis::Ref *instance, + const char *path, std::uint32_t flags, + std::uint32_t mode) { + auto *newInstance = orbis::knew(); + newInstance->ioctl = ajm_instance_ioctl; + + io_device_instance_init(device, newInstance); + *instance = newInstance; + return 0; +} + +IoDevice *createAjmCharacterDevice() { + auto *newDevice = orbis::knew(); + newDevice->open = ajm_device_open; + return newDevice; +} \ No newline at end of file diff --git a/rpcsx-os/main.cpp b/rpcsx-os/main.cpp index ce91e8c..791509a 100644 --- a/rpcsx-os/main.cpp +++ b/rpcsx-os/main.cpp @@ -267,6 +267,7 @@ static int ps4Exec(orbis::Process *mainProcess, rx::vfs::mount("/dev/hid", createHidCharacterDevice()); rx::vfs::mount("/dev/gc", createGcCharacterDevice()); rx::vfs::mount("/dev/rng", createRngCharacterDevice()); + rx::vfs::mount("/dev/ajm", createAjmCharacterDevice()); rx::procOpsTable.open(mainThread, "/dev/stdin", 0, 0); rx::procOpsTable.open(mainThread, "/dev/stdout", 0, 0); diff --git a/rpcsx-os/ops.cpp b/rpcsx-os/ops.cpp index dd2f24d..1c9c1e7 100644 --- a/rpcsx-os/ops.cpp +++ b/rpcsx-os/ops.cpp @@ -230,6 +230,7 @@ orbis::SysResult open(orbis::Thread *thread, orbis::ptr path, auto result = rx::vfs::open(path, flags, mode, &instance); if (result.isError()) { ORBIS_LOG_WARNING("Failed to open file", path, result.value()); + thread->where(); return result; } @@ -404,6 +405,7 @@ orbis::SysResult ioctl(orbis::Thread *thread, orbis::sint fd, orbis::ulong com, if (result < 0) { // TODO + thread->where(); return ErrorCode::IO; }