Difference between revisions of "SceSysmem"

From Vita Development Wiki
Jump to navigation Jump to search
Line 9,013: Line 9,013:
 
== SceDebugForTZS ==
 
== SceDebugForTZS ==
  
    sceKernelAssert: found
+
FW 1.80:
    sceKernelPrintfLevel: found
 
    sceKernelStopped: 0xCB502FD1 on 0.990, not present on 1.80
 
 
 
 
       NID 0: 0x1655E0E3
 
       NID 0: 0x1655E0E3
 
       NID 1: 0x2F9B8AA8: sceKernelAssert
 
       NID 1: 0x2F9B8AA8: sceKernelAssert
Line 9,022: Line 9,019:
 
       NID 3: 0xC70CBB58: sceKernelPrintfLevel
 
       NID 3: 0xC70CBB58: sceKernelPrintfLevel
 
       NID 4: 0xD4E6A0C0
 
       NID 4: 0xD4E6A0C0
 +
 +
=== sceKernelAssertForTZS ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.80 || 0x2F9B8AA8
 +
|}
 +
 +
<source lang="C">int sceKernelAssertForTZS(int expected_value, const char *file_name, const char *function_name, int line);</source>
 +
 +
=== sceKernelPrintfLevelForTZS ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990-1.80 || 0xC70CBB58
 +
|}
 +
 +
<source lang="C">
 +
//print_level: ex: 1
 +
int sceKernelPrintfLevelForTZS(int print_level, const char *fmt, ...);</source>
 +
 +
=== sceKernelStoppedForTZS ===
 +
{| class="wikitable"
 +
|-
 +
! Version !! NID
 +
|-
 +
| 0.990 || 0xCB502FD1
 +
|-
 +
| 1.80 || not present
 +
|}
  
 
== SceCpuForTZS ==
 
== SceCpuForTZS ==

Revision as of 16:11, 4 December 2019

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 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.

Contents

Module

This module exists in both non-secure and secure world. The non-secure world SELF can be found in os0:kd/sysmem.skprx. It also can be found in the Boot Image.

Known NIDs

Version Name World Privilege NID
1.50 SceSysmem Non-secure Kernel 0x78D8AA34
1.69 SceSysmem Non-secure Kernel 0xB93950C6
3.57 SceSysmem Non-secure Kernel 0x00CFDC77
3.60-3.61 SceSysmem Non-secure Kernel 0x3380B323
1.69 SceSysmem Secure Kernel 0x502BE0E5
1.80 SceSysmem Secure Kernel 0x72425377

Libraries

Known NIDs

Version Name World Visibility NID
1.50-3.60 SceSysmemForKernel Non-secure Kernel 0x63A519E5
1.50-3.60 SceSysmemForDriver Non-secure Kernel 0x6F25E18A
1.50-1.692 SceSysmemForDebugger Non-secure Kernel 0xC7309957
1.50-3.60 SceSysmem Non-secure User 0x37FE725A
1.50-3.60 SceDipsw Non-secure User 0xB36D5922
1.50-3.60 SceDipswForDriver Non-secure Kernel 0xC9E26388
1.50-3.60 SceUartForKernel Non-secure Kernel 0xC03DBE40
1.50-3.60 SceCpu Non-secure User 0x45265161
1.50-3.60 SceCpuForKernel Non-secure Kernel 0x54BF2BAB
1.50-3.60 SceCpuForDriver Non-secure Kernel 0x40ECDB0E
1.50-1.69 SceSysclibForKernel Non-secure Kernel 0x24878615
3.60 SceSysclibForKernel Non-secure Kernel removed
1.50-3.60 SceSysclibForDriver Non-secure Kernel 0x7EE45391
1.50-3.60 SceSysrootForKernel Non-secure Kernel 0x3691DA45
1.50-3.60 SceSysrootForDriver Non-secure Kernel 0x2ED7F97A
1.50-3.60 SceKernelUtilsForDriver Non-secure Kernel 0x496AD8B4
1.50-3.60 SceZlibForDriver Non-secure Kernel 0xE241534E
1.50-3.60 SceKernelSuspendForDriver Non-secure Kernel 0x7290B21C
1.50-3.60 SceQafMgrForDriver Non-secure Kernel 0x4E29D3B6
1.50-3.60 ScePmMgrForDriver Non-secure Kernel 0xF13F32F9
1.50-3.60 SceSblAIMgrForDriver Non-secure Kernel 0xFD00C69A
1.50-3.60 SceProcEventForDriver Non-secure Kernel 0x887F19D0
1.50-3.60 SceDebugLed Non-secure User 0xAE004C0A
1.50-3.60 SceDebugLedForDriver Non-secure Kernel 0x7BC05EAD
1.50-3.60 SceDebugForKernel Non-secure Kernel 0x88C17370
1.50-3.60 SceDebugForDriver Non-secure Kernel 0x88758561
1.69-1.80 SceSysmemForTZS Secure Kernel 0x8680060
1.69-1.80 SceDipswForTZS Secure Kernel 0x9DBF584C
1.80 SceUartForTZS Secure Kernel 0xA1D740D7
1.80 SceDebugForTZS Secure Kernel 0x028FFADB
1.69-1.80 SceCpuForTZS Secure Kernel 0xC516B23E
1.69-1.80 SceSysclibForTZS Secure Kernel 0xC839BB78
1.69-1.80 SceSysrootForTZS Secure Kernel 0xFEFF641D
1.69-1.80 SceQafMgrForTZS Secure Kernel 0x637069DD
1.69-1.80 ScePmMgrForTZS Secure Kernel 0x27F1AFD8
1.69-1.80 SceSblAIMgrForTZS Secure Kernel 0x60D19047

