Difference between revisions of "SceSysmem"

From Vita Development Wiki
Jump to navigation Jump to search
Line 1: Line 1:
SceSysmem is a kernel module that acts as the heart of the kernel. It exports multiple libraries for different functionalities (one of the few modules that do so). SceSysmem is the first module that is loaded in the [[Boot Sequence|kernel load sequence]] and its libraries are imported by almost all other modules. See [[Memory]] for more details on the memory subsystem.
+
SceSysmem is a kernel module that acts as the heart of the kernel. It exports multiple libraries for various features. SceSysmem is the first module that is loaded in the [[Boot Sequence|kernel load sequence]] and its libraries are imported by almost all other modules. See [[Virtual Memory]] and [[Physical Memory]] for more details on the memory subsystem.
  
 
== Module ==
 
== Module ==
 
This module exists in both non-secure and secure world. The non-secure world SELF can be found in <code>os0:kd/sysmem.skprx</code>. It also can be found in the [[Boot Sequence|Boot Image]].
 
This module exists in both non-secure and secure world. The non-secure world SELF can be found in <code>os0:kd/sysmem.skprx</code>. It also can be found in the [[Boot Sequence|Boot Image]].
  
=== Known NIDs ===
 
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Version !! World !! Privilege
 
|-
 
|-
! Version !! Name !! World !! Privilege !! NID
+
| 1.50-3.61 || Non-secure || Kernel
|-
 
| 1.69 || SceSysmem || Non-secure || Kernel || 0xB93950C6
 
|-
 
| 3.60 || SceSysmem || ? || Kernel || 0x3380B323
 
|-
 
| 3.61 || SceSysmem || Non-secure || Kernel || 0x3380B323
 
 
|-
 
|-
| 1.69 || SceSysmem || Secure || Kernel || 0x502BE0E5
+
| 1.69-1.80 || Secure || Kernel
 
|}
 
|}
  
 
== Libraries ==
 
== Libraries ==
This module only exports kernel libraries.
 
  
 
=== Known NIDs ===
 
=== Known NIDs ===
 
