create PowerPC-specific alloc_real_mode_area memory op
PATCH 1/1 create PowerPC-specific alloc_real_mode_area memory op
# HG changeset patch
# User Hollis Blanchard <[email protected]>
# 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 <[email protected]>
tools/libxc/xenctrl.h +4 -0
@@ -421,6 +421,10 @@ int xc_domain_memory_populate_physmap(inunsigned 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,
tools/python/xen/lowlevel/xc/xc.c +32 -0
@@ -732,6 +732,28 @@ static PyObject *pyxc_domain_memory_incrreturn 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,
xen/include/public/domctl.h +8 -0
@@ -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; };