Hollis Blanchard
2006-Sep-20 20:08 UTC
[Xen-devel] [PATCH] [LIBXC] create PowerPC-specific alloc_real_mode_area memory op
# HG changeset patch # User Hollis Blanchard <hollisb@us.ibm.com> # Date 1158782630 18000 # Node ID a755393bb7331723bcc1971e4a555830897ed40d # Parent b46d3d47063ac51343847ec22321276b72a5e591 [LIBXC] create PowerPC-specific alloc_real_mode_area memory op It doesn''t seem to be worth the complexity to create an xc.arch object, so this xc method is just prefixed with "arch_". (The actual implementation of xc_alloc_real_mode_area() was accidentally committed earlier in 38d6cf70e8f258f7f63d3456301f201a13b25958 .) Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> diff -r b46d3d47063a -r a755393bb733 tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h Wed Sep 20 14:23:32 2006 -0500 +++ b/tools/libxc/xenctrl.h Wed Sep 20 15:03:50 2006 -0500 @@ -421,6 +421,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 b46d3d47063a -r a755393bb733 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Wed Sep 20 14:23:32 2006 -0500 +++ b/tools/python/xen/lowlevel/xc/xc.c Wed Sep 20 15:03:50 2006 -0500 @@ -732,6 +732,28 @@ static PyObject *pyxc_domain_memory_incr return zero; } +#ifdef __powerpc__ +static PyObject *pyxc_arch_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; +} +#endif + static PyObject *pyxc_domain_ioport_permission(XcObject *self, PyObject *args, PyObject *kwds) @@ -1089,6 +1111,16 @@ static PyMethodDef pyxc_methods[] = { " dom [int]: Identifier of domain.\n" " mem_kb [long]: .\n" "Returns: [int] 0 on success; -1 on error.\n" }, + +#ifdef __powerpc__ + { "arch_alloc_real_mode_area", + (PyCFunction)pyxc_arch_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" }, +#endif { "domain_ioport_permission", (PyCFunction)pyxc_domain_ioport_permission, diff -r b46d3d47063a -r a755393bb733 xen/include/public/domctl.h --- a/xen/include/public/domctl.h Wed Sep 20 14:23:32 2006 -0500 +++ b/xen/include/public/domctl.h Wed Sep 20 15:03:50 2006 -0500 @@ -347,6 +347,13 @@ struct xen_domctl_settimeoffset { }; typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t; DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t); + +#define XEN_DOMCTL_real_mode_area 26 +struct xen_domctl_real_mode_area { + uint32_t log; /* log2 of Real Mode Area size */ +}; +typedef struct xen_domctl_real_mode_area xen_domctl_real_mode_area_t; +DEFINE_XEN_GUEST_HANDLE(xen_domctl_real_mode_area_t); struct xen_domctl { uint32_t cmd; @@ -373,6 +380,7 @@ struct xen_domctl { struct xen_domctl_hypercall_init hypercall_init; struct xen_domctl_arch_setup arch_setup; struct xen_domctl_settimeoffset settimeoffset; + struct xen_domctl_real_mode_area real_mode_area; uint8_t pad[128]; } u; }; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel