diff options
Diffstat (limited to 'mm/nommu.c')
| -rw-r--r-- | mm/nommu.c | 23 | 
1 files changed, 18 insertions, 5 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index f670d9979a26..c072a660ec2c 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -631,23 +631,36 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)  EXPORT_SYMBOL(find_vma);  /* - * find a VMA - * - we don't extend stack VMAs under NOMMU conditions + * At least xtensa ends up having protection faults even with no + * MMU.. No stack expansion, at least.   */ -struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr) +struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, +			unsigned long addr, struct pt_regs *regs)  { -	return find_vma(mm, addr); +	struct vm_area_struct *vma; + +	mmap_read_lock(mm); +	vma = vma_lookup(mm, addr); +	if (!vma) +		mmap_read_unlock(mm); +	return vma;  }  /*   * expand a stack to a given address   * - not supported under NOMMU conditions   */ -int expand_stack(struct vm_area_struct *vma, unsigned long address) +int expand_stack_locked(struct vm_area_struct *vma, unsigned long addr)  {  	return -ENOMEM;  } +struct vm_area_struct *expand_stack(struct mm_struct *mm, unsigned long addr) +{ +	mmap_read_unlock(mm); +	return NULL; +} +  /*   * look up the first VMA exactly that exactly matches addr   * - should be called with mm->mmap_lock at least held readlocked  |