Skip to content

Commit

Permalink
iodev: add kayman/reg device stub
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Aug 31, 2024
1 parent f6369c7 commit a2af72c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions rpcsx-os/io-devices.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ IoDevice *createSrtcCharacterDevice();
IoDevice *createScreenShotCharacterDevice();
IoDevice *createLvdCtlCharacterDevice();
IoDevice *createIccPowerCharacterDevice();
IoDevice *createCaymanRegCharacterDevice();
39 changes: 39 additions & 0 deletions rpcsx-os/iodev/cayman_reg.cpp
Original file line number Diff line number Diff line change
@@ -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>();
}
1 change: 1 addition & 0 deletions rpcsx-os/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a2af72c

Please sign in to comment.