From: Stefano Stabellini Date: Wed, 4 Jul 2012 10:21:34 +0000 (+0000) Subject: xen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f1cb915028d67070f24fc9fef217fc1cf2b378f5;p=people%2Fsstabellini%2Flinux-pvhvm-deprecated.git xen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree Only until we get the balloon driver to work. Signed-off-by: Stefano Stabellini --- diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index a6dc9eb9c8d..924c9aa42ee 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -199,3 +199,21 @@ int __init xen_guest_init(void) return 0; } EXPORT_SYMBOL(xen_guest_init); + +/* XXX: only until balloon is properly working */ +int alloc_xenballooned_pages(int nr_pages, struct page **pages, bool highmem) +{ + *pages = alloc_pages(highmem ? GFP_HIGHUSER : GFP_KERNEL, + get_order(nr_pages)); + if (*pages == NULL) + return -ENOMEM; + return 0; +} +EXPORT_SYMBOL(alloc_xenballooned_pages); + +void free_xenballooned_pages(int nr_pages, struct page **pages) +{ + kfree(*pages); + *pages = NULL; +} +EXPORT_SYMBOL(free_xenballooned_pages);