[Kernel] Implement GetSystemTick

This commit is contained in:
wheremyfoodat 2022-09-21 00:48:51 +03:00
parent 5bcdf4d063
commit cbefe3c2d0
4 changed files with 19 additions and 0 deletions

View file

@ -26,6 +26,7 @@ void Kernel::serviceSVC(u32 svc) {
case 0x22: arbitrateAddress(); break;
case 0x23: svcCloseHandle(); break;
case 0x24: waitSynchronization1(); break;
case 0x28: getSystemTick(); break;
case 0x2D: connectToPort(); break;
case 0x32: sendSyncRequest(); break;
case 0x38: getResourceLimit(); break;
@ -108,6 +109,15 @@ void Kernel::svcCloseHandle() {
regs[0] = SVCResult::Success;
}
// u64 GetSystemTick()
void Kernel::getSystemTick() {
printf("GetSystemTick()\n");
u64 ticks = cpu.getTicks();
regs[0] = u32(ticks);
regs[1] = u32(ticks >> 32);
}
// Result OutputDebugString(const char* str, s32 size)
// TODO: Does this actually write an error code in r0 and is the above signature correct?
void Kernel::outputDebugString() {