From: Ben Gras Date: Mon, 1 Sep 2014 13:02:08 +0000 (+0200) Subject: vm: allow split of mem_anon_contig region X-Git-Tag: v3.3.0~28 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=48e74378c704462d3f3a44232a8578541c8543a6;p=minix.git vm: allow split of mem_anon_contig region . so that memory of such regions can be deallocated in any order Change-Id: I34013d6085cf19a482412cf9bed6b7f96e60e1e6 --- 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; }