]> xenbits.xensource.com Git - people/sstabellini/linux-pvhvm-deprecated.git/commitdiff
xen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 4 Jul 2012 10:21:34 +0000 (10:21 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 4 Jul 2012 10:21:34 +0000 (10:21 +0000)
Only until we get the balloon driver to work.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
arch/arm/xen/enlighten.c

index a6dc9eb9c8dd1a2cac1a01e9b5fbac97eaecc1b4..924c9aa42ee1e57a467ae5c7476bbac4c3a7d082 100644 (file)
@@ -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);