Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sceKernelAioInitializeParam #208

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading