您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ xc_hypercall_bounce_post函数代码示例

51自学网 2021-06-03 10:15:41
  C++
这篇教程C++ xc_hypercall_bounce_post函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中xc_hypercall_bounce_post函数的典型用法代码示例。如果您正苦于以下问题:C++ xc_hypercall_bounce_post函数的具体用法?C++ xc_hypercall_bounce_post怎么用?C++ xc_hypercall_bounce_post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了xc_hypercall_bounce_post函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: xc_numainfo

int xc_numainfo(xc_interface *xch, unsigned *max_nodes,                xc_meminfo_t *meminfo, uint32_t *distance){    int ret;    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(meminfo, *max_nodes * sizeof(*meminfo),                             XC_HYPERCALL_BUFFER_BOUNCE_OUT);    DECLARE_HYPERCALL_BOUNCE(distance,                             *max_nodes * *max_nodes * sizeof(*distance),                             XC_HYPERCALL_BUFFER_BOUNCE_OUT);    if ( (ret = xc_hypercall_bounce_pre(xch, meminfo)) )        goto out;    if ((ret = xc_hypercall_bounce_pre(xch, distance)) )        goto out;    sysctl.u.numainfo.num_nodes = *max_nodes;    set_xen_guest_handle(sysctl.u.numainfo.meminfo, meminfo);    set_xen_guest_handle(sysctl.u.numainfo.distance, distance);    sysctl.cmd = XEN_SYSCTL_numainfo;    if ( (ret = do_sysctl(xch, &sysctl)) != 0 )        goto out;    *max_nodes = sysctl.u.numainfo.num_nodes;out:    xc_hypercall_bounce_post(xch, meminfo);    xc_hypercall_bounce_post(xch, distance);    return ret;}
开发者ID:MrVan,项目名称:xen,代码行数:33,


示例2: xc_pm_get_cxstat

int xc_pm_get_cxstat(xc_interface *xch, int cpuid, struct xc_cx_stat *cxpt){    DECLARE_SYSCTL;    DECLARE_NAMED_HYPERCALL_BOUNCE(triggers, cxpt->triggers,                                   cxpt->nr * sizeof(*cxpt->triggers),                                   XC_HYPERCALL_BUFFER_BOUNCE_OUT);    DECLARE_NAMED_HYPERCALL_BOUNCE(residencies, cxpt->residencies,                                   cxpt->nr * sizeof(*cxpt->residencies),                                   XC_HYPERCALL_BUFFER_BOUNCE_OUT);    DECLARE_NAMED_HYPERCALL_BOUNCE(pc, cxpt->pc,                                   cxpt->nr_pc * sizeof(*cxpt->pc),                                   XC_HYPERCALL_BUFFER_BOUNCE_OUT);    DECLARE_NAMED_HYPERCALL_BOUNCE(cc, cxpt->cc,                                   cxpt->nr_cc * sizeof(*cxpt->cc),                                   XC_HYPERCALL_BUFFER_BOUNCE_OUT);    int ret = -1;    if ( xc_hypercall_bounce_pre(xch, triggers) )        goto unlock_0;    if ( xc_hypercall_bounce_pre(xch, residencies) )        goto unlock_1;    if ( xc_hypercall_bounce_pre(xch, pc) )        goto unlock_2;    if ( xc_hypercall_bounce_pre(xch, cc) )        goto unlock_3;    sysctl.cmd = XEN_SYSCTL_get_pmstat;    sysctl.u.get_pmstat.type = PMSTAT_get_cxstat;    sysctl.u.get_pmstat.cpuid = cpuid;    sysctl.u.get_pmstat.u.getcx.nr = cxpt->nr;    sysctl.u.get_pmstat.u.getcx.nr_pc = cxpt->nr_pc;    sysctl.u.get_pmstat.u.getcx.nr_cc = cxpt->nr_cc;    set_xen_guest_handle(sysctl.u.get_pmstat.u.getcx.triggers, triggers);    set_xen_guest_handle(sysctl.u.get_pmstat.u.getcx.residencies, residencies);    set_xen_guest_handle(sysctl.u.get_pmstat.u.getcx.pc, pc);    set_xen_guest_handle(sysctl.u.get_pmstat.u.getcx.cc, cc);    if ( (ret = xc_sysctl(xch, &sysctl)) )        goto unlock_4;    cxpt->nr = sysctl.u.get_pmstat.u.getcx.nr;    cxpt->last = sysctl.u.get_pmstat.u.getcx.last;    cxpt->idle_time = sysctl.u.get_pmstat.u.getcx.idle_time;    cxpt->nr_pc = sysctl.u.get_pmstat.u.getcx.nr_pc;    cxpt->nr_cc = sysctl.u.get_pmstat.u.getcx.nr_cc;unlock_4:    xc_hypercall_bounce_post(xch, cc);unlock_3:    xc_hypercall_bounce_post(xch, pc);unlock_2:    xc_hypercall_bounce_post(xch, residencies);unlock_1:    xc_hypercall_bounce_post(xch, triggers);unlock_0:    return ret;}
开发者ID:CPFL,项目名称:xen,代码行数:57,