{| class="wikitable"
 
{| class="wikitable"
|-
 
 
! Version !! Name !! World !! Visibility !! NID
 
! Version !! Name !! World !! Visibility !! NID
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysmemForKernel|SceSysmemForKernel]] || Non-secure || Kernel || 0x63A519E5
+
| 1.50-3.60 || [[SceSysmem#SceSysmemForKernel|SceSysmemForKernel]] || Non-secure || Kernel || 0x63A519E5
 
|-
 
|-
| 3.60 || [[SceSysmem#SceSysmemForKernel|SceSysmemForKernel]] || ? || Kernel || 0x63A519E5
+
| 3.65 || [[SceSysmem#SceSysmemForKernel|SceSysmemForKernel]] || Non-secure || Kernel || 0x02451F0F
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysmemForDriver|SceSysmemForDriver]] || Non-secure || Kernel || 0x6F25E18A
+
| 1.50-3.60 || [[SceSysmem#SceSysmemForDriver|SceSysmemForDriver]] || Non-secure || Kernel || 0x6F25E18A
 
|-
 
|-
| 3.60 || [[SceSysmem#SceSysmemForDriver|SceSysmemForDriver]] || ? || Kernel || 0x6F25E18A
+
| 1.50-1.692 || [[SceSysmem#SceSysmemForDebugger|SceSysmemForDebugger]] || Non-secure || Kernel || 0xC7309957
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysmem|SceSysmem]] || Non-secure || User || 0x37FE725A
+
| 1.50-3.60 || [[SceSysmem#SceSysmem|SceSysmem]] || Non-secure || User || 0x37FE725A
 
|-
 
|-
| 3.60 || [[SceSysmem#SceSysmem|SceSysmem]] || ? || User || 0x37FE725A
+
| 1.50-3.60 || [[SceSysmem#SceDipsw|SceDipsw]] || Non-secure || User || 0xB36D5922
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysmemForDebugger|SceSysmemForDebugger]] || Non-secure || Kernel || 0xC7309957
+
| 1.50-3.60 || [[SceSysmem#SceDipswForDriver|SceDipswForDriver]] || Non-secure || Kernel || 0xC9E26388
 
|-
 
|-
| 1.69 || [[SceSysmem#SceDipsw|SceDipsw]] || Non-secure || User || 0xB36D5922
+
| 1.50-3.60 || [[SceSysmem#SceUartForKernel|SceUartForKernel]] || Non-secure || Kernel || 0xC03DBE40
 
|-
 
|-
| 3.60 || [[SceSysmem#SceDipsw|SceDipsw]] || ? || User || 0xB36D5922
+
| 1.50-3.60 || [[SceSysmem#SceCpu|SceCpu]] || Non-secure || User || 0x45265161
 
|-
 
|-
| 1.69 || [[SceSysmem#SceDipswForDriver|SceDipswForDriver]] || Non-secure || Kernel || 0xC9E26388
+
| 1.50-3.60 || [[SceSysmem#SceCpuForKernel|SceCpuForKernel]] || Non-secure || Kernel || 0x54BF2BAB
 
|-
 
|-
| 3.60 || [[SceSysmem#SceDipswForDriver|SceDipswForDriver]] || ? || Kernel || 0xC9E26388
+
| 3.65 || [[SceSysmem#SceCpuForKernel|SceCpuForKernel]] || Non-secure || Kernel || 0xA5195D20
 
|-
 
|-
| 1.69 || [[SceSysmem#SceUartForKernel|SceUartForKernel]] || Non-secure || Kernel || 0xC03DBE40
+
| 1.50-3.60 || [[SceSysmem#SceCpuForDriver|SceCpuForDriver]] || Non-secure || Kernel || 0x40ECDB0E
 
|-
 
|-
| 3.60 || [[SceSysmem#SceUartForKernel|SceUartForKernel]] || ? || Kernel || 0xC03DBE40
+
| 1.50-1.69 || [[SceSysmem#SceSysclibForKernel|SceSysclibForKernel]] || Non-secure || Kernel || 0x24878615
 
|-
 
|-
| 1.69 || [[SceSysmem#SceCpu|SceCpu]] || Non-secure || User || 0x45265161
+
| 3.60 || [[SceSysmem#SceSysclibForKernel|SceSysclibForKernel]] || Non-secure || Kernel || removed
 
|-
 
|-
| 3.60 || [[SceSysmem#SceCpu|SceCpu]] || ? || User || 0x45265161
+
| 1.50-3.60 || [[SceSysmem#SceSysclibForDriver|SceSysclibForDriver]] || Non-secure || Kernel || 0x7EE45391
 
|-
 
|-
| 1.69 || [[SceSysmem#SceCpuForKernel|SceCpuForKernel]] || Non-secure || Kernel || 0x54BF2BAB
+
| 1.50-3.60 || [[SceSysmem#SceSysrootForKernel|SceSysrootForKernel]] || Non-secure || Kernel || 0x3691DA45
 
|-
 
|-
| 3.60 || [[SceSysmem#SceCpuForKernel|SceCpuForKernel]] || ? || Kernel || 0x54BF2BAB
+
| 1.50-3.60 || [[SceSysmem#SceSysrootForDriver|SceSysrootForDriver]] || Non-secure || Kernel || 0x2ED7F97A
 
|-
 
|-
| 1.69 || [[SceSysmem#SceCpuForDriver|SceCpuForDriver]] || Non-secure || Kernel || 0x40ECDB0E
+
| 1.50-3.60 || [[SceSysmem#SceKernelUtilsForDriver|SceKernelUtilsForDriver]] || Non-secure || Kernel || 0x496AD8B4
 
|-
 
|-
| 3.60 || [[SceSysmem#SceCpuForDriver|SceCpuForDriver]] || ? || Kernel || 0x40ECDB0E
+
| 1.50 || [[SceSysmem#SceZlibForDriver|SceZlibForDriver]] || Non-secure || Kernel || 0xE241534E
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysclibForKernel|SceSysclibForKernel]] || Non-secure || Kernel || 0x24878615
+
| 1.50-3.60 || [[SceSysmem#SceKernelSuspendForDriver|SceKernelSuspendForDriver]] || Non-secure || Kernel || 0x7290B21C
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysclibForDriver|SceSysclibForDriver]] || Non-secure || Kernel || 0x7EE45391
+
| 1.50-3.60 || [[SceSysmem#SceQafMgrForDriver|SceQafMgrForDriver]] || Non-secure || Kernel || 0x4E29D3B6
 
|-
 
|-
| 3.60 || [[SceSysmem#SceSysclibForDriver|SceSysclibForDriver]] || ? || Kernel || 0x7EE45391
+
| 1.50-3.60 || [[SceSysmem#ScePmMgrForDriver|ScePmMgrForDriver]] || Non-secure || Kernel || 0xF13F32F9
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysrootForKernel|SceSysrootForKernel]] || Non-secure || Kernel || 0x3691DA45
+
| 1.50-3.60 || [[SceSysmem#SceSblAIMgrForDriver|SceSblAIMgrForDriver]] || Non-secure || Kernel || 0xFD00C69A
 
|-
 
|-
| 3.60 || [[SceSysmem#SceSysrootForKernel|SceSysrootForKernel]] || ? || Kernel || 0x3691DA45
+
| 1.50-3.60 || [[SceSysmem#SceProcEventForDriver|SceProcEventForDriver]] || Non-secure || Kernel || 0x887F19D0
 
|-
 
|-
| 1.69 || [[SceSysmem#SceKernelUtilsForDriver|SceKernelUtilsForDriver]] || Non-secure || Kernel || 0x496AD8B4
+
| 1.50-3.60 || [[SceSysmem#SceDebugLed|SceDebugLed]] || Non-secure || User || 0xAE004C0A
 
|-
 
|-
| 3.60 || [[SceSysmem#SceKernelUtilsForDriver|SceKernelUtilsForDriver]] || ? || Kernel || 0x496AD8B4
+
| 1.50-3.60 || [[SceSysmem#SceDebugLedForDriver|SceDebugLedForDriver]] || Non-secure || Kernel || 0x7BC05EAD
 
|-
 
|-
| 1.69 || [[SceSysmem#SceZlibForDriver|SceZlibForDriver]] || Non-secure || Kernel || 0xE241534E
+
| 1.50-3.60 || [[SceSysmem#SceDebugForKernel|SceDebugForKernel]] || Non-secure || Kernel || 0x88C17370
 
|-
 
|-
| 1.69 || [[SceSysmem#SceKernelSuspendForDriver|SceKernelSuspendForDriver]] || Non-secure || Kernel || 0x7290B21C
+
| 1.50-3.60 || [[SceSysmem#SceDebugForDriver|SceDebugForDriver]] || Non-secure || Kernel || 0x88758561
 
|-
 
|-
| 3.60 || [[SceSysmem#SceKernelSuspendForDriver|SceKernelSuspendForDriver]] || ? || Kernel || 0x7290B21C
+
| 1.69-1.80 || [[SceSysmem#SceSysmemForTZS|SceSysmemForTZS]] || Secure || Kernel || 0x8680060
 
|-
 
|-
| 1.69 || [[SceSysmem#SceQafMgrForDriver|SceQafMgrForDriver]] || Non-secure || Kernel || 0x4E29D3B6
+
| 1.69-1.80 || [[SceSysmem#SceDipswForTZS|SceDipswForTZS]] || Secure || Kernel || 0x9DBF584C
 
|-
 
|-
| 3.60 || [[SceSysmem#SceQafMgrForDriver|SceQafMgrForDriver]] || ? || Kernel || 0x4E29D3B6
+
| 1.80 || [[SceSysmem#SceUartForTZS|SceUartForTZS]] || Secure || Kernel || 0xA1D740D7
 
|-
 
|-
| 1.69 || [[SceSysmem#ScePmMgrForDriver|ScePmMgrForDriver]] || Non-secure || Kernel || 0xF13F32F9
+
| 1.80 || [[SceSysmem#SceDebugForTZS|SceDebugForTZS]] || Secure || Kernel || 0x028FFADB
 
|-
 
|-
| 3.60 || [[SceSysmem#ScePmMgrForDriver|ScePmMgrForDriver]] || ? || Kernel || 0xF13F32F9
+
| 1.69-1.80 || [[SceSysmem#SceCpuForTZS|SceCpuForTZS]] || Secure || Kernel || 0xC516B23E
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSblAIMgrForDriver|SceSblAIMgrForDriver]] || Non-secure || Kernel || 0xFD00C69A
+
| 1.69-1.80 || [[SceSysmem#SceSysclibForTZS|SceSysclibForTZS]] || Secure || Kernel || 0xC839BB78
 
|-
 
|-
| 3.60 || [[SceSysmem#SceSblAIMgrForDriver|SceSblAIMgrForDriver]] || ? || Kernel || 0xFD00C69A
+
| 1.69-1.80 || [[SceSysmem#SceSysrootForTZS|SceSysrootForTZS]] || Secure || Kernel || 0xFEFF641D
 
|-
 
|-
| 1.69 || [[SceSysmem#SceProcEventForDriver|SceProcEventForDriver]] || Non-secure || Kernel || 0x887F19D0
+
| 1.69-1.80 || [[SceSysmem#SceQafMgrForTZS|SceQafMgrForTZS]] || Secure || Kernel || 0x637069DD
 
|-
 
|-
| 3.60 || [[SceSysmem#SceProcEventForDriver|SceProcEventForDriver]] || ? || Kernel || 0x887F19D0
+
| 1.69-1.80 || [[SceSysmem#ScePmMgrForTZS|ScePmMgrForTZS]] || Secure || Kernel || 0x27F1AFD8
 
|-
 
|-
| 1.69 || [[SceSysmem#SceSysrootForDriver|SceSysrootForDriver]] || Non-secure || Kernel || 0x2ED7F97A
+
| 1.69-1.80 || [[SceSysmem#SceSblAIMgrForTZS|SceSblAIMgrForTZS]] || Secure || Kernel || 0x60D19047
|-
 
| 3.60 || [[SceSysmem#SceSysrootForDriver|SceSysrootForDriver]] || ? || Kernel || 0x2ED7F97A
 
|-
 
| 3.60 || [[SceSysmem#SceDebugLed|SceDebugLed]] || ? || ? || 0xAE004C0A
 
|-
 
| 3.60 || [[SceSysmem#SceDebugLedForDriver|SceDebugLedForDriver]] || ? || Kernel || 0x7BC05EAD
 
|-
 
| 3.60 || [[SceSysmem#SceDebugForKernel|SceDebugForKernel]] || ? || Kernel || 0x88C17370
 
|-
 
| 3.60 || [[SceSysmem#SceDebugForDriver|SceDebugForDriver]] || ? || Kernel || 0x88758561
 
|-
 
| 1.69 || [[SceSysmem#SceSysmemForTZS|SceSysmemForTZS]] || Secure || Kernel || 0x8680060
 
|-
 
| 1.69 || [[SceSysmem#SceDipswForTZS|SceDipswForTZS]] || Secure || Kernel || 0x9DBF584C
 
|-
 
| 1.69 || [[SceSysmem#SceCpuForTZS|SceCpuForTZS]] || Secure || Kernel || 0xC516B23E
 
|-
 
| 1.69 || [[SceSysmem#SceSysclibForTZS|SceSysclibForTZS]] || Secure || Kernel || 0xC839BB78
 
|-
 
| 1.69 || [[SceSysmem#SceSysrootForTZS|SceSysrootForTZS]] || Secure || Kernel || 0xFEFF641D
 
|-
 
| 1.69 || [[SceSysmem#SceQafMgrForTZS|SceQafMgrForTZS]] || Secure || Kernel || 0x637069DD
 
|-
 
| 1.69 || [[SceSysmem#ScePmMgrForTZS|ScePmMgrForTZS]] || Secure || Kernel || 0x27F1AFD8
 
|-
 
| 1.69 || [[SceSysmem#SceSblAIMgrForTZS|SceSblAIMgrForTZS]] || Secure || Kernel || 0x60D19047
 
 
|}
 
|}
  
== Memory Block Type ==
+
== Types ==
The <code>type</code> parameter indicates what kind of memory to allocate. Here is a mapping of <code>type</code> flags to ARM MMU flags. Higher bits are used for other options including where to allocate from. Not all flag values are valid, there is a table of valid types in the kernel. You cannot, for example, allocate RWX memory.
+
 
 +
<source lang="C">
 +
typedef int threadmgr_core_ctx;
 +
 
 +
typedef struct tctx_holder {
 +
  int unk0;
 +
  int unk4;
 +
  int unk8;
 +
  int unkC;
 +
  int unk10;
 +
  int unk14;
 +
  int unk18;
 +
  int unk1C;
 +
  int unk20;
 +
  int unk24;
 +
  int unk28;
 +
  int unk2C;
 +
  int unk30;
 +
  threadmgr_core_ctx *tctx_34;
 +
} tctx_holder;
 +
 
 +
typedef struct callback_holder1 {
 +
  int unk0;
 +
  int (*unk4)(void);
 +
  int (*unk8)(void);
 +
  int (*unkC)(void);
 +
  int unk10;
 +
  int unk14;
 +
  int unk18;
 +
  int unk1C;
 +
  int (*unk20)(void);
 +
  int unk24;
 +
  int unk28;
 +
  int unk2C;
 +
  int unk30;
 +
  int unk34;
 +
  int unk38;
 +
  int (*unk3C)(void);
 +
} callback_holder1;
 +
 
 +
typedef struct callback_holder2 {
 +
  int size;
 +
  int (__cdecl *unk4)(int result, int *a2);
 +
  int (__cdecl *unk8)(SceUID *a1);
 +
  int (__cdecl *unkC)(int, int *);
 +
  int (__cdecl *sceKernelSysrootGetProcessSelfAuthInfoForKernel)(SceUID pid, SceSelfAuthInfo* self_auth_info);
 +
  int (__cdecl *sceKernelSysrootGetProcessTitleIdForKernel)(SceUID pid, char *title_id, SceSize len);
 +
  int (__cdecl *unk18)(unsigned int a1);
 +
  int (__cdecl *unk1c)(int a1);
 +
} callback_holder2;
 +
 
 +
typedef struct callback_holder3 {
 +
  int unk0;
 +
  int (*unk4)(void);
 +
  int (*unk8)(void);
 +
  int (__fastcall *unkC)(int);
 +
  int (__fastcall *unk10)(int);
 +
  int (*unk14)(void);
 +
} callback_holder3;
 +
 
 +
typedef struct sysbase_t {
 +
  tctx_holder *hldr[6];
 +
  char unk[84];
 +
  char *kbl_param;
 +
  int unk70;
 +
  char unk74[616];
 +
  char unk2dc[52];
 +
  int unk310;
 +
  int unk314;
 +
  int unk318;
 +
  int unk31C;
 +
  int unk320;
 +
  int unk324;
 +
  int unk328;
 +
  int unk32C;
 +
  int unk330;
 +
  int unk334;
 +
  int unk338;
 +
  int unk33C;
 +
  int unk340;
 +
  int (__cdecl *GetThreadAccessLevel)();
 +
  int unk348;
 +
  int (*unk34C_some_callback1)(void);
 +
  callback_holder3 *unk350;
 +
  int unk354;
 +
  callback_holder1 *unk358;
 +
  callback_holder2 *unk35C;
 +
  int (*unk360)(void);
 +
  int (*unk364)(void);
 +
  int (__fastcall *unk368)(int, int, int);
 +
  char unk36C[20];
 +
  int (__cdecl *sceSblLicMgrGetLicenseStatusForDriver)();
 +
  int (__cdecl *SceSblPostSsMgrForDriver_22599675)();
 +
  int (__cdecl *SceSblPostSsMgrForDriver_9b49c249)();
 +
  int (__cdecl *SceSblPostSsMgrForDriver_d8a2d465)(unsigned long long);
 +
  int (__cdecl *SceSblPostSsMgrForDriver_abdd68cd)(void *);
 +
  int (__cdecl *sceSblUtMgrHasNpTestFlagForDriver)();
 +
  int (*SceSblUpdateMgr_smth)(void);
 +
  int (*ScePower_smth)(void);
 +
} sysbase_t;
 +
 
 +
typedef struct sysbase360_t {
 +
int unk_0x00; // 0
 +
void *unk_0x04;
 +
SceSize sysbase_size; // 3.60:0x41C
 +
uint32_t sysbase_magic1;
 +
int unk_0x10; // 0
 +
int unk_0x14; // 0x400
 +
void *unk_0x18;
 +
int unk_0x1C; // 0x4
 +
void *unk_0x20;
 +
int unk_0x24; // 0
 +
int unk_0x28; // 0x10
 +
int unk_0x2C; // 0x1
 +
 
 +
int unk_0x30; // 0x40004
 +
// start ModulePrivate
 +
int unk_0x34; // 0
 +
int unk_0x38; // 0
 +
void *unk_0x3C;
 +
 
 +
void *unk_0x40;
 +
void *unk_0x44; // SceExcpmgr data vaddr?
 +
void *unk_0x48; // SceKernelIntrMgr data vaddr?
 +
void *unk_0x4C;
 +
 
 +
void *unk_0x50;
 +
int unk_0x54; // 0
 +
void *unk_0x58;
 +
int unk_0x5C; // 0
 +
 
 +
int unk_0x60; // 0
 +
int unk_0x64; // 0
 +
int unk_0x68; // 0
 +
// end ModulePrivate?
 +
SceKblParam *KblParam; // old name is sysroot buff
  
{| class="wikitable"
+
int unk_0x70; // 0x51030100, paddr?
|-
+
int unk_0x74; // 0x80000115
! Mask !! Value !! Description
+
int unk_0x78; // 0
|-
+
int unk_0x7C; // 0x115
| 0x10000 || 0x10000 || Global. <code>nG</code> bit NOT set
+
 
|-
+
int unk_0x80; // 0x10200
| 0xFF00 || 0x800 || <code>B</code> bit set. Sharable device memory.
+
int unk_0x84; // 0x704
|-
+
int unk_0x88; // 0x2800D000
| 0xFF00 || 0x2000 || <code>TEX[2]</code> and <code>TEX[0]</code> bit set. Outer cache Write-back, Write-Allocate. Inner cache non-cachable.
+
int unk_0x8C; // 0
|-
 
| 0xFF00 || 0x4000 || <code>TEX[2]</code> and <code>B</code> bit set. Outer cache non-cachable. Inner cache Write-back, Write-Allocate
 
|-
 
| 0xFF00 || 0x8000 || <code>TEX[0]</code> bit set. <code>S</code> bit unset. Outer and inner non-cachable. Not sharable.
 
|-
 
| 0xFF00 || 0xD000 || <code>TEX[0]</code> bit set. <code>C,B</code> bits set. Outer and inner Write-back, Write-Allocate.
 
|-
 
| 0xFF || 0x4 || <code>AP[2:0] = 5</code>, <code>XN=1</code>. Privileged RO, User NA.
 
|-
 
| 0xFF || 0x5 || <code>AP[2:0] = 5</code>. Privileged RX, User NA.
 
|-
 
| 0xFF || 0x6 || <code>AP[2:0] = 1</code>, <code>XN=1</code>. Privileged RW, User NA.
 
|-
 
| 0xFF || 0x7 || <code>AP[2:0] = 1</code>. Privileged RWX, User NA. (Never used)
 
|-
 
| 0xFF || 0x50 || <code>AP[2:0] = 7</code>. Privileged RX, User RX.
 
|-
 
| 0xFF || 0x60 || <code>AP[2:0] = 3</code>, <code>XN=1</code>. Privileged RW, User RW.
 
|-
 
| 0xFF || 0x40 || <code>AP[2:0] = 7</code>, <code>XN=1</code>. Privileged RO, User RO.
 
|-
 
|}
 
  
== SceSysmemForKernel ==
+
int unk_0x90; // 0x5
 +
int unk_0x94; // 0
 +
int unk_0x98; // 0
 +
int unk_0x9C; // 0
  
==== sceKernelAllocMemBlockForKernel ====
+
int unk_0xA0[0x18]; // 0
{| class="wikitable"
+
int unk_0x100[0x34]; // 0
|-
 
! Version
 
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0xC94850C9
 
|-
 
| 1.69 (secure)
 
| 0x402EB970
 
|}
 
<source lang="c">
 
struct SceKernelAllocMemKernelBlockOpt_old
 
{
 
    uint32_t size; // 0x34
 
    uint32_t unk;
 
    uint32_t attr;
 
    uint32_t unk2;
 
    uint32_t paddr;
 
    uint32_t align;
 
    uint32_t unk3[3];
 
    uint32_t processid;
 
    uint32_t unk4[3];
 
};
 
  
// specific to 3.60
+
int unk_0x1D0; // 0
typedef struct SceKernelAllocMemBlockKernelOpt {
+
int unk_0x1D4; // func ptr?, paddr:0x51003581
  SceSize size; // 0x58
+
int unk_0x1D8; // 0
  SceUInt32 field_4;
+
int (* sceKernelSysrootMountDummyTtypDevFs)(void); // SceIofilemgr + 0x1
  SceUInt32 attr;
+
int unk_0x1E0[0x8]; // 0
  SceUInt32 field_C;
+
int unk_0x200[0x14]; // 0
  SceUInt32 paddr;
 
  SceSize alignment;
 
  SceUInt32 field_18;
 
  SceUInt32 field_1C;
 
  SceUInt32 mirror_blkid;
 
  SceUID pid;
 
  SceUInt32 field_28;
 
  SceUInt32 field_2C;
 
  SceUInt32 field_30;
 
  SceUInt32 field_34;
 
  SceUInt32 field_38;
 
  SceUInt32 field_3C;
 
  SceUInt32 field_40;
 
  SceUInt32 field_44;
 
  SceUInt32 field_48;
 
  SceUInt32 field_4C;
 
  SceUInt32 field_50;
 
  SceUInt32 field_54;
 
} SceKernelAllocMemBlockKernelOpt;
 
  
int sceKernelAllocMemBlockForKernel(const char *name, int32_t type, uint32_t vsize, struct SceKernelAllocMemKernelBlockOpt *pOpt);
+
int unk_0x250; // 0
</source>
+
int (* sceKernelSysrootPowerTriggerFlag0x10000)(int a1); // Temp name, ScePower + 0x21F5
 +
int unk_0x258; // 0
 +
int unk_0x25C; // 0
  
The interface is the same as the user version of this call, however more types can be specified and more options are in the pOpt argument.
+
int unk_0x260[0xC]; // 0
  
To allocate a kernel RW block of memory, specify <code>type = 0x6020D006</code>.
+
int unk_0x290; // 0
 +
int (* sceKernelSysrootDisplayRev1)(); // SceDisplay + 0x1
 +
int unk_0x298; // 0
 +
int (* sceKernelSysrootMsifStart)(void); // SceMsif + 0x3811
  
To allocate a block of memory with a specific physical address, specify <code>type = 0x20100206</code>, <code>pOpt->attr = 2</code>, and <code>pOpt->paddr = physical address</code>.
+
int unk_0x2A0; // 0
 +
int (* sceKernelSysrootPowerRev1)(); // Temp name, ScePower + 0x7BCD
 +
int unk_0x2A8; // 0
 +
int (* sceKernelSysrootPowerTriggerFlag0x10000_2)(void); // Temp name, ScePower + 0x218D
  
To allocate a block of memory that is kernel executable, specify <code>type = 0x1020D005</code>.
+
int unk_0x2B0; // 0
 +
int (* sceKernelSysrootPowerEnableSubIntr)(void); // Temp name, ScePower + 0x5B51
 +
int unk_0x2B8; // 0
 +
int unk_0x2BC; // 0
  
To allocate a block of memory that is physically contiguous, specify <code>type = 0x30808006</code>, <code>pOpt->attr = 0x200004</code> and an alignment to <code>pOpt->alignment</code>.
+
int unk_0x2C0[0x4]; // 0
  
To allocate a block of memory inside the CDRAM, specify <code>type = 0x40404006</code>.
+
int unk_0x2D0; // 0
 +
int (* sceKernelSysrootThreadMgrStartAfterProcess)(void);
 +
int (* sceKernelSysrootIofilemgrStart)(void); // SceIofilemgr + 0x3E5
 +
void *unk_0x2DC;
  
==== Unrestricted Write for Process ====
+
void *unk_0x2E0;
Unrestricted memcpy to the virtual address space for process <code>pid</code>. Both <code>dst</code> and <code>src</code> must be in the address space of <code>pid</code> but <code>src</code> must also be accessible in the address space of the caller. This is normally used for resolving stubs in module loads.
+
void *unk_0x2E4;
 +
void *unk_0x2E8;
 +
void *unk_0x2EC;
  
{| class="wikitable"
+
void *unk_0x2F0;
|-
+
void *unk_0x2F4;
! Version
+
void *unk_0x2F8;
! NID
+
void *unk_0x2FC;
|-
 
| 1.69 (non-secure)
 
| 0x30931572
 
|}
 
<source lang="c">int unrestricted_memcpy_for_pid(int pid, void *dst, void *src, size_t len);</source>
 
  
== SceSysmemForDriver ==
+
void *unk_0x300;
 +
void *unk_0x304;
 +
int unk_0x308; // 0x10001
 +
void *unk_0x30C;
  
=== sceKernelMemcpyKernelToUser ===
+
void *unk_0x310;
{| class="wikitable"
+
void *unk_0x314;
|-
+
void *unk_0x318;
! Version
+
int unk_0x31C; // 0
! NID
+
 
|-
+
void *unk_0x320;
| 1.69 (non-secure)
+
void *unk_0x324;
| 0x6D88EF8A
+
SceUID (* sceKernelSysrootGetThreadId)(void); // Temp name, SceKernelThreadMgr + 0x895
|}
+
int (* sceKernelSysrootGetThreadFunction3)(void); // Temp name, SceKernelThreadMgr + 0xC79,  SceThreadmgrForDriver_91382762
<source lang="c">int sceKernelMemcpyKernelToUser(uint32_t uaddr, const void *kaddr, uint32_t len);</source>
+
 
 +
SceUID (* sceKernelSysrootGetProcessId)(void); // Temp name, SceKernelThreadMgr + 0x8A9
 +
int (* sceKernelSysrootGetThreadFunction4)(void); // Temp name, SceKernelThreadMgr + 0x8D1
 +
int (* sceKernelSysrootGetThreadFunction5)(void); // Temp name, SceKernelThreadMgr + 0x8ED
 +
int (* sceKernelSysrootGetThreadFunction6)(void); // Temp name, SceKernelThreadMgr + 0x90D
  
=== sceKernelMemcpyUserToKernel ===
+
void (* sceKernelSysrootGetThreadFunction7); // Temp name, SceKernelThreadMgr + 0xE69
{| class="wikitable"
+
int (* sceKernelSysrootGetThreadFunction8)(void); // Temp name, SceKernelThreadMgr + 0x8BD, SceThreadmgrForDriver_332E127C
|-
+
int (* sceKernelSysrootThreadFunction9)(int a1, int a2, int a3); // Temp name, SceKernelThreadMgr + 0x2541
! Version
+
int (* sceKernelSysrootThreadFunction10)(int a1); // Temp name, SceKernelThreadMgr + 0xC99, SceThreadmgrForDriver_AB977C72
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0xBC996A7A
 
|}
 
<source lang="c">int sceKernelMemcpyUserToKernel(void *kaddr, uint32_t uaddr, uint32_t len);</source>
 
  
=== sceKernelMemcpyUserToKernelForPid ===
+
void *unk_0x350;
{| class="wikitable"
+
int unk_0x354; // 0xFFFFFFFF
|-
+
void *unk_0x358;
! Version
+
void *unk_0x35C;
! NID
 
|-
 
| 3.60 (non-secure)
 
| 0x605275F8
 
|}
 
<source lang="c">int sceKernelMemcpyUserToKernelForPid(int pid, void *kaddr, uint32_t uaddr, uint32_t len);</source>
 
  
Same as above, but copies from the specified process.
+
int unk_0x360;
 +
int (* sceKernelSysrootGetBusError)(void *dst, uint32_t len); // SceKernelBusError + 0x23, SceBusErrorForKernel_EBB1F135
 +
int (* sceKernelSysrootAppMgrFunction1)(int a1, int a2, int a3, int a4, int a5, int a6); // SceAppMgr + 0x2795, SceAppMgrForDriver_324DD34E
 +
SceUID (* sceKernelSysrootGetShellPid)(void); // SceAppMgr + 0x101F9, SceAppMgrForDriver_2FEACA9F
  
=== strncpyKernelToUser ===
+
void *unk_func_0x370; // SceCoredump + 0x7109, SceCoredumpForDriver_A7D214A7
{| class="wikitable"
+
void *unk_func_0x374; // SceCoredump + 0x74F9, SceCoredumpForDriver_340856F7
|-
+
void *unk_func_0x378; // SceCoredump + 0x132ED, SceCoredumpForDriver_EF20949F
! Version
+
int unk_0x37C; // 0
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0x80BD6FEB
 
|}
 
<source lang="c">int strncpyKernelToUser(uint32_t uaddr, const void *kaddr, uint32_t maxlen);</source>
 
  
=== strncpyUserToKernel ===
+
void *unk_func_0x380; // SceSblPostSsMgr + 0x9001, sceSblLicMgrGetLicenseStatusForDriver
{| class="wikitable"
+
int (* unk_func_0x384)(void); // SceSblPostSsMgr + 0xB005, SceSblPostSsMgrForDriver_22599675, get flag
|-
+
int (* unk_func_0x388)(void); // SceSblPostSsMgr + 0xB011, SceSblPostSsMgrForDriver_9B49C249, get flag
! Version
+
void *unk_func_0x38C; // SceSblPostSsMgr + 0xB4ED, SceSblPostSsMgrForDriver_D8A2D465
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0xDB3EC244
 
|}
 
<source lang="c">int strncpyUserToKernel(void *kaddr, uint32_t uaddr, uint32_t maxlen);</source>
 
  
=== strnlenUserSrc ===
+
void *unk_func_0x390; // SceSblPostSsMgr + 0xB111, sceSblUtMgrGetTrilithiumBufferForDriver
{| class="wikitable"
+
int (* sceKernelSysrootHasNpTestFlag)(void); // SceSblPostSsMgr + 0xB01D
|-
+
void *unk_func_0x398; // SceSblUpdateMgr + 0x8B01
! Version
+
int (* sceKernelSysrootLedSetMode)(int led, int mode, void *led_configuration); // ScePower + 0x7C05
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0xB429D419
 
|}
 
<source lang="c">int strnlenUserSrc(uint32_t uaddr, uint32_t maxlen);</source>
 
  
=== get_paddr ===
+
void *unk_0x3A0;
{| class="wikitable"
+
int unk_0x3A4; // 0
|-
+
int unk_0x3A8; // 0
! Version
+
int unk_0x3AC; // 0
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0x8D160E65
 
|-
 
| 1.69 (secure)
 
| 0x1DEADF6C
 
|}
 
<source lang="c">int get_paddr(void *vaddr, void **result);</source>
 
  
This will write the physical address for a virtual address <code>vaddr</code> to memory pointed to by <code>result</code>. Returns <0 on error, values >=0 indicate success.
+
int unk_0x3B0[0x4]; // 0
  
=== get paddr list ===
+
int unk_0x3C0; // 0
{| class="wikitable"
+
int unk_0x3C4; // 0
|-
+
int unk_0x3C8; // 0
! Version
+
void *unk_func_0x3CC; // SceNetPs + 0x3E51, SceNetPsForDriver_83A12CCC
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0xE68BEEBD
 
|}
 
<source lang="c">
 
struct addr_pair
 
{
 
    uint32_t addr;
 
    uint32_t length;
 
};
 
struct paddr_list_req
 
{
 
    uint32_t size; // 0x14
 
    uint32_t output_buffer_size;
 
    uint32_t unk;
 
    uint32_t ret_count;
 
    struct addr_pair *output_buffer;
 
};
 
input.addr = vaddr;
 
input.length = length;
 
int get_paddr_list(struct addr_pair *input, struct paddr_list_req *req);
 
</source>
 
  
This function takes in two parameters: an array of length 2 specifying the virtual address and the size of the block of memory and a request information. The function will write into <code>output_buffer</code> an array of <code>addr_pair</code> that encompasses the block of memory specified in the input. <code>req->ret_count</code> will contain the number of entries written. If <code>output_buffer</code> is null, it will just write the count.
+
void *unk_func_0x3D0; // SceNetPs + 0x3F4D, SceNetPsForDriver_C000CA8F
 +
int unk_0x3D4; // 0
 +
int unk_0x3D8; // 0
 +
void *unk_func_0x3DC; // SceNetPs + 0x3E51, SceNetPsForDriver_83A12CCC
  
=== sceKernelGetMemBlockBaseForDriver ===
+
void *unk_func_0x3E0; // SceNetPs + 0x3F4D, SceNetPsForDriver_C000CA8F
{| class="wikitable"
+
int (* sceKernelSysrootAppMgrFunction3)(int a1, int a2); // SceAppMgr + 0x9F49
|-
+
int (* sceKernelSysrootAppMgrFunction4)(int a1, int a2); // SceAppMgr + 0x9EED
! Version
+
int (* sceKernelSysrootAppMgrFunction5)(int a1); // SceAppMgr + 0x9D31
! NID
+
 
|-
+
void *unk_func_0x3F0; // ScePfsMgr + 0x1, ScePfsMgrForKernel_4C148288
| 1.69 (non-secure)
+
void *unk_0x3F4;
| 0xA841EDDA
+
void *unk_0x3F8;
|}
+
int unk_0x3FC; // 0
<source lang="c">int sceKernelGetMemBlockBaseForDriver(int blkid, void **base);</source>
+
 
 +
int unk_0x400[0x6]; // 0
 +
uint32_t sysbase_magic2;
 +
} sysbase360_t; // Real name is maybe sysroot
  
=== sceKernelFindMemBlockByAddrForDriver ===
+
// 0x51030100
{| class="wikitable"
+
typedef struct SceSblSysbase {
|-
+
SceSize size;
! Version
+
int data_0x04;
! NID
+
int data_0x08; // ex:3
|-
+
uint32_t non_secure_base;
| 1.69 (non-secure)
 
| 0x8A1742F6
 
|}
 
<source lang="c">int sceKernelFindMemBlockByAddrForDriver(void *base, int);</source>
 
  
=== Remap Block ===
+
uint32_t non_secure_size_without_secure;
{| class="wikitable"
+
uint32_t non_secure_size;
|-
+
int data_0x18; // ex:0x8000000
! Version
+
int data_0x1C; // ex:0x80000000
! NID
 
|-
 
| 1.05 (non-secure)
 
| 0x8d332ae1
 
|-
 
| 1.69 (non-secure)
 
| 0xDFE2C8CB
 
|}
 
<source lang="c">int sysmem_remap(int blkid, int type);</source>
 
  
This is used to remap RW memory as RX. To do this, first allocate a memory block of type <code>0x1020D006</code>. After you are done writing, call this with <code>type</code> set to <code>0x1020D005</code>.
+
int data_0x20; // ex:0x40000000
 +
int data_0x24;
 +
int data_0x28;
 +
SceKblParam *pKblParam;
  
=== Create Heap Pool ===
+
int data_0x30[4];
{| class="wikitable"
+
int data_0x40[4]; // 0. 0x80000115, 0, 0x00000115
|-
+
int data_0x50[3]; // 0x00010200, 0x00000704, 0x51023A00(SceKernelTTBR0)
! Version
+
uint32_t ttbr0;
! NID
+
int data_0x60[4]; // 0x000F4000, 0x00004000, 0x00004000, 0
|-
+
int data_0x70[4]; // 0x3FFFFFFF, 0x40000000, 0x51023A10(SceKernelTTBR1), 0x4020C000
| 1.69 (non-secure)
+
int data_0x80[4]; // 0x0001C000, 0x00004000, 0x00004000, 0
| 0x9328E0E8
+
int data_0x90[4]; // 0xC0000000, 0, 0x510239CC(SceKernelReset), 0x40200000
|}
+
int data_0xA0[4]; // 0, 0x00001000, 0x00004000, 0x00003000
<source lang="c">
 
typedef struct {
 
    int size; // 28
 
    int flags; // usually 0x1
 
    int unk;
 
    int unk;
 
    int block_type;
 
    int unk;
 
    int unk;
 
} pool_arg_t;
 
int heap_pool_create(const char *name, int size, pool_arg_t *opt); // opt can be NULL
 
</source>
 
  
The heap pool is thread safe.
+
const char *pSceKernelExceptionEntry_name;
 +
int data_0xB4[3]; // 0x40200000, 0x000F0000, 0x00001000
  
=== Destroy Heap Pool ===
+
char data_0xC0[0x40];
{| class="wikitable"
+
sysbase360_t *pSysbase2;
|-
+
char data_0x104[0x20C];
! Version
+
} SceSblSysbase; // size is 0x310
! NID
+
// arg of base kernel
|-
 
| 1.69 (non-secure)
 
| 0xD6437637
 
|}
 
<source lang="c">
 
int heap_pool_destroy(int pool_uid);
 
</source>
 
  
=== Alloc from Heap Pool ===
+
typedef struct SceKernelFreeMemorySizeInfo {
{| class="wikitable"
+
SceSize size;
|-
+
SceSize sizeMain;
! Version
+
SceSize sizeCdram;
! NID
+
SceSize sizePhycont;
|-
+
} SceKernelFreeMemorySizeInfo;
| 1.69 (non-secure)
 
| 0x7B4CB60A
 
|}
 
<source lang="c">
 
void *heap_pool_malloc(int pool_uid);
 
</source>
 
  
=== Free from Heap Pool ===
+
typedef int (*SceClassCallback)(void *item);
{| class="wikitable"
 
|-
 
! Version
 
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0x3EBCE343
 
|}
 
<source lang="c">
 
int heap_pool_free(int pool_uid, void *ptr);
 
</source>
 
  
=== Map User to Kernel  ===
+
typedef struct SceClass_0990 { // size is 0x10 on FW 0.990
{| class="wikitable"
+
SceSize size; // Size of this structure
|-
+
struct SceClass *next;
! Version
+
struct SceClass *root; // to confirm
! NID
+
struct SceClass *prev; // to confirm
|-
+
} SceClass_0990;
| 1.69 (non-secure)
+
 
| 0x7D4F8B5F
+
typedef struct SceClass { // size is 0x2C on FW 3.60
| 3.60 (?)
+
struct SceClass *next; // 0x00
| 0x7D4F8B5F
+
struct SceClass *root; // 0x04
|}
+
struct SceClass *prev; // 0x08
Permission is either "1" for read only, no execute or "2"/"3" for read write, no execute. Type is either 0, 1, or 17 and affects the block type. 0 is default. This will allocate kernel memory starting at kernel_page. To get the same memory as the user pointer, add the kernel_offset. kernel_size is how much is allocated.
+
const char *name; // 0x0C
<source lang="c">
+
struct SceClass *uid_class; // 0x10
 +
unsigned int attr; // 0x14
 +
unsigned short item_size; // 0x18
 +
unsigned short unk_1A; // 0x1A
 +
SceClassCallback constructor; // 0x1C
 +
SceClassCallback destructor; // 0x20
 +
const unsigned int magic; // 0x24 - 0xABCE9DA5
 +
SceClassCallback allocMethod; // 0x28
 +
} SceClass;
 +
 
 +
typedef struct SceKernelObject { // size is at least 0x24
 +
void *pObject; // 0x0
 +
SceClass pClass; // 0x4
 +
uint32_t type; // 0x8
 +
uint16_t lcount; // 0xC
 +
uint16_t ucount; // 0xE
 +
uint16_t ccount; // 0x10
 +
uint32_t unk_12; // 0x12 - 0x54c3
 +
uint16_t unk_16; // 0x16
 +
uint32_t uid; // 0x18
 +
char unk_1C[4]; // 0x1C
 +
const char *name; // 0x20
 +
uint32_t indexRaw; // 0x24
 +
} SceKernelObject;
 +
 
 +
/** @name Memory types that can be specified with sceKernelAllocMemBlock
 +
*/
 +
/*@{*/
  
//this signature is for 1.69
+
/**
int map_user_to_kernel(int permission, int type, void *user_buf, int size, void **kernel_page, int *kernel_size, int *kernel_offset);
+
* @brief User readable / writable LPDDR2 memory
 +
*
 +
* This type secures a readable / writable memory block in user space.
 +
*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RW 0x0c20d060U
  
//this signature is for 3.60 - now allows to give a name
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA SCE_KERNEL_MEMBLOCK_TYPE_USER_RW
int map_user_to_kernel(char *name, int permission, int type, void *user_buf, int size, void **kernel_page, int *kernel_size, int *kernel_offset);
 
  
</source>
+
/**
 +
* @brief User readable / writable LPDDR2 non-cache memory
 +
*
 +
* A type to secure a memory block on LPDDR2 that is readable
 +
* and writable in user space and does not use cache.
 +
*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW 0x0c208060U
  
=== Switch TTB to PID ===
+
/**
Changes the TTBR to point to the tables for a given PID.
+
* @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW.
{| class="wikitable"
+
*/
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW
! Version
 
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0x6F2ACDAE
 
|-
 
| 3.60 (non-secure)
 
| N/A
 
|}
 
<source lang="c">
 
int switch_ttb(int pid);
 
</source>
 
  
=== Write to RO for PID ===
+
/**
{| class="wikitable"
+
* @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW.
|-
+
*/
! Version
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA_UNCACHE SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0x571D2739
 
|}
 
<source lang="c">
 
int write_to_ro(int pid, void *dst, const void *src, int size);
 
</source>
 
  
=== Write to RX for PID ===
+
/**
Same as write to RO but does a cache flush.
+
* @brief User readable and writable LPDDR2 physical continuous memory
{| class="wikitable"
+
*
|-
+
* A type that can read and write in user space and secure
! Version
+
* memory blocks from the physical continuous memory area.
! NID
+
*/
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW 0x0c80d060U
| 1.69 (non-secure)
 
| 0x30931572
 
|}
 
<source lang="c">
 
int write_to_rx(int pid, void *dst, const void *src, int size);
 
</source>
 
  
=== Find Int for PID ===
+
/**
Looks for an integer in user space.
+
* @brief User-readable and non-cacheable physical continuous memory
{| class="wikitable"
+
*
|-
+
* A type for on-cacheable read / write in user space and to secure
! Version
+
* memory blocks from the physical continuous memory area.
! NID
+
*/
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW 0x0d808060U
| 1.69 (non-secure)
 
| 0x8334454F
 
|}
 
<source lang="c">
 
int find_int(int pid, void *haystack, int needle, int size);
 
</source>
 
  
=== strnlen for PID ===
+
/**
{| class="wikitable"
+
* @brief User-readable and non-cacheable CDRAM memory
|-
+
*
! Version
+
* A type that can be read and written in user space and secures
! NID
+
* memory blocks on CDRAM.
|-
+
*/
| 1.69 (non-secure)
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW 0x09408060U
| 0x9929EB07
 
|}
 
<source lang="c">
 
int user_strnlen(int pid, char *ptr, int size);
 
</source>
 
  
=== strncpy for PID ===
+
/**
{| class="wikitable"
+
* @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW.
|-
+
*/
! Version
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RWDATA SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW
! NID
+
 
|-
+
/*@}*/
| 1.69 (non-secure)
+
 
| 0x75AAF178
+
/**
|}
+
* @brief A type representing a memory type
<source lang="c">
+
*
int user_strncpy(int pid, char *dst, const char *kern_src, int size);
+
* A type that represents the type of memory block secured by sceKernelAllocMemBlock.
</source>
+
*/
 +
typedef int SceKernelMemoryType;
 +
 
 +
/**
 +
* @brief Memory block information structure
 +
*
 +
* A structure for obtaining information about memory blocks. Size is 0x14 bytes on FW 0.990.
 +
*/
 +
typedef struct SceKernelMemBlockInfo0990 {
 +
SceSize size; /**< Size of the structure itself */
 +
void *mappedBase; /**< Map base address */
 +
SceSize mappedSize; /**< Mapped size */
 +
SceKernelMemoryType memoryType; /**< Memory type */
 +
SceUInt32 access; /**< Access right */
 +
} SceKernelMemBlockInfo0990;
 +
 
 +
/**
 +
* @brief Memory block information structure
 +
*
 +
* A structure for obtaining information about memory blocks. Size is 0x18 bytes on FWs 0.996+.
 +
*/
 +
typedef struct SceKernelMemBlockInfo {
 +
SceSize size; /**< Size of the structure itself */
 +
void *mappedBase; /**< Map base address */
 +
SceSize mappedSize; /**< Mapped size */
 +
SceKernelMemoryType memoryType; /**< Memory type */
 +
SceUInt32 access; /**< Access right */
 +
SceKernelMemBlockType type; /**< Memory block type */
 +
} SceKernelMemBlockInfo;
 +
 
 +
typedef struct SceKernelMemBlockInfoExDetails {
 +
    SceKernelMemBlockType type;
 +
    SceUID memblk_uid;
 +
    const char *name;
 +
    void *mappedBase;
 +
    SceSize mappedSize;
 +
    SceSize memblock_some_size_or_alignment;
 +
    int extraLow;
 +
    int extraHigh;
 +
    int unk20;
 +
    SceUID unk24; // ex: 0x10045, maybe some pid
 +
    SceKernelObject *SceUIDPhyMemPartClass_obj;
 +
} SceKernelMemBlockInfoExDetails;
 +
 
 +
typedef struct SceKernelMemBlockInfoEx { // size is 0xAC on FW 0.990, 0xB8 on FW 3.60
 +
    SceSize size; // Size of this structure
 +
    SceKernelMemBlockInfoExDetails details;
 +
    SceSize unk30; // paddr num
 +
    SceSize unk34; // paddr size num?
 +
    void *paddr_list[0x10];
 +
    SceSize size_list[0x10];
 +
} SceKernelMemBlockInfoEx;
  
=== memcpyk2u unchecked for PID ===
+
typedef struct SceKernelMemBlockInfoSimple { // size is 0x24 on FW 0.990
{| class="wikitable"
+
    SceSize size; // Size of this structure
|-
+
    SceKernelMemBlockType type;
! Version
+
    SceUID uid;
! NID
+
    char *name; // "SceNULL" by default
|-
+
    char unk_0x10[0x14];
| 1.69 (non-secure)
+
} SceKernelMemBlockInfoSimple;
| 0xFED82F2D
 
|}
 
<source lang="c">
 
int user_memcpyk2u(int pid, void *dst, const void *kern_src, int size);
 
</source>
 
  
=== memcpyk2u checked for PID ===
+
/*----- memory access permission -----*/
This will not crash on invalid user pointers, but instead return error.
 
{| class="wikitable"
 
|-
 
! Version
 
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0x6B825479
 
|}
 
<source lang="c">
 
int user_safe_memcpyk2u(int pid, void *dst, const void *kern_src, int size);
 
</source>
 
  
=== memcpyu2u for PID ===
+
/**
{| class="wikitable"
+
* @brief readable memory
|-
+
*/
! Version
+
#define SCE_KERNEL_MEMORY_ACCESS_R 0x04U
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0x8E086C33
 
|}
 
<source lang="c">
 
int user_memcpyu2u(int pid, void *dst, const void *src, int size);
 
</source>
 
  
=== create_event ===
+
/**
{| class="wikitable"
+
* @brief writable memory
|-
+
*/
! Version
+
#define SCE_KERNEL_MEMORY_ACCESS_W 0x02U
! NID
 
|-
 
| 3.60
 
| 0x56A13E90
 
|}
 
<source lang="c">
 
SceUID create_event(SceClass *cls, const char *name, SceObjectBase **obj);
 
</source>
 
  
== SceSysmem ==
+
/**
 +
* @brief executable memory (kernel only)
 +
*/
 +
#define SCE_KERNEL_MEMORY_ACCESS_X 0x01U
  
The SceSysmem library is responsible for both low-level and high-level memory management. There are functions for allocating raw blocks of memory (similar to Linux <code>sbrk</code>) as well as functions for maintaining a heap-like structure (similar to <code>malloc</code>) for kernel, however [[SceLibKernel]] implements a proper heap and that is used for user code.
+
/*----- memory type -----*/
  
=== sceKernelGetMemBlockInfoByRange ===
+
/**
{| class="wikitable"
+
* @brief uncache normal memory
|-
+
*/
! Version !! NID
+
#define SCE_KERNEL_MEMORY_TYPE_NORMAL_NC 0x80
|-
+
 
| 1.69 || 0x6F3DB4
+
/**
|}
+
* @brief cache normal memory
=== sceKernelSyncVMDomain ===
+
*/
{| class="wikitable"
+
#define SCE_KERNEL_MEMORY_TYPE_NORMAL 0xD0
|-
+
 
! Version !! NID
+
/**
|-
+
* Optional parameter of sceKernelAllocMemBlock for FWs <=0.940.
| 1.69 || 0x19D2A81A
+
*/
|}
+
typedef struct SceKernelAllocMemBlockOpt0940 { // size is 0x14 on FW 0.940-0.990
=== sceKernelRemapMemBlock ===
+
SceSize size; /**< Size of this structure */
{| class="wikitable"
+
SceUInt32 attr; /**< Attributes field */
|-
+
SceSize alignment; /**< Specify alignment.
! Version !! NID
+
SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT must be set for the attr member. */
|-
+
SceUID uidBaseBlock; /**< Base memory block UID */
| 1.69 || 0x3B29E0F5
+
const char *strBaseBlockName; /**< Base memory block UID name */
|}
+
} SceKernelAllocMemBlockOpt0940;
=== sceKernelGetMemBlockInfoByAddr ===
+
 
{| class="wikitable"
+
/**
|-
+
* Option parameter of sceKernelAllocMemBlock
! Version !! NID
+
*/
|-
+
typedef struct SceKernelAllocMemBlockOpt { // size is 0x14/0x38/0x3C/0x40 on FW 3.60
| 1.69 || 0x4010AD65
+
/**
|}
+
* Size of this structure
=== sceKernelMapMemBlock ===
+
*/
{| class="wikitable"
+
SceSize size;
 +
 
 +
/**
 +
* Attributes field
 +
*/
 +
SceUInt32 attr;
 +
 
 +
/**
 +
* Specify alignment.
 +
* SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT must be set for the attr member.
 +
*/
 +
SceSize alignment;
 +
 
 +
/**
 +
* reserved
 +
*/
 +
SceUInt32 uidBaseBlock;
 +
 
 +
/**
 +
* reserved2
 +
*/
 +
const char *strBaseBlockName;
 +
 
 +
#if 0
 +
/**
 +
* mapped base address [out]
 +
*/
 +
void *mappedBase;
 +
 
 +
/**
 +
* mapped size [out]
 +
*/
 +
SceSize mappedSize;
 +
 
 +
/**
 +
* memory type [out]
 +
*/
 +
SceKernelMemoryType memoryType;
 +
 
 +
SceUInt32 access;
 +
#endif
 +
} SceKernelAllocMemBlockOpt;
 +
 
 +
/**
 +
* Option parameter of kernel sceKernelAllocMemBlock on old FWs (as seen on FWs 0.900-0.990)
 +
*/
 +
typedef struct SceKernelAllocMemBlockOptKernel_old { // size is 0x28 on 0.900, 0x2C on 0.910, 0x30 on 0.931-0.990, 0x34 on ?.??
 +
    SceSize size; // Size of this structure
 +
    SceUInt32 unk_4;
 +
    SceUInt32 attr;
 +
    void *vbase;
 +
    void *pbase; // Physical address to use as base
 +
    SceSize alignment;
 +
    SceUInt32 extraLow;
 +
    SceUInt32 extraHigh;
 +
    void *base;
 +
    SceUID pid;
 +
    SceKernelPAVector *pPAV;
 +
    SceSize vsize;
 +
    SceUInt32 unk_30;
 +
} SceKernelAllocMemBlockOptKernel_old;
 +
 
 +
/**
 +
* Option parameter of kernel sceKernelAllocMemBlock on recent FWs (as seen on FW 3.60)
 +
*/
 +
typedef struct SceKernelAllocMemBlockOptKernel { // size is 0x58 on FW 3.60
 +
SceSize size; // Size of this structure
 +
SceUInt32 unk_4;
 +
SceUInt32 attr;
 +
void *vbase;
 +
void *pbase; // Physical address to use as base
 +
SceSize alignment;
 +
SceUInt32 extraLow;
 +
SceUInt32 extraHigh;
 +
void *base;
 +
SceUID pid;
 +
SceKernelPAVector *pPAV;
 +
SceSize vsize;
 +
SceUInt32 unk_30;
 +
SceUInt32 unk_34;
 +
SceUInt32 unk_38;
 +
SceUInt32 unk_3C;
 +
SceUInt32 unk_40;
 +
SceUInt32 unk_44;
 +
SceUInt32 unk_48;
 +
SceUInt32 unk_4C;
 +
SceUInt32 unk_50;
 +
SceUInt32 unk_54;
 +
} SceKernelAllocMemBlockOptKernel;
 +
 
 +
/**
 +
* Attributes to enable some SceKernelAllocMemBlockOpt members.
 +
*/
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_VBASE 0x00000001
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PBASE 0x00000002
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT 0x00000004
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_EXTRA_LOW 0x00000008
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_EXTRA_HIGH 0x00000010
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_BASE 0x00000040
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PID 0x00000080
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_BASENAME 0x00000200 // Need to find where basename is located in the structure
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PPAV 0x00001000
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_SIZE 0x00002000
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_FIELD_30 0x00010000
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_NOPHYPAGE 0x00020000
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_PHYCONT 0x00200000 // Memory area is physically continuous.
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_UNK 0x00400000
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_SHARE_VBASE 0x00800000
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_SHARE_PHYPAGE 0x01000000
 +
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_ALLOW_PARTIAL_OP 0x04000000 // Allow partial operation. ?What does that mean?
 +
 
 +
/**
 +
* UID is created by sceKernelOpen***()
 +
*/
 +
#define SCE_UID_ATTR_OPEN_FLAG 0x00080000U
 +
 
 +
typedef struct SceKernelHeapInfo { // size is 0xCC on FW 0.990
 +
SceSize size; // Size of this structure
 +
char unk_4[0xC8];
 +
} SceKernelHeapInfo;
 +
 
 +
typedef struct SceKernelHeapObject { // size is 0x40 on FW 0.990
 +
SceSize size; // Size of this structure
 +
uint32_t unk_4; // 0x4
 +
uint32_t unk_8; // 0x8
 +
uint32_t unk_C; // 0xC
 +
uint32_t unk_10; // 0x10
 +
uint32_t unk_14; // 0x14
 +
uint32_t unk_18; // 0x18
 +
uint32_t unk_1C; // 0x1C
 +
uint32_t unk_20; // 0x20
 +
uint32_t unk_24; // 0x24
 +
uint32_t unk_28; // 0x28
 +
uint32_t unk_2C; // 0x2C
 +
uint32_t unk_30; // 0x30
 +
uint32_t magic; // 0x34 - 0xD2BBDEC3
 +
uint32_t unk_38; // 0x38
 +
uint32_t unk_3C; // 0x3C
 +
uint32_t unk_40; // 0x40
 +
} SceKernelHeapObject;
 +
 
 +
typedef struct SceKernelFixedHeap { // size is 0x40 on FW 0.990
 +
SceSize size; // Size of this structure
 +
SceClass pClass; // 0x4
 +
uint32_t unk_8; // 0x8
 +
uint32_t unk_C; // 0xC
 +
uint32_t unk_10; // 0x10
 +
uint32_t unk_14; // 0x14
 +
uint32_t pageSize; // 0x18 - min 0x1000 on FW 0.990
 +
uint16_t itemSize; // 0x1C
 +
uint16_t unk_1E; // 0x1E
 +
uint32_t unk_20; // 0x20
 +
uint32_t unk_24; // 0x24
 +
uint32_t magic; // 0x28 - 0xFD9B28A6
 +
uint16_t sizeInWords; // 0x2C
 +
uint16_t index; // 0x2E
 +
SceKernelHeapObject *heapObject; // 0x30
 +
uint32_t unk_34; // 0x34
 +
uint32_t unk_38; // 0x38
 +
uint16_t unk_3C; // 0x3C
 +
} SceKernelFixedHeap;
 +
 
 +
typedef struct SceKernelFixedHeapInfo { // size is 0x14 on FW 0.990
 +
SceSize size; // Size of this structure
 +
uint32_t unk_4; // = (uint32_t)*(uint16_t *)(pObject + 0x1C)
 +
uint32_t unk_8; // = *(uint32_t *)(pObject + 0x18) + (uint32_t)*(uint16_t *)(pObject + 0x2E)
 +
uint32_t unk_C; // = (uint32_t)*(uint16_t *)(pObject + 0x1E)
 +
uint32_t unk_10; // = (uint32_t)*(uint16_t *)(pObject + 0x20)
 +
} SceKernelFixedHeapInfo;
 +
 
 +
typedef struct SceKernelHeapMemoryOpt { // size is 0x14 on FW 0.990
 +
SceSize size; // Size of this structure
 +
uint32_t unk_4;
 +
SceSize alignment; // ex: 0x10
 +
uint32_t unk_C; // ex: 0x20
 +
uint32_t unk_10;
 +
} SceKernelHeapMemoryOpt;
 +
 
 +
typedef struct SceAddressSpace { // size is at least 0xEC
 +
char unk[0x14];
 +
SceKernelMMUContext *context;
 +
char unk[0xC4];
 +
void *funcAlloc;
 +
char unk2[0x8];
 +
uint32_t magic; // always 0x4d95AEEC
 +
} SceAddressSpace;
 +
 
 +
typedef struct SceKernelAddressSpace { // size is 0x10 bytes on FW 0.940-3.60
 +
    SceSize size; // Size of this structure
 +
    int flag;
 +
    void *data_0x08; // info dst buff ptr, need AddrSpace.flag  = 2;
 +
    void *data_0x0C; // info dst buff ptr, need AddrSpace.flag |= 4;
 +
} SceKernelAddressSpace;
 +
 
 +
typedef struct SceKernelVARange {
 +
uint32_t vaddr;
 +
uint32_t length;
 +
} SceKernelVARange;
 +
 
 +
typedef struct SceKernelPARange {
 +
uint32_t paddr;
 +
uint32_t length;
 +
} SceKernelPARange;
 +
 
 +
typedef struct SceKernelPAVector { // size is 0x14 on FW 0.990
 +
SceSize size; // Size of this structure
 +
uint32_t pRanges_size; // Ex: 8
 +
uint32_t nDataInVector; // Must be <= 8
 +
uint32_t count;
 +
SceKernelPARange *pRanges;
 +
} SceKernelPAVector;
 +
 
 +
#define SCE_KERNEL_PROCESS_ID_SELF 0 // Current running process ID is always 0.
 +
 
 +
typedef struct SceKernelPhyMemPart { // size is at least 0x9C on FWs 0.931-3.60
 +
    uint32_t field_0x0;
 +
    uint32_t field_0x4;
 +
    uint32_t some_counter; // always positive
 +
    uint32_t field_0xc;
 +
    char *name;
 +
    int type; // 0x10000 for Lpddr2Main, 0x30000 for Cdram
 +
    int mutex;
 +
    uint32_t field_0x1c;
 +
    SceSize totalSize;
 +
    int field_0x24;
 +
    int pRoot;
 +
    uint32_t field_0x2c;
 +
    uint32_t field_0x30;
 +
    uint32_t field_0x34;
 +
    uint32_t field_0x38;
 +
    int status;
 +
    int pindex40; //1
 +
    int field_0x44;
 +
    int pindex48; //2
 +
    int field_0x4c;
 +
    int pindex50; //3
 +
    int field_0x54;
 +
    int pindex58; //4
 +
    int field_0x5c;
 +
    int pindex60; //5
 +
    int field_0x64;
 +
    int pindex68; //6
 +
    int field_0x6c;
 +
    int pindex70; //7
 +
    int field_0x74;
 +
    int pindex78; //8
 +
    int field_0x7c;
 +
    int pindex80; //9
 +
    SceSize psize2;
 +
    int min;
 +
    int pindex8C; //10
 +
    int field_0x90;
 +
    int nClient;
 +
    SceSize freeSize;
 +
} SceKernelPhyMemPart;
 +
 
 +
typedef struct ScePhyMemPartInfoCore { // size is 0x10 on FWs 0.990-3.60
 +
  SceUInt32 unk_0; // same as SceKernelPhyMemPart field 0x1C
 +
  SceSize totalSize;
 +
  SceSize freeSize;
 +
  SceUInt32 unk_C; // maybe some counter
 +
} ScePhyMemPartInfoCore;
 +
 
 +
/**
 +
* An enumeration to represent the various logging levels which can be output by sceDbgLoggingHandler().
 +
*/
 +
typedef enum SceDbgLogLevel {
 +
    SCE_DBG_LOG_LEVEL_TRACE = 0, /* An extremely verbose logging level, mostly useful for internal developers. */
 +
    SCE_DBG_LOG_LEVEL_DEBUG,    /* A diagnostic logging level. */
 +
    SCE_DBG_LOG_LEVEL_INFO,      /* An informational logging level. */
 +
    SCE_DBG_LOG_LEVEL_WARNING,  /* A logging level that gives warnings of situations detrimental to proper execution. */
 +
    SCE_DBG_LOG_LEVEL_ERROR,    /* A logging level that will report erroneous conditions in execution. */
 +
    SCE_DBG_NUM_LOG_LEVELS      /* The number of logging levels available. */
 +
} SceDbgLogLevel;
 +
 
 +
/*
 +
Target Manager (Communication Processor) Logging levels.
 +
These levels can be set using psp2ctrl set-logging-level <level>.
 +
LOG_LEVEL_NONE (0)
 +
LOG_LEVEL_ERROR (1)
 +
LOG_LEVEL_WARNING (2)
 +
LOG_LEVEL_SERVICE (3)
 +
LOG_LEVEL_INFO (4)
 +
LOG_LEVEL_INTERNAL (5)
 +
LOG_LEVEL_MAX (6)
 +
*/
 +
 
 +
typedef struct SceSyscallInfo { // size is 0x3C on FW 3.60
 +
    SceSize size; // Size of this structure
 +
    SceUInt32 moduleFingerprint;
 +
    SceUInt32 maybeModuleAttr;
 +
    char moduleName[0x20];
 +
    char *libName;
 +
    SceUInt32 maybeLibAttr;
 +
    SceUInt32 libVer;
 +
    SceUInt32 libNid;
 +
} SceSyscallInfo;
 +
 
 +
typedef struct SceSyscallFrame { // size is at least 0x5C on FW 3.60
 +
SceUInt32 r0; // 0x00
 +
SceUInt32 r1; // 0x04
 +
SceUInt32 r2; // 0x08
 +
SceUInt32 r3; // 0x0C
 +
SceUInt32 r4; // 0x10
 +
SceUInt32 r5; // 0x14
 +
SceUInt32 r6; // 0x18
 +
SceUInt32 r7; // 0x1C
 +
SceUInt32 r8; // 0x20
 +
SceUInt32 r9; // 0x24
 +
SceUInt32 r10; // 0x28
 +
SceUInt32 r11; // 0x2C
 +
SceUInt32 r12; // 0x30
 +
SceUInt32 unk_34; // 0x34
 +
void *entry; // 0x38
 +
SceUInt32 unk_3C; // 0x3C
 +
SceUInt32 resultType; // 0x40, 0-3
 +
int unk_44[3]; // 0x44
 +
SceUInt32 SP; // 0x50
 +
SceUInt32 LR; // 0x54
 +
SceUInt32 PC; // 0x58
 +
} SceSyscallFrame;
 +
</source>
 +
 
 +
=== GetPhyMemPartIndex ===
 +
 
 +
<source lang="C">
 +
uint GetPhyMemPartIndex(uint param_1) {
 +
  uint cpuId;
 +
 
 +
  if (param_1 == 0xea0d050) goto LAB_81009494;
 +
  if (param_1 < 0xea0d051) {
 +
    if (param_1 == 0x620d004) {
 +
      return 6;
 +
    }
 +
    if (param_1 < 0x620d005) {
 +
      if (param_1 != 0x3b0d060) {
 +
        if (param_1 < 0x3b0d061) {
 +
          if (param_1 != 0x3a0d060) {
 +
            if (param_1 < 0x3a0d061) {
 +
              if (param_1 == 0x3a0d040) goto LAB_81009494;
 +
              if (param_1 == 0x3a0d050) {
 +
                return 10;
 +
              }
 +
            }
 +
            else {
 +
              if (param_1 == 0x3b0d040) goto LAB_81009494;
 +
              if (param_1 == 0x3b0d050) {
 +
                return 0xb;
 +
              }
 +
            }
 +
            goto LAB_81009402;
 +
          }
 +
        }
 +
        else {
 +
          if (param_1 != 0x3f0d060) {
 +
            if (param_1 < 0x3f0d061) {
 +
              if ((param_1 == 0x3f0d040) || (param_1 == 0x3f0d050)) goto LAB_81009494;
 +
            }
 +
            else {
 +
              if (param_1 == 0x6208004) {
 +
                return 6;
 +
              }
 +
              if (param_1 == 0x6208006) {
 +
                return 6;
 +
              }
 +
            }
 +
            goto LAB_81009402;
 +
          }
 +
        }
 +
      }
 +
LAB_81009494:
 +
      return (param_1 << 8) >> 0x1c;
 +
    }
 +
    if (param_1 == 0xc208060) {
 +
      return 0xb;
 +
    }
 +
    if (param_1 < 0xc208061) {
 +
      if (param_1 == 0x9408060) {
 +
        return 0xc;
 +
      }
 +
      if (param_1 < 0x9408061) {
 +
        if (param_1 == 0x620d006) {
 +
          return 6;
 +
        }
 +
        if (param_1 == 0x9404060) {
 +
          return 0xc;
 +
        }
 +
      }
 +
      else {
 +
        if (param_1 == 0xb100860) {
 +
          return 1;
 +
        }
 +
        if (param_1 == 0xc200860) {
 +
          return 0xb;
 +
        }
 +
      }
 +
    }
 +
    else {
 +
      if (param_1 == 0xea08040) goto LAB_81009494;
 +
      if (param_1 < 0xea08041) {
 +
        if (param_1 == 0xc20d050) {
 +
          return 0xb;
 +
        }
 +
        if (param_1 == 0xc20d060) {
 +
          return 0xb;
 +
        }
 +
      }
 +
      else {
 +
        if (param_1 == 0xea08060) goto LAB_81009494;
 +
        if (param_1 == 0xea0d040) {
 +
          return 10;
 +
        }
 +
      }
 +
    }
 +
  }
 +
  else {
 +
    if (param_1 == 0x20108004) {
 +
      return 1;
 +
    }
 +
    if (param_1 < 0x20108005) {
 +
      if (param_1 == 0x1020d006) {
 +
        return 6;
 +
      }
 +
      if (param_1 < 0x1020d007) {
 +
        if (param_1 == 0x10208004) {
 +
          return 6;
 +
        }
 +
        if (param_1 < 0x10208005) {
 +
          if (param_1 == 0xea0d060) goto LAB_81009494;
 +
          if (param_1 == 0x10200806) {
 +
            return 6;
 +
          }
 +
        }
 +
        else {
 +
          if (param_1 == 0x10208006) {
 +
            return 6;
 +
          }
 +
          if (param_1 == 0x1020d004) {
 +
            return 6;
 +
          }
 +
        }
 +
      }
 +
      else {
 +
        if (param_1 == 0x20100206) {
 +
          return 1;
 +
        }
 +
        if (param_1 < 0x20100207) {
 +
          if (param_1 == 0x1050d006) {
 +
            return 5;
 +
          }
 +
          if (param_1 == 0x20100204) {
 +
            return 1;
 +
          }
 +
        }
 +
        else {
 +
          if (param_1 == 0x20100804) {
 +
            return 1;
 +
          }
 +
          if (param_1 == 0x20100806) {
 +
            return 1;
 +
          }
 +
        }
 +
      }
 +
    }
 +
    else {
 +
      if (param_1 == 0x60208006) {
 +
        return 6;
 +
      }
 +
      if (param_1 < 0x60208007) {
 +
        if (param_1 == 0x40404006) {
 +
          return 0xc;
 +
        }
 +
        if (param_1 < 0x40404007) {
 +
          if (param_1 == 0x20108006) {
 +
            return 1;
 +
          }
 +
          if (param_1 == 0x2010d006) {
 +
            return 1;
 +
          }
 +
        }
 +
        else {
 +
          if (param_1 == 0x40408006) {
 +
            return 0xc;
 +
          }
 +
          if (param_1 == 0x60208004) {
 +
            return 6;
 +
          }
 +
        }
 +
      }
 +
      else {
 +
        if (param_1 == 0x6050d006) goto LAB_81009494;
 +
        if (param_1 < 0x6050d007) {
 +
          if (param_1 == 0x6020d004) {
 +
            return 6;
 +
          }
 +
          if (param_1 == 0x6020d006) {
 +
            return 6;
 +
          }
 +
        }
 +
        else {
 +
          if (0x70f0d003 < param_1) {
 +
            if (param_1 < 0x70f0d007) goto LAB_81009494;
 +
            if (param_1 == 0xa0408006) {
 +
              return 0xc;
 +
            }
 +
          }
 +
        }
 +
      }
 +
    }
 +
  }
 +
LAB_81009402:
 +
  cpuId = ksceKernelCpuGetCpuId();
 +
  SceDebugForDriver_1A3F2AA4
 +
            (1,
 +
            "%d:address_space.c:%s:Warning:Using SCE_KERNEL_PHYMEMPART_LPDDR2MAIN_KERNEL_INDEX for0x%08x\n"
 +
            ,cpuId,"GetPhyMemPartIndex",param_1);
 +
  return 6;
 +
}
 +
</source>
 +
 
 +
== Memory Block Type ==
 +
 
 +
The <code>type</code> parameter indicates what kind of memory to allocate. Here is a mapping of <code>type</code> flags to ARM MMU flags. Higher bits are used for other options including where to allocate from. Not all flag values are valid, there is a table of valid types in the kernel. You cannot, for example, allocate RWX memory.
 +
 
 +
=== memtype bit value ===
 +
 
 +
{| class="wikitable"
 
|-
 
|-
! Version !! NID
+
! Mask !! Value !! Description
 
|-
 
|-
| 1.69 || 0x7B763A21
+
| 0x10000 || 0x10000 || Global. <code>nG</code> bit NOT set
|}
 
=== sceKernelGetSubbudgetInfo ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF00 || 0x800 || <code>B</code> bit set. Sharable device memory.
 
|-
 
|-
| 1.69 || 0x832B4A65
+
| 0xFF00 || 0x2000 || <code>TEX[2]</code> and <code>TEX[0]</code> bit set. Outer cache Write-back, Write-Allocate. Inner cache non-cachable.
|}
 
=== sceKernelGetFreeMemorySize ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF00 || 0x4000 || <code>TEX[2]</code> and <code>B</code> bit set. Outer cache non-cachable. Inner cache Write-back, Write-Allocate
 
|-
 
|-
| 1.69 || 0x87CC580B
+
| 0xFF00 || 0x8000 || <code>TEX[0]</code> bit set. <code>S</code> bit unset. Outer and inner non-cachable. Not sharable.
|}
 
=== sceKernelOpenMemBlock ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF00 || 0xD000 || <code>TEX[0]</code> bit set. <code>C,B</code> bits set. Outer and inner Write-back, Write-Allocate.
 
|-
 
|-
| 1.69 || 0x8EB8DFBB
+
| 0xFF || 0x4 || <code>AP[2:0] = 5</code>, <code>XN=1</code>. Privileged RO, User NA.
|}
 
=== sceKernelOpenVMDomain ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF || 0x5 || <code>AP[2:0] = 5</code>. Privileged RX, User NA.
 
|-
 
|-
| 1.69 || 0x9CA3EB2B
+
| 0xFF || 0x6 || <code>AP[2:0] = 1</code>, <code>XN=1</code>. Privileged RW, User NA.
|}
 
=== sceKernelFindMemBlockByAddr ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF || 0x7 || <code>AP[2:0] = 1</code>. Privileged RWX, User NA. (Never used, 3.60 0x80024B01)
 
|-
 
|-
| 1.69 || 0xA33B99D1
+
| 0xFF || 0x50 || <code>AP[2:0] = 7</code>. Privileged RX, User RX.
|}
 
=== sceKernelFreeMemBlock ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF || 0x60 || <code>AP[2:0] = 3</code>, <code>XN=1</code>. Privileged RW, User RW.
 
|-
 
|-
| 1.69 || 0xA91E15EE
+
| 0xFF || 0x40 || <code>AP[2:0] = 7</code>, <code>XN=1</code>. Privileged RO, User RO.
|}
 
=== sceKernelCloseMemBlock ===
 
{| class="wikitable"
 
|-
 
! Version !! NID
 
 
|-
 
|-
| 1.69 || 0xB680E3A0
 
 
|}
 
|}
=== sceKernelGetMemBlockBase ===
+
 
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Mask !! Value !! Name
 
|-
 
|-
! Version !! NID
+
| 0x0F000000 || 0x09000000 || SceKernelUserCdram
 
|-
 
|-
| 1.69 || 0xB8EF5818
+
| 0x0F000000 || 0x0A000000 || SceKernelUserShared
|}
 
=== sceKernelAllocMemBlock ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0F000000 || 0x0B000000 || SceKernelUserIO
 
|-
 
|-
| 1.69 || 0xB9D5EBDE
+
| 0x0F000000 || 0x0C000000 || SceKernelUserMain
|}
 
=== sceKernelPartialMapMemBlock ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0F000000 || 0x0D000000 || SceKernelUserUncache
|-
 
| 1.69 || 0xC0A59868
 
|}
 
=== sceKernelPartialUnmapMemBlock ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0F000000 || 0x0E000000 || SceKernelUserCDialog
 
|-
 
|-
| 1.69 || 0xCA99929B
+
| 0x0F000000 || 0x0F000000 || SceKernelUserCDialogNC
|}
 
=== sceKernelCloseVMDomain ===
 
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 1.69 || 0xD6CA56CA
 
|}
 
=== sceKernelAllocMemBlockForVM ===
 
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 1.69 || 0xE2D7E137
 
|}
 
=== sceKernelUnmapMemBlock ===
 
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 1.69 || 0xEE30D976
 
 
|}
 
|}
  
== SceDipsw ==
+
=== Available memory types ===
== SceCpu ==
+
 
This library provides wrapper for much ARM CP15 co-processor access as well as low level support of spinlocks and other synchronization primitives.
+
See also : [[Memory budget]]
== SceSysclib ==
+
 
The C standard library for use in the kernel only. (User code have [[SceLibKernel]], which confusingly is user-only code). Include standard string functions (no insecure variants like <code>strcpy</code>).
+
<source lang="C">
=== strcmp ===
+
type bits
{| class="wikitable"
+
 
|-
+
mask
! Version
+
0x0000000F : only kernel
! NID
+
0x000000F0 : only user
|-
+
 
| 1.69 (non-secure)
+
RWXO bit
| 0x0B33BC43
+
0 1 1 0
|}
+
? R W X
=== strncmp ===
+
 
{| class="wikitable"
+
RO type when both w bit and x bit are 0
|-
+
 
! Version
+
memory device type(?)
! NID
+
mask : 0x00000F00
|-
+
0x00000200 : SO
| 1.69 (non-secure)
+
0x00000800 : DEVICE
| 0x12cee649
+
 
|}
+
memory cache type
=== strstr ===
+
mask : 0x0000F000
{| class="wikitable"
+
0x00002000 : No internal cache only
|-
+
0x00004000 : No external cache only
! Version
+
0x00008000 : NORMAL_NC (uncache)
! NID
+
0x0000D000 : NORMAL (cache)
|-
+
 
| 1.69 (non-secure)
+
memory budget type
| 0x1304A69D
+
mask : 0x00F00000
|}
+
0x00100000 : IO
=== rshift ===
+
0x00200000 : NORMAL(kernel:KD, user:GAME)
{| class="wikitable"
+
0x00300000 : maybe unused
|-
+
0x00400000 : CDRAM
! Version
+
0x00500000 : GAME
! NID
+
0x00800000 : PHYCONT
|-
+
0x00900000 : SHARED(userland only)
| 1.69 (non-secure)
+
0x00A00000 : CDIALOG
| 0x1D89F6C0
+
0x00C00000 : ???
|}
+
0x00F00000 : TOOL
=== memcpy ===
+
 
{| class="wikitable"
+
memory access type?
|-
+
mask : 0x0F000000
! Version
+
0x05000000 : CDRAM2
! NID
+
0x06000000 : KTMP
|-
+
0x09000000 : CDRAM
| 1.69 (non-secure)
+
0x0C000000 : normal?
| 0x40c88316
+
0x0D000000 : MAIN PHYCONT
|}
+
0x0E000000 : CDIALOG
=== strchr ===
+
 
{| class="wikitable"
+
memory access type2? (only kernel)
|-
+
mask : 0xF0000000
! Version
+
0x00000000 : USER
! NID
+
0x10000000 : ROOT
|-
+
0x20000000 : IO
| 1.69 (non-secure)
+
0x30000000 : PHYCONT
| 0x38463759
+
0x40000000 : CDRAM
|}
+
0x50000000 : CDRAM2
=== memset2 ===
+
0x60000000 : TMP
{| class="wikitable"
+
0xA0000000 : GPU
|-
+
 
! Version
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM2_RW                0x05408060
! NID
+
 
|-
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP*****                0x0620D006
| 1.69 (non-secure)
+
 
| 0x502B000D
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW_UNCACHE_EXTERNAL 0x09404060
|}
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RO_UNCACHE          0x09408040
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW_UNCACHE          0x09408060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW                  0x09408060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RWDATA              0x09408060
 +
 
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_DEVICE_RW                0x0C200860
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW                    0x0C208060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE                0x0C208060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA_UNCACHE            0x0C208060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_RO                        0x0C20D040
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_TEXT                      0x0C20D050
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW                        0x0C20D060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA                    0x0C20D060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_GAME_RW                  0x0C50D060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW          0x0C80D060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_UNKNOWN_RW_UNCACHE        0x0CA08060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_UNKNOWN_RW                0x0CA0D060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_UNKNOWN2_RW              0x0CF0D060
 +
 
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW        0x0D808060
 +
 
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_RO_UNCACHE        0x0E208040
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_RX_UNCACHE        0x0E208050
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_RW_UNCACHE        0x0E208060
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_RO                0x0E20D040
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_RW                0x0E20D060
 +
 
 +
 
 +
kernel memory types:
 +
 
 +
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_DEVICE_RW          0x10200806
 +
 
 +
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_SO_RW              0x10200206
 +
 
 +
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R_UNCACHE          0x10208004
  
=== memmove ===
+
/* alloc from ScePhyMemPartKD */
On 1.69, this seems to be implemented incorrectly.
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_UNCACHE        0x10208006
{| class="wikitable"
+
 
|-
+
/* alloc from ScePhyMemPartKD */
! Version
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R                  0x1020D004
! NID
+
 
|-
+
/* alloc from ScePhyMemPartKD */
| 1.69 (non-secure)
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX                0x1020D005
| 0x6CC9C1A1
+
 
|}
+
/* alloc from ScePhyMemPartKD */
=== strrchr ===
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW                0x1020D006
{| class="wikitable"
+
 
 +
/* alloc from ScePhyMemPartGame */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_GAME            0x1050D006
 +
 
 +
/* alloc from ScePhyMemPartPhyCont */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_PHYCONT        0x1080D006
 +
 
 +
/* alloc from ScePhyMemPartGameCDialog */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_CDIALOG        0x10A0D006
 +
 
 +
// for larger size memblock, ex:16MiB
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_10C0D006        0x10C0D006
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RO          0x20100204
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RW          0x20100206
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_RO              0x20100804
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_RW              0x20100806
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_NC_RO          0x20108004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_NC_RW          0x20108006
 +
 
 +
/* alloc from ScePhyMemPartPhyCont */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_PHYCONT_RW_UNCACHE 0x30808006
 +
 
 +
/* from L1?*/
 +
/* alloc from ScePhyMemPartGameCdram */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_RW_UNK      0x40404006
 +
 
 +
/* from L2?*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_RW          0x40408006
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM2_RW          0x50408006
 +
 
 +
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_NC_R          0x60208004
 +
 
 +
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_NC_RW          0x60208006
 +
 
 +
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_R              0x6020D004
 +
 
 +
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_RW            0x6020D006
 +
 
 +
/* alloc from ScePhyMemPartGame */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_GAME_RW        0x6050D006
 +
 
 +
code memory types:
 +
SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_L2WBWA: 0x2000
 +
SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_L1WBWA: 0x4000
 +
SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_NORMAL_NC: 0x8000
 +
 
 +
from 0.990
 +
/* need check */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_L1WBWA_RW
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_SO_RW        0x10200206
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_DEVICE_RW    0x10200806
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_NC_R          0x10208004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_NC_RW        0x10208006
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_R            0x1020D004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_RX            0x1020D005
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_RW            0x1020D006
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_BOOT_IMAGE        0x1020D007
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_GAME_RW      0x1050D006
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_R            0x20100204
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_DEVICE_R        0x20100804
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_DEVICE_RW      0x20100806
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_NC_R            0x20108004
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_NC_R  0x30808004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_NC_RW 0x30808006
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_R    0x3080D004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_RW    0x3080D006
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_UMAIN_RW
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_CDIALOG_R    0x10A0D004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_CDIALOG_RW    0x10A0D006
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_NC_RW        0x10F08004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_NC_R          0x10F08006
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_R            0x10F0D004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_RX            0x10F0D005
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_RW            0x10F0D006
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_NC_R          0x60208004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_NC_RW          0x60208006
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_R              0x6020D006
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_GAME_RW        0x6050D006
 +
 
 +
/* need check */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_KMP_TOOL_RW        0x60F0D006
 +
 
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_GPU_CDRAM_RW      0xA0408006
 +
</source>
 +
 
 +
=== memory allocate test ===
 +
 
 +
{| class="wikitable"
 
|-
 
|-
! Version
+
! mem type !! mem size !! mem base
! NID
 
 
|-
 
|-
| 1.69 (non-secure)
+
| 0x0C200860 || 0x200000 || 0x80100000
| 0x7F0E0835
 
|}
 
=== strncat ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version
+
| 0x0C208060 || 0x200000 || 0x70000000
! NID
 
 
|-
 
|-
| 1.69 (non-secure)
+
| 0x0C20D040 || 0x200000 || 0x85200000
| 0xA1D1C32C
 
|}
 
=== strtol ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version
+
| 0x0C20D060 || 0x200000 || 0x85200000
! NID
 
 
|-
 
|-
| 1.69 (non-secure)
+
| 0x0C50D060 || 0x200000 || 0x85200000
| 0xAB77C5AA
 
|}
 
=== snprintf ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version
+
| 0x0C80D060 || 0x200000 || 0x85200000
! NID
 
 
|-
 
|-
| 1.69 (non-secure)
+
| 0x0CA08060 || 0x200000 || 0x70000000
| 0xAE7A8981
 
|}
 
=== sceKernelStackCheckFail ===
 
{| class="wikitable"
 
|-
 
! Version
 
! NID
 
 
|-
 
|-
| 1.69 (non-secure)
+
| 0x0CA0D060 || 0x200000 || 0x85200000
| 0xb997493d
 
|}
 
=== strnlen ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version
+
| 0x0CF0D060 || 0x200000 || error, Looks like a memory type to reserve a fairly large size memory
! NID
 
 
|-
 
|-
| 1.69 (non-secure)
+
| 0x0D808060 || 0x200000 || 0x70000000
| 0xCD4BD884
 
|}
 
=== strlen ===
 
{| class="wikitable"
 
|-
 
! Version
 
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0xCFC6A9AC
 
|}
 
=== memcmp ===
 
{| class="wikitable"
 
|-
 
! Version
 
! NID
 
|-
 
| 1.69 (non-secure)
 
| 0xF939E83D
 
|}
 
 
 
== SceDipsw ==
 
 
 
=== sceKernelCheckDipsw ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0E208040 || 0x200000 || 0x68000000
 
|-
 
|-
| 1.69 || 0x1C783FB2
+
| 0x0E208050 || 0x200000 || error, It seems that RX memory cannot be allocated from the user
|}
 
=== sceKernelClearDipsw ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0E208060 || 0x200000 || 0x68000000
 
|-
 
|-
| 1.69 || 0x800EDCC1
+
| 0x0E20D040 || 0x200000 || 0xD0300000
|}
 
=== sceKernelSetDipsw ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0E20D060 || 0x200000 || 0xD0300000
 
|-
 
|-
| 1.69 || 0x817053D4
 
 
|}
 
|}
== SceDipswForDriver ==
 
== SceUartForKernel ==
 
== SceCpu ==
 
  
 +
=== Types to reverse ===
  
=== sceKernelCpuId ===
+
from 0.990:
{| class="wikitable"
+
<source>
|-
+
CDIALOG:
! Version !! NID
+
SCE_KERNEL_MEMBLOCK_TYPE_CDIALOG_NC_R
|-
 
| 1.69 || 0x2704CFEE
 
|}
 
== SceCpuForKernel ==
 
  
<source lang="C">void SceCpuForKernel_1BB2BB8D(void); // BPIALLIS, Branch predictor invalidate all (IS)</source>
+
FREE:
 +
SCE_KERNEL_MEMBLOCK_TYPE_FREE
  
<source lang="C">void SceCpuForKernel_264DA250(void); // ICIALLUIS, Instruction cache invalidate all (PoU, IS)</source>
+
KERNEL:
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_L1WBWA_RW
  
<source lang="C">void SceCpuForKernel_2F3BF020(void); //DCISW, Data cache invalidate by set/way (all the cache)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_DEVICE_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_DEVICE_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_R
  
<source lang="C">void SceCpuForKernel_470EAE1E(int mva); //DCIMVAC, Data cache invalidate by MVA (PoC)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_KMP_TOOL_RW
  
<source lang="C">void SceCpuForKernel_4C4C7D6B(void); //BPIALL, Branch predictor invalidate all</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_CDIALOG_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_CDIALOG_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_DEVICE_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_GAME_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_RX
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_SO_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_UMAIN_RW
  
<source lang="C">void SceCpuForKernel_583F30D1(void *addr, unsigned int size); //DCIMVAC, Data cache invalidate by MVA (PoC)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_GAME_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_R
  
<source lang="C">void SceCpuForKernel_6BA2E51C(void *addr, unsigned int size); // DCCIMVAC, Data cache clean and invalidate by MVA (PoC)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_RX
  
<source lang="C">void SceCpuForKernel_73A30DB2(void); // DCCSW, Data cache clean by set/way (all the cache)</source>
+
USER:
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDIALOG_RX
  
<source lang="C">void SceCpuForKernel_76DAB4D0(void); // DCCISW, Data cache clean and invalidate by set/way (all the cache)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_NC_RW
  
<source lang="C">void SceCpuForKernel_AEE0B489(void); //ICIALLU, Instruction cache invalidate all (PoU)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_IO_DEVICE_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_IO_SO_RW
  
<source lang="C">void SceCpuForKernel_C5C1EE4E(void *addr, unsigned int size); // DCCMVAC, Data cache clean by MVA (PoC)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP_RW
  
<source lang="C">void SceCpuForKernel_C8E8C9E9(int mva); //DCCIMVAC, Data cache clean and invalidate by MVA (PoC)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_DEVICE_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_GAME_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_RX
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_TOOL_NC_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_TOOL_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_TOOL_RX
  
<source lang="C">void SceCpuForKernel_F4C7F578(void *addr, unsigned int size); // ICIMVAU, Instruction cache invalidate by MVA (PoU)</source>
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_CDIALOG_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_CDIALOG_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_CDIALOG_RX
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_MAIN_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_MAIN_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_MAIN_RX
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_SHARED_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_SHARED_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_SHARED_RX
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_TOOL_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_TOOL_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_SHARED_TOOL_RX
 +
</source>
  
<source lang="C">void SceCpuForKernel_F7159B55(int mva); // DCCMVAC, Data cache clean by MVA (PoC)</source>
+
== SceSysmemForKernel ==
  
==== Unrestricted Write for Kernel ====
+
=== sceKernelGrowPhyMemPartForKernel ===
Unrestricted memcpy by first setting the <code>DACR</code> register to <code>0xFFFF0000</code> and then doing a memcpy.
+
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x6B3F4102
 +
|}
 +
 
 +
Calls sceKernelGrowPhyMemPartWithFlagsForKernel with flags = 0.
 +
 
 +
<source lang="C">int sceKernelGrowPhyMemPartForKernel(SceKernelPhyMemPart *pPhyMemPart, SceSize psize);</source>
 +
 
 +
=== sceKernelGrowPhyMemPartWithFlagsForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x775AA5E3
 +
|}
 +
 
 +
Grows physical memory partition with flags.
 +
 
 +
<source lang="C">int sceKernelGrowPhyMemPartWithFlagsForKernel(SceKernelPhyMemPart *pPhyMemPart, int flags, SceSize psize);</source>
 +
 
 +
=== sceKernelGetGrownPhyMemPartSizeForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x4D809B47
 +
|}
 +
 
 +
This is a temp name.
 +
 
 +
Returns a global variable. This global variable is either a size or offset or address and is incremented by sceKernelGrowPhyMemPartWithFlagsForKernel.
 +
 
 +
<source lang="C">int sceKernelGetGrownPhyMemPartSizeForKernel(void);</source>
 +
 
 +
=== sceKernelAddressSpaceSetProcessForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x2476B90F
 +
|}
 +
 
 +
<source lang="C">int sceKernelAddressSpaceSetProcessForKernel(SceUID uid, SceUID pid);</source>
  
 +
=== sceKernelAddressSpaceChangeMMUContextForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Version
+
! Version !! NID
! NID
 
 
|-
 
|-
| 1.69
+
| 0.931-3.60 || 0x653B0849
| 0x8C683DEC
 
 
|}
 
|}
<source lang="c">int unrestricted_memcpy_for_kernel(void *dst, void *src, size_t len);</source>
 
  
== SceCpuForDriver ==
+
<source lang="C">int sceKernelAddressSpaceChangeMMUContextForKernel(SceUID uid);</source>
=== SceCpuForDriver_BF82DEB2_lock ===
+
 
 +
=== sceKernelAddressSpaceGetMMUL1InfoForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 1.60 || 0xBF82DEB2
+
| 0.931 || 0x671A3444
 +
|-
 +
| 3.60 || not present
 
|}
 
|}
 
+
 
<source lang="c">int SceCpuForDriver_BF82DEB2_lock(int *addr);</source>
+
<source lang="C">int sceKernelAddressSpaceGetMMUL1InfoForKernel(SceUID uid, const void *addr, void *pInfo);</source>
 
+
 
=== SceCpuForDriver_D6ED0C46_unlock ===
+
=== sceKernelAddressSpaceGetMMUL2InfoForKernel ===
{| class="wikitable"
+
{| class="wikitable"
|-
+
|-
! Version !! NID
+
! Version !! NID
|-
+
|-
| 1.60 || 0xD6ED0C46
+
| 0.931 || 0xCB6E1C80
|}
+
|-
 
+
| 3.60 || not present
<source lang="c">int SceCpuForDriver_D6ED0C46_unlock(int *addr);</source>
+
|}
 
+
 
These two functions implement a simple mutual exclusive access on a resource addr using LDREX/STREX.
+
<source lang="C">int sceKernelAddressSpaceGetMMUL2InfoForKernel(SceUID uid, const void *addr, void *pInfo);</source>
 
+
 
<hr>
+
=== sceKernelAddressSpaceGetMMUL1AllInfoForKernel ===
 
+
{| class="wikitable"
=== SceCpuForDriver_D32ACE9E_lock_int ===
+
|-
{| class="wikitable"
+
! Version !! NID
|-
+
|-
! Version !! NID
+
| 0.931 || 0x1A898F2E
|-
+
|-
| 3.35 || 0xD32ACE9E
+
| 3.60 || not present
|}
+
|}
 
+
 
<source lang="c">int SceCpuForDriver_D32ACE9E_lock_int(int *addr);</source>
+
<source lang="C">
 
+
typedef struct SceKernelAddressSpaceMMUL1AllInfo { // size is 0x400C on FW 0.931
=== SceCpuForDriver_7BB9D5DF_unlock_int ===
+
  SceSize size; // Size of this structure
{| class="wikitable"
+
  char unk[0x4008];
|-
+
} SceKernelAddressSpaceMMUL1AllInfo;
! Version !! NID
+
 
|-
+
int sceKernelAddressSpaceGetMMUL1AllInfoForKernel(SceUID uid, SceKernelAddressSpaceMMUL1AllInfo *pInfo);</source>
| 3.35 || 0x7BB9D5DF
+
 
|}
+
=== sceKernelAddressSpaceGetMMUL2AllInfoForKernel ===
 
+
{| class="wikitable"
<source lang="c">void SceCpuForDriver_7BB9D5DF_unlock_int(int *addr, int prev_state);</source>
+
|-
 
+
! Version !! NID
Same as the pair above, but while mutex is held, interrupts are disabled. Used like this:
+
|-
<source lang="c">
+
| 0.931 || 0x1E1AA29B
int prev_state = SceCpuForDriver_D32ACE9E_lock_int(mutex);
+
|-
// do work
+
| 3.60 || not present
SceCpuForDriver_7BB9D5DF_unlock_int(mutex, prev_state);
+
|}
</source>
+
 
 
+
<source lang="C">
<hr>
+
typedef struct SceKernelAddressSpaceMMUL2AllInfo { // size is 0x404 on FW 0.931
=== SceCpuForDriver_4C38CE4D_lock_int_2 ===
+
  SceSize size; // Size of this structure
 +
  char unk[0x400];
 +
} SceKernelAddressSpaceMMUL2AllInfo;
 +
 
 +
int sceKernelAddressSpaceGetMMUL2AllInfoForKernel(SceUID uid, const void *addr, SceKernelAddressSpaceMMUL2AllInfo *pInfo);</source>
 +
 
 +
=== sceKernelGetPhyPartKernelForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x4D38F861
 +
|}
 +
 
 +
return gpPhyPartKernel;
 +
 
 +
<source lang="C">int sceKernelGetPhyPartKernelForKernel(void);</source>
 +
 
 +
=== sceKernelGetPhyMemPartInfoCoreForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931 || not present
 +
|-
 +
| 0.990-3.60 || 0x3650963F
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetPhyMemPartInfoCoreForKernel(SceKernelPhyMemPart *pPhyMemPart, ScePhyMemPartInfoCore *pInfo);</source>
 +
 
 +
=== sceKernelPhyMemLowAllocForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x5E169FEF
 +
|}
 +
 
 +
<source lang="C">
 +
// type must be 0x10001, 0x10002 or 0x20001
 +
int sceKernelPhyMemLowAllocForKernel(int type, uint size, uint alignment, void *out);
 +
</source>
 +
 
 +
=== sceKernelPhyMemLowPA2VAForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x0FD6B756
 +
|}
 +
 
 +
<source lang="C">
 +
// type must be 0x10002
 +
int sceKernelPhyMemLowPA2VAForKernel(int type, void *PA, void **pVA);
 +
</source>
 +
 
 +
=== sceKernelGetPhyMemLowInfoForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0x06A4DA6C
 +
|}
 +
 
 +
<source lang="C">
 +
typedef struct SceKernelPhyMemLowInfo { // size is 0x1C on FW 0.931-0.990
 +
SceSize size; // Size of this structure
 +
uint32_t unk_4;
 +
uint32_t unk_8;
 +
uint32_t unk_C;
 +
uint32_t unk_10;
 +
uint32_t unk_14;
 +
uint32_t unk_18;
 +
} SceKernelPhyMemLowInfo;
 +
 
 +
// type must be 0x10001, 0x10002 or 0x20001
 +
 
 +
int sceKernelGetPhyMemLowInfoForKernel(int type, SceKernelPhyMemLowInfo *info);
 +
</source>
 +
 
 +
=== sceKernelPhyMemLowFreeForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x18B99FDD
 +
|}
 +
 
 +
<source lang="C">
 +
// type must be 0x10001, 0x10002 or 0x20001
 +
int sceKernelPhyMemLowFreeForKernel(int type);
 +
</source>
 +
 
 +
=== sceGUIDtoClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x66636970
 +
|}
 +
 
 +
<source lang="C">SceClass *sceGUIDtoClassForKernel(SceUID uid);</source>
 +
 
 +
=== SceSysmemForKernel_95ABFDC3 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x95ABFDC3
 +
|}
 +
 
 +
<source lang="C">int SceSysmemForKernel_95ABFDC3(uint32_t flags);</source>
 +
 
 +
=== sceKernelRegisterClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x11761B77
 +
|}
 +
 
 +
=== sceKernelAllocKernelHeapForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0x432EADA6
 +
|}
 +
 
 +
<source lang="C">int sceKernelAllocKernelHeapForKernel(SceSize size);</source>
 +
 
 +
=== sceUIDCreateEntryHeapForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x19CAEF35
 +
|}
 +
 
 +
<source lang="C">int sceUIDCreateEntryHeapForKernel(void);</source>
 +
 
 +
=== sceUIDObjectSetClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0x226DE851
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceUIDObjectSetClassForKernel(SceKernelObject *pObject, SceClass *pClass);</source>
 +
 
 +
=== sceGUIDGetEntryInfoAllForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x2A79C51C
 +
|}
 +
 
 +
<source lang="C">int sceGUIDGetEntryInfoAllForKernel(SceUID uid, void *vectors, uint32_t nVector, void *out);</source>
 +
 
 +
=== sceGUIDNameForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x250EE289
 +
|}
 +
 
 +
<source lang="C">char *sceGUIDNameForKernel(SceUID uid);</source>
 +
 
 +
=== sceGUIDRegisterForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xAF42AAD5
 +
|}
 +
 
 +
<source lang="C">int sceGUIDRegisterForKernel(SceClass *pClass, const char *name, SceKernelObject *pObject);</source>
 +
 
 +
=== sceUIDRegisterForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0x59162CD7
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Calls sceGUIDRegisterForKernel.
 +
 
 +
<source lang="C">int sceUIDRegisterForKernel(SceClass *pClass, const char *name, SceKernelObject *pObject);</source>
 +
 
 +
=== SceSysmemForKernel_48D87E17 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x48D87E17
 +
|}
 +
 
 +
=== sceKernelGetAddressSpaceMMUContextForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xFBEF93AA
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetAddressSpaceMMUContextForKernel(SceUID uid, void *context);</source>
 +
 
 +
=== sceKernelAllocSimpleMemBlockForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xF81F4672
 +
|}
 +
 
 +
<source lang="C">
 +
typedef struct SceKernelSimpleMemBlock {
 +
char unk_0[0x14];
 +
void *base;
 +
char unk_18[0x14];
 +
void *PhyPage;
 +
SceSize size;
 +
} SceKernelSimpleMemBlock;
 +
 
 +
int sceKernelAllocSimpleMemBlockForKernel(const char *name, SceKernelMemBlockType type, SceSize vsize, SceKernelSimpleMemBlock *smb);
 +
</source>
 +
 
 +
=== sceKernelGetSimpleMemBlockBaseForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x0A8D14EC
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetSimpleMemBlockBaseForKernel(SceKernelSimpleMemBlock *smb, void **base);</source>
 +
 
 +
=== sceKernelGetMemBlockInfoSimpleForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x2364A170
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetMemBlockInfoSimpleForKernel(SceUID uid, SceKernelMemBlockInfoSimple *pInfo);</source>
 +
 
 +
=== sceKernelAddressSpaceVARangeToPAVectorForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xF7250E6C
 +
|}
 +
 
 +
<source lang="C">int sceKernelAddressSpaceVARangeToPAVectorForKernel(SceUID uid, const SceKernelVARange *vRange, SceKernelPAVector *pVector);</source>
 +
 
 +
=== sceKernelCreatePhyMemPartForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x2E36E0C4
 +
|}
 +
 
 +
Calls sceKernelCreatePhyMemPartByPbaseForKernel with pbase = 0.
 +
 
 +
<source lang="C">int sceKernelCreatePhyMemPartForKernel(const char *name, int type, SceSize psize, SceKernelPhyMemPart *pPhyMemPart);</source>
 +
 
 +
=== sceKernelCreatePhyMemPartByPbaseForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x63D83911
 +
|}
 +
 
 +
<source lang="C">
 +
/*
 +
type
 +
 
 +
ORed values:
 +
0x00002 : Shell
 +
0x00004 : Game
 +
0x00005 : PhyCont
 +
0x00060 : CDialog
 +
0x10000 : Lpddr2Main
 +
0x30000 : Cdram
 +
 
 +
seen values:
 +
0x10002 : ShellLpddr2Main (shared)
 +
0x10004 : GameLpddr2Main
 +
0x10005 : PhyContLpddr2Main
 +
0x10064 : GameCDialogLpddr2Main
 +
 
 +
0x30002 : ShellCdram
 +
0x30004 : GameCdram
 +
*/
 +
 
 +
int sceKernelCreatePhyMemPartByPbaseForKernel(const char *name, int type, void *pbase, SceSize psize, SceKernelPhyMemPart **ppPhyMemPart);
 +
</source>
 +
 
 +
=== sceKernelDeletePhyMemPartForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x2AEA9E09
 +
|}
 +
 
 +
<source lang="C">int sceKernelDeletePhyMemPartForKernel(SceKernelPhyMemPart *pPhyMemPart);</source>
 +
 
 +
=== sceKernelGetPhyMemPartAllForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x2F6F9C2C
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetPhyMemPartAllForKernel(int param_1, int param_2, void *pCountInBuffer);</source>
 +
 
 +
=== sceKernelGetPhyMemPartInfoForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0x67849418
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetPhyMemPartInfoForKernel(SceKernelPhyMemPart *pPhyMemPart, SceKernelPhyMemPartInfo *pInfo);</source>
 +
 
 +
=== sceKernelGetPhyMemPartInfoByIDForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xF4FA0575
 +
|}
 +
 
 +
<source lang="C">
 +
typedef struct SceKernelPhyMemPartInfo { // size is 0x44 on FW 0.931-0.990
 +
  SceSize size;  // Size of this structure
 +
  uint32_t unk_4; // some size or address
 +
  uint32_t unk_8; // some size or address
 +
  char unk1[0xC];
 +
  char *name; // name, maybe pointer or array
 +
  char unk2[0x24];
 +
} SceKernelPhyMemPartInfo;
 +
 
 +
int sceKernelGetPhyMemPartInfoByIDForKernel(SceUID id, SceKernelPhyMemPartInfo *pInfo);
 +
</source>
 +
 
 +
=== sceUIDDeleteEntryHeapForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xF0C3FCFC
 +
|}
 +
 
 +
<source lang="C">int sceUIDDeleteEntryHeapForKernel(SceUID uid);</source>
 +
 
 +
=== sceGUIDUnregisterForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0xE79BBCF2
 +
|}
 +
 
 +
<source lang="C">int sceGUIDUnregisterForKernel(SceUID uid);</source>
 +
 
 +
=== sceGUIDGetEntryInfoClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xE90CFD62
 +
|}
 +
 
 +
<source lang="C">int sceGUIDGetEntryInfoClassForKernel(SceUID uid, int a2, void *vectors, int nVector, void *out);</source>
 +
 
 +
=== sceKernelGetPhyPageResetForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xEB350679
 +
|}
 +
 
 +
<source lang="C">void *sceKernelGetPhyPageResetForKernel(void);</source>
 +
 
 +
=== sceKernelFreePhyPageForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x00BC5B4A
 +
|}
 +
 
 +
<source lang="C">int sceKernelFreePhyPageForKernel(uint32_t a1, int pPage, uint32_t a3, uint32_t a4);</source>
 +
 
 +
=== sceKernelNameHeapInsertForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x08AB3DAE
 +
|}
 +
 
 +
<source lang="C">int sceKernelNameHeapInsertForKernel(char *name, uint32_t flags, uint32_t *out);</source>
 +
 
 +
=== sceGUIDKernelCreateForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xE6FAD50A
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Create a GUID with default attribute (0x30000).
 +
 
 +
<source lang="C">int sceGUIDKernelCreateForKernel(SceClass *pClass, const char *name, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceGUIDKernelCreateWithAttrForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x53E1FFDE
 +
|}
 +
 
 +
Create a GUID with the specified attribute.
 +
 
 +
<source lang="C">int sceGUIDKernelCreateWithAttrForKernel(SceClass *pClass, const char *name, SceUInt32 attr, SceKernelObject **ppEntry);</source>
 +
 
 +
=== scePUIDKernelCreateWithAttrForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0xDF0288D7
 +
|}
 +
 
 +
Temp name was sceKernelCreateUidObjForKernel.
 +
 
 +
<source lang="c">
 +
typedef struct ScePUIDKernelCreateParam { // size is at least 0x20 on FW 3.60
 +
SceUInt32 attr;
 +
SceUInt32 field_4;
 +
SceUID uid;
 +
SceUID pid;
 +
SceUInt32 field_10;
 +
SceUInt32 field_14;
 +
SceUInt32 field_18;
 +
SceUInt32 field_1C;
 +
} ScePUIDKernelCreateParam;
 +
SceUID scePUIDKernelCreateWithAttrForKernel(SceClass *pClass, const char *name, ScePUIDKernelCreateParam *pParam, SceKernelObject **ppEntry);
 +
</source>
 +
 
 +
=== scePUIDReleaseObjectForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x3FCA782B
 +
|}
 +
 
 +
<source lang="C">int scePUIDReleaseObjectForKernel(SceUID pid, SceUID uid);</source>
 +
 
 +
=== scePUIDGetInfoForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x12ED88AE
 +
|}
 +
 
 +
<source lang="C">
 +
// pInfo size is 0x14 bytes
 +
int scePUIDGetInfoForKernel(SceUID pid, SceUID uid, void *pInfo);
 +
</source>
 +
 
 +
=== sceGUIDGetEntryForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x45F2A59C
 +
|}
 +
 
 +
=== sceGUIDGetVisibilityLevelForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xC69666C3
 +
|}
 +
 
 +
=== sceGUIDSetVisibilityLevelForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xCB8D03C0
 +
|}
 +
 
 +
=== sceGUIDFindByNameForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xCEBA8031
 +
|}
 +
 
 +
=== sceGUIDFindByNameAllForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x4B5C85AC
 +
|}
 +
 
 +
=== sceGUIDGetPIDForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xCF5A2311
 +
|}
 +
 
 +
=== sceGUIDSetCNOAForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x8D6AF468
 +
|}
 +
 
 +
=== sceGUIDSetForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xD7B323EB
 +
|}
 +
 
 +
<source lang="C">int sceGUIDSetForKernel(SceUID uid, SceClass *pClass, const char *name, SceKernelObject *pObject);</source>
 +
 
 +
=== sceUIDGetProcUIDVectorByClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x51C08396
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
=== sceUIDReferObjectWithLevelForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xF79B52B2
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceUIDReferObjectWithLevelForKernel(SceUID uid, SceUInt32 level, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceGUIDReferForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xB3E2AA7A
 +
|}
 +
 
 +
<source lang="C">int sceGUIDReferForKernel(SceUID pid, int guid);</source>
 +
 
 +
=== sceKernelPhysicalMemWriteForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931 || 0x4B86A751
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelPhysicalMemWriteForKernel(void *dest, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelPhysicalMemReadForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0xF96E3AE2
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Temp name was memcpy_from_paddr.
 +
 
 +
dest must be a vaddr and src must be a paddr. Return copied size on success.
 +
 
 +
<source lang="C">int sceKernelPhysicalMemReadForKernel(void *dest, const void *src, SceSize dest_size, SceSize src_size);</source>
 +
 
 +
=== sceKernelAllocPartitionMemBlockForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x5FFE4B79
 +
|}
 +
 
 +
Temp name was sceKernelAllocSystemCallTableForKernel.
 +
 
 +
<source lang="C">
 +
SceUID sceKernelAllocPartitionMemBlockForKernel(SceUID part, const char *name, SceKernelMemBlockType type, SceSize size, const struct SceKernelAllocMemBlockOptKernel *pOpt);
 +
</source>
 +
 
 +
=== sceUIDEntryHeapGetInfoForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x686AA15C
 +
|}
 +
 
 +
=== sceUIDEntryHeapCloseAllPUIDForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xFAF96C1F
 +
|}
 +
 
 +
<source lang="C">int sceUIDEntryHeapCloseAllPUIDForKernel(SceUID uid);</source>
 +
 
 +
=== sceKernelNameHeapGetInfoForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0xE443253B
 +
|}
 +
 
 +
=== sceKernelGetFixedHeapInfoByPointerForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x219E90FD
 +
|}
 +
 
 +
<source lang="C">
 +
// pObject is of size 0x30
 +
// pObject first 4 bytes are structure size
 +
int sceKernelGetFixedHeapInfoByPointerForKernel(void *pObject, SceKernelFixedHeapInfo *pInfo);</source>
 +
 
 +
=== sceKernelGetHeapInfoByPointerForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x68451777
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetHeapInfoByPointerForKernel(void *pObject, SceKernelHeapInfo *pInfo);</source>
 +
 
 +
=== sceKernelGetHeapInfoForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x91733EF4
 +
|}
 +
 
 +
<source lang="C">
 +
int sceKernelGetHeapInfoForKernel(SceUID uid, SceKernelHeapInfo *pInfo);
 +
</source>
 +
 
 +
=== sceKernelFreeSimpleMemBlockForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xA1FFA2C9
 +
|}
 +
 
 +
=== sceKernelAllocForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xC0A4D2F3
 +
|-
 +
| 3.65 || 0x85571907
 +
|}
 +
 
 +
<source lang="C">void *sceKernelAllocForKernel(SceSize len);</source>
 +
 
 +
=== sceKernelAllocWithOptForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xA2CD1697
 +
|}
 +
 
 +
<source lang="C">
 +
 
 +
typedef struct SceAllocOpt {
 +
    SceSize size;  // 0x14
 +
    SceSize data04; // maybe len align?
 +
    SceSize align;
 +
    int data0C;
 +
    int data10;
 +
} SceAllocOpt;
 +
 
 +
void *sceKernelAllocWithOptForKernel(SceSize len, SceAllocOpt *pOpt);
 +
 
 +
</source>
 +
 
 +
=== sceKernelFreeForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xABAB0FAB
 +
|-
 +
| 3.65 || 0x4233C16D
 +
|}
 +
<source lang="C">
 +
void sceKernelFreeForKernel(void *ptr);
 +
</source>
 +
 
 +
=== sceGUIDGetObjectWithClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x7ABFA9A7
 +
|}
 +
 
 +
Possible name are sceUIDGetObjectWithClassForKernel or sceUIDtoProcessForKernel.
 +
 
 +
<source lang="C">int sceGUIDGetObjectWithClassForKernel(SceUID uid, SceClass *pClass, SceKernelObject **obj);</source>
 +
 
 +
=== SceSysmemForKernel_C38D61FC ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xC38D61FC
 +
|}
 +
 
 +
Calls SceSysmemForDriver_89A44858.
 +
 
 +
=== sceUIDGetObjectForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0xC4893914
 +
|}
 +
 
 +
Calls sceGUIDGetObjectForDriver.
 +
 
 +
<source lang="C">int sceUIDGetObjectForKernel(SceUID uid, SceKernelObject **ppEntry);</source>
 +
 
 +
=== SceSysmemForKernel_620E00E7 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x620E00E7
 +
|}
 +
 
 +
<source lang="C">SceSysmemForKernel_620E00E7(int a1, int global_id, _DWORD *out);</source>
 +
 
 +
=== SceSysmemForKernel_7C797940 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x7C797940
 +
|}
 +
 
 +
Calls SceSysmemForKernel_620E00E7 or sceGUIDReferObjectForDriver.
 +
 
 +
=== sceKernelRxMemcpyKernelToUserForPidForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x30931572
 +
|}
 +
 
 +
Unrestricted memcpy to the virtual address space for process <code>pid</code>. Both <code>dst</code> and <code>src</code> must be in the address space of <code>pid</code> but <code>src</code> must also be accessible in the address space of the caller. This is normally used for resolving stubs in module loads. Same as write to RO but does a cache flush.
 +
 
 +
<source lang="c">int sceKernelRxMemcpyKernelToUserForPidForKernel(SceUID pid, void * dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceUIDtoObjectForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xED221825
 +
|}
 +
 
 +
Calls [[SceSysmem#sceGUIDGetObjectForDriver]].
 +
 
 +
<source lang="C">SceKernelObject *sceUIDtoObjectForKernel(SceUID uid);</source>
 +
 
 +
=== sceGUIDOpenByGUIDForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xCF53EEE4
 +
|}
 +
 
 +
=== sceGUIDGetUIDVectorByClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xEC7D36EF
 +
|}
 +
 
 +
Copy uid to vector by referring to all objects created by cls.
 +
 
 +
<source lang="C">
 +
/*
 +
* num - max copy number
 +
*/
 +
int sceGUIDGetUIDVectorByClassForKernel(SceClass *cls, int vis_level, SceUID *vector, SceSize num, SceSize *ret_num);
 +
</source>
 +
 
 +
=== sceUIDGetUIDVectorByClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0xA2F03233
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
It is simply a wrapper for sceGUIDGetUIDVectorByClassForKernel.
 +
 
 +
=== sceKernelCreateAddressSpaceForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x4A3737F0
 +
|-
 +
| 3.65 || 0x8EE89D2C
 +
|}
 +
 
 +
<source lang="C">
 +
// flag: 0x10000001
 +
// name: maybe titleid
 +
SceUID sceKernelCreateAddressSpaceForKernel(SceUID pid, const char *name, SceUInt32 flag, SceKernelAddressSpace *pAS);
 +
</source>
 +
 
 +
=== sceKernelDeleteAddressSpaceForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xF2D7FE3A
 +
|}
 +
 
 +
<source lang="C">int sceKernelDeleteAddressSpaceForKernel(SceUID guid);</source>
 +
 
 +
=== sceKernelAddressSpaceFreeAllMemBlockForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x89CE1F31
 +
|}
 +
 
 +
<source lang="C">int sceKernelAddressSpaceFreeAllMemBlockForKernel(SceUID guid);</source>
 +
 
 +
=== sceKernelAddressSpaceSetPhyMemPartForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x67955EE9
 +
|}
 +
 
 +
<source lang="C">int sceKernelAddressSpaceSetPhyMemPartForKernel(SceUID guid, int a2, SceKernelPhyMemPart *pPhyMemPart);</source>
 +
 
 +
=== sceKernelAddressSpaceUnmapForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xCE72839E
 +
|}
 +
 
 +
<source lang="C">int sceKernelAddressSpaceUnmapForKernel(SceUID uid, int unk, void *vbase, SceSize size);</source>
 +
 
 +
3.60:
 +
<source lang="C">int sceKernelAddressSpaceUnmapForKernel(SceUID uid, int flags, int unk, uint32_t paddr, SceSize size);</source>
 +
 
 +
Example: in SceSysStateMgr:
 +
<source lang="C">
 +
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF7, 0x51000000, 0x1000000);
 +
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0xE0000000, 0x8000000);
 +
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0x1A000000, 0x100000);
 +
</source>
 +
 
 +
3.60
 +
 
 +
<source lang="C">
 +
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF7, 0xC, 0x51000000, 0x1000000);
 +
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0xC, 0xE0000000, 0x8000000);
 +
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0xC, 0x1A000000, 0x100000);
 +
</source>
 +
 
 +
=== sceKernelAddressSpaceVAtoPAForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xF2179820
 +
|}
 +
 
 +
<source lang="C">int sceKernelAddressSpaceVAtoPAForKernel(SceAddressSpace *pAS, uint32_t mode, void *pVA, void **pPA);</source>
 +
 
 +
=== sceKernelAddressSpaceGetMemoryTypeForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xCC7BB240
 +
|}
 +
 
 +
<source lang="C">int sceKernelAddressSpaceGetMemoryTypeForKernel(uint32_t *memory_type);</source>
 +
 
 +
=== sceKernelFindClassByNameForKernel ===
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x62989905
 +
|}
 +
 
 +
<source lang="c">int sceKernelFindClassByNameForKernel(const char *name, SceClass **class);</source>
 +
 
 +
=== sceKernelGetMemBlockTypeForKernel ===
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x289BE3EC
 +
|}
 +
 
 +
<source lang="c">
 +
/***
 +
* Gets the memory block type of a memory block
 +
*
 +
* @param[in] uid - SceUID of the memory block
 +
* @param[out] type - Type of the memory block identified by uid
 +
*
 +
* @return 0 on success, < 0 on error.
 +
*/
 +
int sceKernelGetMemBlockTypeForKernel(SceUID uid, unsigned int *type);</source>
 +
 
 +
=== sceKernelGetUidHeapClassForKernel ===
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x4CCA935D
 +
|}
 +
 
 +
<source lang="c">SceClass *sceKernelGetUidHeapClassForKernel(void);</source>
 +
 
 +
=== sceKernelGetUidMemBlockClassForKernel ===
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xAF729575
 +
|}
 +
 
 +
<source lang="c">SceClass *sceKernelGetUidMemBlockClassForKernel(void);</source>
 +
 
 +
=== sceKernelGetUidDLinkClassForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xC105604E
 +
|}
 +
 
 +
<source lang="c">SceClass *sceKernelGetUidDLinkClassForKernel(void);</source>
 +
 
 +
=== SceSysmemForKernel_F8E95A5A ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xF8E95A5A
 +
|}
 +
 
 +
Certainly returns address to a structure.
 +
 
 +
<source lang="C">int SceSysmemForKernel_F8E95A5A(void);</source>
 +
 
 +
=== SceSysmemForKernel_54E85275 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.50 || not present
 +
|-
 +
| 3.60 || 0x54E85275
 +
|}
 +
 
 +
Uses result from [[SceSysmem#SceSysmemForKernel_F8E95A5A]].
 +
 
 +
<source lang="C">
 +
// some_struct comes from SceSysmemForKernel_F8E95A5A
 +
// out_struct size is 0xB0 bytes
 +
int SceSysmemForKernel_54E85275(void *some_struct, void *out_struct);
 +
</source>
 +
 
 +
=== SceSysmemForKernel_7BD56D6D ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.50 || not present
 +
|-
 +
| 3.60 || 0x7BD56D6D
 +
|}
 +
 
 +
Used by SceProcessmgr.
 +
 
 +
<source lang="C">int SceSysmemForKernel_7BD56D6D(SceUID guid, const char *name);</source>
 +
 
 +
=== SceSysmemForKernel_9C7B62AB ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x9C7B62AB
 +
|}
 +
 
 +
<source lang="C">
 +
// name max length is 31 characters
 +
int SceSysmemForKernel_9C7B62AB(const char *name, SceUInt32 flag);
 +
</source>
 +
 
 +
=== SceSysmemForKernel_153A08A0 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x153A08A0
 +
|}
 +
 
 +
Calls sceKernelCpuAtomicAddAndGet32ForDriver to increment by 1 value at addr + 0x94.
 +
 
 +
<source lang="C">int SceSysmemForKernel_153A08A0(void *addr);</source>
 +
 
 +
=== SceSysmemForKernel_942D15FC ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x942D15FC
 +
|}
 +
 
 +
Used to get GUID by name.
 +
 
 +
<source lang="C">int SceSysmemForKernel_942D15FC(const char *name, SceSize namelen, int unk_guid_global_value);</source>
 +
 
 +
=== SceSysmemForKernel_C8672A3D ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xC8672A3D
 +
|}
 +
 
 +
<source lang="C">int SceSysmemForKernel_C8672A3D(int unk);</source>
 +
 
 +
== SceSysmemForDriver ==
 +
 
 +
=== sceUIDGetDefaultClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0xFE28F5EB
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">SceClass *sceUIDGetDefaultClassForDriver(void);</source>
 +
 
 +
=== sceUIDtoClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x65B9B393
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Calls sceGUIDtoClassForKernel.
 +
 
 +
<source lang="C">SceClass *sceUIDtoClassForDriver(SceUID uid);</source>
 +
 
 +
=== scePUIDGetClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xE9728A12
 +
|}
 +
 
 +
Temp name was sceKernelGetClassForPidForUidForDriver.
 +
 
 +
<source lang="c">int scePUIDGetClassForDriver(SceUID pid, SceUID uid, SceClass **ppClass);</source>
 +
 
 +
=== sceGUIDGetClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xC74B0152
 +
|}
 +
 
 +
Temp name was sceKernelGetClassForUidForDriver.
 +
 
 +
<source lang="c">int sceGUIDGetClassForDriver(SceUID uid, SceClass **ppClass);</source>
 +
 
 +
=== sceUIDClassInitForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0xE6D75E99
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceUIDClassInitForDriver(SceClass *pClass, const char *name, uint32_t uid_class, SceSize item_size, void *constructor, void *destructor);</source>
 +
 
 +
=== add_heap ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xB800123C
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int add_heap(SceUID uid, const char *name, SceClass *class);</source>
 +
 
 +
=== sceKernelIsSubclassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x6484D03E
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">SceBool sceKernelIsSubclassForDriver(SceClass *parentClass, SceClass *class);</source>
 +
 
 +
=== sceGUIDNameForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xB2BB6216
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">char *sceGUIDNameForDriver(SceUID id);</source>
 +
 
 +
=== sceKernelGetMemBlockAllocSizeForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x63E5754B
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelGetMemBlockAllocSizeForDriver(SceUID id, SceSize *size);</source>
 +
 
 +
=== sceUIDGetClassInfoAllForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x3EF32C6C
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceUIDGetClassInfoAllForDriver(SceClassInfo_0990 *vector, uint32_t maxNumClass, uint32_t *pNumClassInBuf);</source>
 +
 
 +
=== sceUIDCloseForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x32C5F628
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
if (a2 & 0x40000000) == 0 calls sceGUIDCloseForDriver else scePUIDCloseForDriver.
 +
 
 +
<source lang="C">int sceUIDCloseForDriver(SceUID uid, SceUInt32 flag_or_addr_or_pid);</source>
 +
 
 +
=== SceSysmemForDriver_F09A7D09 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xF09A7D09
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Calls sceGUIDCloseForDriver.
 +
 
 +
<source lang="C">int SceSysmemForDriver_F09A7D09(SceUID uid);</source>
 +
 
 +
=== Switch TTB For PID ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69 || 0x6F2ACDAE
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Changes the TTBR to point to the tables for a given PID.
 +
 
 +
<source lang="c">int switch_ttb_for_pid(SceUID pid);</source>
 +
 
 +
=== sceKernelAllocHeapMemoryForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x7B4CB60A
 +
|}
 +
 
 +
Temp name was sceKernelMemPoolAlloc. Official name might also be sceUIDKernelCreateForDriver.
 +
 
 +
Calls [[SceSysmem#sceKernelAllocHeapMemoryWithOptionForDriver|sceKernelAllocHeapMemoryWithOptionForDriver]] with a3 = 0.
 +
 
 +
<source lang="c">void *sceKernelAllocHeapMemoryForDriver(SceUID uid, SceSize size);</source>
 +
 
 +
=== sceKernelAllocHeapMemoryFromGlobalHeapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x7750CEA7
 +
|}
 +
 
 +
Calls [[SceSysmem#sceKernelAllocHeapMemoryForDriver|sceKernelAllocHeapMemoryForDriver]] with uid = -1 (global heap <code>uid</code>).
 +
 
 +
<source lang="c">void* sceKernelAllocHeapMemoryFromGlobalHeapForDriver(SceSize size);</source>
 +
 
 +
=== sceKernelAllocHeapMemoryFromGlobalHeapWithOptForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x0B4ED16A
 +
|}
 +
 
 +
Calls [[SceSysmem#sceKernelAllocHeapMemoryWithOptionForDriver|sceKernelAllocHeapMemoryWithOptionForDriver]] with uid = -1 (global heap <code>uid</code>).
 +
 
 +
<source lang="c">void* sceKernelAllocHeapMemoryFromGlobalHeapWithOptForDriver(SceSize size, SceKernelHeapMemoryOpt *pOpt);</source>
 +
 
 +
=== sceKernelAllocHeapMemoryWithOptForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xB415B5A8
 +
|}
 +
 
 +
Temp name was sceKernelAllocHeapMemoryWithOpt1ForDriver.
 +
 
 +
Same as <code>sceKernelAllocHeapMemoryForDriver</code> but uses <code>pOpt</code>.
 +
 
 +
<source lang="c">void* sceKernelAllocHeapMemoryWithOptForDriver(SceUID uid, SceSize size, SceKernelHeapMemoryOpt *pOpt);</source>
 +
 
 +
=== sceKernelAllocHeapMemoryWithOptionForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x49D4DD9B
 +
|}
 +
 
 +
Temp name was sceKernelAllocHeapMemoryWithOpt2ForDriver.
 +
 
 +
Same as <code>sceKernelAllocHeapMemoryForDriver</code> but uses <code>pOpt</code>.
 +
 
 +
<source lang="c">void* sceKernelAllocHeapMemoryWithOptionForDriver(SceUID uid, SceSize size, SceKernelHeapMemoryOpt *pOpt);</source>
 +
 
 +
=== sceKernelAllocMemBlockWithInfoForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xD44F464D
 +
|}
 +
 
 +
Temp name was sceKernelAllocMemBlockExtForDriver.
 +
 
 +
<source lang="c">SceUID sceKernelAllocMemBlockWithInfoForDriver(const char *name, SceKernelMemBlockType type, SceSize vsize, const struct SceKernelAllocMemBlockOptKernel *pOpt, SceKernelMemBlockInfo *pInfo);</source>
 +
 
 +
=== sceKernelAllocMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xC94850C9
 +
|}
 +
 
 +
The interface is the same as the userland version of this function, however more types can be specified and more options are in the pOpt argument.
 +
 
 +
To allocate a kernel RW block of memory, specify <code>type = SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_RW</code>.
 +
 
 +
To allocate a block of memory with a specific physical address, specify <code>type = SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RW</code> or <code>type = SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_RW</code>, <code>pOpt->attr = 2</code>, and <code>pOpt->paddr = physical address</code>.
 +
 
 +
To allocate a block of memory that is kernel executable, specify <code>type = SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX</code>.
 +
 
 +
To allocate a block of memory that is physically contiguous, specify <code>type = 0x30808006</code>, <code>pOpt->attr = 0x200004</code> and an alignment to <code>pOpt->alignment</code>.
 +
 
 +
To allocate a block of memory inside the CDRAM, specify <code>type = 0x40404006</code>.
 +
 
 +
<source lang="c">SceUID sceKernelAllocMemBlockForDriver(const char *name, SceKernelMemBlockType type, SceSize vsize, const struct SceKernelAllocMemBlockOptKernel *pOpt);</source>
 +
 
 +
=== sceKernelAllocMemBlockForDebuggerForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.940-1.50 || 0x59F3159C
 +
|}
 +
 
 +
Same as sceKernelAllocMemBlockForDriver but authorize null pOpt.
 +
 
 +
<source lang="c">SceUID sceKernelAllocMemBlockForDebuggerForDriver(const char *name, SceKernelMemBlockType type, SceSize vsize, SceKernelAllocMemBlockOptKernel *pOpt);</source>
 +
 
 +
=== sceKernelCreateClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x61317102
 +
|}
 +
 
 +
<source lang="c">int sceKernelCreateClassForDriver(SceClass *cls, const char *name, struct SceClass *uid_class, size_t item_size, SceClassCallback create, SceClassCallback destroy);</source>
 +
 
 +
=== sceKernelCreateHeapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x9328E0E8
 +
|}
 +
 
 +
The heap pool is thread safe.
 +
 
 +
<source lang="c">
 +
typedef struct SceKernelHeapCreateOpt { // size is 0x14 on FW 0.931-0.990, 0x28 on FW 3.60
 +
  SceSize size;
 +
  SceUInt32 uselock; // ex: 1, 0x100
 +
  SceUInt32 field_8; // ex: 0x8000
 +
  SceUInt32 field_C;
 +
  SceUInt32 block_type;
 +
  SceUInt32 field_14;
 +
  SceUInt32 field_18;
 +
  SceUInt32 field_1C;
 +
  SceUInt32 field_20;
 +
  SceUInt32 field_24;
 +
} SceKernelHeapCreateOpt;
 +
 
 +
// pOpt can be NULL
 +
SceUID sceKernelCreateHeapForDriver(const char *name, SceSize size, SceKernelHeapCreateOpt *pOpt);
 +
</source>
 +
 
 +
=== sceUIDKernelCreateForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0x7FC849B1
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Calls sceGUIDKernelCreateForKernel.
 +
 
 +
Create a UID with default attribute (0x30000).
 +
 
 +
<source lang="C">int sceUIDKernelCreateForDriver(SceClass *pClass, const char *name, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceUIDKernelCreate2ForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x56A13E90
 +
|}
 +
 
 +
Temp name was sceKernelCreateUidObj2ForDriver.
 +
 
 +
Create a UID with default attribute (0x30000).
 +
 
 +
<source lang="c">SceUID sceUIDKernelCreate2ForDriver(SceClass *pClass, const char *name, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceGUIDCreateForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x89A44858
 +
|}
 +
 
 +
Temp name was sceKernelCreateUidObjForUidForDriver.
 +
 
 +
Create a GUID with default attribute (0x30000) for the specified UID.
 +
 
 +
<source lang="c">SceUID sceGUIDCreateForDriver(SceClass *pClass, const char *name, SceUID uid, SceKernelObject **ppEntry);</source>
 +
 
 +
=== scePUIDOpenByGUIDForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xBF209859
 +
|}
 +
 
 +
Temp name was sceKernelCreateUserUidForDriver.
 +
 
 +
<source lang="c">SceUID scePUIDOpenByGUIDForDriver(SceUID pid, SceUID uid);</source>
 +
 
 +
=== scePUIDOpenByGUIDWithFlagsForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xCED1547B
 +
|}
 +
 
 +
Temp name was sceKernelCreateUserUidForClassForDriver.
 +
 
 +
<source lang="c">SceUID scePUIDOpenByGUIDWithFlagsForDriver(SceUID pid, SceUID guid, SceUInt32 flags);</source>
 +
 
 +
=== scePUIDOpenByNameForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x513B9DDD
 +
|}
 +
 
 +
Temp name was sceKernelCreateUserUidForNameForDriver.
 +
 
 +
<source lang="c">SceUID scePUIDOpenByNameForDriver(SceUID pid, const char *name);</source>
 +
 
 +
=== scePUIDOpenByNameWithClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x8DA0BCA5
 +
|}
 +
 
 +
<source lang="c">SceUID scePUIDOpenByNameWithClassForDriver(SceUID pid, const char *name, SceClass *cls);</source>
 +
 
 +
=== sceKernelDeleteHeapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.940-3.60 || 0xD6437637
 +
|}
 +
 
 +
<source lang="c">int sceKernelDeleteHeapForDriver(SceUID uid);</source>
 +
 
 +
=== sceGUIDCloseForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x047D32F2
 +
|}
 +
 
 +
Temp name was sceKernelDeleteUidForDriver.
 +
 
 +
<source lang="C">int sceGUIDCloseForDriver(SceUID uid);</source>
 +
 
 +
=== scePUIDCloseForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x84A4AF5E
 +
|}
 +
 
 +
Temp name was sceKernelDeleteUserUidForDriver.
 +
 
 +
<source lang="c">int scePUIDCloseForDriver(SceUInt32 flag_or_addr_or_pid, SceUID uid);</source>
 +
 
 +
=== sceKernelGetMemBlockMemtypeByAddrForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xF3BBE2E1
 +
|}
 +
 
 +
Temp name was sceKernelFindMemBlockByAddrForDefaultSizeForDriver.
 +
 
 +
<source lang="c">SceKernelMemoryType sceKernelGetMemBlockMemtypeByAddrForDriver(const void *addr);</source>
 +
 
 +
=== sceKernelFindMemBlockByAddrForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x8A1742F6
 +
|}
 +
 
 +
<source lang="c">SceUID sceKernelFindMemBlockByAddrForDriver(const void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelFindProcMemBlockByAddrForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x857F1D5A
 +
|}
 +
 
 +
Temp name was sceKernelFindMemBlockByAddrForPidForDriver.
 +
 
 +
<source lang="c">SceUID sceKernelFindProcMemBlockByAddrForDriver(SceUID pid, const void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelFindMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.57 || not present, added on 3.60
 +
|-
 +
| 3.60 || 0x9C78064C
 +
|}
 +
 
 +
<source lang="c">SceUID sceKernelFindMemBlockForDriver(int flags, void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelFindMemBlockProcForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x9F6E45E3
 +
|}
 +
 
 +
Temp name was sceKernelFindMemBlockForPidForDriver.
 +
 
 +
<source lang="c">SceUID sceKernelFindMemBlockProcForDriver(SceUID pid, int flags, void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelFirstDifferentBlock32UserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xBDA6E42B
 +
|}
 +
 
 +
<source lang="c">int sceKernelFirstDifferentBlock32UserForDriver(unsigned int *ptr, int value, int byte_size);</source>
 +
 
 +
=== sceKernelFirstDifferentBlock32UserForPidForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0x8334454F
 +
|}
 +
 
 +
Looks for an integer in userspace.
 +
 
 +
<source lang="c">int sceKernelFirstDifferentBlock32UserForPidForDriver(SceUID pid, unsigned int *ptr, int value, int byte_size);</source>
 +
 
 +
=== sceKernelFirstDifferentBlock64UserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xBB3B02C2
 +
|}
 +
 
 +
<source lang="c">int sceKernelFirstDifferentBlock64UserForDriver(unsigned long long *ptr, int unused, unsigned long long value, int byte_size);</source>
 +
 
 +
=== sceKernelFirstDifferentBlock64UserForPidForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xE83855FD
 +
|}
 +
 
 +
<source lang="c">int sceKernelFirstDifferentBlock64UserForPidForDriver(SceUID pid, unsigned long long *ptr, unsigned long long value, int byte_size);</source>
 +
 
 +
=== sceKernelFreeHeapMemoryForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x3EBCE343
 +
|}
 +
 
 +
Temp name was sceKernelMemPoolFreeForDriver.
 +
 
 +
<source lang="c">int sceKernelFreeHeapMemoryForDriver(SceUID uid, void *ptr);</source>
 +
 
 +
=== sceKernelFreeHeapMemoryFromGlobalHeapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xFB817A59
 +
|}
 +
 
 +
<source lang="c">int sceKernelFreeHeapMemoryFromGlobalHeapForDriver(void *ptr);</source>
 +
 
 +
=== sceKernelFreeMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x009E1C61
 +
|}
 +
 
 +
<source lang="c">int sceKernelFreeMemBlockForDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelGetMemBlockPARangeForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x98C15666
 +
|}
 +
 
 +
Previous name was sceKernelGetMemBlockAddrPairForUidForDriver
 +
 
 +
Returns the paddr and size (pRange) of the memory block if it is physically continuous.
 +
 
 +
<source lang="c">int sceKernelGetMemBlockPARangeForDriver(SceUID uid, SceKernelPARange *pRange);</source>
 +
 
 +
=== sceKernelGetMemBlockBaseForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xA841EDDA
 +
|}
 +
 
 +
<source lang="C">
 +
/**
 +
* @brief Get mapped base address of memory block.
 +
*
 +
* Get base address of memory block.
 +
* @param[in] uid block id
 +
* @param[out] ppBase base address of memory block
 +
* @retval SCE_OK success
 +
* @retval <SCE_OK Error
 +
*/
 +
int sceKernelGetMemBlockBaseForDriver(SceUID uid, void **ppBase);
 +
</source>
 +
 
 +
=== sceKernelGetMemBlockVBaseForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xB81CF0A3
 +
|}
 +
 
 +
Wrongly named sceKernelGetMemBlockKernelPageForDriver.
 +
 
 +
<source lang="c">int sceKernelGetMemBlockVBaseForDriver(SceUID uid, void **kernel_page);</source>
 +
 
 +
=== sceKernelGetMemBlockMappedBaseForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x0B1FD5C3
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetMemBlockMappedBaseForDriver(SceUID uid, void **basep);</source>
 +
 
 +
=== sceKernelGetMemBlockPAVectorForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x19A51AC7
 +
|}
 +
 
 +
Temp name was sceKernelGetMemBlockPaddrListForUidForDriver.
 +
 
 +
<source lang="c">int sceKernelGetMemBlockPAVectorForDriver(SceUID uid, SceKernelPAVector *pVector);</source>
 +
 
 +
=== scePUIDGetEntryHeapNameForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x09896EB7
 +
|}
 +
 
 +
Temp name was sceKernelGetNameForPidByUidForDriver. Real name might be scePUIDGetEntryHeapNameForDriver.
 +
 
 +
<source lang="c">int scePUIDGetEntryHeapNameForDriver(SceUID pid, SceUID uid, char **pName);</source>
 +
 
 +
=== sceKernelGetNameForUid2ForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xE655852F
 +
|}
 +
 
 +
<source lang="c">const char* sceKernelGetNameForUid2ForDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelGetNameForUidForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xA78755EB
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetNameForUidForDriver(SceUID uid, char **pName);</source>
 +
 
 +
=== sceUIDtoObjectForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xAB7AC3D1
 +
|}
 +
 
 +
Calls sceUIDtoObjectForKernel.
 +
 
 +
<source lang="C">SceKernelObject *sceUIDtoObjectForDriver(SceUID uid);</source>
 +
 
 +
=== sceGUIDGetObjectForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x0FC24464
 +
|}
 +
 
 +
Temp name was sceKernelGUIDGetObjectForDriver.
 +
 
 +
<source lang="c">int sceGUIDGetObjectForDriver(SceUID uid, SceKernelObject **ppEntry);</source>
 +
 
 +
=== scePUIDGetObjectForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xFE6D7FAE
 +
|}
 +
 
 +
Temp name was sceKernelGetObjectForPidForUidForDriver.
 +
 
 +
<source lang="c">int scePUIDGetObjectForDriver(SceUID pid, SceUID uid, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceGUIDReferObjectForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x0F5C84B7
 +
|}
 +
 
 +
Temp name was sceKernelGetObjectForUidForDriver.
 +
 
 +
<source lang="c">int sceGUIDReferObjectForDriver(SceUID uid, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceGUIDReferObjectWithLevelForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0xF6DB54BA
 +
|}
 +
 
 +
Temp name was sceKernelGetObjectForUidForAttrForDriver.
 +
 
 +
<source lang="c">int sceGUIDReferObjectWithLevelForDriver(SceUID uid, SceUInt32 level, SceKernelObject **pEntry);</source>
 +
 
 +
=== sceGUIDReferObjectWithClassAttrForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x77066FD1
 +
|}
 +
 
 +
Temp name was sceKernelGetObjectForUidForClassForAttrForDriver.
 +
 
 +
<source lang="c">int sceGUIDReferObjectWithClassAttrForDriver(SceUID uid, SceClass *pClass, SceUInt32 attr, SceKernelObject **pEntry);</source>
 +
 
 +
=== sceGUIDReferObjectWithClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x00ED6C14
 +
|}
 +
 
 +
Temp name was sceKernelGetObjForUidForDriver.
 +
 
 +
<source lang="c">int sceGUIDReferObjectWithClassForDriver(SceUID uid, SceClass *pClass, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceGUIDReferObjectWithSubclassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x72A98D17
 +
|}
 +
 
 +
Temp name was sceKernelGetObjectForUidForClassTreeForDriver.
 +
 
 +
<source lang="c">int sceGUIDReferObjectWithSubclassForDriver(SceUID uid, SceClass *pClass, SceKernelObject **ppEntry);</source>
 +
 
 +
=== sceKernelVAtoPAForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x8D160E65
 +
|}
 +
 
 +
Temp name was sceKernelGetPaddrForDriver.
 +
 
 +
This will write the physical address for a virtual address <code>pVA</code> to memory pointed to by <code>pPA</code>.
 +
 
 +
Returns <0 on error, values >=0 indicate success.
 +
 
 +
<source lang="c">int sceKernelVAtoPAForDriver(void *pVA, void **pPA);</source>
 +
 
 +
=== sceKernelProcVAtoPAForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xC51934BD
 +
|}
 +
 
 +
<source lang="c">int sceKernelProcVAtoPAForDriver(SceUID pid, void *pVA, void **pPA);</source>
 +
 
 +
=== sceKernelProcModeVAtoPAForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x61A67D32
 +
|}
 +
 
 +
Temp name was sceKernelGetPaddrForPidForDriver.
 +
 
 +
<source lang="c">int sceKernelProcModeVAtoPAForDriver(SceUID pid, uint32_t mode, void *pVA, void **pPA);</source>
 +
 
 +
=== sceKernelVARangeToPAVectorForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xE68BEEBD
 +
|}
 +
 
 +
