mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +00:00
More WIP
This commit is contained in:
parent
3cab8f2168
commit
50a46b4613
@ -7,6 +7,12 @@
|
|||||||
#include "urandom.h"
|
#include "urandom.h"
|
||||||
|
|
||||||
namespace Core::Devices {
|
namespace Core::Devices {
|
||||||
|
|
||||||
|
std::shared_ptr<BaseDevice> URandomDevice::Create(u32 handle, const char*, int, u16) {
|
||||||
|
return std::shared_ptr<BaseDevice>(
|
||||||
|
reinterpret_cast<Devices::BaseDevice*>(new URandomDevice(handle)));
|
||||||
|
}
|
||||||
|
|
||||||
int URandomDevice::ioctl(u64 cmd, Common::VaCtx* args) {
|
int URandomDevice::ioctl(u64 cmd, Common::VaCtx* args) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ class URandomDevice final : BaseDevice {
|
|||||||
u32 handle;
|
u32 handle;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static std::shared_ptr<BaseDevice> Create(u32 handle, const char*, int, u16);
|
||||||
explicit URandomDevice(u32 handle) : handle(handle) {}
|
explicit URandomDevice(u32 handle) : handle(handle) {}
|
||||||
|
|
||||||
~URandomDevice() override = default;
|
~URandomDevice() override = default;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "common/singleton.h"
|
#include "common/singleton.h"
|
||||||
#include "core/devices/logger.h"
|
#include "core/devices/logger.h"
|
||||||
#include "core/devices/nop_device.h"
|
#include "core/devices/nop_device.h"
|
||||||
|
#include "core/devices/urandom.h"
|
||||||
#include "core/file_sys/fs.h"
|
#include "core/file_sys/fs.h"
|
||||||
#include "core/libraries/kernel/file_system.h"
|
#include "core/libraries/kernel/file_system.h"
|
||||||
#include "core/libraries/kernel/orbis_error.h"
|
#include "core/libraries/kernel/orbis_error.h"
|
||||||
@ -41,6 +42,8 @@ static std::map<std::string, FactoryDevice> available_device = {
|
|||||||
{"/dev/deci_stderr", GET_DEVICE_FD(2)},
|
{"/dev/deci_stderr", GET_DEVICE_FD(2)},
|
||||||
|
|
||||||
{"/dev/null", GET_DEVICE_FD(0)}, // fd0 (stdin) is a nop device
|
{"/dev/null", GET_DEVICE_FD(0)}, // fd0 (stdin) is a nop device
|
||||||
|
|
||||||
|
{"/dev/urandom", &D::URandomDevice::Create }
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user