参照元

説明

引数

返り値

参考

実装

static int ion_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
        struct ion_buffer *buffer = vma->vm_private_data;
        unsigned long pfn;
        int ret;
        mutex_lock(&buffer->lock);
        ion_buffer_page_dirty(buffer->pages + vmf->pgoff);
        BUG_ON(!buffer->pages || !buffer->pages[vmf->pgoff]);
        pfn = page_to_pfn(ion_buffer_page(buffer->pages[vmf->pgoff]));
        ret = vm_insert_pfn(vma, (unsigned long)vmf->virtual_address, pfn);
        mutex_unlock(&buffer->lock);
        if (ret)
                return VM_FAULT_ERROR;
        return VM_FAULT_NOPAGE;
}

コメント


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS