u32 dom2, /* may be DOMID_SELF */
int *port1,
int *port2);
+int xc_evtchn_bind_virq(int xc_handle,
+ int virq,
+ int *port);
int xc_evtchn_close(int xc_handle,
u32 dom, /* may be DOMID_SELF */
int port);
#include "xc_private.h"
+
static int do_evtchn_op(int xc_handle, evtchn_op_t *op)
{
int ret = -1;
out1: return ret;
}
+
int xc_evtchn_bind_interdomain(int xc_handle,
u32 dom1,
u32 dom2,
}
+int xc_evtchn_bind_virq(int xc_handle,
+ int virq,
+ int *port)
+{
+ evtchn_op_t op;
+ int rc;
+
+ op.cmd = EVTCHNOP_bind_virq;
+ op.u.bind_virq.virq = (u32)virq;
+
+ if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
+ {
+ if ( port != NULL )
+ *port = op.u.bind_virq.port;
+ }
+
+ return rc;
+}
+
+
int xc_evtchn_close(int xc_handle,
u32 dom,
int port)
"port2", port2);
}
+static PyObject *pyxc_evtchn_bind_virq(PyObject *self,
+ PyObject *args,
+ PyObject *kwds)
+{
+ XcObject *xc = (XcObject *)self;
+
+ int virq, port;
+
+ static char *kwd_list[] = { "virq", NULL };
+
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &virq) )
+ return NULL;
+
+ if ( xc_evtchn_bind_virq(xc->xc_handle, virq, &port) != 0 )
+ return PyErr_SetFromErrno(xc_error);
+
+ return PyInt_FromLong(port);
+}
+
static PyObject *pyxc_evtchn_close(PyObject *self,
PyObject *args,
PyObject *kwds)
" port1 [int]: Port-id for endpoint at dom1.\n"
" port2 [int]: Port-id for endpoint at dom2.\n" },
+ { "evtchn_bind_virq",
+ (PyCFunction)pyxc_evtchn_bind_virq,
+ METH_VARARGS | METH_KEYWORDS, "\n"
+ "Bind an event channel to the specified VIRQ.\n"
+ " virq [int]: VIRQ to bind.\n\n"
+ "Returns: [int] Bound event-channel port.\n" },
+
{ "evtchn_close",
(PyCFunction)pyxc_evtchn_close,
METH_VARARGS | METH_KEYWORDS, "\n"