-void
-__heap_copied(struct mm_region* region)
-{
- mm_index((void**)®ion->proc_vms->heap, region);
-}
-
-int
-__exec_remap_heap(struct ld_param* param, struct proc_mm* pvms)
-{
- if (pvms->heap) {
- mem_unmap_region(param->vms_mnt, pvms->heap);
- }
-
- struct mmap_param map_param = { .pvms = pvms,
- .vms_mnt = param->vms_mnt,
- .flags = MAP_ANON | MAP_PRIVATE,
- .type = REGION_TYPE_HEAP,
- .proct = PROT_READ | PROT_WRITE,
- .mlen = PG_SIZE };
- int status = 0;
- struct mm_region* heap;
- if ((status = mem_map(NULL, &heap, param->info.end, NULL, &map_param))) {
- param->status |= LD_STAT_FKUP;
- return status;
- }
-
- heap->region_copied = __heap_copied;
- mm_index((void**)&pvms->heap, heap);
-
- return status;
-}
+// externed from mm/dmm.c
+extern int
+create_heap(struct proc_mm* pvms, ptr_t addr);