WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] arch-specific xc.c code?

To: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Subject: [Xen-devel] arch-specific xc.c code?
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Wed, 30 Aug 2006 15:40:47 -0500
Cc: Alistair Tse <atse@xxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 30 Aug 2006 13:40:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Ewan/Alistair, I have a patch that looks like this:

diff -r a39ad4c78850 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Wed Aug 30 13:51:12 2006 +0100
+++ b/tools/libxc/xenctrl.h     Wed Aug 30 15:11:20 2006 -0500
@@ -416,6 +416,10 @@ int xc_domain_memory_populate_physmap(in
                                       unsigned int address_bits,
                                       xen_pfn_t *extent_start);
 
+int xc_alloc_real_mode_area(int xc_handle,
+                            uint32_t domid,
+                            unsigned int log);
+
 int xc_domain_translate_gpfn_list(int xc_handle,
                                   uint32_t domid,
                                   unsigned long nr_gpfns,
diff -r a39ad4c78850 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Aug 30 13:51:12 2006 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c Wed Aug 30 15:11:20 2006 -0500
@@ -732,6 +732,26 @@ static PyObject *pyxc_domain_memory_incr
     return zero;
 }
 
+static PyObject *pyxc_alloc_real_mode_area(XcObject *self,
+                                           PyObject *args,
+                                           PyObject *kwds)
+{
+    uint32_t dom;
+    unsigned int log;
+
+    static char *kwd_list[] = { "dom", "log", NULL };
+
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwd_list, 
+                                      &dom, &log) )
+        return NULL;
+
+    if ( xc_alloc_real_mode_area(self->xc_handle, dom, log) )
+        return PyErr_SetFromErrno(xc_error);
+
+    Py_INCREF(zero);
+    return zero;
+}
+
 static PyObject *pyxc_domain_ioport_permission(XcObject *self,
                                                PyObject *args,
                                                PyObject *kwds)
@@ -1088,6 +1108,14 @@ static PyMethodDef pyxc_methods[] = {
       "Increase a domain's memory reservation\n"
       " dom [int]: Identifier of domain.\n"
       " mem_kb [long]: .\n"
+      "Returns: [int] 0 on success; -1 on error.\n" },
+
+    { "alloc_real_mode_area", 
+      (PyCFunction)pyxc_alloc_real_mode_area, 
+      METH_VARARGS | METH_KEYWORDS, "\n"
+      "Allocate a domain's real mode area.\n"
+      " dom [int]: Identifier of domain.\n"
+      " log [int]: Specifies the area's size.\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
     { "domain_ioport_permission",



xc_alloc_real_mode_area() is a PowerPC-specific libxc function. How
would you like this handled in xc.c? Just an ifdef?

-- 
Hollis Blanchard
IBM Linux Technology Center


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

<Prev in Thread] Current Thread [Next in Thread>