kernels/linux-2.4.0/drivers/ieee1394/video1394.c
/*
 *	This maps the vmalloced and reserved buffer to user space.
 *
 *  FIXME: 
 *  - PAGE_READONLY should suffice!?
 *  - remap_page_range is kind of inefficient for page by page remapping.
 *    But e.g. pte_alloc() does not work in modules ... :-(
 */
This maps the vmalloced and reserved buffer to user space.
FIXME:
- PAGE_READONLY should suffice!.
- remap_page_range is kind of inefficient for page by page remapping.
This maps the vmalloced and reserved buffer to user space . FIXME : - PAGE_READONLY should suffice! . - remap_page_range is kind of inefficient for page by page remapping .
int video1394_mmap(struct file *file, struct vm_area_struct *vma)
{
	struct video_card *video = 
		&video_cards[MINOR(file->f_dentry->d_inode->i_rdev)];
	struct ti_ohci *ohci;
	int res = -EINVAL;
	lock_kernel();
	ohci = video->ohci;
	PRINT(KERN_INFO, ohci->id, "mmap");
	if (video->current_ctx == NULL) {
		PRINT(KERN_ERR, ohci->id, "current iso context not set");
	} else
		res = do_iso_mmap(ohci, video->current_ctx, 
			   (char *)vma->vm_start, 
			   (unsigned long)(vma->vm_end-vma->vm_start));
	unlock_kernel();
	return res;
}
int video1394_mmap ( struct file * file , struct vm_area_struct * vma ) { struct video_card * video = & video_cards [ MINOR ( file -> f_dentry -> d_inode -> i_rdev ) ] ; struct ti_ohci * ohci ; int res = - EINVAL ; lock_kernel ( ) ; ohci = video -> ohci ; PRINT ( KERN_INFO , ohci -> id , " " ) ; if ( video -> current_ctx == NULL ) { PRINT ( KERN_ERR , ohci -> id , " " ) ; } else res = do_iso_mmap ( ohci , video -> current_ctx , ( char * ) vma -> vm_start , ( unsigned long ) ( vma -> vm_end - vma -> vm_start ) ) ; unlock_kernel ( ) ; return res ; }
This maps the vmalloced and reserved buffer to user space.
This maps the vmalloced and reserved buffer to user space .