vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceKernelAllocMemBlockOpt
 
struct  SceKernelFreeMemorySizeInfo
 
struct  SceKernelMemBlockInfo
 

Enumerations

enum  SceKernelMemoryAccessType { SCE_KERNEL_MEMORY_ACCESS_X = 0x01 , SCE_KERNEL_MEMORY_ACCESS_W = 0x02 , SCE_KERNEL_MEMORY_ACCESS_R = 0x04 }
 
enum  SceKernelMemoryType { SCE_KERNEL_MEMORY_TYPE_NORMAL_NC = 0x80 , SCE_KERNEL_MEMORY_TYPE_NORMAL = 0xD0 }
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x40, SceKernelAllocMemBlockOpt)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceKernelFreeMemorySizeInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceKernelMemBlockInfo)
 
SceUID sceKernelAllocMemBlock (const char *name, SceKernelMemBlockType type, SceSize size, SceKernelAllocMemBlockOpt *opt)
 Allocates a new memory block.
 
int sceKernelFreeMemBlock (SceUID uid)
 Frees new memory block.
 
int sceKernelGetMemBlockBase (SceUID uid, void **base)
 Gets the base address of a memory block.
 
SceUID sceKernelFindMemBlockByAddr (const void *addr, SceSize size)
 Gets the associated memory block to a given memory location.
 
int sceKernelGetMemBlockInfoByAddr (void *base, SceKernelMemBlockInfo *info)
 Gets memory block information given a base address.
 
int sceKernelGetMemBlockInfoByRange (void *base, SceSize size, SceKernelMemBlockInfo *info)
 Gets memory block information given a memory location.
 
SceUID sceKernelAllocMemBlockForVM (const char *name, SceSize size)
 Allocates a new memory block for Virtual Machine domain.
 
int sceKernelSyncVMDomain (SceUID uid, void *data, SceSize size)
 Flushes Virtual Machine caches for the given memory location.
 
int sceKernelOpenVMDomain (void)
 Makes all Virtual Machine domain memblocks executeable.
 
int sceKernelCloseVMDomain (void)
 Makes all Virtual Machine domain memblocks non executeable.
 
int sceKernelOpenMemBlock (const char *name, int flags)
 
int sceKernelCloseMemBlock (SceUID uid)
 
int sceKernelGetModelForCDialog (void)
 Get the model number of the device.
 
int sceKernelGetModel (void)
 Get the model number of the device.
 
int sceKernelGetFreeMemorySize (SceKernelFreeMemorySizeInfo *info)
 Get free memory size in bytes.
 
int sceKernelIsPSVitaTV (void)
 Returns wether the running device is a PSTV or not.
 

Variables

SceSize SceKernelAllocMemBlockOpt::size
 
SceUInt32 SceKernelAllocMemBlockOpt::attr
 
SceSize SceKernelAllocMemBlockOpt::alignment
 
SceUInt32 SceKernelAllocMemBlockOpt::uidBaseBlock
 
const char * SceKernelAllocMemBlockOpt::strBaseBlockName
 
int SceKernelAllocMemBlockOpt::flags
 
int SceKernelAllocMemBlockOpt::reserved [10]
 Unknown flags 0x10 or 0x30 for sceKernelOpenMemBlock.
 
int SceKernelFreeMemorySizeInfo::size
 sizeof(SceKernelFreeMemorySizeInfo)
 
int SceKernelFreeMemorySizeInfo::size_user
 Free memory size for *_USER_RW memory.
 
int SceKernelFreeMemorySizeInfo::size_cdram
 Free memory size for USER_CDRAM_RW memory.
 
int SceKernelFreeMemorySizeInfo::size_phycont
 Free memory size for USER_MAIN_PHYCONT_*_RW memory.
 
SceSize SceKernelMemBlockInfo::size
 
void * SceKernelMemBlockInfo::mappedBase
 
SceSize SceKernelMemBlockInfo::mappedSize
 
int SceKernelMemBlockInfo::memoryType
 
SceUInt32 SceKernelMemBlockInfo::access
 