Temp name was sceKernelGetPaddrListForDriver.
 +
 
 +
This function writes into <code>pVector->output_buffer</code> an array of <code>vRange</code> that encompasses the block of memory specified in the input. <code>pVector->ret_count</code> will contain the number of entries written. If <code>pVector->output_buffer</code> is null, it will just write the count.
 +
 
 +
<source lang="c">int sceKernelVARangeToPAVectorForDriver(const SceKernelVARange *vRange, SceKernelPAVector *pVector);</source>
 +
 
 +
=== sceKernelGetPaddrListForLargePageForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x08A8A7E8
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetPaddrListForLargePageForDriver(const SceKernelVARange *vRange, SceKernelPAVector *pVector);</source>
 +
 
 +
=== sceKernelGetPaddrListForSmallPageForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x16844CE6
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetPaddrListForSmallPageForDriver(const SceKernelVARange *vRange, SceKernelPAVector *pVector);</source>
 +
 
 +
=== sceKernelVARangeToPARangeForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.940-3.60 || 0xAE36C775
 +
|}
 +
 
 +
Temp name was sceKernelGetPaddrPairForDriver.
 +
 
 +
<source lang="c">int sceKernelVARangeToPARangeForDriver(const SceKernelVARange *vRange, SceKernelPARange *pRange);</source>
 +
 
 +
=== sceKernelGetPaddrPairForLargePageForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x32257A24
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetPaddrPairForLargePageForDriver(SceKernelVARange *pair, SceKernelPARange *result_pair);</source>
 +
 
 +
=== sceKernelGetPaddrPairForSmallPageForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xB3575090
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetPaddrPairForSmallPageForDriver(SceKernelVARange *pair, SceKernelPARange *result_pair);</source>
 +
 
 +
=== sceKernelVAtoPABySWForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x65419BD3
 +
|}
 +
 
 +
Temp name was sceKernelGetPaddrWithSectionTypeCheckForDriver. Wrong name was sceKernelAddressSpaceVAtoPABySWForDriver.
 +
 
 +
<source lang="c">int sceKernelVAtoPABySWForDriver(void *pVA, void **pPA);</source>
 +
 
 +
=== sceKernelGetPidContextForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x2ECF7944
 +
|}
 +
 
 +
<source lang="c">
 +
struct SceKernelProcessContext
 +
{
 +
  SceUInt32 TTBR1;
 +
  SceUInt32 DACR;
 +
  SceUInt32 CONTEXTIDR;
 +
};
 +
 
 +
int sceKernelGetPidContextForDriver(SceUID pid, SceKernelProcessContext **ctx);
 +
</source>
 +
 
 +
=== sceKernelGetUidClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x85336A1C
 +
|}
 +
 
 +
<source lang="c">SceClass *sceKernelGetUidClassForDriver();</source>
 +
 
 +
=== sceKernelGetUnknownValidPhysAddressSpaceForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xC9928F5E
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetUnknownValidPhysAddressSpaceForDriver(void **start, void **end);</source>
 +
 
 +
=== sceKernelIsPaddrWithinSameSectionForUidForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xF4AD89D8
 +
|}
 +
 
 +
<source lang="c">int sceKernelIsPaddrWithinSameSectionForUidForDriver(SceUID pid, int permission_type, void *vaddr, unsigned int len);</source>
 +
 
 +
=== sceKernelIsPaddrWithinUnknownValidPhysAddressSpaceForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xA7C0D1FC
 +
|}
 +
 
 +
<source lang="c">int sceKernelIsPaddrWithinUnknownValidPhysAddressSpaceForDriver(void *vaddr);</source>
 +
 
 +
=== scePUIDtoGUIDWithClassForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x184172B1
 +
|}
 +
 
 +
Temp name was sceKernelKernelUidForUserUidForClassForDriver.
 +
 
 +
<source lang="c">SceUID scePUIDtoGUIDWithClassForDriver(SceUID pid, SceUID uid, SceClass *pClass);</source>
 +
 
 +
=== scePUIDtoGUIDForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x45D22597
 +
|}
 +
 
 +
Temp name was sceKernelKernelUidForUserUidForDriver.
 +
 
 +
Process UID to Global UID.
 +
 
 +
<source lang="c">SceUID scePUIDtoGUIDForDriver(SceUID pid, SceUID uid);</source>
 +
 
 +
=== sceKernelPartitionMapMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x58D21746
 +
|}
 +
 
 +
Temp name was sceKernelMapBlockUserVisibleForDriver.
 +
 
 +
<source lang="c">int sceKernelPartitionMapMemBlockForDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelMapBlockUserVisibleWithFlagForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x04059C4B
 +
|}
 +
 
 +
<source lang="c">int sceKernelMapBlockUserVisibleWithFlagForDriver(SceUID uid, int some_flag);</source>
 +
 
 +
=== sceKernelUserMapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x278BC201
 +
|}
 +
 
 +
Wrongly named sceKernelMapUserBlockDefaultTypeForDriver.
 +
 
 +
Assigns type 0.
 +
 
 +
<source lang="C">int sceKernelUserMapForDriver(char *name, int permission, void *user_buf, int size, void **kernel_page, int *kernel_size, int *kernel_offset);</source>
 +
 
 +
=== sceKernelProcUserMapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x0091D74D
 +
