vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceKernelAllocMemBlockOpt
 
struct  SceKernelFreeMemorySizeInfo
 
struct  SceKernelSubbudgetInfo
 

Enumerations

enum  SceKernelMemoryAccessType { SCE_KERNEL_MEMORY_ACCESS_X = 0x01 , SCE_KERNEL_MEMORY_ACCESS_W = 0x02 , SCE_KERNEL_MEMORY_ACCESS_R = 0x04 }
 
enum  SceKernelSubbudgetId { SCE_KERNEL_SUBBUDGET_ID_MAIN = 0 , SCE_KERNEL_SUBBUDGET_ID_CDLG = 1 }
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x40, SceKernelAllocMemBlockOpt)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceKernelFreeMemorySizeInfo)
 
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.
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceKernelSubbudgetInfo)
 
SceUID sceKernelAllocUnmapMemBlock (const char *name, SceSize size)
 Allocates a user memblock without mapping it.
 
int sceKernelCheckModelCapability (int capability_index)
 Tests a hardware-model capability whose purpose is unknown.
 
int sceKernelFreeMemBlockForVM (SceUID uid)
 Frees a VM memblock tracked by the calling process.
 
int sceKernelGetSubbudgetInfo (SceKernelSubbudgetId subbudget, SceKernelSubbudgetInfo *info)
 Gets the total and free size of a memory subbudget.
 

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 SceKernelSubbudgetInfo::size
 Must be set to sizeof(SceKernelSubbudgetInfo).
 
SceSize SceKernelSubbudgetInfo::total_size
 Total size of the subbudget in bytes.
 
SceSize SceKernelSubbudgetInfo::free_size
 Free space in the subbudget in bytes.
 

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.

◆ SceKernelSubbudgetInfo

struct SceKernelSubbudgetInfo
Data Fields
SceSize size Must be set to sizeof(SceKernelSubbudgetInfo).
SceSize total_size Total size of the subbudget in bytes.
SceSize free_size Free space in the subbudget in bytes.

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.

◆ SceKernelSubbudgetId

Enumerator
SCE_KERNEL_SUBBUDGET_ID_MAIN 
SCE_KERNEL_SUBBUDGET_ID_CDLG 

Common-dialog memory subbudget.

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   
)

◆ 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]addr- 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]data- 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.

◆ VITASDK_BUILD_ASSERT_EQ() [3/3]

VITASDK_BUILD_ASSERT_EQ ( 0xC  ,
SceKernelSubbudgetInfo   
)

◆ sceKernelAllocUnmapMemBlock()

SceUID sceKernelAllocUnmapMemBlock ( const char *  name,
SceSize  size 
)

Allocates a user memblock without mapping it.

FW 3.60 accepts only sizes aligned to 1 MiB and copies at most 31 bytes of name. This function is available only while user remapping is enabled.

Parameters
[in]name- Memory-block name.
[in]size- Allocation size, aligned to 1 MiB.
Returns
The memblock UID in the calling process on success, < 0 on error.

◆ sceKernelCheckModelCapability()

int sceKernelCheckModelCapability ( int  capability_index)

Tests a hardware-model capability whose purpose is unknown.

FW 3.60 accepts only indices 7 and 10. Index 10 identifies the Teleport-client model: TeleportClient requires it, while TeleportServer rejects operation when it is present. The purpose of index 7 is unknown; no caller in the FW 3.60 dumps uses it.

Parameters
[in]capability_indexCapability bit index.
Returns
1 if the capability is present, 0 if it is absent, SCE_KERNEL_ERROR_INVALID_ARGUMENT if the index is unsupported.

◆ sceKernelFreeMemBlockForVM()

int sceKernelFreeMemBlockForVM ( SceUID  uid)

Frees a VM memblock tracked by the calling process.

Parameters
[in]uid- UID previously returned for a tracked VM allocation.
Returns
0 on success, < 0 on error.

◆ sceKernelGetSubbudgetInfo()

int sceKernelGetSubbudgetInfo ( SceKernelSubbudgetId  subbudget,
SceKernelSubbudgetInfo *  info 
)

Gets the total and free size of a memory subbudget.

Parameters
[in]subbudgetSCE_KERNEL_SUBBUDGET_ID_MAIN or SCE_KERNEL_SUBBUDGET_ID_CDLG.
[in,out]infoPointer to a SceKernelSubbudgetInfo structure.
Returns
0 on success, < 0 on error.
Note
FW 3.60 requires DIP switch 159 to be enabled.

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 SceKernelSubbudgetInfo::size

Must be set to sizeof(SceKernelSubbudgetInfo).

◆ total_size

SceSize SceKernelSubbudgetInfo::total_size

Total size of the subbudget in bytes.

◆ free_size

SceSize SceKernelSubbudgetInfo::free_size

Free space in the subbudget in bytes.