From ad0b0240a8ac472d6ac3f81b707e5d66aba3dc07 Mon Sep 17 00:00:00 2001 From: Ordinary205 <125112932+Ordinary205@users.noreply.github.com> Date: Wed, 3 Apr 2024 00:45:28 +0400 Subject: [PATCH] sceKernelAioInitializeParam (#208) --- kernel/ps4_kernel_file.pas | 52 ++++++++++++++++++++++++++++++++++++++ kernel/ps4_libkernel.pas | 2 ++ 2 files changed, 54 insertions(+) diff --git a/kernel/ps4_kernel_file.pas b/kernel/ps4_kernel_file.pas index b9d4dd4c..4addcf4b 100644 --- a/kernel/ps4_kernel_file.pas +++ b/kernel/ps4_kernel_file.pas @@ -14,6 +14,37 @@ interface Classes, SysUtils; +const + SCE_KERNEL_AIO_DISABLE_SPLIT=0; + SCE_KERNEL_AIO_ENABLE_SPLIT =1; + + SCE_KERNEL_AIO_SCHED_WINDOW_MAX =128; + SCE_KERNEL_AIO_DELAYED_COUNT_MAX =128; + SCE_KERNEL_AIO_SPLIT_SIZE_MAX =$1000000; + SCE_KERNEL_AIO_SPLIT_CHUNK_SIZE_MAX=$1000000; + + SCE_KERNEL_AIO_SCHED_WINDOW_DEFAULT =32; + SCE_KERNEL_AIO_DELAYED_COUNT_DEFAULT =32; + SCE_KERNEL_AIO_SPLIT_SIZE_DEFAULT =$100000; + SCE_KERNEL_AIO_SPLIT_CHUNK_SIZE_DEFAULT=$100000; + +type + pSceKernelAioSchedulingParam=^SceKernelAioSchedulingParam; + SceKernelAioSchedulingParam=packed record + schedulingWindowSize:Integer; + delayedCountLimit :Integer; + enableSplit :DWORD; + splitSize :DWORD; + splitChunkSize :DWORD; + end; + + pSceKernelAioParam=^SceKernelAioParam; + SceKernelAioParam=packed record + low :SceKernelAioSchedulingParam; + mid :SceKernelAioSchedulingParam; + high:SceKernelAioSchedulingParam; + end; + function ps4_open(path:PChar;flags,mode:Integer):Integer; SysV_ABI_CDecl; function ps4_sceKernelOpen(path:PChar;flags,mode:Integer):Integer; SysV_ABI_CDecl; @@ -91,6 +122,8 @@ function ps4_access(path:PChar;mode:Integer):Integer; SysV_ABI_CDecl; function ps4_getdtablesize:Integer; SysV_ABI_CDecl; function ps4_sceKernelGetFsSandboxRandomWord:PChar; SysV_ABI_CDecl; +procedure ps4_sceKernelAioInitializeParam(param:pSceKernelAioParam); SysV_ABI_CDecl; + implementation uses @@ -1267,5 +1300,24 @@ function ps4_sceKernelGetFsSandboxRandomWord:PChar; SysV_ABI_CDecl; Result:=fs_word; end; +procedure ps4_sceKernelAioInitializeParam(param:pSceKernelAioParam); SysV_ABI_CDecl; +begin + param^.low.schedulingWindowSize :=$20; + param^.low.delayedCountLimit :=$20; + param^.low.enableSplit :=1; + param^.low.splitSize :=$100000; + param^.low.splitChunkSize :=$100000; + param^.mid.schedulingWindowSize :=$20; + param^.mid.delayedCountLimit :=$20; + param^.mid.enableSplit :=1; + param^.mid.splitSize :=$100000; + param^.mid.splitChunkSize :=$100000; + param^.high.schedulingWindowSize:=$20; + param^.high.delayedCountLimit :=$20; + param^.high.enableSplit :=0; + param^.high.splitSize :=0; + param^.high.splitChunkSize :=0; +end; + end. diff --git a/kernel/ps4_libkernel.pas b/kernel/ps4_libkernel.pas index 377d5246..b97816e1 100644 --- a/kernel/ps4_libkernel.pas +++ b/kernel/ps4_libkernel.pas @@ -1972,6 +1972,8 @@ function Load_libkernel(Const name:RawByteString):TElf_node; lib^.set_proc($B19BB06833C04CAB,@ps4_getdtablesize); lib^.set_proc($2467D330139D509A,@ps4_sceKernelGetFsSandboxRandomWord); + lib^.set_proc($9EEE1AD3F6AB422B,@ps4_sceKernelAioInitializeParam); + //file //socket