|}
 +
 
 +
Wrongly named sceKernelMapUserBlockForDefaultTypeForPidForDriver. sceKernelProcUserMapForDriver is certainly real name.
 +
 
 +
Assigns type 0.
 +
 
 +
<source lang="C">int sceKernelProcUserMapForDriver(SceUID pid, const char *name, int permission, void *user_buf, int size, void **kernel_page, int *kernel_size, int *kernel_offset);</source>
 +
 
 +
=== sceKernelMapUserBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0x7D4F8B5F
 +
|}
 +
 
 +
Permission is either "1" for read only, no execute or "2"/"3" for read write, no execute. Type is either 0, 1, or 17 and affects the block type. 0 is default. This will allocate kernel memory starting at kernel_page. To get the same memory as the user pointer, add the kernel_offset. kernel_size is how much is allocated.
 +
 
 +
<source lang="c">
 +
// this signature is for FW 1.50-1.69
 +
int sceKernelMapUserBlockForDriver(int permission, int type, void *user_buf, int size, void **kernel_page, int *kernel_size, int *kernel_offset);
 +
 
 +
// this signature is for FW 3.60 - it now allows to give a name
 +
int sceKernelMapUserBlockForDriver(char *name, int permission, int type, void *user_buf, int size, void **kernel_page, int *kernel_size, int *kernel_offset);
 +
</source>
 +
 
 +
=== sceKernelDecRefCountMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xF50BDC0C
 +
|}
 +
 
 +
Temp name was sceKernelMemBlockDecRefCounterAndReleaseUidForDriver.
 +
 
 +
<source lang="c">int sceKernelDecRefCountMemBlockDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelMemBlockGetInfoExForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x24A99FFF
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemBlockGetInfoExForDriver(SceUID uid, SceKernelMemBlockInfoEx *info);</source>
 +
 
 +
=== sceKernelGetMemBlockInfoForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xA73CFFEF
 +
|}
 +
 
 +
Temp name was sceKernelMemBlockGetInfoExForVisibilityLevelForDriver.
 +
 
 +
<source lang="c">int sceKernelGetMemBlockInfoForDriver(SceUID uid, uint32_t level, SceKernelMemBlockInfoEx *pInfo);</source>
 +
 
 +
=== sceKernelMemBlockGetSomeSizeForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x78337B62
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemBlockGetSomeSizeForDriver(SceUID uid, int *some_size);</source>
 +
 
 +
=== sceKernelIncRefCountMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xEAF3849B
 +
|}
 +
 
 +
Temp name was sceKernelMemBlockIncRefCounterAndReleaseUidForDriver.
 +
 
 +
<source lang="c">int sceKernelIncRefCountMemBlockForDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelUserUnmapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x00575B00
 +
|}
 +
 
 +
Temp name was sceKernelMemBlockReleaseForDriver.
 +
 
 +
<source lang="c">int sceKernelUserUnmapForDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelMemBlockType2MemtypeForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x20C811FA
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemBlockType2MemtypeForDriver(SceKernelMemBlockType type);</source>
 +
 
 +
=== sceKernelMemBlockTypeGetPrivilegesForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x6A0792A3
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemBlockTypeGetPrivilegesForDriver(SceKernelMemBlockType type);</source>
 +
 
 +
=== sceKernelMemBlockTypeGetUnknownForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xCB0F3A33
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemBlockTypeGetUnknownForDriver(SceKernelMemBlockType type);</source>
 +
 
 +
=== sceKernelMemRangeReleaseForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x75C70DE0
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemRangeReleaseForDriver(void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelMemRangeReleaseForPidForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xA8525B06
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemRangeReleaseForPidForDriver(SceUID pid, void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelMemRangeReleaseWithPermForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x22CBE925
 +
|}
 +
 
 +
Decrease references to pages.
 +
 
 +
<source lang="c">int sceKernelMemRangeReleaseWithPermForDriver(SceKernelMemoryRefPerm perm, void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelMemRangeRetainForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x59A4402F
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemRangeRetainForDriver(void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelMemRangeRetainForPidForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x659586BF
 +
|}
 +
 
 +
<source lang="c">int sceKernelMemRangeRetainForPidForDriver(SceUID pid, void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelMemRangeRetainWithPermForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xBC0A1D60
 +
|}
 +
 
 +
Increase references to pages.
 +
 
 +
<source lang="c">int sceKernelMemRangeRetainWithPermForDriver(SceKernelMemoryRefPerm perm, void *addr, SceSize size);</source>
 +
 
 +
=== sceKernelRoMemcpyKernelToUserForPidForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.69 || 0x571D2739
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="c">int sceKernelRoMemcpyKernelToUserForPidForDriver(SceUID pid, void *dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelCopyToUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x6D88EF8A
 +
|}
 +
 
 +
Temp name was sceKernelMemcpyKernelToUserForDriver.
 +
 
 +
<source lang="c">int sceKernelCopyToUserForDriver(void *dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelProcCopyToUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x6B825479
 +
|}
 +
 
 +
Temp name was sceKernelMemcpyKernelToUserForPidForDriver. Possible name is sceKernelCopyoutProcForDriver.
 +
 
 +
This will not crash on invalid user pointers, but instead return error.
 +
 
 +
<source lang="c">int sceKernelProcCopyToUserForDriver(SceUID pid, void *dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelReadUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xE08F3967
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelReadUserForDriver(void *dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelCopyFromUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xBC996A7A
 +
|}
 +
 
 +
Temp name was sceKernelMemcpyUserToKernelForDriver.
 +
 
 +
<source lang="c">int sceKernelCopyFromUserForDriver(void *dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelProcCopyFromUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x605275F8
 +
|}
 +
 
 +
Temp name was sceKernelMemcpyUserToKernelForPidForDriver.
 +
 
 +
<source lang="c">int sceKernelProcCopyFromUserForDriver(SceUID pid, void *dst, void *src, SceSize size);</source>
 +
 
 +
=== sceKernelUserCopyForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0x1BD44DD5
 +
|}
 +
 
 +
Temp name was sceKernelMemcpyUserToUserForDriver.
 +
 
 +
<source lang="C">int sceKernelUserCopyForDriver(void *dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelProcUserCopyForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0x8E086C33
 +
|}
 +
 
 +
Temp name was sceKernelMemcpyUserToUserForPidForDriver.
 +
 
 +
<source lang="c">int sceKernelProcUserCopyForDriver(SceUID pid, void *dst, const void *src, SceSize size);</source>
 +
 
 +
=== sceKernelUserStrnlenForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.940-0.990 || 0xFF06898A
 +
|-
 +
| 1.50-3.60 || not present
 +
|}
 +
 
 +
<source lang="C">SceSize sceKernelUserStrnlenForDriver(const char *s, SceSize maxlen);</source>
 +
 
 +
=== sceKernelStrnlenUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0xB429D419
 +
|}
 +
 
 +
<source lang="c">SceSize sceKernelStrnlenUserForDriver(const char *s, SceSize maxlen);</source>
 +
 
 +
=== sceKernelProcStrnlenUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0x9929EB07
 +
|}
 +
 
 +
<source lang="c">SceSize sceKernelProcStrnlenUserForDriver(SceUID pid, const char *s, SceSize maxlen);</source>
 +
 
 +
=== sceKernelProcUserStrcpyForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.50 || 0xEBCB3970
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelProcUserStrcpyForDriver(SceUID pid, char *dst, const char *src);</source>
 +
 
 +
=== sceKernelStrncpyFromUserSpecialForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.50 || 0x7440BCDA
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelStrncpyFromUserSpecialForDriver(char *dst, const char *src, SceSize maxlen, SceSize *dst_size);</source>
 +
 
 +
=== sceKernelStrncpyToUserSpecialForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.50 || 0x369355F1
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelStrncpyToUserSpecialForDriver(char *dst, const char *src, SceSize maxlen, SceSize *dst_size);</source>
 +
 
 +
=== sceKernelUserStrncpyForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.940-0.990 || 0xE6D5EFE4
 +
|-
 +
| 1.50-3.60 || not present
 +
|}
 +
 
 +
Return 0 on success.
 +
 
 +
<source lang="C">int sceKernelUserStrncpyForDriver(char *dst, const char *src, SceSize maxlen);</source>
 +
 
 +
=== sceKernelStrncpyFromUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0xDB3EC244
 +
|}
 +
 
 +
<source lang="c">int sceKernelStrncpyFromUserForDriver(char *dst, const char *src, SceSize maxlen);</source>
 +
 
 +
=== sceKernelProcStrncpyFromUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0x75AAF178
 +
|}
 +
 
 +
<source lang="c">int sceKernelProcStrncpyFromUserForDriver(SceUID pid, char *dst, const char *src, SceSize maxlen);</source>
 +
 
 +
=== sceKernelStrncpyToUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0x80BD6FEB
 +
|}
 +
 
 +
<source lang="c">int sceKernelStrncpyToUserForDriver(char* dst, const char *src, SceSize maxlen);</source>
 +
 
 +
=== sceKernelProcStrncpyToUserForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0xFED82F2D
 +
|}
 +
 
 +
Temp name was sceKernelMemcpyKernelToUserForPidUncheckedForDriver.
 +
 
 +
<source lang="c">int sceKernelProcStrncpyToUserForDriver(SceUID pid, char *dst, const char *src, SceSize maxlen);</source>
 +
 
 +
=== sceUIDOpenByNameForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-0.990 || 0x796881D6
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
Calls sceGUIDOpenByNameForDriver.
 +
 
 +
<source lang="c">SceUID sceUIDOpenByNameForDriver(const char *name);</source>
 +
 
 +
=== sceGUIDOpenByNameForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0xD76E7452
 +
|}
 +
 
 +
Temp name was sceKernelOpenUidForNameForDriver.
 +
 
 +
<source lang="c">SceUID sceGUIDOpenByNameForDriver(const char *name);</source>
 +
 
 +
=== sceKernelRemapMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-1.05 || 0x8D332AE1
 +
|-
 +
| 1.50-3.60 || not present
 +
|}
 +
 
 +
This can be used to remap RW memory as RX. To do this, first allocate a memory block of type <code>SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW</code>. After you are done writing, call sceKernelRemapMemBlockForDriver with type <code>SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX</code>.
 +
 
 +
<source lang="c">int sceKernelRemapMemBlockForDriver(SceUID uid, SceKernelMemBlockType type);</source>
 +
 
 +
=== sceKernelPartialRemapMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.50-3.60 || 0xDFE2C8CB
 +
|}
 +
 
 +
Temp name was sceKernelRemapBlockForDriver, sceKernelRemapMemBlockForDriver.
 +
 
 +
This can be used to remap RW memory as RX. To do this, first allocate a memory block of type <code>SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW</code>. After you are done writing, call sceKernelPartialRemapMemBlockForDriver with type <code>SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX</code>.
 +
 
 +
<source lang="c">int sceKernelPartialRemapMemBlockForDriver(SceUID uid, SceKernelMemBlockType type);</source>
 +
 
 +
=== scePUIDSetNameForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x12624884
 +
|}
 +
 
 +
Temp name was sceKernelSetNameForPidForUidForDriver.
 +
 
 +
<source lang="c">int scePUIDSetNameForDriver(SceUID pid, SceUID uid, const char *name);</source>
 +
 
 +
=== scePUIDSetNameForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x4CFA4100
 +
|}
 +
 
 +
Temp name was sceKernelSetObjectForUidForDriver.
 +
 
 +
<source lang="c">int scePUIDSetNameForDriver(SceUID pid, const char *name);</source>
 +
 
 +
=== sceKernelSwitchPidContextForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x2D711589
 +
|}
 +
 
 +
<source lang="c">int sceKernelSwitchPidContextForDriver(SceKernelProcessContext *new_context, SceKernelProcessContext *prev_context);</source>
 +
 
 +
=== sceGUIDReleaseObjectForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x149885C4
 +
|}
 +
 
 +
Temp name was sceKernelUidReleaseForDriver.
 +
 
 +
<source lang="c">int sceGUIDReleaseObjectForDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelUnmapMemBlockForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xFFCD9B60
 +
|}
 +
 
 +
<source lang="c">int sceKernelUnmapMemBlockForDriver(SceUID uid);</source>
 +
 
 +
=== sceKernelGetPhysicalMemoryTypeForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x0AAA4FDD
 +
|}
 +
 
 +
Temp name was sceKernelVaddrMaybeGetSectionTypeForDriver
 +
 
 +
<source lang="c">int sceKernelGetPhysicalMemoryTypeForDriver(void *vaddr);</source>
 +
 
 +
=== some_memblock_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x13805CA8
 +
|}
 +
 
 +
<source lang="c">int some_memblock_operation(SceUID uid, int a2, int a3, int a4);</source>
 +
 
 +
=== some_memblock_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x16713BE8
 +
|}
 +
 
 +
Same as above but with different flags.
 +
 
 +
<source lang="c">int some_memblock_operation(SceUID uid, int a2, int a3, int a4);</source>
 +
 
 +
=== some_memblock_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x16713BE8
 +
|}
 +
 
 +
Same as above but with different flags.
 +
 
 +
<source lang="c">int some_memblock_operation(SceUID uid, int a2, int a3, int a4);</source>
 +
 
 +
=== some_memblock_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x4C584B29
 +
|}
 +
 
 +
Same as above but with different flags.
 +
 
 +
<source lang="c">int some_memblock_operation(SceUID uid, int a2, int a3, int a4);</source>
 +
 
 +
=== some_memblock_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x6C76AD89
 +
|}
 +
 
 +
Same as above but with different flags.
 +
 
 +
<source lang="c">int some_memblock_operation(SceUID uid, int a2, int a3, int a4);</source>
 +
 
 +
=== some_memblock_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x8C43B052
 +
|}
 +
 
 +
Same as above but with different flags.
 +
 
 +
<source lang="c">int some_memblock_operation(SceUID uid, int a2, int a3, int a4);</source>
 +
 
 +
=== sceKernelGetMemBlockProcessForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x1EFC96EA
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetMemBlockProcessForDriver(SceUID uid);</source>
 +
 
 +
=== memblock_related_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x64DBE472
 +
|}
 +
 
 +
<source lang="c">int memblock_related_operation(SceUID uid, int a2);</source>
 +
 
 +
=== memblock_related_operation ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x987EE587
 +
|}
 +
 
 +
<source lang="c">
 +
struct result_987ee587
 +
{
 +
  int unk0;
 +
  int unk4;
 +
  int unk8;
 +
  int unkC;
 +
  int unk10;
 +
};
 +
 
 +
int memblock_related_operation(SceUID uid, result_987ee587 *result);
 +
</source>
 +
 
 +
=== SceSysmemForDriver_856FA2E3 ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x856FA2E3
 +
|}
 +
 
 +
Seems related to heap.
 +
 
 +
<source lang="c">int SceSysmemForDriver_856FA2E3(SceUID uid);</source>
 +
 
 +
=== sceKernelGetPhyMemInfoForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.931-3.60 || 0x89475192
 +
|}
 +
 
 +
<source lang="c">
 +
typedef struct SceKernelPhyMemInfo { // Size is 0xC on 0.931-3.60
 +
  SceSize size; // Size of this structure
 +
  uint32_t unk4;
 +
  uint32_t unk8;
 +
} SceKernelPhyMemInfo;
 +
 
 +
// as of FW 0.931-0.990, pindex must be one of these values: 1 PhyPartKernel, 8 PageVenezia, 9 PageVIP
 +
#define SCE_KERNEL_PHYMEMPART_KERNEL_INDEX 1
 +
#define SCE_KERNEL_PHYMEMPART_LPDDR2MAIN_KERNEL_INDEX 6
 +
#define SCE_KERNEL_PAGE_VENEZIA_INDEX 8
 +
#define SCE_KERNEL_PAGE_VIP_INDEX 9
 +
 
 +
int sceKernelGetPhyMemInfoForDriver(uint32_t pindex, SceKernelPhyMemInfo *pInfo);
 +
</source>
 +
 
 +
=== sceKernelVerifyHeapForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xC50A9C0D
 +
|}
 +
 
 +
<source lang="c">int sceKernelVerifyHeapForDriver(SceUID uid, void *ptr);</source>
 +
 
 +
== SceSysmemForDebugger ==
 +
 
 +
This library was removed somewhere between 1.692 and 3.60.
 +
 
 +
=== sceKernelPhysicalAddressSpaceStartForDebugger ===
 +
{| class="wikitable"
 +
! Version !! NID
 +
|-
 +
| 0.931 || 0x6AE2188F
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelPhysicalAddressSpaceStartForDebugger(void);</source>
 +
 
 +
=== sceKernelGetPhysicalAddressSpaceForDebugger ===
 +
{| class="wikitable"
 +
! Version !! NID
 +
|-
 +
| 0.931 || 0xE8905626
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
In FW 0.931 calls sceKernelPhysicalAddressSpaceStartForDebugger.
 +
 
 +
<source lang="C">void *sceKernelGetPhysicalAddressSpaceForDebugger(void);</source>
 +
 
 +
=== sceKernelIsAccessibleRangeProcForDebugger ===
 +
{| class="wikitable"
 +
! Version !! NID
 +
|-
 +
| 0.990-1.50 || 0x01DFC193
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelIsAccessibleRangeProcForDebugger(SceUID pid, SceUInt32 mode, const void *pVA, SceSize size);</source>
 +
 
 +
=== sceKernelIsAccessibleRangeForDebugger ===
 +
{| class="wikitable"
 +
! Version !! NID
 +
|-
 +
| 0.931-1.50 || 0xD027761F
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelIsAccessibleRangeForDebugger(SceUInt32 mode, const void *pVA, SceSize size);</source>
 +
 
 +
== SceSysmem ==
 +
 
 +
The SceSysmem library is responsible for both low-level and high-level memory management. There are functions for allocating raw blocks of memory (similar to Linux <code>sbrk</code>) as well as functions for maintaining a heap-like structure (similar to <code>malloc</code>) for kernel, however [[SceLibKernel]] implements a proper heap and that is used for user code.
 +
 
 +
=== sceKernelMapMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.69 || 0x7B763A21
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
=== sceKernelRemapMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.69 || 0x3B29E0F5
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
=== sceKernelPartialMapMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.69 || 0xC0A59868
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
=== sceKernelUnmapMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.69 || 0xEE30D976
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
<source lang="C">int sceKernelUnmapMemBlock(SceUID uid);</source>
 +
 
 +
=== sceKernelPartialUnmapMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.69 || 0xCA99929B
 +
|-
 +
| 3.60 || not present
 +
|}
 +
 
 +
=== sceKernelGetMemBlockInfoByRange ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 0.996-3.60 || 0x006F3DB4
 +
|}
 +
 
 +
<source lang="c">
 +
/**
 +
* @brief Get memory block informaton by virtual address range
 +
 
 +
* @param[in] vbase base address
 +
* @param[in] vsize  size
 +
* @param[inout] pInfo information structure
 +
*/
 +
int sceKernelGetMemBlockInfoByRange(void *vbase, SceSize vsize, SceKernelMemBlockInfo *pInfo);
 +
</source>
 +
 
 +
=== sceKernelGetMemBlockInfoByAddr ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x4010AD65
 +
|}
 +
 
 +
<source lang="c">
 +
/**
 +
* @brief Get memory block information.
 +
*
 +
* Get information about a memory block.
 +
* @param[in] vbase Base address
 +
* @param[inout] pInfo Information structure
 +
*/
 +
int sceKernelGetMemBlockInfoByAddr(void *vbase, SceKernelMemBlockInfo *pInfo);
 +
</source>
 +
 
 +
=== sceKernelGetSubbudgetInfo ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 1.69-3.60 || 0x832B4A65
 +
|}
 +
 
 +
<source lang="c">
 +
typedef struct SceKernelSubbudgetInfo { // size is 0xC on FW 3.60
 +
  int size; // Size of this structure
 +
  int unk_4;
 +
  int unk_8;
 +
} SceKernelSubbudgetInfo;
 +
 
 +
int sceKernelGetSubbudgetInfo(SceBool unk_boolean, SceKernelSubbudgetInfo *pInfo);
 +
</source>
 +
 
 +
=== sceKernelGetFreeMemorySize ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0x87CC580B
 +
|}
 +
 
 +
<source lang="C">
 +
/**
 +
* Get free memory size
 +
*/
 +
int sceKernelGetFreeMemorySize(SceKernelFreeMemorySizeInfo *info);
 +
</source>
 +
 
 +
=== sceKernelOpenMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x8EB8DFBB
 +
|}
 +
 
 +
<source lang="c">
 +
// on FW <= 1.691, flags is not used
 +
SceUID sceKernelOpenMemBlock(const char *name, int flags);
 +
</source>
 +
 
 +
=== sceKernelFindMemBlockByAddr ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xA33B99D1
 +
|}
 +
 
 +
<source lang="c">
 +
/**
 +
* Find memory block by virtual range (base address and size)
 +
* If size == 0, API returns a memory block which contains 'start'
 +
* If size > 0, API returns a memory block just fit range [start, start + size].
 +
* @param[in] vaddr base address
 +
* @param[in] size address size
 +
* @retval >=SCE_OK block id
 +
* @retval <SCE_OK error
 +
*/
 +
SceUID sceKernelFindMemBlockByAddr(void *vaddr, SceSize size);
 +
</source>
 +
 
 +
=== sceKernelFreeMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xA91E15EE
 +
|}
 +
 
 +
<source lang="c">
 +
/**
 +
* Free memory block.
 +
*
 +
* @param[in] uid block uid
 +
* @retval SCE_OK Success
 +
* @retval <SCE_OK Error code
 +
*/
 +
int sceKernelFreeMemBlock(SceUID uid);
 +
</source>
 +
 
 +
=== sceKernelFreeMemBlockForVM ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x4EA13FEA
 +
|}
 +
 
 +
<source lang="c">int sceKernelFreeMemBlockForVM(SceUID uid);</source>
 +
 
 +
=== sceKernelCloseMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xB680E3A0
 +
|}
 +
 
 +
<source lang="c">int sceKernelCloseMemBlock(SceUID uid);</source>
 +
 
 +
=== sceKernelGetMemBlockBase ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.996-3.60 || 0xB8EF5818
 +
|}
 +
 
 +
<source lang="C">
 +
/**
 +
* @brief Get mapped base address of memory block.
 +
*
 +
* Get base address of memory block.
 +
* @param[in] uid block id
 +
* @param[out] ppBase base address of memory block
 +
* @retval SCE_OK success
 +
* @retval <SCE_OK Error
 +
*/
 +
int sceKernelGetMemBlockBase(SceUID uid, void **ppBase);
 +
</source>
 +
 
 +
=== sceKernelAllocMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0xB9D5EBDE
 +
|}
 +
 
 +
<source lang="c">
 +
/**
 +
* Reserve a new memory block.
 +
*
 +
* The memory types that can be specified for type are as follows.
 +
* - SCE_KERNEL_MEMBLOCK_TYPE_USER_RW
 +
* - SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE
 +
* - SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW
 +
* - SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW
 +
* - SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW
 +
*
 +
* Allocate a memory block.
 +
*
 +
* @param[in] name Memory block name
 +
* @param[in] vsize Memory block virtual size
 +
* @param[in] flags Options
 +
* @retval id UID of memory block
 +
* @retval <SCE_OK Error code
 +
*/
 +
SceUID sceKernelAllocMemBlock(const char *name, SceKernelMemBlockType type, SceSize vsize, const struct SceKernelAllocMemBlockOpt *pOpt);
 +
</source>
 +
 
 +
=== sceKernelAllocUnmapMemBlock ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xEC636BCB
 +
|}
 +
 
 +
<source lang="c">int sceKernelAllocUnmapMemBlock(char *name, SceSize size);</source>
 +
 
 +
=== sceKernelOpenVMDomain ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0x9CA3EB2B
 +
|}
 +
 
 +
<source lang="c">int sceKernelOpenVMDomain();</source>
 +
 
 +
=== sceKernelSyncVMDomain ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0x19D2A81A
 +
|}
 +
 
 +
<source lang="c">int sceKernelSyncVMDomain(SceUID uid, void *data, SceSize size);</source>
 +
 
 +
=== sceKernelCloseVMDomain ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0xD6CA56CA
 +
|}
 +
 
 +
<source lang="c">int sceKernelCloseVMDomain();</source>
 +
 
 +
=== sceKernelAllocMemBlockForVM ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0xE2D7E137
 +
|}
 +
 
 +
<source lang="c">SceUID sceKernelAllocMemBlockForVM(const char *name, SceSize vsize);</source>
 +
 
 +
=== sceKernelCheckModelCapability ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x0144FBD9
 +
|}
 +
 
 +
<source lang="c">int sceKernelCheckModelCapability(int bit);</source>
 +
 
 +
=== sceKernelGetModelForCDialog ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xA2CB322F
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetModelForCDialog();</source>
 +
 
 +
=== sceKernelGetModel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xD0D4F729
 +
|}
 +
 
 +
<source lang="c">int sceKernelGetModel();</source>
 +
 
 +
=== sceKernelIsPSVitaTV ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x1453A5E5
 +
|}
 +
 
 +
<source lang="c">int sceKernelIsPSVitaTV();</source>
 +
 
 +
== SceDipsw ==
 +
 
 +
=== sceKernelCheckDipsw ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0x1C783FB2
 +
|}
 +
 
 +
=== sceKernelClearDipsw ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0x800EDCC1
 +
|}
 +
 
 +
=== sceKernelSetDipsw ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 1.69-3.60 || 0x817053D4
 +
|}
 +
 
 +
== SceDipswForDriver ==
 +
 
 +
=== sceKernelCheckDipswForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xA98FC2FD
 +
|}
 +
 
 +
<source lang="C">int sceKernelCheckDipswForDriver(int no);</source>
 +
 
 +
=== sceKernelGetDipswInfoForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xB2AD48BE
 +
|}
 +
 
 +
return *(int *)(dipsw_addr + 4 * info_id);
 +
 
 +
0 0x40 0x4 DevKit CP timestamp 1
 +
 
 +
1 0x44 0x2 DevKit CP Version
 +
 
 +
2 0x46 0x2 DevKit CP Build ID
 +
 
 +
3 0x48 0x4 DevKit CP timestamp 2 (strangely also set on Retail and TesKit)
 +
 
 +
<source lang="C">int sceKernelGetDipswInfoForDriver(int info_id);</source>
 +
 
 +
=== sceKernelClearDipswForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0xF1F3E9FE
 +
|}
 +
 
 +
<source lang="C">void sceKernelClearDipswForDriver(int no);</source>
 +
 
 +
=== sceKernelSetDipswForDriver ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 3.60 || 0x82E45FBF
 +
|}
 +
 
 +
<source lang="C">void sceKernelSetDipswForDriver(int no);</source>
 +
 
 +
== SceUartForKernel ==
 +
 
 +
=== sceKernelUartInitForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.9313.60 || 0xA9C74212
 +
|}
 +
 
 +
Temp name was sceUartInitForKernel.
 +
 
 +
It initializes the clock generator registers for the <code>port</code>.
 +
The default baud rate is 115200 for ports 0-5 and 250000 for port 6.
 +
 
 +
<source lang="c">int sceKernelUartInitForKernel(int port);</source>
 +
 
 +
=== sceKernelUartReadAvailableForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x38DB7629
 +
|}
 +
 
 +
Temp name was sceUartReadAvailableForKernel.
 +
 
 +
Returns the number of words available to read from the read FIFO.
 +
 
 +
<source lang="c">int sceKernelUartReadAvailableForKernel(int port);</source>
 +
 
 +
=== sceKernelUartReadForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +