• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/contrib/ncsw/etc/

Lines Matching refs:p_MM

167  *      p_MM  - pointer to the MM object
175 static t_Error AddFree(t_MM *p_MM, uint64_t base, uint64_t end)
186 p_CurrB = p_MM->freeBlocks[i];
231 p_MM->freeBlocks[i] = p_NewB;
247 p_MM->freeBlocks[i] = p_CurrB->p_Next;
271 p_MM->freeBlocks[i] = p_NewB;
298 * p_MM - pointer to the MM object
307 static t_Error CutFree(t_MM *p_MM, uint64_t holdBase, uint64_t holdEnd)
317 p_CurrB = p_MM->freeBlocks[i];
335 p_MM->freeBlocks[i] = p_CurrB->p_Next;
366 p_MM->freeBlocks[i] = p_CurrB->p_Next;
398 static void AddBusy(t_MM *p_MM, t_BusyBlock *p_NewBusyB)
404 p_CurrBusyB = p_MM->busyBlocks;
418 p_MM->busyBlocks = p_NewBusyB;
436 * p_MM - pointer to the MM object
444 static t_Error CutBusy(t_MM *p_MM, uint64_t base, uint64_t end)
448 p_CurrB = p_MM->busyBlocks;
483 p_MM->busyBlocks = p_CurrB->p_Next;
541 static uint64_t MmGetGreaterAlignment(t_MM *p_MM, uint64_t size, uint64_t alignment, char* name)
550 p_FreeB = p_MM->freeBlocks[MM_MAX_ALIGNMENT];
578 if ( CutFree ( p_MM, holdBase, holdEnd ) != E_OK )
585 AddBusy ( p_MM, p_NewBusyB );
598 t_MM *p_MM;
608 p_MM = (t_MM *)XX_Malloc(sizeof(t_MM));
609 if (!p_MM)
614 p_MM->h_Spinlock = XX_InitSpinlock();
615 if (!p_MM->h_Spinlock)
617 XX_Free(p_MM);
622 p_MM->freeMemSize = size;
625 p_MM->busyBlocks = 0;
628 if ((p_MM->memBlocks = CreateNewBlock(base, size)) == NULL)
630 MM_Free(p_MM);
640 if ((p_MM->freeBlocks[i] = CreateFreeBlock(newBase, newSize)) == NULL)
642 MM_Free(p_MM);
647 *h_MM = p_MM;
655 t_MM *p_MM = (t_MM *)h_MM;
662 ASSERT_COND(p_MM);
665 p_BusyBlock = p_MM->busyBlocks;
676 p_FreeBlock = p_MM->freeBlocks[i];
686 p_MemBlock = p_MM->memBlocks;
694 if (p_MM->h_Spinlock)
695 XX_FreeSpinlock(p_MM->h_Spinlock);
698 XX_Free(p_MM);
704 t_MM *p_MM = (t_MM *)h_MM;
710 SANITY_CHECK_RETURN_VALUE(p_MM, E_INVALID_HANDLE, (uint64_t)ILLEGAL_BASE);
737 return (MmGetGreaterAlignment(p_MM, size, alignment, name));
740 intFlags = XX_LockIntrSpinlock(p_MM->h_Spinlock);
742 p_FreeB = p_MM->freeBlocks[i];
749 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
759 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
764 if ( CutFree ( p_MM, holdBase, holdEnd ) != E_OK )
766 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
772 p_MM->freeMemSize -= size;
775 AddBusy ( p_MM, p_NewBusyB );
776 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
784 t_MM *p_MM = (t_MM *)h_MM;
790 ASSERT_COND(p_MM);
792 intFlags = XX_LockIntrSpinlock(p_MM->h_Spinlock);
793 p_FreeB = p_MM->freeBlocks[0]; /* The biggest free blocks are in the
809 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
816 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
821 if ( CutFree ( p_MM, base, base+size ) != E_OK )
823 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
829 p_MM->freeMemSize -= size;
832 AddBusy ( p_MM, p_NewBusyB );
833 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
841 t_MM *p_MM = (t_MM *)h_MM;
847 ASSERT_COND(p_MM);
862 intFlags = XX_LockIntrSpinlock(p_MM->h_Spinlock);
863 p_FreeB = p_MM->freeBlocks[i];
875 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
894 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
905 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
910 if ( CutFree( p_MM, holdBase, holdEnd ) != E_OK )
912 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
918 p_MM->freeMemSize -= size;
921 AddBusy( p_MM, p_NewBusyB );
922 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
930 t_MM *p_MM = (t_MM *)h_MM;
935 ASSERT_COND(p_MM);
942 intFlags = XX_LockIntrSpinlock(p_MM->h_Spinlock);
943 p_BusyB = p_MM->busyBlocks;
952 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
956 if ( AddFree( p_MM, p_BusyB->base, p_BusyB->end ) != E_OK )
958 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
966 p_MM->busyBlocks = p_BusyB->p_Next;
971 p_MM->freeMemSize += size;
974 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
982 t_MM *p_MM = (t_MM *)h_MM;
986 ASSERT_COND(p_MM);
988 intFlags = XX_LockIntrSpinlock(p_MM->h_Spinlock);
990 if ( CutBusy( p_MM, base, end ) != E_OK )
992 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
996 if ( AddFree ( p_MM, base, end ) != E_OK )
998 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
1003 p_MM->freeMemSize += size;
1005 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
1013 t_MM *p_MM = (t_MM *)h_MM;
1018 ASSERT_COND(p_MM);
1023 intFlags = XX_LockIntrSpinlock(p_MM->h_Spinlock);
1025 p_MemB = p_MM->memBlocks;
1030 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
1038 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
1045 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
1053 errCode = AddFree(p_MM, base, base+size);
1056 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
1063 p_MM->freeMemSize += size;
1065 XX_UnlockIntrSpinlock(p_MM->h_Spinlock, intFlags);
1073 t_MM *p_MM = (t_MM*)h_MM;
1077 ASSERT_COND(p_MM);
1079 p_MemBlock = p_MM->memBlocks;
1092 t_MM *p_MM = (t_MM*)h_MM;
1095 ASSERT_COND(p_MM);
1097 p_MemBlock = p_MM->memBlocks;
1104 t_MM *p_MM = (t_MM*)h_MM;
1107 ASSERT_COND(p_MM);
1109 p_MemBlock = p_MM->memBlocks;
1120 t_MM *p_MM = (t_MM*)h_MM;
1122 ASSERT_COND(p_MM);
1124 return p_MM->freeMemSize;
1130 t_MM *p_MM = (t_MM *)h_MM;
1135 p_BusyB = p_MM->busyBlocks;
1147 p_FreeB = p_MM->freeBlocks[i];