From mboxrd@z Thu Jan 1 00:00:00 1970 From: lists-xen@pimb.org Subject: [PATCH 3/4] ioports: xen.lowlevel.xc support Date: Sun, 6 Nov 2005 02:45:40 +0100 Message-ID: <20051106014540.GC12698@pimb.org> References: <20051106014026.GN5268@pimb.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="S1BNGpv0yoYahz37" Return-path: Content-Disposition: inline In-Reply-To: <20051106014026.GN5268@pimb.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --S1BNGpv0yoYahz37 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 3/4 -- Jody Belka knew (at) pimb (dot) org --S1BNGpv0yoYahz37 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="ioport-3.patch" # HG changeset patch # User jmb@artemis.home.pimb.org # Node ID 3acad8d6d0cf5c8a00833aea7fdbb20f9e73868e # Parent d8d62e726d8d217dde4fbc33962d9c4be115befc Added domain_ioport_permission to the python module xen.lowlevel.xc, wrapping the equivalent libxc call Signed-off-by: Jody Belka diff -r d8d62e726d8d -r 3acad8d6d0cf tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Sun Nov 6 01:14:43 2005 +++ b/tools/python/xen/lowlevel/xc/xc.c Sun Nov 6 01:15:12 2005 @@ -858,6 +858,29 @@ return zero; } +static PyObject *pyxc_domain_ioport_permission(PyObject *self, + PyObject *args, + PyObject *kwds) +{ + XcObject *xc = (XcObject *)self; + uint32_t dom; + int first_port, nr_ports, allow_access, ret; + + static char *kwd_list[] = { "dom", "first_port", "nr_ports", "allow_access", NULL }; + + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiii", kwd_list, + &dom, &first_port, &nr_ports, &allow_access) ) + return NULL; + + ret = xc_domain_ioport_permission( + xc->xc_handle, dom, first_port, nr_ports, allow_access); + if ( ret != 0 ) + return PyErr_SetFromErrno(xc_error); + + Py_INCREF(zero); + return zero; +} + static PyMethodDef pyxc_methods[] = { { "handle", (PyCFunction)pyxc_handle, @@ -1127,6 +1150,16 @@ " mem_kb [long]: .\n" "Returns: [int] 0 on success; -1 on error.\n" }, + { "domain_ioport_permission", + (PyCFunction)pyxc_domain_ioport_permission, + METH_VARARGS | METH_KEYWORDS, "\n" + "Allow a domain access to a range of IO ports\n" + " dom [int]: Identifier of domain to be allowed access.\n" + " first_port [int]: First IO port\n" + " nr_ports [int]: Number of IO ports\n" + " allow_access [int]: Non-zero means enable access; else disable access\n\n" + "Returns: [int] 0 on success; -1 on error.\n" }, + { NULL, NULL, 0, NULL } }; --S1BNGpv0yoYahz37 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --S1BNGpv0yoYahz37--