+
+ ptr_t cur_end = 0;
+ struct mm_region *pos = (struct mm_region*)lead,
+ *n = list_entry(lead->next, struct mm_region, head);
+ do {
+ if (vmregion->start >= cur_end && vmregion->end <= n->start) {
+ break;
+ }
+ cur_end = n->end;
+ pos = n;
+ n = list_entry(n->head.next, struct mm_region, head);
+ } while ((ptr_t)&pos->head != (ptr_t)lead);
+
+ // XXX caution. require mm_region::head to be the lead of struct
+ llist_insert_after(&pos->head, &vmregion->head);