mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
ps5: add hdd devices
stub nsid1.ctl and a53io devices
This commit is contained in:
parent
c3edcfe6e6
commit
8797cf8475
|
|
@ -10,6 +10,7 @@ add_executable(rpcsx
|
|||
audio/AudioDevice.cpp
|
||||
audio/AlsaDevice.cpp
|
||||
|
||||
iodev/a53io.cpp
|
||||
iodev/ajm.cpp
|
||||
iodev/blockpool.cpp
|
||||
iodev/bt.cpp
|
||||
|
|
@ -31,6 +32,7 @@ add_executable(rpcsx
|
|||
iodev/metadbg.cpp
|
||||
iodev/notification.cpp
|
||||
iodev/npdrm.cpp
|
||||
iodev/nsid_ctl.cpp
|
||||
iodev/null.cpp
|
||||
iodev/rng.cpp
|
||||
iodev/sbl_srv.cpp
|
||||
|
|
|
|||
|
|
@ -51,3 +51,5 @@ IoDevice *createScreenShotCharacterDevice();
|
|||
IoDevice *createLvdCtlCharacterDevice();
|
||||
IoDevice *createIccPowerCharacterDevice();
|
||||
IoDevice *createCaymanRegCharacterDevice();
|
||||
IoDevice *createA53IoCharacterDevice();
|
||||
IoDevice *createNsidCtlCharacterDevice();
|
||||
|
|
|
|||
42
rpcsx/iodev/a53io.cpp
Normal file
42
rpcsx/iodev/a53io.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
struct A53IoFile : orbis::File {};
|
||||
|
||||
static orbis::ErrorCode a53io_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
|
||||
ORBIS_LOG_FATAL("Unhandled a53io ioctl", request);
|
||||
return {};
|
||||
}
|
||||
static orbis::ErrorCode a53io_read(orbis::File *file, orbis::Uio *uio,
|
||||
orbis::Thread *thread) {
|
||||
ORBIS_LOG_TODO(__FUNCTION__);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::days(1));
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps fileOps = {
|
||||
.ioctl = a53io_ioctl,
|
||||
.read = a53io_read,
|
||||
};
|
||||
|
||||
struct A53IoDevice : 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<A53IoFile>();
|
||||
newFile->ops = &fileOps;
|
||||
newFile->device = this;
|
||||
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
IoDevice *createA53IoCharacterDevice() { return orbis::knew<A53IoDevice>(); }
|
||||
51
rpcsx/iodev/nsid_ctl.cpp
Normal file
51
rpcsx/iodev/nsid_ctl.cpp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
#include "vfs.hpp"
|
||||
#include "../io-devices.hpp"
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
struct NsidCtlFile : orbis::File {};
|
||||
|
||||
static orbis::ErrorCode nsid_ctl_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
|
||||
if (request == 0x20003102) {
|
||||
ORBIS_LOG_ERROR(__FUNCTION__, "create ssd0 device");
|
||||
vfs::addDevice("ssd0", createHddCharacterDevice(0x100000000));
|
||||
} else {
|
||||
ORBIS_LOG_FATAL("Unhandled nsid_ctl ioctl", request);
|
||||
}
|
||||
|
||||
|
||||
return {};
|
||||
}
|
||||
static orbis::ErrorCode nsid_ctl_read(orbis::File *file, orbis::Uio *uio,
|
||||
orbis::Thread *thread) {
|
||||
ORBIS_LOG_TODO(__FUNCTION__);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::days(1));
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps fileOps = {
|
||||
.ioctl = nsid_ctl_ioctl,
|
||||
.read = nsid_ctl_read,
|
||||
};
|
||||
|
||||
struct NsidCtlDevice : 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<NsidCtlFile>();
|
||||
newFile->ops = &fileOps;
|
||||
newFile->device = this;
|
||||
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
IoDevice *createNsidCtlCharacterDevice() { return orbis::knew<NsidCtlDevice>(); }
|
||||
|
|
@ -434,6 +434,26 @@ static void guestInitDev() {
|
|||
if (orbis::g_context.fwType == orbis::FwType::Ps5) {
|
||||
vfs::addDevice("iccnvs4", createIccPowerCharacterDevice());
|
||||
vfs::addDevice("ajmi", createAjmCharacterDevice());
|
||||
vfs::addDevice("ssd0", createHddCharacterDevice(0x100000000));
|
||||
vfs::addDevice("nsid1.ctl", createNsidCtlCharacterDevice());
|
||||
vfs::addDevice("ssd0.swapx2", createHddCharacterDevice(0x100000000));
|
||||
vfs::addDevice("ssd0.bd_rvlist", createHddCharacterDevice(1048576));
|
||||
vfs::addDevice("ssd0.system", createHddCharacterDevice(671088640));
|
||||
vfs::addDevice("ssd0.system_ex", createHddCharacterDevice(1610612736));
|
||||
vfs::addDevice("ssd0.system_b", createHddCharacterDevice(671088640));
|
||||
vfs::addDevice("ssd0.system_ex_b", createHddCharacterDevice(1610612736));
|
||||
vfs::addDevice("ssd0.preinst", createHddCharacterDevice(155189248));
|
||||
vfs::addDevice("ssd0.app_temp0", createHddCharacterDevice(1073741824));
|
||||
// vfs::addDevice("ssd0.app_temp1", createHddCharacterDevice(1073741824));
|
||||
vfs::addDevice("ssd0.system_data", createHddCharacterDevice(8589934592));
|
||||
vfs::addDevice("ssd0.update", createHddCharacterDevice(4294967296));
|
||||
vfs::addDevice("ssd0.swap", createHddCharacterDevice(8589934592));
|
||||
vfs::addDevice("ssd0.app_swap", createHddCharacterDevice(15032385536));
|
||||
vfs::addDevice("ssd0.hibernation", createHddCharacterDevice(3623878656));
|
||||
vfs::addDevice("ssd0.user", createHddCharacterDevice(-41630302208)); /// ?????
|
||||
vfs::addDevice("ssd0.user_bfs", createHddCharacterDevice(0x100000000));
|
||||
vfs::addDevice("bfs/ctl", createHddCharacterDevice(0x100000000));
|
||||
vfs::addDevice("a53io", createA53IoCharacterDevice());
|
||||
}
|
||||
|
||||
// mbus->emitEvent({
|
||||
|
|
|
|||
Loading…
Reference in a new issue