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

Lines Matching refs:base

54  *      rom "base" address. Each busy block has a name that
58 * base - base address of the busy block
66 static t_BusyBlock * CreateBusyBlock(uint64_t base, uint64_t size, char *name)
78 p_BusyBlock->base = base;
79 p_BusyBlock->end = base + size;
96 * from "base" address.
99 * base - base address of the memory block
106 static t_MemBlock * CreateNewBlock(uint64_t base, uint64_t size)
117 p_MemBlock->base = base;
118 p_MemBlock->end = base+size;
129 * started from "base" address.
132 * base - base address of the free block
139 static t_FreeBlock * CreateFreeBlock(uint64_t base, uint64_t size)
150 p_FreeBlock->base = base;
151 p_FreeBlock->end = base + size;
164 * by their base address.
168 * base - base address of a given free block
175 static t_Error AddFree(t_MM *p_MM, uint64_t base, uint64_t end)
189 alignBase = MAKE_ALIGNED(base, alignment);
211 if ( !p_NextB || (p_NextB && end < p_NextB->base) )
222 else if ( (end < p_CurrB->base) && ((end-alignBase) >= alignment) )
235 if ((alignBase < p_CurrB->base) && (end >= p_CurrB->base))
237 p_CurrB->base = alignBase;
242 if ( (p_CurrB->end - p_CurrB->base) < alignment)
263 if ( !p_CurrB && ((((uint64_t)(end-base)) & ((uint64_t)(alignment-1))) == 0) )
265 if ((p_NewB = CreateFreeBlock(alignBase, end-base)) == NULL)
277 if ( p_CurrB && base > p_CurrB->base )
278 base = p_CurrB->base;
299 * holdBase - base address of the allocated block
310 uint64_t alignBase, base, end;
324 base = p_CurrB->base;
327 if ( (holdBase <= base) && (holdEnd <= end) && (holdEnd > base) )
340 p_CurrB->base = alignBase;
344 else if ( (holdBase > base) && (holdEnd <= end) )
346 if ( (holdBase-base) >= alignment )
359 p_CurrB->base = alignBase;
387 * that all busy blocks are ordered by their base address in
406 while ( p_CurrBusyB && p_NewBusyB->base > p_CurrBusyB->base )
425 * Cuts a block from base to end from the list of busy blocks.
437 * base - base address of a given busy block
444 static t_Error CutBusy(t_MM *p_MM, uint64_t base, uint64_t end)
453 if ( base < p_CurrB->end )
466 if ( p_NextB && end > p_NextB->base )
468 p_NextB->base = end;
472 if ( base <= p_CurrB->base )
474 if ( end < p_CurrB->end && end > p_CurrB->base )
476 p_CurrB->base = end;
489 if ( end < p_CurrB->end && end > p_CurrB->base )
498 p_CurrB->end = base;
537 * base address of an allocated block.
549 base address according to the alignment. */
554 alignBase = MAKE_ALIGNED(p_FreeB->base, alignment);
556 /* the block is found if the aligned base inside the block
558 if ( alignBase >= p_FreeB->base &&
596 t_Error MM_Init(t_Handle *h_MM, uint64_t base, uint64_t size)
628 if ((p_MM->memBlocks = CreateNewBlock(base, size)) == NULL)
637 newBase = MAKE_ALIGNED( base, (0x1 << i) );
638 newSize = size - (newBase - base);
743 while ( p_FreeB && (p_FreeB->end - p_FreeB->base) < size )
753 holdBase = p_FreeB->base;
782 uint64_t MM_GetForce(t_Handle h_MM, uint64_t base, uint64_t size, char* name)
798 if ( base >= p_FreeB->base && (base+size) <= p_FreeB->end )
814 if ((p_NewBusyB = CreateBusyBlock(base, size, name)) == NULL)
821 if ( CutFree ( p_MM, base, base+size ) != E_OK )
835 return (base);
866 base address. If the whole required size may be fit
880 holdBase = ( min <= p_FreeB->base ) ? p_FreeB->base : min;
888 while ( p_FreeB && ((p_FreeB->end - p_FreeB->base) < size) )
898 holdBase = p_FreeB->base;
928 uint64_t MM_Put(t_Handle h_MM, uint64_t base)
937 /* Look for a busy block that have the given base value.
944 while ( p_BusyB && base != p_BusyB->base )
956 if ( AddFree( p_MM, p_BusyB->base, p_BusyB->end ) != E_OK )
968 size = p_BusyB->end - p_BusyB->base;
980 uint64_t MM_PutForce(t_Handle h_MM, uint64_t base, uint64_t size)
983 uint64_t end = base + size;
990 if ( CutBusy( p_MM, base, end ) != E_OK )
996 if ( AddFree ( p_MM, base, end ) != E_OK )
1011 t_Error MM_Add(t_Handle h_MM, uint64_t base, uint64_t size)
1028 if ( base >= p_MemB->base && base < p_MemB->end )
1036 if ( base >= p_MemB->base && base < p_MemB->end )
1043 if ((p_NewMemB = CreateNewBlock(base, size)) == NULL)
1053 errCode = AddFree(p_MM, base, base+size);
1084 return (p_MemBlock->base);
1098 return p_MemBlock->base;
1111 if ((addr >= p_MemBlock->base) && (addr < p_MemBlock->end))
1139 XX_Print("\t0x%p: (%s: b=0x%llx, e=0x%llx)\n", p_BusyB, p_BusyB->name, p_BusyB->base, p_BusyB->end );
1150 XX_Print("\t0x%p: (b=0x%llx, e=0x%llx)\n", p_FreeB, p_FreeB->base, p_FreeB->end);