kernels/linux-2.4.0/arch/arm/kernel/ecard.c
/* to be removed when exec_mmap becomes extern */
to be removed when exec_mmap becomes extern
to be removed when exec_mmap becomes extern
static int exec_mmap(void)
{
	struct mm_struct * mm, * old_mm;
	old_mm = current->mm;
	if (old_mm && atomic_read(&old_mm->mm_users) == 1) {
		flush_cache_mm(old_mm);
		mm_release();
		exit_mmap(old_mm);
		flush_tlb_mm(old_mm);
		return 0;
	}
	mm = mm_alloc();
	if (mm) {
		struct mm_struct *active_mm = current->active_mm;
		current->mm = mm;
		current->active_mm = mm;
		activate_mm(active_mm, mm);
		mm_release();
		if (old_mm) {
			if (active_mm != old_mm) BUG();
			mmput(old_mm);
			return 0;
		}
		mmdrop(active_mm);
		return 0;
	}
	return -ENOMEM;
}
static int exec_mmap ( void ) { struct mm_struct * mm , * old_mm ; old_mm = current -> mm ; if ( old_mm && atomic_read ( & old_mm -> mm_users ) == 1 ) { flush_cache_mm ( old_mm ) ; mm_release ( ) ; exit_mmap ( old_mm ) ; flush_tlb_mm ( old_mm ) ; return 0 ; } mm = mm_alloc ( ) ; if ( mm ) { struct mm_struct * active_mm = current -> active_mm ; current -> mm = mm ; current -> active_mm = mm ; activate_mm ( active_mm , mm ) ; mm_release ( ) ; if ( old_mm ) { if ( active_mm != old_mm ) BUG ( ) ; mmput ( old_mm ) ; return 0 ; } mmdrop ( active_mm ) ; return 0 ; } return - ENOMEM ; }
to be removed when exec_mmap becomes extern
to be removed when exec_mmap becomes extern