From: Arun Thomas Date: Thu, 16 Aug 2012 21:33:27 +0000 (+0200) Subject: VM: allow for 16KB chunk alignment X-Git-Tag: v3.2.1~365 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/host.html?a=commitdiff_plain;h=fc9b3f9bdd34dbfc5c8153180cdac6c0200c9c2e;p=minix.git VM: allow for 16KB chunk alignment --- diff --git a/servers/vm/alloc.c b/servers/vm/alloc.c index 8a7108308..391071693 100644 --- a/servers/vm/alloc.c +++ b/servers/vm/alloc.c @@ -171,6 +171,9 @@ phys_clicks alloc_mem(phys_clicks clicks, u32_t memflags) if(memflags & PAF_ALIGN64K) { align_clicks = (64 * 1024) / CLICK_SIZE; clicks += align_clicks; + } else if(memflags & PAF_ALIGN16K) { + align_clicks = (16 * 1024) / CLICK_SIZE; + clicks += align_clicks; } mem = alloc_pages(clicks, memflags, NULL); diff --git a/servers/vm/vm.h b/servers/vm/vm.h index 85d218142..0e95b6ed7 100644 --- a/servers/vm/vm.h +++ b/servers/vm/vm.h @@ -8,6 +8,7 @@ #define PAF_LOWER16MB 0x08 #define PAF_LOWER1MB 0x10 #define PAF_FIRSTBLOCK 0x20 /* alloc_mem: return first block */ +#define PAF_ALIGN16K 0x40 /* Aligned to 16k boundary. */ #define MARK do { if(mark) { printf("%d\n", __LINE__); } } while(0)