PSPSDK 2024-12-16
Loading...
Searching...
No Matches
System Memory Manager

This module contains routines to manage heaps of memory. More...

Typedefs

typedef int SceKernelSysMemAlloc_t
 

Enumerations

enum  PspSysMemBlockTypes { PSP_SMEM_Low = 0 , PSP_SMEM_High , PSP_SMEM_Addr }
 Specifies the type of allocation used for memory blocks. More...
 

Functions

SceUID sceKernelAllocPartitionMemory (SceUID partitionid, const char *name, int type, SceSize size, void *addr)
 Allocate a memory block from a memory partition.
 
int sceKernelFreePartitionMemory (SceUID blockid)
 Free a memory block allocated with sceKernelAllocPartitionMemory.
 
voidsceKernelGetBlockHeadAddr (SceUID blockid)
 Get the address of a memory block.
 
SceSize sceKernelTotalFreeMemSize (void)
 Get the total amount of free memory.
 
SceSize sceKernelMaxFreeMemSize (void)
 Get the size of the largest free memory block.
 
int sceKernelDevkitVersion (void)
 Get the firmware version.
 
int sceKernelSetCompiledSdkVersion (int version)
 Set the version of the SDK with which the caller was compiled.
 
int sceKernelGetCompiledSdkVersion (void)
 Get the SDK version set with sceKernelSetCompiledSdkVersion().
 

Detailed Description

This module contains routines to manage heaps of memory.

Typedef Documentation

◆ SceKernelSysMemAlloc_t

Enumeration Type Documentation

◆ PspSysMemBlockTypes

Specifies the type of allocation used for memory blocks.

Enumerator
PSP_SMEM_Low 

Allocate from the lowest available address.

PSP_SMEM_High 

Allocate from the highest available address.

PSP_SMEM_Addr 

Allocate from the specified address.

Function Documentation

◆ sceKernelAllocPartitionMemory()

SceUID sceKernelAllocPartitionMemory ( SceUID  partitionid,
const char name,
int  type,
SceSize  size,
void addr 
)

Allocate a memory block from a memory partition.

Parameters
partitionid- The UID of the partition to allocate from.
name- Name assigned to the new block.
type- Specifies how the block is allocated within the partition. One of PspSysMemBlockTypes.
size- Size of the memory block, in bytes.
addr- If type is PSP_SMEM_Addr, then addr specifies the lowest address allocate the block from.
Returns
The UID of the new block, or if less than 0 an error.

◆ sceKernelDevkitVersion()

int sceKernelDevkitVersion ( void  )

Get the firmware version.

Returns
The firmware version. 0x01000300 on v1.00 unit, 0x01050001 on v1.50 unit, 0x01050100 on v1.51 unit, 0x01050200 on v1.52 unit, 0x02000010 on v2.00/v2.01 unit, 0x02050010 on v2.50 unit, 0x02060010 on v2.60 unit, 0x02070010 on v2.70 unit, 0x02070110 on v2.71 unit.

◆ sceKernelFreePartitionMemory()

int sceKernelFreePartitionMemory ( SceUID  blockid)

Free a memory block allocated with sceKernelAllocPartitionMemory.

Parameters
blockid- UID of the block to free.
Returns
? on success, less than 0 on error.

◆ sceKernelGetBlockHeadAddr()

void * sceKernelGetBlockHeadAddr ( SceUID  blockid)

Get the address of a memory block.

Parameters
blockid- UID of the memory block.
Returns
The lowest address belonging to the memory block.

◆ sceKernelGetCompiledSdkVersion()

int sceKernelGetCompiledSdkVersion ( void  )

Get the SDK version set with sceKernelSetCompiledSdkVersion().

Returns
Version number, or 0 if unset.

◆ sceKernelMaxFreeMemSize()

SceSize sceKernelMaxFreeMemSize ( void  )

Get the size of the largest free memory block.

Returns
The size of the largest free memory block, in bytes.

◆ sceKernelSetCompiledSdkVersion()

int sceKernelSetCompiledSdkVersion ( int  version)

Set the version of the SDK with which the caller was compiled.

Version numbers are as for sceKernelDevkitVersion().

Returns
0 on success, < 0 on error.

◆ sceKernelTotalFreeMemSize()

SceSize sceKernelTotalFreeMemSize ( void  )

Get the total amount of free memory.

Returns
The total amount of free memory, in bytes.