Exemple #1
0
int mem_paging_memop(struct domain *d, xen_mem_event_op_t *mec)
{
    if ( unlikely(!d->mem_event->paging.ring_page) )
        return -ENODEV;

    switch( mec->op )
    {
    case XENMEM_paging_op_nominate:
    {
        unsigned long gfn = mec->gfn;
        return p2m_mem_paging_nominate(d, gfn);
    }
    break;

    case XENMEM_paging_op_evict:
    {
        unsigned long gfn = mec->gfn;
        return p2m_mem_paging_evict(d, gfn);
    }
    break;

    case XENMEM_paging_op_prep:
    {
        unsigned long gfn = mec->gfn;
        return p2m_mem_paging_prep(d, gfn, mec->buffer);
    }
    break;

    default:
        return -ENOSYS;
        break;
    }
}
Exemple #2
0
int mem_paging_memop(struct domain *d, xen_mem_paging_op_t *mpo)
{
    int rc = -ENODEV;
    if ( unlikely(!d->vm_event->paging.ring_page) )
        return rc;

    switch( mpo->op )
    {
    case XENMEM_paging_op_nominate:
        rc = p2m_mem_paging_nominate(d, mpo->gfn);
        break;

    case XENMEM_paging_op_evict:
        rc = p2m_mem_paging_evict(d, mpo->gfn);
        break;

    case XENMEM_paging_op_prep:
        rc = p2m_mem_paging_prep(d, mpo->gfn, mpo->buffer);
        break;

    default:
        rc = -ENOSYS;
        break;
    }

    return rc;
}