} else {
if (fault & VM_FAULT_SIGBUS)
do_sigbus(regs, error_code, address);
- else if (fault & VM_FAULT_SIGSEGV)
- bad_area(regs, error_code, address);
else
BUG();
}
struct mm_struct *mm;
struct vm_area_struct * vma;
int fault;
- unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
+ int write = error_code & FAULT_CODE_WRITE;
+ unsigned int flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
+ (write ? FAULT_FLAG_WRITE : 0));
tsk = current;
mm = tsk->mm;
set_thread_fault_code(error_code);
- if (user_mode(regs))
- flags |= FAULT_FLAG_USER;
- if (error_code & FAULT_CODE_WRITE)
- flags |= FAULT_FLAG_WRITE;
-
/*
* If for any reason at all we couldn't handle the fault,
* make sure we exit gracefully rather than endlessly redo