示例3: xc_pm_get_pxstat

int xc_pm_get_pxstat(xc_interface *xch, int cpuid, struct xc_px_stat *pxpt){    DECLARE_SYSCTL;    /* Sizes unknown until xc_pm_get_max_px */    DECLARE_NAMED_HYPERCALL_BOUNCE(trans, pxpt->trans_pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    DECLARE_NAMED_HYPERCALL_BOUNCE(pt, pxpt->pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    int max_px, ret;    if ( !pxpt->trans_pt || !pxpt->pt )    {        errno = EINVAL;        return -1;    }    if ( (ret = xc_pm_get_max_px(xch, cpuid, &max_px)) != 0)        return ret;    HYPERCALL_BOUNCE_SET_SIZE(trans, max_px * max_px * sizeof(uint64_t));    HYPERCALL_BOUNCE_SET_SIZE(pt, max_px * sizeof(struct xc_px_val));    if ( xc_hypercall_bounce_pre(xch, trans) )        return ret;    if ( xc_hypercall_bounce_pre(xch, pt) )    {        xc_hypercall_bounce_post(xch, trans);        return ret;    }    sysctl.cmd = XEN_SYSCTL_get_pmstat;    sysctl.u.get_pmstat.type = PMSTAT_get_pxstat;    sysctl.u.get_pmstat.cpuid = cpuid;    sysctl.u.get_pmstat.u.getpx.total = max_px;    set_xen_guest_handle(sysctl.u.get_pmstat.u.getpx.trans_pt, trans);    set_xen_guest_handle(sysctl.u.get_pmstat.u.getpx.pt, pt);    ret = xc_sysctl(xch, &sysctl);    if ( ret )    {	xc_hypercall_bounce_post(xch, trans);	xc_hypercall_bounce_post(xch, pt);        return ret;    }    pxpt->total = sysctl.u.get_pmstat.u.getpx.total;    pxpt->usable = sysctl.u.get_pmstat.u.getpx.usable;    pxpt->last = sysctl.u.get_pmstat.u.getpx.last;    pxpt->cur = sysctl.u.get_pmstat.u.getpx.cur;    xc_hypercall_bounce_post(xch, trans);    xc_hypercall_bounce_post(xch, pt);    return ret;}
开发者ID:CPFL,项目名称:xen,代码行数:54,


示例4: xc_livepatch_upload

int xc_livepatch_upload(xc_interface *xch,                        char *name,                        unsigned char *payload,                        uint32_t size){    int rc;    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BUFFER(char, local);    DECLARE_HYPERCALL_BOUNCE(name, 0 /* later */, XC_HYPERCALL_BUFFER_BOUNCE_IN);    xen_livepatch_name_t def_name = { .pad = { 0, 0, 0 } };    if ( !name || !payload )    {        errno = EINVAL;        return -1;    }    def_name.size = strlen(name) + 1;    if ( def_name.size > XEN_LIVEPATCH_NAME_SIZE )    {        errno = EINVAL;        return -1;    }    HYPERCALL_BOUNCE_SET_SIZE(name, def_name.size);    if ( xc_hypercall_bounce_pre(xch, name) )        return -1;    local = xc_hypercall_buffer_alloc(xch, local, size);    if ( !local )    {        xc_hypercall_bounce_post(xch, name);        return -1;    }    memcpy(local, payload, size);    sysctl.cmd = XEN_SYSCTL_livepatch_op;    sysctl.u.livepatch.cmd = XEN_SYSCTL_LIVEPATCH_UPLOAD;    sysctl.u.livepatch.pad = 0;    sysctl.u.livepatch.u.upload.size = size;    set_xen_guest_handle(sysctl.u.livepatch.u.upload.payload, local);    sysctl.u.livepatch.u.upload.name = def_name;    set_xen_guest_handle(sysctl.u.livepatch.u.upload.name.name, name);    rc = do_sysctl(xch, &sysctl);    xc_hypercall_buffer_free(xch, local);    xc_hypercall_bounce_post(xch, name);    return rc;}
开发者ID:MrVan,项目名称:xen,代码行数:53,


示例5: xc_machphys_mfn_list

int xc_machphys_mfn_list(xc_interface *xch,			 unsigned long max_extents,			 xen_pfn_t *extent_start){    int rc;    DECLARE_HYPERCALL_BOUNCE(extent_start, max_extents * sizeof(xen_pfn_t), XC_HYPERCALL_BUFFER_BOUNCE_OUT);    struct xen_machphys_mfn_list xmml = {        .max_extents = max_extents,    };    if ( xc_hypercall_bounce_pre(xch, extent_start) )    {        PERROR("Could not bounce memory for XENMEM_machphys_mfn_list hypercall");        return -1;    }    set_xen_guest_handle(xmml.extent_start, extent_start);    rc = do_memory_op(xch, XENMEM_machphys_mfn_list, &xmml, sizeof(xmml));    if (rc || xmml.nr_extents != max_extents)        rc = -1;    else        rc = 0;    xc_hypercall_bounce_post(xch, extent_start);    return rc;}
开发者ID:tklengyel,项目名称:xen,代码行数:27,


示例6: flush_mmu_updates

static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu){    int rc, err = 0;    DECLARE_NAMED_HYPERCALL_BOUNCE(updates, mmu->updates, mmu->idx*sizeof(*mmu->updates), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    if ( mmu->idx == 0 )        return 0;    if ( xc_hypercall_bounce_pre(xch, updates) )    {        PERROR("flush_mmu_updates: bounce buffer failed");        err = 1;        goto out;    }    rc = xencall4(xch->xcall, __HYPERVISOR_mmu_update,                  HYPERCALL_BUFFER_AS_ARG(updates),                  mmu->idx, 0, mmu->subject);    if ( rc < 0 )    {        ERROR("Failure when submitting mmu updates");        err = 1;    }    mmu->idx = 0;    xc_hypercall_bounce_post(xch, updates); out:    return err;}
开发者ID:tklengyel,项目名称:xen,代码行数:31,


示例7: xc_sched_rtds_vcpu_get

int xc_sched_rtds_vcpu_get(xc_interface *xch,                           uint32_t domid,                           xen_domctl_schedparam_vcpu_t *vcpus,                           uint32_t num_vcpus){    int rc;    DECLARE_DOMCTL;    DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,            XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    if ( xc_hypercall_bounce_pre(xch, vcpus) )        return -1;    domctl.cmd = XEN_DOMCTL_scheduler_op;    domctl.domain = (domid_t) domid;    domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_RTDS;    domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getvcpuinfo;    domctl.u.scheduler_op.u.v.nr_vcpus = num_vcpus;    set_xen_guest_handle(domctl.u.scheduler_op.u.v.vcpus, vcpus);    rc = do_domctl(xch, &domctl);    xc_hypercall_bounce_post(xch, vcpus);    return rc;}
开发者ID:Chong-Li,项目名称:RTDS-ToolStack-2,代码行数:26,


示例8: xc_get_pfn_list

int xc_get_pfn_list(xc_interface *xch,                    uint32_t domid,                    uint64_t *pfn_buf,                    unsigned long max_pfns){    DECLARE_DOMCTL;    DECLARE_HYPERCALL_BOUNCE(pfn_buf, max_pfns * sizeof(*pfn_buf), XC_HYPERCALL_BUFFER_BOUNCE_OUT);    int ret;#ifdef VALGRIND    memset(pfn_buf, 0, max_pfns * sizeof(*pfn_buf));#endif    if ( xc_hypercall_bounce_pre(xch, pfn_buf) )    {        PERROR("xc_get_pfn_list: pfn_buf bounce failed");        return -1;    }    domctl.cmd = XEN_DOMCTL_getmemlist;    domctl.domain   = (domid_t)domid;    domctl.u.getmemlist.max_pfns = max_pfns;    set_xen_guest_handle(domctl.u.getmemlist.buffer, pfn_buf);    ret = do_domctl(xch, &domctl);    xc_hypercall_bounce_post(xch, pfn_buf);    return (ret < 0) ? -1 : domctl.u.getmemlist.num_pfns;}
开发者ID:mymas,项目名称:xen-4.4.0,代码行数:30,


示例9: xc_flask_op

int xc_flask_op(xc_interface *xch, xen_flask_op_t *op){    int ret = -1;    DECLARE_HYPERCALL;    DECLARE_HYPERCALL_BOUNCE(op, sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    op->interface_version = XEN_FLASK_INTERFACE_VERSION;    if ( xc_hypercall_bounce_pre(xch, op) )    {        PERROR("Could not bounce memory for flask op hypercall");        goto out;    }    hypercall.op     = __HYPERVISOR_xsm_op;    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op);    if ( (ret = do_xen_hypercall(xch, &hypercall)) < 0 )    {        if ( errno == EACCES )            fprintf(stderr, "XSM operation failed!/n");    }    xc_hypercall_bounce_post(xch, op); out:    return ret;}
开发者ID:HackLinux,项目名称:xen-1,代码行数:28,


示例10: xc_domain_populate_physmap

int xc_domain_populate_physmap(xc_interface *xch,                               uint32_t domid,                               unsigned long nr_extents,                               unsigned int extent_order,                               unsigned int mem_flags,                               xen_pfn_t *extent_start){    int err;    DECLARE_HYPERCALL_BOUNCE(extent_start, nr_extents * sizeof(*extent_start), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    struct xen_memory_reservation reservation = {        .nr_extents   = nr_extents,        .extent_order = extent_order,        .mem_flags    = mem_flags,        .domid        = domid    };    if ( xc_hypercall_bounce_pre(xch, extent_start) )    {        PERROR("Could not bounce memory for XENMEM_populate_physmap hypercall");        return -1;    }    set_xen_guest_handle(reservation.extent_start, extent_start);    err = do_memory_op(xch, XENMEM_populate_physmap, &reservation, sizeof(reservation));    xc_hypercall_bounce_post(xch, extent_start);    return err;}
开发者ID:HackLinux,项目名称:xen,代码行数:28,


示例11: xc_domain_getinfolist

int xc_domain_getinfolist(xc_interface *xch,                          uint32_t first_domain,                          unsigned int max_domains,                          xc_domaininfo_t *info){    int ret = 0;    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(info, max_domains*sizeof(*info), XC_HYPERCALL_BUFFER_BOUNCE_OUT);    if ( xc_hypercall_bounce_pre(xch, info) )        return -1;    sysctl.cmd = XEN_SYSCTL_getdomaininfolist;    sysctl.u.getdomaininfolist.first_domain = first_domain;    sysctl.u.getdomaininfolist.max_domains  = max_domains;    set_xen_guest_handle(sysctl.u.getdomaininfolist.buffer, info);    if ( xc_sysctl(xch, &sysctl) < 0 )        ret = -1;    else        ret = sysctl.u.getdomaininfolist.num_domains;    xc_hypercall_bounce_post(xch, info);    return ret;}
开发者ID:HackLinux,项目名称:xen,代码行数:26,


示例12: xc_hvm_track_dirty_vram

int xc_hvm_track_dirty_vram(    xc_interface *xch, domid_t dom,    uint64_t first_pfn, uint64_t nr,    unsigned long *dirty_bitmap){    DECLARE_HYPERCALL_BOUNCE(dirty_bitmap, (nr+7) / 8, XC_HYPERCALL_BUFFER_BOUNCE_OUT);    DECLARE_HYPERCALL_BUFFER(struct xen_hvm_track_dirty_vram, arg);    int rc;    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));    if ( arg == NULL || xc_hypercall_bounce_pre(xch, dirty_bitmap) )    {        PERROR("Could not bounce memory for xc_hvm_track_dirty_vram hypercall");        rc = -1;        goto out;    }    arg->domid     = dom;    arg->first_pfn = first_pfn;    arg->nr        = nr;    set_xen_guest_handle(arg->dirty_bitmap, dirty_bitmap);    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,                  HVMOP_track_dirty_vram,                  HYPERCALL_BUFFER_AS_ARG(arg));out:    xc_hypercall_buffer_free(xch, arg);    xc_hypercall_bounce_post(xch, dirty_bitmap);    return rc;}
开发者ID:MrVan,项目名称:xen,代码行数:31,


示例13: xc_domain_decrease_reservation

int xc_domain_decrease_reservation(xc_interface *xch,                                   uint32_t domid,                                   unsigned long nr_extents,                                   unsigned int extent_order,                                   xen_pfn_t *extent_start){    int err;    DECLARE_HYPERCALL_BOUNCE(extent_start, nr_extents * sizeof(*extent_start), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    struct xen_memory_reservation reservation = {        .nr_extents   = nr_extents,        .extent_order = extent_order,        .mem_flags    = 0,        .domid        = domid    };    if ( extent_start == NULL )    {        DPRINTF("decrease_reservation extent_start is NULL!/n");        errno = EINVAL;        return -1;    }    if ( xc_hypercall_bounce_pre(xch, extent_start) )    {        PERROR("Could not bounce memory for XENMEM_decrease_reservation hypercall");        return -1;    }    set_xen_guest_handle(reservation.extent_start, extent_start);    err = do_memory_op(xch, XENMEM_decrease_reservation, &reservation, sizeof(reservation));    xc_hypercall_bounce_post(xch, extent_start);    return err;}int xc_domain_decrease_reservation_exact(xc_interface *xch,                                         uint32_t domid,                                         unsigned long nr_extents,                                         unsigned int extent_order,                                         xen_pfn_t *extent_start){    int err;    err = xc_domain_decrease_reservation(xch, domid, nr_extents,                                         extent_order, extent_start);    if ( err == nr_extents )        return 0;    if ( err >= 0 )    {        DPRINTF("Failed deallocation for dom %d: %ld extents of order %d/n",                domid, nr_extents, extent_order);        errno = EINVAL;        err = -1;    }    return err;}
开发者ID:HackLinux,项目名称:xen,代码行数:60,


示例14: xc_domain_hvm_getcontext_partial

/* Get just one element of the HVM guest context. * size must be >= HVM_SAVE_LENGTH(type) */int xc_domain_hvm_getcontext_partial(xc_interface *xch,                                     uint32_t domid,                                     uint16_t typecode,                                     uint16_t instance,                                     void *ctxt_buf,                                     uint32_t size){    int ret;    DECLARE_DOMCTL;    DECLARE_HYPERCALL_BOUNCE(ctxt_buf, size, XC_HYPERCALL_BUFFER_BOUNCE_OUT);    if ( !ctxt_buf || xc_hypercall_bounce_pre(xch, ctxt_buf) )        return -1;    domctl.cmd = XEN_DOMCTL_gethvmcontext_partial;    domctl.domain = (domid_t) domid;    domctl.u.hvmcontext_partial.type = typecode;    domctl.u.hvmcontext_partial.instance = instance;    set_xen_guest_handle(domctl.u.hvmcontext_partial.buffer, ctxt_buf);    ret = do_domctl(xch, &domctl);    if ( ctxt_buf )        xc_hypercall_bounce_post(xch, ctxt_buf);    return ret ? -1 : 0;}
开发者ID:HackLinux,项目名称:xen,代码行数:29,


示例15: xc_readconsolering

int xc_readconsolering(xc_interface *xch,                       char *buffer,                       unsigned int *pnr_chars,                       int clear, int incremental, uint32_t *pindex){    int ret;    unsigned int nr_chars = *pnr_chars;    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(buffer, nr_chars, XC_HYPERCALL_BUFFER_BOUNCE_OUT);    if ( xc_hypercall_bounce_pre(xch, buffer) )        return -1;    sysctl.cmd = XEN_SYSCTL_readconsole;    set_xen_guest_handle(sysctl.u.readconsole.buffer, buffer);    sysctl.u.readconsole.count = nr_chars;    sysctl.u.readconsole.clear = clear;    sysctl.u.readconsole.incremental = 0;    if ( pindex )    {        sysctl.u.readconsole.index = *pindex;        sysctl.u.readconsole.incremental = incremental;    }    if ( (ret = do_sysctl(xch, &sysctl)) == 0 )    {        *pnr_chars = sysctl.u.readconsole.count;        if ( pindex )            *pindex = sysctl.u.readconsole.index;    }    xc_hypercall_bounce_post(xch, buffer);    return ret;}
开发者ID:MrVan,项目名称:xen,代码行数:35,


示例16: xc_cputopoinfo

int xc_cputopoinfo(xc_interface *xch, unsigned *max_cpus,                   xc_cputopo_t *cputopo){    int ret;    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(cputopo, *max_cpus * sizeof(*cputopo),                             XC_HYPERCALL_BUFFER_BOUNCE_OUT);    if ( (ret = xc_hypercall_bounce_pre(xch, cputopo)) )        goto out;    sysctl.u.cputopoinfo.num_cpus = *max_cpus;    set_xen_guest_handle(sysctl.u.cputopoinfo.cputopo, cputopo);    sysctl.cmd = XEN_SYSCTL_cputopoinfo;    if ( (ret = do_sysctl(xch, &sysctl)) != 0 )        goto out;    *max_cpus = sysctl.u.cputopoinfo.num_cpus;out:    xc_hypercall_bounce_post(xch, cputopo);    return ret;}
开发者ID:MrVan,项目名称:xen,代码行数:26,


示例17: flush_mmu_updates

static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu){    int err = 0;    DECLARE_HYPERCALL;    DECLARE_NAMED_HYPERCALL_BOUNCE(updates, mmu->updates, mmu->idx*sizeof(*mmu->updates), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    if ( mmu->idx == 0 )        return 0;    if ( xc_hypercall_bounce_pre(xch, updates) )    {        PERROR("flush_mmu_updates: bounce buffer failed");        err = 1;        goto out;    }    hypercall.op     = __HYPERVISOR_mmu_update;    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(updates);    hypercall.arg[1] = (unsigned long)mmu->idx;    hypercall.arg[2] = 0;    hypercall.arg[3] = mmu->subject;    if ( do_xen_hypercall(xch, &hypercall) < 0 )    {        ERROR("Failure when submitting mmu updates");        err = 1;    }    mmu->idx = 0;    xc_hypercall_bounce_post(xch, updates); out:    return err;}
开发者ID:mymas,项目名称:xen-4.4.0,代码行数:35,


示例18: xc_flask_context_to_sid

int xc_flask_context_to_sid(xc_interface *xch, char *buf, uint32_t size, uint32_t *sid){    int err;    DECLARE_FLASK_OP;    DECLARE_HYPERCALL_BOUNCE(buf, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);    if ( xc_hypercall_bounce_pre(xch, buf) )    {        PERROR("Could not bounce memory for flask op hypercall");        return -1;    }    op.cmd = FLASK_CONTEXT_TO_SID;    op.u.sid_context.size = size;    set_xen_guest_handle(op.u.sid_context.context, buf);        err = xc_flask_op(xch, &op);    if ( !err )        *sid = op.u.sid_context.sid;    xc_hypercall_bounce_post(xch, buf);    return err;}
开发者ID:HackLinux,项目名称:xen-1,代码行数:25,


示例19: xc_flask_setbool

int xc_flask_setbool(xc_interface *xch, char *name, int value, int commit){    int rv;    DECLARE_FLASK_OP;    DECLARE_HYPERCALL_BOUNCE(name, strlen(name), XC_HYPERCALL_BUFFER_BOUNCE_IN);    if ( xc_hypercall_bounce_pre(xch, name) )    {        PERROR("Could not bounce memory for flask op hypercall");        return -1;    }    op.cmd = FLASK_SETBOOL;    op.u.boolean.bool_id = -1;    op.u.boolean.new_value = value;    op.u.boolean.commit = 1;    op.u.boolean.size = strlen(name);    set_xen_guest_handle(op.u.boolean.name, name);    rv = xc_flask_op(xch, &op);    xc_hypercall_bounce_post(xch, name);    return rv;}
开发者ID:HackLinux,项目名称:xen-1,代码行数:25,


示例20: xc_flask_getbool_byname

int xc_flask_getbool_byname(xc_interface *xch, char *name, int *curr, int *pend){    int rv;    DECLARE_FLASK_OP;    DECLARE_HYPERCALL_BOUNCE(name, strlen(name), XC_HYPERCALL_BUFFER_BOUNCE_IN);    if ( xc_hypercall_bounce_pre(xch, name) )    {        PERROR("Could not bounce memory for flask op hypercall");        return -1;    }    op.cmd = FLASK_GETBOOL;    op.u.boolean.bool_id = -1;    op.u.boolean.size = strlen(name);    set_xen_guest_handle(op.u.boolean.name, name);    rv = xc_flask_op(xch, &op);    xc_hypercall_bounce_post(xch, name);    if ( rv )        return rv;        if ( curr )        *curr = op.u.boolean.enforcing;    if ( pend )        *pend = op.u.boolean.pending;    return rv;}
开发者ID:HackLinux,项目名称:xen-1,代码行数:31,


示例21: xc_sched_rt_domain_get

int xc_sched_rt_domain_get(xc_interface *xch,                           uint32_t domid,                           struct xen_domctl_sched_rt_params *sdom,                           uint16_t num_vcpus){    int rc;    DECLARE_DOMCTL;    DECLARE_HYPERCALL_BOUNCE(sdom,         sizeof(*sdom) * num_vcpus,         XC_HYPERCALL_BUFFER_BOUNCE_OUT);    if ( xc_hypercall_bounce_pre(xch, sdom) )        return -1;    domctl.cmd = XEN_DOMCTL_scheduler_op;    domctl.domain = (domid_t) domid;    domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_RT_DS;    domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;    set_xen_guest_handle(domctl.u.scheduler_op.u.rt.vcpu, sdom);    rc = do_domctl(xch, &domctl);    xc_hypercall_bounce_post(xch, sdom);    return rc;}
开发者ID:rtos-projects,项目名称:Team5,代码行数:26,


示例22: xc_get_cpu_featureset

int xc_get_cpu_featureset(xc_interface *xch, uint32_t index,                          uint32_t *nr_features, uint32_t *featureset){    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(featureset,                             *nr_features * sizeof(*featureset),                             XC_HYPERCALL_BUFFER_BOUNCE_OUT);    int ret;    if ( xc_hypercall_bounce_pre(xch, featureset) )        return -1;    sysctl.cmd = XEN_SYSCTL_get_cpu_featureset;    sysctl.u.cpu_featureset.index = index;    sysctl.u.cpu_featureset.nr_features = *nr_features;    set_xen_guest_handle(sysctl.u.cpu_featureset.features, featureset);    ret = do_sysctl(xch, &sysctl);    xc_hypercall_bounce_post(xch, featureset);    if ( !ret )        *nr_features = sysctl.u.cpu_featureset.nr_features;    return ret;}
开发者ID:0day-ci,项目名称:xen,代码行数:26,


示例23: xc_mmuext_op

int xc_mmuext_op(    xc_interface *xch,    struct mmuext_op *op,    unsigned int nr_ops,    domid_t dom){    DECLARE_HYPERCALL;    DECLARE_HYPERCALL_BOUNCE(op, nr_ops*sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    long ret = -EINVAL;    if ( xc_hypercall_bounce_pre(xch, op) )    {        PERROR("Could not bounce memory for mmuext op hypercall");        goto out1;    }    hypercall.op     = __HYPERVISOR_mmuext_op;    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op);    hypercall.arg[1] = (unsigned long)nr_ops;    hypercall.arg[2] = (unsigned long)0;    hypercall.arg[3] = (unsigned long)dom;    ret = do_xen_hypercall(xch, &hypercall);    xc_hypercall_bounce_post(xch, op); out1:    return ret;}
开发者ID:mymas,项目名称:xen-4.4.0,代码行数:29,


示例24: xc_pcitopoinfo

int xc_pcitopoinfo(xc_interface *xch, unsigned num_devs,                   physdev_pci_device_t *devs,                   uint32_t *nodes){    int ret = 0;    unsigned processed = 0;    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(devs, num_devs * sizeof(*devs),                             XC_HYPERCALL_BUFFER_BOUNCE_IN);    DECLARE_HYPERCALL_BOUNCE(nodes, num_devs* sizeof(*nodes),                             XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    if ( (ret = xc_hypercall_bounce_pre(xch, devs)) )        goto out;    if ( (ret = xc_hypercall_bounce_pre(xch, nodes)) )        goto out;    sysctl.cmd = XEN_SYSCTL_pcitopoinfo;    while ( processed < num_devs )    {        sysctl.u.pcitopoinfo.num_devs = num_devs - processed;        set_xen_guest_handle_offset(sysctl.u.pcitopoinfo.devs, devs,                                    processed);        set_xen_guest_handle_offset(sysctl.u.pcitopoinfo.nodes, nodes,                                    processed);        if ( (ret = do_sysctl(xch, &sysctl)) != 0 )                break;        processed += sysctl.u.pcitopoinfo.num_devs;    } out:    xc_hypercall_bounce_post(xch, devs);    xc_hypercall_bounce_post(xch, nodes);    return ret;}
开发者ID:MrVan,项目名称:xen,代码行数:39,


示例25: xc_tmem_control

int xc_tmem_control(xc_interface *xch,                    int32_t pool_id,                    uint32_t cmd,                    uint32_t cli_id,                    uint32_t len,                    uint32_t arg,                    void *buf){    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(buf, len, XC_HYPERCALL_BUFFER_BOUNCE_OUT);    int rc;    sysctl.cmd = XEN_SYSCTL_tmem_op;    sysctl.u.tmem_op.pool_id = pool_id;    sysctl.u.tmem_op.cmd = cmd;    sysctl.u.tmem_op.cli_id = cli_id;    sysctl.u.tmem_op.len = len;    sysctl.u.tmem_op.arg = arg;    sysctl.u.tmem_op.pad = 0;    sysctl.u.tmem_op.oid.oid[0] = 0;    sysctl.u.tmem_op.oid.oid[1] = 0;    sysctl.u.tmem_op.oid.oid[2] = 0;    if ( cmd == XEN_SYSCTL_TMEM_OP_SET_CLIENT_INFO ||         cmd == XEN_SYSCTL_TMEM_OP_SET_AUTH )        HYPERCALL_BOUNCE_SET_DIR(buf, XC_HYPERCALL_BUFFER_BOUNCE_IN);    if ( len )    {        if ( buf == NULL )        {            errno = EINVAL;            return -1;        }        if ( xc_hypercall_bounce_pre(xch, buf) )        {            PERROR("Could not bounce buffer for tmem control hypercall");            return -1;        }    }    set_xen_guest_handle(sysctl.u.tmem_op.u.buf, buf);    rc = do_sysctl(xch, &sysctl);    if ( len )        xc_hypercall_bounce_post(xch, buf);    return rc;}
开发者ID:fdario,项目名称:xen,代码行数:49,


示例26: xc_get_pfn_type_batch

int xc_get_pfn_type_batch(xc_interface *xch, uint32_t dom,                          unsigned int num, xen_pfn_t *arr){    int rc;    DECLARE_DOMCTL;    DECLARE_HYPERCALL_BOUNCE(arr, sizeof(*arr) * num, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    if ( xc_hypercall_bounce_pre(xch, arr) )        return -1;    domctl.cmd = XEN_DOMCTL_getpageframeinfo3;    domctl.domain = dom;    domctl.u.getpageframeinfo3.num = num;    set_xen_guest_handle(domctl.u.getpageframeinfo3.array, arr);    rc = do_domctl_retry_efault(xch, &domctl);    xc_hypercall_bounce_post(xch, arr);    return rc;}
开发者ID:tklengyel,项目名称:xen,代码行数:16,


示例27: xc_tmem_control_oid

int xc_tmem_control_oid(xc_interface *xch,                        int32_t pool_id,                        uint32_t cmd,                        uint32_t cli_id,                        uint32_t len,                        uint32_t arg,                        struct xen_tmem_oid oid,                        void *buf){    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(buf, len, XC_HYPERCALL_BUFFER_BOUNCE_OUT);    int rc;    sysctl.cmd = XEN_SYSCTL_tmem_op;    sysctl.u.tmem_op.pool_id = pool_id;    sysctl.u.tmem_op.cmd = cmd;    sysctl.u.tmem_op.cli_id = cli_id;    sysctl.u.tmem_op.len = len;    sysctl.u.tmem_op.arg = arg;    sysctl.u.tmem_op.pad = 0;    sysctl.u.tmem_op.oid = oid;    if ( len  )    {        if ( buf == NULL )        {            errno = EINVAL;            return -1;        }        if ( xc_hypercall_bounce_pre(xch, buf) )        {            PERROR("Could not bounce buffer for tmem control (OID) hypercall");            return -1;        }    }    set_xen_guest_handle(sysctl.u.tmem_op.u.buf, buf);    rc = do_sysctl(xch, &sysctl);    if ( len )        xc_hypercall_bounce_post(xch, buf);    return rc;}
开发者ID:Xilinx,项目名称:xen,代码行数:45,


示例28: xc_livepatch_get

int xc_livepatch_get(xc_interface *xch,                     char *name,                     xen_livepatch_status_t *status){    int rc;    DECLARE_SYSCTL;    DECLARE_HYPERCALL_BOUNCE(name, 0 /*adjust later */, XC_HYPERCALL_BUFFER_BOUNCE_IN);    xen_livepatch_name_t def_name = { .pad = { 0, 0, 0 } };    if ( !name )    {        errno = EINVAL;        return -1;    }    def_name.size = strlen(name) + 1;    if ( def_name.size > XEN_LIVEPATCH_NAME_SIZE )    {        errno = EINVAL;        return -1;    }    HYPERCALL_BOUNCE_SET_SIZE(name, def_name.size);    if ( xc_hypercall_bounce_pre(xch, name) )        return -1;    sysctl.cmd = XEN_SYSCTL_livepatch_op;    sysctl.u.livepatch.cmd = XEN_SYSCTL_LIVEPATCH_GET;    sysctl.u.livepatch.pad = 0;    sysctl.u.livepatch.u.get.status.state = 0;    sysctl.u.livepatch.u.get.status.rc = 0;    sysctl.u.livepatch.u.get.name = def_name;    set_xen_guest_handle(sysctl.u.livepatch.u.get.name.name, name);    rc = do_sysctl(xch, &sysctl);    xc_hypercall_bounce_post(xch, name);    memcpy(status, &sysctl.u.livepatch.u.get.status, sizeof(*status));    return rc;}
开发者ID:MrVan,项目名称:xen,代码行数:45,


示例29: do_memory_op

long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len){    DECLARE_HYPERCALL_BOUNCE(arg, len, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    long ret = -1;    if ( xc_hypercall_bounce_pre(xch, arg) )    {        PERROR("Could not bounce memory for XENMEM hypercall");        goto out1;    }    ret = xencall2(xch->xcall, __HYPERVISOR_memory_op,                   cmd, HYPERCALL_BUFFER_AS_ARG(arg));    xc_hypercall_bounce_post(xch, arg); out1:    return ret;}
开发者ID:tklengyel,项目名称:xen,代码行数:18,


示例30: xc_mca_op

int xc_mca_op(xc_interface *xch, struct xen_mc *mc){    int ret = 0;    DECLARE_HYPERCALL_BOUNCE(mc, sizeof(*mc), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);    if ( xc_hypercall_bounce_pre(xch, mc) )    {        PERROR("Could not bounce xen_mc memory buffer");        return -1;    }    mc->interface_version = XEN_MCA_INTERFACE_VERSION;    ret = xencall1(xch->xcall, __HYPERVISOR_mca,                   HYPERCALL_BUFFER_AS_ARG(mc));    xc_hypercall_bounce_post(xch, mc);    return ret;}
开发者ID:MrVan,项目名称:xen,代码行数:18,



注:本文中的xc_hypercall_bounce_post函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ xc_hypercall_bounce_pre函数代码示例
C++ xc_dom_panic函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。