ALSA: xen-front: Implement handling of shared buffers
[sfrench/cifs-2.6.git] / sound / xen / xen_snd_front.c
index 277214d4fd0a55a0d1393e7700769974f6c72399..cdf66ea516c456bf11ad0b5d5690a4cfbeadfbab 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 
+#include <xen/page.h>
 #include <xen/platform_pci.h>
 #include <xen/xen.h>
 #include <xen/xenbus.h>
@@ -191,6 +192,13 @@ static int __init xen_drv_init(void)
        if (!xen_has_pv_devices())
                return -ENODEV;
 
+       /* At the moment we only support case with XEN_PAGE_SIZE == PAGE_SIZE */
+       if (XEN_PAGE_SIZE != PAGE_SIZE) {
+               pr_err(XENSND_DRIVER_NAME ": different kernel and Xen page sizes are not supported: XEN_PAGE_SIZE (%lu) != PAGE_SIZE (%lu)\n",
+                      XEN_PAGE_SIZE, PAGE_SIZE);
+               return -ENODEV;
+       }
+
        pr_info("Initialising Xen " XENSND_DRIVER_NAME " frontend driver\n");
        return xenbus_register_frontend(&xen_driver);
 }