mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
implement cross process dmem support implement ipmi try send message implement sys_batch_map store saves to game directory (.rpcsx subfolder) fix get dir entries added uvd & vce devices
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#include "io-device.hpp"
|
|
#include "orbis/KernelAllocator.hpp"
|
|
#include "orbis/uio.hpp"
|
|
#include <span>
|
|
|
|
struct NullDevice : public IoDevice {
|
|
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
|
std::uint32_t flags, std::uint32_t mode,
|
|
orbis::Thread *thread) override;
|
|
};
|
|
struct NullFile : public orbis::File {};
|
|
|
|
static orbis::ErrorCode null_write(orbis::File *file, orbis::Uio *uio,
|
|
orbis::Thread *) {
|
|
for (auto entry : std::span(uio->iov, uio->iovcnt)) {
|
|
uio->offset += entry.len;
|
|
}
|
|
return {};
|
|
}
|
|
|
|
static const orbis::FileOps ops = {
|
|
.write = null_write,
|
|
};
|
|
|
|
orbis::ErrorCode NullDevice::open(orbis::Ref<orbis::File> *file,
|
|
const char *path, std::uint32_t flags,
|
|
std::uint32_t mode, orbis::Thread *thread) {
|
|
auto newFile = orbis::knew<NullFile>();
|
|
newFile->device = this;
|
|
newFile->ops = &ops;
|
|
*file = newFile;
|
|
return {};
|
|
}
|
|
|
|
IoDevice *createNullCharacterDevice() { return orbis::knew<NullDevice>(); }
|