|
REpsp2
PSP2 OS reverse engineering
|
Data Structures | |
| struct | ObjectHeap |
Functions | |
| void | ObjectHeap_init (ObjectHeap *pObjectHeap, SceKernelPhyMemPart *pPhyMemPart, SceUInt32 num_heaps, struct HeapDescriptor *heaps, SceKernelHeapHook *pHeapHook) |
| void | ObjectHeap_set_heap_for_size (ObjectHeap *pObjectHeap, SceSize itemSize, SceUIDHeap *pHeap, int heapGuid) |
| SceUIDHeap * | ObjectHeapGetHeap (ObjectHeap *pObjectHeap, SceSize size) |
| Get appropriate heap for allocations of given size. | |
| SceInt32 | ObjectHeapSetResourceLimit (ObjectHeap *pObjectHeap, SceUInt32 resourceType, SceInt32 nMaxLimit, SceSize max_cache_size) |
| void * | ObjectHeap_get_unk18 (ObjectHeap *pObjectHeap) |
| SceBool | ObjectHeapAllocLimit (ObjectHeap *pObjectHeap, SceUInt32 type, ScePVoid *ppObject) |
| Allocate resource from object heap with limit checking. | |
| SceBool | ObjectHeapFree (ObjectHeap *pObjectHeap, SceUInt32 type, ScePVoid pObject) |
| Attempt freeing memory into object heap. | |
| ObjectHeap * | get_kernel_objectheap (void) |
| Obtain pointer to the kernel's object heap. | |
| SceInt32 | sceKernelCreateObjectHeap (ScePID processId, int a2, SceKernelHeapHook *pHeapHook, ObjectHeap **ppObjectHeap) |
| Create an object heap. | |
| SceInt32 | sceKernelObjectHeapStart (ObjectHeap *pObjectHeap, int a2, unsigned a3) |
| SceInt32 | sce_KernelDeleteObjectHeap (ObjectHeap *pObjectHeap) |
| Delete an object heap. | |
| SceInt32 | sceKernelObjectHeap_setResourceSize (SceUInt32 type, SceSize size) |
| Set size of resources of a given type in object heap. | |
| SceInt32 | sceKernelObjectHeapSetResourceLimit (ObjectHeap *pObjectHeap, SceUInt32 resourceType, SceInt32 nMaxLimit, SceSize max_cache_size) |
| Set limit for specific resource in object heap. | |
| SceInt32 | sceKernelObjectHeapSetResourceLimitAll (ObjectHeap *pObjectHeap, unsigned a2, const void *a3) |
| Set limit for "all" resource types in an object heap. | |
| ScePVoid | sceKernelObjectHeapAlloc (ObjectHeap *pObjectHeap, SceSize size) |
| Allocate memory from an object heap. | |
| SceInt32 | sceKernelObjectHeapFree (ObjectHeap *pObjectHeap, SceSize size, ScePVoid ptr) |
| Free memory allocated from an object heap. | |
Object Heaps are per-process objects used to perform memory allocations. They are used to ensure a process cannot allocate more resources of a certain type than allowed by a configurable limit. Under the hood, memory is allocated from one of various heaps (usually(?) per-process).
The Object Heap also implements a memory re-use mechanism which retains the allocations of a configurable amount of objects in a freelist, such that allocations can be serviced without calling the underlying heaps.
| ObjectHeap * get_kernel_objectheap | ( | void | ) |
Obtain pointer to the kernel's object heap.
| void * ObjectHeap_get_unk18 | ( | ObjectHeap * | pObjectHeap | ) |
| void ObjectHeap_init | ( | ObjectHeap * | pObjectHeap, |
| SceKernelPhyMemPart * | pPhyMemPart, | ||
| SceUInt32 | num_heaps, | ||
| struct HeapDescriptor * | heaps, | ||
| SceKernelHeapHook * | pHeapHook ) |
| void ObjectHeap_set_heap_for_size | ( | ObjectHeap * | pObjectHeap, |
| SceSize | itemSize, | ||
| SceUIDHeap * | pHeap, | ||
| int | heapGuid ) |
| SceBool ObjectHeapAllocLimit | ( | ObjectHeap * | pObjectHeap, |
| SceUInt32 | type, | ||
| ScePVoid * | ppObject ) |
Allocate resource from object heap with limit checking.
| pObjectHeap | Target object heap | |
| type | Resource type | |
| [out] | ppObject | Pointer receiving pointer to allocated memory |
| SCE_TRUE | Resource allocation successful |
| SCE_FALSE | Resource allocation failed (object limit overflow) |
| SceBool ObjectHeapFree | ( | ObjectHeap * | pObjectHeap, |
| SceUInt32 | type, | ||
| ScePVoid | pObject ) |
Attempt freeing memory into object heap.
| pObjectHeap | Target object heap |
| type | Resource type |
| pObject | Pointer to memory |
| SCE_TRUE | Resource has been free'ed (added to object heap freelist) |
| SCE_FALSE | Resource has been ignored When this value is returned, the caller should call UIDHeapCallFree on the appropriate heap to release the resource. |
| SceUIDHeap * ObjectHeapGetHeap | ( | ObjectHeap * | pObjectHeap, |
| SceSize | size ) |
Get appropriate heap for allocations of given size.
| pObjectHeap | Target object heap |
| size | Size to allocate |
| Non-NULL | Heap from which memory can be allocated |
| NULL | No appropriate heap found |
| SceInt32 ObjectHeapSetResourceLimit | ( | ObjectHeap * | pObjectHeap, |
| SceUInt32 | resourceType, | ||
| SceInt32 | nMaxLimit, | ||
| SceSize | max_cache_size ) |
| SceInt32 sce_KernelDeleteObjectHeap | ( | ObjectHeap * | pObjectHeap | ) |
Delete an object heap.
| pObjectHeap | Target object heap |
| SCE_OK | Success |
| <SCE_OK | Error code |
| SceInt32 sceKernelCreateObjectHeap | ( | ScePID | processId, |
| int | a2, | ||
| SceKernelHeapHook * | pHeapHook, | ||
| ObjectHeap ** | ppObjectHeap ) |
Create an object heap.
| processId | Object heap owner PID |
| a2 | |
| pHeapHook | Heap operations hook |
| ppObjectHeap | Receives pointer to created object heap |
| SCE_OK | Success |
| <SCE_OK | Error code |
Set size of resources of a given type in object heap.
| type | |
| size |
| SCE_OK | Success |
| <SCE_OK | Error code |
| ScePVoid sceKernelObjectHeapAlloc | ( | ObjectHeap * | pObjectHeap, |
| SceSize | size ) |
Allocate memory from an object heap.
| pObjectHeap | Object heap to allocate from |
| size | Size of memory to allocate |
| SceInt32 sceKernelObjectHeapFree | ( | ObjectHeap * | pObjectHeap, |
| SceSize | size, | ||
| ScePVoid | ptr ) |
Free memory allocated from an object heap.
| pObjectHeap | Object heap from which memory comes |
| size | Size of allocated memory |
| ptr | Pointer to allocated memory |
| SCE_OK | Success |
| <SCE_OK | Error code |
| SceInt32 sceKernelObjectHeapSetResourceLimit | ( | ObjectHeap * | pObjectHeap, |
| SceUInt32 | resourceType, | ||
| SceInt32 | nMaxLimit, | ||
| SceSize | max_cache_size ) |
Set limit for specific resource in object heap.
| pObjectHeap | Target object heap |
| resourceType | Target resource type |
| nMaxLimit | Maximum number of allocations for resource type |
| max_cache_size | Maximum cache size for the resource type This is the number of free()'ed items kept allocated in a freelist instead of releasing the memory back to the underlying heap. |
| SCE_OK | Success |
| <SCE_OK | Error code |
| SceInt32 sceKernelObjectHeapSetResourceLimitAll | ( | ObjectHeap * | pObjectHeap, |
| unsigned | a2, | ||
| const void * | a3 ) |
Set limit for "all" resource types in an object heap.
| pObjectHeap | Target object heap |
| a2 | Maximal resource type index on which limits are set |
| a3 | Resource limits information |
| SCE_OK | Success |
| <SCE_OK | Error code |
| SceInt32 sceKernelObjectHeapStart | ( | ObjectHeap * | pObjectHeap, |
| int | a2, | ||
| unsigned | a3 ) |
| pObjectHeap | |
| a2 | |
| a3 |
| SCE_OK | Success |
| <SCE_OK | Error code |