|
@@ -148,3 +148,21 @@ static int __init xen_init_events(void)
|
|
|
return 0;
|
|
|
}
|
|
|
postcore_initcall(xen_init_events);
|
|
|
+
|
|
|
+/* 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_GPL(alloc_xenballooned_pages);
|
|
|
+
|
|
|
+void free_xenballooned_pages(int nr_pages, struct page **pages)
|
|
|
+{
|
|
|
+ kfree(*pages);
|
|
|
+ *pages = NULL;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(free_xenballooned_pages);
|