iodev: add kayman/reg device stub

This commit is contained in:
DH 2024-08-31 23:55:47 +03:00
parent f6369c710a
commit d0d22529f9
4 changed files with 42 additions and 0 deletions

View file

@ -48,6 +48,7 @@ add_executable(rpcsx-os
iodev/sshot.cpp
iodev/lvdctl.cpp
iodev/icc_power.cpp
iodev/cayman_reg.cpp
main.cpp
backtrace.cpp

View file

@ -48,3 +48,4 @@ IoDevice *createSrtcCharacterDevice();
IoDevice *createScreenShotCharacterDevice();
IoDevice *createLvdCtlCharacterDevice();
IoDevice *createIccPowerCharacterDevice();
IoDevice *createCaymanRegCharacterDevice();

View file

@ -0,0 +1,39 @@
#include "io-device.hpp"
#include "orbis/KernelAllocator.hpp"
#include "orbis/file.hpp"
#include "orbis/thread/Thread.hpp"
#include "orbis/utils/Logs.hpp"
struct CaymanRegDevice : IoDevice {
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
std::uint32_t flags, std::uint32_t mode,
orbis::Thread *thread) override;
};
static orbis::ErrorCode cayman_reg_ioctl(orbis::File *file,
std::uint64_t request, void *argp,
orbis::Thread *thread) {
ORBIS_LOG_FATAL("Unhandled cayman_reg ioctl", request);
thread->where();
return {};
}
static const orbis::FileOps fileOps = {
.ioctl = cayman_reg_ioctl,
};
orbis::ErrorCode CaymanRegDevice::open(orbis::Ref<orbis::File> *file,
const char *path, std::uint32_t flags,
std::uint32_t mode,
orbis::Thread *thread) {
auto newFile = orbis::knew<orbis::File>();
newFile->ops = &fileOps;
newFile->device = this;
*file = newFile;
return {};
}
IoDevice *createCaymanRegCharacterDevice() {
return orbis::knew<CaymanRegDevice>();
}

View file

@ -474,6 +474,7 @@ static void ps4InitDev() {
rx::vfs::addDevice("lvdctl", createLvdCtlCharacterDevice());
rx::vfs::addDevice("lvd0", createHddCharacterDevice(0x100000000));
rx::vfs::addDevice("icc_power", createIccPowerCharacterDevice());
rx::vfs::addDevice("cayman/reg", createCaymanRegCharacterDevice());
// mbus->emitEvent({
// .system = 2,