All of lore.kernel.org
 help / color / mirror / Atom feed
From: lists-xen@pimb.org
To: xen-devel@lists.xensource.com
Subject: [PATCH 3/4] ioports: xen.lowlevel.xc support
Date: Sun, 6 Nov 2005 02:45:40 +0100	[thread overview]
Message-ID: <20051106014540.GC12698@pimb.org> (raw)
In-Reply-To: <20051106014026.GN5268@pimb.org>

[-- Attachment #1: Type: text/plain, Size: 45 bytes --]

3/4

-- 
Jody Belka
knew (at) pimb (dot) org

[-- Attachment #2: ioport-3.patch --]
[-- Type: text/plain, Size: 2088 bytes --]

# 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 <knew (at) pimb (dot) org>

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 }
 };
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2005-11-06  1:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-06  1:40 [PATCH 0/4] fleshing out the ioport support lists-xen
2005-11-06  1:43 ` [PATCH 1/4] ioports: disable ioports in dom0 at boot-time lists-xen
2005-11-06  1:44 ` [PATCH 2/4] ioports: libxc support lists-xen
2005-11-06  1:45 ` lists-xen [this message]
2005-11-06  1:46 ` [PATCH 4/4] ioports: xend/xm support lists-xen
2005-11-06 20:09 ` [PATCH 5/4] ioports: iopif.py missing from last patch Jody Belka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051106014540.GC12698@pimb.org \
    --to=lists-xen@pimb.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.