xen: Move evtchn functions to xen_pvdev.c

The name of the functions moved:
 * xen_be_evtchn_event
 * xen_be_unbind_evtchn
 * xen_be_send_notify

Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Quan Xu <xuquan8@huawei.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
This commit is contained in:
Emil Condrea 2016-10-25 08:50:11 +03:00 committed by Stefano Stabellini
parent 046db9bec5
commit 31c17aa5c3
4 changed files with 39 additions and 37 deletions

View file

@ -171,3 +171,38 @@ void xen_be_printf(struct XenDevice *xendev, int msg_level,
}
qemu_log_flush();
}
void xen_be_evtchn_event(void *opaque)
{
struct XenDevice *xendev = opaque;
evtchn_port_t port;
port = xenevtchn_pending(xendev->evtchndev);
if (port != xendev->local_port) {
xen_be_printf(xendev, 0,
"xenevtchn_pending returned %d (expected %d)\n",
port, xendev->local_port);
return;
}
xenevtchn_unmask(xendev->evtchndev, port);
if (xendev->ops->event) {
xendev->ops->event(xendev);
}
}
void xen_be_unbind_evtchn(struct XenDevice *xendev)
{
if (xendev->local_port == -1) {
return;
}
qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
xendev->local_port = -1;
}
int xen_be_send_notify(struct XenDevice *xendev)
{
return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
}