Overview
The memory API provides functions for allocating and managing memory on the PlayStation 3. It includes direct memory allocation, virtual memory mapping, and memory containers for resource management.Direct Memory Allocation
sysMemoryAllocate
Allocate a block of memory.Size of memory block in bytes
Page size and access rights flags (OR combination):
SYS_MEMORY_PAGE_SIZE_1MorSYS_MEMORY_PAGE_SIZE_64KSYS_MEMORY_ACCESS_RIGHT_PPU_THR,SYS_MEMORY_ACCESS_RIGHT_SPU_THR, etc.
Pointer to storage for allocated memory address
Zero on success, error code otherwise
sysMemoryFree
Free previously allocated memory.Address returned by sysMemoryAllocate
Zero on success, error code otherwise
Virtual Memory Mapping
sysMMapperAllocateAddress
Allocate a virtual address range.Size of virtual address range
Page size flags
Address alignment requirement
Pointer to storage for allocated virtual address
Zero on success, error code otherwise
sysMMapperFreeAddress
Free a virtual address range.Virtual address to free
Zero on success, error code otherwise
sysMMapperSearchAndMap
Search for and map a memory region to a virtual address.Starting virtual address for search
Memory object ID to map
Access rights and protection flags
Pointer to storage for mapped address
Zero on success, error code otherwise
sysMMapperAllocateMemory
Allocate a memory object for mapping.Size of memory object
Page size flags
Pointer to storage for memory object ID
Zero on success, error code otherwise
sysMMapperFreeMemory
Free a memory object.Memory object ID to free
Zero on success, error code otherwise
sysMMapperMapMemory
Map a memory object to a virtual address.Virtual address where memory should be mapped
Memory object ID
Access rights flags
Zero on success, error code otherwise
sysMMapperUnmapMemory
Unmap memory from a virtual address.Virtual address to unmap
Pointer to storage for unmapped memory object ID
Zero on success, error code otherwise
Memory Containers
Memory containers are used for resource management and limiting memory usage.sysMemContainerCreate
Create a memory container.Pointer to storage for container ID
Maximum size of container in bytes
Zero on success, error code otherwise
sysMemContainerDestroy
Destroy a memory container.Container ID to destroy
Zero on success, error code otherwise
sysMemAllocateFromContainer
Allocate memory from a container.Size to allocate
Container ID
Page size and access rights flags
Pointer to storage for allocated address
Zero on success, error code otherwise
sysMMapperAllocateMemoryFromContainer
Allocate a memory object from a container.Size of memory object
Container ID
Page size flags
Pointer to storage for memory object ID
Zero on success, error code otherwise
Constants
Page Size Flags
Use 1MB page size (0x0000000000000400ULL)
Use 64KB page size (0x0000000000000200ULL)
Access Rights Flags
PPU thread access (0x0000000000000008ULL)
SPU thread access (0x0000000000000002ULL)
Handler access (0x0000000000000004ULL)
Raw SPU access (0x0000000000000001ULL)
All access rights (OR of all above)
Protection Flags
Read-only access (0x0000000000080000ULL)
Read-write access (0x0000000000040000ULL)