Skip to content

Commit

Permalink
sceKernelAioInitializeParam (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ordinary205 authored Apr 2, 2024
1 parent 72a5a16 commit ad0b024
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
52 changes: 52 additions & 0 deletions kernel/ps4_kernel_file.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

2 changes: 2 additions & 0 deletions kernel/ps4_libkernel.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad0b024

Please sign in to comment.