mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
[orbis-kernel] impi: implement server ops
stub mkdir/rmdir syscalls
This commit is contained in:
parent
ca58c03eb6
commit
7ea6f3d91a
6 changed files with 76 additions and 6 deletions
|
|
@ -977,6 +977,19 @@ struct IpmiSyncCallParams {
|
|||
orbis::uint32_t resultCount;
|
||||
};
|
||||
|
||||
struct IpmiCreateServerParams {
|
||||
orbis::uint64_t arg0;
|
||||
orbis::ptr<char> name;
|
||||
orbis::uint64_t arg2;
|
||||
};
|
||||
|
||||
struct IpmiClientConnectParams {
|
||||
orbis::ptr<char> arg0;
|
||||
orbis::ptr<char> name;
|
||||
orbis::ptr<char> arg2;
|
||||
orbis::ptr<char> arg3;
|
||||
};
|
||||
|
||||
static_assert(sizeof(IpmiSyncCallParams) == 0x30);
|
||||
|
||||
orbis::SysResult orbis::sys_ipmimgr_call(Thread *thread, uint op, uint kid,
|
||||
|
|
@ -985,6 +998,36 @@ orbis::SysResult orbis::sys_ipmimgr_call(Thread *thread, uint op, uint kid,
|
|||
ORBIS_LOG_TODO("sys_ipmimgr_call", op, kid, result, params, paramsSz, arg6);
|
||||
thread->where();
|
||||
|
||||
if (op == kImpiCreateServer) {
|
||||
if (paramsSz != sizeof(IpmiCreateServerParams)) {
|
||||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
auto createParams = (ptr<IpmiCreateServerParams>)params;
|
||||
|
||||
ORBIS_LOG_TODO("IPMI: create server", createParams->arg0,
|
||||
createParams->name, createParams->arg2);
|
||||
|
||||
auto [server, inserted] = g_context.createIpmiServer(createParams->name);
|
||||
if (!inserted) {
|
||||
return ErrorCode::EXIST;
|
||||
}
|
||||
|
||||
auto id = thread->tproc->ipmiServerMap.insert(server);
|
||||
return uwrite<uint>(result, id);
|
||||
}
|
||||
|
||||
if (op == 0x10) {
|
||||
// IPMI server start?
|
||||
|
||||
return uwrite<uint>(result, 0);
|
||||
}
|
||||
|
||||
if (op == 0x201) {
|
||||
// IPMI server receive packet?
|
||||
return uwrite<uint>(result, 0x80020023);
|
||||
}
|
||||
|
||||
if (op == kIpmiCreateClient) {
|
||||
if (paramsSz != sizeof(IpmiCreateClientParams)) {
|
||||
return ErrorCode::INVAL;
|
||||
|
|
@ -1029,7 +1072,13 @@ orbis::SysResult orbis::sys_ipmimgr_call(Thread *thread, uint op, uint kid,
|
|||
}
|
||||
|
||||
if (op == 0x400) {
|
||||
ORBIS_LOG_TODO("IMPI: connect?");
|
||||
if (paramsSz != sizeof(IpmiClientConnectParams)) {
|
||||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
auto connectParams = (ptr<IpmiClientConnectParams>)params;
|
||||
ORBIS_LOG_TODO("IMPI: connect?", connectParams->arg0, connectParams->name,
|
||||
connectParams->arg2, connectParams->arg3);
|
||||
if (result) {
|
||||
return uwrite<uint>(result, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,13 +292,32 @@ orbis::SysResult orbis::sys_renameat(Thread *thread, sint oldfd, ptr<char> old,
|
|||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_mkdir(Thread *thread, ptr<char> path, sint mode) {
|
||||
if (auto mkdir = thread->tproc->ops->mkdir) {
|
||||
return mkdir(thread, path, mode);
|
||||
}
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_mkdirat(Thread *thread, sint fd, ptr<char> path,
|
||||
mode_t mode) {
|
||||
return ErrorCode::NOSYS;
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
||||
auto mkdir = file->ops->mkdir;
|
||||
|
||||
if (mkdir == nullptr) {
|
||||
return ErrorCode::NOTSUP;
|
||||
}
|
||||
std::lock_guard lock(file->mtx);
|
||||
|
||||
return mkdir(file.get(), path, mode);
|
||||
}
|
||||
|
||||
orbis::SysResult orbis::sys_rmdir(Thread *thread, ptr<char> path) {
|
||||
if (auto rmdir = thread->tproc->ops->rmdir) {
|
||||
return rmdir(thread, path);
|
||||
}
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_getdirentries(Thread *thread, sint fd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue