From 91dd175d6bf8c302cb7e8d44801d0be8d828b8f8 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Tue, 7 May 2024 16:28:42 +0300 Subject: [PATCH] added sceKernelGetTscFrequency --- src/core/libraries/kernel/file_system.cpp | 1 - src/core/libraries/kernel/time_management.cpp | 5 +++++ src/core/libraries/kernel/time_management.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 1321a1bc..a2dfcbc1 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -34,7 +34,6 @@ int PS4_SYSV_ABI sceKernelOpen(const char* path, int flags, u16 mode) { if (directory) { UNREACHABLE(); // not supported yet } else { - // only open files support! u32 handle = h->CreateHandle(); auto* file = h->GetFile(handle); file->m_guest_name = path; diff --git a/src/core/libraries/kernel/time_management.cpp b/src/core/libraries/kernel/time_management.cpp index 2e3d8896..f32e2b8e 100644 --- a/src/core/libraries/kernel/time_management.cpp +++ b/src/core/libraries/kernel/time_management.cpp @@ -10,6 +10,10 @@ namespace Libraries::Kernel { static u64 initial_ptc; static std::unique_ptr clock; +u64 PS4_SYSV_ABI sceKernelGetTscFrequency() { + return clock->GetTscFrequency(); +} + u64 PS4_SYSV_ABI sceKernelGetProcessTime() { return clock->GetProcessTimeUS(); } @@ -34,6 +38,7 @@ void timeSymbolsRegister(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("BNowx2l588E", "libkernel", 1, "libkernel", 1, 1, sceKernelGetProcessTimeCounterFrequency); LIB_FUNCTION("-2IRUCO--PM", "libkernel", 1, "libkernel", 1, 1, sceKernelReadTsc); + LIB_FUNCTION("1j3S3n-tTW4", "libkernel", 1, "libkernel", 1, 1, sceKernelGetTscFrequency); } } // namespace Libraries::Kernel diff --git a/src/core/libraries/kernel/time_management.h b/src/core/libraries/kernel/time_management.h index 91436195..ad420f7c 100644 --- a/src/core/libraries/kernel/time_management.h +++ b/src/core/libraries/kernel/time_management.h @@ -11,6 +11,7 @@ class SymbolsResolver; namespace Libraries::Kernel { +u64 PS4_SYSV_ABI sceKernelGetTscFrequency(); u64 PS4_SYSV_ABI sceKernelGetProcessTime(); u64 PS4_SYSV_ABI sceKernelGetProcessTimeCounter(); u64 PS4_SYSV_ABI sceKernelGetProcessTimeCounterFrequency();