From: Hollis Blanchard Subject: arch-specific xc.c code? Date: Wed, 30 Aug 2006 15:40:47 -0500 Message-ID: <1156970448.9513.80.camel@basalt.austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ewan Mellor Cc: Alistair Tse , xen-devel List-Id: xen-devel@lists.xenproject.org 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