Stub /dev/ajm + minor fx

This commit is contained in:
Ivan Chikish 2023-07-26 14:35:40 +03:00
parent ff263057bd
commit 5925cc2c75
6 changed files with 40 additions and 2 deletions

View File

@ -448,7 +448,7 @@ orbis::ErrorCode orbis::umtx_wake_umutex(Thread *thread, ptr<umutex> m) {
orbis::ErrorCode orbis::umtx_sem_wait(Thread *thread, ptr<usem> 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);

View File

@ -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

View File

@ -17,3 +17,4 @@ IoDevice *createStdinCharacterDevice();
IoDevice *createStdoutCharacterDevice();
IoDevice *createZeroCharacterDevice();
IoDevice *createRngCharacterDevice();
IoDevice *createAjmCharacterDevice();

33
rpcsx-os/iodev/ajm.cpp Normal file
View File

@ -0,0 +1,33 @@
#include "io-device.hpp"
#include "orbis/KernelAllocator.hpp"
#include "orbis/utils/Logs.hpp"
#include <cstdio>
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<IoDeviceInstance> *instance,
const char *path, std::uint32_t flags,
std::uint32_t mode) {
auto *newInstance = orbis::knew<AjmInstance>();
newInstance->ioctl = ajm_instance_ioctl;
io_device_instance_init(device, newInstance);
*instance = newInstance;
return 0;
}
IoDevice *createAjmCharacterDevice() {
auto *newDevice = orbis::knew<AjmDevice>();
newDevice->open = ajm_device_open;
return newDevice;
}

View File

@ -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);

View File

@ -230,6 +230,7 @@ orbis::SysResult open(orbis::Thread *thread, orbis::ptr<const char> 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;
}