diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-12-23 15:25:57 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-12-23 15:25:57 +0000 |
commit | 3e446a35ee82c738367e8f90e3bc9166687043a8 (patch) | |
tree | d2ed5fd210a798cb5c54007a08e8bd2b9e9a221f /tools/libxc/xc_netbsd.c | |
parent | 252cb308e37470915d0f64c730e4e2e829ec2512 (diff) | |
download | xen-3e446a35ee82c738367e8f90e3bc9166687043a8.tar.gz xen-3e446a35ee82c738367e8f90e3bc9166687043a8.tar.bz2 xen-3e446a35ee82c738367e8f90e3bc9166687043a8.zip |
libxc: convert evtchn interfaces to use an opaque handle type
This makes the interface consistent with the changes made to the main
interface in 21483:779c0ef9682c.
Also fix some references to "struct xc_interface" which should have
been simply "xc_interface" in tools/xenpaging, and update QEMU_TAG to
pull in the corresponding qemu change.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_netbsd.c')
-rw-r--r-- | tools/libxc/xc_netbsd.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c index c6bf227684..f60d0d4154 100644 --- a/tools/libxc/xc_netbsd.c +++ b/tools/libxc/xc_netbsd.c @@ -60,9 +60,9 @@ int xc_interface_open_core(xc_interface *xch) return -1; } -int xc_interface_close_core(xc_interface *xch, int fd) +int xc_interface_close_core(xc_interface *xch) { - return close(fd); + return close(xch->fd); } void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot, @@ -181,39 +181,39 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall) #define EVTCHN_DEV_NAME "/dev/xenevt" -int xc_evtchn_open(void) +int xc_evtchn_open_core(xc_evtchn *xce) { return open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR); } -int xc_evtchn_close(int xce_handle) +int xc_evtchn_close_core(xc_evtchn *xce) { - return close(xce_handle); + return close(xce->fd); } -int xc_evtchn_fd(int xce_handle) +int xc_evtchn_fd(xc_evtchn *xce) { - return xce_handle; + return xce->fd; } -int xc_evtchn_notify(int xce_handle, evtchn_port_t port) +int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port) { struct ioctl_evtchn_notify notify; notify.port = port; - return ioctl(xce_handle, IOCTL_EVTCHN_NOTIFY, ¬ify); + return ioctl(xce->fd, IOCTL_EVTCHN_NOTIFY, ¬ify); } evtchn_port_or_error_t -xc_evtchn_bind_unbound_port(int xce_handle, int domid) +xc_evtchn_bind_unbound_port(xc_evtchn * xce, int domid) { struct ioctl_evtchn_bind_unbound_port bind; int ret; bind.remote_domain = domid; - ret = ioctl(xce_handle, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind); + ret = ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind); if (ret == 0) return bind.port; else @@ -221,7 +221,7 @@ xc_evtchn_bind_unbound_port(int xce_handle, int domid) } evtchn_port_or_error_t -xc_evtchn_bind_interdomain(int xce_handle, int domid, +xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid, evtchn_port_t remote_port) { struct ioctl_evtchn_bind_interdomain bind; @@ -230,31 +230,31 @@ xc_evtchn_bind_interdomain(int xce_handle, int domid, bind.remote_domain = domid; bind.remote_port = remote_port; - ret = ioctl(xce_handle, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind); + ret = ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind); if (ret == 0) return bind.port; else return -1; } -int xc_evtchn_unbind(int xce_handle, evtchn_port_t port) +int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port) { struct ioctl_evtchn_unbind unbind; unbind.port = port; - return ioctl(xce_handle, IOCTL_EVTCHN_UNBIND, &unbind); + return ioctl(xce->fd, IOCTL_EVTCHN_UNBIND, &unbind); } evtchn_port_or_error_t -xc_evtchn_bind_virq(int xce_handle, unsigned int virq) +xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq) { struct ioctl_evtchn_bind_virq bind; int err; bind.virq = virq; - err = ioctl(xce_handle, IOCTL_EVTCHN_BIND_VIRQ, &bind); + err = ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind); if (err) return -1; else @@ -262,19 +262,19 @@ xc_evtchn_bind_virq(int xce_handle, unsigned int virq) } evtchn_port_or_error_t -xc_evtchn_pending(int xce_handle) +xc_evtchn_pending(xc_evtchn *xce) { evtchn_port_t port; - if ( read_exact(xce_handle, (char *)&port, sizeof(port)) == -1 ) + if ( read_exact(xce->fd, (char *)&port, sizeof(port)) == -1 ) return -1; return port; } -int xc_evtchn_unmask(int xce_handle, evtchn_port_t port) +int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port) { - return write_exact(xce_handle, (char *)&port, sizeof(port)); + return write_exact(xce->fd, (char *)&port, sizeof(port)); } /* Optionally flush file to disk and discard page cache */ |