Lines Matching refs:heapInfo

358     OSHeapInfo *heapInfo;  in OS_AllocFromHeap()  local
374 heapInfo = OSiHeapInfo[id]; in OS_AllocFromHeap()
377 if (!heapInfo) in OS_AllocFromHeap()
386 heap = heapInfo->currentHeap; in OS_AllocFromHeap()
389 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_ALLOCFROMHEAP_NOHEAP); in OS_AllocFromHeap()
391 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_ALLOCFROMHEAP_INVHEAP); in OS_AllocFromHeap()
392 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_ALLOCFROMHEAP_INVHEAP); in OS_AllocFromHeap()
394 hd = &heapInfo->heapArray[heap]; in OS_AllocFromHeap()
492 OSHeapInfo *heapInfo; in OS_AllocFixed() local
504 heapInfo = OSiHeapInfo[id]; in OS_AllocFixed()
506 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_ALLOCFIXED_NOHEAP); in OS_AllocFixed()
508 SDK_ASSERTMSG(RangeSubset(start, end, heapInfo->arenaStart, heapInfo->arenaEnd), in OS_AllocFixed()
512 for (i = 0; i < heapInfo->numHeaps; i++) in OS_AllocFixed()
514 hd = &heapInfo->heapArray[i]; in OS_AllocFixed()
538 for (i = 0; i < heapInfo->numHeaps; i++) in OS_AllocFixed()
541 hd = &heapInfo->heapArray[i]; in OS_AllocFixed()
669 OSHeapInfo *heapInfo; in OS_FreeToHeap() local
678 heapInfo = OSiHeapInfo[id]; in OS_FreeToHeap()
682 heap = heapInfo->currentHeap; in OS_FreeToHeap()
685 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_FREETOHEAP_NOHEAP); in OS_FreeToHeap()
687 (ptr, (char *)heapInfo->arenaStart + HEADERSIZE, (char *)heapInfo->arenaEnd), in OS_FreeToHeap()
690 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_FREETOHEAP_INVHEAP); in OS_FreeToHeap()
693 hd = &heapInfo->heapArray[heap]; in OS_FreeToHeap()
726 OSHeapInfo *heapInfo; in OS_FreeAllToHeap() local
735 heapInfo = OSiHeapInfo[id]; in OS_FreeAllToHeap()
739 heap = heapInfo->currentHeap; in OS_FreeAllToHeap()
742 SDK_ASSERTMSG(heapInfo->heapArray, "heap not initialized"); in OS_FreeAllToHeap()
743 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, "invalid heap handle"); in OS_FreeAllToHeap()
745 hd = &heapInfo->heapArray[heap]; in OS_FreeAllToHeap()
782 OSHeapInfo *heapInfo; in OS_SetCurrentHeap() local
789 heapInfo = OSiHeapInfo[id]; in OS_SetCurrentHeap()
791 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_SETCURRENTHEAP_NOHEAP); in OS_SetCurrentHeap()
792 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_SETCURRENTHEAP_INVHEAP); in OS_SetCurrentHeap()
793 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_SETCURRENTHEAP_INVHEAP); in OS_SetCurrentHeap()
794 prev = heapInfo->currentHeap; in OS_SetCurrentHeap()
795 heapInfo->currentHeap = heap; in OS_SetCurrentHeap()
819 OSHeapInfo *heapInfo; in OS_InitAlloc() local
834 heapInfo = arenaStart; in OS_InitAlloc()
835 OSiHeapInfo[id] = heapInfo; in OS_InitAlloc()
839 heapInfo->heapArray = (void *)((u32)arenaStart + sizeof(OSHeapInfo)); in OS_InitAlloc()
840 heapInfo->numHeaps = maxHeaps; in OS_InitAlloc()
842 for (i = 0; i < heapInfo->numHeaps; i++) in OS_InitAlloc()
844 HeapDesc *hd = &heapInfo->heapArray[i]; in OS_InitAlloc()
854 heapInfo->currentHeap = -1; in OS_InitAlloc()
857 arenaStart = (void *)((char *)heapInfo->heapArray + arraySize); in OS_InitAlloc()
860 heapInfo->arenaStart = arenaStart; in OS_InitAlloc()
861 heapInfo->arenaEnd = (void *)TRUNC(arenaEnd, ALIGNMENT); in OS_InitAlloc()
862 SDK_ASSERTMSG(MINOBJSIZE <= (char *)heapInfo->arenaEnd - (char *)heapInfo->arenaStart, in OS_InitAlloc()
866 return heapInfo->arenaStart; in OS_InitAlloc()
902 OSHeapInfo *heapInfo; in OS_CreateHeap() local
913 heapInfo = OSiHeapInfo[id]; in OS_CreateHeap()
915 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_CREATEHEAP_NOHEAP); in OS_CreateHeap()
920 SDK_ASSERTMSG(RangeSubset(start, end, heapInfo->arenaStart, heapInfo->arenaEnd), in OS_CreateHeap()
927 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_CreateHeap()
929 if (heapInfo->heapArray[heap].size < 0) in OS_CreateHeap()
933 SDK_ASSERTMSG(!DLOverlap(heapInfo->heapArray[heap].free, start, end), in OS_CreateHeap()
935 SDK_ASSERTMSG(!DLOverlap(heapInfo->heapArray[heap].allocated, start, end), in OS_CreateHeap()
941 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_CreateHeap()
943 hd = &heapInfo->heapArray[heap]; in OS_CreateHeap()
990 OSHeapInfo *heapInfo; in OS_DestroyHeap() local
1000 heapInfo = OSiHeapInfo[id]; in OS_DestroyHeap()
1002 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_DESTROYHEAP_NOHEAP); in OS_DestroyHeap()
1003 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_DESTROYHEAP_INVHEAP); in OS_DestroyHeap()
1004 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_DESTROYHEAP_INVHEAP); in OS_DestroyHeap()
1006 hd = &heapInfo->heapArray[heap]; in OS_DestroyHeap()
1023 if (heapInfo->currentHeap == heap) in OS_DestroyHeap()
1025 heapInfo->currentHeap = -1; in OS_DestroyHeap()
1048 OSHeapInfo *heapInfo; in OS_AddToHeap() local
1059 heapInfo = OSiHeapInfo[id]; in OS_AddToHeap()
1061 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_ADDTOHEAP_NOHEAP); in OS_AddToHeap()
1062 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_ADDTOHEAP_INVHEAP); in OS_AddToHeap()
1063 SDK_ASSERTMSG(0 <= heapInfo->heapArray[heap].size, OS_ERR_ADDTOHEAP_INVHEAP); in OS_AddToHeap()
1065 hd = &heapInfo->heapArray[heap]; in OS_AddToHeap()
1071 SDK_ASSERTMSG(RangeSubset(start, end, heapInfo->arenaStart, heapInfo->arenaEnd), in OS_AddToHeap()
1077 for (i = 0; i < heapInfo->numHeaps; i++) in OS_AddToHeap()
1079 if (heapInfo->heapArray[i].size < 0) in OS_AddToHeap()
1083 SDK_ASSERTMSG(!DLOverlap(heapInfo->heapArray[i].free, start, end), in OS_AddToHeap()
1085 SDK_ASSERTMSG(!DLOverlap(heapInfo->heapArray[i].allocated, start, end), in OS_AddToHeap()
1151 OSHeapInfo *heapInfo; in OS_CheckHeap() local
1162 heapInfo = OSiHeapInfo[id]; in OS_CheckHeap()
1167 heap = heapInfo->currentHeap; in OS_CheckHeap()
1171 OSi_CHECK(heapInfo->heapArray); in OS_CheckHeap()
1172 OSi_CHECK(0 <= heap && heap < heapInfo->numHeaps); in OS_CheckHeap()
1174 hd = &heapInfo->heapArray[heap]; in OS_CheckHeap()
1180 OSi_CHECK(InRange(cell, heapInfo->arenaStart, heapInfo->arenaEnd)); in OS_CheckHeap()
1198 OSi_CHECK(InRange(cell, heapInfo->arenaStart, heapInfo->arenaEnd)); in OS_CheckHeap()
1235 OSHeapInfo *heapInfo; in OS_ReferentSize() local
1242 heapInfo = OSiHeapInfo[id]; in OS_ReferentSize()
1244 SDK_ASSERTMSG(heapInfo->heapArray, OS_ERR_REFERENT_NOHEAP); in OS_ReferentSize()
1246 (ptr, (char *)heapInfo->arenaStart + HEADERSIZE, (char *)heapInfo->arenaEnd), in OS_ReferentSize()
1253 SDK_ASSERTMSG(((char *)cell->hd - (char *)heapInfo->heapArray) % sizeof(HeapDesc) == 0, in OS_ReferentSize()
1255 SDK_ASSERTMSG(heapInfo->heapArray <= cell->hd in OS_ReferentSize()
1256 && cell->hd < &heapInfo->heapArray[heapInfo->numHeaps], OS_ERR_REFERENT_INVPTR); in OS_ReferentSize()
1277 OSHeapInfo *heapInfo; in OS_DumpHeap() local
1285 heapInfo = OSiHeapInfo[id]; in OS_DumpHeap()
1287 SDK_ASSERTMSG(heapInfo && heapInfo->heapArray, OS_ERR_DUMPHEAP_NOHEAP); in OS_DumpHeap()
1292 heap = heapInfo->currentHeap; in OS_DumpHeap()
1294 SDK_ASSERTMSG(0 <= heap && heap < heapInfo->numHeaps, OS_ERR_DUMPHEAP_INVHEAP); in OS_DumpHeap()
1296 hd = &heapInfo->heapArray[heap]; in OS_DumpHeap()
1365 OSHeapInfo *heapInfo; in OS_VisitAllocated() local
1374 heapInfo = OSiHeapInfo[id]; in OS_VisitAllocated()
1376 for (heap = 0; heap < heapInfo->numHeaps; heap++) in OS_VisitAllocated()
1378 if (heapInfo->heapArray[heap].size >= 0) in OS_VisitAllocated()
1380 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OS_VisitAllocated()
1407 OSHeapInfo *heapInfo; in OSi_GetTotalAllocSize() local
1413 heapInfo = OSiHeapInfo[id]; in OSi_GetTotalAllocSize()
1414 SDK_ASSERT(heapInfo); in OSi_GetTotalAllocSize()
1415 SDK_ASSERT(heap < heapInfo->numHeaps); in OSi_GetTotalAllocSize()
1420 heap = heapInfo->currentHeap; in OSi_GetTotalAllocSize()
1425 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OSi_GetTotalAllocSize()
1432 for (cell = heapInfo->heapArray[heap].allocated; cell; cell = cell->next) in OSi_GetTotalAllocSize()
1456 OSHeapInfo *heapInfo; in OS_GetTotalFreeSize() local
1462 heapInfo = OSiHeapInfo[id]; in OS_GetTotalFreeSize()
1463 SDK_ASSERT(heapInfo); in OS_GetTotalFreeSize()
1464 SDK_ASSERT(heap < heapInfo->numHeaps); in OS_GetTotalFreeSize()
1469 heap = heapInfo->currentHeap; in OS_GetTotalFreeSize()
1472 for (cell = heapInfo->heapArray[heap].free; cell; cell = cell->next) in OS_GetTotalFreeSize()
1494 OSHeapInfo *heapInfo; in OS_GetMaxFreeSize() local
1500 heapInfo = OSiHeapInfo[id]; in OS_GetMaxFreeSize()
1501 SDK_ASSERT(heapInfo); in OS_GetMaxFreeSize()
1502 SDK_ASSERT(heap < heapInfo->numHeaps); in OS_GetMaxFreeSize()
1507 heap = heapInfo->currentHeap; in OS_GetMaxFreeSize()
1510 for (cell = heapInfo->heapArray[heap].free; cell; cell = cell->next) in OS_GetMaxFreeSize()
1539 OSHeapInfo *heapInfo; in OS_ClearHeap() local
1548 heapInfo = OSiHeapInfo[id]; in OS_ClearHeap()
1550 SDK_ASSERTMSG(heapInfo && heapInfo->heapArray, "heap not initialized"); in OS_ClearHeap()
1555 SDK_ASSERTMSG(RangeSubset(start, end, heapInfo->arenaStart, heapInfo->arenaEnd), in OS_ClearHeap()
1562 heap = heapInfo->currentHeap; in OS_ClearHeap()
1566 hd = &heapInfo->heapArray[heap]; in OS_ClearHeap()