SceKernelMemBlockType SceKernelMemBlockInfo::type
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceSysmem_stub




Data Structure Documentation

◆ SceKernelAllocMemBlockOpt

struct SceKernelAllocMemBlockOpt
Data Fields
SceSize size
SceUInt32 attr
SceSize alignment
SceUInt32 uidBaseBlock
const char * strBaseBlockName
int flags
int reserved[10] Unknown flags 0x10 or 0x30 for sceKernelOpenMemBlock.

◆ SceKernelFreeMemorySizeInfo

struct SceKernelFreeMemorySizeInfo
Data Fields
int size sizeof(SceKernelFreeMemorySizeInfo)
int size_user Free memory size for *_USER_RW memory.
int size_cdram Free memory size for USER_CDRAM_RW memory.
int size_phycont Free memory size for USER_MAIN_PHYCONT_*_RW memory.

◆ SceKernelMemBlockInfo

struct SceKernelMemBlockInfo
Data Fields
SceSize size
void * mappedBase
SceSize mappedSize
int memoryType
SceUInt32 access
SceKernelMemBlockType type

Enumeration Type Documentation

◆ SceKernelMemoryAccessType

Enumerator
SCE_KERNEL_MEMORY_ACCESS_X 

Execute privileges.

SCE_KERNEL_MEMORY_ACCESS_W 

Write privileges.

SCE_KERNEL_MEMORY_ACCESS_R 

Read privileges.

◆ SceKernelMemoryType

Enumerator
SCE_KERNEL_MEMORY_TYPE_NORMAL_NC 

Non cached memory type.

SCE_KERNEL_MEMORY_TYPE_NORMAL 

Cached memory type.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/3]

VITASDK_BUILD_ASSERT_EQ ( 0x40  ,
SceKernelAllocMemBlockOpt   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/3]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceKernelFreeMemorySizeInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/3]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceKernelMemBlockInfo   
)

◆ sceKernelAllocMemBlock()

SceUID sceKernelAllocMemBlock ( const char *  name,
SceKernelMemBlockType  type,
SceSize  size,
SceKernelAllocMemBlockOpt opt 
)

Allocates a new memory block.

Parameters
[in]name- Name for the memory block
[in]type- Type of the memory to allocate. Use SCE_KERNEL_MEMBLOCK_TYPE_USER_*.
[in]size- Size of the memory to allocate in bytes
[in]opt- Memory block options?
Returns
SceUID of the memory block on success, < 0 on error.

◆ sceKernelFreeMemBlock()

int sceKernelFreeMemBlock ( SceUID  uid)

Frees new memory block.

Parameters
[in]uid- SceUID of the memory block to free
Returns
0 on success, < 0 on error.

◆ sceKernelGetMemBlockBase()

int sceKernelGetMemBlockBase ( SceUID  uid,
void **  base 
)

Gets the base address of a memory block.

Parameters
[in]uid- SceUID of the memory block to free
[out]base- Base address of the memory block identified by SceUID
Returns
0 on success, < 0 on error.

◆ sceKernelFindMemBlockByAddr()

SceUID sceKernelFindMemBlockByAddr ( const void *  addr,
SceSize  size 
)

Gets the associated memory block to a given memory location.

Parameters
[in]base- Address of the memory location to search
[in]size- Size of the memory location in bytes
Returns
SceUID of the memory block on success, < 0 on error.

◆ sceKernelGetMemBlockInfoByAddr()

int sceKernelGetMemBlockInfoByAddr ( void *  base,
SceKernelMemBlockInfo info 
)

Gets memory block information given a base address.

Parameters
[in]base- Base address of the memory location
[out]info- Information about the related memory block
Returns
0 on success, < 0 on error.

◆ sceKernelGetMemBlockInfoByRange()

int sceKernelGetMemBlockInfoByRange ( void *  base,
SceSize  size,
SceKernelMemBlockInfo info 
)

Gets memory block information given a memory location.

Parameters
[in]base- Address of the memory location
[in]size- Size of the memory location in bytes
[out]info- Information about the related memory block
Returns
0 on success, < 0 on error.

