mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 23:15:18 +00:00
[orbis-kernel] evf: implement shared evf
Protect shared evfs with mutex Fixed memory leak on shared evf allocation Fixed set condition on wait Update RcIdMap usage to use new api
This commit is contained in:
parent
e613f09b6d
commit
800c1ffcdc
6 changed files with 50 additions and 22 deletions
|
|
@ -114,7 +114,7 @@ orbis::SysResult open(orbis::Thread *thread, orbis::ptr<const char> path,
|
|||
}
|
||||
|
||||
orbis::SysResult close(orbis::Thread *thread, orbis::sint fd) {
|
||||
if (!thread->tproc->fileDescriptors.remove(fd)) {
|
||||
if (!thread->tproc->fileDescriptors.close(fd)) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ static std::string ioctlToString(unsigned long arg) {
|
|||
|
||||
orbis::SysResult ioctl(orbis::Thread *thread, orbis::sint fd, orbis::ulong com,
|
||||
orbis::caddr_t argp) {
|
||||
std::printf("ioctl: %s\n", ioctlToString(com).c_str());
|
||||
std::printf("ioctl: %d %s\n", (int)fd, ioctlToString(com).c_str());
|
||||
|
||||
Ref<IoDeviceInstance> handle =
|
||||
static_cast<IoDeviceInstance *>(thread->tproc->fileDescriptors.get(fd));
|
||||
|
|
@ -248,6 +248,10 @@ orbis::SysResult ioctl(orbis::Thread *thread, orbis::sint fd, orbis::ulong com,
|
|||
return ErrorCode::BADF;
|
||||
}
|
||||
|
||||
if (handle->ioctl == nullptr) {
|
||||
return ErrorCode::NOTSUP;
|
||||
}
|
||||
|
||||
auto result = handle->ioctl(handle.get(), com, argp);
|
||||
|
||||
if (result < 0) {
|
||||
|
|
@ -411,7 +415,7 @@ orbis::SysResult dynlib_load_prx(orbis::Thread *thread,
|
|||
thread->tproc->ops->processNeeded(thread);
|
||||
auto result = module->relocate(thread->tproc);
|
||||
if (result.isError()) {
|
||||
thread->tproc->modulesMap.remove(module->id);
|
||||
thread->tproc->modulesMap.close(module->id);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue