Difference between revisions of "SceSysmem"

From Vita Development Wiki
Jump to navigation Jump to search
 
(884 intermediate revisions by 5 users not shown)
Line 28: Line 28:
 
|-
 
|-
 
| 1.50-3.60 || [[SceSysmem#SceSysmemForKernel|SceSysmemForKernel]] || Non-secure || Kernel || 0x63A519E5
 
| 1.50-3.60 || [[SceSysmem#SceSysmemForKernel|SceSysmemForKernel]] || Non-secure || Kernel || 0x63A519E5
 +
|-
 +
| 3.65 || [[SceSysmem#SceSysmemForKernel|SceSysmemForKernel]] || Non-secure || Kernel || 0x02451F0F
 
|-
 
|-
 
| 1.50-3.60 || [[SceSysmem#SceSysmemForDriver|SceSysmemForDriver]] || Non-secure || Kernel || 0x6F25E18A
 
| 1.50-3.60 || [[SceSysmem#SceSysmemForDriver|SceSysmemForDriver]] || Non-secure || Kernel || 0x6F25E18A
Line 44: Line 46:
 
|-
 
|-
 
| 1.50-3.60 || [[SceSysmem#SceCpuForKernel|SceCpuForKernel]] || Non-secure || Kernel || 0x54BF2BAB
 
| 1.50-3.60 || [[SceSysmem#SceCpuForKernel|SceCpuForKernel]] || Non-secure || Kernel || 0x54BF2BAB
 +
|-
 +
| 3.65 || [[SceSysmem#SceCpuForKernel|SceCpuForKernel]] || Non-secure || Kernel || 0xA5195D20
 
|-
 
|-
 
| 1.50-3.60 || [[SceSysmem#SceCpuForDriver|SceCpuForDriver]] || Non-secure || Kernel || 0x40ECDB0E
 
| 1.50-3.60 || [[SceSysmem#SceCpuForDriver|SceCpuForDriver]] || Non-secure || Kernel || 0x40ECDB0E
Line 59: Line 63:
 
| 1.50-3.60 || [[SceSysmem#SceKernelUtilsForDriver|SceKernelUtilsForDriver]] || Non-secure || Kernel || 0x496AD8B4
 
| 1.50-3.60 || [[SceSysmem#SceKernelUtilsForDriver|SceKernelUtilsForDriver]] || Non-secure || Kernel || 0x496AD8B4
 
|-
 
|-
| 1.50-3.60 || [[SceSysmem#SceZlibForDriver|SceZlibForDriver]] || Non-secure || Kernel || 0xE241534E
+
| 1.50 || [[SceSysmem#SceZlibForDriver|SceZlibForDriver]] || Non-secure || Kernel || 0xE241534E
 
|-
 
|-
 
| 1.50-3.60 || [[SceSysmem#SceKernelSuspendForDriver|SceKernelSuspendForDriver]] || Non-secure || Kernel || 0x7290B21C
 
| 1.50-3.60 || [[SceSysmem#SceKernelSuspendForDriver|SceKernelSuspendForDriver]] || Non-secure || Kernel || 0x7290B21C
Line 105: Line 109:
 
typedef int threadmgr_core_ctx;
 
typedef int threadmgr_core_ctx;
  
struct tctx_holder
+
typedef struct tctx_holder {
{
 
 
   int unk0;
 
   int unk0;
 
   int unk4;
 
   int unk4;
Line 121: Line 124:
 
   int unk30;
 
   int unk30;
 
   threadmgr_core_ctx *tctx_34;
 
   threadmgr_core_ctx *tctx_34;
};
+
} tctx_holder;
  
struct callback_holder1
+
typedef struct callback_holder1 {
{
 
 
   int unk0;
 
   int unk0;
 
   int (*unk4)(void);
 
   int (*unk4)(void);
Line 141: Line 143:
 
   int unk38;
 
   int unk38;
 
   int (*unk3C)(void);
 
   int (*unk3C)(void);
};
+
} callback_holder1;
  
struct callback_holder2
+
typedef struct callback_holder2 {
{
 
 
   int size;
 
   int size;
 
   int (__cdecl *unk4)(int result, int *a2);
 
   int (__cdecl *unk4)(int result, int *a2);
 
   int (__cdecl *unk8)(SceUID *a1);
 
   int (__cdecl *unk8)(SceUID *a1);
 
   int (__cdecl *unkC)(int, int *);
 
   int (__cdecl *unkC)(int, int *);
   int (__cdecl *sceKernelGetSelfAuthInfoForKernel)(SceUID pid, SceSelfAuthInfo* self_info);
+
   int (__cdecl *sceKernelSysrootGetProcessSelfAuthInfoForKernel)(SceUID pid, SceSelfAuthInfo* self_auth_info);
   int (__cdecl *sceKernelGetProcessTitleIdForKernel)(SceUID pid, char *titleid, size_t len);
+
   int (__cdecl *sceKernelSysrootGetProcessTitleIdForKernel)(SceUID pid, char *title_id, SceSize len);
 
   int (__cdecl *unk18)(unsigned int a1);
 
   int (__cdecl *unk18)(unsigned int a1);
 
   int (__cdecl *unk1c)(int a1);
 
   int (__cdecl *unk1c)(int a1);
};
+
} callback_holder2;
  
struct callback_holder3
+
typedef struct callback_holder3 {
{
 
 
   int unk0;
 
   int unk0;
 
   int (*unk4)(void);
 
   int (*unk4)(void);
Line 163: Line 163:
 
   int (__fastcall *unk10)(int);
 
   int (__fastcall *unk10)(int);
 
   int (*unk14)(void);
 
   int (*unk14)(void);
};
+
} callback_holder3;
  
struct sysbase_t
+
typedef struct sysbase_t {
{
 
 
   tctx_holder *hldr[6];
 
   tctx_holder *hldr[6];
 
   char unk[84];
 
   char unk[84];
   char *sysroot_buffer;
+
   char *kbl_param;
 
   int unk70;
 
   int unk70;
 
   char unk74[616];
 
   char unk74[616];
Line 205: Line 204:
 
   int (*SceSblUpdateMgr_smth)(void);
 
   int (*SceSblUpdateMgr_smth)(void);
 
   int (*ScePower_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
 +
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
 +
SceBootArgs *KblParam; // old name is sysroot buff
 +
 
 +
int unk_0x70; // 0x51030100, paddr?
 +
int unk_0x74; // 0x80000115
 +
int unk_0x78; // 0
 +
int unk_0x7C; // 0x115
 +
 
 +
int unk_0x80; // 0x10200
 +
int unk_0x84; // 0x704
 +
int unk_0x88; // 0x2800D000
 +
int unk_0x8C; // 0
 +
 
 +
int unk_0x90; // 0x5
 +
int unk_0x94; // 0
 +
int unk_0x98; // 0
 +
int unk_0x9C; // 0
 +
 
 +
int unk_0xA0[0x18]; // 0
 +
int unk_0x100[0x34]; // 0
 +
 
 +
int unk_0x1D0; // 0
 +
int unk_0x1D4; // func ptr?, paddr:0x51003581
 +
int unk_0x1D8; // 0
 +
int (* sceKernelSysrootMountDummyTtypDevFs)(void); // SceIofilemgr + 0x1
 +
int unk_0x1E0[0x8]; // 0
 +
int unk_0x200[0x14]; // 0
 +
 
 +
int unk_0x250; // 0
 +
int (* sceKernelSysrootPowerTriggerFlag0x10000)(int a1); // Temp name, ScePower + 0x21F5
 +
int unk_0x258; // 0
 +
int unk_0x25C; // 0
 +
 
 +
int unk_0x260[0xC]; // 0
 +
 
 +
int unk_0x290; // 0
 +
int (* sceKernelSysrootDisplayRev1)(); // SceDisplay + 0x1
 +
int unk_0x298; // 0
 +
int (* sceKernelSysrootMsifStart)(void); // SceMsif + 0x3811
 +
 
 +
int unk_0x2A0; // 0
 +
int (* sceKernelSysrootPowerRev1)(); // Temp name, ScePower + 0x7BCD
 +
int unk_0x2A8; // 0
 +
int (* sceKernelSysrootPowerTriggerFlag0x10000_2)(void); // Temp name, ScePower + 0x218D
 +
 
 +
int unk_0x2B0; // 0
 +
int (* sceKernelSysrootPowerEnableSubIntr)(void); // Temp name, ScePower + 0x5B51
 +
int unk_0x2B8; // 0
 +
int unk_0x2BC; // 0
 +
 
 +
int unk_0x2C0[0x4]; // 0
 +
 
 +
int unk_0x2D0; // 0
 +
int (* sceKernelSysrootThreadFunction1)(void); // Temp name, SceKernelThreadMgr + 0x4D85
 +
int (* sceKernelSysrootIofilemgrStart)(void); // SceIofilemgr + 0x3E5
 +
void *unk_0x2DC;
 +
 
 +
void *unk_0x2E0;
 +
void *unk_0x2E4;
 +
void *unk_0x2E8;
 +
void *unk_0x2EC;
 +
 
 +
void *unk_0x2F0;
 +
void *unk_0x2F4;
 +
void *unk_0x2F8;
 +
void *unk_0x2FC;
 +
 
 +
void *unk_0x300;
 +
void *unk_0x304;
 +
int unk_0x308; // 0x10001
 +
void *unk_0x30C;
 +
 
 +
void *unk_0x310;
 +
void *unk_0x314;
 +
void *unk_0x318;
 +
int unk_0x31C; // 0
 +
 
 +
void *unk_0x320;
 +
void *unk_0x324;
 +
SceUID (* sceKernelSysrootGetThreadId)(void); // Temp name, SceKernelThreadMgr + 0x895
 +
int (* sceKernelSysrootGetThreadFunction3)(void); // Temp name, SceKernelThreadMgr + 0xC79,  SceThreadmgrForDriver_91382762
 +
 
 +
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
 +
 
 +
void (* sceKernelSysrootGetThreadFunction7); // Temp name, SceKernelThreadMgr + 0xE69
 +
int (* sceKernelSysrootGetThreadFunction8)(void); // Temp name, SceKernelThreadMgr + 0x8BD, SceThreadmgrForDriver_332E127C
 +
int (* sceKernelSysrootThreadFunction9)(int a1, int a2, int a3); // Temp name, SceKernelThreadMgr + 0x2541
 +
int (* sceKernelSysrootThreadFunction10)(int a1); // Temp name, SceKernelThreadMgr + 0xC99, SceThreadmgrForDriver_AB977C72
 +
 
 +
void *unk_0x350;
 +
int unk_0x354; // 0xFFFFFFFF
 +
void *unk_0x358;
 +
void *unk_0x35C;
 +
 
 +
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
 +
 
 +
void *unk_func_0x370; // SceCoredump + 0x7109, SceCoredumpForDriver_A7D214A7
 +
void *unk_func_0x374; // SceCoredump + 0x74F9, SceCoredumpForDriver_340856F7
 +
void *unk_func_0x378; // SceCoredump + 0x132ED, SceCoredumpForDriver_EF20949F
 +
int unk_0x37C; // 0
 +
 
 +
void *unk_func_0x380; // SceSblPostSsMgr + 0x9001, sceSblLicMgrGetLicenseStatusForDriver
 +
int (* unk_func_0x384)(void); // SceSblPostSsMgr + 0xB005, SceSblPostSsMgrForDriver_22599675, get flag
 +
int (* unk_func_0x388)(void); // SceSblPostSsMgr + 0xB011, SceSblPostSsMgrForDriver_9B49C249, get flag
 +
void *unk_func_0x38C; // SceSblPostSsMgr + 0xB4ED, SceSblPostSsMgrForDriver_D8A2D465
 +
 
 +
void *unk_func_0x390; // SceSblPostSsMgr + 0xB111, sceSblUtMgrGetTrilithiumBufferForDriver
 +
int (* sceKernelSysrootHasNpTestFlag)(void); // SceSblPostSsMgr + 0xB01D
 +
void *unk_func_0x398; // SceSblUpdateMgr + 0x8B01
 +
int (* sceKernelSysrootLedSetMode)(int led, int mode, void *led_configuration); // ScePower + 0x7C05
 +
 
 +
void *unk_0x3A0;
 +
int unk_0x3A4; // 0
 +
int unk_0x3A8; // 0
 +
int unk_0x3AC; // 0
 +
 
 +
int unk_0x3B0[0x4]; // 0
 +
 
 +
int unk_0x3C0; // 0
 +
int unk_0x3C4; // 0
 +
int unk_0x3C8; // 0
 +
void *unk_func_0x3CC; // SceNetPs + 0x3E51, SceNetPsForDriver_83A12CCC
 +
 
 +
void *unk_func_0x3D0; // SceNetPs + 0x3F4D, SceNetPsForDriver_C000CA8F
 +
int unk_0x3D4; // 0
 +
int unk_0x3D8; // 0
 +
void *unk_func_0x3DC; // SceNetPs + 0x3E51, SceNetPsForDriver_83A12CCC
 +
 
 +
void *unk_func_0x3E0; // SceNetPs + 0x3F4D, SceNetPsForDriver_C000CA8F
 +
int (* sceKernelSysrootAppMgrFunction3)(int a1, int a2); // SceAppMgr + 0x9F49
 +
int (* sceKernelSysrootAppMgrFunction4)(int a1, int a2); // SceAppMgr + 0x9EED
 +
int (* sceKernelSysrootAppMgrFunction5)(int a1); // SceAppMgr + 0x9D31
 +
 
 +
void *unk_func_0x3F0; // ScePfsMgr + 0x1, ScePfsMgrForKernel_4C148288
 +
void *unk_0x3F4;
 +
void *unk_0x3F8;
 +
int unk_0x3FC; // 0
 +
 
 +
int unk_0x400[0x6]; // 0
 +
uint32_t sysbase_magic2;
 +
} sysbase360_t;
 +
 
 +
typedef struct SceKernelFreeMemorySizeInfo {
 +
SceSize size;
 +
SceSize sizeMain;
 +
SceSize sizeCdram;
 +
SceSize sizePhycont;
 +
} SceKernelFreeMemorySizeInfo;
  
 
typedef int (*SceClassCallback)(void *item);
 
typedef int (*SceClassCallback)(void *item);
  
typedef struct SceClass {
+
typedef struct SceClass_0990 { // size is 0x10 on FW 0.990
 +
SceSize size; // Size of this structure
 
struct SceClass *next;
 
struct SceClass *next;
struct SceClass *root;
+
struct SceClass *root; // to confirm
struct SceClass *prev;
+
struct SceClass *prev; // to confirm
const char *name;
+
} SceClass_0990;
struct SceClass *uidclass;
+
 
unsigned int attributes;
+
typedef struct SceClass { // size is 0x2C on FW 3.60
unsigned short itemsize;
+
struct SceClass *next; // 0x00
unsigned short unk1A;
+
struct SceClass *root; // 0x04
unsigned int object_type;
+
struct SceClass *prev; // 0x08
SceClassCallback create_cb;
+
const char *name; // 0x0C
SceClassCallback destroy_cb;
+
struct SceClass *uid_class; // 0x10
unsigned int magic; /* 0xABCE9DA5 */
+
unsigned int attr; // 0x14
} SceClass; /* size = 0x2C */
+
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;
  
</source>
+
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;
  
== Memory Block Type ==
+
/** @name Memory types that can be specified with sceKernelAllocMemBlock
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.
+
*/
 +
/*@{*/
  
{| class="wikitable"
+
/**
|-
+
* @brief User readable / writable LPDDR2 memory
! Mask !! Value !! Description
+
*
|-
+
* This type secures a readable / writable memory block in user space.
| 0x10000 || 0x10000 || Global. <code>nG</code> bit NOT set
+
*/
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RW 0x0c20d060U
| 0xFF00 || 0x800 || <code>B</code> bit set. Sharable device memory.
+
 
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA SCE_KERNEL_MEMBLOCK_TYPE_USER_RW
| 0xFF00 || 0x2000 || <code>TEX[2]</code> and <code>TEX[0]</code> bit set. Outer cache Write-back, Write-Allocate. Inner cache non-cachable.
 
|-
 
| 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, 3.60 0x80024B01)
 
|-
 
| 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.
 
|-
 
|}
 
  
{| class="wikitable"
+
/**
|-
+
* @brief User readable / writable LPDDR2 non-cache memory
! Mask !! Value !! Name
+
*
|-
+
* A type to secure a memory block on LPDDR2 that is readable
| 0x0F000000 || 0x09000000 || SceKernelUserCdram
+
* and writable in user space and does not use cache.
|-
+
*/
| 0x0F000000 || 0x0A000000 || SceKernelUserShared
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW 0x0c208060U
|-
 
| 0x0F000000 || 0x0B000000 || SceKernelUserIO
 
|-
 
| 0x0F000000 || 0x0C000000 || SceKernelUserMain
 
|-
 
| 0x0F000000 || 0x0D000000 || SceKernelUserUncache
 
|-
 
| 0x0F000000 || 0x0E000000 || SceKernelUserCDialog
 
|-
 
| 0x0F000000 || 0x0F000000 || SceKernelUserCDialogNC
 
|-
 
|}
 
  
<source lang="C">
+
/**
type bits
+
* @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW.
 +
*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW
  
mask
+
/**
0x0000000F : only kernel
+
* @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW.
0x000000F0 : only user
+
*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA_UNCACHE SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE
  
RWXO bit
+
/**
0 1 1 0
+
* @brief User readable and writable LPDDR2 physical continuous memory
? R W X
+
*
 +
* A type that can read and write in user space and secure
 +
* memory blocks from the physical continuous memory area.
 +
*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW 0x0c80d060U
 +
 
 +
/**
 +
* @brief User-readable and non-cacheable physical continuous memory
 +
*
 +
* A type for on-cacheable read / write in user space and to secure
 +
* memory blocks from the physical continuous memory area.
 +
*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW 0x0d808060U
  
RO type when both w bit and x bit are 0
+
/**
 +
* @brief User-readable and non-cacheable CDRAM memory
 +
*
 +
* A type that can be read and written in user space and secures
 +
* memory blocks on CDRAM.
 +
*/
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW 0x09408060U
  
mem device type(?)
+
/**
mask : 0x00000F00
+
* @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW.
0x00000200 : SO
+
*/
0x00000800 : DEVICE
+
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RWDATA SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW
  
mem cache type
+
/*@}*/
mask : 0x0000F000
 
0x00002000 : No internal cache only
 
0x00004000 : No external cache only
 
0x00008000 : UNCACHE, NC
 
0x0000D000 : CACHE
 
  
mem access type?
+
/**
mask : 0x00F00000
+
* @brief A type representing a memory type
0x00100000 : IO
+
*
0x00200000 : normal?
+
* A type that represents the type of memory block secured by sceKernelAllocMemBlock.
0x00400000 : CDRAM
+
*/
0x00500000 : GAME
+
typedef int SceKernelMemoryType;
  
mem access type2?(only kernel)
+
/**
mask : 0xF0000000
+
* @brief Memory block information structure
0x10000000 : normal?
+
*
0x20000000 : IO
+
* A structure for obtaining information about memory blocks. Size is 0x14 bytes on FW 0.990.
0x40000000 : CDRAM
+
*/
0x50000000 : CDRAM2
+
typedef struct SceKernelMemBlockInfo0990 {
0x60000000 : TMP
+
SceSize size; /**< Size of the structure itself */
0xA0000000 : GPU
+
void *mappedBase; /**< Map base address */
</source>
+
SceSize mappedSize; /**< Mapped size */
 +
SceKernelMemoryType memoryType; /**< Memory type */
 +
SceUInt32 access; /**< Access right */
 +
} SceKernelMemBlockInfo0990;
  
== SceSysmemForKernel ==
+
/**
 +
* @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;
  
=== scePUIDReleaseObjectForKernel ===
+
typedef struct SceKernelMemBlockInfoExDetails {
{| class="wikitable"
+
    SceKernelMemBlockType type;
|-
+
    SceUID memblk_uid;
! Version !! NID
+
    const char *name;
|-
+
    void *mappedBase;
| 3.60 || 0x3FCA782B
+
    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;
  
=== scePUIDGetInfoForKernel ===
+
typedef struct SceKernelMemBlockInfoEx { // size is 0xAC on FW 0.990, 0xB8 on FW 3.60
{| class="wikitable"
+
    SceSize size; // Size of this structure
|-
+
    SceKernelMemBlockInfoExDetails details;
! Version !! NID
+
    SceSize unk30; // paddr num
|-
+
    SceSize unk34; // paddr size num?
| 3.60 || 0x12ED88AE
+
    void *paddr_list[0x10];
|}
+
    SceSize size_list[0x10];
 +
} SceKernelMemBlockInfoEx;
  
=== sceGUIDGetEntryForKernel ===
+
typedef struct SceKernelMemBlockInfoSimple { // size is 0x24 on FW 0.990
{| class="wikitable"
+
    SceSize size; // Size of this structure
|-
+
    SceKernelMemBlockType type;
! Version !! NID
+
    SceUID uid;
|-
+
    char *name; // "SceNULL" by default
| 3.60 || 0x45F2A59C
+
    char unk_0x10[0x14];
|}
+
} SceKernelMemBlockInfoSimple;
  
=== sceGUIDGetVisibilityLevelForKernel ===
+
/*----- memory access permission -----*/
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 3.60 || 0xC69666C3
 
|}
 
  
=== sceGUIDSetVisibilityLevelForKernel ===
+
/**
{| class="wikitable"
+
* @brief readable memory
|-
+
*/
! Version !! NID
+
#define SCE_KERNEL_MEMORY_ACCESS_R 0x04U
|-
+
 
| 3.60 || 0xCB8D03C0
+
/**
|}
+
* @brief writable memory
 +
*/
 +
#define SCE_KERNEL_MEMORY_ACCESS_W 0x02U
 +
 
 +
/**
 +
* @brief executable memory (kernel only)
 +
*/
 +
#define SCE_KERNEL_MEMORY_ACCESS_X 0x01U
 +
 
 +
/*----- memory type -----*/
 +
 
 +
/**
 +
* @brief uncache normal memory
 +
*/
 +
#define SCE_KERNEL_MEMORY_TYPE_NORMAL_NC 0x80
  
=== sceGUIDFindByNameForKernel ===
+
/**
{| class="wikitable"
+
* @brief cache normal memory
|-
+
*/
! Version !! NID
+
#define SCE_KERNEL_MEMORY_TYPE_NORMAL 0xD0
|-
 
| 3.60 || 0xCEBA8031
 
|}
 
  
=== sceGUIDFindByNameAllForKernel ===
+
/**
{| class="wikitable"
+
* Optional parameter of sceKernelAllocMemBlock for FWs <=0.940.
|-
+
*/
! Version !! NID
+
typedef struct SceKernelAllocMemBlockOpt0940 {
|-
+
SceSize size; /**< Size of this structure */
| 3.60 || 0x4B5C85AC
+
SceUInt32 attr; /**< Attributes field */
|}
+
SceSize alignment; /**< Specify alignment.
 +
SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT must be set for the attr member. */
 +
SceUID uidBaseBlock; /**< Base memory block UID */
 +
const char *strBaseBlockName; /**< Base memory block UID name */
 +
} SceKernelAllocMemBlockOpt0940;
  
=== sceGUIDGetPIDForKernel ===
+
/**
{| class="wikitable"
+
* Option parameter of sceKernelAllocMemBlock
|-
+
*/
! Version !! NID
+
typedef struct SceKernelAllocMemBlockOpt {
|-
+
/**
| 3.60 || 0xCF5A2311
+
* Size of this structure
|}
+
*/
 +
SceSize size;
  
=== sceGUIDSetCNOAForKernel ===
+
/**
{| class="wikitable"
+
* Attributes field
|-
+
*/
! Version !! NID
+
SceUInt32 attr;
|-
 
| 3.60 || 0x8D6AF468
 
|}
 
  
=== sceGUIDSetForKernel ===
+
/**
{| class="wikitable"
+
* Specify alignment.
|-
+
* SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT must be set for the attr member.
! Version !! NID
+
*/
|-
+
SceSize alignment;
| 0.990-3.60 || 0xD7B323EB
 
|}
 
  
=== sceUIDGetProcUIDVectorByClassForKernel ===
+
/**
{| class="wikitable"
+
* reserved
|-
+
*/
! Version !! NID
+
SceUInt32 uidBaseBlock;
|-
 
| 0.990 || 0x51C08396
 
|-
 
| 3.60 || not present
 
|}
 
  
=== sceKernelGetPhyMemPartInfoForKernel ===
+
/**
{| class="wikitable"
+
* reserved2
|-
+
*/
! Version !! NID
+
const char *strBaseBlockName;
|-
+
 
| 0.990 || 0x67849418
+
#if 0
|-
+
/**
| 3.60 || not present
+
* mapped base address [out]
|}
+
*/
 +
void *mappedBase;
 +
 
 +
/**
 +
* mapped size [out]
 +
*/
 +
SceSize mappedSize;
 +
 
 +
/**
 +
* memory type [out]
 +
*/
 +
SceKernelMemoryType memoryType;
 +
 
 +
SceUInt32 access;
 +
#endif
 +
} SceKernelAllocMemBlockOpt;
  
=== sceUIDReferObjectWithLevelForKernel ===
+
/**
{| class="wikitable"
+
* Option parameter of kernel sceKernelAllocMemBlock on old FWs (as seen on FWs 0.900-0.990)
|-
+
*/
! Version !! NID
+
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
| 0.990 || 0xF79B52B2
+
    SceUInt32 unk_4;
|-
+
    SceUInt32 attr;
| 3.60 || not present
+
    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;
  
=== memcpy_from_paddr ===
+
/**
{| class="wikitable"
+
* Option parameter of kernel sceKernelAllocMemBlock on recent FWs (as seen on FW 3.60)
|-
+
*/
! Version !! NID
+
typedef struct SceKernelAllocMemBlockOptKernel { // size is 0x58 on FW 3.60
|-
+
SceSize size; // Size of this structure
| 0.990 || 0xF96E3AE2
+
SceUInt32 unk_4;
|-
+
SceUInt32 attr;
| 3.60 || not present
+
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;
  
<source lang="C">
+
/**
// dst must be a vaddr
+
* Attributes to enable some SceKernelAllocMemBlockOpt members.
int memcpy_from_paddr(void *dst, void *paddr, uint32_t size);
+
*/
</source>
+
#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?
  
=== sceKernelAllocSystemCallTableForKernel ===
+
/**
{| class="wikitable"
+
* UID is created by sceKernelOpen***()
|-
+
*/
! Version !! NID
+
#define SCE_UID_ATTR_OPEN_FLAG 0x00080000U
|-
 
| 0.990-3.60 || 0x5FFE4B79
 
|}
 
  
<source lang="C">
+
typedef struct SceKernelHeapInfo { // size is 0xCC on FW 0.990
// example: SceIntrmgrForKernel_B60ACF4B calls:
+
SceSize size; // Size of this structure
// sceKernelAllocSystemCallTableForKernel(0x10009, "SceSyscallTable", 0x1020D006, 4 * a1);
+
char unk_4[0xC8];
int sceKernelAllocSystemCallTableForKernel(SceUID pid, char *name, uint32_t memblock_type, uint32_t size);
+
} SceKernelHeapInfo;
</source>
 
  
=== sceKernelUIDEntryHeapGetInfoForKernel ===
+
typedef struct SceKernelHeapObject { // size is 0x40 on FW 0.990
{| class="wikitable"
+
SceSize size; // Size of this structure
|-
+
uint32_t unk_4; // 0x4
! Version !! NID
+
uint32_t unk_8; // 0x8
|-
+
uint32_t unk_C; // 0xC
| 0.990 || not present
+
uint32_t unk_10; // 0x10
|-
+
uint32_t unk_14; // 0x14
| 3.60 || 0x686AA15C
+
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;
  
=== sceUIDEntryHeapCloseAllPUIDForKernel ===
+
typedef struct SceKernelFixedHeap { // size is 0x40 on FW 0.990
{| class="wikitable"
+
SceSize size; // Size of this structure
|-
+
SceClass pClass; // 0x4
! Version !! NID
+
uint32_t unk_8; // 0x8
|-
+
uint32_t unk_C; // 0xC
| 0.990-3.60 || 0xFAF96C1F
+
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;
  
=== sceKernelNameHeapGetInfoForKernel ===
+
typedef struct SceKernelFixedHeapInfo { // size is 0x14 on FW 0.990
{| class="wikitable"
+
SceSize size; // Size of this structure
|-
+
uint32_t unk_4; // = (uint32_t)*(uint16_t *)(pObject + 0x1C)
! Version !! NID
+
uint32_t unk_8; // = *(uint32_t *)(pObject + 0x18) + (uint32_t)*(uint16_t *)(pObject + 0x2E)
|-
+
uint32_t unk_C; // = (uint32_t)*(uint16_t *)(pObject + 0x1E)
| 0.990 || not present
+
uint32_t unk_10; // = (uint32_t)*(uint16_t *)(pObject + 0x20)
|-
+
} SceKernelFixedHeapInfo;
| 3.60 || 0xE443253B
+
 
|}
+
typedef struct SceKernelHeapMemoryOpt { // size is 0x14 on FW 0.990
 +
SceSize size; // Size of this structure
 +
uint32_t unk_4;
 +
uint32_t unk_8;
 +
uint32_t unk_C; // example: 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;
  
=== sceKernelGetFixedHeapInfoByPointerForKernel ===
+
typedef struct SceKernelVARange {
{| class="wikitable"
+
uint32_t vaddr;
|-
+
uint32_t length;
! Version !! NID
+
} SceKernelVARange;
|-
 
| 0.990-3.60 || 0x219E90FD
 
|}
 
  
=== sceKernelGetHeapInfoByPtrForKernel ===
+
typedef struct SceKernelPARange {
{| class="wikitable"
+
uint32_t paddr;
|-
+
uint32_t length;
! Version !! NID
+
} SceKernelPARange;
|-
 
| 0.990 || not present
 
|-
 
| 3.60 || 0x68451777
 
|}
 
  
=== sceKernelGetHeapInfoForKernel ===
+
typedef struct SceKernelPAVector {
{| class="wikitable"
+
SceSize size; // Size of this structure (0x14 on 0.990)
|-
+
uint32_t pRanges_size; // Ex: 8
! Version !! NID
+
uint32_t nDataInVector; // Must be <= 8
|-
+
uint32_t count;
| 0.990-3.60 || 0x91733EF4
+
SceKernelPARange *pRanges;
|}
+
} SceKernelPAVector;
  
=== sceKernelFreeSimpleMemBlockForKernel ===
+
#define SCE_KERNEL_PROCESS_ID_SELF 0 // Current running process ID is always 0.
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 0.990-3.60 || 0xA1FFA2C9
 
|}
 
  
=== sceKernelSysrootAllocForKernel ===
+
typedef struct SceKernelPhyMemPart { // size is at least 0x9C on FW 0.931
{| class="wikitable"
+
    uint32_t field_0x0;
|-
+
    uint32_t field_0x4;
! Version !! NID
+
    uint32_t some_counter; // always positive
|-
+
    uint32_t field_0xc;
| 0.990-3.60 || 0xC0A4D2F3
+
    char *name;
|}
+
    int type; // 0x10000 for Lpddr2Main, 0x30000 for Cdram
 +
    int mutex;
 +
    uint32_t field_0x1c;
 +
    SceSize psize;
 +
    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;
  
=== sceGUIDGetObjectWithClassForKernel ===
+
/**
{| class="wikitable"
+
* An enumeration to represent the various logging levels which can be output by sceDbgLoggingHandler().
|-
+
*/
! Version !! NID
+
typedef enum SceDbgLogLevel {
|-
+
    SCE_DBG_LOG_LEVEL_TRACE = 0, /* An extremely verbose logging level, mostly useful for internal developers. */
| 0.990-3.60 || 0x7ABFA9A7
+
    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;
  
<source lang="C">int sceGUIDGetObjectWithClassForKernel(SceUID uid, SceClass *cls, SceObjectBase **obj);</source>
+
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;
  
=== SceSysmemForKernel_C38D61FC ===
+
typedef struct SceSyscallFrame { // size is at least 0x5C on FW 3.60
{| class="wikitable"
+
SceUInt32 r0; // 0x00
|-
+
SceUInt32 r1; // 0x04
! Version !! NID
+
SceUInt32 r2; // 0x08
|-
+
SceUInt32 r3; // 0x0C
| 0.990 || 0xC38D61FC
+
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 ===
  
Calls SceSysmemForDriver_89A44858.
+
<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>
  
=== sceUIDGetObjectForKernel ===
+
== Memory Block Type ==
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 0.990 || 0xC4893914
 
|}
 
  
=== SceSysmemForKernel_620E00E7 ===
+
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.
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 0.990 || 0x620E00E7
 
|}
 
  
<source lang="C">SceSysmemForKernel_620E00E7(int a1, int global_id, _DWORD *out);</source>
+
=== memtype bit value ===
  
=== SceSysmemForKernel_7C797940 ===
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Version !! NID
+
! Mask !! Value !! Description
 +
|-
 +
| 0x10000 || 0x10000 || Global. <code>nG</code> bit NOT set
 
|-
 
|-
| 0.990 || 0x7C797940
+
| 0xFF00 || 0x800 || <code>B</code> bit set. Sharable device memory.
|}
 
 
 
Calls SceSysmemForKernel_620E00E7 or SceSysmemForDriver_0F5C84B7.
 
 
 
=== free ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF00 || 0x2000 || <code>TEX[2]</code> and <code>TEX[0]</code> bit set. Outer cache Write-back, Write-Allocate. Inner cache non-cachable.
 
|-
 
|-
| 0.990-3.60 || 0xABAB0FAB
+
| 0xFF00 || 0x4000 || <code>TEX[2]</code> and <code>B</code> bit set. Outer cache non-cachable. Inner cache Write-back, Write-Allocate
|}
 
 
 
=== SceSysmemForKernel_ED221825 ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF00 || 0x8000 || <code>TEX[0]</code> bit set. <code>S</code> bit unset. Outer and inner non-cachable. Not sharable.
 
|-
 
|-
| 0.990-3.60 || 0xED221825
+
| 0xFF00 || 0xD000 || <code>TEX[0]</code> bit set. <code>C,B</code> bits set. Outer and inner Write-back, Write-Allocate.
|}
 
 
 
Calls sceKernelGUIDGetObjectForDriver.
 
 
 
=== sceGUIDKernelCreateWithAttrForKernel ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF || 0x4 || <code>AP[2:0] = 5</code>, <code>XN=1</code>. Privileged RO, User NA.
 
|-
 
|-
| 0.990-3.60 || 0x53E1FFDE
+
| 0xFF || 0x5 || <code>AP[2:0] = 5</code>. Privileged RX, User NA.
|}
 
 
 
=== sceGUIDOpenByGUIDForKernel ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF || 0x6 || <code>AP[2:0] = 1</code>, <code>XN=1</code>. Privileged RW, User NA.
 
|-
 
|-
| 0.990-3.60 || 0xCF53EEE4
+
| 0xFF || 0x7 || <code>AP[2:0] = 1</code>. Privileged RWX, User NA. (Never used, 3.60 0x80024B01)
|}
 
 
 
=== sceGUIDGetUIDVectorByClassForKernel ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF || 0x50 || <code>AP[2:0] = 7</code>. Privileged RX, User RX.
 
|-
 
|-
| 0.990-3.60 || 0xEC7D36EF
+
| 0xFF || 0x60 || <code>AP[2:0] = 3</code>, <code>XN=1</code>. Privileged RW, User RW.
|}
 
 
 
=== sceGUIDGetUIDVectorByClass2ForKernel ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0xFF || 0x40 || <code>AP[2:0] = 7</code>, <code>XN=1</code>. Privileged RO, User RO.
|-
 
| 0.990 || 0xA2F03233
 
 
|-
 
|-
| 3.60 || not present
 
 
|}
 
|}
  
It is simply a wrapper for sceGUIDGetUIDVectorByClassForKernel.
 
 
=== sceKernelCreateAddressSpaceForKernel ===
 
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Mask !! Value !! Name
 +
|-
 +
| 0x0F000000 || 0x09000000 || SceKernelUserCdram
 
|-
 
|-
! Version !! NID
+
| 0x0F000000 || 0x0A000000 || SceKernelUserShared
 
|-
 
|-
| 0.990-3.60 || 0x4A3737F0
+
| 0x0F000000 || 0x0B000000 || SceKernelUserIO
|}
 
 
 
=== sceKernelDeleteAddressSpaceForKernel ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0F000000 || 0x0C000000 || SceKernelUserMain
 
|-
 
|-
| 0.990-3.60 || 0xF2D7FE3A
+
| 0x0F000000 || 0x0D000000 || SceKernelUserUncache
|}
 
 
 
=== sceKernelAddressSpaceFreeAllMemBlockForKernel ===
 
{| class="wikitable"
 
 
|-
 
|-
! Version !! NID
+
| 0x0F000000 || 0x0E000000 || SceKernelUserCDialog
 
|-
 
|-
| 0.990-3.60 || 0x89CE1F31
+
| 0x0F000000 || 0x0F000000 || SceKernelUserCDialogNC
 
|}
 
|}
  
=== sceKernelAddressSpaceSetPhyMemPartForKernel ===
+
=== Available memory types ===
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 0.990-3.60 || 0x67955EE9
 
|}
 
  
=== sceKernelAddressSpaceUnmapForKernel ===
+
See also : [[Memory budget]]
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 0.940-3.60 || 0xCE72839E
 
|}
 
  
<source lang="C">int sceKernelAddressSpaceUnmapForKernel(SceUID pid, int unk, uint32_t paddr, uint32_t size);</source>
+
<source lang="C">
 +
type bits
  
Example: in SceSysStateMgr:
+
mask
<source lang="C">
+
0x0000000F : only kernel
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF7, 0x51000000, 0x1000000);
+
0x000000F0 : only user
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0xE0000000, 0x8000000);
 
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0x1A000000, 0x100000);
 
</source>
 
  
=== sceKernelAddressSpaceVAtoPAForKernel ===
+
RWXO bit
{| class="wikitable"
+
0 1 1 0
|-
+
? R W X
! Version !! NID
 
|-
 
| 0.990-3.60 || 0xF2179820
 
|}
 
  
=== sceKernelRxMemcpyKernelToUserForPidForKernel ===
+
RO type when both w bit and x bit are 0
{| class="wikitable"
 
|-
 
! Version !! NID
 
|-
 
| 1.69-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.
+
memory device type(?)
 +
mask : 0x00000F00
 +
0x00000200 : SO
 +
0x00000800 : DEVICE
  
<source lang="c">int sceKernelRxMemcpyKernelToUserForPidForKernel(SceUID pid, uintptr_t dst, const void *src, size_t len);</source>
+
memory cache type
 +
mask : 0x0000F000
 +
0x00002000 : No internal cache only
 +
0x00004000 : No external cache only
 +
0x00008000 : NORMAL_NC (uncache)
 +
0x0000D000 : NORMAL (cache)
  
=== sceKernelFindClassByNameForKernel ===
+
memory budget type
 +
mask : 0x00F00000
 +
0x00100000 : IO
 +
0x00200000 : NORMAL(kernel:KD, user:GAME)
 +
0x00300000 : maybe unused
 +
0x00400000 : CDRAM
 +
0x00500000 : GAME
 +
0x00800000 : PHYCONT
 +
0x00900000 : SHARED(userland only)
 +
0x00A00000 : CDIALOG
 +
0x00F00000 : TOOL
  
{| class="wikitable"
+
memory access type?
|-
+
mask : 0x0F000000
! Version !! NID
+
0x05000000 : CDRAM2
|-
+
0x06000000 : KTMP
| 3.60 || 0x62989905
+
0x09000000 : CDRAM
|}
+
0x0C000000 : normal?
 +
0x0D000000 : MAIN PHYCONT
 +
0x0E000000 : CDIALOG
  
<source lang="c">int sceKernelFindClassByNameForKernel(const char *name, SceClass **class);</source>
+
memory access type2? (only kernel)
 +
mask : 0xF0000000
 +
0x00000000 : USER
 +
0x10000000 : ROOT
 +
0x20000000 : IO
 +
0x30000000 : PHYCONT
 +
0x40000000 : CDRAM
 +
0x50000000 : CDRAM2
 +
0x60000000 : TMP
 +
0xA0000000 : GPU
  
=== sceKernelGetMemBlockTypeForKernel ===
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM2_RW                0x05408060
  
{| class="wikitable"
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP*****                0x0620D006
|-
 
! Version !! NID
 
|-
 
| 3.60 || 0x289BE3EC
 
|}
 
  
<source lang="c">
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW_UNCACHE_EXTERNAL 0x09404060
/***
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RO_UNCACHE          0x09408040
* Gets the memory block type of a memory block
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW_UNCACHE          0x09408060
*
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW                  0x09408060
* @param[in] uid - SceUID of the memory block
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RWDATA              0x09408060
* @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>
 
  
=== sceKernelCreateUidObjForKernel ===
+
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
  
{| class="wikitable"
+
SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW        0x0D808060
|-
 
! Version !! NID
 
|-
 
| 3.60 || 0xDF0288D7
 
|}
 
  
<source lang="c">SceUID sceKernelCreateUidObjForKernel(SceClass *class, const char *name, SceCreateUidObjOpt *opt, SceObjectBase **obj);</source>
+
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
  
=== sceKernelGetUidHeapClassForKernel ===
 
  
{| class="wikitable"
+
kernel memory types:
|-
 
! Version !! NID
 
|-
 
| 3.60 || 0x4CCA935D
 
|}
 
  
<source lang="c">SceClass *sceKernelGetUidHeapClassForKernel(void);</source>
+
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_DEVICE_RW          0x10200806
  
=== sceKernelGetUidMemBlockClassForKernel ===
+
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_SO_RW              0x10200206
  
{| class="wikitable"
+
/* alloc from ScePhyMemPartKD */
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R_UNCACHE          0x10208004
! Version !! NID
 
|-
 
| 3.60 || 0xAF729575
 
|}
 
  
<source lang="c">SceClass *sceKernelGetUidMemBlockClassForKernel(void);</source>
+
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_UNCACHE        0x10208006
  
=== sceKernelGetUidDLinkClassForKernel ===
+
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R                  0x1020D004
  
{| class="wikitable"
+
/* alloc from ScePhyMemPartKD */
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX                0x1020D005
! Version !! NID
 
|-
 
| 3.60 || 0xC105604E
 
|}
 
  
<source lang="c">SceClass *sceKernelGetUidDLinkClassForKernel(void);</source>
+
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW                0x1020D006
  
== SceSysmemForDriver ==
+
/* alloc from ScePhyMemPartGame */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_GAME            0x1050D006
  
=== Switch TTB For PID ===
+
/* alloc from ScePhyMemPartPhyCont */
{| class="wikitable"
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_PHYCONT        0x1080D006
|-
+
 
! Version !! NID
+
/* alloc from ScePhyMemPartGameCDialog */
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_CDIALOG        0x10A0D006
| 1.69 || 0x6F2ACDAE
+
 
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RO          0x20100204
| 3.60 || not present
+
#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
  
Changes the TTBR to point to the tables for a given PID.
+
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_R              0x6020D004
  
<source lang="c">int switch_ttb_for_pid(SceUID pid);</source>
+
/* alloc from ScePhyMemPartKD */
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_RW            0x6020D006
  
=== sceKernelRoMemcpyKernelToUserForPidForDriver ===
+
/* alloc from ScePhyMemPartGame */
{| class="wikitable"
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_GAME_RW        0x6050D006
|-
 
! Version !! NID
 
|-
 
| 1.69 || 0x571D2739
 
|-
 
| 3.60 || not present
 
|}
 
  
<source lang="c">int sceKernelRoMemcpyKernelToUserForPidForDriver(SceUID pid, void *dst, const void *src, SceSize size);</source>
+
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
  
=== sceKernelAllocHeapMemoryForDriver ===
+
from 0.990
{| class="wikitable"
+
/* need check */
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_L1WBWA_RW
! Version !! NID
 
|-
 
| 0.990-3.60 || 0x7B4CB60A
 
|}
 
  
Temp name was sceKernelMemPoolAlloc.
+
#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
  
Calls [[SceSysmem#sceKernelAllocHeapMemoryWithOptionForDriver|sceKernelAllocHeapMemoryWithOptionForDriver]] with a3 = 0.
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_GAME_RW      0x1050D006
  
<source lang="c">void* sceKernelAllocHeapMemoryForDriver(SceUID uid, SceSize size);</source>
+
#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
  
=== sceKernelAllocHeapMemoryFromGlobalHeapForDriver ===
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_NC_R  0x30808004
{| class="wikitable"
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_NC_RW 0x30808006
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_R    0x3080D004
! Version !! NID
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_PHYCONT_RW    0x3080D006
|-
 
| 3.60 || 0x7750CEA7
 
|}
 
  
Calls [[SceSysmem#sceKernelAllocHeapMemoryForDriver|sceKernelAllocHeapMemoryForDriver]] with uid = -1 (global pool <code>uid</code>).
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_UMAIN_RW
  
<source lang="c">void* sceKernelAllocHeapMemoryFromGlobalHeapForDriver(SceSize size);</source>
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_CDIALOG_R    0x10A0D004
 +
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_ROOT_CDIALOG_RW    0x10A0D006
  
=== sceKernelAllocHeapMemoryFromGlobalHeapWithOptForDriver ===
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_NC_RW        0x10F08004
{| class="wikitable"
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_NC_R          0x10F08006
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_R            0x10F0D004
! Version !! NID
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_RX            0x10F0D005
|-
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TOOL_RW            0x10F0D006
| 0.990-3.60 || 0x0B4ED16A
 
|}
 
  
Calls [[SceSysmem#sceKernelAllocHeapMemoryWithOptionForDriver|sceKernelAllocHeapMemoryWithOptionForDriver]] with uid = -1 (global pool <code>uid</code>).
+
#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
  
<source lang="c">
+
/* need check */
typedef struct ctx_49D4DD9B
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_KMP_TOOL_RW        0x60F0D006
{
 
  int unk0;
 
  int unk4;
 
  int unk8;
 
  int unkC;
 
  int unk10;
 
};
 
  
void* sceKernelAllocHeapMemoryFromGlobalHeapWithOptForDriver(SceSize size, ctx_49D4DD9B *unk);
+
#define SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_GPU_CDRAM_RW      0xA0408006
 
</source>
 
</source>
  
=== sceKernelAllocHeapMemoryWithOpt1ForDriver ===
+
=== memory allocate test ===
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Version !! NID
+
! mem type !! mem size !! mem base
 +
|-
 +
| 0x0C200860 || 0x200000 || 0x80100000
 +
|-
 +
| 0x0C208060 || 0x200000 || 0x70000000
 +
|-
 +
| 0x0C20D040 || 0x200000 || 0x85200000
 +
|-
 +
| 0x0C20D060 || 0x200000 || 0x85200000
 +
|-
 +
| 0x0C50D060 || 0x200000 || 0x85200000
 +
|-
 +
| 0x0C80D060 || 0x200000 || 0x85200000
 +
|-
 +
| 0x0CA08060 || 0x200000 || 0x70000000
 +
|-
 +
| 0x0CA0D060 || 0x200000 || 0x85200000
 +
|-
 +
| 0x0CF0D060 || 0x200000 || error, Looks like a memory type to reserve a fairly large size memory
 +
|-
 +
| 0x0D808060 || 0x200000 || 0x70000000
 +
|-
 +
| 0x0E208040 || 0x200000 || 0x68000000
 +
|-
 +
| 0x0E208050 || 0x200000 || error, It seems that RX memory cannot be allocated from the user
 +
|-
 +
| 0x0E208060 || 0x200000 || 0x68000000
 +
|-
 +
| 0x0E20D040 || 0x200000 || 0xD0300000
 +
|-
 +
| 0x0E20D060 || 0x200000 || 0xD0300000
 
|-
 
|-
| 3.60 || 0xB415B5A8
 
 
|}
 
|}
  
Same as <code>sceKernelAllocHeapMemoryForDriver</code> but uses <code>unk2</code>.
+
=== Types to reverse ===
 +
 
 +
from 0.990:
 +
<source>
 +
CDIALOG:
 +
SCE_KERNEL_MEMBLOCK_TYPE_CDIALOG_NC_R
 +
 
 +
FREE:
 +
SCE_KERNEL_MEMBLOCK_TYPE_FREE
 +
 
 +
KERNEL:
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_L1WBWA_RW
 +
 
 +
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
 +
 
 +
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_KMP_TOOL_RW
 +
 
 +
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
 +
 
 +
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
 +
 
 +
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
 +
 
 +
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
 +
 
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_NC_R
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_NC_RW
 +
 
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_IO_DEVICE_RW
 +
SCE_KERNEL_MEMBLOCK_TYPE_USER_IO_SO_RW
 +
 
 +
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
 +
 
 +
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
 +
 
 +
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* sceKernelAllocHeapMemoryWithOpt1ForDriver(SceUID uid, SceSize size, ctx_49D4DD9B *unk2);</source>
+
== SceSysmemForKernel ==
  
=== sceKernelAllocHeapMemoryWithOptionForDriver ===
+
=== sceKernelGrowPhyMemPartForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0x49D4DD9B
+
| 0.990-3.60 || 0x6B3F4102
 
|}
 
|}
  
Was named sceKernelAllocHeapMemoryWithOpt2ForDriver.
+
Calls sceKernelGrowPhyMemPartWithFlagsForKernel with flags = 0.
  
Same as <code>sceKernelAllocHeapMemoryForDriver</code> but uses <code>unk2</code>.
+
<source lang="C">int sceKernelGrowPhyMemPartForKernel(SceKernelPhyMemPart *pPhyMemPart, SceSize psize);</source>
 
 
<source lang="c">
 
void* sceKernelAllocHeapMemoryWithOpt2ForDriver(SceUID uid, SceSize size, ctx_49D4DD9B *unk2);
 
</source>
 
  
=== sceKernelAllocMemBlockWithInfoForDriver ===
+
=== sceKernelGrowPhyMemPartWithFlagsForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0xD44F464D
+
| 0.990 || not present
 +
|-
 +
| 3.60 || 0x775AA5E3
 
|}
 
|}
  
Temp name was sceKernelAllocMemBlockExtForDriver. According to logs, maybe it was "sceKernelAllocMemBlockWithInfoForKernel" on FWs pre-0.990.
+
Grows physical memory partition with flags.
  
<source lang="c">SceUID sceKernelAllocMemBlockWithInfoForDriver(const char *name, SceKernelMemBlockType type, int size, SceKernelAllocMemBlockKernelOpt *optp, SceKernelPaddrList *out_paddr_list);</source>
+
<source lang="C">int sceKernelGrowPhyMemPartWithFlagsForKernel(SceKernelPhyMemPart *pPhyMemPart, int flags, SceSize psize);</source>
  
=== sceKernelAllocMemBlockForDriver ===
+
=== sceKernelGetGrownPhyMemPartSizeForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 1.50 || 0x59F3159C
+
| 0.990 || not present
 
|-
 
|-
| 1.69-3.60 || 0xC94850C9
+
| 3.60 || 0x4D809B47
 
|}
 
|}
  
<source lang="c">
+
This is a temp name.
typedef enum SceKernelAllocMemBlockAttr {
 
SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PADDR          = 0x00000002U,
 
SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT      = 0x00000004U,
 
SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_MIRROR_BLOCKID = 0x00000040U,
 
SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PID            = 0x00000080U,
 
SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PADDR_LIST    = 0x00001000U
 
} SceKernelAllocMemBlockAttr;
 
 
 
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
+
Returns a global variable. This global variable is either a size or offset or address and is incremented by sceKernelGrowPhyMemPartWithFlagsForKernel.
typedef struct SceKernelAllocMemBlockKernelOpt {
 
SceSize size;                  //!< sizeof(SceKernelAllocMemBlockKernelOpt)
 
SceUInt32 field_4;
 
SceUInt32 attr;                //!< OR of SceKernelAllocMemBlockAttr
 
SceUInt32 field_C;
 
SceUInt32 paddr;
 
SceSize alignment;
 
SceUInt32 extraLow;
 
SceUInt32 extraHigh;
 
SceUInt32 mirror_blockid;
 
SceUID pid;
 
SceKernelPaddrList *paddr_list;
 
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;
 
  
SceUID sceKernelAllocMemBlockForDriver(const char *name, SceKernelMemBlockType type, SceSize size, SceKernelAllocMemBlockKernelOpt *optp);
+
<source lang="C">int sceKernelGetGrownPhyMemPartSizeForKernel(void);</source>
</source>
 
  
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.
+
=== sceKernelAddressSpaceSetProcessForKernel ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-3.60 || 0x2476B90F
 +
|}
  
To allocate a kernel RW block of memory, specify <code>type = 0x6020D006</code>.
+
<source lang="C">int sceKernelAddressSpaceSetProcessForKernel(SceUID uid, SceUID pid);</source>
  
To allocate a block of memory with a specific physical address, specify <code>type = 0x20100206</code> or <code>type = 0x20100806</code>, <code>pOpt->attr = 2</code>, and <code>pOpt->paddr = physical address</code>.
+
=== sceKernelAddressSpaceChangeMMUContextForKernel ===
 
+
{| class="wikitable"
To allocate a block of memory that is kernel executable, specify <code>type = 0x1020D005</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>.
 
 
 
==== pOpt->attr bitmask ====
 
{| class='wikitable'
 
 
|-
 
|-
! Bitmask
+
! Version !! NID
! Uses
 
|-
 
| 0x00000001
 
| field_C
 
|-
 
| 0x00000002
 
| paddr
 
|-
 
| 0x00000004
 
| alignment
 
|-
 
| 0x00000008
 
| field_18
 
|-
 
| 0x00000010
 
| field_1C
 
|-
 
| 0x00000020
 
| ??
 
|-
 
| 0x00000040
 
| mirror_blockid
 
|-
 
| 0x00000080
 
| pid
 
|-
 
| 0x00001000
 
| paddr_list
 
|-
 
| 0x00002000
 
| field_2C
 
 
|-
 
|-
| 0x00010000
+
| 0.931-3.60 || 0x653B0849
| field_30
 
 
|}
 
|}
  
=== sceKernelCreateClassForDriver ===
+
<source lang="C">int sceKernelAddressSpaceChangeMMUContextForKernel(SceUID uid);</source>
 +
 
 +
=== sceKernelAddressSpaceGetMMUL1InfoForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0x61317102
+
| 0.931 || 0x671A3444
 +
|-
 +
| 3.60 || not present
 
|}
 
|}
  
<source lang="c">int sceKernelCreateClassForDriver(SceClass *cls, const char *name, struct SceClass *uid_class, size_t item_size, SceClassCallback create, SceClassCallback destroy);</source>
+
<source lang="C">int sceKernelAddressSpaceGetMMUL1InfoForKernel(SceUID uid, const void *addr, void *pInfo);</source>
  
=== sceKernelCreateHeapForDriver ===
+
=== sceKernelAddressSpaceGetMMUL2InfoForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 1.69-3.60 || 0x9328E0E8
+
| 0.931 || 0xCB6E1C80
 +
|-
 +
| 3.60 || not present
 
|}
 
|}
  
<source lang="c">
+
<source lang="C">int sceKernelAddressSpaceGetMMUL2InfoForKernel(SceUID uid, const void *addr, void *pInfo);</source>
struct SceKernelHeapCreateOpt
 
{
 
  SceSize size; //28
 
  SceUInt32 uselock;
 
  SceUInt32 field_8;
 
  SceUInt32 field_C;
 
  SceUInt32 block_type;
 
  SceUInt32 field_14;
 
  SceUInt32 field_18;
 
};
 
 
 
int sceKernelCreateHeapForDriver(const char *name, SceSize size, SceKernelHeapCreateOpt *opt); // opt can be NULL
 
</source>
 
 
 
The heap pool is thread safe.
 
  
=== sceKernelCreateUidObjForDriver ===
+
=== sceKernelAddressSpaceGetMMUL1AllInfoForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0x56A13E90
+
| 0.931 || 0x1A898F2E
 +
|-
 +
| 3.60 || not present
 
|}
 
|}
  
<source lang="c">SceUID sceKernelCreateUidObjForDriver(SceClass *cls, const char *name, SceObjectBase **obj);</source>
+
<source lang="C">
 +
typedef struct SceKernelAddressSpaceMMUL1AllInfo { // size is 0x400C on FW 0.931
 +
  SceSize size; // Size of this structure
 +
  char unk[0x4008];
 +
} SceKernelAddressSpaceMMUL1AllInfo;
 +
 
 +
int sceKernelAddressSpaceGetMMUL1AllInfoForKernel(SceUID uid, SceKernelAddressSpaceMMUL1AllInfo *pInfo);</source>
  
=== sceKernelCreateUidObjForUidForDriver ===
+
=== sceKernelAddressSpaceGetMMUL2AllInfoForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 0.990-3.60 || 0x89A44858
+
| 0.931 || 0x1E1AA29B
 +
|-
 +
| 3.60 || not present
 
|}
 
|}
  
Calls SceSysmemForKernel_ED221825.
+
<source lang="C">
 +
typedef struct SceKernelAddressSpaceMMUL2AllInfo { // size is 0x404 on FW 0.931
 +
  SceSize size; // Size of this structure
 +
  char unk[0x400];
 +
} SceKernelAddressSpaceMMUL2AllInfo;
  
<source lang="c">SceUID sceKernelCreateUidObjForUidForDriver(SceClass *cls, const char *name, SceUID uid, SceObjectBase **obj_base);</source>
+
int sceKernelAddressSpaceGetMMUL2AllInfoForKernel(SceUID uid, const void *addr, SceKernelAddressSpaceMMUL2AllInfo *pInfo);</source>
  
=== sceKernelCreateUserUidForClassForDriver ===
+
=== sceKernelGetPhyPartKernelForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0xCED1547B
+
| 0.931-3.60 || 0x4D38F861
 
|}
 
|}
  
<source lang="c">SceUID sceKernelCreateUserUidForClassForDriver(SceUID pid, SceUID uid, SceClass *cls);</source>
+
return gpPhyPartKernel;
  
=== sceKernelCreateUserUidForDriver ===
+
<source lang="C">int sceKernelGetPhyPartKernelForKernel(void);</source>
 +
 
 +
=== sceKernelPhyMemLowAllocForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0xBF209859
+
| 0.931-3.60 || 0x5E169FEF
 
|}
 
|}
  
<source lang="c">SceUID sceKernelCreateUserUidForDriver(SceUID pid, SceUID uid);</source>
+
<source lang="C">
 +
// type must be 0x10001, 0x10002 or 0x20001
 +
int sceKernelPhyMemLowAllocForKernel(int type, uint size, uint alignment, void *out);
 +
</source>
  
=== sceKernelCreateUserUidForNameForDriver ===
+
=== sceKernelPhyMemLowPA2VAForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0x513B9DDD
+
| 0.931-3.60 || 0x0FD6B756
 
|}
 
|}
  
<source lang="c">SceUID sceKernelCreateUserUidForNameForDriver(SceUID pid, char *name);</source>
+
<source lang="C">
 +
// type must be 0x10002
 +
int sceKernelPhyMemLowPA2VAForKernel(int type, void *PA, void **pVA);
 +
</source>
  
=== sceKernelCreateUserUidForNameWithClassForDriver ===
+
=== sceKernelGetPhyMemLowInfoForKernel ===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Version !! NID
 
! Version !! NID
 
|-
 
|-
| 3.60 || 0x8DA0BCA5
+
| 0.931-0.990 || 0x06A4DA6C
 
|}
 
|}
  
<source lang="c">SceUID sceKernelCreateUserUidForNameWithClassForDriver(SceUID pid, char *name, SceClass *cls);</source>
+
<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;</