mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-09 00:14:56 +00:00
Initial kernel allocator
This commit is contained in:
parent
0f76e72de1
commit
d7a34f0904
25 changed files with 247 additions and 144 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
|
||||
struct StdinDevice : public IoDevice {
|
||||
};
|
||||
|
|
@ -14,7 +15,7 @@ static std::int64_t stdin_instance_read(IoDeviceInstance *instance, void *data,
|
|||
static std::int32_t open(IoDevice *device, orbis::Ref<IoDeviceInstance> *instance,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode) {
|
||||
auto *newInstance = new StdinInstance{};
|
||||
auto *newInstance = orbis::knew<StdinInstance>();
|
||||
newInstance->read = stdin_instance_read;
|
||||
io_device_instance_init(device, newInstance);
|
||||
*instance = newInstance;
|
||||
|
|
@ -22,7 +23,7 @@ static std::int32_t open(IoDevice *device, orbis::Ref<IoDeviceInstance> *instanc
|
|||
}
|
||||
|
||||
IoDevice *createStdinCharacterDevice() {
|
||||
auto *newDevice = new StdinDevice();
|
||||
auto *newDevice = orbis::knew<StdinDevice>();
|
||||
newDevice->open = open;
|
||||
return newDevice;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue