diff --git a/orbis-kernel/include/orbis/sys/sysproto.hpp b/orbis-kernel/include/orbis/sys/sysproto.hpp index 74dba9436..804cb5c61 100644 --- a/orbis-kernel/include/orbis/sys/sysproto.hpp +++ b/orbis-kernel/include/orbis/sys/sysproto.hpp @@ -720,9 +720,8 @@ SysResult sys_get_paging_stats_of_all_objects(Thread *thread /* TODO */); SysResult sys_test_debug_rwmem(Thread *thread /* TODO */); SysResult sys_free_stack(Thread *thread /* TODO */); SysResult sys_suspend_system(Thread *thread /* TODO */); -SysResult sys_ipmimgr_call(Thread *thread, uint64_t id, uint64_t arg2, - ptr result, ptr params, - uint64_t arg5, uint64_t arg6); +SysResult sys_ipmimgr_call(Thread *thread, uint op, uint kid, ptr result, + ptr params, uint64_t paramsz, uint64_t arg6); SysResult sys_get_gpo(Thread *thread /* TODO */); SysResult sys_get_vm_map_timestamp(Thread *thread /* TODO */); SysResult sys_opmc_set_hw(Thread *thread /* TODO */); diff --git a/orbis-kernel/src/sys/sys_sce.cpp b/orbis-kernel/src/sys/sys_sce.cpp index 0e50732bc..e213b21db 100644 --- a/orbis-kernel/src/sys/sys_sce.cpp +++ b/orbis-kernel/src/sys/sys_sce.cpp @@ -737,7 +737,14 @@ orbis::SysResult orbis::sys_suspend_system(Thread *thread /* TODO */) { return ErrorCode::NOSYS; } -enum ImpiOpcode { kIpmiCreateClient = 2 }; +enum ImpiOpcode { + kImpiCreateServer = 0, + kImpiDestroyServer = 1, + kIpmiCreateClient = 2, + kImpiDestroyClient = 3, + kImpiCreateSession = 4, + kImpiDestroySession = 5, +}; struct IpmiCreateClientParams { orbis::ptr arg0; @@ -747,39 +754,47 @@ struct IpmiCreateClientParams { static_assert(sizeof(IpmiCreateClientParams) == 0x18); -orbis::SysResult orbis::sys_ipmimgr_call(Thread *thread, uint64_t id, - uint64_t arg2, ptr result, - ptr params, - uint64_t paramsSize, uint64_t arg6) { - std::printf("TODO: sys_ipmimgr_call(id = %lld)\n", (unsigned long long)id); +orbis::SysResult orbis::sys_ipmimgr_call(Thread *thread, uint op, uint kid, + ptr result, ptr params, + uint64_t paramsSz, uint64_t arg6) { + ORBIS_LOG_TODO("sys_ipmimgr_call", op, kid, result, params, paramsSz, arg6); - if (id == kIpmiCreateClient) { - if (paramsSize != sizeof(IpmiCreateClientParams)) { + if (op == kIpmiCreateClient) { + if (paramsSz != sizeof(IpmiCreateClientParams)) { return ErrorCode::INVAL; } auto createParams = (ptr)params; - std::printf("ipmi create client(%p, '%s', %p)\n", - (void *)createParams->arg0, (char *)createParams->name, - (void *)createParams->arg2); - + ORBIS_LOG_TODO("IPMI: create client", createParams->arg0, + createParams->name, createParams->arg2); + uwrite(result, 0x1); + thread->retval[0] = 0; return {}; } - if (id == 1131 || id == 1024 || id == 800) { + if (op == kImpiDestroyClient) { + ORBIS_LOG_TODO("IPMI: destroy client"); + if (result) + uwrite(result, 0); + thread->retval[0] = 0; + return {}; + } + + if (op == 0x400) { + ORBIS_LOG_TODO("IMPI: connect?"); + if (result) + uwrite(result, 0); + thread->retval[0] = 0; + return {}; + } + + if (op == 1131 || op == 1024 || op == 800) { thread->retval[0] = -0x40004; // HACK return {}; // return -0x40004; } - if (id == 3) { - if (result) { - *result = 0; - } - return {}; - } - return {}; } orbis::SysResult orbis::sys_get_gpo(Thread *thread /* TODO */) {