◆ sceKernelAllocMemBlockForVM()

SceUID sceKernelAllocMemBlockForVM ( const char *  name,
SceSize  size 
)

Allocates a new memory block for Virtual Machine domain.

Parameters
[in]name- Name for the memory block
[in]size- Size of the memory to allocate in bytes
Returns
SceUID of the memory block on success, < 0 on error.
Note
- size can't be higher than 16 * 1024 * 1024.

◆ sceKernelSyncVMDomain()

int sceKernelSyncVMDomain ( SceUID  uid,
void *  data,
SceSize  size 
)

Flushes Virtual Machine caches for the given memory location.

Parameters
[in]uid- SceUID of the memory block to flush.
[in]base- Address of the memory location to flush
[in]size- Size of the memory to flush in bytes
Returns
SceUID of the memory block on success, < 0 on error.

◆ sceKernelOpenVMDomain()

int sceKernelOpenVMDomain ( void  )

Makes all Virtual Machine domain memblocks executeable.

Returns
0 on success, < 0 on error.

◆ sceKernelCloseVMDomain()

int sceKernelCloseVMDomain ( void  )

Makes all Virtual Machine domain memblocks non executeable.

Returns
0 on success, < 0 on error.

◆ sceKernelOpenMemBlock()

int sceKernelOpenMemBlock ( const char *  name,
int  flags 
)

◆ sceKernelCloseMemBlock()

int sceKernelCloseMemBlock ( SceUID  uid)

◆ sceKernelGetModelForCDialog()

int sceKernelGetModelForCDialog ( void  )

Get the model number of the device.

Returns
A value from SCE_KERNEL_MODEL

◆ sceKernelGetModel()

int sceKernelGetModel ( void  )

Get the model number of the device.

Returns
A value from SCE_KERNEL_MODEL

◆ sceKernelGetFreeMemorySize()

int sceKernelGetFreeMemorySize ( SceKernelFreeMemorySizeInfo info)

Get free memory size in bytes.

Parameters
[out]info- Returned free memory size for different kind of memory block types
Returns
0 on success, < 0 on error.

◆ sceKernelIsPSVitaTV()

int sceKernelIsPSVitaTV ( void  )

Returns wether the running device is a PSTV or not.

Returns
1 if the device is a PSTV, 0 otherwise.

Variable Documentation

◆ size [1/3]

SceSize SceKernelAllocMemBlockOpt::size

◆ attr

SceUInt32 SceKernelAllocMemBlockOpt::attr

◆ alignment

SceSize SceKernelAllocMemBlockOpt::alignment

◆ uidBaseBlock

SceUInt32 SceKernelAllocMemBlockOpt::uidBaseBlock

◆ strBaseBlockName

const char* SceKernelAllocMemBlockOpt::strBaseBlockName

◆ flags

int SceKernelAllocMemBlockOpt::flags

◆ reserved

int SceKernelAllocMemBlockOpt::reserved[10]

Unknown flags 0x10 or 0x30 for sceKernelOpenMemBlock.

◆ size [2/3]

int SceKernelFreeMemorySizeInfo::size

sizeof(SceKernelFreeMemorySizeInfo)

◆ size_user

int SceKernelFreeMemorySizeInfo::size_user

Free memory size for *_USER_RW memory.

◆ size_cdram

int SceKernelFreeMemorySizeInfo::size_cdram

Free memory size for USER_CDRAM_RW memory.

◆ size_phycont

int SceKernelFreeMemorySizeInfo::size_phycont

Free memory size for USER_MAIN_PHYCONT_*_RW memory.

◆ size [3/3]

SceSize SceKernelMemBlockInfo::size

◆ mappedBase

void* SceKernelMemBlockInfo::mappedBase

◆ mappedSize

SceSize SceKernelMemBlockInfo::mappedSize

◆ memoryType

int SceKernelMemBlockInfo::memoryType

◆ access

SceUInt32 SceKernelMemBlockInfo::access

◆ type

SceKernelMemBlockType SceKernelMemBlockInfo::type