FreeBSD/sys/arm/arm/physmem.c
/*
 * Insertion-sort a new entry into a regions list; sorted by start address.
 */
Insertion-sort a new entry into a regions list; sorted by start address.
Insertion - sort a new entry into a regions list ; sorted by start address .
static void
insert_region(struct region *regions, size_t rcnt, vm_paddr_t addr,
    vm_size_t size, uint32_t flags)
{
	size_t i;
	struct region *ep, *rp;
	ep = regions + rcnt;
	for (i = 0, rp = regions; i < rcnt; ++i, ++rp) {
		if (addr < rp->addr) {
			bcopy(rp, rp + 1, (ep - rp) * sizeof(*rp));
			break;
		}
	}
	rp->addr  = addr;
	rp->size  = size;
	rp->flags = flags;
}
static void insert_region ( struct region * regions , size_t rcnt , vm_paddr_t addr , vm_size_t size , uint32_t flags ) { size_t i ; struct region * ep , * rp ; ep = regions + rcnt ; for ( i = 0 , rp = regions ; i < rcnt ; ++ i , ++ rp ) { if ( addr < rp -> addr ) { bcopy ( rp , rp + 1 , ( ep - rp ) * sizeof ( * rp ) ) ; break ; } } rp -> addr = addr ; rp -> size = size ; rp -> flags = flags ; }
Insertion-sort a new entry into a regions list; sorted by start address.
Insertion - sort a new entry into a regions list ; sorted by start address .