From fc9b3f9bdd34dbfc5c8153180cdac6c0200c9c2e Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Thu, 16 Aug 2012 23:33:27 +0200 Subject: [PATCH] VM: allow for 16KB chunk alignment --- servers/vm/alloc.c | 3 +++ servers/vm/vm.h | 1 + 2 files changed, 4 insertions(+) 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) -- 2.44.0