*参照元 [#m8fe8c64] #backlinks *説明 [#rf916c9a] -パス: [[linux-4.4.1/drivers/staging/android/ion/ion.c]] -FIXME: これは何? --説明 **引数 [#m37056df] -struct vm_area_struct *vma -- --[[linux-4.4.1/vm_area_struct]] --struct vm_fault *vmf -struct vm_fault *vmf -- --[[linux-4.4.1/vm_fault]] **返り値 [#oab3c9fd] -int -- **参考 [#ged39f82] *実装 [#p6f1b1a1] 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; - --[[linux-4.4.1/ion_buffer]] mutex_lock(&buffer->lock); ion_buffer_page_dirty(buffer->pages + vmf->pgoff); BUG_ON(!buffer->pages || !buffer->pages[vmf->pgoff]); - --[[linux-4.4.1/mutex_lock()]] --[[linux-4.4.1/ion_buffer_page_dirty()]] --[[linux-4.4.1/BUG_ON()]] 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; - --[[linux-4.4.1/page_to_pfn()]] --[[linux-4.4.1/ion_buffer_page()]] --[[linux-4.4.1/mutex_unlock()]] return VM_FAULT_NOPAGE; } *コメント [#u1ac01e8]