Editing Syscalls

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
<!--// todo : needs to be tabled like the PS3 one
<!--// todo : needs to be tabled like the PS3 one  
  http://fxr.watson.org/fxr/source/sys/syscall.h?v=FREEBSD-9-1
  http://fxr.watson.org/fxr/source/sys/syscall.h?v=FREEBSD9
http://fxr.watson.org/fxr/source/kern/syscalls.master?v=FREEBSD9
//-->
//-->
The PS4 kernel is based on FreeBSD 9.0; a list of standard FreeBSD 9.0 system calls can be found [http://fxr.watson.org/fxr/source/kern/syscalls.master?v=FREEBSD9 here].


The PS4 kernel is based on FreeBSD 9, hence why PS4 has many syscalls in common with standard FreeBSD. However, some syscalls from FreeBSD are missing or disabled, and some custom syscalls have been added. A list of standard FreeBSD 9.1 syscalls can be found on[http://fxr.watson.org/fxr/source/sys/syscall.h?v=FREEBSD-9-1 watson.org FreeBSD headers].
Compatibility system calls, and some others, have been disabled. The first custom Sony system call comes at number 99, though most after the last FreeBSD system call, wait6, and is number 532. Currently, the last known custom Sony system call is 672. Calling any system calls higher than 672 gives the same result as calling a compatibility or unimplemented system call, a "There is not enough free system memory" error/segfault.


Compatibility (for 32-bit on 64-bit) syscalls, and some others, have been disabled. The first custom Sony syscall comes at number 99. But PS4 specific syscalls come after the last FreeBSD 9.1 syscall, posix_fadvise, syscall 531. Currently, the last custom Sony syscall ID is 677 (as of FW 6.51). Calling any syscall with ID higher than 677 gives the same result as calling a compatibility or unimplemented syscall: a "There is not enough free system memory" error/segfault.
Of these 85 explored system calls in 1.76 (532 - 617):


As of FW 1.76, of the 85 explored sony syscalls (532 - 617):
* Two will not be implemented in retail units (possibly in devkits though) and return 0x4E ENOSYS, being sys_dynlib_dlopen and sys_dl_notify_event
* Two will not be implemented in retail units (possibly in DevKits though) and return 0x4E ENOSYS, being sys_dynlib_dlopen and sys_dl_notify_event
* Eight will return 0x4E ENOSYS should the caller be lacking credentials (td->td_proc->p_ucred)
* Eight will return 0x4E ENOSYS should the caller be lacking credentials (td->td_proc->p_ucred)
* Four will return 0x4E ENOSYS should the caller have insufficient privileges (uid0)
* Four will return 0x4E ENOSYS should the caller have insufficient privileges (uid0)
* Three will return 0x01 EPERM should the caller have insufficient privileges (uid0)
* Three will return 0x01 EPERM should the caller have insufficient privileges (uid0)
* One explicitly requires to run a PS4 DevKit (sys_set_gpo), as it sets output to debug LEDs that only development kit units have.
* One explicitly requires a development kit (sys_set_gpo), as it sets output to components that only development kit units have.


== Reverse engineering ==
As of firmware version 3.55 there is evidence of new syscalls!
 
Syscalls are mostly called by libkernel.sprx that exports wrappers to application. For example libkernel exports sceIoOpen function that is a wrapper to sys_open syscall.


https://i.gyazo.com/aa2bceacf5e5f45a15495fcdb79585cb.png
https://i.gyazo.com/aa2bceacf5e5f45a15495fcdb79585cb.png


You can find an IDA Pro .idc script made by Cloverleafswag3 to label syscalls in libkernel [http://pastebin.com/xch7pb2H here]
You can find an IDA Pro .idc script made by Cloverleafswag3 to label system calls in libkernel [http://pastebin.com/xch7pb2H here]
An updated, janky, hacky version by X41 can be found [https://pastebin.com/2UWVj1N3 here]
An updated, janky, hacky version by X41 can be found [https://pastebin.com/2UWVj1N3 here]


== Functions of PS4 custom syscalls ==
== Functions of custom Sony system calls ==


Known calls include those relating to:
# Modules
# Modules
# Memory
# Memory
# Process sandbox
# Sandboxing
# Semaphores, ?mutexes?
# Semaphores


Other operations, such as file I/O and networking are handled through the standard FreeBSD 9.0 syscalls.
Other potential calls could be for:
# Mutexes


== PS4 custom syscalls ==
Other operations, such as file I/O and networking are handled through the standard FreeBSD 9.0 system calls which can be found linked above.


* Syscalls prototypes in the following table are for usermode interface. If it was kernel interface, the prototypes would have a thread pointer and a uap pointer:
== Public system calls ==
<source>sys_xxx(struct thread* td, struct xxx_args* uap);</source>


{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
! Syscall ID !! <abbr title="Firmware Version">PS4 FW Version</abbr> !! Syscall name !! Syscall usermode prototype !! Notes
! # !! <abbr title="Firmware Type">FW Type</abbr> !! <abbr title="Firmware Version">FW Ver</abbr> !! Name !! Prototype !! Notes
|-
| 99 || <=1.01? || sys_netcontrol || int sys_netcontrol(int ifindex, uint op, void *buf, uint nbuf) || Using invalid ifindex, ifp is null. Before PS4 12.00, the lack of mutexes allowed double free as fdrop is called unconditionally in bnet_netevent_unset_queue. See also PS Vita SceNetPs kernel module that uses similar bnet functions.
|-
| 101 || <=1.01? || sys_netabort || - || -
|-
|-
| 102 || <=1.01? || sys_netgetsockinfo || - || -
| 99 || ? || <=1.76? || sys_netcontrol || int sys_netcontrol(int fd, uint op, void *buf, uint nbuf) || -
|-
|-
| 113 || <=1.01? || sys_socketex || int sys_socketex(const char *name, int domain, int type, int protocol) || Like existing socket syscall, but with the addition of a name argument.
| 101 || ? || <=1.76? || sys_netabort || - || -
|-
|-
| 114 || <=1.01? || sys_socketclose || - || -
| 102 || ? || <=1.76? || sys_netgetsockinfo || - || -
|-
|-
| 125 || <=1.01? || sys_netgetiflist || - || -
| 113 || ? || <=1.76? || sys_socketex || int sys_socketex(const char *name, int domain, int type, int protocol) || Like existing socket syscall, but with the addition of a name argument.
|-
|-
| 141 || <=1.01? || sys_kqueueex || - || -
| 114 || ? || <=1.76? || sys_socketclose || - || -
|-
|-
| 379 || >1.01 <=1.76? || sys_mtypeprotect || - || -
| 125 || ? || <=1.76? || sys_netgetiflist || - || -
|-
|-
| 532 || <=1.76? || sys_regmgr_call || - || -
| 141 || ? || <=1.76? || sys_kqueueex || - || -
|-
|-
| 533 || <=1.01? || sys_jitshm_create || - || Only callable from a jit compiler process, else returns EPERM (0x1)
| 379 || ? || <=1.76? || sys_mtypeprotect || - || -
|-
|-
| 534 || <=1.01? || sys_jitshm_alias || - || Only callable from a jit compiler/application process, else returns EPERM (0x1)
| 532 || ? || <=1.76? || sys_regmgr_call || - || -
|-
|-
| 535 || <=1.01? || sys_dl_get_list || - || Only callable from a debugger, core dump, or syscore process, else returns EPERM (0x1)
| 533 || ? || <=1.76? || sys_jitshm_create || - || Only callable from a jit compiler process, else returns EPERM (0x1)
|-
|-
| 536 || <=1.01? || sys_dl_get_info || - || Only callable from a debugger, core dump, or syscore process, else returns EPERM (0x1)
| 534 || ? || <=1.76? || sys_jitshm_alias || - || Only callable from a jit compiler/application process, else returns EPERM (0x1)
|-
|-
| 537 || <=1.01? || sys_dl_notify_event || - || Always returns ENOSYS (0x4E) (may only be implemented in devkits)
| 535 || ? || <=1.76? || sys_dl_get_list || - || Only callable from a debugger, core dump, or syscore process, else returns EPERM (0x1)
|-
|-
| 538 || <=1.01? || sys_evf_create || int sys_evf_create(char* name, int flag, struct evFlag *evf) || -
| 536 || ? || <=1.76? || sys_dl_get_info || - || Only callable from a debugger, core dump, or syscore process, else returns EPERM (0x1)
|-
|-
| 539 || <=1.01? || sys_evf_delete || int sys_evf_delete(int id) || -
| 537 || ? || <=1.76? || sys_dl_notify_event || - || Always returns ENOSYS (0x4E) (may only be implemented in devkits)
|-
|-
| 540 || <=1.01? || sys_evf_open || int sys_evf_open(struct evFlag *evf) || -
| 538 || ? || <=1.76? || sys_evf_create || int sys_evf_create(char* name, int flag, struct evFlag *evf) || -
|-
|-
| 541 || <=1.01? || sys_evf_close || int sys_evf_close(int id) || -
| 539 || ? || <=1.76? || sys_evf_delete || int sys_evf_delete(int id) || -
|-
|-
| 542 || <=1.01? || sys_evf_wait || - || -
| 540 || ? || <=1.76? || sys_evf_open || int sys_evf_open(struct evFlag *evf) || -
|-
|-
| 543 || <=1.01? || sys_evf_trywait || - || -
| 541 || ? || <=1.76? || sys_evf_close || int sys_evf_close(int id) || -
|-
|-
| 544 || <=1.01? || sys_evf_set || int sys_evf_set(int id) || -
| 542 || ? || <=1.76? || sys_evf_wait || - || -
|-
|-
| 545 || <=1.01? || sys_evf_clear || int sys_evf_clear(int id) || -
| 543 || ? || <=1.76? || sys_evf_trywait || - || -
|-
|-
| 546 || <=1.01? || sys_evf_cancel || int sys_evf_cancel(int id) || -
| 544 || ? || <=1.76? || sys_evf_set || int sys_evf_set(int id) || -
|-
|-
| 547 || <=1.01? || sys_query_memory_protection || - || -
| 545 || ? || <=1.76? || sys_evf_clear || int sys_evf_clear(int id) || -
|-
|-
| 548 || <=1.01? || sys_batch_map || - || -
| 546 || ? || <=1.76? || sys_evf_cancel || int sys_evf_cancel(int id) || -
|-
|-
| 549 || <=1.01? || sys_osem_create || - || -
| 547 || ? || <=1.76? || sys_query_memory_protection || - || -
|-
|-
| 550 || <=1.01? || sys_osem_delete || - || -
| 548 || ? || <=1.76? || sys_batch_map || - || -
|-
|-
| 551 || <=1.01? || sys_osem_open || - || -
| 549 || ? || <=1.76? || sys_osem_create || - || -
|-
|-
| 552 || <=1.01? || sys_osem_close || - || -
| 550 || ? || <=1.76? || sys_osem_delete || - || -
|-
|-
| 553 || <=1.01? || sys_osem_wait || - || -
| 551 || ? || <=1.76? || sys_osem_open || - || -
|-
|-
| 554 || <=1.01? || sys_osem_trywait || - || -
| 552 || ? || <=1.76? || sys_osem_close || - || -
|-
|-
| 555 || <=1.01? || sys_osem_post || - || -
| 553 || ? || <=1.76? || sys_osem_wait || - || -
|-
|-
| 556 || <=1.01? || sys_osem_cancel || - || -
| 554 || ? || <=1.76? || sys_osem_trywait || - || -
|-
|-
| 557 || <=1.01? || sys_namedobj_create || - || -
| 555 || ? || <=1.76? || sys_osem_post || - || -
|-
|-
| 558 || <=1.01? || sys_namedobj_delete || - || -
| 556 || ? || <=1.76? || sys_osem_cancel || - || -
|-
|-
| 559 || <=1.01? || sys_set_vm_container || - || Successful call requires privileges (uid0), else returns EPERM (0x1)
| 557 || ? || <=1.76? || sys_namedobj_create || - || -
|-
|-
| 560 || <=1.01? || sys_debug_init || - || -
| 558 || ? || <=1.76? || sys_namedobj_delete || - || -
|-
|-
| 561 || <=1.01? || sys_suspend_process || int sys_suspend_process(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
| 559 || ? || <=1.76? || sys_set_vm_container || - || Successful call requires privileges (uid0), else returns EPERM (0x1)
|-
|-
| 562 || <=1.01? || sys_resume_process || int sys_resume_process(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
| 560 || ? || <=1.76? || sys_debug_init || - || -
|-
|-
| 563 || <=1.01? || sys_opmc_enable || - || -
| 561 || ? || <=1.76? || sys_suspend_process || int sys_suspend_process(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
|-
|-
| 564 || <=1.01? || sys_opmc_disable || - || -
| 562 || ? || <=1.76? || sys_resume_process || int sys_resume_process(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
|-
|-
| 565 || <=1.01? || sys_opmc_set_ctl || - || -
| 563 || ? || <=1.76? || sys_opmc_enable || - || -
|-
|-
| 566 || <=1.01? || sys_opmc_set_ctr || - || -
| 564 || ? || <=1.76? || sys_opmc_disable || - || -
|-
|-
| 567 || <=1.01? || sys_opmc_get_ctr || - || -
| 565 || ? || <=1.76? || sys_opmc_set_ctl || - || -
|-
|-
| 568 || <=1.01? || sys_budget_create || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 566 || ? || <=1.76? || sys_opmc_set_ctr || - || -
|-
|-
| 569 || <=1.01? || sys_budget_delete || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 567 || ? || <=1.76? || sys_opmc_get_ctr || - || -
|-
|-
| 570 || <=1.01? || sys_budget_get || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 568 || ? || <=1.76? || sys_budget_create || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 571 || <=1.01? || sys_budget_set || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 569 || ? || <=1.76? || sys_budget_delete || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 572 || <=1.01? || sys_virtual_query || int sys_virtual_query(uint64_t addr, uint64_t unk, void *info, uint64_t info_size) || -
| 570 || ? || <=1.76? || sys_budget_get || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 573 || <=1.01? || sys_mdbg_call || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 571 || ? || <=1.76? || sys_budget_set || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 574 || <=1.01? || sys_sblock_create || - || -
| 572 || ? || <=1.76? || sys_virtual_query || - || -
|-
|-
| 575 || <=1.01? || sys_sblock_delete || - || -
| 573 || ? || <=1.76? || sys_mdbg_call || - || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 576 || <=1.01? || sys_sblock_enter || - || -
| 574 || ? || <=1.76? || sys_sblock_create || - || -
|-
|-
| 577 || <=1.01? || sys_sblock_exit || - || -
| 575 || ? || <=1.76? || sys_sblock_delete || - || -
|-
|-
| 578 || <=1.01? || sys_sblock_xenter || - || -
| 576 || ? || <=1.76? || sys_sblock_enter || - || -
|-
|-
| 579 || <=1.01? || sys_sblock_xexit || - || -
| 577 || ? || <=1.76? || sys_sblock_exit || - || -
|-
|-
| 580 || <=1.01? || sys_eport_create || - || -
| 578 || ? || <=1.76? || sys_sblock_xenter || - || -
|-
|-
| 581 || <=1.01? || sys_eport_delete || - || -
| 579 || ? || <=1.76? || sys_sblock_xexit || - || -
|-
|-
| 582 || <=1.01? || sys_eport_trigger || - || -
| 580 || ? || <=1.76? || sys_eport_create || - || -
|-
|-
| 583 || <=1.01? || sys_eport_open || - || -
| 581 || ? || <=1.76? || sys_eport_delete || - || -
|-
|-
| 584 || <=1.01? || sys_eport_close || - || -
| 582 || ? || <=1.76? || sys_eport_trigger || - || -
|-
|-
| 585 || <=1.01? || sys_is_in_sandbox || - || -
| 583 || ? || <=1.76? || sys_eport_open || - || -
|-
|-
| 586 || <=1.01? || sys_dmem_container || - || Successful call requires privileges (uid0), else returns EPERM (0x1)
| 584 || ? || <=1.76? || sys_eport_close || - || -
|-
|-
| 587 || <=1.01? || sys_get_authinfo || - || Some functionality requires privileges (uid0)
| 585 || ? || <=1.76? || sys_is_in_sandbox || - || -
|-
|-
| 588 || <=1.01? || sys_mname || - || -
| 586 || ? || <=1.76? || sys_dmem_container || - || Successful call requires privileges (uid0), else returns EPERM (0x1)
|-
|-
| 589 || <=1.01? || sys_dynlib_dlopen || - || Always returns ENOSYS (0x4E) (may only be implemented in devkits)
| 587 || ? || <=1.76? || sys_get_authinfo || - || Some functionality requires privileges (uid0)
|-
|-
| 590 || <=1.01? || sys_dynlib_dlclose || - || -
| 588 || ? || <=1.76? || sys_mname || - || -
|-
|-
| 591 || <=1.01? || sys_dynlib_dlsym || int sys_dynlib_dlsym(SceKernelModule handle, const char *symbol, void **addrp) || -
| 589 || ? || <=1.76? || sys_dynlib_dlopen || - || Always returns ENOSYS (0x4E) (may only be implemented in devkits)
|-
|-
| 592 || <=1.01? || sys_dynlib_get_list || int sys_dynlib_get_list(SceKernelModule *pArray, size_t numArray, size_t * pActualNum) || -
| 590 || ? || <=1.76? || sys_dynlib_dlclose || - || -
|-
|-
| 593 || <=1.01? || sys_dynlib_get_info || int sys_dynlib_get_info(SceKernelModule handle, SceDbgModuleInfo *pInfo) || Sony has stripped module information since 1.76 FW (STO) *
| 591 || ? || <=1.76? || sys_dynlib_dlsym || int sys_dynlib_dlsym(int moduleHandle, char* functionName, int *destFuncOffset) || -
|-
|-
| 594 || <=1.01? || sys_dynlib_load_prx || int sys_dynlib_load_prx(const char *moduleFileName, size_t args, const void *argp, uint32_t flags, const SceKernelLoadModuleOpt *pOpt, int *pRes) || -
| 592 || ? || <=1.76? || sys_dynlib_get_list || int sys_dynlib_get_list(int *destModuleHandles, int max, int *count) || -
|-
|-
| 595 || <=1.01? || sys_dynlib_unload_prx || int sys_dynlib_unload_prx(SceKernelModule handle, size_t args, const void *argp, uint32_t flags, const SceKernelUnloadModuleOpt *pOpt, int *pRes) || -
| 593 || ? || <=1.76? || sys_dynlib_get_info || int sys_dynlib_get_info(int moduleHandle, int *destModuleInfo) || Sony has stripped module information since 1.76 FW (STO) *
|-
|-
| 596 || <=1.01? || sys_dynlib_do_copy_relocations || - || -
| 594 || ? || <=1.76? || sys_dynlib_load_prx || int sys_dynlib_load_prx(char* prxPath) || -
|-
|-
| 597 || <=1.01? || sys_dynlib_prepare_dlclose || - || Contains an exploitable integer overflow on FWs <= 1.76
| 595 || ? || <=1.76? || sys_dynlib_unload_prx || int sys_dynlib_unload_prx(int prxID) || -
|-
|-
| 598 || <=1.01? || sys_dynlib_get_proc_param || - || -
| 596 || ? || <=1.76? || sys_dynlib_do_copy_relocations || - || -
|-
|-
| 599 || <=1.01? || sys_dynlib_process_needed_and_relocate || - || -
| 597 || ? || <=1.76? || sys_dynlib_prepare_dlclose || - || Contains an exploitable integer overflow FW <= 1.76, patched FW >= 2.00 **
|-
|-
| 600 || <=1.01? || sys_sandbox_path || - || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
| 598 || ? || <=1.76? || sys_dynlib_get_proc_param || - || -
|-
|-
| 601 || <=1.01? || sys_mdbg_service || - || -
| 599 || ? || <=1.76? || sys_dynlib_process_needed_and_relocate || - || -
|-
|-
| 602 || <=1.01? || sys_randomized_path || - || Some functionality requires privileges (uid0)
| 600 || ? || <=1.76? || sys_sandbox_path || - || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
|-
|-
| 603 || <=1.01? || sys_rdup || - || Successful call requires privileges (uid0), else returns EPERM (0x1)
| 601 || ? || <=1.76? || sys_mdbg_service || - || -
|-
|-
| 604 || <=1.01? || sys_dl_get_metadata || - || Only callable from a debugger, core dump, or syscore process, else returns EPERM (0x1)
| 602 || ? || <=1.76? || sys_randomized_path || - || Some functionality requires privileges (uid0)
|-
|-
| 605 || <=1.01? || sys_workaround8849 || - || -
| 603 || ? || <=1.76? || sys_rdup || - || Successful call requires privileges (uid0), else returns EPERM (0x1)
|-
|-
| 606 || <=1.01? || sys_is_development_mode || - || -
| 604 || ? || <=1.76? || sys_dl_get_metadata || - || Only callable from a debugger, core dump, or syscore process, else returns EPERM (0x1)
|-
|-
| 607 || <=1.01? || sys_get_self_auth_info || - || -
| 605 || ? || <=1.76? || sys_workaround8849 || - || -
|-
|-
| 608 || <=1.01? || sys_dynlib_get_info_ex || int sys_dynlib_get_info_ex(int moduleHandle, struct Unk *unk, int *destModuleInfoEx) || -
| 606 || ? || <=1.76? || sys_is_development_mode || - || -
|-
|-
| 609 || <=1.01? || sys_budget_getid || int sys_budget_getid(void) || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 607 || ? || <=1.76? || sys_get_self_auth_info || - || -
|-
|-
| 610 || <=1.01? || sys_budget_get_ptype || int sys_budget_get_ptype(int budgetID) || -
| 608 || ? || <=1.76? || sys_dynlib_get_info_ex || int sys_dynlib_get_info_ex(int moduleHandle, struct Unk *unk, int *destModuleInfoEx) || -
|-
|-
| 611 || <=1.01? || sys_get_paging_stats_of_all_threads || - || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
| 609 || ? || <=1.76? || sys_budget_getid || int sys_budget_getid() // no arguments || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 612 || <=1.01? || sys_get_proc_type_info || int sys_get_proc_type_info(int *destProcessInfo) || Only callable from certain processes mainly involving media and JiT
| 610 || ? || <=1.76? || sys_budget_get_ptype || int sys_budget_get_ptype(int budgetID) || -
|-
|-
| 613 || >1.01 <=1.76? || sys_get_resident_count || int sys_get_resident_count(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 611 || ? || <=1.76? || sys_get_paging_stats_of_all_threads || - || Successful call requires credentials (td->td_proc->p_ucred), else returns EPERM (0x1)
|-
|-
| 614 || <=1.76? || sys_prepare_to_suspend_process || int sys_prepare_to_suspend_process(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
| 612 || ? || <=1.76? || sys_get_proc_type_info || int sys_get_proc_type_info(int *destProcessInfo) || Only callable from certain processes mainly involving media and JiT
|-
|-
| 615 || <=1.76? || sys_get_resident_fmem_count || int sys_get_resident_fmem_count(int pid) || Some functionality requires privileges (uid0)
| 613 || ? || <=1.76? || sys_get_resident_count || int sys_get_resident_count(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 616 || <=1.76? || sys_thr_get_name || int sys_thr_get_name(int threadID) || -
| 614 || ? || <=1.76? || sys_prepare_to_suspend_process || int sys_prepare_to_suspend_process(int pid) || Successful call requires credentials (td->td_proc->p_ucred), else returns ENOSYS (0x4E)
|-
|-
| 617 || <=1.76? || sys_set_gpo || - || Only callable on development kit (devkit) units
| 615 || ? || <=1.76? || sys_get_resident_fmem_count || int sys_get_resident_fmem_count(int pid) || Some functionality requires privileges (uid0)
|-
|-
| 618 || >1.76? || sys_get_paging_stats_of_all_objects || - ||  
| 616 || ? || <=1.76? || sys_thr_get_name || int sys_thr_get_name(int threadID) || -
|-
|-
| 619 || >1.76? || sys_test_debug_rwmem || - ||  
| 617 || ? || <=1.76? || sys_set_gpo || - || Only callable on development kit (devkit) units
|-
|-
| 620 || >1.76? || sys_free_stack || - ||  
| 618 || ? || >1.76? || sys_get_paging_stats_of_all_objects || - ||  
|-
|-
| 621 || >1.76? || sys_suspend_system || - ||  
| 619 || ? || >1.76? || sys_test_debug_rwmem || - ||  
|-
|-
| 622 || >1.76? || sys_ipmimgr_call || - ||  
| 620 || ? || >1.76? || sys_free_stack || - ||  
|-
|-
| 623 || >1.76? || sys_get_gpo || - ||  
| 621 || ? || >1.76? || sys_suspend_system || - ||  
|-
|-
| 624 || >1.76? || sys_get_vm_map_timestamp || - ||  
| 622 || ? || >1.76? || sys_ipmimgr_call || - ||  
|-
|-
| 625 || >1.76? || sys_opmc_set_hw || - ||  
| 623 || ? || >1.76? || sys_get_gpo || - ||  
|-
|-
| 626 || >1.76? || sys_opmc_get_hw || - ||  
| 624 || ? || >1.76? || sys_get_vm_map_timestamp || - ||  
|-
|-
| 627 || >1.76? || sys_get_cpu_usage_all || - ||  
| 625 || ? || >1.76? || sys_opmc_set_hw || - ||  
|-
|-
| 628 || >1.76? || sys_mmap_dmem || - ||  
| 626 || ? || >1.76? || sys_opmc_get_hw || - ||  
|-
|-
| 629 || >1.76? || sys_physhm_open || - ||  
| 627 || ? || >1.76? || sys_get_cpu_usage_all || - ||  
|-
|-
| 630 || >1.76? || sys_physhm_unlink || - ||  
| 628 || ? || >1.76? || sys_mmap_dmem || - ||  
|-
|-
| 631 || >1.76? || sys_resume_internal_hdd || - ||  
| 629 || ? || >1.76? || sys_physhm_open || - ||  
|-
|-
| 632 || >1.76? || sys_thr_suspend_ucontext || - ||  
| 630 || ? || >1.76? || sys_physhm_unlink || - ||  
|-
|-
| 633 || >1.76? || sys_thr_resume_ucontext || - ||  
| 631 || ? || >1.76? || sys_resume_internal_hdd || - ||  
|-
|-
| 634 || >1.76? || sys_thr_get_ucontext || - ||  
| 632 || ? || >1.76? || sys_thr_suspend_ucontext || - ||  
|-
|-
| 635 || >1.76? || sys_thr_set_ucontext || - ||  
| 633 || ? || >1.76? || sys_thr_resume_ucontext || - ||  
|-
|-
| 636 || >1.76? || sys_set_timezone_info || - ||  
| 634 || ? || >1.76? || sys_thr_get_ucontext || - ||  
|-
|-
| 637 || >1.76? || sys_set_phys_fmem_limit || - ||  
| 635 || ? || >1.76? || sys_thr_set_ucontext || - ||  
|-
|-
| 638 || >1.76? || sys_utc_to_localtime || - ||  
| 636 || ? || >1.76? || sys_set_timezone_info || - ||  
|-
|-
| 639 || >1.76? || sys_localtime_to_utc || - ||  
| 637 || ? || >1.76? || sys_set_phys_fmem_limit || - ||  
|-
|-
| 640 || >1.76? || sys_set_uevt || - ||  
| 638 || ? || >1.76? || sys_utc_to_localtime || - ||  
|-
|-
| 641 || >1.76? || sys_get_cpu_usage_proc || - ||  
| 639 || ? || >1.76? || sys_localtime_to_utc || - ||  
|-
|-
| 642 || >1.76? || sys_get_map_statistics || - ||  
| 640 || ? || >1.76? || sys_set_uevt || - ||  
|-
|-
| 643 || >1.76? || sys_set_chicken_switches || - ||  
| 641 || ? || >1.76? || sys_get_cpu_usage_proc || - ||  
|-
|-
| 644 || ?>4.05>3.55? || sys_extend_page_table_pool || int sys_extend_page_table_pool(void) ||  
| 642 || ? || >1.76? || sys_get_map_statistics || - ||  
|-
|-
| 645 || ?>4.05>3.55?? || sys_extend_page_table_pool2 || int sys_extend_page_table_pool2(void) || Duplicate of sys_extend_page_table_pool.
| 643 || ? || >1.76? || sys_set_chicken_switches || - ||  
|-
|-
| 646 || >1.76? || sys_get_kernel_mem_statistics || - ||  
| 644 || ? || >1.76? || sys_#644 || - ||  
|-
|-
| 647 || >1.76? || sys_get_sdk_compiled_version || - ||  
| 645 || ? || >1.76? || sys_#645 || - ||  
|-
|-
| 648 || >1.76? || sys_app_state_change || - ||  
| 646 || ? || >1.76? || sys_get_kernel_mem_statistics || - ||  
|-
|-
| 649 || >1.76? || sys_dynlib_get_obj_member || - ||  
| 647 || ? || >1.76? || sys_get_sdk_compiled_version || - ||  
|-
|-
| 650 || >1.76? || sys_budget_get_ptype_of_budget || - ||  
| 648 || ? || >1.76? || sys_app_state_change || - ||  
|-
|-
| 651 || >1.76? || sys_prepare_to_resume_process || - ||  
| 649 || ? || >1.76? || sys_dynlib_get_obj_member || - ||  
|-
|-
| 652 || >1.76? || sys_process_terminate || - ||  
| 650 || ? || >1.76? || sys_budget_get_ptype_of_budget || - ||  
|-
|-
| 653 || >1.76? || sys_blockpool_open || - ||  
| 651 || ? || >1.76? || sys_prepare_to_resume_process || - ||  
|-
|-
| 654 || >1.76? || sys_blockpool_map || - ||  
| 652 || ? || >1.76? || sys_process_terminate || - ||  
|-
|-
| 655 || >1.76? || sys_blockpool_unmap || - ||  
| 653 || ? || >1.76? || sys_blockpool_open || - ||  
|-
|-
| 656 || >1.76? || sys_dynlib_get_info_for_libdbg || - ||  
| 654 || ? || >1.76? || sys_blockpool_map || - ||  
|-
|-
| 657 || >1.76? || sys_blockpool_batch || - ||  
| 655 || ? || >1.76? || sys_blockpool_unmap || - ||  
|-
|-
| 658 || >1.76? || sys_fdatasync || - ||  
| 656 || ? || >1.76? || sys_dynlib_get_info_for_libdbg || - ||  
|-
|-
| 659 || >1.76? || sys_dynlib_get_list2 || - ||  
| 657 || ? || >1.76? || sys_blockpool_batch || - ||  
|-
|-
| 660 || >1.76? || sys_dynlib_get_info2 || - ||  
| 658 || ? || >1.76? || sys_fdatasync || - ||  
|-
|-
| 661 || >1.76? || sys_aio_submit || - ||  
| 659 || ? || >1.76? || sys_dynlib_get_list2 || - ||  
|-
|-
| 662 || >1.76? || sys_aio_multi_delete || - ||  
| 660 || ? || >1.76? || sys_dynlib_get_info2 || - ||  
|-
|-
| 663 || >1.76? || sys_aio_multi_wait || - ||  
| 661 || ? || >1.76? || sys_aio_submit || - ||  
|-
|-
| 664 || >1.76? || sys_aio_multi_poll || - ||  
| 662 || ? || >1.76? || sys_aio_multi_delete || - ||  
|-
|-
| 665 || >1.76? || sys_aio_get_data || - ||  
| 663 || ? || >1.76? || sys_aio_multi_wait || - ||  
|-
|-
| 666 || >1.76? || sys_aio_multi_cancel || - ||  
| 664 || ? || >1.76? || sys_aio_multi_poll || - ||  
|-
|-
| 667 || >1.76? || sys_get_bio_usage_all || - ||  
| 665 || ? || >1.76? || sys_aio_get_data || - ||  
|-
|-
| 668 || >1.76? || sys_aio_create || - ||  
| 666 || ? || >1.76? || sys_aio_multi_cancel || - ||  
|-
|-
| 669 || >1.76? || sys_aio_submit_cmd || - ||  
| 667 || ? || >1.76? || sys_get_bio_usage_all || - ||  
|-
|-
| 670 || >1.76? || sys_aio_init || - ||  
| 668 || ? || >1.76? || sys_aio_create || - ||  
|-
|-
| 671 || >1.76? || sys_get_page_table_stats || - ||  
| 669 || ? || >1.76? || sys_aio_submit_cmd || - ||  
|-
|-
| 672 || >1.76? || sys_dynlib_get_list_for_libdbg || - ||  
| 670 || ? || >1.76? || sys_aio_init || - ||  
|-
|-
| 673 || ?> 5.07? || sys_blockpool_move || - ||  
| 671 || ? || >1.76? || sys_get_page_table_stats || - ||  
|-
|-
| 674 || ?> 5.07? || sys_virtual_query_all || - ||
| 672 || ? || >1.76? || sys_dynlib_get_list_for_libdbg || - ||  
|-
| 675 || ?> 5.07? || sys_reserve_2mb_page || - ||  
|-
| 676 || ?> 5.07? || sys_cpumode_yield || - ||
|-
| 677 || ?>= 6.50? (not present on 6.20) || sys_get_phys_page_size || - || Not present in PS5 PS4EMU on PS5 FW 2.20.
|}
|}


<nowiki>*</nowiki> Since FW 1.76, Sony has removed key information from sys_dynlib_get_info() (syscall 593), eg. it does not return the module's code base address, data base address, code size, nor the data size.
<nowiki>*</nowiki> Since 1.76, Sony has removed key information from the sys_dynlib_get_info() system call, eg. it does not return the module's code base address, data base address, code size, or the data size.
 
<nowiki>**</nowiki> The second copyin() function failed to check boundaries, and therefore could result in an integer overflow. This was patched after it's usage in 1.76.


<b>Note:</b> All system calls actually have the thread pointer as the first argument (struct thread *td), however since it's common among all system calls it's been omitted for readability.


{{Reverse Engineering}}
{{Reverse Engineering}}
<noinclude>[[Category:Main]]</noinclude>
<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)