hoc-sys: add emc patcher

This commit is contained in:
souldbminersmwc
2025-11-02 13:09:23 -05:00
parent 9f1c5570b2
commit 745ec1d9c8
8 changed files with 461 additions and 0 deletions

View File

@@ -31,6 +31,8 @@
#include "file_utils.h"
#include "errors.h"
#include "clock_manager.h"
#include "emc_patcher.h"
IpcService::IpcService(ClockManager* clockMgr)
{
std::int32_t priority;
@@ -189,6 +191,9 @@ Result IpcService::ServiceHandlerFunc(void* arg, const IpcServerRequest* r, u8*
return ipcSrv->SetReverseNXRTMode(mode);
}
break;
case HocClkIpcCmd_UpdateEMCRegs: // Trigger, not data
return ipcSrv->PatchEmcRegs();
break;
}
return SYSCLK_ERROR(Generic);
@@ -225,6 +230,7 @@ Result IpcService::Exit()
return 0;
}
Result IpcService::GetProfileCount(std::uint64_t* tid, std::uint8_t* out_count)
{
Config* config = this->clockMgr->GetConfig();
@@ -345,3 +351,9 @@ Result IpcService::SetReverseNXRTMode(ReverseNXMode mode) {
ClockManager::GetInstance()->SetRNXRTMode(mode);
return 0;
}
Result IpcService::PatchEmcRegs() {
EMCpatcher::GetInstance()->Run();
return 0;
}