- unsigned long grow;
-
- grow = PAGE_SIZE >> PAGE_SHIFT;
- if (address - vma->vm_start > current->rlim[RLIMIT_STACK].rlim_cur
- || (((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) >
- current->rlim[RLIMIT_AS].rlim_cur))
- return -ENOMEM;
- if (!vx_vmpages_avail(vma->vm_mm, grow) ||
- ((vma->vm_flags & VM_LOCKED) &&
- !vx_vmlocked_avail(vma->vm_mm, grow)))
- return -ENOMEM;
- vma->vm_end += PAGE_SIZE;
- // vma->vm_mm->total_vm += grow;
- vx_vmpages_add(vma->vm_mm, grow);
- if (vma->vm_flags & VM_LOCKED)
- // vma->vm_mm->locked_vm += grow;
- vx_vmlocked_add(vma->vm_mm, grow);
- return 0;
+ struct die_args args = {
+ .regs = regs,
+ .str = str,
+ .err = err,
+ .trapnr = trap,
+ .signr = sig
+ };
+ return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);