From 48e74378c704462d3f3a44232a8578541c8543a6 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Mon, 1 Sep 2014 15:02:08 +0200 Subject: [PATCH] vm: allow split of mem_anon_contig region . so that memory of such regions can be deallocated in any order Change-Id: I34013d6085cf19a482412cf9bed6b7f96e60e1e6 --- minix/servers/vm/mem_anon_contig.c | 9 +++++++++ minix/servers/vm/region.c | 1 + 2 files changed, 10 insertions(+) diff --git a/minix/servers/vm/mem_anon_contig.c b/minix/servers/vm/mem_anon_contig.c index d2f063df1..76fb3dc52 100644 --- a/minix/servers/vm/mem_anon_contig.c +++ b/minix/servers/vm/mem_anon_contig.c @@ -15,6 +15,8 @@ static int anon_contig_pagefault(struct vmproc *vmp, struct vir_region *region, int len, int *io); static int anon_contig_sanitycheck(struct phys_region *pr, const char *file, int line); static int anon_contig_writable(struct phys_region *pr); +static void anon_contig_split(struct vmproc *vmp, struct vir_region *vr, + struct vir_region *r1, struct vir_region *r2); static int anon_contig_resize(struct vmproc *vmp, struct vir_region *vr, vir_bytes l); static int anon_contig_new(struct vir_region *vr); static int anon_contig_pt_flags(struct vir_region *vr); @@ -26,6 +28,7 @@ struct mem_type mem_type_anon_contig = { .ev_unreference = anon_contig_unreference, .ev_pagefault = anon_contig_pagefault, .ev_resize = anon_contig_resize, + .ev_split = anon_contig_split, .ev_sanitycheck = anon_contig_sanitycheck, .writable = anon_contig_writable, .pt_flags = anon_contig_pt_flags, @@ -121,3 +124,9 @@ static int anon_contig_writable(struct phys_region *pr) return mem_type_anon.writable(pr); } +static void anon_contig_split(struct vmproc *vmp, struct vir_region *vr, + struct vir_region *r1, struct vir_region *r2) +{ + return; +} + diff --git a/minix/servers/vm/region.c b/minix/servers/vm/region.c index 507407d67..881488d72 100644 --- a/minix/servers/vm/region.c +++ b/minix/servers/vm/region.c @@ -1160,6 +1160,7 @@ static int split_region(struct vmproc *vmp, struct vir_region *vr, if(!vr->def_memtype->ev_split) { printf("VM: split region not implemented for %s\n", vr->def_memtype->name); + sys_diagctl_stacktrace(vmp->vm_endpoint); return EINVAL; } -- 2.11.4.GIT