Types

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 *sceKernelGetSelfAuthInfoForKernel)(SceUID pid, SceSelfAuthInfo* self_info);
  int (__cdecl *sceKernelGetProcessTitleIdForKernel)(SceUID pid, char *titleid, size_t 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 *sysroot_buffer;
  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
	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 struct SceClassInfo_0990 { // size is 0x10 on 0.990
	SceSize size; // Size of this structure
	struct SceClass *next;
	struct SceClass *root; // to confirm
	struct SceClass *prev; // to confirm
} SceClassInfo_0990;

typedef struct SceClass { // size is 0x2C
	struct SceClass *next;				// 0x00
	struct SceClass *root;				// 0x04
	struct SceClass *prev;				// 0x08
	const char *name;				// 0x0C
	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
 */
/*@{*/

/**
 * @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

#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA			SCE_KERNEL_MEMBLOCK_TYPE_USER_RW

/**
 * @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

/**
 * @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

/**
 * @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_NC_RW.
 */
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_RWDATA_UNCACHE		SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE

/**
 * @brief User readable and writable LPDDR2 physical continuous memory
 *
 * 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

/**
 * @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

/**
 * @brief An alias for SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW.
 */
#define SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RWDATA		SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW

/*@}*/

/**
 * @brief A type representing a memory type
 *
 * A type that represents the type of memory block secured by sceKernelAllocMemBlock.
 */
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 FW 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;
  int unk4;
  char *name;
  int unkC;
  int unk10;
  int memblock_some_size;
  int extraLow;
  int extraHigh;
  int unk20;
  int unk24;
  SceKernelObject *SceUIDPhyMemPartClass_obj;
} SceKernelMemBlockInfoExDetails;

typedef struct SceKernelMemBlockInfoEx { // size is 0xAC on FW 0.990, 0xB8 on FW 3.60
  SceSize size;
  SceKernelMemBlockInfoExDetails details;
  int unk30;
  int unk34;
  int unk38;
  int unk3C;
  int unk40;
  int unk44;
  int unk48;
  int unk4C;
  int unk50;
  int unk54;
  int unk58;
  int unk5C;
  int unk60;
  int unk64;
  int unk68;
  int unk6C;
  int unk70;
  int unk74;
  int unk78;
  int unk7C;
  int unk80;
  int unk84;
  int unk88;
  int unk8C;
  int unk90;
  int unk94;
  int unk98;
  int unk9C;
  int unkA0;
  int unkA4;
  int unkA8;
  int unkAC;
  int unkB0;
  int unkB4;
} SceKernelMemBlockInfoEx;

/*----- memory access permission -----*/

/**
 * @brief readable memory
 */
#define SCE_KERNEL_MEMORY_ACCESS_R		0x04U

/**
 * @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

/**
 * @brief cache normal memory
 */
#define SCE_KERNEL_MEMORY_TYPE_NORMAL		0xD0

/**
 * Optional parameter of sceKernelAllocMemBlock for FW <=0.940.
 */
 typedef struct SceKernelAllocMemBlockOpt0940 {
	SceSize		size;
	SceUInt32	attr;
	SceSize		alignment;			/**< alignment */
	SceUID		uidBaseBlock;			/**< base memory block */
	const char	*strBaseBlockName;
} SceKernelAllocMemBlockOpt0940;

/**
 * Option parameter of sceKernelAllocMemBlock
 */
 typedef struct SceKernelAllocMemBlockOpt {
	/**
	 * Size of this structure
	 */
	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	reserved;

	/**
	 * 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
 */
typedef struct SceKernelAllocMemBlockOptKernel_old {
    SceSize size;			// 0x28 on 0.910, 0x2C on 0.910, 0x30 on 0.990, 0x34 on ?.??
    SceUInt32 field_4;
    SceUInt32 attr;
    SceUInt32 field_C;
    SceUInt32 paddr;
    SceSize alignment;
    SceUInt32 extraLow;
    SceUInt32 extraHigh;
    SceUInt32 base;
    SceUID pid;
    ScePAVector *paddr_list;
    SceUInt32 field_2C;
    SceUInt32 field_30;
} SceKernelAllocMemBlockOptKernel_old;

/**
 * Option parameter of kernel sceKernelAllocMemBlock on recent FWs (as seen on FW 3.60)
 */
typedef struct SceKernelAllocMemBlockOptKernel {
	SceSize size;			// 0x58 on 3.60
	SceUInt32 field_4;
	SceUInt32 attr;
	SceUInt32 field_C;
	SceUInt32 paddr;
	SceSize alignment;
	SceUInt32 extraLow;
	SceUInt32 extraHigh;
	SceUInt32 base;
	SceUID pid;
	ScePAVector *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;
} SceKernelAllocMemBlockOptKernel;

/**
 * Attributes to enable some SceKernelAllocMemBlockOpt members.
 */
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PADDR		0x00000002 // to check
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_ALIGNMENT		0x00000004
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_BASE			0x00000040
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PID			0x00000080 // to check
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_BASENAME		0x00000200
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_HAS_PADDR_LIST		0x00001000 // to check

/**
 * Memory area is physically continuous.
 */
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_PHYCONT			0x00200000

#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_SHARE_PHYPAGE		0x01000000

/**
 * Allow partial operation. ?What does that mean?
 */
#define SCE_KERNEL_ALLOC_MEMBLOCK_ATTR_ALLOW_PARTIAL_OP		0x04000000

/**
 * 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;
	uint32_t unk_8;
	uint32_t unk_C;			// example: 0x20
	uint32_t unk_10;
} SceKernelHeapMemoryOpt;

typedef struct SceKernelVARange {
	uint32_t vaddr;
	uint32_t length;
} SceKernelVARange;

typedef struct SceKernelPARange {
	uint32_t paddr;
	uint32_t length;
} SceKernelPARange;

typedef struct SceKernelPAVector {
	SceSize size;			// Size of this structure (0x14 on 0.990)
	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.

SceKernelAllocMemBlockOpt.attr bitmask

Bitmask Uses
0x00000001 has_field_C
0x00000002 HAS_PADDR (10)
0x00000004 HAS_ALIGNMENT (14)
0x00000008 has_field_18
0x00000010 has_field_1C
0x00000040 HAS_BASE (20)
0x00000080 HAS_PID (24)
0x00000200 HAS_BASENAME (?)
0x00001000 HAS_PADDR_LIST (28)
0x00002000 has_field_2C
0x00010000 has_field_30

Memory Block Type

The type parameter indicates what kind of memory to allocate. Here is a mapping of type 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.

Mask Value Description
0x10000 0x10000 Global. nG bit NOT set
0xFF00 0x800 B bit set. Sharable device memory.
0xFF00 0x2000 TEX[2] and TEX[0] bit set. Outer cache Write-back, Write-Allocate. Inner cache non-cachable.
0xFF00 0x4000 TEX[2] and B bit set. Outer cache non-cachable. Inner cache Write-back, Write-Allocate
0xFF00 0x8000 TEX[0] bit set. S bit unset. Outer and inner non-cachable. Not sharable.
0xFF00 0xD000 TEX[0] bit set. C,B bits set. Outer and inner Write-back, Write-Allocate.
0xFF 0x4 AP[2:0] = 5, XN=1. Privileged RO, User NA.
0xFF 0x5 AP[2:0] = 5. Privileged RX, User NA.
0xFF 0x6 AP[2:0] = 1, XN=1. Privileged RW, User NA.
0xFF 0x7 AP[2:0] = 1. Privileged RWX, User NA. (Never used, 3.60 0x80024B01)
0xFF 0x50 AP[2:0] = 7. Privileged RX, User RX.
0xFF 0x60 AP[2:0] = 3, XN=1. Privileged RW, User RW.
0xFF 0x40 AP[2:0] = 7, XN=1. Privileged RO, User RO.
Mask Value Name
0x0F000000 0x09000000 SceKernelUserCdram
0x0F000000 0x0A000000 SceKernelUserShared
0x0F000000 0x0B000000 SceKernelUserIO
0x0F000000 0x0C000000 SceKernelUserMain
0x0F000000 0x0D000000 SceKernelUserUncache
0x0F000000 0x0E000000 SceKernelUserCDialog
0x0F000000 0x0F000000 SceKernelUserCDialogNC
type bits

mask
0x0000000F : only kernel
0x000000F0 : only user

RWXO bit
0 1 1 0
? R W X

RO type when both w bit and x bit are 0

memory device type(?)
mask : 0x00000F00
0x00000200 : SO
0x00000800 : DEVICE

memory cache type
mask : 0x0000F000
0x00002000 : No internal cache only
0x00004000 : No external cache only
0x00008000 : NORMAL_NC (uncache)
0x0000D000 : NORMAL (cache)

memory access type?
mask : 0x00F00000
0x00100000 : IO
0x00200000 : normal?
0x00400000 : CDRAM
0x00500000 : GAME
0x00800000 : PHYCONT
0x00A00000 : UNKNOWN
0x00F00000 : UNKNOWN

memory access type2?(only kernel)
mask : 0xF0000000
0x10000000 : normal?
0x20000000 : IO
0x40000000 : CDRAM
0x50000000 : CDRAM2
0x60000000 : TMP
0xA0000000 : GPU

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_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

memory allocate test.

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

Types to reverse

from 0.931:

kernel memory types:
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_SO_RW: 0x10200206
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R: 0x1020d004
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R_UNCACHE: 0x10208004
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW: 0x1020d006
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_UNCACHE: 0x10208006
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_DEVICE_RW: 0x10200806
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX: 0x1020d005
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_GAME: 0x1050d006
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_RO: 0x20100804
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_RW: 0x20100806
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RO: 0x20100204
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RW: 0x20100206
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_NC_RO: 0x20108004
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_NC_RW: 0x20108006
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_BOOT_IMAGE: 0x1020d007
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_RW: 0x40408006
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM2_RW: 0x50408006
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_TMP_RW: 0x6020d006
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_GPU_CDRAM_RW: 0xa0408006

user memory types:
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP*****: 0x620d006
SCE_KERNEL_MEMBLOCK_TYPE_USER_TEXT: 0xc20d050
SCE_KERNEL_MEMBLOCK_TYPE_USER_DEVICE_RW: ok
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW: 0xc20d060
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE: 0xc208060
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW: 0x9408060
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM2_RW: 0x5408060

code memory types:
SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_L1WBWA: 0x4000
SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_L2WBWA: 0x2000
SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_NORMAL_NC

alloc attributes:
SCE_KERNEL_MEMBLOCK_ALLOC_ATTR_HAS_PBASE

from 0.990:

SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_L1WBWA
SCE_KERNEL_MEMBLOCK_CODE_MEMORY_TYPE_L2WBWA
SCE_KERNEL_MEMBLOCK_CODE_USER_CDRAM_L1WBWA_RW

CDIALOG:
SCE_KERNEL_MEMBLOCK_TYPE_CDIALOG_NC_R

FREE:
SCE_KERNEL_MEMBLOCK_TYPE_FREE

KERNEL:
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_BOOT_IMAGE
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM2_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_L1WBWA_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_CDRAM_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_DEVICE_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_GPU_CDRAM_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_NC_RO
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_NC_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_RO
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_R
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RO
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_IO_SO_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_KMP_TOOL_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_R_UNCACHE
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_RW
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_GAME
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RW_UNCACHE
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_SO_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_TMP_RW
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_CDRAM2_RW
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_NC_R
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_NC_RW
SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW
SCE_KERNEL_MEMBLOCK_TYPE_USER_IO_DEVICE_RW
SCE_KERNEL_MEMBLOCK_TYPE_USER_IO_SO_RW
SCE_KERNEL_MEMBLOCK_TYPE_USER_KTMP*****
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_RW
SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE
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
SCE_KERNEL_MEMBLOCK_TYPE_USER_TEXT

SceSysmemForKernel

SceSysmemForKernel_66636970

Version NID
0.990 0x66636970

Return *class.

int SceSysmemForKernel_66636970(SceUID uid);

SceSysmemForKernel_95ABFDC3

Version NID
0.990-3.60 0x95ABFDC3
int SceSysmemForKernel_95ABFDC3(uint32_t flags);

sceKernelRegisterClassForKernel

Version NID
0.990 0x11761B77

sceKernelAllocKernelHeapForKernel

Version NID
0.990 0x432EADA6
int sceKernelAllocKernelHeapForKernel(SceSize size);

sceUIDCreateEntryHeapForKernel

Version NID
0.990-3.60 0x19CAEF35
int sceUIDCreateEntryHeapForKernel(void);

sceUIDKernelCreateForKernel

Version NID
0.990 0xE6FAD50A

sceUIDObjectSetClassForKernel

Version NID
0.990 0x226DE851
int sceUIDObjectSetClassForKernel(SceKernelObject *pObject, SceClass *pClass);

sceGUIDGetEntryInfoAllForKernel

Version NID
0.990-3.60 0x2A79C51C
int sceGUIDGetEntryInfoAllForKernel(SceUID uid, void *vectors, uint32_t nVector, void *out);

sceGUIDNameForKernel

Version NID
0.990 0x250EE289
char *sceGUIDNameForKernel(SceUID uid);

sceGUIDRegisterForKernel

Version NID
0.990-3.60 0xAF42AAD5
int sceGUIDRegisterForKernel(SceClass *pClass, const char *name, SceKernelObject *pObject);

sceKernelGetAddressSpaceMMUContextForKernel

Version NID
0.990-3.60 0xFBEF93AA
int sceKernelGetAddressSpaceMMUContextForKernel(SceUID uid, void *context);

sceKernelAllocSimpleMemBlockForKernel

Version NID
0.990-3.60 0xF81F4672
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);

sceKernelGetSimpleMemBlockBaseForKernel

Version NID
0.990-3.60 0x0A8D14EC
int sceKernelGetSimpleMemBlockBaseForKernel(SceKernelSimpleMemBlock *smb, void **base);

sceKernelAddressSpaceVARangeToPAVectorForKernel

Version NID
0.990-3.60 0xF7250E6C
int sceKernelAddressSpaceVARangeToPAVectorForKernel(SceUID uid, const SceKernelVARange *vRange, SceKernelPAVector *pVector);

sceKernelGetPhyMemPartInfoByIDForKernel

Version NID
0.990-3.60 0xF4FA0575
int sceKernelGetPhyMemPartInfoByIDForKernel(SceUID uid, void *info);

sceUIDDeleteEntryHeapForKernel

Version NID
0.990-3.60 0xF0C3FCFC
int sceUIDDeleteEntryHeapForKernel(SceUID uid);

sceGUIDUnregisterForKernel

Version NID
0.990 0xE79BBCF2
int sceGUIDUnregisterForKernel(SceUID uid);

sceGUIDGetEntryInfoClassForKernel

Version NID
0.990-3.60 0xE90CFD62
int sceGUIDGetEntryInfoClassForKernel(SceUID uid, int a2, void *vectors, int nVector, void *out);

sceKernelGetPhyPageResetForKernel

Version NID
0.990-3.60 0xEB350679
void *sceKernelGetPhyPageResetForKernel(void);

sceKernelFreePhyPageForKernel

Version NID
0.990-3.60 0x00BC5B4A
int sceKernelFreePhyPageForKernel(uint32_t a1, int pPage, uint32_t a3, uint32_t a4);

sceKernelGetPhyMemLowInfoForKernel

Version NID
0.990 0x06A4DA6C
typedef struct SceKernelPhyMemLowInfo { // size is 0x1C on FW 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;

int sceKernelGetPhyMemLowInfoForKernel(uint32_t type, SceKernelPhyMemLowInfo *info);

sceKernelNameHeapInsertForKernel

Version NID
0.990-3.60 0x08AB3DAE
int sceKernelNameHeapInsertForKernel(char *name, uint32_t flags, uint32_t *out);

scePUIDReleaseObjectForKernel

Version NID
3.60 0x3FCA782B

scePUIDGetInfoForKernel

Version NID
3.60 0x12ED88AE

sceGUIDGetEntryForKernel

Version NID
3.60 0x45F2A59C

sceGUIDGetVisibilityLevelForKernel

Version NID
3.60 0xC69666C3

sceGUIDSetVisibilityLevelForKernel

Version NID
3.60 0xCB8D03C0

sceGUIDFindByNameForKernel

Version NID
3.60 0xCEBA8031

sceGUIDFindByNameAllForKernel

Version NID
3.60 0x4B5C85AC

sceGUIDGetPIDForKernel

Version NID
3.60 0xCF5A2311

sceGUIDSetCNOAForKernel

Version NID
3.60 0x8D6AF468

sceGUIDSetForKernel

Version NID
0.990-3.60 0xD7B323EB
int sceGUIDSetForKernel(SceUID uid, SceClass *pClass, const char *name, SceKernelObject *pObject);

sceUIDGetProcUIDVectorByClassForKernel

Version NID
0.990 0x51C08396
3.60 not present

sceKernelGetPhyMemPartInfoForKernel

Version NID
0.990 0x67849418
3.60 not present

sceUIDReferObjectWithLevelForKernel

Version NID
0.990 0xF79B52B2
3.60 not present

sceKernelPhysicalMemReadForKernel

Version NID
0.990 0xF96E3AE2
3.60 not present

Temp name was memcpy_from_paddr.

dst must be a vaddr and src must be a paddr. Return copied size on success.

int sceKernelPhysicalMemReadForKernel(void *dst, const void *src, SceSize dst_size, SceSize src_size);

sceKernelAllocPartitionMemBlockForKernel

Version NID
0.990-3.60 0x5FFE4B79

Temp name was sceKernelAllocSystemCallTableForKernel.

SceUID sceKernelAllocPartitionMemBlockForKernel(SceUID pid, const char *name, SceKernelMemBlockType type, SceSize vsize, const struct SceKernelAllocMemBlockOptKernel *pOpt);

sceKernelUIDEntryHeapGetInfoForKernel

Version NID
0.990 not present
3.60 0x686AA15C

sceUIDEntryHeapCloseAllPUIDForKernel

Version NID
0.990-3.60 0xFAF96C1F
int sceUIDEntryHeapCloseAllPUIDForKernel(SceUID uid);

sceKernelNameHeapGetInfoForKernel

Version NID
0.990 not present
3.60 0xE443253B

sceKernelGetFixedHeapInfoByPointerForKernel

Version NID
0.990-3.60 0x219E90FD
// pObject is of size 0x30
// pObject first 4 bytes are structure size
int sceKernelGetFixedHeapInfoByPointerForKernel(void *pObject, SceKernelFixedHeapInfo *pInfo);

sceKernelGetHeapInfoByPointerForKernel

Version NID
0.990 not present
3.60 0x68451777
int sceKernelGetHeapInfoByPointerForKernel(void *pObject, SceKernelHeapInfo *pInfo);

sceKernelGetHeapInfoForKernel

Version NID
0.990-3.60 0x91733EF4
int sceKernelGetHeapInfoForKernel(SceUID uid, SceKernelHeapInfo *pInfo);

sceKernelFreeSimpleMemBlockForKernel

Version NID
0.990-3.60 0xA1FFA2C9

sceKernelSysrootAllocUnsureForKernel

Version NID
0.990-3.60 0xC0A4D2F3
void *sceKernelSysrootAllocUnsureForKernel(uint32_t size);

sceGUIDGetObjectWithClassForKernel

Version NID
0.990-3.60 0x7ABFA9A7
int sceGUIDGetObjectWithClassForKernel(SceUID uid, SceClass *pClass, SceKernelObject **obj);

SceSysmemForKernel_C38D61FC

Version NID
0.990 0xC38D61FC

Calls SceSysmemForDriver_89A44858.

sceUIDGetObjectForKernel

Version NID
0.990 0xC4893914

SceSysmemForKernel_620E00E7

Version NID
0.990 0x620E00E7
SceSysmemForKernel_620E00E7(int a1, int global_id, _DWORD *out);

SceSysmemForKernel_7C797940

Version NID
0.990 0x7C797940

Calls SceSysmemForKernel_620E00E7 or SceSysmemForDriver_0F5C84B7.

free

Version NID
0.990-3.60 0xABAB0FAB

sceUIDtoObjectForKernel

Version NID
0.990-3.60 0xED221825

Calls sceKernelGUIDGetObjectForDriver.

SceKernelObject *sceUIDtoObjectForKernel(SceUID uid);

sceGUIDKernelCreateWithAttrForKernel

Version NID
0.990-3.60 0x53E1FFDE
int sceGUIDKernelCreateWithAttrForKernel(SceClass *pClass, uint32_t a2, uint32_t a3, SceKernelObject *pObject);

sceGUIDOpenByGUIDForKernel

Version NID
0.990-3.60 0xCF53EEE4

sceGUIDGetUIDVectorByClassForKernel

Version NID
0.990-3.60 0xEC7D36EF

sceGUIDGetUIDVectorByClass2ForKernel

Version NID
0.990 0xA2F03233
3.60 not present

It is simply a wrapper for sceGUIDGetUIDVectorByClassForKernel.

sceKernelCreateAddressSpaceForKernel

Version NID
0.990-3.60 0x4A3737F0

sceKernelDeleteAddressSpaceForKernel

Version NID
0.990-3.60 0xF2D7FE3A

sceKernelAddressSpaceFreeAllMemBlockForKernel

Version NID
0.990-3.60 0x89CE1F31
int sceKernelAddressSpaceFreeAllMemBlockForKernel(SceUID uid);

sceKernelAddressSpaceSetPhyMemPartForKernel

Version NID
0.990-3.60 0x67955EE9
int sceKernelAddressSpaceSetPhyMemPartForKernel(SceUID uid, uint32_t a2, void *PhyMemPart);

sceKernelAddressSpaceUnmapForKernel

Version NID
0.940-3.60 0xCE72839E
int sceKernelAddressSpaceUnmapForKernel(SceUID uid, int unk, void *vbase, SceSize size);

3.60:

int sceKernelAddressSpaceUnmapForKernel(SceUID uid, int flags, int unk, uint32_t paddr, SceSize size);

Example: in SceSysStateMgr:

sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF7, 0x51000000, 0x1000000);
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0xE0000000, 0x8000000);
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0x1A000000, 0x100000);

3.60

sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF7, 0xC, 0x51000000, 0x1000000);
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0xC, 0xE0000000, 0x8000000);
sceKernelAddressSpaceUnmapForKernel(0x10007, 0xF0, 0xC, 0x1A000000, 0x100000);

sceKernelAddressSpaceVAtoPAForKernel

Version NID
0.990-3.60 0xF2179820
int sceKernelAddressSpaceVAtoPAForKernel(SceAddressSpace *pAS, uint32_t mode, void *pVA, void **pPA);

sceKernelAddressSpaceGetMemoryTypeForKernel

Version NID
0.990-3.60 0xCC7BB240
int sceKernelAddressSpaceGetMemoryTypeForKernel(uint32_t *memory_type);