From 110109bac4ce028d1fec820692cccddb7498155c Mon Sep 17 00:00:00 2001 From: red-prig Date: Fri, 14 Apr 2023 22:16:29 +0300 Subject: [PATCH] sceKernelClockGetres --- kernel/ps4_libkernel.pas | 3 +++ kernel/ps4_time.pas | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/kernel/ps4_libkernel.pas b/kernel/ps4_libkernel.pas index 5431f2b..cedfddc 100644 --- a/kernel/ps4_libkernel.pas +++ b/kernel/ps4_libkernel.pas @@ -1645,6 +1645,9 @@ begin lib^.set_proc($9FCF2FC770B99D6F,@ps4_gettimeofday); lib^.set_proc($B26223EDEAB3644F,@ps4_clock_getres); lib^.set_proc($94B313F6F240724D,@ps4_clock_gettime); + + lib^.set_proc($C1161503966896CA,@ps4_sceKernelClockGetres); + lib^.set_proc($7A37A471A35036AD,@ps4_sceKernelGettimeofday); lib^.set_proc($90E7277ABCA99D00,@ps4_sceKernelGettimezone); diff --git a/kernel/ps4_time.pas b/kernel/ps4_time.pas index 5cb3a47..3074bbc 100644 --- a/kernel/ps4_time.pas +++ b/kernel/ps4_time.pas @@ -36,6 +36,8 @@ function ps4_gettimeofday(tv:Ptimeval;tz:Ptimezone):Integer; SysV_ABI_CDecl; function ps4_clock_getres(clock_id:Integer;tp:Ptimespec):Integer; SysV_ABI_CDecl; function ps4_clock_gettime(clock_id:Integer;tp:Ptimespec):Integer; SysV_ABI_CDecl; +function ps4_sceKernelClockGetres(clock_id:Integer;tp:Ptimespec):Integer; SysV_ABI_CDecl; + function ps4_sceKernelGettimeofday(tv:Ptimeval):Integer; SysV_ABI_CDecl; function ps4_sceKernelGettimezone(tz:Ptimezone):Integer; SysV_ABI_CDecl; @@ -173,7 +175,8 @@ end; function ps4_sceKernelSettimeofday(tv:Ptimeval;tz:Ptimezone):Integer; SysV_ABI_CDecl; begin - Result:=_set_errno(px2sce(EPERM)); + _set_errno(EPERM); + Result:=px2sce(EPERM); end; function ps4_clock_getres(clock_id:Integer;tp:Ptimespec):Integer; SysV_ABI_CDecl; @@ -214,6 +217,15 @@ begin end; +function ps4_sceKernelClockGetres(clock_id:Integer;tp:Ptimespec):Integer; SysV_ABI_CDecl; +begin + Result:=ps4_clock_getres(clock_id,tp); + if (Result<>0) then + begin + Result:=px2sce(PInteger(_error)^); + end; +end; + function mul_div_u64(m,d,v:QWORD):QWORD; sysv_abi_default; assembler; nostackframe; asm movq v,%rax