mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-10 18:50:03 +01:00
[rpcsx-os] stub console, npdrm and icc_configuration devices
This commit is contained in:
parent
738a760fbe
commit
35ba07f676
|
|
@ -5,6 +5,7 @@ add_library(orbis::kernel::config ALIAS standalone-config)
|
|||
add_executable(rpcsx-os
|
||||
iodev/ajm.cpp
|
||||
iodev/blockpool.cpp
|
||||
iodev/console.cpp
|
||||
iodev/dce.cpp
|
||||
iodev/dipsw.cpp
|
||||
iodev/dmem.cpp
|
||||
|
|
@ -14,6 +15,8 @@ add_executable(rpcsx-os
|
|||
iodev/hmd_cmd.cpp
|
||||
iodev/hmd_mmap.cpp
|
||||
iodev/hmd_snsr.cpp
|
||||
iodev/icc_configuration.cpp
|
||||
iodev/npdrm.cpp
|
||||
iodev/null.cpp
|
||||
iodev/rng.cpp
|
||||
iodev/sbl_srv.cpp
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ IoDevice *createNullCharacterDevice();
|
|||
IoDevice *createZeroCharacterDevice();
|
||||
IoDevice *createRngCharacterDevice();
|
||||
IoDevice *createAjmCharacterDevice();
|
||||
IoDevice *createIccConfigurationCharacterDevice();
|
||||
IoDevice *createNpdrmCharacterDevice();
|
||||
IoDevice *createConsoleCharacterDevice();
|
||||
IoDevice *createSblSrvCharacterDevice();
|
||||
IoDevice *createShmDevice();
|
||||
IoDevice *createBlockPoolDevice();
|
||||
|
|
|
|||
32
rpcsx-os/iodev/console.cpp
Normal file
32
rpcsx-os/iodev/console.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct ConsoleFile : orbis::File {};
|
||||
|
||||
static orbis::ErrorCode console_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
|
||||
ORBIS_LOG_FATAL("Unhandled console ioctl", request);
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps fileOps = {
|
||||
.ioctl = console_ioctl,
|
||||
};
|
||||
|
||||
struct ConsoleDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<ConsoleFile>();
|
||||
newFile->ops = &fileOps;
|
||||
newFile->device = this;
|
||||
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
IoDevice *createConsoleCharacterDevice() { return orbis::knew<ConsoleDevice>(); }
|
||||
32
rpcsx-os/iodev/icc_configuration.cpp
Normal file
32
rpcsx-os/iodev/icc_configuration.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct IccConfigurationFile : orbis::File {};
|
||||
|
||||
static orbis::ErrorCode icc_configuration_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
|
||||
ORBIS_LOG_FATAL("Unhandled icc_configuration ioctl", request);
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps fileOps = {
|
||||
.ioctl = icc_configuration_ioctl,
|
||||
};
|
||||
|
||||
struct IccConfigurationDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<IccConfigurationFile>();
|
||||
newFile->ops = &fileOps;
|
||||
newFile->device = this;
|
||||
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
IoDevice *createIccConfigurationCharacterDevice() { return orbis::knew<IccConfigurationDevice>(); }
|
||||
32
rpcsx-os/iodev/npdrm.cpp
Normal file
32
rpcsx-os/iodev/npdrm.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct NpdrmFile : orbis::File {};
|
||||
|
||||
static orbis::ErrorCode npdrm_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
|
||||
ORBIS_LOG_FATAL("Unhandled NPDRM ioctl", request);
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps fileOps = {
|
||||
.ioctl = npdrm_ioctl,
|
||||
};
|
||||
|
||||
struct NpdrmDevice : IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override {
|
||||
auto newFile = orbis::knew<NpdrmFile>();
|
||||
newFile->ops = &fileOps;
|
||||
newFile->device = this;
|
||||
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
IoDevice *createNpdrmCharacterDevice() { return orbis::knew<NpdrmDevice>(); }
|
||||
|
|
@ -323,6 +323,9 @@ static int ps4Exec(orbis::Thread *mainThread,
|
|||
orbis::g_context.dmemDevice = dmem1;
|
||||
|
||||
rx::vfs::mount("/dev/dmem0", createDmemCharacterDevice(0));
|
||||
rx::vfs::mount("/dev/npdrm", createNpdrmCharacterDevice());
|
||||
rx::vfs::mount("/dev/icc_configuration", createIccConfigurationCharacterDevice());
|
||||
rx::vfs::mount("/dev/console", createConsoleCharacterDevice());
|
||||
rx::vfs::mount("/dev/dmem1", dmem1);
|
||||
rx::vfs::mount("/dev/dmem2", createDmemCharacterDevice(2));
|
||||
rx::vfs::mount("/dev/stdout", createFdWrapDevice(STDOUT_FILENO));
|
||||
|
|
|
|||
Loading…
Reference in a new issue