return s == XENBUS_XSD_FOREIGN_READY || s == XENBUS_XSD_LOCAL_READY;
}
+#if defined(CONFIG_XEN_XENBUS_DEV) && defined(CONFIG_XEN_PRIVILEGED_GUEST)
+#include <xen/interface/event_channel.h>
+#include <xen/interface/grant_table.h>
+
+int xenbus_conn(domid_t, grant_ref_t *, evtchn_port_t *);
+#endif
+
#endif /* _XENBUS_COMMS_H */
return 0;
}
-#ifdef HAVE_UNLOCKED_IOCTL
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
static long xenbus_dev_ioctl(struct file *file,
unsigned int cmd, unsigned long data)
{
- extern int xenbus_conn(domid_t remote_dom, int *grant_ref,
- evtchn_port_t *local_port);
void __user *udata = (void __user *) data;
int ret = -ENOTTY;
.open = xenbus_dev_open,
.release = xenbus_dev_release,
.poll = xenbus_dev_poll,
-#ifdef HAVE_UNLOCKED_IOCTL
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
.unlocked_ioctl = xenbus_dev_ioctl
#endif
};
}
-#if defined(CONFIG_PROC_FS) && defined(CONFIG_XEN_PRIVILEGED_GUEST)
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
+#ifdef CONFIG_PROC_FS
static struct file_operations xsd_kva_fops;
static struct proc_dir_entry *xsd_kva_intf;
static struct proc_dir_entry *xsd_port_intf;
}
#endif
+#ifdef CONFIG_XEN_XENBUS_DEV
static int xb_free_port(evtchn_port_t port)
{
struct evtchn_close close;
return HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
}
-int xenbus_conn(domid_t remote_dom, unsigned long *grant_ref, evtchn_port_t *local_port)
+int xenbus_conn(domid_t remote_dom, grant_ref_t *grant_ref,
+ evtchn_port_t *local_port)
{
struct evtchn_alloc_unbound alloc_unbound;
int rc, rc2;
BUG_ON(atomic_read(&xenbus_xsd_state) != XENBUS_XSD_FOREIGN_INIT);
BUG_ON(!is_initial_xendomain());
-#if defined(CONFIG_PROC_FS) && defined(CONFIG_XEN_PRIVILEGED_GUEST)
remove_xen_proc_entry("xsd_kva");
remove_xen_proc_entry("xsd_port");
-#endif
rc = xb_free_port(xen_store_evtchn);
if (rc != 0)
xen_store_evtchn = -1;
return rc;
}
+#endif
+#endif /* CONFIG_XEN_PRIVILEGED_GUEST */
static int xenbus_probe_init(void)
{